@nrwl/workspace 13.4.5-beta.3 → 13.4.5-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/package.json +5 -6
  2. package/src/command-line/affected.js +1 -1
  3. package/src/command-line/affected.js.map +1 -1
  4. package/src/command-line/dep-graph.js +12 -8
  5. package/src/command-line/dep-graph.js.map +1 -1
  6. package/src/command-line/format.js +13 -14
  7. package/src/command-line/format.js.map +1 -1
  8. package/src/command-line/nx-commands.js +1 -1
  9. package/src/command-line/nx-commands.js.map +1 -1
  10. package/src/core/dep-graph/3rdpartylicenses.txt +89 -7
  11. package/src/core/dep-graph/main.esm.js +1 -1
  12. package/src/core/dep-graph/main.esm.js.LICENSE.txt +0 -36
  13. package/src/core/dep-graph/styles.css +3 -1
  14. package/src/core/file-utils.d.ts +1 -3
  15. package/src/core/file-utils.js +4 -18
  16. package/src/core/file-utils.js.map +1 -1
  17. package/src/core/hasher/file-hasher-base.js +3 -0
  18. package/src/core/hasher/file-hasher-base.js.map +1 -1
  19. package/src/core/hasher/hasher.js +1 -0
  20. package/src/core/hasher/hasher.js.map +1 -1
  21. package/src/core/nx-deps/nx-deps-cache.js +1 -1
  22. package/src/core/nx-deps/nx-deps-cache.js.map +1 -1
  23. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.d.ts +0 -1
  24. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js +23 -18
  25. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js.map +1 -1
  26. package/src/core/target-project-locator.js +15 -6
  27. package/src/core/target-project-locator.js.map +1 -1
  28. package/src/generators/npm-package/npm-package.js +1 -0
  29. package/src/generators/npm-package/npm-package.js.map +1 -1
  30. package/src/generators/workspace/files/__workspaceFile__.json__tmpl__ +0 -5
  31. package/src/tasks-runner/cache.d.ts +2 -1
  32. package/src/tasks-runner/cache.js +8 -4
  33. package/src/tasks-runner/cache.js.map +1 -1
  34. package/src/tasks-runner/neo-output/render.js +2 -2
  35. package/src/tasks-runner/neo-output/render.js.map +1 -1
  36. package/src/tasks-runner/run-command.js +5 -1
  37. package/src/tasks-runner/run-command.js.map +1 -1
  38. package/src/tasks-runner/run-many-terminal-output-life-cycle.js +4 -1
  39. package/src/tasks-runner/run-many-terminal-output-life-cycle.js.map +1 -1
  40. package/src/tasks-runner/run-one-terminal-output-life-cycle.js +4 -1
  41. package/src/tasks-runner/run-one-terminal-output-life-cycle.js.map +1 -1
  42. package/src/tasks-runner/task-orchestrator.js +18 -7
  43. package/src/tasks-runner/task-orchestrator.js.map +1 -1
  44. package/src/tasks-runner/task-profiling-life-cycle.d.ts +19 -0
  45. package/src/tasks-runner/task-profiling-life-cycle.js +67 -0
  46. package/src/tasks-runner/task-profiling-life-cycle.js.map +1 -0
  47. package/src/tasks-runner/task-timings-life-cycle.d.ts +3 -10
  48. package/src/tasks-runner/task-timings-life-cycle.js +3 -56
  49. package/src/tasks-runner/task-timings-life-cycle.js.map +1 -1
  50. package/src/tasks-runner/tasks-runner-v2.js +3 -1
  51. package/src/tasks-runner/tasks-runner-v2.js.map +1 -1
  52. package/src/tasks-runner/tasks-runner.d.ts +1 -1
  53. package/src/utils/ast-utils.js.map +1 -1
  54. package/src/utils/versions.js +1 -1
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see main.esm.js.LICENSE.txt */
2
- (self.webpackChunk=self.webpackChunk||[]).push([[179],{"0K9E":(e,t,n)=>{"use strict";var r=n("ERkP"),i=n("7nmT"),o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=n("IXFX"),s=n("4K4U"),l=n("QzV0"),u=n.n(l);function c(e){return"function"==typeof e?e():e}function d(e){try{return JSON.stringify(e)}catch(t){return u()(e)}}var f=new Map;var p={url:"https://statecharts.io/inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e,t,n=(e=new Set,t=new Set,{services:e,register:function(n){e.add(n),f.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),f.delete(n.sessionId)}))},unregister:function(t){e.delete(t),f.delete(t.sessionId)},onRegister:function(n){return t.add(n),e.forEach((function(e){return n(e)})),{unsubscribe:function(){t.delete(n)}}}});return globalThis.__xstate__=n,n}};var h="top",v="bottom",g="right",y="left",m="auto",b=[h,v,g,y],x="start",w="end",E="viewport",k="popper",S=b.reduce((function(e,t){return e.concat([t+"-"+x,t+"-"+w])}),[]),P=[].concat(b,[m]).reduce((function(e,t){return e.concat([t,t+"-"+x,t+"-"+w])}),[]),_=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function C(e){return e?(e.nodeName||"").toLowerCase():null}function j(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function T(e){return e instanceof j(e).Element||e instanceof Element}function D(e){return e instanceof j(e).HTMLElement||e instanceof HTMLElement}function O(e){return"undefined"!=typeof ShadowRoot&&(e instanceof j(e).ShadowRoot||e instanceof ShadowRoot)}const N={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];D(i)&&C(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(r)&&C(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var L=Math.max,A=Math.min,I=Math.round;function B(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(D(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=I(n.width)/a||1),o>0&&(i=I(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function z(e){var t=B(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function R(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&O(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function F(e){return j(e).getComputedStyle(e)}function V(e){return["table","td","th"].indexOf(C(e))>=0}function G(e){return((T(e)?e.ownerDocument:e.document)||window.document).documentElement}function U(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(O(e)?e.host:null)||G(e)}function W(e){return D(e)&&"fixed"!==F(e).position?e.offsetParent:null}function q(e){for(var t=j(e),n=W(e);n&&V(n)&&"static"===F(n).position;)n=W(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===F(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&D(e)&&"fixed"===F(e).position)return null;for(var n=U(e);D(n)&&["html","body"].indexOf(C(n))<0;){var r=F(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function H(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Y(e,t,n){return L(e,A(t,n))}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function K(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=M(n.placement),l=H(s),u=[y,g].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:K(e,b))}(i.padding,n),d=z(o),f="y"===l?h:y,p="y"===l?v:g,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],x=a[l]-n.rects.reference[l],w=q(o),E=w?"y"===l?w.clientHeight||0:w.clientWidth||0:0,k=m/2-x/2,S=c[f],P=E-d[u]-c[p],_=E/2-d[u]/2+k,C=Y(S,_,P),j=l;n.modifiersData[r]=((t={})[j]=C,t.centerOffset=C-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&R(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(e){return e.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:I(t*r)/r||0,y:I(n*r)/r||0}}(a):"function"==typeof c?c(a):a,p=f.x,m=void 0===p?0:p,b=f.y,x=void 0===b?0:b,E=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),S=y,P=h,_=window;if(u){var C=q(n),T="clientHeight",D="clientWidth";if(C===j(n)&&"static"!==F(C=G(n)).position&&"absolute"===s&&(T="scrollHeight",D="scrollWidth"),C=C,i===h||(i===y||i===g)&&o===w)P=v,x-=(d&&_.visualViewport?_.visualViewport.height:C[T])-r.height,x*=l?1:-1;if(i===y||(i===h||i===v)&&o===w)S=g,m-=(d&&_.visualViewport?_.visualViewport.width:C[D])-r.width,m*=l?1:-1}var O,N=Object.assign({position:s},u&&Z);return l?Object.assign({},N,((O={})[P]=k?"0":"",O[S]=E?"0":"",O.transform=(_.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",O)):Object.assign({},N,((t={})[P]=k?x+"px":"",t[S]=E?m+"px":"",t.transform="",t))}const ee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,u={placement:M(t.placement),variation:$(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var te={passive:!0};const ne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=j(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,te)})),s&&l.addEventListener("resize",n.update,te),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,te)})),s&&l.removeEventListener("resize",n.update,te)}},data:{}};var re={left:"right",right:"left",bottom:"top",top:"bottom"};function ie(e){return e.replace(/left|right|bottom|top/g,(function(e){return re[e]}))}var oe={start:"end",end:"start"};function ae(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e){var t=j(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return B(G(e)).left+se(e).scrollLeft}function ue(e){var t=F(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ce(e){return["html","body","#document"].indexOf(C(e))>=0?e.ownerDocument.body:D(e)&&ue(e)?e:ce(U(e))}function de(e,t){var n;void 0===t&&(t=[]);var r=ce(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=j(r),a=i?[o].concat(o.visualViewport||[],ue(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(de(U(a)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function pe(e,t){return t===E?fe(function(e){var t=j(e),n=G(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+le(e),y:s}}(e)):T(t)?function(e){var t=B(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):fe(function(e){var t,n=G(e),r=se(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=L(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=L(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+le(e),l=-r.scrollTop;return"rtl"===F(i||n).direction&&(s+=L(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(G(e)))}function he(e,t,n){var r="clippingParents"===t?function(e){var t=de(U(e)),n=["absolute","fixed"].indexOf(F(e).position)>=0,r=n&&D(e)?q(e):e;return T(r)?t.filter((function(e){return T(e)&&R(e,r)&&"body"!==C(e)&&(!n||"static"!==F(e).position)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=pe(e,n);return t.top=L(r.top,t.top),t.right=A(r.right,t.right),t.bottom=A(r.bottom,t.bottom),t.left=L(r.left,t.left),t}),pe(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?M(i):null,a=i?$(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case h:t={x:s,y:n.y-r.height};break;case v:t={x:s,y:n.y+n.height};break;case g:t={x:n.x+n.width,y:l};break;case y:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?H(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case x:t[u]=t[u]-(n[c]/2-r[c]/2);break;case w:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,l=void 0===s?E:s,u=n.elementContext,c=void 0===u?k:u,d=n.altBoundary,f=void 0!==d&&d,p=n.padding,y=void 0===p?0:p,m=X("number"!=typeof y?y:K(y,b)),x=c===k?"reference":k,w=e.rects.popper,S=e.elements[f?x:c],P=he(T(S)?S:S.contextElement||G(e.elements.popper),a,l),_=B(e.elements.reference),C=ve({reference:_,element:w,strategy:"absolute",placement:i}),j=fe(Object.assign({},w,C)),D=c===k?j:_,O={top:P.top-D.top+m.top,bottom:D.bottom-P.bottom+m.bottom,left:P.left-D.left+m.left,right:D.right-P.right+m.right},N=e.modifiersData.offset;if(c===k&&N){var M=N[i];Object.keys(O).forEach((function(e){var t=[g,v].indexOf(e)>=0?1:-1,n=[h,v].indexOf(e)>=0?"y":"x";O[e]+=M[n]*t}))}return O}const ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,w=void 0===p||p,E=n.allowedAutoPlacements,k=t.options.placement,_=M(k),C=l||(_===k||!w?[ie(k)]:function(e){if(M(e)===m)return[];var t=ie(e);return[ae(e),t,ae(t)]}(k)),j=[k].concat(C).reduce((function(e,n){return e.concat(M(n)===m?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?P:l,c=$(r),d=c?s?S:S.filter((function(e){return $(e)===c})):b,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[M(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:E}):n)}),[]),T=t.rects.reference,D=t.rects.popper,O=new Map,N=!0,L=j[0],A=0;A<j.length;A++){var I=j[A],B=M(I),z=$(I)===x,R=[h,v].indexOf(B)>=0,F=R?"width":"height",V=ge(t,{placement:I,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),G=R?z?g:y:z?v:h;T[F]>D[F]&&(G=ie(G));var U=ie(G),W=[];if(o&&W.push(V[B]<=0),s&&W.push(V[G]<=0,V[U]<=0),W.every((function(e){return e}))){L=I,N=!1;break}O.set(I,W)}if(N)for(var q=function(e){var t=j.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return L=t,"break"},H=w?3:1;H>0;H--){if("break"===q(H))break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function me(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function be(e){return[h,g,v,y].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ge(t,{elementContext:"reference"}),s=ge(t,{altBoundary:!0}),l=me(a,r),u=me(s,i,o),c=be(l),d=be(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};const we={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=P.reduce((function(e,n){return e[n]=function(e,t,n){var r=M(e),i=[y,h].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[y,g].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}};const Ee={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,m=n.tetherOffset,b=void 0===m?0:m,w=ge(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),E=M(t.placement),k=$(t.placement),S=!k,P=H(E),_="x"===P?"y":"x",C=t.modifiersData.popperOffsets,j=t.rects.reference,T=t.rects.popper,D="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,O="number"==typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(C){if(o){var B,R="y"===P?h:y,F="y"===P?v:g,V="y"===P?"height":"width",G=C[P],U=G+w[R],W=G-w[F],X=p?-T[V]/2:0,K=k===x?j[V]:T[V],Q=k===x?-T[V]:-j[V],Z=t.elements.arrow,J=p&&Z?z(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[R],ne=ee[F],re=Y(0,j[V],J[V]),ie=S?j[V]/2-X-re-te-O.mainAxis:K-re-te-O.mainAxis,oe=S?-j[V]/2+X+re+ne+O.mainAxis:Q+re+ne+O.mainAxis,ae=t.elements.arrow&&q(t.elements.arrow),se=ae?"y"===P?ae.clientTop||0:ae.clientLeft||0:0,le=null!=(B=null==N?void 0:N[P])?B:0,ue=G+oe-le,ce=Y(p?A(U,G+ie-le-se):U,G,p?L(W,ue):W);C[P]=ce,I[P]=ce-G}if(s){var de,fe="x"===P?h:y,pe="x"===P?v:g,he=C[_],ve="y"===_?"height":"width",ye=he+w[fe],me=he-w[pe],be=-1!==[h,y].indexOf(E),xe=null!=(de=null==N?void 0:N[_])?de:0,we=be?ye:he-j[ve]-T[ve]-xe+O.altAxis,Ee=be?he+j[ve]+T[ve]-xe-O.altAxis:me,ke=p&&be?function(e,t,n){var r=Y(e,t,n);return r>n?n:r}(we,he,Ee):Y(p?we:ye,he,p?Ee:me);C[_]=ke,I[_]=ke-he}t.modifiersData[r]=I}},requiresIfExists:["offset"]};function Se(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=I(t.width)/e.offsetWidth||1,r=I(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=G(t),l=B(e,a),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==C(t)||ue(s))&&(u=(r=t)!==j(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:se(r)),D(t)?((c=B(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=le(s))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Pe(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var _e={placement:"bottom",modifiers:[],strategy:"absolute"};function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function je(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?_e:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},_e,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:T(e)?de(e):e.contextElement?de(e.contextElement):[],popper:de(t)};var a=function(e){var t=Pe(e);return _.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r}),a=function(){};l.push(o||a)}})),c.update()},forceUpdate:function(){if(!u){var e=s.elements,t=e.reference,n=e.popper;if(Ce(t,n)){s.rects={reference:Se(t,q(n),"fixed"===s.options.strategy),popper:z(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,l=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:l,name:d,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),u=!0}};if(!Ce(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Te=je({defaultModifiers:[ne,Ee,ee,N,we,ye,ke,Q,xe]}),De="tippy-content",Oe="tippy-backdrop",Ne="tippy-arrow",Me="tippy-svg-arrow",Le={passive:!0,capture:!0},Ae=function(){return document.body};function Ie(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Be(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ze(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Re(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Fe(e){return[].concat(e)}function Ve(e,t){-1===e.indexOf(t)&&e.push(t)}function Ge(e){return e.split("-")[0]}function Ue(e){return[].slice.call(e)}function We(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function qe(){return document.createElement("div")}function He(e){return["Element","Fragment"].some((function(t){return Be(e,t)}))}function Ye(e){return Be(e,"MouseEvent")}function Xe(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Ke(e){return He(e)?[e]:function(e){return Be(e,"NodeList")}(e)?Ue(e):Array.isArray(e)?e:Ue(document.querySelectorAll(e))}function Qe(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function $e(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ze(e){var t,n=Fe(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Je(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function et(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var tt={isTouch:!1},nt=0;function rt(){tt.isTouch||(tt.isTouch=!0,window.performance&&document.addEventListener("mousemove",it))}function it(){var e=performance.now();e-nt<20&&(tt.isTouch=!1,document.removeEventListener("mousemove",it)),nt=e}function ot(){var e=document.activeElement;if(Xe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var at=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var st={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lt=Object.assign({appendTo:Ae,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},st,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ut=Object.keys(lt);function ct(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=lt[i])?r:o);return t}),{});return Object.assign({},e,t)}function dt(e,t){var n=Object.assign({},t,{content:ze(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(ct(Object.assign({},lt,{plugins:t}))):ut).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(i){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},lt.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ft(e,t){e.innerHTML=t}function pt(e){var t=qe();return!0===e?t.className=Ne:(t.className=Me,He(e)?t.appendChild(e):ft(t,e)),t}function ht(e,t){He(t.content)?(ft(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ft(e,t.content):e.textContent=t.content)}function vt(e){var t=e.firstElementChild,n=Ue(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(De)})),arrow:n.find((function(e){return e.classList.contains(Ne)||e.classList.contains(Me)})),backdrop:n.find((function(e){return e.classList.contains(Oe)}))}}function gt(e){var t=qe(),n=qe();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=qe();function i(n,r){var i=vt(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||ht(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(pt(r.arrow))):o.appendChild(pt(r.arrow)):s&&o.removeChild(s)}return r.className=De,r.setAttribute("data-state","hidden"),ht(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}gt.$$tippy=!0;var yt=1,mt=[],bt=[];function xt(e,t){var n,r,i,o,a,s,l,u,c=dt(e,Object.assign({},lt,ct(We(t)))),d=!1,f=!1,p=!1,h=!1,v=[],g=Re(Y,c.interactiveDebounce),y=yt++,m=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:y,reference:e,popper:qe(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:m,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){0;if(b.state.isDestroyed)return;M("onBeforeUpdate",[b,t]),q();var n=b.props,r=dt(e,Object.assign({},n,We(t),{ignoreAttributes:!0}));b.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(I(),g=Re(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Fe(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");A(),N(),E&&E(n,r);b.popperInstance&&($(),J().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));M("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=tt.isTouch&&!b.props.touch,i=Ie(b.props.duration,0,lt.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(M("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,C()&&(w.style.visibility="visible");N(),F(),b.state.isMounted||(w.style.transition="none");if(C()){var o=D(),a=o.box,l=o.content;Qe([a,l],0)}s=function(){var e;if(b.state.isVisible&&!h){if(h=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,C()&&b.props.animation){var t=D(),n=t.box,r=t.content;Qe([n,r],i),$e([n,r],"visible")}L(),A(),Ve(bt,b),null==(e=b.popperInstance)||e.forceUpdate(),M("onMount",[b]),b.props.animation&&C()&&function(e,t){G(e,t)}(i,(function(){b.state.isShown=!0,M("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===Ae||"parent"===t?n.parentNode:ze(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,$(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Ie(b.props.duration,1,lt.duration);if(e||t||n)return;if(M("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,h=!1,d=!1,C()&&(w.style.visibility="hidden");if(I(),V(),N(!0),C()){var i=D(),o=i.box,a=i.content;b.props.animation&&(Qe([o,a],r),$e([o,a],"hidden"))}L(),A(),b.props.animation?C()&&function(e,t){G(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ve(mt,g),g(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;Z(),J().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);bt=bt.filter((function(e){return e!==b})),b.state.isMounted=!1,M("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),q(),delete e._tippy,b.state.isDestroyed=!0,M("onDestroy",[b])}};if(!c.render)return b;var x=c.render(b),w=x.popper,E=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var k=m.map((function(e){return e.fn(b)})),S=e.hasAttribute("aria-expanded");return W(),A(),N(),M("onCreate",[b]),c.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&T().addEventListener("mousemove",g)})),b;function P(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===P()[0]}function C(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return l||e}function T(){var e=j().parentNode;return e?Ze(e):document}function D(){return vt(w)}function O(e){return b.state.isMounted&&!b.state.isVisible||tt.isTouch||o&&"focus"===o.type?0:Ie(b.props.delay,e?0:1,lt.delay)}function N(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function M(e,t,n){var r;(void 0===n&&(n=!0),k.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function L(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;Fe(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function A(){!S&&b.props.aria.expanded&&Fe(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function I(){T().removeEventListener("mousemove",g),mt=mt.filter((function(e){return e!==g}))}function B(t){if(!tt.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!et(w,n)){if(Fe(b.props.triggerTarget||e).some((function(e){return et(e,n)}))){if(tt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else M("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),f=!0,setTimeout((function(){f=!1})),b.state.isMounted||V())}}}function z(){p=!0}function R(){p=!1}function F(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Le),e.addEventListener("touchstart",R,Le),e.addEventListener("touchmove",z,Le)}function V(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Le),e.removeEventListener("touchstart",R,Le),e.removeEventListener("touchmove",z,Le)}function G(e,t){var n=D().box;function r(e){e.target===n&&(Je(n,"remove",r),t())}if(0===e)return t();Je(n,"remove",a),Je(n,"add",r),a=r}function U(t,n,r){void 0===r&&(r=!1),Fe(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;_()&&(U("touchstart",H,{passive:!0}),U("touchend",X,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(U(e,H),e){case"mouseenter":U("mouseleave",X);break;case"focus":U(at?"focusout":"blur",K);break;case"focusin":U("focusout",K)}}))}function q(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function H(e){var t,n=!1;if(b.state.isEnabled&&!Q(e)&&!f){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,A(),!b.state.isVisible&&Ye(e)&&mt.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||d)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function Y(e){var t=e.target,n=j().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=J().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Ge(i.placement),s=i.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,d="left"===a?s.right.x:0,f=t.top-r+l>o,p=r-t.bottom-u>o,h=t.left-n+c>o,v=n-t.right-d>o;return f||p||h||v}))})(r,e)&&(I(),te(e))}}function X(e){Q(e)||b.props.trigger.indexOf("click")>=0&&d||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function K(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function Q(e){return!!tt.isTouch&&_()!==e.type.indexOf("touch")>=0}function $(){Z();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,l=C()?vt(w).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=D().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},c];C()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),b.popperInstance=Te(u,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:d}))}function Z(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function J(){return Ue(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&M("onTrigger",[b,e]),F();var t=O(!0),r=P(),i=r[0],o=r[1];tt.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),M("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=O(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else V()}}function wt(e,t){void 0===t&&(t={});var n=lt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",rt,Le),window.addEventListener("blur",ot);var r=Object.assign({},t,{plugins:n}),i=Ke(e).reduce((function(e,t){var n=t&&xt(t,r);return n&&e.push(n),e}),[]);return He(e)?i[0]:i}wt.defaultProps=lt,wt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){lt[t]=e[t]}))},wt.currentInput=tt;Object.assign({},N,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});wt.setDefaultProps({render:gt});const Et=wt;function kt(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var St="undefined"!=typeof window&&"undefined"!=typeof document;function Pt(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function _t(){return St&&document.createElement("div")}function Ct(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!t.hasOwnProperty(n))return!1;if(!Ct(e[n],t[n]))return!1}return!0}return!1}function jt(e){var t=[];return e.forEach((function(e){t.find((function(t){return Ct(e,t)}))||t.push(e)})),t}function Tt(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:jt([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]))})})}var Dt=St?r.useLayoutEffect:r.useEffect;function Ot(e){var t=(0,r.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Nt(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var Mt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||Nt(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&Nt(t,"remove",e.props.className)},onAfterUpdate:r}}};function Lt(e){return function(t){var n=t.children,o=t.content,a=t.visible,s=t.singleton,l=t.render,u=t.reference,c=t.disabled,d=void 0!==c&&c,f=t.ignoreAttributes,p=void 0===f||f,h=(t.__source,t.__self,kt(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),v=void 0!==a,g=void 0!==s,y=(0,r.useState)(!1),m=y[0],b=y[1],x=(0,r.useState)({}),w=x[0],E=x[1],k=(0,r.useState)(),S=k[0],P=k[1],_=Ot((function(){return{container:_t(),renders:1}})),C=Object.assign({ignoreAttributes:p},h,{content:_.container});v&&(C.trigger="manual",C.hideOnClick=!1),g&&(d=!0);var j=C,T=C.plugins||[];l&&(j=Object.assign({},C,{plugins:g&&null!=s.data?[].concat(T,[{fn:function(){return{onTrigger:function(e,t){var n=s.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,P(n.content)}}}}]):T,render:function(){return{popper:_.container}}}));var D=[u].concat(n?[n.type]:[]);return Dt((function(){var t=u;u&&u.hasOwnProperty("current")&&(t=u.current);var n=e(t||_.ref||_t(),Object.assign({},j,{plugins:[Mt].concat(C.plugins||[])}));return _.instance=n,d&&n.disable(),a&&n.show(),g&&s.hook({instance:n,content:o,props:j,setSingletonContent:P}),b(!0),function(){n.destroy(),null==s||s.cleanup(n)}}),D),Dt((function(){var e;if(1!==_.renders){var t=_.instance;t.setProps(Tt(t.props,j)),null==(e=t.popperInstance)||e.forceUpdate(),d?t.disable():t.enable(),v&&(a?t.show():t.hide()),g&&s.hook({instance:t,content:o,props:j,setSingletonContent:P})}else _.renders++})),Dt((function(){var e;if(l){var t=_.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;w.placement===n.placement&&w.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&w.escaped===(null==r?void 0:r.hasPopperEscaped)||E({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[w.placement,w.referenceHidden,w.escaped].concat(D)),r.createElement(r.Fragment,null,n?(0,r.cloneElement)(n,{ref:function(e){_.ref=e,Pt(n.ref,e)}}):null,m&&(0,i.createPortal)(l?l(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(w),S,_.instance):o,_.container))}}var At=function(e,t){return(0,r.forwardRef)((function(n,i){var o=n.children,a=kt(n,["children"]);return r.createElement(e,Object.assign({},t,a),o?(0,r.cloneElement)(o,{ref:function(e){Pt(i,e),Pt(o.ref,e)}}):null)}))};const It=At(Lt(Et));var Bt=n("jg1C");const zt=(0,r.memo)((function({projectGraphs:e,selectedProjectGraph:t,projectGraphChange:n,lastPerfReport:r}){return(0,Bt.jsxs)("div",{id:"debugger-panel",className:" w-auto text-gray-700 bg-gray-50 border-b border-gray-200 p-4 flex flex-column items-center justify-items-center gap-4 ",children:[(0,Bt.jsx)("h4",{className:"text-lg font-bold mr-4",children:"Debugger"}),(0,Bt.jsx)("select",{className:"w-auto flex items-center px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white","data-cy":"project-select",onChange:e=>n(e.target.value),value:t,children:e.map((e=>(0,Bt.jsx)("option",{value:e.id,children:e.label},e.id)))}),(0,Bt.jsxs)("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",(0,Bt.jsxs)("b",{className:"font-mono text-medium",children:[r.numNodes," nodes"]})," ","|"," ",(0,Bt.jsxs)("b",{className:"font-mono text-medium",children:[r.numEdges," edges"]}),"."]})]})}));var Rt=n("t6Oc"),Ft=n("rFOX"),Vt=n.n(Ft),Gt=n("Ded0"),Ut=n.n(Gt),Wt=n("CQyY"),qt=n.n(Wt);class Ht{constructor(e){this.node=e}render(){const e=document.createElement("div"),t=this.createHeader(),n=this.createTags(),r=this.createButtons();return e.appendChild(t),e.appendChild(n),e.appendChild(r),e}createHeader(){const e=document.createElement("h4"),t=document.createElement("span"),n=document.createTextNode(this.node.attr("id"));return t.classList.add("tag"),t.innerText=this.node.attr("type"),e.appendChild(t),e.appendChild(n),e}createTags(){var e,t;const n=document.createElement("p"),r=document.createElement("strong"),i=document.createTextNode(null!=(e=null==(t=this.node.attr("tags"))?void 0:t.join(", "))?e:"");return r.innerText="tags",n.appendChild(r),n.appendChild(document.createElement("br")),n.appendChild(i),n}createButtons(){const e=document.createElement("div"),t=document.createElement("button"),n=document.createElement("button");e.classList.add("flex");const r=pn();return t.addEventListener("click",(()=>r.send({type:"focusProject",projectName:this.node.attr("id")}))),t.innerText="Focus",n.addEventListener("click",(()=>{r.send({type:"deselectProject",projectName:this.node.attr("id")})})),n.innerText="Exclude",e.appendChild(t),e.appendChild(n),e}}let Yt;!function(e){e.blue="hsla(214, 62%, 21%, 1)",e.green="hsla(162, 47%, 50%, 1)",e.lightBlue="hsla(192, 75%, 59%, 1)",e.gray="hsla(0, 0%, 92%, 1)",e.darkGray="hsla(0, 0%, 72%, 1)",e.black="hsla(220, 9%, 46%, 1)",e.red="hsla(347, 92%, 65%, 1)",e.white="#fff"}(Yt||(Yt={}));const Xt=[{selector:"edge",style:{width:"1px","line-color":Yt.black,"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":Yt.black}},{selector:"edge.affected",style:{"line-color":Yt.red,"target-arrow-color":Yt.red,"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","edge-text-rotation":"autorotate","curve-style":"unbundled-bezier"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}}],Kt=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',"border-style":"solid","border-color":Yt.darkGray,"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:Yt.black,label:"data(id)",width:"label",backgroundColor:Yt.white,"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out"}},{selector:'node[type="app"]',style:{shape:"round-rectangle"}},{selector:'node[type="lib"]',style:{shape:"round-rectangle"}},{selector:'node[type="e2e"]',style:{shape:"round-rectangle"}},{selector:"node.focused",style:{color:Yt.white,"border-color":Yt.gray,backgroundColor:Yt.green}},{selector:"node.affected",style:{color:Yt.white,"border-color":Yt.gray,backgroundColor:Yt.red}},{selector:":parent",style:{"background-opacity":.5,"background-color":Yt.gray,"border-color":Yt.darkGray,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:Yt.white,"border-color":Yt.gray,backgroundColor:Yt.blue}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"edge.highlight",style:{"mid-target-arrow-color":Yt.blue}},{selector:"edge.transparent",style:{opacity:.2}}];class Qt{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target}},t.classes=null!=(e=this.dep.type)?e:"",this.affected&&(t.classes+=" affected"),t}}class $t{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}function Zt(e){return e.replace(/\/$/,"")}function Jt(e,t){const n=Zt(e).split("/");return n[0]===Zt(t)&&n.shift(),n.pop(),n}class en{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null}}getClasses(){var e;let t=null!=(e=this.project.type)?e:"";return this.affected&&(t+=" affected"),t}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return Jt(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:`dir-${r}`,parentId:t>0?`dir-${[...n].slice(0,t).join("/")}`:null}}))}}class tn{constructor(e,t){this.tooltipService=e,this.containerId=t,this.traversalGraph=void 0,this.renderGraph=void 0,this.openTooltip=null,Vt().use(Ut()),Vt().use(qt())}handleEvent(e){const t=Date.now();switch(this.renderGraph&&"notifyGraphUpdateGraph"!==e.type&&this.renderGraph.nodes(".focused").removeClass("focused"),this.tooltipService.hideAll(),e.type){case"notifyGraphInitGraph":this.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects);break;case"notifyGraphUpdateGraph":this.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects),this.setShownProjects(e.selectedProjects);break;case"notifyGraphFocusProject":this.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":this.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProject":this.showProjects([e.projectName]);break;case"notifyGraphHideProject":this.hideProject(e.projectName);break;case"notifyGraphShowAllProjects":this.showAllProjects();break;case"notifyGraphHideAllProjects":this.hideAllProjects();break;case"notifyGraphShowAffectedProjects":this.showAffectedProjects()}let n=[],r={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph){this.renderGraph.elements().sort(((e,t)=>e.id().localeCompare(t.id()))).layout({name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"}).run(),this.renderGraph.fit().center().resize(),n=this.renderGraph.nodes('[type!="dir"]').map((e=>e.id()));r={renderTime:Date.now()-t,numNodes:this.renderGraph.nodes().length,numEdges:this.renderGraph.edges().length}}return{selectedProjectNames:n,perfReport:r}}setShownProjects(e){let t=this.traversalGraph.collection();e.forEach((e=>{t=t.union(this.traversalGraph.$id(e))}));const n=t.ancestors(),r=t.union(n),i=r.edgesTo(r);this.transferToRenderGraph(r.union(i))}showProjects(e){var t,n;const r=null!=(t=null==(n=this.renderGraph)?void 0:n.nodes())?t:this.traversalGraph.collection();let i=this.traversalGraph.collection();e.forEach((e=>{i=i.union(this.traversalGraph.$id(e))}));const o=i.ancestors(),a=r.union(i).union(o),s=a.edgesTo(a);this.transferToRenderGraph(a.union(s))}hideProject(e){var t,n;const r=null!=(t=null==(n=this.renderGraph)?void 0:n.nodes())?t:this.traversalGraph.collection(),i=this.renderGraph.$id(e),o=r.difference(i).difference(i.ancestors()),a=o.ancestors();let s=o.union(a);const l=s.edgesTo(s);this.transferToRenderGraph(s.union(l))}showAffectedProjects(){const e=this.traversalGraph.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);this.transferToRenderGraph(n.union(r))}focusProject(e,t=1){const n=this.traversalGraph.$id(e),r=this.includeProjectsByDepth(n,t),i=n.union(r),o=i.ancestors(),a=i.union(o),s=a.edgesTo(a);this.transferToRenderGraph(a.union(s)),this.renderGraph.$id(e).addClass("focused")}showAllProjects(){this.transferToRenderGraph(this.traversalGraph.elements())}hideAllProjects(){this.transferToRenderGraph(this.traversalGraph.collection())}filterProjectsByText(e,t,n=-1){if(""===e)this.transferToRenderGraph(this.traversalGraph.collection());else{const r=e.split(",");let i=this.traversalGraph.nodes().filter((e=>r.findIndex((t=>e.id().includes(t)))>-1));t&&(i=i.union(this.includeProjectsByDepth(i,n))),i=i.union(i.ancestors());const o=i.edgesTo(i);this.transferToRenderGraph(i.union(o))}}transferToRenderGraph(e){let t;this.renderGraph&&(t=this.renderGraph.nodes(".focused").first().id(),this.renderGraph.destroy(),delete this.renderGraph);const n=document.getElementById(this.containerId);this.renderGraph=Vt()({container:n,headless:!n,boxSelectionEnabled:!1,style:[...Kt,...Xt]}),this.renderGraph.add(e),t&&this.renderGraph.$id(t).addClass("focused"),this.renderGraph.on("zoom",(()=>{this.openTooltip&&(this.openTooltip.hide(),this.openTooltip=null)})),this.listenForProjectNodeClicks(),this.listenForProjectNodeHovers()}includeProjectsByDepth(e,t=-1){let n=this.traversalGraph.collection();if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}let r=this.traversalGraph.collection();if(-1===t)r=e.successors();else{r=e.outgoers();for(let e=1;e<t;e++)r=r.union(r.outgoers())}return e.union(n).union(r)}initGraph(e,t,n,r,i){this.tooltipService.hideAll(),this.generateCytoscapeLayout(e,t,n,r,i)}generateCytoscapeLayout(e,t,n,r,i){const o=this.createElements(e,t,n,r,i);this.traversalGraph=Vt()({headless:!0,elements:[...o],boxSelectionEnabled:!1,style:[...Kt,...Xt]})}createElements(e,t,n,r,i){let o=[];const a=e.map((e=>e.name)),s=[],l=[],u={};e.forEach((e=>{const o="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,c=new en(e,o);if(c.affected=i.includes(e.name),s.push(c),r[e.name].forEach((e=>{if(a.includes(e.target)){const t=new Qt(e);l.push(t)}})),t){c.getAncestors().forEach((e=>u[e.id]=e))}}));const c=s.map((e=>e.getCytoscapeNodeDef(t))),d=l.map((e=>e.getCytosacpeNodeDef()));if(o=c.concat(d),t){o=Object.keys(u).map((e=>new $t(u[e]).getCytoscapeNodeDef())).concat(o)}return o}listenForProjectNodeClicks(){this.renderGraph.$("node:childless").on("click",(e=>{const t=e.target;let n=t.popperRef();const r=new Ht(t).render();this.openTooltip=this.tooltipService.open(n,r)}))}listenForProjectNodeHovers(){this.renderGraph.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.renderGraph.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.renderGraph.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.renderGraph.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}getImage(){return this.renderGraph.png({bg:"#fff",full:!0})}}class nn{open(e,t){let n=Et(document.createElement("div"),{trigger:"manual",theme:"nx",interactive:!0,appendTo:document.body,content:t,getReferenceClientRect:e.getBoundingClientRect});return n.show(),n}hideAll(){var e,t,n,r;n=(t=void 0===e?{}:e).exclude,r=t.duration,bt.forEach((function(e){var t=!1;if(n&&(t=Xe(n)?e.reference===n:e.popper===n.popper),!t){var i=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:i})}}))}}let rn;function on(){return rn||(rn=new tn(new nn,"cytoscape-graph")),rn}const an={on:{updateGraph:{target:"customSelected",actions:[(0,Rt.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,a.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graph})]}}},sn={entry:[(0,Rt.f0)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),"notifyGraphFocusProject"],exit:[(0,Rt.f0)((e=>{e.focusedProject=null}))],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject"]},unfocusProject:{target:"unselected"},updateGraph:{actions:["setGraph",(0,a.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graph}),"notifyGraphFocusProject"]}}},ln={entry:[(0,Rt.f0)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,Rt.f0)((e=>{e.includePath=!1,e.textFilter=""}))},setIncludeProjectsByPath:{actions:["setIncludeProjectsByPath","notifyGraphFilterProjectsByText"]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFilterProjectsByText"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFilterProjectsByText"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFilterProjectsByText"]},updateGraph:{actions:["setGraph",(0,a.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graph}),"notifyGraphFilterProjectsByText"]}}},un={entry:["notifyGraphHideAllProjects"],on:{updateGraph:{target:"customSelected",actions:[(0,Rt.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,a.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graph})]}}},cn=(e,t)=>{const n=on();t((t=>{const{selectedProjectNames:r,perfReport:i}=n.handleEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:i})}))},dn=(0,a.Machine)({id:"DepGraph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!1,groupByFolder:!1,workspaceLayout:{libsDir:"",appsDir:""},graph:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0}},states:{idle:{},unselected:un,customSelected:an,focused:sn,textFiltered:ln},on:{initGraph:{target:"unselected",actions:["setGraph",(0,a.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder})),{to:e=>e.graph})]},setSelectedProjectsFromGraph:{actions:(0,Rt.f0)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))},selectProject:{target:"customSelected",actions:["notifyGraphShowProject"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProject"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setGroupByFolder:{actions:["setGroupByFolder",(0,a.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graph})]},setIncludeProjectsByPath:{actions:[(0,Rt.f0)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1},actions:{setGroupByFolder:(0,Rt.f0)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),incrementSearchDepth:(0,Rt.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,Rt.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepthEnabled:(0,Rt.f0)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,Rt.f0)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,Rt.f0)(((e,t)=>{"initGraph"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.graph=(0,a.spawn)(cn,"graphActor"),"initGraph"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphShowProject:(0,a.send)(((e,t)=>{if("selectProject"===t.type)return{type:"notifyGraphShowProject",projectName:t.projectName}}),{to:e=>e.graph}),notifyGraphHideProject:(0,a.send)(((e,t)=>{if("deselectProject"===t.type)return{type:"notifyGraphHideProject",projectName:t.projectName}}),{to:e=>e.graph}),notifyGraphShowAllProjects:(0,a.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graph}),notifyGraphHideAllProjects:(0,a.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graph}),notifyGraphShowAffectedProjects:(0,a.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graph}),notifyGraphFocusProject:(0,a.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graph}),notifyGraphFilterProjectsByText:(0,a.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graph})}});let fn;function pn(){return fn||(fn=(0,a.interpret)(dn,{devTools:!!window.useXstateInspect}),fn.start()),fn}const hn=(0,r.createContext)({}),vn=e=>{const t=pn();return(0,Bt.jsx)(hn.Provider,{value:t,children:e.children})};function gn(){return(0,r.useContext)(hn)}var yn;!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(yn||(yn={}));const mn=r.useLayoutEffect;function bn(e){return"state"in e}var xn=n("D3Vl");var wn=function(e,t){return e===t},En=function(e){return"state"in(n=e)&&"machine"in n?0!==("status"in(t=e)?t.status:t._status)?t.state:t.machine.initialState:bn(e)?e.state:void 0;var t,n};n("Mgrw");function kn(e){return function(e,t,n,i){void 0===n&&(n=wn),void 0===i&&(i=En);var o=(0,r.useRef)(t),a=(0,r.useMemo)((function(){var r,a=i(e),s=t(a);return{getSnapshot:function(){return a},getCurrentValue:function(){return s},setCurrentValue:function(e){s=e,null==r||r()},subscribe:function(t){r=t;var i=e.subscribe((function(e){a=e;var r=o.current(e);n(s,r)||(s=r,t())}));return function(){i.unsubscribe()}}}}),[e]),s=(0,xn.useSubscription)(a),l=!1;if(o.current!==t){var u=t(a.getSnapshot());n(s,u)||(l=!0,s=u)}return mn((function(){o.current=t,l&&a.setCurrentValue(s)})),s}(gn(),e)}class Sn{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}class Pn{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}}class _n{constructor(e=5e3){this.response={hash:"79054025255fb1a26e4bc422aef54eb4",layout:{appsDir:"apps",libsDir:"libs"},projects:[{name:"existing-app-1",type:"app",data:{root:"apps/app1",tags:[]}},{name:"existing-lib-1",type:"lib",data:{root:"libs/lib1",tags:[]}}],dependencies:{"existing-app-1":[{source:"existing-app-1",target:"existing-lib-1",type:"statis"}],"existing-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1},setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.response.hash)))}getProjectGraph(e){return new Promise((e=>e(this.response)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.response.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[]}}}updateResponse(){const e=this.createNewProject(),t=this.response.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.response=Object.assign({},this.response,{projects:[...this.response.projects,e],dependencies:Object.assign({},this.response.dependencies,{[e.name]:r})})}}let Cn;function jn(){return void 0===Cn&&("dev"===window.environment?Cn=new Sn:"watch"===window.environment?Cn=new _n:"release"===window.environment&&(Cn="build"===window.localMode?new Pn:new Sn)),Cn}const Tn=e=>e.context.projects,Dn=e=>e.context.workspaceLayout,On=e=>e.context.selectedProjects,Nn=e=>e.context.selectedProjects.length>0,Mn=e=>e.context.lastPerfReport,Ln=e=>e.context.focusedProject,An=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),In=e=>e.context.includePath,Bn=e=>e.context.textFilter,zn=e=>e.context.affectedProjects.length>0,Rn=(0,r.memo)((({focusedProject:e,resetFocus:t})=>(0,Bt.jsx)("div",{className:"mt-10 px-4",children:(0,Bt.jsxs)("div",{className:"p-2 shadow-sm bg-green-nx-base text-gray-50 border border-gray-200 rounded-md flex items-center group relative cursor-pointer overflow-hidden","data-cy":"unfocusButton",onClick:()=>t(),children:[(0,Bt.jsxs)("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 inline -mt-1 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,Bt.jsxs)("span",{id:"focused-project-name",children:["Focused on ",e]})]}),(0,Bt.jsxs)("div",{className:"absolute right-2 flex transition-all translate-x-32 transition duration-200 ease-in-out group-hover:translate-x-0 pl-2 rounded-md text-gray-700 items-center text-sm font-medium bg-white shadow-sm ring-1 ring-gray-500",children:["Reset",(0,Bt.jsx)("span",{className:"p-1 rounded-md",children:(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})]})}))),Fn=(0,r.memo)((({groupByFolderChanged:e})=>(0,Bt.jsx)("div",{className:"mt-8 px-4",children:(0,Bt.jsxs)("div",{className:"flex items-start",children:[(0,Bt.jsx)("div",{className:"flex items-center h-5",children:(0,Bt.jsx)("input",{id:"displayOptions",name:"displayOptions",value:"groupByFolder",type:"checkbox",className:"h-4 w-4 border-gray-300 rounded",onChange:t=>e(t.target.checked)})}),(0,Bt.jsxs)("div",{className:"ml-3 text-sm",children:[(0,Bt.jsx)("label",{htmlFor:"displayOptions",className:"cursor-pointer font-medium text-gray-700",children:"Group by folder"}),(0,Bt.jsx)("p",{className:"text-gray-500",children:"Visually arrange libraries by folders with different colors."})]})]})})));function Vn(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function Gn(e,t,n){let r={};return e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,o=Jt(e.data.root,i).join("/");r.hasOwnProperty(o)||(r[o]=[]),r[o].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function Un({project:e,toggleProject:t,focusProject:n}){return(0,Bt.jsxs)("li",{className:"text-xs text-gray-600 block cursor-default select-none relative py-1 pl-3 pr-9",children:[(0,Bt.jsxs)("div",{className:"flex items-center",children:[(0,Bt.jsx)("button",{type:"button",className:"flex rounded-md",title:"Focus on this library",onClick:()=>n(e.projectGraphNode.name),children:(0,Bt.jsx)("span",{className:"p-1 rounded-md flex items-center font-medium bg-white transition hover:bg-gray-50 shadow-sm ring-1 ring-gray-200",children:(0,Bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[(0,Bt.jsx)("path",{d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2h-1.528A6 6 0 004 9.528V4z"}),(0,Bt.jsx)("path",{fillRule:"evenodd",d:"M8 10a4 4 0 00-3.446 6.032l-1.261 1.26a1 1 0 101.414 1.415l1.261-1.261A4 4 0 108 10zm-2 4a2 2 0 114 0 2 2 0 01-4 0z",clipRule:"evenodd"})]})})}),(0,Bt.jsx)("label",{className:"font-mono font-normal ml-3 p-2 transition hover:bg-gray-50 cursor-pointer block rounded-md truncate w-full","data-project":e.projectGraphNode.name,"data-active":e.isSelected,onClick:()=>t(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name})]}),e.isSelected?(0,Bt.jsx)("span",{title:"This library is visible",className:"text-green-nx-base absolute inset-y-0 right-0 flex items-center cursor-pointer",onClick:()=>t(e.projectGraphNode.name,e.isSelected),children:(0,Bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}):null]})}function Wn({headerText:e,projects:t,selectProject:n,deselectProject:r,focusProject:i}){let o=[...t];function a(e,t){t?r(e):n(e)}return o.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)("h3",{className:"mt-4 py-2 uppercase tracking-wide font-semibold text-sm lg:text-xs text-gray-900 cursor-text",children:e}),(0,Bt.jsx)("ul",{className:"mt-2 -ml-3",children:o.map((e=>(0,Bt.jsx)(Un,{project:e,toggleProject:a,focusProject:i},e.projectGraphNode.name)))})]})}const qn=function(){const e=gn();function t(t){e.send({type:"deselectProject",projectName:t})}function n(t){e.send({type:"selectProject",projectName:t})}function r(t){e.send({type:"focusProject",projectName:t})}const i=kn(Tn),o=kn(Dn),a=kn(On),s=Vn("app",i),l=Vn("lib",i),u=Vn("e2e",i),c=Gn(s,a,o),d=Gn(l,a,o),f=Gn(u,a,o),p=Object.keys(c).sort(),h=Object.keys(d).sort(),v=Object.keys(f).sort();return(0,Bt.jsxs)("div",{id:"project-lists",className:"mt-8 px-4 border-t border-gray-200",children:[(0,Bt.jsx)("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"app projects"}),p.map((e=>(0,Bt.jsx)(Wn,{headerText:e,projects:c[e],deselectProject:t,selectProject:n,focusProject:r},"app-"+e))),(0,Bt.jsx)("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"e2e projects"}),v.map((e=>(0,Bt.jsx)(Wn,{headerText:e,projects:f[e],deselectProject:t,selectProject:n,focusProject:r},"e2e-"+e))),(0,Bt.jsx)("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"lib projects"}),h.map((e=>(0,Bt.jsx)(Wn,{headerText:e,projects:d[e],deselectProject:t,selectProject:n,focusProject:r},"lib-"+e)))]})},Hn=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:i})=>(0,Bt.jsxs)("div",{className:"mt-4 px-4",children:[(0,Bt.jsxs)("div",{className:"mt-4 flex items-start",children:[(0,Bt.jsx)("div",{className:"flex items-center h-5",children:(0,Bt.jsx)("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 border-gray-300 rounded",checked:t,onChange:e=>n(e.target.checked)})}),(0,Bt.jsxs)("div",{className:"ml-3 text-sm",children:[(0,Bt.jsx)("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-gray-700",children:"Activate proximity"}),(0,Bt.jsx)("p",{className:"text-gray-500",children:"Explore connected libraries step by step."})]})]}),(0,Bt.jsx)("div",{className:"mt-3 px-10",children:(0,Bt.jsxs)("div",{className:"flex rounded-md shadow-sm text-gray-500",children:[(0,Bt.jsx)("button",{title:"Remove ancestor level",className:"inline-flex items-center py-2 px-4 rounded-l-md border border-gray-300 bg-gray-50 text-gray-500 hover:bg-gray-100",onClick:r,children:(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 12H4"})})}),(0,Bt.jsx)("span",{id:"depthFilterValue",className:"p-1.5 bg-white flex-1 block w-full rounded-none border-t border-b border-gray-300 text-center font-mono",children:e}),(0,Bt.jsx)("button",{title:"Add ancestor level",className:"inline-flex items-center py-2 px-4 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 hover:bg-gray-100",onClick:i,children:(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})})]})})]}))),Yn=(0,r.memo)((({showAllProjects:e,hideAllProjects:t,showAffectedProjects:n,hasAffectedProjects:r})=>(0,Bt.jsxs)("div",{className:"mt-8 px-4",children:[(0,Bt.jsxs)("button",{onClick:e,type:"button",className:"w-full flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50","data-cy":"selectAllButton",children:[(0,Bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),"Show all projects"]}),r?(0,Bt.jsxs)("button",{onClick:n,type:"button",className:"mt-3 w-full flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-500 bg-white hover:bg-red-50","data-cy":"affectedButton",children:[(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Show affected projects"]}):null,(0,Bt.jsxs)("button",{onClick:t,type:"button",className:"mt-3 w-full flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50","data-cy":"deselectAllButton",children:[(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}),"Hide all projects"]})]})));const Xn=function({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:i,includePath:o}){const[a,s]=(0,r.useState)(""),l=function(e,t){const[n,i]=(0,r.useState)(e);return(0,r.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n}(a,500);return(0,r.useEffect)((()=>{""!==l&&n(l)}),[l,n]),(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)("div",{className:"mt-10 px-4",children:(0,Bt.jsxs)("form",{className:"flex rounded-md shadow-sm relative",onSubmit:e=>e.preventDefault(),children:[(0,Bt.jsx)("span",{className:"inline-flex items-center p-2 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500",children:(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})}),(0,Bt.jsx)("input",{type:"text",className:"p-1.5 bg-white text-gray-600 flex-1 block w-full rounded-none rounded-r-md border border-gray-300",placeholder:"lib name, other lib name","data-cy":"textFilterInput",name:"filter",value:a,onKeyUp:function(e){"Enter"===e.key&&n(e.currentTarget.value)},onChange:e=>{var n;""===(n=e.currentTarget.value)?(s(""),t()):s(n)}}),a.length>0?(0,Bt.jsx)("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){s(""),t()},className:"p-1 top-1 right-1 absolute bg-white inline-block rounded-md text-gray-500",children:(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z"})})}):null]})}),(0,Bt.jsx)("div",{className:"mt-4 px-4",children:(0,Bt.jsxs)("div",{className:"flex items-start",children:[(0,Bt.jsx)("div",{className:"flex items-center h-5",children:(0,Bt.jsx)("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 border-gray-300 rounded",checked:o,onChange:i})}),(0,Bt.jsxs)("div",{className:"ml-3 text-sm",children:[(0,Bt.jsx)("label",{htmlFor:"includeInPath",className:"font-medium text-gray-700 cursor-pointer",children:"Include related libraries"}),(0,Bt.jsx)("p",{className:"text-gray-500",children:"Show libraries that are related to your search."})]})]})})]})};const Kn=function(){const e=gn(),t=kn(Ln),n=kn(An),i=kn(In),o=kn(Bn),a=kn(zn),s=(0,r.useCallback)((t=>{e.send({type:"filterByText",search:t})}),[e]);return(0,Bt.jsxs)("div",{className:" flex flex-col h-full overflow-scroll w-72 pb-10 shadow-lg ring-1 ring-gray-400 ring-opacity-10 relative ",id:"sidebar",children:[(0,Bt.jsx)("div",{className:"bg-blue-nx-base",children:(0,Bt.jsxs)("div",{className:"flex items-center justify-start mx-4 my-5 text-white",children:[(0,Bt.jsxs)("svg",{className:"h-10 w-auto",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bt.jsx)("title",{children:"Nx"}),(0,Bt.jsx)("path",{d:"M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z"})]}),(0,Bt.jsx)("span",{className:"ml-4 text-xl font-medium",children:" Dependency Graph "})]})}),(0,Bt.jsxs)("a",{id:"help",className:" mt-3 px-4 text-xs text-gray-500 flex items-center cursor-pointer hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"nofollow noreferrer",target:"_blank",children:[(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Analyse and visualize your workspace."]}),t?(0,Bt.jsx)(Rn,{focusedProject:t,resetFocus:function(){e.send({type:"unfocusProject"})}}):null,(0,Bt.jsx)(Xn,{includePath:i,resetTextFilter:function(){e.send({type:"clearTextFilter"})},textFilter:o,toggleIncludeLibsInPathChange:function(){e.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!i})},updateTextFilter:s}),(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)(Yn,{hideAllProjects:function(){e.send({type:"deselectAll"})},showAllProjects:function(){e.send({type:"selectAll"})},showAffectedProjects:function(){e.send({type:"selectAffected"})},hasAffectedProjects:a}),(0,Bt.jsx)(Fn,{groupByFolderChanged:function(t){e.send({type:"setGroupByFolder",groupByFolder:t})}}),(0,Bt.jsx)(Hn,{searchDepth:n.searchDepth,searchDepthEnabled:n.searchDepthEnabled,searchDepthFilterEnabledChange:function(t){e.send({type:"setSearchDepthEnabled",searchDepthEnabled:t})},incrementDepthFilter:function(){e.send({type:"incrementSearchDepth"})},decrementDepthFilter:function(){e.send({type:"decrementSearchDepth"})}})]}),(0,Bt.jsx)(qn,{})]})};function Qn(){const e=gn(),t=jn(),n=(0,r.useRef)({exclude:window.exclude,focusedProject:window.focusedProject,groupByFolder:window.groupByFolder,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:window.appConfig,useXstateInspect:window.useXstateInspect}).current,i=kn(Mn),o=kn(Nn),[a,s]=(0,r.useState)(n.appConfig.defaultProjectGraph);return(0,r.useEffect)((()=>{const{appConfig:r}=n,i=r.projectGraphs.find((e=>e.id===a));(async()=>{const r=await t.getProjectGraph(i.url),o=null==r?void 0:r.layout;e.send({type:"initGraph",projects:r.projects,dependencies:r.dependencies,affectedProjects:r.affected,workspaceLayout:o}),n.focusedProject&&e.send({type:"focusProject",projectName:n.focusedProject}),n.groupByFolder&&e.send({type:"setGroupByFolder",groupByFolder:!0})})()}),[a,n,e,t]),((e,t,n)=>{const i=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(i.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n){const e=()=>{i.current()};if(null!==t){let n=setInterval(e,t);return()=>clearInterval(n)}}}),[t,n])})((()=>{const r=n.appConfig.projectGraphs.find((e=>e.id===a));(async()=>{const n=await t.getProjectGraph(r.url);e.send({type:"updateGraph",projects:n.projects,dependencies:n.dependencies})})()}),5e3,n.watch),(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(Kn,{}),(0,Bt.jsxs)("div",{id:"main-content",className:"flex-grow overflow-hidden",children:[n.appConfig.showDebugger?(0,Bt.jsx)(zt,{projectGraphs:n.appConfig.projectGraphs,selectedProjectGraph:a,lastPerfReport:i,projectGraphChange:function(e){s(e)}}):null,o?null:(0,Bt.jsxs)("div",{id:"no-projects-chosen",className:"flex text-gray-700",children:[(0,Bt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z"})}),(0,Bt.jsx)("h4",{children:"Please select projects in the sidebar."})]}),(0,Bt.jsxs)("div",{id:"graph-container",children:[(0,Bt.jsx)("div",{id:"cytoscape-graph"}),(0,Bt.jsx)(It,{content:"Download Graph as PNG",placement:"right",theme:"nx",children:(0,Bt.jsx)("button",{type:"button",className:`\n fixed\n z-50\n bottom-4\n right-4\n w-16\n h-16\n rounded-full\n bg-green-nx-base\n shadow-sm\n text-white\n block\n transition\n duration-300\n transform\n ${o?"":"opacity-0"}\n `,"data-cy":"downloadImageButton",onClick:function(){const e=on().getImage();let t=document.createElement("a");t.href=e,t.download="graph.png",t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},children:(0,Bt.jsx)("svg",{height:"24",width:"24",className:"absolute top-1/2 left-1/2 -mt-3 -ml-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Bt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})})]})]})]})}const $n=function(){return(0,Bt.jsx)(vn,{children:(0,Bt.jsx)(Qn,{})})};!0===window.useXstateInspect&&function(e){var t=function(e){var t=o(o({},p),e);return o(o({},t),{url:new URL(t.url),iframe:c(t.iframe),devTools:c(t.devTools)})}(e),n=t.iframe,r=t.url,i=t.devTools;if(null!==n){var l,u,f=function(e){void 0===e&&(e=globalThis.__xstate__);var t=new Map,n=e.onRegister((function(e){t.set(e.sessionId,e)}));return(0,a.createMachine)({initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,t){return e.client.send(t)}},"service.event":{actions:function(e,t){return e.client.send(t)}},"service.register":{actions:function(e,t){return e.client.send(t)}},"service.stop":{actions:function(e,t){return e.client.send(t)}},"xstate.event":{actions:function(e,n){var r=n.event,i=JSON.parse(r),o=t.get(i.origin);null==o||o.send(i)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){n.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,a.assign)({client:function(e,t){return t.client}}),function(t){e.services.forEach((function(e){var n;null===(n=t.client)||void 0===n||n.send({type:"service.register",machine:d(e.machine),state:d(e.state||e.initialState),sessionId:e.sessionId})}))}]}}})}(i),h=(0,a.interpret)(f).start(),v=new Set,g=h.subscribe((function(e){v.forEach((function(t){return t.next(e)}))})),y=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!l&&(l=n.contentWindow),u||(u={send:function(e){l.postMessage(e,r.origin)}});var t=o(o({},e.data),{client:u});h.send(t)}};return window.addEventListener("message",y),window.addEventListener("unload",(function(){h.send({type:"unload"})})),i.onRegister((function(e){var t;h.send({type:"service.register",machine:d(e.machine),state:d(e.state||e.initialState),sessionId:e.sessionId,id:e.id,parent:null===(t=e.parent)||void 0===t?void 0:t.sessionId}),h.send({type:"service.event",event:d((e.state||e.initialState)._event),sessionId:e.sessionId});var n=e.send.bind(e);e.send=function(t,r){return h.send({type:"service.event",event:d((0,s.toSCXMLEvent)((0,s.toEventObject)(t,r))),sessionId:e.sessionId}),n(t,r)},e.subscribe((function(t){void 0!==t&&h.send({type:"service.state",state:d(t),sessionId:e.sessionId})})),e.onStop((function(){h.send({type:"service.stop",sessionId:e.sessionId})}))})),n?(n.addEventListener("load",(function(){l=n.contentWindow})),n.setAttribute("src",String(r))):l=window.open(String(r),"xstateinspector"),{send:function(e){h.send(e)},subscribe:function(e,t,n){var r=(0,s.toObserver)(e,t,n);return v.add(r),r.next(h.state),{unsubscribe:function(){v.delete(r)}}},disconnect:function(){h.send("disconnect"),window.removeEventListener("message",y),g.unsubscribe()}}}console.warn("No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.")}({url:"https://stately.ai/viz?inspect",iframe:!1}),i.render((0,Bt.jsx)(r.StrictMode,{children:(0,Bt.jsx)($n,{})}),document.getElementById("app"))},"1ajG":(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>E,afterRead:()=>b,afterWrite:()=>P,applyStyles:()=>N,arrow:()=>Q,auto:()=>s,basePlacements:()=>l,beforeMain:()=>x,beforeRead:()=>y,beforeWrite:()=>k,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>ee,createPopper:()=>Oe,createPopperBase:()=>Te,createPopperLite:()=>De,detectOverflow:()=>ge,end:()=>c,eventListeners:()=>ne,flip:()=>ye,hide:()=>xe,left:()=>a,main:()=>w,modifierPhases:()=>_,offset:()=>we,placements:()=>g,popper:()=>p,popperGenerator:()=>je,popperOffsets:()=>Ee,preventOverflow:()=>ke,read:()=>m,reference:()=>h,right:()=>o,start:()=>u,top:()=>r,variationPlacements:()=>v,viewport:()=>f,write:()=>S});var r="top",i="bottom",o="right",a="left",s="auto",l=[r,i,o,a],u="start",c="end",d="clippingParents",f="viewport",p="popper",h="reference",v=l.reduce((function(e,t){return e.concat([t+"-"+u,t+"-"+c])}),[]),g=[].concat(l,[s]).reduce((function(e,t){return e.concat([t,t+"-"+u,t+"-"+c])}),[]),y="beforeRead",m="read",b="afterRead",x="beforeMain",w="main",E="afterMain",k="beforeWrite",S="write",P="afterWrite",_=[y,m,b,x,w,E,k,S,P];function C(e){return e?(e.nodeName||"").toLowerCase():null}function j(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function T(e){return e instanceof j(e).Element||e instanceof Element}function D(e){return e instanceof j(e).HTMLElement||e instanceof HTMLElement}function O(e){return"undefined"!=typeof ShadowRoot&&(e instanceof j(e).ShadowRoot||e instanceof ShadowRoot)}const N={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];D(i)&&C(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(r)&&C(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}function L(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect();return{width:n.width/1,height:n.height/1,top:n.top/1,right:n.right/1,bottom:n.bottom/1,left:n.left/1,x:n.left/1,y:n.top/1}}function A(e){var t=L(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function I(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&O(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function B(e){return j(e).getComputedStyle(e)}function z(e){return["table","td","th"].indexOf(C(e))>=0}function R(e){return((T(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(O(e)?e.host:null)||R(e)}function V(e){return D(e)&&"fixed"!==B(e).position?e.offsetParent:null}function G(e){for(var t=j(e),n=V(e);n&&z(n)&&"static"===B(n).position;)n=V(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===B(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&D(e)&&"fixed"===B(e).position)return null;for(var n=F(e);D(n)&&["html","body"].indexOf(C(n))<0;){var r=B(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function U(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var W=Math.max,q=Math.min,H=Math.round;function Y(e,t,n){return W(e,q(t,n))}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function K(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,u=e.options,c=n.elements.arrow,d=n.modifiersData.popperOffsets,f=M(n.placement),p=U(f),h=[a,o].indexOf(f)>=0?"height":"width";if(c&&d){var v=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:K(e,l))}(u.padding,n),g=A(c),y="y"===p?r:a,m="y"===p?i:o,b=n.rects.reference[h]+n.rects.reference[p]-d[p]-n.rects.popper[h],x=d[p]-n.rects.reference[p],w=G(c),E=w?"y"===p?w.clientHeight||0:w.clientWidth||0:0,k=b/2-x/2,S=v[y],P=E-g[h]-v[m],_=E/2-g[h]/2+k,C=Y(S,_,P),j=p;n.modifiersData[s]=((t={})[j]=C,t.centerOffset=C-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&I(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(e){return e.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,s=e.popperRect,l=e.placement,u=e.variation,d=e.offsets,f=e.position,p=e.gpuAcceleration,h=e.adaptive,v=e.roundOffsets,g=!0===v?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:H(H(t*r)/r)||0,y:H(H(n*r)/r)||0}}(d):"function"==typeof v?v(d):d,y=g.x,m=void 0===y?0:y,b=g.y,x=void 0===b?0:b,w=d.hasOwnProperty("x"),E=d.hasOwnProperty("y"),k=a,S=r,P=window;if(h){var _=G(n),C="clientHeight",T="clientWidth";_===j(n)&&"static"!==B(_=R(n)).position&&"absolute"===f&&(C="scrollHeight",T="scrollWidth"),_=_,l!==r&&(l!==a&&l!==o||u!==c)||(S=i,x-=_[C]-s.height,x*=p?1:-1),l!==a&&(l!==r&&l!==i||u!==c)||(k=o,m-=_[T]-s.width,m*=p?1:-1)}var D,O=Object.assign({position:f},h&&Z);return p?Object.assign({},O,((D={})[S]=E?"0":"",D[k]=w?"0":"",D.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",D)):Object.assign({},O,((t={})[S]=E?x+"px":"",t[k]=w?m+"px":"",t.transform="",t))}const ee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,u={placement:M(t.placement),variation:$(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var te={passive:!0};const ne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=j(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,te)})),s&&l.addEventListener("resize",n.update,te),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,te)})),s&&l.removeEventListener("resize",n.update,te)}},data:{}};var re={left:"right",right:"left",bottom:"top",top:"bottom"};function ie(e){return e.replace(/left|right|bottom|top/g,(function(e){return re[e]}))}var oe={start:"end",end:"start"};function ae(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e){var t=j(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function le(e){return L(R(e)).left+se(e).scrollLeft}function ue(e){var t=B(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ce(e){return["html","body","#document"].indexOf(C(e))>=0?e.ownerDocument.body:D(e)&&ue(e)?e:ce(F(e))}function de(e,t){var n;void 0===t&&(t=[]);var r=ce(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=j(r),a=i?[o].concat(o.visualViewport||[],ue(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(de(F(a)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function pe(e,t){return t===f?fe(function(e){var t=j(e),n=R(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+le(e),y:s}}(e)):D(t)?function(e){var t=L(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):fe(function(e){var t,n=R(e),r=se(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=W(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=W(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+le(e),l=-r.scrollTop;return"rtl"===B(i||n).direction&&(s+=W(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(R(e)))}function he(e,t,n){var r="clippingParents"===t?function(e){var t=de(F(e)),n=["absolute","fixed"].indexOf(B(e).position)>=0&&D(e)?G(e):e;return T(n)?t.filter((function(e){return T(e)&&I(e,n)&&"body"!==C(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=pe(e,n);return t.top=W(r.top,t.top),t.right=q(r.right,t.right),t.bottom=q(r.bottom,t.bottom),t.left=W(r.left,t.left),t}),pe(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t,n=e.reference,s=e.element,l=e.placement,d=l?M(l):null,f=l?$(l):null,p=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(d){case r:t={x:p,y:n.y-s.height};break;case i:t={x:p,y:n.y+n.height};break;case o:t={x:n.x+n.width,y:h};break;case a:t={x:n.x-s.width,y:h};break;default:t={x:n.x,y:n.y}}var v=d?U(d):null;if(null!=v){var g="y"===v?"height":"width";switch(f){case u:t[v]=t[v]-(n[g]/2-s[g]/2);break;case c:t[v]=t[v]+(n[g]/2-s[g]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,u=n.boundary,c=void 0===u?d:u,v=n.rootBoundary,g=void 0===v?f:v,y=n.elementContext,m=void 0===y?p:y,b=n.altBoundary,x=void 0!==b&&b,w=n.padding,E=void 0===w?0:w,k=X("number"!=typeof E?E:K(E,l)),S=m===p?h:p,P=e.rects.popper,_=e.elements[x?S:m],C=he(T(_)?_:_.contextElement||R(e.elements.popper),c,g),j=L(e.elements.reference),D=ve({reference:j,element:P,strategy:"absolute",placement:s}),O=fe(Object.assign({},P,D)),N=m===p?O:j,M={top:C.top-N.top+k.top,bottom:N.bottom-C.bottom+k.bottom,left:C.left-N.left+k.left,right:N.right-C.right+k.right},A=e.modifiersData.offset;if(m===p&&A){var I=A[s];Object.keys(M).forEach((function(e){var t=[o,i].indexOf(e)>=0?1:-1,n=[r,i].indexOf(e)>=0?"y":"x";M[e]+=I[n]*t}))}return M}const ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,c=e.name;if(!t.modifiersData[c]._skip){for(var d=n.mainAxis,f=void 0===d||d,p=n.altAxis,h=void 0===p||p,y=n.fallbackPlacements,m=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,E=n.flipVariations,k=void 0===E||E,S=n.allowedAutoPlacements,P=t.options.placement,_=M(P),C=y||(_===P||!k?[ie(P)]:function(e){if(M(e)===s)return[];var t=ie(e);return[ae(e),t,ae(t)]}(P)),j=[P].concat(C).reduce((function(e,n){return e.concat(M(n)===s?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?g:u,d=$(r),f=d?s?v:v.filter((function(e){return $(e)===d})):l,p=f.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=f);var h=p.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[M(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:m,flipVariations:k,allowedAutoPlacements:S}):n)}),[]),T=t.rects.reference,D=t.rects.popper,O=new Map,N=!0,L=j[0],A=0;A<j.length;A++){var I=j[A],B=M(I),z=$(I)===u,R=[r,i].indexOf(B)>=0,F=R?"width":"height",V=ge(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:m}),G=R?z?o:a:z?i:r;T[F]>D[F]&&(G=ie(G));var U=ie(G),W=[];if(f&&W.push(V[B]<=0),h&&W.push(V[G]<=0,V[U]<=0),W.every((function(e){return e}))){L=I,N=!1;break}O.set(I,W)}if(N)for(var q=function(e){var t=j.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return L=t,"break"},H=k?3:1;H>0;H--){if("break"===q(H))break}t.placement!==L&&(t.modifiersData[c]._skip=!0,t.placement=L,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function me(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function be(e){return[r,o,i,a].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ge(t,{elementContext:"reference"}),s=ge(t,{altBoundary:!0}),l=me(a,r),u=me(s,i,o),c=be(l),d=be(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};const we={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,l=void 0===s?[0,0]:s,u=g.reduce((function(e,n){return e[n]=function(e,t,n){var i=M(e),s=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,u=l[0],c=l[1];return u=u||0,c=(c||0)*s,[a,o].indexOf(i)>=0?{x:c,y:u}:{x:u,y:c}}(n,t.rects,l),e}),{}),c=u[t.placement],d=c.x,f=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=f),t.modifiersData[i]=u}};const Ee={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,l=n.mainAxis,c=void 0===l||l,d=n.altAxis,f=void 0!==d&&d,p=n.boundary,h=n.rootBoundary,v=n.altBoundary,g=n.padding,y=n.tether,m=void 0===y||y,b=n.tetherOffset,x=void 0===b?0:b,w=ge(t,{boundary:p,rootBoundary:h,padding:g,altBoundary:v}),E=M(t.placement),k=$(t.placement),S=!k,P=U(E),_="x"===P?"y":"x",C=t.modifiersData.popperOffsets,j=t.rects.reference,T=t.rects.popper,D="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,O={x:0,y:0};if(C){if(c||f){var N="y"===P?r:a,L="y"===P?i:o,I="y"===P?"height":"width",B=C[P],z=C[P]+w[N],R=C[P]-w[L],F=m?-T[I]/2:0,V=k===u?j[I]:T[I],H=k===u?-T[I]:-j[I],X=t.elements.arrow,K=m&&X?A(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Q[N],J=Q[L],ee=Y(0,j[I],K[I]),te=S?j[I]/2-F-ee-Z-D:V-ee-Z-D,ne=S?-j[I]/2+F+ee+J+D:H+ee+J+D,re=t.elements.arrow&&G(t.elements.arrow),ie=re?"y"===P?re.clientTop||0:re.clientLeft||0:0,oe=t.modifiersData.offset?t.modifiersData.offset[t.placement][P]:0,ae=C[P]+te-oe-ie,se=C[P]+ne-oe;if(c){var le=Y(m?q(z,ae):z,B,m?W(R,se):R);C[P]=le,O[P]=le-B}if(f){var ue="x"===P?r:a,ce="x"===P?i:o,de=C[_],fe=de+w[ue],pe=de-w[ce],he=Y(m?q(fe,ae):fe,de,m?W(pe,se):pe);C[_]=he,O[_]=he-de}}t.modifiersData[s]=O}},requiresIfExists:["offset"]};function Se(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return 1!==n||1!==r}(t),s=R(t),l=L(e,a),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==C(t)||ue(s))&&(u=(r=t)!==j(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:se(r)),D(t)?((c=L(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=le(s))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Pe(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var _e={placement:"bottom",modifiers:[],strategy:"absolute"};function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function je(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?_e:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},_e,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:T(e)?de(e):e.contextElement?de(e.contextElement):[],popper:de(t)};var a=function(e){var t=Pe(e);return _.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r}),a=function(){};l.push(o||a)}})),c.update()},forceUpdate:function(){if(!u){var e=s.elements,t=e.reference,n=e.popper;if(Ce(t,n)){s.rects={reference:Se(t,G(n),"fixed"===s.options.strategy),popper:A(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,l=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:l,name:d,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),u=!0}};if(!Ce(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Te=je(),De=je({defaultModifiers:[ne,Ee,ee,N]}),Oe=je({defaultModifiers:[ne,Ee,ee,N,we,ye,ke,Q,xe]})},t6Oc:(e,t,n)=>{"use strict";t.f0=void 0;var r=n("IXFX"),i=n("9EWH");function o(e){return r.assign((function(t,n,r){return i.produce(t,(function(t){e(t,n,r)}))}))}t.f0=o},Ded0:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),l={},u=function(e,t){null!=t&&(l[e]=t)};u("nodesep",e.nodeSep),u("edgesep",e.edgeSep),u("ranksep",e.rankSep),u("rankdir",e.rankDir),u("ranker",e.ranker),s.setGraph(l),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var c=n.nodes(),d=0;d<c.length;d++){var f=c[d],p=f.layoutDimensions(e);s.setNode(f.id(),{width:p.w,height:p.h,name:f.id()})}for(var h=0;h<c.length;h++){var v=c[h];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),y=0;y<g.length;y++){var m=g[y];s.setEdge(m.source().id(),m.target().id(),{minlen:i(m,e.minLen),weight:i(m,e.edgeWeight),name:m.id()},m.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var E=x[w],k=s.node(E);t.getElementById(E).scratch().dagre=k}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},c.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,c.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){if(e.boundingBox){var n=0===b.w?0:(t.x-b.x1)/b.w,r=0===b.h?0:(t.y-b.y1)/b.h;return{x:o.x1+n*o.w,y:o.y1+r*o.h}}return t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}};e.exports=n},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n("4e6e"))},CQyY:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),l=o(e,t.content),u=r({},a,t.popper);return s(n,l,u)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy(),o={renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e),i=r.w/2,o=r.h/2;return{x:n.x-i,y:n.y-o}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i};return r({},o,t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.cy,i=t.renderedDimensions,o=r.container().getBoundingClientRect(),a=i(e),s=n(e);return{top:s.y+o.top,left:s.x+o.left,right:s.x+a.w+o.left,bottom:s.y+a.h+o.top,width:a.w,height:a.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n=null;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n("1ajG"))},rFOX:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n("E/ZA")),o=r(n("3Ssf"));function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var f="undefined"==typeof window?null:window,p=f?f.navigator:null,h=(f&&f.document,a("")),v=a({}),g=a((function(){})),y="undefined"==typeof HTMLElement?"undefined":a(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&a(e)==h},x=function(e){return null!=e&&a(e)===g},w=function(e){return!P(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&a(e)===v&&!w(e)&&e.constructor===Object},k=function(e){return null!=e&&a(e)===a(1)&&!isNaN(e)},S=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},P=function(e){return _(e)||C(e)},_=function(e){return"collection"===m(e)&&e._private.single},C=function(e){return"collection"===m(e)&&!e._private.single},j=function(e){return"core"===m(e)},T=function(e){return"stylesheet"===m(e)},D=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&a(e)===v}(e)&&x(e.then)},N=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},M=N((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),L=N((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),A=N((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),I=function(e){return D(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},B="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",z=function(e,t){return e<t?-1:e>t?1:0},R=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},F=function(e){return(w(e)?e:null)||function(e){return V[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,f=2*i-d;a=Math.round(255*u(f,d,n+1/3)),s=Math.round(255*u(f,d,n)),l=Math.round(255*u(f,d,n-1/3))}t=[a,s,l,o]}return t}(e)},V={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},G=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},U=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},W=f?f.performance:null,q=W&&W.now?function(){return W.now()}:function(){return Date.now()},H=function(){if(f){if(f.requestAnimationFrame)return function(e){f.requestAnimationFrame(e)};if(f.mozRequestAnimationFrame)return function(e){f.mozRequestAnimationFrame(e)};if(f.webkitRequestAnimationFrame)return function(e){f.webkitRequestAnimationFrame(e)};if(f.msRequestAnimationFrame)return function(e){f.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(q())}),1e3/60)}}(),Y=function(e){return H(e)},X=q,K=9261,Q=65599,$=5381,Z=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K,r=n;!(t=e.next()).done;)r=r*Q+t.value|0;return r},J=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;return t*Q+e|0},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return(t<<5)+t+e|0},te=function(e){return 2097152*e[0]+e[1]},ne=function(e,t){return[J(e[0],t[0]),ee(e[1],t[1])]},re=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Z({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ie=function(){return oe(arguments)},oe=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?re(r):re(r,t)}return t},ae=!0,se=null!=console.warn,le=null!=console.trace,ue=Number.MAX_SAFE_INTEGER||9007199254740991,ce=function(){return!0},de=function(){return!1},fe=function(){return 0},pe=function(){},he=function(e){throw new Error(e)},ve=function(e){if(void 0===e)return ae;ae=!!e},ge=function(e){ve()&&(se?console.warn(e):(console.log(e),le&&console.trace()))},ye=function(e){return null==e?e:w(e)?e.slice():E(e)?function(e){return R({},e)}(e):e},me=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},be={},xe=function(){return be},we=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},Ee=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},ke=function(e){e.splice(0,e.length)},Se=function(e,t,n){return n&&(t=A(n,t)),e[t]},Pe=function(e,t,n,r){n&&(t=A(n,t)),e[t]=r},_e="undefined"!=typeof Map?Map:function(){function e(){s(this,e),this._obj={}}return u(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ce=function(){function e(t){if(s(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return u(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),je="undefined"!==("undefined"==typeof Set?"undefined":a(Set))?Set:Ce,Te=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&j(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new je,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&""!==d&&i.classes.add(d)}this.createEmitter();var f=t.style||t.css;f&&(ge("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f)),(void 0===n||n)&&this.restore()}else he("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else he("An element must have a core reference and parameters set")},De=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;E(t)&&!P(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var o,a=this._private.cy,s=t=b(t)?this.filter(t):t,l=[],u=[],c={},d={},f={},p=0,h=this.byGroup(),v=h.nodes,g=h.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(f[w]=!0,u.push(m)),d[w]=0)}var k=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(f[i])return"continue";f[i]=!0,u.push(t)}var a,s=d[i],h=c[i],y=null!=h?h.source():null,m=null!=h?h.target():null,b=null==h?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,h,b,p++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var E=x[w],k=E.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),S=k.id();0===k.length||f[S]||(k=k[0],l.push(k),e.bfs&&(f[S]=!0,u.push(k)),c[S]=E,d[S]=d[i]+1)}};e:for(;0!==l.length;){var S=k();switch(S){case"continue":continue;case"break":break e}}for(var _=a.collection(),C=0;C<u.length;C++){var j=u[C],T=c[j.id()];null!=T&&_.push(T),_.push(j)}return{path:a.collection(_),found:a.collection(o)}}},Oe={breadthFirstSearch:De({bfs:!0}),depthFirstSearch:De({dfs:!0})};Oe.bfs=Oe.breadthFirstSearch,Oe.dfs=Oe.depthFirstSearch;var Ne=we({root:null,weight:function(e){return 1},directed:!1}),Me={dijkstra:function(e){if(!E(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ne(e),r=n.root,i=n.weight,a=n.directed,s=this,l=i,u=b(r)?this.filter(r)[0]:r[0],c={},d={},f={},p=this.byGroup(),h=p.nodes,v=p.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return c[e.id()]},y=function(e,t){c[e.id()]=t,m.updateItem(e)},m=new o((function(e,t){return g(e)-g(t)})),x=0;x<h.length;x++){var w=h[x];c[w.id()]=w.same(u)?0:1/0,m.push(w)}for(var k=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,o=0;o<r.length;o++){var s=r[o],u=l(s);(u<i||!n)&&(i=u,n=s)}return{edge:n,dist:i}};m.size()>0;){var S=m.pop(),P=g(S),_=S.id();if(f[_]=P,P!==1/0)for(var C=S.neighborhood().intersect(h),j=0;j<C.length;j++){var T=C[j],D=T.id(),O=k(S,T),N=P+O.dist;N<g(T)&&(y(T,N),d[D]={node:S,edge:O.edge})}}return{distanceTo:function(e){var t=b(e)?h.filter(e)[0]:e[0];return f[t.id()]},pathTo:function(e){var t=b(e)?h.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return s.spawn(n)}}}},Le={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var u=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<u.length;c++){var d=u[c],f=d.source()[0],p=d.target()[0],h=s(f),v=s(p),g=o[h],y=o[v];h!==v&&(a.merge(d),g.merge(y),o.splice(v,1))}return a}},Ae=we({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Ie={aStar:function(e){var t=this.cy(),n=Ae(e),r=n.root,i=n.goal,a=n.heuristic,s=n.directed,l=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var u,c,d=r.id(),f=i.id(),p={},h={},v={},g=new o((function(e,t){return h[e.id()]-h[t.id()]})),y=new je,m={},b={},x=function(e,t){g.push(e),y.add(t)};x(r,d),p[d]=0,h[d]=a(r);for(var w,E=0;g.size()>0;){if(u=g.pop(),c=u.id(),y.delete(c),E++,c===f){for(var k=[],S=i,P=f,_=b[P];k.unshift(S),null!=_&&k.unshift(_),null!=(S=m[P]);)_=b[P=S.id()];return{found:!0,distance:p[c],path:this.spawn(k),steps:E}}v[c]=!0;for(var C=u._private.edges,j=0;j<C.length;j++){var T=C[j];if(this.hasElementWithId(T.id())&&(!s||T.data("source")===c)){var D=T.source(),O=T.target(),N=D.id()!==c?D:O,M=N.id();if(this.hasElementWithId(M)&&!v[M]){var L=p[c]+l(T);w=M,y.has(w)?L<p[M]&&(p[M]=L,h[M]=L+a(N),m[M]=u,b[M]=T):(p[M]=L,h[M]=L+a(N),x(N,M),m[M]=u,b[M]=T)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Be=we({weight:function(e){return 1},directed:!1}),ze={floydWarshall:function(e){for(var t=this.cy(),n=Be(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,l=a.edges,u=s.length,c=u*u,d=function(e){return s.indexOf(e)},f=function(e){return s[e]},p=new Array(c),h=0;h<c;h++){var v=h%u,g=(h-v)/u;p[h]=g===v?0:1/0}for(var y=new Array(c),m=new Array(c),x=0;x<l.length;x++){var w=l[x],E=w.source()[0],k=w.target()[0];if(E!==k){var S=d(E),P=d(k),_=S*u+P,C=o(w);if(p[_]>C&&(p[_]=C,y[_]=P,m[_]=w),!i){var j=P*u+S;!i&&p[j]>C&&(p[j]=C,y[j]=S,m[j]=w)}}}for(var T=0;T<u;T++)for(var D=0;D<u;D++)for(var O=D*u+T,N=0;N<u;N++){var M=D*u+N,L=T*u+N;p[O]+p[L]<p[M]&&(p[M]=p[O]+p[L],y[M]=y[O])}var A=function(e){return d(function(e){return(b(e)?t.filter(e):e)[0]}(e))},I={distance:function(e,t){var n=A(e),r=A(t);return p[n*u+r]},path:function(e,n){var r=A(e),i=A(n),o=f(r);if(r===i)return o.collection();if(null==y[r*u+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=y[r*u+i],a=m[l*u+r],s.merge(a),s.merge(f(r));return s}};return I}},Re=we({weight:function(e){return 1},directed:!1,root:null}),Fe={bellmanFord:function(e){var t=this,n=Re(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,f=d.length,p=new _e,h=!1;o=l.collection(o)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var v=c.length,g=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},y=function(e){return(b(e)?l.$(e):e)[0]},m=0;m<f;m++){var x=d[m],w=g(x);x.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,k=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,E=!0)},S=1;S<f;S++){E=!1;for(var P=0;P<v;P++){var _=c[P],C=_.source(),j=_.target(),T=a(_),D=g(C),O=g(j);k(C,0,_,D,O,T),i||k(j,0,_,O,D,T)}if(!E)break}if(E)for(var N=0;N<v;N++){var M=c[N],L=M.source(),A=M.target(),I=a(M),B=g(L).dist,z=g(A).dist;if(B+I<z||!i&&z+I<B){ge("Graph contains a negative weight cycle for Bellman-Ford"),h=!0;break}}return{distanceTo:function(e){return g(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=y(e),i=[],a=r;;){if(null==a)return t.spawn();var l=g(a),u=l.edge,c=l.pred;if(i.unshift(a[0]),a.same(n)&&i.length>0)break;null!=u&&i.unshift(u),a=c}return s.spawn(i)},hasNegativeWeightCycle:h,negativeWeightCycles:[]}}},Ve=Math.sqrt(2),Ge=function(e,t,n){0===n.length&&he("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],f=c[2];(t[d]===a&&t[f]===s||t[d]===s&&t[f]===a)&&l.splice(u,1)}for(var p=0;p<l.length;p++){var h=l[p];h[1]===s?(l[p]=h.slice(),l[p][1]=a):h[2]===s&&(l[p]=h.slice(),l[p][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return l},Ue=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Ge(i,e,t),n--}return t},We={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Ve);if(!(i<2)){for(var l=[],u=0;u<o;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,f=[],p=new Array(i),h=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)h[m]=m;var b=Ue(h,l.slice(),i,s),x=b.slice();g(h,v);var w=Ue(h,b,s,2),E=Ue(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,f=w,g(h,p)):E.length<=w.length&&E.length<d&&(d=E.length,f=E,g(v,p))}for(var k=this.spawn(f.map((function(e){return r[e[0]]}))),S=this.spawn(),P=this.spawn(),_=p[0],C=0;C<p.length;C++){var j=p[C],T=n[C];j===_?S.merge(T):P.merge(T)}var D=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)}))})),n},O=[D(S),D(P)];return{cut:k,components:O,partition1:S,partition2:P}}he("At least 2 nodes are required for Karger-Stein algorithm")}},qe=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},He=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Ye=function(e){return{x:e[0],y:e[1]}},Xe=function(e,t){return Math.atan2(t,e)-Math.PI/2},Ke=Math.log2||function(e){return Math.log(e)/Math.log(2)},Qe=function(e){return e>0?1:e<0?-1:0},$e=function(e,t){return Math.sqrt(Ze(e,t))},Ze=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Je=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},et=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},tt=function(e,t,n,r){return{x:et(e.x,t.x,n.x,r),y:et(e.y,t.y,n.y,r)}},nt=function(e,t,n){return Math.max(e,Math.min(n,t))},rt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},it=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},ot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},at=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=d(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},st=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},lt=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},ut=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ct=function(e,t){return ut(e,t.x1,t.y1)&&ut(e,t.x2,t.y2)},dt=function(e,t,n,r,i,o,a){var s,l=Tt(i,o),u=i/2,c=o/2,d=r-c-a;if((s=kt(e,t,n,r,n-u+l-a,d,n+u-l+a,d,!1)).length>0)return s;var f=n+u+a;if((s=kt(e,t,n,r,f,r-c+l-a,f,r+c-l+a,!1)).length>0)return s;var p=r+c+a;if((s=kt(e,t,n,r,n-u+l-a,p,n+u-l+a,p,!1)).length>0)return s;var h,v=n-u-a;if((s=kt(e,t,n,r,v,r-c+l-a,v,r+c-l+a,!1)).length>0)return s;var g=n-u+l,y=r-c+l;if((h=wt(e,t,n,r,g,y,l+a)).length>0&&h[0]<=g&&h[1]<=y)return[h[0],h[1]];var m=n+u-l,b=r-c+l;if((h=wt(e,t,n,r,m,b,l+a)).length>0&&h[0]>=m&&h[1]<=b)return[h[0],h[1]];var x=n+u-l,w=r+c-l;if((h=wt(e,t,n,r,x,w,l+a)).length>0&&h[0]>=x&&h[1]>=w)return[h[0],h[1]];var E=n-u+l,k=r+c-l;return(h=wt(e,t,n,r,E,k,l+a)).length>0&&h[0]<=E&&h[1]>=k?[h[0],h[1]]:[]},ft=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},pt=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,f=Math.max(r,s,o)+l;return!(e<u||e>c||t<d||t>f)},ht=function(e,t,n,r,i,o,a,s){var l=[];!function(e,t,n,r,i){var o,a,s,l,u,c,d,f;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,d=t/3,o>0?(u=(u=s+Math.sqrt(o))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+u+c,d+=(u+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+u)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===o?(f=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*f-d,i[4]=i[2]=-(f+d)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),f=2*Math.sqrt(a),i[0]=-d+f*Math.cos(l/3),i[2]=-d+f*Math.cos((l+2*Math.PI)/3),i[4]=-d+f*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,f,p,h=-1,v=0;v<u.length;v++)d=Math.pow(1-u[v],2)*n+2*(1-u[v])*u[v]*i+u[v]*u[v]*a,f=Math.pow(1-u[v],2)*r+2*(1-u[v])*u[v]*o+u[v]*u[v]*s,p=Math.pow(d-e,2)+Math.pow(f-t,2),h>=0?p<h&&(h=p):h=p;return h},vt=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],l=s[0]*s[0]+s[1]*s[1],u=a[0]*a[0]+a[1]*a[1],c=a[0]*s[0]+a[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-i)*(e-i)+(t-o)*(t-o):u-d},gt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],a=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},yt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,f=Math.cos(-u),p=Math.sin(-u),h=0;h<c.length/2;h++)c[2*h]=o/2*(n[2*h]*f-n[2*h+1]*p),c[2*h+1]=a/2*(n[2*h+1]*f+n[2*h]*p),c[2*h]+=r,c[2*h+1]+=i;if(l>0){var v=bt(c,-l);d=mt(v)}else d=c;return gt(e,t,d)},mt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],i=e[4*c+3],c<e.length/4-1?(o=e[4*(c+1)],a=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(o=e[0],a=e[1],s=e[2],l=e[3]);var d=kt(t,n,r,i,o,a,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},bt=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var l=o-r,u=-(i-n),c=Math.sqrt(l*l+u*u),d=l/c,f=u/c;a[4*s]=n+d*t,a[4*s+1]=r+f*t,a[4*s+2]=i+d*t,a[4*s+3]=o+f*t}return a},xt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},wt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],l=[e-i,t-o],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-a*a);if(d<0)return[];var f=(-c+Math.sqrt(d))/(2*u),p=(-c-Math.sqrt(d))/(2*u),h=Math.min(f,p),v=Math.max(f,p),g=[];if(h>=0&&h<=1&&g.push(h),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},Et=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},kt=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,f=t-o,p=r-t,h=s-o,v=d*f-h*u,g=c*f-p*u,y=h*c-d*p;if(0!==y){var m=v/y,b=g/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===v||0===g?Et(e,n,a)===a?[a,s]:Et(e,n,i)===i?[i,o]:Et(i,a,n)===n?[n,r]:[]:[]},St=function(e,t,n,r,i,o,a,s){var l,u,c,d,f,p,h=[],v=new Array(n.length),g=!0;if(null==o&&(g=!1),g){for(var y=0;y<v.length/2;y++)v[2*y]=n[2*y]*o+r,v[2*y+1]=n[2*y+1]*a+i;if(s>0){var m=bt(v,-s);u=mt(m)}else u=v}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],d=u[2*b+1],b<u.length/2-1?(f=u[2*(b+1)],p=u[2*(b+1)+1]):(f=u[0],p=u[1]),0!==(l=kt(e,t,r,i,c,d,f,p)).length&&h.push(l[0],l[1]);return h},Pt=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},_t=function(e,t){var n=jt(e,t);return n=Ct(n)},Ct=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var u=2/(a-i),c=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var f=0;f<r;f++)n=e[2*f+1]=e[2*f+1]+(-1-o);return e},jt=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Tt=function(e,t){return Math.min(e/4,t/4,8)},Dt=function(e,t){return Math.min(e/10,t/10,8)},Ot=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Nt=we({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Mt={pageRank:function(e){for(var t=Nt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,f=u.length,p=new Array(d),h=new Array(c),v=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){p[g*c+y]=0}h[g]=0}for(var m=0;m<f;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),k=l.indexOfId(w),S=o(b);p[k*c+E]+=S,h[E]+=S}}for(var P=1/c+v,_=0;_<c;_++)if(0===h[_])for(var C=0;C<c;C++){p[C*c+_]=P}else for(var j=0;j<c;j++){var T=j*c+_;p[T]=p[T]/h[_]+v}for(var D,O=new Array(c),N=new Array(c),M=0;M<c;M++)O[M]=1;for(var L=0;L<i;L++){for(var A=0;A<c;A++)N[A]=0;for(var I=0;I<c;I++)for(var B=0;B<c;B++){var z=I*c+B;N[I]+=p[z]*O[B]}Je(N),D=O,O=N,N=D;for(var R=0,F=0;F<c;F++){var V=D[F]-O[F];R+=V*V}if(R<r)break}return{rank:function(e){return e=a.collection(e)[0],O[l.indexOf(e)]}}}},Lt=we({root:null,weight:function(e){return 1},directed:!1,alpha:0}),At={degreeCentralityNormalized:function(e){e=Lt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[c]=d.indegree,o[c]=d.outdegree}return{indegree:function(e){return 0==a?0:(b(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var f={},p=0,h=0;h<r;h++){var v=n[h];e.root=v;var g=this.degreeCentrality(e);p<g.degree&&(p=g.degree),f[v.id()]=g.degree}return{degree:function(e){return 0===p?0:(b(e)&&(e=t.filter(e)),f[e.id()]/p)}}},degreeCentrality:function(e){e=Lt(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var l=i.connectedEdges(),u=l.filter((function(e){return e.target().same(i)&&n.has(e)})),c=l.filter((function(e){return e.source().same(i)&&n.has(e)})),d=u.length,f=c.length,p=0,h=0,v=0;v<u.length;v++)p+=o(u[v]);for(var g=0;g<c.length;g++)h+=o(c[g]);return{indegree:Math.pow(d,1-s)*Math.pow(p,s),outdegree:Math.pow(f,1-s)*Math.pow(h,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=o(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};At.dc=At.degreeCentrality,At.dcn=At.degreeCentralityNormalised=At.degreeCentralityNormalized;var It=we({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Bt={closenessCentralityNormalized:function(e){for(var t=It(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),c=0;c<l.length;c++){for(var d=0,f=l[c],p=0;p<l.length;p++)if(c!==p){var h=u.distance(f,l[p]);d+=n?1/h:h}n||(d=1/d),s<d&&(s=d),a[f.id()]=d}return{closeness:function(e){return 0==s?0:(e=b(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=It(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=a.distanceTo(c);s+=o?1/d:d}}return o?s:1/s}};Bt.cc=Bt.closenessCentrality,Bt.ccn=Bt.closenessCentralityNormalised=Bt.closenessCentralityNormalized;var zt=we({weight:null,directed:!1}),Rt={betweennessCentrality:function(e){for(var t=zt(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),s=this.nodes(),l={},u={},c=0,d=function(e,t){u[e]=t,t>c&&(c=t)},f=function(e){return u[e]},p=0;p<s.length;p++){var h=s[p],v=h.id();l[v]=n?h.outgoers().nodes():h.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=s[e].id(),n=[],u={},c={},p={},h=new o((function(e,t){return p[e]-p[t]})),v=0;v<s.length;v++){var g=s[v].id();u[g]=[],c[g]=0,p[g]=1/0}for(c[t]=1,p[t]=0,h.push(t);!h.empty();){var y=h.pop();if(n.push(y),i)for(var m=0;m<l[y].length;m++){var b=l[y][m],x=a.getElementById(y),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var E=r(w);b=b.id(),p[b]>p[y]+E&&(p[b]=p[y]+E,h.nodes.indexOf(b)<0?h.push(b):h.updateItem(b),c[b]=0,u[b]=[]),p[b]==p[y]+E&&(c[b]=c[b]+c[y],u[b].push(y))}else for(var k=0;k<l[y].length;k++){var S=l[y][k].id();p[S]==1/0&&(h.push(S),p[S]=p[y]+1),p[S]==p[y]+1&&(c[S]=c[S]+c[y],u[S].push(y))}}for(var P={},_=0;_<s.length;_++)P[s[_].id()]=0;for(;n.length>0;){for(var C=n.pop(),j=0;j<u[C].length;j++){var T=u[C][j];P[T]=P[T]+c[T]/c[C]*(1+P[C])}C!=s[e].id()&&d(C,f(C)+P[C])}},y=0;y<s.length;y++)g(y);var m={betweenness:function(e){var t=a.collection(e).id();return f(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=a.collection(e).id();return f(t)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};Rt.bc=Rt.betweennessCentrality;var Ft=we({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Vt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Gt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Ut=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},Wt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Ut(e,r,t);return e},qt=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Gt(r,t),r},Ht=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Yt=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Xt=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Ft(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var f=0;f<n.length;f++){var p=n[f],h=o[p.source().id()],v=o[p.target().id()],g=Vt(p,i.attributes);c[h*l+v]+=g,c[v*l+h]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,i.multFactor),Gt(c,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Wt(c,l,i.expandFactor),c=qt(s,l,i.inflateFactor),Ht(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Yt(e[t],e[n])&&e.splice(n,1);return e}(b),b},Kt={markovClustering:Xt,mcl:Xt},Qt=function(e){return e},$t=function(e,t){return Math.abs(t-e)},Zt=function(e,t,n){return e+$t(t,n)},Jt=function(e,t,n){return e+Math.pow(n-t,2)},en=function(e){return Math.sqrt(e)},tn=function(e,t,n){return Math.max(e,$t(t,n))},nn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Qt,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},rn={euclidean:function(e,t,n){return e>=2?nn(e,t,n,0,Jt,en):nn(e,t,n,0,Zt)},squaredEuclidean:function(e,t,n){return nn(e,t,n,0,Jt)},manhattan:function(e,t,n){return nn(e,t,n,0,Zt)},max:function(e,t,n){return nn(e,t,n,-1/0,tn)}};function on(e,t,n,r,i,o){var a;return a=x(e)?e:rn[e]||rn.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}rn["squared-euclidean"]=rn.squaredEuclidean,rn.squaredeuclidean=rn.squaredEuclidean;var an=we({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),sn=function(e){return an(e)},ln=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return on(e,r.length,o,(function(e){return r[e](t)}),a,s)},un=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(o[c]-i[c])+i[c];a[u]=s}return a},cn=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=ln(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},dn=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},fn=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},pn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},hn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];pn(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},vn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=ln("manhattan",t[i],e,n,"kMedoids");return r},gn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var u=0;u<e.length;u++)for(var c=0;c<i.attributes.length;c++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][u]*i.attributes[c](t[d]),a+=r[d][u];e[u][c]=o/a}},yn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,l,u=2/(i.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){a=0;for(var f=0;f<n.length;f++)s=ln(i.distance,r[d],n[c],i.attributes,"cmeans"),l=ln(i.distance,r[d],n[f],i.attributes,"cmeans"),a+=Math.pow(s/l,u);e[d][c]=1/a}},mn=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=sn(e);i=new Array(s.length);for(var u=0;u<s.length;u++)i[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var f=0,p=0;p<l.k;p++)r[d][p]=Math.random(),f+=r[d][p];for(var h=0;h<l.k;h++)r[d][h]=r[d][h]/f}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);o=new Array(s.length);for(var g=0;g<s.length;g++)o[g]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,gn(n,s,r,o,l),yn(r,i,n,s,l),fn(r,i,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){i=-1/0,o=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c<a.length;c++)a[c]=r.collection(a[c]);return a}(s,r,l,a),{clusters:t,degreeOfMembership:r}},bn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=sn(e),s=new Array(o.k),l={};t=o.testMode?"number"==typeof o.testCentroids?un(r,o.k,o.attributes):"object"===a(o.testCentroids)?o.testCentroids:un(r,o.k,o.attributes):un(r,o.k,o.attributes);for(var u,c,d,f=!0,p=0;f&&p<o.maxIterations;){for(var h=0;h<r.length;h++)l[(i=r[h]).id()]=cn(i,t,o.distance,o.attributes,"kMeans");f=!1;for(var v=0;v<o.k;v++){var g=dn(v,r,l);if(0!==g.length){for(var y=o.attributes.length,m=t[v],b=new Array(y),x=new Array(y),w=0;w<y;w++){x[w]=0;for(var E=0;E<g.length;E++)i=g[E],x[w]+=o.attributes[w](i);b[w]=x[w]/g.length,u=b[w],c=m[w],d=o.sensitivityThreshold,Math.abs(c-u)<=d||(f=!0)}t[v]=b,s[v]=n.collection(g)}}p++}return s},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,s=sn(e),l=new Array(s.k),u={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(t="object"===a(s.testCentroids)?s.testCentroids:hn(i,s.k)):t=hn(i,s.k);for(var d=!0,f=0;d&&f<s.maxIterations;){for(var p=0;p<i.length;p++)u[(o=i[p]).id()]=cn(o,t,s.distance,s.attributes,"kMedoids");d=!1;for(var h=0;h<t.length;h++){var v=dn(h,i,u);if(0!==v.length){c[h]=vn(t[h],v,s.attributes);for(var g=0;g<v.length;g++)(n=vn(v[g],v,s.attributes))<c[h]&&(c[h]=n,t[h]=v[g],d=!0);l[h]=r.collection(v)}}f++}return l},fuzzyCMeans:mn,fcm:mn},xn=we({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),wn={single:"min",complete:"max"},En=function(e,t,n,r,i){for(var o,a=0,s=1/0,l=i.attributes,u=function(e,t){return on(i.distance,l.length,(function(t){return l[t](e)}),(function(e){return l[e](t)}),e,t)},c=0;c<e.length;c++){var d=e[c].key,f=n[d][r[d]];f<s&&(a=d,s=f)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,h=t[a],v=t[r[a]];p="dendrogram"===i.mode?{left:h,right:v,key:h.key}:{value:h.value.concat(v.value),key:h.key},e[h.index]=p,e.splice(v.index,1),t[h.key]=p;for(var g=0;g<e.length;g++){var y=e[g];h.key===y.key?o=1/0:"min"===i.linkage?(o=n[h.key][y.key],n[h.key][y.key]>n[v.key][y.key]&&(o=n[v.key][y.key])):"max"===i.linkage?(o=n[h.key][y.key],n[h.key][y.key]<n[v.key][y.key]&&(o=n[v.key][y.key])):o="mean"===i.linkage?(n[h.key][y.key]*h.size+n[v.key][y.key]*v.size)/(h.size+v.size):"dendrogram"===i.mode?u(y.value,h.value):u(y.value[0],h.value[0]),n[h.key][y.key]=n[y.key][h.key]=o}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===h.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return h.key=v.key=h.index=v.index=null,!0},kn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},Sn=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0},Pn=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&kn(t.left,i),t.right&&kn(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&kn(t.left,i),t.right&&kn(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))},_n=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=xn(e),n=wn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return on(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],l=[],u=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};a[c]=d,u[c]=d,s[c]=[],l[c]=0}for(var f=0;f<a.length;f++)for(var p=0;p<=f;p++){var h=void 0;h="dendrogram"===r.mode?f===p?1/0:o(a[f].value,a[p].value):f===p?1/0:o(a[f].value[0],a[p].value[0]),s[f][p]=h,s[p][f]=h,h<s[f][l[f]]&&(l[f]=p)}for(var v,g=En(a,u,s,l,r);g;)g=En(a,u,s,l,r);return"dendrogram"===r.mode?(v=Pn(a[0],r.dendrogramDepth,t),r.addDendrogram&&Sn(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},Cn={hierarchicalClustering:_n,hca:_n},jn=we({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Tn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-on(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Dn=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t,n},On=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},Nn=function(e){for(var t,n,r,i,o,a,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||he("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||k(n)||he("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),jn(e)}(e),c={},d=0;d<l.length;d++)c[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var f=0;f<n;f++)r[f]=-1/0;for(var p=0;p<t;p++)for(var h=0;h<t;h++)p!==h&&(r[p*t+h]=Tn(u.distance,l[p],l[h],u.attributes));i=Dn(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var y=0;y<n;y++)a[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,S=new Array(t*u.minIterations),P=0;P<S.length;P++)S[P]=0;for(E=0;E<u.maxIterations;E++){for(var _=0;_<t;_++){for(var C=-1/0,j=-1/0,T=-1,D=0,O=0;O<t;O++)m[O]=o[_*t+O],(D=a[_*t+O]+r[_*t+O])>=C?(j=C,C=D,T=O):D>j&&(j=D);for(var N=0;N<t;N++)o[_*t+N]=(1-u.damping)*(r[_*t+N]-C)+u.damping*m[N];o[_*t+T]=(1-u.damping)*(r[_*t+T]-j)+u.damping*m[T]}for(var M=0;M<t;M++){for(var L=0,A=0;A<t;A++)m[A]=a[A*t+M],b[A]=Math.max(0,o[A*t+M]),L+=b[A];L-=b[M],b[M]=o[M*t+M],L+=b[M];for(var I=0;I<t;I++)a[I*t+M]=(1-u.damping)*Math.min(0,L-b[I])+u.damping*m[I];a[M*t+M]=(1-u.damping)*(L-b[M])+u.damping*m[M]}for(var B=0,z=0;z<t;z++){var R=a[z*t+z]+o[z*t+z]>0?1:0;S[E%u.minIterations*t+z]=R,B+=R}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var F=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<u.minIterations;G++)x[V]+=S[G*t+V];0!==x[V]&&x[V]!==u.minIterations||F++}if(F===t)break}}for(var U=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),W=function(e,t,n){for(var r=On(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,l=-1/0,u=0;u<o.length;u++){for(var c=0,d=0;d<o.length;d++)c+=t[o[d]*e+o[u]];c>l&&(s=u,l=c)}n[i]=o[s]}return On(e,t,n)}(t,r,U),q={},H=0;H<U.length;H++)q[U[H]]=[];for(var Y=0;Y<l.length;Y++){var X=W[c[l[Y].id()]];null!=X&&q[X].push(l[Y])}for(var K=new Array(U.length),Q=0;Q<U.length;Q++)K[Q]=s.collection(q[U[Q]]);return K},Mn={affinityPropagation:Nn,ap:Nn},Ln=we({root:void 0,directed:!1}),An=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={},s=function s(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var d,f,p,h,v=e.getElementById(u).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(u))):v.forEach((function(n){d=n.source().id(),f=n.target().id(),(p=d===u?f:d)!==c&&(h=n.id(),a[h]||(a[h]=!0,o.push({x:u,y:p,edge:n})),p in t?t[u].low=Math.min(t[u].low,t[p].id):(s(l,p,u),t[u].low=Math.min(t[u].low,t[p].low),t[u].id<=t[p].low&&(t[u].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],l=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter((function(e){return e.isLoop()}))):l.merge(i)}))})),i.push(l)}(u,p))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},In=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},Bn={};[Oe,Me,Le,Ie,ze,Fe,We,Mt,At,Bt,Rt,Kt,bn,Cn,Mn,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=Ln(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var f={found:!1,trail:void 0};if(u)return f;if(r&&n)if(s){if(i&&r!=i)return f;i=r}else{if(i&&r!=i&&n!=i)return f;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},h=[],v=[];for(v=p(i);1!=v.length;)0==c[v[0]].length?(h.unshift(l.getElementById(v.shift())),h.unshift(l.getElementById(v.shift()))):v=p(v.shift()).concat(v);for(var g in h.unshift(l.getElementById(v.shift())),c)if(c[g].length)return f;return f.found=!0,f.trail=this.spawn(h,!0),f}},{hopcroftTarjanBiconnected:An,htbc:An,htb:An,hopcroftTarjanBiconnectedComponents:An},{tarjanStronglyConnected:In,tsc:In,tscc:In,tarjanStronglyConnectedComponents:In}].forEach((function(e){R(Bn,e)}));var zn=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};zn.prototype={fulfill:function(e){return Rn(this,1,"fulfillValue",e)},reject:function(e){return Rn(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new zn;return n.onFulfilled.push(Gn(e,r,"fulfill")),n.onRejected.push(Gn(t,r,"reject")),Fn(n),r.proxy}};var Rn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Fn(e)),e},Fn=function(e){1===e.state?Vn(e,"onFulfilled",e.fulfillValue):2===e.state&&Vn(e,"onRejected",e.rejectReason)},Vn=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Gn=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}Un(t,i)}}},Un=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===a(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};zn.all=function(e){return new zn((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},zn.resolve=function(e){return new zn((function(t,n){t(e)}))},zn.reject=function(e){return new zn((function(t,n){n(e)}))};var Wn="undefined"!=typeof Promise?Promise:zn,qn=function(e,t,n){var r=j(e),i=!r,o=this._private=R({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&x(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Hn=qn.prototype;R(Hn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),P(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new Wn((function(e,n){t.push((function(){e()}))}))}}),Hn.complete=Hn.completed,Hn.run=Hn.play,Hn.running=Hn.playing;var Yn={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){t[n]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,i=r?n:[n],o=this._private.cy||this,a=!r,s=!a;if(!o.styleEnabled())return this;var l=o.style();if(e=R({},e,t),0===Object.keys(e).length)return new qn(i[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var u=e.renderedPosition,c=o.pan(),d=o.zoom();e.position=He(u,d,c)}if(a&&null!=e.panBy){var f=e.panBy,p=o.pan();e.pan={x:p.x+f.x,y:p.y+f.y}}var h=e.center||e.centre;if(a&&null!=h){var v=o.getCenterPan(h.eles,e.zoom);null!=v&&(e.pan=v)}if(a&&null!=e.fit){var g=e.fit,y=o.getFitViewport(g.eles||g.boundingBox,g.padding);null!=y&&(e.pan=y.pan,e.zoom=y.zoom)}if(a&&E(e.zoom)){var m=o.getZoomedViewport(e.zoom);null!=m?(m.zoomed&&(e.zoom=m.zoom),m.panned&&(e.pan=m.pan)):e.zoom=null}return new qn(i[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=R({},e,t));for(var i=0;i<r.length;i++){var o=r[i],a=o.animated()&&(void 0===e.queue||e.queue);o.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<r.length;o++){for(var a=r[o]._private,s=a.animation.current,l=0;l<s.length;l++){var u=s[l]._private;t&&(u.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return i.notify("draw"),this}}},Xn={data:function(e){return e=R({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,o=void 0!==i.length,a=o?i:[i],s=o?i[0]:i;if(b(t)){var l;if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),l=s._private[r.field][t]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=c({},t,n);r.beforeSet(i,u);for(var d=0,f=a.length;d<f;d++){var p=a[d];r.canSet(p)&&(p._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&E(t)){var h,v,g=t,y=Object.keys(g);r.beforeSet(i,g);for(var m=0;m<y.length;m++){if(v=g[h=y[m]],!r.immutableKeys[h])for(var w=0;w<a.length;w++){var k=a[w];r.canSet(k)&&(k._private[r.field][h]=v)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t)){var S=t;i.on(r.bindingEvent,S)}else if(r.allowGetting&&void 0===t){var P;return s&&(r.beforeGet(s),P=s._private[r.field]),P}return i}},removeData:function(e){return e=R({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=void 0!==r.length?r:[r];if(b(t)){for(var o=t.split(/\s+/),a=o.length,s=0;s<a;s++){var l=o[s];if(!D(l))if(!n.immutableKeys[l])for(var u=0,c=i.length;u<c;u++)i[u]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var d=0,f=i.length;d<f;d++)for(var p=i[d]._private[n.field],h=Object.keys(p),v=0;v<h.length;v++){var g=h[v];!n.immutableKeys[g]&&(p[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},Kn={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Wn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}},Qn={};[Yn,Xn,Kn].forEach((function(e){R(Qn,e)}));var $n={animate:Qn.animate(),animation:Qn.animation(),animated:Qn.animated(),clearQueue:Qn.clearQueue(),delay:Qn.delay(),delayAnimation:Qn.delayAnimation(),stop:Qn.stop()},Zn={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new je(e),o=0;o<t.length;o++){for(var a=t[o],s=a._private,l=s.classes,u=!1,c=0;c<e.length;c++){var d=e[c];if(!l.has(d)){u=!0;break}}u||(u=l.size!==e.length),u&&(s.classes=i,r.push(a))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o<a;o++)for(var s=n[o],l=s._private.classes,u=!1,c=0;c<e.length;c++){var d=e[c],f=l.has(d),p=!1;t||r&&!f?(l.add(d),p=!0):(!t||r&&f)&&(l.delete(d),p=!0),!u&&p&&(i.push(s),u=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Zn.className=Zn.classNames=Zn.classes;var Jn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Jn.variable="(?:[\\w-]|(?:\\\\"+Jn.metaChar+"))+",Jn.value=Jn.string+"|"+Jn.number,Jn.className=Jn.variable,Jn.id=Jn.variable,function(){var e,t,n;for(e=Jn.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],Jn.comparatorOp+="|@"+t;for(e=Jn.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(Jn.comparatorOp+="|\\!"+t)}();var er=0,tr=1,nr=2,rr=3,ir=4,or=5,ar=6,sr=7,lr=8,ur=9,cr=10,dr=11,fr=12,pr=13,hr=14,vr=15,gr=16,yr=17,mr=18,br=19,xr=20,wr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*z(e,t)}(e.selector,t.selector)})),Er=function(){for(var e,t={},n=0;n<wr.length;n++)t[(e=wr[n]).selector]=e.matches;return t}(),kr="("+wr.map((function(e){return e.selector})).join("|")+")",Sr=function(e){return e.replace(new RegExp("\\\\("+Jn.metaChar+")","g"),(function(e,t){return t}))},Pr=function(e,t,n){e[e.length-1]=n},_r=[{name:"group",query:!0,regex:"("+Jn.group+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:er,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:kr,populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:sr,value:r})}},{name:"id",query:!0,regex:"\\#("+Jn.id+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:lr,value:Sr(r)})}},{name:"className",query:!0,regex:"\\.("+Jn.className+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:ur,value:Sr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Jn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:ir,field:Sr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Jn.variable+")\\s*("+Jn.comparatorOp+")\\s*("+Jn.value+")\\s*\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+Jn.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:rr,field:Sr(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Jn.boolOp+")\\s*("+Jn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,2),i=r[0],o=r[1];t.checks.push({type:or,field:Sr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Jn.meta+")\\s*("+Jn.comparatorOp+")\\s*("+Jn.number+")\\s*\\]\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];t.checks.push({type:ar,field:Sr(i),operator:o,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:Jn.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:Jn.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:dr,source:r,target:i}),Pr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:fr,source:a,target:s}),Pr(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:Jn.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:cr,nodes:[r,i]}),Pr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:hr,node:a,neighbor:s}),Pr(e,0,o),s}},{name:"child",separator:!0,regex:Jn.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:vr,parent:i,child:r}),Pr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return o.checks.push({type:br,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:xr}],c.checks.push({type:xr}),s.checks.push({type:yr,parent:c,child:u}),Pr(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},p=[{type:yr,parent:d,child:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:"descendant",separator:!0,regex:Jn.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:gr,ancestor:i,descendant:r}),Pr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return o.checks.push({type:br,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:xr}],c.checks.push({type:xr}),s.checks.push({type:mr,ancestor:c,descendant:u}),Pr(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},p=[{type:mr,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}},{name:"subject",modifier:!0,regex:Jn.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return ge("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===dr?n.type=pr:r===cr&&(n.type=hr,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];_r.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Cr=function(e){for(var t,n,r,i=0;i<_r.length;i++){var o=_r[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},jr={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(n);;){var i=Cr(n);if(null==i.expr)return ge("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),a=i.expr.populate(t,r,o);if(!1===a)return!1;if(null!=a&&(r=a),(n=i.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var u=t[l];if(u.compoundCount>0&&u.edgeCount>0)return ge("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return ge("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&ge("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,o){var a=r.type,s=r.value;switch(a){case er:var l=e(s);return l.substring(0,l.length-1);case rr:var u=r.field,c=r.operator;return"["+u+n(e(c))+t(s)+"]";case or:var d=r.operator,f=r.field;return"["+e(d)+f+"]";case ir:return"["+r.field+"]";case ar:var p=r.operator;return"[["+r.field+n(e(p))+t(s)+"]]";case sr:return s;case lr:return"#"+s;case ur:return"."+s;case yr:case vr:return i(r.parent,o)+n(">")+i(r.child,o);case mr:case gr:return i(r.ancestor,o)+" "+i(r.descendant,o);case br:var h=i(r.left,o),v=i(r.subject,o),g=i(r.right,o);return h+(h.length>0?" ":"")+v+g;case xr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,o){return n+(t===e&&0===o?"$":"")+r(i,t)}),"")},o="",a=0;a<this.length;a++){var s=this[a];o+=i(s,s.subject),this.length>1&&a<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},Tr=function(e,t,n){var r,i,o,a=b(e),s=k(e),l=b(n),u=!1,c=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!c||null==e&&d||(r=!r),r},Dr=function(e,t){return e.data(t)},Or=[],Nr=function(e,t){return e.checks.every((function(e){return Or[e.type](e,t)}))};Or[er]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Or[sr]=function(e,t){return function(e,t){return Er[e](t)}(e.value,t)},Or[lr]=function(e,t){var n=e.value;return t.id()===n},Or[ur]=function(e,t){var n=e.value;return t.hasClass(n)},Or[ar]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Tr(function(e,t){return e[t]()}(t,n),r,i)},Or[rr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Tr(Dr(t,n),r,i)},Or[or]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Dr(t,n),r)},Or[ir]=function(e,t){var n=e.field;e.operator;return void 0!==Dr(t,n)},Or[cr]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return Nr(n,i)&&Nr(r,o)||Nr(r,i)&&Nr(n,o)},Or[hr]=function(e,t){return Nr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Nr(e.neighbor,t)}))},Or[dr]=function(e,t){return Nr(e.source,t.source())&&Nr(e.target,t.target())},Or[fr]=function(e,t){return Nr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Nr(e.target,t)}))},Or[pr]=function(e,t){return Nr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Nr(e.source,t)}))},Or[vr]=function(e,t){return Nr(e.child,t)&&Nr(e.parent,t.parent())},Or[yr]=function(e,t){return Nr(e.parent,t)&&t.children().some((function(t){return Nr(e.child,t)}))},Or[gr]=function(e,t){return Nr(e.descendant,t)&&t.ancestors().some((function(t){return Nr(e.ancestor,t)}))},Or[mr]=function(e,t){return Nr(e.ancestor,t)&&t.descendants().some((function(t){return Nr(e.descendant,t)}))},Or[br]=function(e,t){return Nr(e.subject,t)&&Nr(e.left,t)&&Nr(e.right,t)},Or[xr]=function(){return!0},Or[tr]=function(e,t){return e.value.has(t)},Or[nr]=function(e,t){return(0,e.value)(t)};var Mr={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Nr(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===lr)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Nr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Lr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(P(e)?this.addQuery({checks:[{type:tr,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:nr,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):he("A selector must be created from a string; found "))},Ar=Lr.prototype;[jr,Mr].forEach((function(e){return R(Ar,e)})),Ar.text=function(){return this.inputText},Ar.size=function(){return this.length},Ar.eq=function(e){return this[e]},Ar.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Ar.addQuery=function(e){this[this.length++]=e},Ar.selector=Ar.toString;var Ir={allAre:function(e){var t=new Lr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Lr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};Ir.allAreNeighbours=Ir.allAreNeighbors,Ir.has=Ir.contains,Ir.equal=Ir.equals=Ir.same;var Br,zr,Rr=function(e,t){return function(n,r,i,o){var a,s=n,l=this;if(null==s?a="":P(s)&&1===s.length&&(a=s.id()),1===l.length&&a){var u=l[0]._private,c=u.traversalCache=u.traversalCache||{},d=c[t]=c[t]||[],f=re(a),p=d[f];return p||(d[f]=e.call(l,n,r,i,o))}return e.call(l,n,r,i,o)}},Fr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:Rr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Vr(e,t,n,r){for(var i=[],o=new je,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):a&&r(i,o,l)}for(;i.length>0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Gr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function Ur(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function Wr(e,t,n){Ur(e,t,n),Gr(e,t,n)}Fr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,Gr)},Fr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,Ur)},Fr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,Wr)},Fr.ancestors=Fr.parents,(Br=zr={data:Qn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Qn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Qn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Br.data,Br.removeAttr=Br.removeData;var qr,Hr,Yr=zr,Xr={};function Kr(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;a<o.length;a++){var s=o[a];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function Qr(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}R(Xr,{degree:Kr((function(e,t){return t.source().same(t.target())?2:1})),indegree:Kr((function(e,t){return t.target().same(e)?1:0})),outdegree:Kr((function(e,t){return t.source().same(e)?1:0}))}),R(Xr,{minDegree:Qr("degree",(function(e,t){return e<t})),maxDegree:Qr("degree",(function(e,t){return e>t})),minIndegree:Qr("indegree",(function(e,t){return e<t})),maxIndegree:Qr("indegree",(function(e,t){return e>t})),minOutdegree:Qr("outdegree",(function(e,t){return e<t})),maxOutdegree:Qr("outdegree",(function(e,t){return e>t}))}),R(Xr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var $r=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},Zr={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){$r(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};qr=Hr={position:Qn.data(Zr),silentPosition:Qn.data(R({},Zr,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){$r(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(E(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(E(e)?(r={x:k(e.x)?e.x:0,y:k(e.y)?e.y:0},n=t):b(e)&&k(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o],s=a.position(),l={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(l):a.position(l)}i.endBatch()}return this},silentShift:function(e,t){return E(e)?this.shift(e,!0):b(e)&&k(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=E(e)?e:void 0,s=void 0!==a||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var l=n.position();return a=qe(l,i,o),void 0===e?a:a[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-o[e])/i):void 0!==a&&c.position(He(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=E(e)?e:void 0,o=void 0!==i||void 0!==t&&b(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),l=a?n.parent():null,u=l&&l.length>0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var f=0;f<this.length;f++){var p=this[f],h=a?p.parent():null,v=h&&h.length>0,g=v;v&&(h=h[0]);var y=g?h.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},qr.modelPosition=qr.point=qr.position,qr.modelPositions=qr.points=qr.positions,qr.renderedPoint=qr.renderedPosition,qr.relativePoint=qr.relativePosition;var Jr,ei,ti=Hr;Jr=ei={},ei.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},ei.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},ei.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),f=d.biasDiff,p=d.biasComplementDiff,h=y(i.height.val-o.h,u,c),v=h.biasDiff,g=h.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-f+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var ni=function(e){return e===1/0||e===-1/0?0:e},ri=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ii=function(e,t){return null==t?e:ri(e,t.x1,t.y1,t.x2,t.y2)},oi=function(e,t,n){return Se(e,t,n)},ai=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,ot(u,1),ri(e,u.x1,u.y1,u.x2,u.y2)}}},si=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),f=oi(o,"labelWidth",n),p=oi(o,"labelHeight",n),h=oi(o,"labelX",n),v=oi(o,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,k=p,S=f,P=S/2,_=k/2;if(m)a=h-P,s=h+P,l=v-_,u=v+_;else{switch(c.value){case"left":a=h-S,s=h;break;case"center":a=h-P,s=h+P;break;case"right":a=h,s=h+S}switch(d.value){case"top":l=v-k,u=v;break;case"center":l=v-_,u=v+_;break;case"bottom":l=v,u=v+k}}a+=g-Math.max(x,w)-E-2,s+=g+Math.max(x,w)+E+2,l+=y-Math.max(x,w)-E-2,u+=y+Math.max(x,w)+E+2;var C=n||"main",j=i.labelBounds,T=j[C]=j[C]||{};T.x1=a,T.y1=l,T.x2=s,T.y2=u,T.w=s-a,T.h=u-l;var D=m&&"autorotate"===b.strValue,O=null!=b.pfValue&&0!==b.pfValue;if(D||O){var N=D?oi(i.rstyle,"labelAngle",n):b.pfValue,M=Math.cos(N),L=Math.sin(N),A=(a+s)/2,I=(l+u)/2;if(!m){switch(c.value){case"left":A=s;break;case"right":A=a}switch(d.value){case"top":I=u;break;case"bottom":I=l}}var B=function(e,t){return{x:(e-=A)*M-(t-=I)*L+A,y:e*L+t*M+I}},z=B(a,l),R=B(a,u),F=B(s,l),V=B(s,u);a=Math.min(z.x,R.x,F.x,V.x),s=Math.max(z.x,R.x,F.x,V.x),l=Math.min(z.y,R.y,F.y,V.y),u=Math.max(z.y,R.y,F.y,V.y)}var G=C+"Rot",U=j[G]=j[G]||{};U.x1=a,U.y1=l,U.x2=s,U.y2=u,U.w=s-a,U.h=u-l,ri(e,a,l,s,u),ri(i.labelBounds.all,a,l,s,u)}return e}},li=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},ui=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Z({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},ci=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?fi:li(t))===fi,a=ui(e),s=r.bbCachePosKey===a,l=t.useCache&&s,u=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||u(e)||i&&u(e.source())||u(e.target())?(s||e.recalculateRenderedStyle(l),n=function(e,t){var n,r,i,o,a,s,l,u=e._private.cy,c=u.styleEnabled(),d=u.headless(),f=rt(),p=e._private,h=e.isNode(),v=e.isEdge(),g=p.rstyle,y=h&&c?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!c||m(e)&&(!v||m(e.source())&&m(e.target()));if(b){var x=0;c&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;if(c&&(w=e.pstyle("width").pfValue/2),h&&t.includeNodes){var E=e.position();a=E.x,s=E.y;var k=e.outerWidth()/2,S=e.outerHeight()/2;ri(f,n=a-k,i=s-S,r=a+k,o=s+S)}else if(v&&t.includeEdges)if(c&&!d){var P=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),ri(f,n-=w,i-=w,r+=w,o+=w),"haystack"===P){var _=g.haystackPts;if(_&&2===_.length){if(n=_[0].x,i=_[0].y,n>(r=_[1].x)){var C=n;n=r,r=C}if(i>(o=_[1].y)){var j=i;i=o,o=j}ri(f,n-w,i-w,r+w,o+w)}}else if("bezier"===P||"unbundled-bezier"===P||"segments"===P||"taxi"===P){var T;switch(P){case"bezier":case"unbundled-bezier":T=g.bezierPts;break;case"segments":case"taxi":T=g.linePts}if(null!=T)for(var D=0;D<T.length;D++){var O=T[D];n=O.x-w,r=O.x+w,i=O.y-w,o=O.y+w,ri(f,n,i,r,o)}}}else{var N=e.source().position(),M=e.target().position();if((n=N.x)>(r=M.x)){var L=n;n=r,r=L}if((i=N.y)>(o=M.y)){var A=i;i=o,o=A}ri(f,n-=w,i-=w,r+=w,o+=w)}if(c&&t.includeEdges&&v&&(ai(f,e,"mid-source"),ai(f,e,"mid-target"),ai(f,e,"source"),ai(f,e,"target")),c&&"yes"===e.pstyle("ghost").value){var I=e.pstyle("ghost-offset-x").pfValue,B=e.pstyle("ghost-offset-y").pfValue;ri(f,f.x1+I,f.y1+B,f.x2+I,f.y2+B)}var z=p.bodyBounds=p.bodyBounds||{};st(z,f),at(z,y),ot(z,1),c&&(n=f.x1,r=f.x2,i=f.y1,o=f.y2,ri(f,n-x,i-x,r+x,o+x));var R=p.overlayBounds=p.overlayBounds||{};st(R,f),at(R,y),ot(R,1);var F=p.labelBounds=p.labelBounds||{};null!=F.all?((l=F.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):F.all=rt(),c&&t.includeLabels&&(t.includeMainLabels&&si(f,e,null),v&&(t.includeSourceLabels&&si(f,e,"source"),t.includeTargetLabels&&si(f,e,"target")))}return f.x1=ni(f.x1),f.y1=ni(f.y1),f.x2=ni(f.x2),f.y2=ni(f.y2),f.w=ni(f.x2-f.x1),f.h=ni(f.y2-f.y1),f.w>0&&f.h>0&&b&&(at(f,y),ot(f,1)),f}(e,di),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=rt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ii(n,r.overlayBounds):ii(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ii(n,r.labelBounds.all):(t.includeMainLabels&&ii(n,r.labelBounds.mainRot),t.includeSourceLabels&&ii(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ii(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},di={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},fi=li(di),pi=we(di);ei.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=rt();var n=pi(e=e||di),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var o=r[i],a=o._private,s=ui(o),l=a.bbCachePosKey===s,u=n.useCache&&l&&!a.styleDirty;o.recalculateRenderedStyle(u)}this.updateCompoundBounds(!e.useCache);for(var c=0;c<r.length;c++){var d=r[c];ii(t,ci(d,n))}}else e=void 0===e?di:pi(e),t=ci(this[0],e);return t.x1=ni(t.x1),t.y1=ni(t.y1),t.x2=ni(t.x2),t.y2=ni(t.y2),t.w=ni(t.x2-t.x1),t.h=ni(t.y2-t.y1),t},ei.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},ei.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),E(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},Jr.boundingbox=Jr.bb=Jr.boundingBox,Jr.renderedBoundingbox=Jr.renderedBoundingBox;var hi,vi,gi=ei;hi=vi={};var yi=function(e){e.uppercaseName=I(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=I(e.outerName),hi[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}return 1}},hi["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},hi["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},hi["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};yi({name:"width"}),yi({name:"height"}),vi.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},vi.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},vi.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var mi=vi,bi={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},xi=Object.keys(bi).reduce((function(e,t){var n=bi[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return qe(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return qe(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),wi=R({},ti,gi,mi,xi),Ei=function(e,t){this.recycle(e,t)};function ki(){return!1}function Si(){return!0}Ei.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=ki,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Si:ki):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Si;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Si;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Si,this.stopPropagation()},isDefaultPrevented:ki,isPropagationStopped:ki,isImmediatePropagationStopped:ki};var Pi=/^([^.]+)(\.(?:[^.]+))?$/,_i={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ci=Object.keys(_i),ji={};function Ti(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ji,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ci.length;n++){var r=Ci[n];this[r]=e[r]||_i[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Di=Ti.prototype,Oi=function(e,t,n,r,i,o,a){x(r)&&(i=r,r=null),a&&(o=null==o?a:R({},o,a));for(var s=w(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!D(u)){var c=u.match(Pi);if(c)if(!1===t(e,u,c[1],c[2]?c[2]:null,r,i,o))break}}},Ni=function(e,t){return e.addEventFields(e.context,t),new Ei(t.type,t)},Mi=function(e,t,n){if("event"!==m(n))if(E(n))t(e,Ni(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!D(o)){var a=o.match(Pi);if(a){var s=a[1],l=a[2]?a[2]:null;t(e,Ni(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Di.on=Di.addListener=function(e,t,n,r,i){return Oi(this,(function(e,t,n,r,i,o,a){x(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Di.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Di.removeListener=Di.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];Oi(i,(function(t,n,r,i,l,u){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!u||s.callback===u))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(s);return this},Di.removeAllListeners=function(){return this.removeListener("*")},Di.emit=Di.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),Mi(this,(function(e,o){null!=n&&(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}],i=r.length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),l=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===l&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var Li={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&_(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Ai=function(e){return b(e)?new Lr(e):e},Ii={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Ti(Li,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Ai(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=Ai(t),i=0;i<this.length;i++){this[i].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=Ai(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=Ai(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Qn.eventAliasesOn(Ii);var Bi={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||P(e))return new Lr(e).filter(this);if(x(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var o=r[i];(t?e.apply(t,[o,i,r]):e(o,i,r))&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,i=this.length<e.length,o=i?this:r,a=i?r:this,s=0;s<o.length;s++){var l=o[s];a.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],o=i._private.data.id;t.hasElementWithId(o)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],a=o._private.data.id;t.hasElementWithId(a)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],a=!this.has(o);a&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=a,i.set(s,{ele:a,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var o=r[i],a=t?e.apply(t,[o,i,r]):e(o,i,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n,r=-1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s>r&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s<r&&(r=s,n=a)}return{value:r,ele:n}}},zi=Bi;zi.u=zi["|"]=zi["+"]=zi.union=zi.or=zi.add,zi["\\"]=zi["!"]=zi["-"]=zi.difference=zi.relativeComplement=zi.subtract=zi.not,zi.n=zi["&"]=zi["."]=zi.and=zi.intersection=zi.intersect,zi["^"]=zi["(+)"]=zi["(-)"]=zi.symmetricDifference=zi.symdiff=zi.xor,zi.fnFilter=zi.filterFn=zi.stdFilter=zi.filter,zi.complement=zi.abscomp=zi.absoluteComplement;var Ri=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?ue:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},Fi={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Ri)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ue-1}var r=t.source,i=t.target,o=r.zDepth(),a=i.zDepth();return Math.max(o,a,0)}}};Fi.each=Fi.forEach;var Vi;Vi="undefined",("undefined"==typeof Symbol?"undefined":a(Symbol))!=Vi&&a(Symbol.iterator)!=Vi&&(Fi[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return c({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Gi=we({nodeDimensionsIncludeLabels:!1}),Ui={layoutDimensions:function(e){var t;if(e=Gi(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=N(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=t.spacingFactor&&1!==t.spacingFactor,u=function(){if(!l)return null;for(var e=rt(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);it(e,i.x,i.y)}return e}(),c=N((function(e,n){var r=s(e,n);l&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),u,r));return null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var f=r[d],p=c(f,d);if(null==t.animateFilter||t.animateFilter(f,d)){var h=f.animation({position:p,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(h)}else f.position(p)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Wn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(c),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(R({},e,{eles:this}))}};function Wi(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function qi(e,t){return e=re(e),function(n){return Wi(e,t,n)}}function Hi(e,t){e=re(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Wi(e,n,t)}}Ui.createLayout=Ui.makeLayout=Ui.layout;var Yi={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(E(e)){var i=e;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var o=this[0];return o?r.getStylePropertyValue(o,e):void 0}r.applyBypass(this,e,t,false),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style(),r=this;if(void 0===e)for(var i=0;i<r.length;i++){var o=r[i];n.removeAllBypasses(o,false)}else{e=e.split(/\s+/);for(var a=0;a<r.length;a++){var s=r[a];n.removeBypasses(s,e,false)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++){i*=o[a].pstyle("opacity").value}return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function Xi(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function Ki(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||Xi(i,r);var s=a.source,l=a.target;return n(s)&&(!o||Xi(s,n))&&(s===l||n(l)&&(!o||Xi(l,n)))}}}var Qi=qi("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));Yi.takesUpSpace=Hi("takesUpSpace",Ki({ok:Qi}));var $i=qi("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&Qi(e)})),Zi=qi("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&Qi(e)}));Yi.interactive=Hi("interactive",Ki({ok:$i,parentOk:Zi,edgeOkViaNode:Qi})),Yi.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var Ji=qi("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&Qi(e)})),eo=Qi;Yi.visible=Hi("visible",Ki({ok:Ji,edgeOkViaNode:eo})),Yi.hidden=function(){var e=this[0];if(e)return!e.visible()},Yi.isBundledBezier=Hi("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),Yi.bypass=Yi.css=Yi.style,Yi.renderedCss=Yi.renderedStyle,Yi.removeBypass=Yi.removeCss=Yi.removeStyle,Yi.pstyle=Yi.parsedStyle;var to={};function no(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&w(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],c=l._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(l);if(void 0!==d&&(u=d,!d))return this}u&&(l._private[e.field]=e.value,c&&n.push(l))}var f=this.spawn(n);f.updateStyle(),f.emit(e.event),a&&f.emit(a)}return this}}function ro(e){to[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},to[e.on]=no({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),to[e.off]=no({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}ro({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),ro({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),ro({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),ro({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),to.deselect=to.unselect,to.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},ro({field:"active",on:"activate",off:"unactivate"}),ro({field:"pannable",on:"panify",off:"unpanify"}),to.inactive=function(){var e=this[0];if(e)return!e._private.active};var io={},oo=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var l=a[s],u=l.source(),c=l.target();if(e.noIncomingEdges&&c===i&&u!==i||e.noOutgoingEdges&&u===i&&c!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},ao=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),u=s.target();e.outgoing&&l===i?(n.push(s),n.push(u)):e.incoming&&u===i&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},so=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var l=o[s],u=l.id();i[u]||(i[u]=!0,r.push(l),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function lo(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function uo(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var l=a[s],u=l._private.data,c=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),d=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);if(c||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c)continue;if(i.thisIsTgt&&!d)continue}n.push(l)}}return this.spawn(n,!0)}}function co(e){return e=R({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,l=s._private.data.id,u=a.data.target,c=s._private.edges,d=0;d<c.length;d++){var f=c[d],p=f._private.data,h=p.target,v=p.source,g=h===u&&v===l,y=l===h&&u===v;(i.codirected&&g||!i.codirected&&(g||y))&&n.push(f)}return this.spawn(n,!0).filter(t)}}io.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},R(io,{roots:oo({noIncomingEdges:!0}),leaves:oo({noOutgoingEdges:!0}),outgoers:Rr(ao({outgoing:!0}),"outgoers"),successors:so({outgoing:!0}),incomers:Rr(ao({incoming:!0}),"incomers"),predecessors:so({incoming:!0})}),R(io,{neighborhood:Rr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),u=s.target(),c=i===l?u:l;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),io.neighbourhood=io.neighborhood,io.closedNeighbourhood=io.closedNeighborhood,io.openNeighbourhood=io.openNeighborhood,R(io,{source:Rr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Rr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:lo({attr:"source"}),targets:lo({attr:"target"})}),R(io,{edgesWith:Rr(uo(),"edgesWith"),edgesTo:Rr(uo({thisIsSrc:!0}),"edgesTo")}),R(io,{connectedEdges:Rr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++){var a=i[o];t.push(a)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Rr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Rr(co(),"parallelEdges"),codirectedEdges:Rr(co({codirected:!0}),"codirectedEdges")}),R(io,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),io.componentsOf=io.components;var fo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){var r=new _e,i=!1;if(t){if(t.length>0&&E(t[0])&&!_(t[0])){i=!0;for(var o=[],a=new je,s=0,l=t.length;s<l;s++){var u=t[s];null==u.data&&(u.data={});var c=u.data;if(null==c.id)c.id=me();else if(e.hasElementWithId(c.id)||a.has(c.id))continue;var d=new Te(e,u,!1);o.push(d),a.add(c.id)}t=o}}else t=[];this.length=0;for(var f=0,p=t.length;f<p;f++){var h=t[f][0];if(null!=h){var v=h._private.data.id;n&&r.has(v)||(n&&r.set(v,{index:this.length,ele:h}),this[this.length]=h,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new _e,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=r),i&&this.restore()}else he("A collection must have a reference to the core")},po=Te.prototype=fo.prototype=Object.create(Array.prototype);po.instanceString=function(){return"collection"},po.spawn=function(e,t){return new fo(this.cy(),e,t)},po.spawnSelf=function(){return this.spawn(this)},po.cy=function(){return this._private.cy},po.renderer=function(){return this._private.cy.renderer()},po.element=function(){return this[0]},po.collection=function(){return C(this)?this:new fo(this._private.cy,[this])},po.unique=function(){return new fo(this._private.cy,this,!0)},po.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},po.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new fo(t)},po.$id=po.getElementById,po.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},po.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},po.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},po.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(E(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,l=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=l&&l!=i.target&&(a.target=""+l,o=!0),o&&(t=t.move(a))}else{var u="parent"in e.data,c=e.data.parent;!u||null==c&&null==i.parent||c==i.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var d=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var f={data:ye(r.data),position:ye(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},p=0;return r.classes.forEach((function(e){return f.classes+=0==p++?e:" "+e})),f}}},po.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},po.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Te(e,r,!1);t.push(i)}return new fo(e,t)},po.copy=po.clone,po.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u<c;u++){var d=i[u];r&&!d.removed()||(d.isNode()?s.push(d):l.push(d))}e=s.concat(l);var f=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var p=e[t],h=p._private,v=h.data;if(p.clearTraversalCache(),r||h.removed)if(void 0===v.id)v.id=me();else if(k(v.id))v.id=""+v.id;else{if(D(v.id)||!b(v.id)){he("Can not create element with invalid string ID `"+v.id+"`"),f();continue}if(o.hasElementWithId(v.id)){he("Can not create second element with ID `"+v.id+"`"),f();continue}}else;var g=v.id;if(p.isNode()){var y=h.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(p.isEdge()){for(var m=p,x=["source","target"],w=x.length,E=!1,S=0;S<w;S++){var P=x[S],_=v[P];k(_)&&(_=v[P]=""+v[P]),null==_||""===_?(he("Can not create edge `"+g+"` with unspecified "+P),E=!0):o.hasElementWithId(_)||(he("Can not create edge `"+g+"` with nonexistant "+P+" `"+_+"`"),E=!0)}if(E){f();continue}var C=o.getElementById(v.source),j=o.getElementById(v.target);C.same(j)?C._private.edges.push(m):(C._private.edges.push(m),j._private.edges.push(m)),m._private.source=C,m._private.target=j}h.map=new _e,h.map.set(g,{ele:p,index:0}),h.removed=!1,r&&o.addToPool(p)}for(var T=0;T<s.length;T++){var O=s[T],N=O._private.data;k(N.parent)&&(N.parent=""+N.parent);var M=N.parent,L=null!=M;if(L){var A=o.getElementById(M);if(A.empty())N.parent=void 0;else{for(var I=!1,B=A;!B.empty();){if(O.same(B)){I=!0,N.parent=void 0;break}B=B.parent()}I||(A[0]._private.children.push(O),O._private.parent=A[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var z=e.length===i.length?i:new fo(o,e),R=0;R<z.length;R++){var F=z[R];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):z).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?z.emitAndNotify("add"):r&&z.emit("add")}return i},po.removed=function(){var e=this[0];return e&&e._private.removed},po.inside=function(){var e=this[0];return e&&!e._private.removed},po.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var u=0,c=n.length;u<c;u++){var d=n[u];l(d)}function f(e,t){var n=e._private.edges;Ee(n,t),e.clearTraversalCache()}function p(e){e.clearTraversalCache()}var h=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Ee(n,t),t._private.parent=null,h.ids[r]||(h.ids[r]=!0,h.push(e))}h.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var y=r[g];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];f(m,y),f(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var E=x[w];p(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var k=y.parent();0!==k.length&&v(k,y)}t&&(y._private.removed=!0)}var S=o._private.elements;o._private.hasCompoundNodes=!1;for(var P=0;P<S.length;P++){var _=S[P];if(_.isParent()){o._private.hasCompoundNodes=!0;break}}var C=new fo(this.cy(),r);C.size()>0&&(e?C.emitAndNotify("remove"):t&&C.emit("remove"));for(var j=0;j<h.length;j++){var T=h[j];t&&T.removed()||T.updateStyle()}return C},po.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,o=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var a=o(e.source),s=o(e.target),l=null!=a&&t.hasElementWithId(a),u=null!=s&&t.hasElementWithId(s);(l||u)&&(t.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],o=t._private.data;t.isEdge()&&(l&&(o.source=a),u&&(o.target=s))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var c=o(e.parent);if(null===c||t.hasElementWithId(c)){var d=null===c?void 0:c;t.batch((function(){var e=n.remove(r,i);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var o=n[t],a=o._private.data;o.isNode()&&(a.parent=d)}e.restore(r,i)})),n.emitAndNotify("move")}}return this},[Bn,$n,Zn,Ir,Fr,Yr,Xr,wi,Ii,Bi,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Fi,Ui,Yi,to,io].forEach((function(e){R(po,e)}));var ho={add:function(e){var t,n=this;if(P(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(a.json())}t=new fo(n,i)}}else if(w(e)){t=new fo(n,e)}else if(E(e)&&(w(e.nodes)||w(e.edges))){for(var s=e,l=[],u=["nodes","edges"],c=0,d=u.length;c<d;c++){var f=u[c],p=s[f];if(w(p))for(var h=0,v=p.length;h<v;h++){var g=R({group:f},p[h]);l.push(g)}}t=new fo(n,l)}else{t=new Te(n,e).collection()}return t},remove:function(e){if(P(e));else if(b(e)){var t=e;e=this.$(t)}return e.remove()}};var vo=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),go=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=1e-7,s=10,l=11,u=1/(l-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var f=c?new Float32Array(l):new Array(l);function p(e,t){return 1-3*t+3*e}function h(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((p(t,n)*e+h(t,n))*e+v(t))*e}function y(e,t,n){return 3*p(t,n)*e*e+2*h(t,n)*e+v(t)}function m(t,r){for(var o=0;o<i;++o){var a=y(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<l;++t)f[t]=g(t*u,e,n)}function x(t,r,i){var o,l,u=0;do{(o=g(l=r+(i-r)/2,e,n)-t)>0?i=l:r=l}while(Math.abs(o)>a&&++u<s);return l}function w(t){for(var r=0,i=1,a=l-1;i!==a&&f[i]<=t;++i)r+=u;--i;var s=r+(t-f[i])/(f[i+1]-f[i])*u,c=y(s,e,n);return c>=o?m(t,s):0===c?s:x(t,r,r+u)}var E=!1;function k(){E=!0,e===t&&n===r||b()}var S=function(i){return E||k(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};S.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var P="generateBezier("+[e,t,n,r]+")";return S.toString=function(){return P},S}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},yo={linear:function(e,t,n){return e+(t-e)*n},ease:go(.25,.1,.25,1),"ease-in":go(.42,0,1,1),"ease-out":go(0,0,.58,1),"ease-in-out":go(.42,0,.58,1),"ease-in-sine":go(.47,0,.745,.715),"ease-out-sine":go(.39,.575,.565,1),"ease-in-out-sine":go(.445,.05,.55,.95),"ease-in-quad":go(.55,.085,.68,.53),"ease-out-quad":go(.25,.46,.45,.94),"ease-in-out-quad":go(.455,.03,.515,.955),"ease-in-cubic":go(.55,.055,.675,.19),"ease-out-cubic":go(.215,.61,.355,1),"ease-in-out-cubic":go(.645,.045,.355,1),"ease-in-quart":go(.895,.03,.685,.22),"ease-out-quart":go(.165,.84,.44,1),"ease-in-out-quart":go(.77,0,.175,1),"ease-in-quint":go(.755,.05,.855,.06),"ease-out-quint":go(.23,1,.32,1),"ease-in-out-quint":go(.86,0,.07,1),"ease-in-expo":go(.95,.05,.795,.035),"ease-out-expo":go(.19,1,.22,1),"ease-in-out-expo":go(1,0,0,1),"ease-in-circ":go(.6,.04,.98,.335),"ease-out-circ":go(.075,.82,.165,1),"ease-in-out-circ":go(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return yo.linear;var r=vo(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":go};function mo(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function bo(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function xo(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=bo(e,i),s=bo(t,i);if(k(a)&&k(s))return mo(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u<s.length;u++){var c=a[u],d=s[u];if(null!=c&&null!=d){var f=mo(o,c,d,n,r);l.push(f)}else l.push(d)}return l}}function wo(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,l=a.startTime,u=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=yo.linear;else{var c,d,f;if(b(s))c=u.parse("transition-timing-function",s).value;else c=s;b(c)?(d=c,f=[]):(d=c[1],f=c.slice(2).map((function(e){return+e}))),f.length>0?("spring"===d&&f.push(a.duration),a.easingImpl=yo[d].apply(null,f)):a.easingImpl=yo[d]}var p,h=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var y={};Eo(v.x,g.x)&&(y.x=xo(v.x,g.x,p,h)),Eo(v.y,g.y)&&(y.y=xo(v.y,g.y,p,h)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Eo(m.x,x.x)&&(w.x=xo(m.x,x.x,p,h)),Eo(m.y,x.y)&&(w.y=xo(m.y,x.y,p,h)),e.emit("pan"));var k=a.startZoom,S=a.zoom,P=null!=S&&r;P&&(Eo(k,S)&&(o.zoom=nt(o.minZoom,xo(k,S,p,h),o.maxZoom)),e.emit("zoom")),(E||P)&&e.emit("viewport");var _=a.style;if(_&&_.length>0&&i){for(var C=0;C<_.length;C++){var j=_[C],T=j.name,D=j,O=a.startStyle[T],N=xo(O,D,p,h,u.properties[O.name]);u.overrideBypass(e,T,N)}e.emit("style")}}return a.progress=p,p}function Eo(e,t){return null!=e&&null!=t&&(!(!k(e)||!k(t))||!(!e||!t))}function ko(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function So(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var l=a.shift();l&&o.push(l)}for(var u=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],f=d._private;f.stopped?(o.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,u(f.frames)):(f.playing||f.applying)&&(f.playing&&f.applying&&(f.applying=!1),f.started||ko(0,d,e),wo(t,d,e,n),f.applying&&(f.applying=!1),u(f.frames),null!=f.step&&f.step(e),d.completed()&&(o.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,u(f.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var l=i(t,!0);(o||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Po={animate:Qn.animate(),animation:Qn.animation(),animated:Qn.animated(),clearQueue:Qn.clearQueue(),delay:Qn.delay(),delayAnimation:Qn.delayAnimation(),stop:Qn.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){So(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Y((function(n){So(n,e),t()}))}()}}},_o={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&_(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Co=function(e){return b(e)?new Lr(e):e},jo={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ti(_o,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Co(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Co(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Co(t),n),this},once:function(e,t,n){return this.emitter().one(e,Co(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Qn.eventAliasesOn(jo);var To={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};To.jpeg=To.jpg;var Do={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var o=new r(R({},e,{cy:t,eles:i}));return o}he("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else he("A `name` must be specified to make a layout");else he("Layout options must be specified to make a layout")}};Do.createLayout=Do.makeLayout=Do.layout;var Oo={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},No=we({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Mo={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&ge("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var r=No(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else he("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Mo.invalidateDimensions=Mo.resize;var Lo={collection:function(e,t){return b(e)?this.$(e):P(e)?e.collection():w(e)?new fo(this,e,t):new fo(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Lo.elements=Lo.filter=Lo.$;var Ao={},Io="t";Ao.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],o=t.getContextMeta(i);if(!o.empty){var a=t.getContextStyle(o),s=t.applyContextStyle(o,a,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Ao.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+"-"+t,o=r[i];if(o)return o;for(var a=[],s={},l=0;l<n.length;l++){var u=n[l],c=e[l]===Io,d=t[l]===Io,f=c!==d,p=u.mappedProperties.length>0;if(f||d&&p){var h=void 0;f&&p||f?h=u.properties:p&&(h=u.mappedProperties);for(var v=0;v<h.length;v++){for(var g=h[v],y=g.name,m=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===Io&&(m=null!=x.properties[g.name]))break}s[y]||m||(s[y]=!0,a.push(y))}}}return r[i]=a,a},Ao.getContextMeta=function(e){for(var t,n=this,r="",i=e._private.styleCxtKey||"",o=0;o<n.length;o++){var a=n[o];r+=a.selector&&a.selector.matches(e)?Io:"f"}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Ao.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if(t[i]===Io)for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},Ao.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],l=t[s],u=n.pstyle(s);if(!l){if(!u)continue;l=u.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(u!==l){if(l.mapped===o.fn&&null!=u&&null!=u.mapping&&u.mapping.value===l.value){var c=u.mapping;if((c.fnValue=l.value(n))===c.prevFnValue)continue}var d=i[s]={prev:u};this.applyParsedProperty(n,l),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},Ao.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,o=function(e,t,r){return n.getPropertiesHash(e,t,r)},a=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var u=0;u<i.length;u++){var c=i[u];t.styleKeys[c]=[K,$]}for(var d,f=function(e,n){return t.styleKeys[n][0]=J(e,t.styleKeys[n][0])},p=function(e,n){return t.styleKeys[n][1]=ee(e,t.styleKeys[n][1])},h=function(e,t){f(e,t),p(e,t)},v=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);f(r,t),p(r,t)}},g=0;g<r.length;g++){var y=r[g],m=l[y];if(null!=m){var b=this.properties[y],x=b.type,w=b.groupKey,E=void 0;null!=b.hashOverride?E=b.hashOverride(e,m):null!=m.pfValue&&(E=m.pfValue);var k=null==b.enums?m.value:null,S=null!=E,P=S||null!=k,_=m.units;if(x.number&&P&&!x.multiple)h(-128<(d=S?E:k)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),S||null==_||v(_,w);else v(m.strValue,w)}}for(var C,j,T=[K,$],D=0;D<i.length;D++){var O=i[D],N=t.styleKeys[O];T[0]=J(N[0],T[0]),T[1]=ee(N[1],T[1])}t.styleKey=(C=T[0],j=T[1],2097152*C+j);var M=t.styleKeys;t.labelDimsKey=te(M.labelDimensions);var L=o(e,["label"],M.labelDimensions);if(t.labelKey=te(L),t.labelStyleKey=te(ne(M.commonLabel,L)),!s){var A=o(e,["source-label"],M.labelDimensions);t.sourceLabelKey=te(A),t.sourceLabelStyleKey=te(ne(M.commonLabel,A));var I=o(e,["target-label"],M.labelDimensions);t.targetLabelKey=te(I),t.targetLabelStyleKey=te(ne(M.commonLabel,I))}if(s){var B=t.styleKeys,z=B.nodeBody,R=B.nodeBorder,F=B.backgroundImage,V=B.compound,G=B.pie,U=[z,R,F,V,G].filter((function(e){return null!=e})).reduce(ne,[K,$]);t.nodeKey=te(U),t.hasPie=null!=G&&G[0]!==K&&G[1]!==$}return a!==t.styleKey},Ao.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Ao.applyParsedProperty=function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,l=i.bypass,u=o[i.name],c=u&&u.bypass,d=e._private,f="mapping",p=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},h=function(){var t=p(u),n=p(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&ge("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",l)),i.delete)return o[i.name]=void 0,h(),!0;if(i.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,h(),!0):(h(),!0);if(i.deleteBypass)return u?!!u.bypass&&(o[i.name]=u.bypassed,h(),!0):(h(),!0);var v=function(){ge("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var g,y=i.field.split("."),m=d.data,b=0;b<y.length&&m;b++){m=m[y[b]]}if(null==m)return v(),!1;if(!k(m))return ge("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+m+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((g=0===x?0:(m-i.fieldMin)/x)<0?g=0:g>1&&(g=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],S=i.valueMin[1],P=i.valueMax[1],_=i.valueMin[2],C=i.valueMax[2],j=null==i.valueMin[3]?1:i.valueMin[3],T=null==i.valueMax[3]?1:i.valueMax[3],D=[Math.round(w+(E-w)*g),Math.round(S+(P-S)*g),Math.round(_+(C-_)*g),Math.round(j+(T-j)*g)];n={bypass:i.bypass,name:i.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*g;n=this.parse(i.name,O,i.bypass,f)}if(!n)return v(),!1;n.mapping=i,i=n;break;case a.data:for(var N=i.field.split("."),M=d.data,L=0;L<N.length&&M;L++){M=M[N[L]]}if(null!=M&&(n=this.parse(i.name,M,i.bypass,f)),!n)return v(),!1;n.mapping=i,i=n;break;case a.fn:var A=i.value,I=null!=i.fnValue?i.fnValue:A(e);if(i.prevFnValue=I,null==I)return ge("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,I,i.bypass,f)))return ge("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=ye(i),i=n;break;case void 0:break;default:return!1}return l?(i.bypassed=c?u.bypassed:u,o[i.name]=i):c?u.bypassed=i:o[i.name]=i,h(),!0},Ao.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else r._private.style={}}},Ao.update=function(){this._private.cy.mutableElements().updateStyle()},Ao.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},l=!1,u=0;u<i.length;u++){var c=i[u],d=e.pstyle(c),f=t[c];if(f){var p=f.prev,h=null!=f.next?f.next:d,v=!1,g=void 0,y=1e-6;p&&(k(p.pfValue)&&k(h.pfValue)?(v=h.pfValue-p.pfValue,g=p.pfValue+y*v):k(p.value)&&k(h.value)?(v=h.value-p.value,g=p.value+y*v):w(p.value)&&w(h.value)&&(v=p.value[0]!==h.value[0]||p.value[1]!==h.value[1]||p.value[2]!==h.value[2],g=p.strValue),v&&(s[c]=h.strValue,this.applyBypass(e,c,g),l=!0))}}if(!l)return;r.transitioning=!0,new Wn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ao.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ao.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ao.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"curve-style"!==t||"bezier"!==n&&"bezier"!==r||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Ao.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Bo={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.properties[o].name,s=this.parse(a,n,!0);s&&i.push(s)}}else if(b(t)){var l=this.parse(t,n,!0);l&&i.push(l)}else{if(!E(t))return!1;var u=t;r=n;for(var c=Object.keys(u),d=0;d<c.length;d++){var f=c[d],p=u[f];if(void 0===p&&(p=u[L(f)]),void 0!==p){var h=this.parse(f,p,!0);h&&i.push(h)}}}if(0===i.length)return!1;for(var v=!1,g=0;g<e.length;g++){for(var y=e[g],m={},x=void 0,w=0;w<i.length;w++){var k=i[w];if(r){var S=y.pstyle(k.name);x=m[k.name]={prev:S}}v=this.applyParsedProperty(y,ye(k))||v,r&&(x.next=y.pstyle(k.name))}v&&this.updateStyleHints(y),r&&this.updateTransitions(y,m,true)}return v},overrideBypass:function(e,t,n){t=M(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,l=a.mutiple,u=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,u,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],l=this.properties[s],u=i.pstyle(l.name);if(u&&u.bypass){var c=this.parse(s,"",!0),d=o[l.name]={prev:u};this.applyParsedProperty(i,c),d.next=i.pstyle(l.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,true)}}},zo={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(f&&t&&f.getComputedStyle)return f.getComputedStyle(t).getPropertyValue(e)}},Ro={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},i=0;i<n.properties.length;i++){var o=n.properties[i],a=n.getStylePropertyValue(e,o.name,t);null!=a&&(r[o.name]=a,r[L(o.name)]=a)}return r}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,l=o.strValue;if(n&&i.number&&null!=a&&k(a)){var u=e.cy().zoom(),c=function(e){return e*u},d=function(e,t){return c(e)+t},f=w(a);return(f?s.every((function(e){return null!=e})):null!=s)?f?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):f?a.map((function(e){return b(e)?e:""+c(e)})).join(" "):""+c(a)}if(null!=l)return l}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=E(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],l=r[a]||r[M(a)],u=this.parse(l.name,s);u&&t.push(u)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,l,u=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)u[0]=J(a,u[0]),u[1]=ee(a,u[1]);else for(o=i.strValue,l=0;l<o.length;l++)a=o.charCodeAt(l),u[0]=J(a,u[0]),u[1]=ee(a,u[1]);return u}};Ro.getPropertiesHash=Ro.getNonDefaultPropertiesHash;var Fo={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,o=r.style||r.css,a=Object.keys(o);t.selector(i);for(var s=0;s<a.length;s++){var l=a[s],u=o[l];t.css(l,u)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},Vo={appendFromString:function(e){var t,n,r,i=this,o=""+e;function a(){o=o.length>t.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(o.match(/^\s*$/))break;var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){ge("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u)if(new Lr(u).invalid){ge("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();continue}var c=l[2],d=!1;n=c;for(var f=[];;){if(n.match(/^\s*$/))break;var p=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!p){ge("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var h=p[1],v=p[2];if(this.properties[h])i.parse(h,v)?(f.push({name:h,val:v}),s()):(ge("Skipping property: Invalid property definition in: "+r),s());else ge("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}i.selector(u);for(var g=0;g<f.length;g++){var y=f[g];i.css(y.name,y.val)}a()}return i},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Go={};!function(){var e=B,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Go.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=D(e),r=D(t);return n&&!r||!n&&r}},o=Go.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],l=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],u=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],c=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],f=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],p=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:o.overlayShape,triggersBounds:i.any}],h=[{name:"underlay-padding",type:o.size,triggersBounds:i.any},{name:"underlay-color",type:o.color},{name:"underlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:o.overlayShape,triggersBounds:i.any}],v=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],g=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},y=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],m=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],x=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],w=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],E=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],k=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],S=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],P=[];Go.pieBackgroundN=16,P.push({name:"pie-size",type:o.sizeMaybePercent});for(var _=1;_<=Go.pieBackgroundN;_++)P.push({name:"pie-"+_+"-background-color",type:o.color}),P.push({name:"pie-"+_+"-background-size",type:o.percent}),P.push({name:"pie-"+_+"-background-opacity",type:o.zeroOneNumber});var C=[],j=Go.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;C.push({name:n,type:r,triggersBounds:i})}))}),{});var T=Go.properties=[].concat(d,v,f,p,h,k,c,u,a,s,l,y,m,x,P,w,E,C,S),O=Go.propertyGroups={behavior:d,transition:v,visibility:f,overlay:p,underlay:h,ghost:k,commonLabel:c,labelDimensions:u,mainLabel:a,sourceLabel:s,targetLabel:l,nodeBody:y,nodeBorder:m,backgroundImage:x,pie:P,compound:w,edgeLine:E,edgeArrow:C,core:S},N=Go.propertyGroupNames={};(Go.propertyGroupKeys=Object.keys(O)).forEach((function(e){N[e]=O[e].map((function(e){return e.name})),O[e].forEach((function(t){return t.groupKey=e}))}));var M=Go.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Go.propertyNames=T.map((function(e){return e.name}));for(var L=0;L<T.length;L++){var A=T[L];T[A.name]=A}for(var I=0;I<M.length;I++){var z=M[I],R=T[z.pointsTo],F={name:z.name,alias:!0,pointsTo:R};T.push(F),T[z.name]=F}}(),Go.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Go.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=R({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=Go.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return Go.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=t[o],s=this.parse(o,a);n[o]=s}}return e.defaultProperties=n,e.defaultProperties},Go.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Uo={parse:function(e,t,n,r){var i=this;if(x(t))return i.parseImplWarn(e,t,n,r);var o,a=ie(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=i.propCache=i.propCache||[];return(o=s[a])||(o=s[a]=i.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(o=ye(o))&&(o.value=ye(o.value)),o},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||ge("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||ge("The style value of `label` is deprecated for `"+i.name+"`"),i}};Uo.parseImpl=function(e,t,n,r){var i=this;e=M(e);var o=i.properties[e],a=t,s=i.types;if(!o)return null;if(void 0===t)return null;o.alias&&(o=o.pointsTo,e=o.name);var l=b(t);l&&(t=t.trim());var u,c,d=o.type;if(!d)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!l||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var f=s.data;return{name:e,value:u,strValue:""+t,mapped:f,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var h=this.parse(e,c[4]);if(!h||h.mapped)return!1;var v=this.parse(e,c[5]);if(!v||v.mapped)return!1;if(h.pfValue===v.pfValue||h.strValue===v.strValue)return ge("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`"),this.parse(e,h.strValue);if(d.color){var g=h.value,y=v.value;if(!(g[0]!==y[0]||g[1]!==y[1]||g[2]!==y[2]||g[3]!==y[3]&&(null!=g[3]&&1!==g[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:h.value,valueMax:v.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],S=[],P=[],_="",C=!1,j=0;j<m.length;j++){var T=i.parse(e,m[j],n,"multiple");C=C||b(T.value),E.push(T.value),P.push(null!=T.pfValue?T.pfValue:T.value),S.push(T.units),_+=(j>0?" ":"")+T.strValue}return d.validate&&!d.validate(E,S)?null:d.singleEnum&&C?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:P,strValue:_,bypass:n,units:S}}var D,O,N=function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var L,A="px";if(d.units&&(L=d.units),d.implicitUnits&&(A=d.implicitUnits),!d.unitless)if(l){var I="px|em"+(d.allowPercent?"|\\%":"");L&&(I=L);var z=t.match("^("+B+")("+I+")?$");z&&(t=z[1],L=z[2]||A)}else L&&!d.implicitUnits||(L=A);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,N();if(d.integer&&(!k(O=t)||Math.floor(O)!==O))return null;if(void 0!==d.min&&(t<d.min||d.strictMin&&t===d.min)||void 0!==d.max&&(t>d.max||d.strictMax&&t===d.max))return null;var R={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?R.pfValue=t:R.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(R.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(R.pfValue="rad"===L?t:(D=t,Math.PI*D/180)),"%"===L&&(R.pfValue=t/100),R}if(d.propList){var V=[],G=""+t;if("none"===G);else{for(var U=G.split(/\s*,\s*|\s+/),W=0;W<U.length;W++){var q=U[W].trim();i.properties[q]?V.push(q):ge("`"+q+"` is not a valid property name")}if(0===V.length)return null}return{name:e,value:V,strValue:0===V.length?"none":V.join(" "),bypass:n}}if(d.color){var H=F(t);return H?{name:e,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Y=N();if(Y)return Y}for(var X=d.regexes?d.regexes:[d.regex],K=0;K<X.length;K++){var Q=new RegExp(X[K]).exec(t);if(Q)return{name:e,value:d.singleRegexMatchValue?Q[1]:Q,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?N():null};var Wo=function e(t){if(!(this instanceof e))return new e(t);j(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):he("A style must have a core reference")},qo=Wo.prototype;qo.instanceString=function(){return"style"},qo.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},qo.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},qo.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},qo.selector=function(e){var t="core"===e?null:new Lr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},qo.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[L(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},qo.style=qo.css,qo.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},qo.append=function(e){return T(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},Wo.fromJson=function(e,t){var n=new Wo(e);return n.fromJson(t),n},Wo.fromString=function(e,t){return new Wo(e).fromString(t)},[Ao,Bo,zo,Ro,Fo,Vo,Go,Uo].forEach((function(e){R(qo,e)})),Wo.types=qo.types,Wo.properties=qo.properties,Wo.propertyGroups=qo.propertyGroups,Wo.propertyGroupNames=qo.propertyGroupNames,Wo.propertyGroupKeys=qo.propertyGroupKeys;var Ho={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return T(e)?t.style=e.generateStyle(this):w(e)?t.style=Wo.fromJson(this,e):b(e)?t.style=Wo.fromString(this,e):t.style=Wo(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Yo={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(b(o[0]))return a[e=o[0]];if(E(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,k(r)&&(a.x=r),k(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=o[0],t=o[1],"x"!==e&&"y"!==e||!k(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:E(e)&&(o=(i=s[0]).x,a=i.y,k(o)&&(l.x+=o),k(a)&&(l.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!k(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(k(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(b(e)){var i=e;e=this.$(i)}else if(E(r=e)&&k(r.x1)&&k(r.x2)&&k(r.y1)&&k(r.y2)){var o=e;(n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else P(e)||(e=this.mutableElements());if(!P(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),l=this.height();if(t=k(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(l-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return k(e)&&k(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):k(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:k(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),k(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=qe(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,a||!k(n)||n===o||null!=t&&(!k(t.x)||!k(t.y)))return null;if(null!=t){var s=i,l=o,u=n;return{zoomed:!0,panned:!0,zoom:u,pan:{x:-u/l*(t.x-s.x)+t.x,y:-u/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(k(e.zoom)||(n=!1),E(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;k(l.x)&&(t.pan.x=l.x,a=!1),k(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else P(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=f.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};Yo.centre=Yo.center,Yo.autolockNodes=Yo.autolock,Yo.autoungrabifyNodes=Yo.autoungrabify;var Xo={data:Qn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Xo.attr=Xo.data,Xo.removeAttr=Xo.removeData;var Ko=function(e){var t=this,n=(e=R({},e)).container;n&&!S(n)&&S(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==f&&void 0!==n&&!e.headless,a=e;a.layout=R({name:o?"grid":"null"},a.layout),a.renderer=R({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new fo(this),listeners:[],aniEles:new fo(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:k(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&k(a.pan.x)?a.pan.x:0,y:E(a.pan)&&k(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});l.styleEnabled&&t.setStyle([]);var u=R({},a,a.renderer);t.initRenderer(u);!function(e,t){if(e.some(O))return Wn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=R({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),a.done)}))},Qo=Ko.prototype;R(Qo,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!S(e)&&S(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(R({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return ye(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(E(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var l=""+s.data.id,u=t.getElementById(l);i[l]=!0,0!==u.length?o.push({ele:u,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else ge("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var c=0;c<o.length;c++){var d=o[c],f=d.ele,p=d.json;f.json(p)}};if(w(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var l=a[s],u=e.elements[l];w(u)&&o(u,l)}var c=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?c.merge(e):e.remove()})),c.forEach((function(e){return e.children().move({parent:null})})),c.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],f=0;f<d.length;f++){var p=d[f];null!=e[p]&&t[p](e[p])}return t.endBatch(),this}var h={};!!e?h.elements=this.elements().map((function(e){return e.json()})):(h.elements={},r.forEach((function(e){var t=e.group();h.elements[t]||(h.elements[t]=[]),h.elements[t].push(e.json())}))),this._private.styleEnabled&&(h.style=t.style().json()),h.data=ye(t.data());var v=n.options;return h.zoomingEnabled=n.zoomingEnabled,h.userZoomingEnabled=n.userZoomingEnabled,h.zoom=n.zoom,h.minZoom=n.minZoom,h.maxZoom=n.maxZoom,h.panningEnabled=n.panningEnabled,h.userPanningEnabled=n.userPanningEnabled,h.pan=ye(n.pan),h.boxSelectionEnabled=n.boxSelectionEnabled,h.renderer=ye(v.renderer),h.hideEdgesOnViewport=v.hideEdgesOnViewport,h.textureOnViewport=v.textureOnViewport,h.wheelSensitivity=v.wheelSensitivity,h.motionBlur=v.motionBlur,h.multiClickDebounceTime=v.multiClickDebounceTime,h}}),Qo.$id=Qo.getElementById,[ho,Po,jo,To,Do,Oo,Mo,Lo,Ho,Yo,Xo].forEach((function(e){R(Qo,e)}));var $o={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Zo=function(e){return e.scratch("breadthfirst")},Jo=function(e,t){return e.scratch("breadthfirst",t)};function ea(e){this.options=R({},$o,e)}ea.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,l=n.maximal||n.maximalAdjustments>0,u=rt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(P(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d<n.roots.length;d++){var f=n.roots[d],p=r.getElementById(f);c.push(p)}e=r.collection(c)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var h=i.components();e=r.collection();for(var v=function(t){var n=h[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},g=0;g<h.length;g++)v(g)}var y=[],m={},x=function(e,t){null==y[t]&&(y[t]=[]);var n=y[t].length;y[t].push(e),Jo(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();x(o,i),m[a]=!0}});for(var E=[],k=0;k<o.length;k++){var S=o[k];m[S.id()]||E.push(S)}var _=function(e){for(var t=y[e],n=0;n<t.length;n++){var r=t[n];null!=r?Jo(r,{depth:e,index:n}):(t.splice(n,1),n--)}},C=function(){for(var e=0;e<y.length;e++)_(e)},j=function(e,t){for(var n=Zo(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var l=r[s],u=Zo(l);o=Math.max(o,u.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=Zo(e),r=n.depth,i=n.index;y[r][i]=null,x(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&l){var T=[],D={},O=function(e){return T.push(e)};for(o.forEach((function(e){return T.push(e)}));T.length>0;){var N=T.shift(),M=j(N,D);if(M)N.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===M){ge("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}C();var L=0;if(n.avoidOverlap)for(var A=0;A<o.length;A++){var I=o[A].layoutDimensions(n),B=I.w,R=I.h;L=Math.max(L,B,R)}for(var F={},V=function(e){if(F[e.id()])return F[e.id()];for(var t=Zo(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var l=Zo(s);if(null!=l){var u=l.index,c=l.depth;if(null!=u&&null!=c){var d=y[c].length;c<t&&(r+=u/d,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[e.id()]=r,r},G=function(e,t){var n=V(e)-V(t);return 0===n?z(e.id(),t.id()):n},U=0;U<y.length;U++)y[U].sort(G),_(U);for(var W=[],q=0;q<E.length;q++)W.push(E[q]);y.unshift(W),C();for(var H=0,Y=0;Y<y.length;Y++)H=Math.max(y[Y].length,H);var X=u.x1+u.w/2,K=u.x1+u.h/2,Q=y.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=Zo(e),r=t.depth,i=t.index,o=y[r].length,a=Math.max(u.w/((n.grid?Q:o)+1),L),s=Math.max(u.h/(y.length+1),L),l=Math.min(u.w/2/y.length,u.h/2/y.length);if(l=Math.max(l,L),n.circle){var c=l*r+l-(y.length>0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:X+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:X+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var ta={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function na(e){this.options=R({},ta,e)}na.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,f=0;f<o.length;f++){var p=o[f].layoutDimensions(t),h=p.w,v=p.h;d=Math.max(d,h,v)}if(a=k(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(g*g+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ra,ia={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oa(e){this.options=R({},ia,e)}oa.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d<o.length;d++){var f,p=o[d];f=t.concentric(p),u.push({value:f,node:p}),p._private.scratch.concentric=f}o.updateStyle();for(var h=0;h<o.length;h++){var v=o[h].layoutDimensions(t);c=Math.max(c,v.w,v.h)}u.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),y=[[]],m=y[0],b=0;b<u.length;b++){var x=u[b];if(m.length>0)Math.abs(m[0].value-x.value)>=g&&(m=[],y.push(m));m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,k=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,k)}for(var S=0,P=0;P<y.length;P++){var _=y[P],C=void 0===t.sweep?2*Math.PI-2*Math.PI/_.length:t.sweep,j=_.dTheta=C/Math.max(1,_.length-1);if(_.length>1&&t.avoidOverlap){var T=Math.cos(j)-Math.cos(0),D=Math.sin(j)-Math.sin(0),O=Math.sqrt(w*w/(T*T+D*D));S=Math.max(O,S)}_.r=S,S+=w}if(t.equidistant){for(var N=0,M=0,L=0;L<y.length;L++){var A=y[L].r-M;N=Math.max(N,A)}M=0;for(var I=0;I<y.length;I++){var B=y[I];0===I&&(M=B.r),B.r=M,M+=N}}for(var z={},R=0;R<y.length;R++)for(var F=y[R],V=F.dTheta,G=F.r,U=0;U<F.length;U++){var W=F[U],q=t.startAngle+(n?1:-1)*V*U,H={x:s+G*Math.cos(q),y:l+G*Math.sin(q)};z[W.node.id()]=H}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return z[t]})),this};var aa={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function sa(e){this.options=R({},aa,e),this.options.layout=this}sa.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),ra=!0===e.debug;var r=la(t,n,e);ra&&undefined(r),e.randomize&&da(r);var i=X(),o=function(){pa(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter)&&(ha(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=fa(r,e,t);t.layoutPositions(n,e,i)}},l=0,u=!0;if(!0===e.animate){!function t(){for(var n=0;u&&n<e.refresh;)u=a(l),l++,n++;u?(X()-i>=e.animationThreshold&&o(),Y(t)):(_a(r,e),s())}()}else{for(;u;)u=a(l),l++;_a(r,e),s()}return this},sa.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},sa.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var la=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:rt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},l=0;l<a.length;l++)for(var u=a[l],c=0;c<u.length;c++){s[u[c].id()]=l}for(l=0;l<o.nodeSize;l++){var d=(g=i[l]).layoutDimensions(n);(M={}).isLocked=g.locked(),M.id=g.data("id"),M.parentId=g.data("parent"),M.cmptId=s[g.id()],M.children=[],M.positionX=g.position("x"),M.positionY=g.position("y"),M.offsetX=0,M.offsetY=0,M.height=d.w,M.width=d.h,M.maxX=M.positionX+M.width/2,M.minX=M.positionX-M.width/2,M.maxY=M.positionY+M.height/2,M.minY=M.positionY-M.height/2,M.padLeft=parseFloat(g.style("padding")),M.padRight=parseFloat(g.style("padding")),M.padTop=parseFloat(g.style("padding")),M.padBottom=parseFloat(g.style("padding")),M.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(M),o.idToIndex[M.id]=l}var f=[],p=0,h=-1,v=[];for(l=0;l<o.nodeSize;l++){var g,y=(g=o.layoutNodes[l]).parentId;null!=y?o.layoutNodes[o.idToIndex[y]].children.push(g.id):(f[++h]=g.id,v.push(g.id))}for(o.graphSet.push(v);p<=h;){var m=f[p++],b=o.idToIndex[m],w=o.layoutNodes[b].children;if(w.length>0){o.graphSet.push(w);for(l=0;l<w.length;l++)f[++h]=w[l]}}for(l=0;l<o.graphSet.length;l++){var E=o.graphSet[l];for(c=0;c<E.length;c++){var k=o.idToIndex[E[c]];o.indexToGraph[k]=l}}for(l=0;l<o.edgeSize;l++){var S=r[l],P={};P.id=S.data("id"),P.sourceId=S.data("source"),P.targetId=S.data("target");var _=x(n.idealEdgeLength)?n.idealEdgeLength(S):n.idealEdgeLength,C=x(n.edgeElasticity)?n.edgeElasticity(S):n.edgeElasticity,j=o.idToIndex[P.sourceId],T=o.idToIndex[P.targetId];if(o.indexToGraph[j]!=o.indexToGraph[T]){for(var D=ua(P.sourceId,P.targetId,o),O=o.graphSet[D],N=0,M=o.layoutNodes[j];-1===O.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],N++;for(M=o.layoutNodes[T];-1===O.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],N++;_*=N*n.nestingFactor}P.idealLength=_,P.elasticity=C,o.layoutEdges.push(P)}return o},ua=function(e,t,n){var r=ca(e,t,0,n);return 2>r.count?0:r.graph},ca=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var l=o[s],u=i.idToIndex[l],c=i.layoutNodes[u].children;if(0!==c.length){var d=e(t,n,i.indexToGraph[i.idToIndex[c[0]]],i);if(0!==d.count){if(1!==d.count)return d;if(2===++a)break}}}return{count:a,graph:r}},da=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},fa=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(a.positionX-i.x1)/i.w,l=(a.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:a.positionX,y:a.positionY}}},pa=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=fa(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},ha=function(e,t,n){va(e,t),xa(e),wa(e,t),Ea(e),ka(e)},va=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];ya(a,l,e,t)}},ga=function(e){return-e+2*e*Math.random()},ya=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=ga(1),o=ga(1));var a=ma(e,t,i,o);if(a>0)var s=(u=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),l=u*o/v;else{var u,c=ba(e,i,o),d=ba(t,-1*i,-1*o),f=d.x-c.x,p=d.y-c.y,h=f*f+p*p,v=Math.sqrt(h);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/h)*f/v,l=u*p/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},ma=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},ba=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0<n||0===t&&0>n?(u.x=r,u.y=i+o/2,u):0<t&&-1*l<=s&&s<=l?(u.x=r+a/2,u.y=i+a*n/2/t,u):0>t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0<n&&(s<=-1*l||s>=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},xa=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],o=e.layoutNodes[i],a=e.idToIndex[r.targetId],s=e.layoutNodes[a],l=s.positionX-o.positionX,u=s.positionY-o.positionY;if(0!==l||0!==u){var c=ba(o,l,u),d=ba(s,-1*l,-1*u),f=d.x-c.x,p=d.y-c.y,h=Math.sqrt(f*f+p*p),v=Math.pow(r.idealLength-h,2)/r.elasticity;if(0!==h)var g=v*f/h,y=v*p/h;else g=0,y=0;o.isLocked||(o.offsetX+=g,o.offsetY+=y),s.isLocked||(s.offsetX-=g,s.offsetY-=y)}}},wa=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]];o=l.positionX,a=l.positionY}for(var u=0;u<i;u++){var c=e.layoutNodes[e.idToIndex[r[u]]];if(!c.isLocked){var d=o-c.positionX,f=a-c.positionY,p=Math.sqrt(d*d+f*f);if(p>1){var h=t.gravity*d/p,v=t.gravity*f/p;c.offsetX+=h,c.offsetY+=v}}}}},Ea=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,c=s.offsetY,d=0;d<l.length;d++){var f=e.layoutNodes[e.idToIndex[l[d]]];f.offsetX+=u,f.offsetY+=c,n[++i]=l[d]}s.offsetX=0,s.offsetY=0}}},ka=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Sa(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Pa(i,e)}}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Sa=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Pa=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},_a=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++){if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var l=0;l<v.length;l++){var u=v[l];v.x1=Math.min(v.x1,u.positionX-u.width/2),v.x2=Math.max(v.x2,u.positionX+u.width/2),v.y1=Math.min(v.y1,u.positionY-u.height/2),v.y2=Math.max(v.y2,u.positionY+u.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,d=0,f=0,p=0,h=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(l=0;l<v.length;l++){(u=v[l]).isLocked||(u.positionX+=c-v.x1,u.positionY+=d-v.y1)}c+=v.w+t.componentSpacing,f+=v.w+t.componentSpacing,p=Math.max(p,v.h),f>h&&(d+=p+t.componentSpacing,c=0,f=0,p=0)}}},Ca={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ja(e){this.options=R({},Ca,e)}ja.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},f=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=f&&null!=p)l=f,u=p;else if(null!=f&&null==p)l=f,u=Math.ceil(a/l);else if(null==f&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var h=c(),v=d();(h-1)*v>=a?c(h-1):(v-1)*h>=a&&d(v-1)}else for(;u*l<a;){var g=c(),y=d();(y+1)*g>=a?d(y+1):c(g+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var k=w.layoutDimensions(t),S=t.avoidOverlapPadding,P=k.w+S,_=k.h+S;m=Math.max(m,P),b=Math.max(b,_)}for(var C={},j=function(e,t){return!!C["c-"+e+"-"+t]},T=function(e,t){C["c-"+e+"-"+t]=!0},D=0,O=0,N=function(){++O>=u&&(O=0,D++)},M={},L=0;L<i.length;L++){var A=i[L],I=t.position(A);if(I&&(void 0!==I.row||void 0!==I.col)){var B={row:I.row,col:I.col};if(void 0===B.col)for(B.col=0;j(B.row,B.col);)B.col++;else if(void 0===B.row)for(B.row=0;j(B.row,B.col);)B.row++;M[A.id()]=B,T(B.row,B.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=M[e.id()];if(i)n=i.col*m+m/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;j(D,O);)N();n=O*m+m/2+o.x1,r=D*b+b/2+o.y1,T(D,O),N()}return{x:n,y:r}}))}return this};var Ta={ready:function(){},stop:function(){}};function Da(e){this.options=R({},Ta,e)}Da.prototype.run=function(){var e=this.options,t=e.eles,n=this;e.cy;return n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Da.prototype.stop=function(){return this};var Oa={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Na(e){this.options=R({},Oa,e)}Na.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var Ma={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function La(e){this.options=R({},Ma,e)}La.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Aa=[{name:"breadthfirst",impl:ea},{name:"circle",impl:na},{name:"concentric",impl:oa},{name:"cose",impl:sa},{name:"grid",impl:ja},{name:"null",impl:Da},{name:"preset",impl:Na},{name:"random",impl:La}];function Ia(e){this.options=e,this.notifications=0}var Ba=function(){},za=function(){throw new Error("A headless instance can not render images")};Ia.prototype={recalculateRenderedStyle:Ba,notify:function(){this.notifications++},init:Ba,isHeadless:function(){return!0},png:za,jpg:za};var Ra={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){var s=i.x-n/2-a,l=i.x+n/2+a,u=i.y-n/2-a,c=i.y+n/2+a;return s<=e&&e<=l&&u<=t&&t<=c},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:o*n+i.x,y:a+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2){var s=e[a],l=e[a+1];o.push(r(s,l,t,n,i))}return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=R({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var l=o(i(this.points,n+2*s,r,a));return gt(e,t,l)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:de,roughCollide:de,draw:pe,spacing:fe,gap:fe}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var l=i(this.points,n,o,a),u=this.controlPoint,c=r(u[0],u[1],n,o,a);t.arrowShapeImpl(this.name)(e,l,c)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,l){var u=o(i(this.points,n+2*l,r,a)),c=o(i(this.pointsTee,n+2*l,r,a));return gt(e,t,u)||gt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,l){var u=a,c=Math.pow(u.x-e,2)+Math.pow(u.y-t,2)<=Math.pow((n+2*l)*this.radius,2),d=o(i(this.points,n+2*l,r,a));return gt(e,t,d)||c},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,l){var u=o(i(this.points,n+2*l,r,a)),c=o(i(this.crossLinePts(n,s),n+2*l,r,a));return gt(e,t,u)||gt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),l=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},Fa={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),l=n.zoom();return[((e-i)/a-s.x)/l,((t-o)/a-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=f.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),l=r("border-left-width"),u=r("border-right-width"),c=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),p=e.clientHeight,h=i+o,v=a+s,g=l+u,y=t.width/(d+g),m=d-h,b=p-v,x=t.left+i+l,w=t.top+a+c;return this.containerBB=[x,w,m,b,y]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,l=s.getCachedZSortedEles(),u=[],c=s.cy.zoom(),d=s.cy.hasCompoundNodes(),f=(r?24:8)/c,p=(r?8:2)/c,h=(r?8:2)/c,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,u.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<u.length;n++)if(u[n].isEdge()){u[n]=e,i=e,v=null!=t?t:v;break}}else u.push(e),i=e,v=null!=t?t:v}function y(n){var r=n.outerWidth()+2*p,i=n.outerHeight()+2*p,o=r/2,l=i/2,u=n.position();if(u.x-o<=e&&e<=u.x+o&&u.y-l<=t&&t<=u.y+l&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,u.x,u.y))return g(n,0),!0}function m(n){var r,i=n._private,o=i.rscratch,l=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,p=l/2+f,h=p*p,v=2*p,m=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(ft(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&h>(r=vt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(pt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&h>(r=ht(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),k=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<k.length;w++){var S=k[w],P=s.arrowShapes[n.pstyle(S.name+"-arrow-shape").value],_=n.pstyle("width").pfValue;if(P.roughCollide(e,t,E,S.angle,{x:S.x,y:S.y},_,f)&&P.collide(e,t,E,S.angle,{x:S.x,y:S.y},_,f))return g(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Se(e,t,n)}function x(n,r){var i,o=n._private,a=h;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),f=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-f,y=s.x2+a-f,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),k=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},S=k(v,m),P=k(v,x),_=k(y,m),C=k(y,x),j=[S.x+f,S.y+p,_.x+f,_.y+p,C.x+f,C.y+p,P.x+f,P.y+p];if(gt(e,t,j))return g(n),!0}else if(ut(s,e,t))return g(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),f=rt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p<a.length;p++){var h=a[p];if(h.isNode()){var v=h,g=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});lt(f,g)&&!ct(g,f)&&s.push(v)}else{var y=h,m=y._private,b=m.rscratch;if(null!=b.startX&&null!=b.startY&&!ut(f,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!ut(f,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,E=0;E<x.length;E++)if(i=f,o=x[E],!ut(i,o.x,o.y)){w=!1;break}w&&s.push(y)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(y)}}return s}},Va={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,l="haystack"===s.edgeType,u="bezier"===s.edgeType,c="multibezier"===s.edgeType,d="segments"===s.edgeType,f="compound"===s.edgeType,p="self"===s.edgeType;if(l?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),v=s.midX,g=s.midY,d)t=r-s.segpts[0],n=i-s.segpts[1];else if(c||f||p||u){var h=s.allpts;t=r-et(h[0],h[2],h[4],.1),n=i-et(h[1],h[3],h[5],.1)}else t=r-v,n=i-g;s.srcArrowAngle=Xe(t,n);var v=s.midX,g=s.midY;if(l&&(v=(r+o)/2,g=(i+a)/2),t=o-r,n=a-i,d)if((h=s.allpts).length/2%2==0){var y=(m=h.length/2)-2;t=h[m]-h[y],n=h[m+1]-h[y+1]}else{y=(m=h.length/2-1)-2;var m,b=m+2;t=h[m]-h[y],n=h[m+1]-h[y+1]}else if(c||f||p){var x,w,E,k,h=s.allpts;if(s.ctrlpts.length/2%2==0){var S=(P=(_=h.length/2-1)+2)+2;x=et(h[_],h[P],h[S],0),w=et(h[_+1],h[P+1],h[S+1],0),E=et(h[_],h[P],h[S],1e-4),k=et(h[_+1],h[P+1],h[S+1],1e-4)}else{var P,_;S=(P=h.length/2-1)+2;x=et(h[_=P-2],h[P],h[S],.4999),w=et(h[_+1],h[P+1],h[S+1],.4999),E=et(h[_],h[P],h[S],.5),k=et(h[_+1],h[P+1],h[S+1],.5)}t=E-x,n=k-w}(s.midtgtArrowAngle=Xe(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((h=s.allpts).length/2%2==0||(t=-(h[b=(m=h.length/2-1)+2]-h[m]),n=-(h[b+1]-h[m+1])));if(s.midsrcArrowAngle=Xe(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(c||f||p||u){var C=(h=s.allpts).length;t=o-et(h[C-6],h[C-4],h[C-2],.9),n=a-et(h[C-5],h[C-3],h[C-1],.9)}else t=o-v,n=a-g;s.tgtArrowAngle=Xe(t,n)}};Va.getArrowWidth=Va.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Ga={};function Ua(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Ga.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,l=a.position(),u=s.position(),c=a.width(),d=s.width(),f=a.height(),p=s.height(),h=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*h+l.x,i.source.y*f*h+l.y,i.target.x*d*h+u.x,i.target.y*p*h+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Ga.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),l=e.pstyle("segment-distances"),u=Math.min(s.pfValue.length,l.pfValue.length);n.edgeType="segments",n.segpts=[];for(var c=0;c<u;c++){var d=s.pfValue[c],f=l.pfValue[c],p=1-d,h=d,v="node-position"===a?r:i,g={x:v.x1*p+v.x2*h,y:v.y1*p+v.y2*h};n.segpts.push(g.x+o.x*f,g.y+o.y*f)}},Ga.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var f=n,p=d;r&&(f=0,p=l);var h=u-Math.PI/2,v=h-c/2,g=h+c/2,y=String(u+"_"+c);f=void 0===o[y]?o[y]=0:++o[y],i.ctrlpts=[a.x+1.4*Math.cos(v)*p*(f/3+1),a.y+1.4*Math.sin(v)*p*(f/3+1),a.x+1.4*Math.cos(g)*p*(f/3+1),a.y+1.4*Math.sin(g)*p*(f/3+1)]},Ga.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,c=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,f=e.pstyle("control-point-distances"),p=f?f.pfValue[0]:void 0,h=n,v=d;r&&(h=0,v=p);var g={x:o.x-s/2,y:o.y-l/2},y={x:a.x-u/2,y:a.y-c/2},m={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*u));i.ctrlpts=[m.x,m.y-(1+Math.pow(50,1.12)/100)*v*(h/3+1)*b,m.x-(1+Math.pow(50,1.12)/100)*v*(h/3+1)*x,m.y]},Ga.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Ga.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,l=t.intersectionPts,u=e.pstyle("edge-distances").value,c=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),p=d&&f?Math.min(d.value.length,f.value.length):1,h=d?d.pfValue[0]:void 0,v=f.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var y=0;y<p;y++){var m=(.5-t.eles.length/2+n)*c*(i?-1:1),b=void 0,x=Qe(m);g&&(h=d?d.pfValue[y]:c,v=f.value[y]);var w=void 0!==(b=r?h:void 0!==h?x*h:void 0)?b:m,E=1-v,k=v,S="node-position"===u?s:l,P={x:S.x1*E+S.x2*k,y:S.y1*E+S.y2*k};o.ctrlpts.push(P.x+a.x*w,P.y+a.y*w)}},Ga.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",o="leftward",a="rightward",s="downward",l="upward",u=t.posPts,c=t.srcW,d=t.srcH,f=t.tgtW,p=t.tgtH,h="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,g=v,y=e.pstyle("taxi-turn"),m="%"===y.units,b=y.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,E=h?(c+f)/2:0,k=h?(d+p)/2:0,S=u.x2-u.x1,P=u.y2-u.y1,_=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},C=_(S,E),j=_(P,k),T=!1;"auto"===g?v=Math.abs(C)>Math.abs(j)?i:r:g===l||g===s?(v=r,T=!0):g!==o&&g!==a||(v=i,T=!0);var D,O=v===r,N=O?j:C,M=O?P:S,L=Qe(M),A=!1;(T&&(m||x)||!(g===s&&M<0||g===l&&M>0||g===o&&M>0||g===a&&M<0)||(N=(L*=-1)*Math.abs(N),A=!0),m)?D=(b<0?1+b:b)*N:D=(b<0?N:0)+b*L;var I=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(N)},B=I(D),z=I(Math.abs(N)-Math.abs(D));if((B||z)&&!A)if(O){var R=Math.abs(M)<=d/2,F=Math.abs(S)<=f/2;if(R){var V=(u.x1+u.x2)/2,G=u.y1,U=u.y2;n.segpts=[V,G,V,U]}else if(F){var W=(u.y1+u.y2)/2,q=u.x1,H=u.x2;n.segpts=[q,W,H,W]}else n.segpts=[u.x1,u.y2]}else{var Y=Math.abs(M)<=c/2,X=Math.abs(P)<=p/2;if(Y){var K=(u.y1+u.y2)/2,Q=u.x1,$=u.x2;n.segpts=[Q,K,$,K]}else if(X){var Z=(u.x1+u.x2)/2,J=u.y1,ee=u.y2;n.segpts=[Z,J,Z,ee]}else n.segpts=[u.x2,u.y1]}else if(O){var te=u.y1+D+(h?d/2*L:0),ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else{var ie=u.x1+D+(h?c/2*L:0),oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}},Ga.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=!k(n.startX)||!k(n.startY),f=!k(n.arrowStartX)||!k(n.arrowStartY),p=!k(n.endX)||!k(n.endY),h=!k(n.arrowEndX)||!k(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=$e({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=g<v,m=$e({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<v,x=!1;if(d||f||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),S={x:w.x/E,y:w.y/E},P=Math.max(o,a),_={x:n.ctrlpts[0]+2*S.x*P,y:n.ctrlpts[1]+2*S.y*P},C=u.intersectLine(r.x,r.y,o,a,_.x,_.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+S.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+S.y*(v-g)):(n.ctrlpts[0]=C[0]+S.x*v,n.ctrlpts[1]=C[1]+S.y*v)}if(p||h||b){x=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},T=Math.sqrt(j.x*j.x+j.y*j.y),D={x:j.x/T,y:j.y/T},O=Math.max(o,a),N={x:n.ctrlpts[0]+2*D.x*O,y:n.ctrlpts[1]+2*D.y*O},M=c.intersectLine(i.x,i.y,s,l,N.x,N.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+D.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+D.y*(v-m)):(n.ctrlpts[0]=M[0]+D.x*v,n.ctrlpts[1]=M[1]+D.y*v)}x&&this.findEndpoints(e)}},Ga.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=et(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=et(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},Ga.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||k(t.startX)&&k(t.startY)&&k(t.endX)&&k(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,ge("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Ga.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new _e,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new _e,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var l=e[s],u=l._private,c=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if("haystack"!==c){var d="unbundled-bezier"===c||"segments"===c||"straight"===c||"straight-triangle"===c||"taxi"===c,f="unbundled-bezier"===c||"bezier"===c,p=u.source,h=u.target,v=[p.poolIndex(),h.poolIndex()].sort(),g=i.get(v);null==g&&(g={eles:[]},i.set(v,g),o.push(v)),g.eles.push(l),d&&(g.hasUnbundled=!0),f&&(g.hasBezier=!0)}else a.push(l)}for(var y=function(e){var a=o[e],s=i.get(a),l=void 0;if(!s.hasUnbundled){var u=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));ke(s.eles),u.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=s.eles[0],d=c.source(),f=c.target();if(d.poolIndex()>f.poolIndex()){var p=d;d=f,f=p}var h=s.srcPos=d.position(),v=s.tgtPos=f.position(),g=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=f.outerWidth(),b=s.tgtH=f.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(f)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var E=0;E<s.eles.length;E++){var S=s.eles[E],P=S[0]._private.rscratch,_=S.pstyle("curve-style").value,C="unbundled-bezier"===_||"segments"===_||"taxi"===_,j=!d.same(S.source());if(!s.calculatedIntersection&&d!==f&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var T=x.intersectLine(h.x,h.y,g,y,v.x,v.y,0),D=s.srcIntn=T,O=w.intersectLine(v.x,v.y,m,b,h.x,h.y,0),N=s.tgtIntn=O,M=s.intersectionPts={x1:T[0],x2:O[0],y1:T[1],y2:O[1]},L=s.posPts={x1:h.x,x2:v.x,y1:h.y,y2:v.y},A=O[1]-T[1],I=O[0]-T[0],B=Math.sqrt(I*I+A*A),z=s.vector={x:I,y:A},R=s.vectorNorm={x:z.x/B,y:z.y/B},F={x:-R.y,y:R.x};s.nodesOverlap=!k(B)||w.checkPoint(T[0],T[1],0,m,b,v.x,v.y)||x.checkPoint(O[0],O[1],0,g,y,h.x,h.y),s.vectorNormInverse=F,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:h,srcW:m,srcH:b,tgtW:g,tgtH:y,srcIntn:N,tgtIntn:D,srcShape:w,tgtShape:x,posPts:{x1:L.x2,y1:L.y2,x2:L.x1,y2:L.y1},intersectionPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},vector:{x:-z.x,y:-z.y},vectorNorm:{x:-R.x,y:-R.y},vectorNormInverse:{x:-F.x,y:-F.y}}}var V=j?l:s;P.nodesOverlap=V.nodesOverlap,P.srcIntn=V.srcIntn,P.tgtIntn=V.tgtIntn,r&&(d.isParent()||d.isChild()||f.isParent()||f.isChild())&&(d.parents().anySame(f)||f.parents().anySame(d)||d.same(f)&&d.isParent())?t.findCompoundLoopPoints(S,V,E,C):d===f?t.findLoopPoints(S,V,E,C):"segments"===_?t.findSegmentsPoints(S,V):"taxi"===_?t.findTaxiPoints(S,V):"straight"===_||!C&&s.eles.length%2==1&&E===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(S):t.findBezierPoints(S,V,E,C,j),t.findEndpoints(S),t.tryToCorrectInvalidPoints(S,V),t.checkForInvalidEdgeWarning(S),t.storeAllpts(S),t.storeEdgeProjections(S),t.calculateArrowAngles(S),t.recalculateEdgeLabelProjections(S),t.calculateLabelAngles(S)}},m=0;m<o.length;m++)y(m);this.findHaystackPoints(a)}},Ga.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),Ua(t.segpts)},Ga.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),Ua(t.ctrlpts)},Ga.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Wa={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),l=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,l[0],l[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],l=e.target()[0],u=s.position(),c=l.position(),d=e.pstyle("target-arrow-shape").value,f=e.pstyle("source-arrow-shape").value,p=e.pstyle("target-distance-from-node").pfValue,h=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,y=g.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,E="segments"===y,S=b||x||w,P=m||"taxi"===v,_=e.pstyle("source-endpoint"),C=P?"outside-to-node":_.value,j=e.pstyle("target-endpoint"),T=P?"outside-to-node":j.value;if(g.srcManEndpt=_,g.tgtManEndpt=j,b){var D=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:D,r=D}else if(w){var O=E?g.segpts.slice(0,2):[c.x,c.y];n=E?g.segpts.slice(g.segpts.length-2):[u.x,u.y],r=O}if("inside-to-node"===T)t=[c.x,c.y];else if(j.units)t=this.manualEndptToPx(l,j);else if("outside-to-line"===T)t=g.tgtIntn;else if("outside-to-node"===T||"outside-to-node-or-label"===T?i=n:"outside-to-line"!==T&&"outside-to-line-or-label"!==T||(i=[u.x,u.y]),t=a.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===T||"outside-to-line-or-label"===T){var N=l._private.rscratch,M=N.labelWidth,L=N.labelHeight,A=N.labelX,I=N.labelY,B=M/2,z=L/2,R=l.pstyle("text-valign").value;"top"===R?I-=z:"bottom"===R&&(I+=z);var F=l.pstyle("text-halign").value;"left"===F?A-=B:"right"===F&&(A+=B);var V=St(i[0],i[1],[A-B,I-z,A+B,I-z,A+B,I+z,A-B,I+z],c.x,c.y);if(V.length>0){var G=u,U=Ze(G,Ye(t)),W=Ze(G,Ye(V)),q=U;if(W<U&&(t=V,q=W),V.length>2)Ze(G,{x:V[2],y:V[3]})<q&&(t=[V[2],V[3]])}}var H=Pt(t,n,a.arrowShapes[d].spacing(e)+p),Y=Pt(t,n,a.arrowShapes[d].gap(e)+p);if(g.endX=Y[0],g.endY=Y[1],g.arrowEndX=H[0],g.arrowEndY=H[1],"inside-to-node"===C)t=[u.x,u.y];else if(_.units)t=this.manualEndptToPx(s,_);else if("outside-to-line"===C)t=g.srcIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?o=r:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(o=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===C||"outside-to-line-or-label"===C){var X=s._private.rscratch,K=X.labelWidth,Q=X.labelHeight,$=X.labelX,Z=X.labelY,J=K/2,ee=Q/2,te=s.pstyle("text-valign").value;"top"===te?Z-=ee:"bottom"===te&&(Z+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?$-=J:"right"===ne&&($+=J);var re=St(o[0],o[1],[$-J,Z-ee,$+J,Z-ee,$+J,Z+ee,$-J,Z+ee],u.x,u.y);if(re.length>0){var ie=c,oe=Ze(ie,Ye(t)),ae=Ze(ie,Ye(re)),se=oe;if(ae<oe&&(t=[re[0],re[1]],se=ae),re.length>2)Ze(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var le=Pt(t,r,a.arrowShapes[f].spacing(e)+h),ue=Pt(t,r,a.arrowShapes[f].gap(e)+h);g.startX=ue[0],g.startY=ue[1],g.arrowStartX=le[0],g.arrowStartY=le[1],S&&(k(g.startX)&&k(g.startY)&&k(g.endX)&&k(g.endY)?g.badLine=!1:g.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},qa={};function Ha(e,t,n){for(var r=function(e,t,n,r){return et(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}qa.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)Ha(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},qa.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Ya={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!D(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),l=e.position(),u=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,d=i.rscratch,f=i.rstyle;switch(u){case"left":n=l.x-o/2-s;break;case"right":n=l.x+o/2+s;break;default:n=l.x}switch(c){case"top":r=l.y-a/2-s;break;case"bottom":r=l.y+a/2+s;break;default:r=l.y}d.labelX=n,d.labelY=r,f.labelX=n,f.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},Xa=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},Ka=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Xa(n,r)};Ya.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){t={x:r.midX,y:r.midY};var a=function(e,t,r){Pe(n.rscratch,e,t,r),Pe(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=Xa(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var l=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4){var a={x:r.allpts[o],y:r.allpts[o+1]},s={x:r.allpts[o+2],y:r.allpts[o+3]},l={x:r.allpts[o+4],y:r.allpts[o+5]};t.push({p0:a,p1:s,p2:l,startDist:0,length:0,segments:[]})}var u=n.rstyle.bezierPts,c=i.bezierProjPcts.length;function d(e,t,n,r,i){var o=$e(t,n),a=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o};e.segments.push(s),e.length+=o}for(var f=0;f<t.length;f++){var p=t[f],h=t[f-1];h&&(p.startDist=h.startDist+h.length),d(p,p.p0,u[f*c],0,i.bezierProjPcts[0]);for(var v=0;v<c-1;v++)d(p,u[f*c+v],u[f*c+v+1],i.bezierProjPcts[v],i.bezierProjPcts[v+1]);d(p,u[f*c+c-1],p.p2,i.bezierProjPcts[c-1],1)}return e.cache=t},u=function(n){var i,s="source"===n;if(o[n]){var u=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var c,d=l(),f=0,p=0,h=0;h<d.length;h++){for(var v=d[s?h:d.length-1-h],g=0;g<v.segments.length;g++){var y=v.segments[s?g:v.segments.length-1-g],m=h===d.length-1&&g===v.segments.length-1;if(f=p,(p+=y.length)>=u||m){c={cp:v,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-f)/x.length,E=x.t1-x.t0,k=s?x.t0+E*w:x.t1-E*w;k=nt(0,k,1),t=tt(b.p0,b.p1,b.p2,k),i=function(e,t,n,r){var i=nt(0,r-.001,1),o=nt(0,r+.001,1),a=tt(e,t,n,i),s=tt(e,t,n,o);return Ka(a,s)}(b.p0,b.p1,b.p2,k);break;case"straight":case"segments":case"haystack":for(var S,P,_,C,j=0,T=r.allpts.length,D=0;D+3<T&&(s?(_={x:r.allpts[D],y:r.allpts[D+1]},C={x:r.allpts[D+2],y:r.allpts[D+3]}):(_={x:r.allpts[T-2-D],y:r.allpts[T-1-D]},C={x:r.allpts[T-4-D],y:r.allpts[T-3-D]}),P=j,!((j+=S=$e(_,C))>=u));D+=2);var O=(u-P)/S;O=nt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=$e(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(_,C,O),i=Ka(_,C)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},Ya.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},Ya.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Se(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,f=i.height+(l-1)*(o-1)*u;Pe(n.rstyle,"labelWidth",t,d),Pe(n.rscratch,"labelWidth",t,d),Pe(n.rstyle,"labelHeight",t,f),Pe(n.rscratch,"labelHeight",t,f),Pe(n.rscratch,"labelLineHeight",t,c)},Ya.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Pe(n.rscratch,e,t,r),r):Se(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,f=[],p=/[\s\u200b]+/,h=d?"":" ",v=0;v<u.length;v++){var g=u[v],y=this.calculateLabelDimensions(e,g).width;if(d){var m=g.split("").join("\u200b");g=m}if(y>c){for(var b=g.split(p),x="",w=0;w<b.length;w++){var E=b[w],k=0===x.length?E:x+h+E;this.calculateLabelDimensions(e,k).width<=c?x+=E+h:(x&&f.push(x),x=E+h)}x.match(/^[\s\u200b]+$/)||f.push(x)}else f.push(g)}a("labelWrapCachedLines",f),i=a("labelWrapCachedText",f.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var S=e.pstyle("text-max-width").pfValue,P="",_=!1;if(this.calculateLabelDimensions(e,i).width<S)return i;for(var C=0;C<i.length;C++){if(this.calculateLabelDimensions(e,P+i[C]+"\u2026").width>S)break;P+=i[C],C===i.length-1&&(_=!0)}return _||(P+="\u2026"),P}return i},Ya.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},Ya.calculateLabelDimensions=function(e,t){var n=re(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,u=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=u.getContext("2d");var d=u.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(o," ").concat(l," ").concat(a,"px ").concat(s);for(var f=0,p=0,h=t.split("\n"),v=0;v<h.length;v++){var g=h[v],y=c.measureText(g),m=Math.ceil(y.width),b=a;f=Math.max(m,f),p+=b}return f+=0,p+=0,r[n]={width:f,height:p}},Ya.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",o=e.pstyle(i+"text-rotation"),a=o.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:o.pfValue},Ya.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var Qa={},$a=!1;Qa.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return $a||(ge("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),$a=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var Za={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(o)for(var u=0;u<o.length;u++){(0,o[u])(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,l=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(l.clean=!1),t&&l.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),l.clean=!0)}for(var u=0;u<i.length;u++){var c=i[u],d=c._private.rstyle,f=c.position();this.recalculateNodeLabelProjection(c),d.nodeX=f.x,d.nodeY=f.y,d.nodeW=c.pstyle("width").pfValue,d.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var h=r[p]._private,v=h.rstyle,g=h.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},Ja={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Ri),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},es={};[Fa,Va,Ga,Wa,qa,Ya,Qa,Za,Ja].forEach((function(e){R(es,e)}));var ts={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0}));var a="data:";return e.substring(0,a.length).toLowerCase()===a||(o.crossOrigin=t),o.src=e,o}},ns={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)}};ns.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});window.addEventListener("test",null,o)}catch(s){}n.supportsPassiveEvents=i}var a=function(t,i,o){var a=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),n.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:a,addEventListener:a,addListener:a,bind:a}},ns.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ns.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ns.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++){var a=n[o];t.emit({originalEvent:r,type:a,position:i})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},a=function(e){e[0]._private.rscratch.inDragLayer=!0},s=function(e){e[0]._private.rscratch.isGrabTarget=!0},l=function(e,t){var n=t.addToList;n.has(e)||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},u=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(a),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(a)),n.addToList&&t.forEach((function(e){l(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(a),n.connectedEdges().forEach(a)),t.addToList&&t.addToList.unmerge(n)}}(t,n),f(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},c=u,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},f=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(a),r.forEach(a)),t.addToList&&r.forEach((function(e){l(e,t)}))}}},p=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},h="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;h?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=i((function(){e.cy.resize()}),100);h&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],l=!1,u=0;u<s.length;u++){var c=s[u];if(r<=c.clientX&&c.clientX<=r+o&&i<=c.clientY&&c.clientY<=i+a){l=!0;break}}if(!l)return!1;for(var d=e.container,f=t.target.parentNode,p=!1;f;){if(f===d){p=!0;break}f=f.parentNode}return!!p};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),p(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),a=e.selection,l=e.findNearestElements(o[0],o[1],!0,!1),d=l[0],f=e.dragData.possibleDragElements;e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i;if(3==t.which){e.hoverData.cxtStarted=!0;var h={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(h),e.hoverData.down=d):r.emit(h),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(s(d),d.selected()){f=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));u(g,{addToList:f}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else f=e.dragData.possibleDragElements=r.collection(),c(d,{addToList:f}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=l,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(a[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(a[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}a[0]=a[2]=o[0],a[1]=a[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var i=!1,a=e.cy,s=a.zoom(),l=[t.clientX,t.clientY],c=e.projectIntoViewport(l[0],l[1]),f=e.hoverData.mdownPos,p=e.hoverData.mdownGPos,h=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(c[0],c[1],!0,!1));var g,y=e.hoverData.last,m=e.hoverData.down,b=[c[0]-h[2],c[1]-h[3]],x=e.dragData.possibleDragElements;if(p){var E=l[0]-p[0],S=E*E,P=l[1]-p[1],_=S+P*P;e.hoverData.isOverThresholdDrag=g=_>=e.desktopTapThreshold2}var C=r(t);g&&(e.hoverData.tapholdCancelled=!0);i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var j=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),h[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var T={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};m?m.emit(T):a.emit(T),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(i=!0,a.panningEnabled()&&a.userPanningEnabled()){var D;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;D={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else D={x:b[0]*s,y:b[1]*s};a.panBy(D),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=h[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||v==y||(y&&n(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=v),m)if(g){if(a.boxSelectionEnabled()&&C)m&&m.grabbed()&&(d(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),j();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var N=!e.dragData.didDrag;N&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var M=a.collection();e.hoverData.draggingEles||u(x,{inDragLayer:!0});var L={x:0,y:0};if(k(b[0])&&k(b[1])&&(L.x+=b[0],L.y+=b[1],N)){var A=e.hoverData.dragDelta;A&&k(A[0])&&k(A[1])&&(L.x+=A[0],L.y+=A[1])}for(var I=0;I<x.length;I++){var B=x[I];e.nodeIsDraggable(B)&&B.grabbed()&&M.push(B)}e.hoverData.draggingEles=!0,M.silentShift(L).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();i=!0}else if(g){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!C&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){o(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,h[4]=0,e.data.bgActivePosistion=Ye(f),e.redrawHint("select",!0),e.redraw())}}else j();m&&m.pannable()&&m.active()&&m.unactivate()}return h[2]=c[0],h[3]=c[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,f=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var h={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(h):o.emit(h)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(l,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(c,["click","tap","vclick"],i,{x:a[0],y:a[1]}),b=!1,i.timeStamp-x<=o.multiClickDebounceTime()?(m&&clearTimeout(m),b=!0,x=null,n(c,["dblclick","dbltap","vdblclick"],i,{x:a[0],y:a[1]})):(m=setTimeout((function(){b||n(c,["oneclick","onetap","voneclick"],i,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),x=i.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||f?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):f||(o.$(t).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===o.selectionType()||f||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();d(u),y&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var E,S,P,_,C,j,T,D,O,N,M,L,A,I=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",I,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||I(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var B,z,R,F,V,G,U,W=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",B=function(t){if(e.hasTouchStarted=!0,w(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]){a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=a[0],i[3]=a[1]}if(t.touches[2]){a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=a[0],i[5]=a[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();O=l[0],N=l[1],M=l[2],L=l[3],E=t.touches[0].clientX-O,S=t.touches[0].clientY-N,P=t.touches[1].clientX-O,_=t.touches[1].clientY-N,A=0<=E&&E<=M&&0<=P&&P<=M&&0<=S&&S<=L&&0<=_&&_<=L;var f=r.pan(),h=r.zoom();C=W(E,S,P,_),j=q(E,S,P,_),D=[((T=[(E+P)/2,(S+_)/2])[0]-f.x)/h,(T[1]-f.y)/h];if(j<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),g=e.findNearestElement(i[2],i[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),m=y[0];if(null!=m&&(m.activate(),e.touchData.start=m,e.touchData.starts=y,e.nodeIsGrabbable(m))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),m.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(x,{addToList:b})):c(m,{addToList:b}),s(m);var k=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};m.emit(k("grabon")),x?x.forEach((function(e){e.emit(k("grab"))})):m.emit(k("grab"))}n(m,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==m&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var I=e.touchData.startPosition=[],B=0;B<i.length;B++)I[B]=o[B]=i[B];var z=t.touches[0];e.touchData.startGPosition=[z.clientX,z.clientY]}}},!1),e.registerBinding(window,"touchmove",z=function(t){var r=e.touchData.capture;if(r||w(t)){var i=e.selection,a=e.cy,s=e.touchData.now,l=e.touchData.earlier,c=a.zoom();if(t.touches[0]){var f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}var p,h=e.touchData.startGPosition;if(r&&t.touches[0]&&h){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-l[g];var y=t.touches[0].clientX-h[0],m=y*y,b=t.touches[0].clientY-h[1];p=m+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-O,T=t.touches[0].clientY-N,M=t.touches[1].clientX-O,L=t.touches[1].clientY-N,I=q(x,T,M,L);if(I/j>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(r&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var z=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&z===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=z,z&&z.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var R=0;R<ee.length;R++){var F=ee[R]._private;F.grabbed=!1,F.rscratch.inDragLayer=!1}}var V=e.touchData.start,G=(x=t.touches[0].clientX-O,T=t.touches[0].clientY-N,M=t.touches[1].clientX-O,L=t.touches[1].clientY-N,W(x,T,M,L)),U=G/C;if(A){var H=(x-E+(M-P))/2,Y=(T-S+(L-_))/2,X=a.zoom(),K=X*U,Q=a.pan(),$=D[0]*X+Q.x,Z=D[1]*X+Q.y,J={x:-K/X*($-Q.x-H)+$,y:-K/X*(Z-Q.y-Y)+Z};if(V&&V.active()){var ee=e.dragData.touchDragEles;d(ee),e.redrawHint("drag",!0),e.redrawHint("eles",!0),V.unactivate().emit("freeon"),ee.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),ee.emit("dragfree"))}a.viewport({zoom:K,pan:J,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),C=G,E=x,S=T,P=M,_=L,e.pinching=!0}if(t.touches[0]){f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var te=e.touchData.start,ne=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(z=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=te&&t.preventDefault(),r&&null!=te&&e.nodeIsDraggable(te))if(p){ee=e.dragData.touchDragEles;var re=!e.dragData.didDrag;re&&u(ee,{inDragLayer:!0}),e.dragData.didDrag=!0;var ie={x:0,y:0};if(k(v[0])&&k(v[1]))if(ie.x+=v[0],ie.y+=v[1],re)e.redrawHint("eles",!0),(oe=e.touchData.dragDelta)&&k(oe[0])&&k(oe[1])&&(ie.x+=oe[0],ie.y+=oe[1]);e.hoverData.draggingEles=!0,ee.silentShift(ie).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==l[0]&&e.touchData.startPosition[1]==l[1]&&e.redrawHint("eles",!0),e.redraw()}else{var oe;0===(oe=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(oe.push(v[0]),oe.push(v[1])):(oe[0]+=v[0],oe[1]+=v[1])}if(n(te||z,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||z==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),z&&z.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=z,r)for(R=0;R<s.length;R++)s[R]&&e.touchData.startPosition[R]&&p&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){o(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Ye(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:v[0]*c,y:v[1]*c}),a.emit("dragpan")):p&&(e.swipePanning=!0,a.panBy({x:y*c,y:b*c}),a.emit("dragpan"),te&&(te.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}}for(g=0;g<s.length;g++)l[g]=s[g];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",R=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",F=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(r.touches[0]){var f=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=f[0],u[1]=f[1]}if(r.touches[1]){f=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);u[2]=f[0],u[3]=f[1]}if(r.touches[2]){f=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);u[4]=f[0],u[5]=f[1]}if(i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:r,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var h=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:u[0],y:u[1]}});h.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),h.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=i){var g=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(i.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),v.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:u[0],y:u[1]}),V=!1,r.timeStamp-U<=s.multiClickDebounceTime()?(G&&clearTimeout(G),V=!0,U=null,n(i,["dbltap","vdblclick"],r,{x:u[0],y:u[1]})):(G=setTimeout((function(){V||n(i,["onetap","voneclick"],r,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=r.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var E=0;E<u.length;E++)c[E]=u[E];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var H=[],Y=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},X=function(e){H.push(function(e){return{event:e,touch:Y(e)}}(e))},K=function(e){for(var t=0;t<H.length;t++){if(H[t].event.pointerId===e.pointerId)return void H.splice(t,1)}},Q=function(e){e.touches=H.map((function(e){return e.touch}))},$=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){$(e)||(e.preventDefault(),X(e),Q(e),B(e))})),e.registerBinding(e.container,"pointerup",(function(e){$(e)||(K(e),Q(e),F(e))})),e.registerBinding(e.container,"pointercancel",(function(e){$(e)||(K(e),Q(e),R())})),e.registerBinding(e.container,"pointermove",(function(e){$(e)||(e.preventDefault(),function(e){var t=H.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=Y(e)}(e),Q(e),z(e))}))}};var rs={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return St(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return yt(e,t,this.points,o,a,r,i,[0,-1],n)}}}};rs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var l=Math.sqrt(a*a+s*s),u=l-1;if(u<0)return[];var c=u/l;return[(n-e)*c+e,(r-t)*c+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return xt(e,t,r,i,o,a,n)}}},rs.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,o=void 0;o=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var a=t[o]-t[i],s=t[o+1]-t[i+1],l=Math.sqrt(a*a+s*s);n[4*r+2]=a/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var l,u=[],c=new Array(n.length),d=o/2,f=a/2,p=Dt(o,a),h=0;h<n.length/4;h++){var v,g=void 0;g=0===h?n.length-2:4*h-2,v=4*h+2;var y=r+d*n[4*h],m=i+f*n[4*h+1],b=-n[g]*n[v]-n[g+1]*n[v+1],x=p/Math.tan(Math.acos(b)/2),w=y-x*n[g],E=m-x*n[g+1],k=y+x*n[v],S=m+x*n[v+1];0===h?(c[n.length-2]=w,c[n.length-1]=E):(c[4*h-2]=w,c[4*h-1]=E),c[4*h]=k,c[4*h+1]=S;var P=n[g+1],_=-n[g];P*n[v]+_*n[v+1]<0&&(P*=-1,_*=-1),0!==(l=wt(e,t,r,i,w+P*p,E+_*p,p)).length&&u.push(l[0],l[1])}for(var C=0;C<c.length/4;C++)0!==(l=kt(e,t,r,i,c[4*C],c[4*C+1],c[4*C+2],c[4*C+3],!1)).length&&u.push(l[0],l[1]);if(u.length>2){for(var j=[u[0],u[1]],T=Math.pow(j[0]-e,2)+Math.pow(j[1]-t,2),D=1;D<u.length/2;D++){var O=Math.pow(u[2*D]-e,2)+Math.pow(u[2*D+1]-t,2);O<=T&&(j[0]=u[2*D],j[1]=u[2*D+1],T=O)}return j}return u}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),l=o/2,u=a/2,c=Dt(o,a),d=c*c,f=0;f<n.length/4;f++){var p,h=void 0;h=0===f?n.length-2:4*f-2,p=4*f+2;var v=r+l*n[4*f],g=i+u*n[4*f+1],y=-n[h]*n[p]-n[h+1]*n[p+1],m=c/Math.tan(Math.acos(y)/2),b=v-m*n[h],x=g-m*n[h+1],w=v+m*n[p],E=g+m*n[p+1];s[4*f]=b,s[4*f+1]=x,s[4*f+2]=w,s[4*f+3]=E;var k=n[h+1],S=-n[h];k*n[p]+S*n[p+1]<0&&(k*=-1,S*=-1);var P=b+k*c,_=x+S*c;if(Math.pow(P-e,2)+Math.pow(_-t,2)<=d)return!0}return gt(e,t,s)}(e,t,this.points,o,a,r,i)}}},rs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:_t(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return dt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Tt(r,i),l=2*s;return!!yt(e,t,this.points,o,a,r,i-l,[0,-1],n)||(!!yt(e,t,this.points,o,a,r-l,i,[0,-1],n)||(!!xt(e,t,l,l,o-r/2+s,a-i/2+s,n)||(!!xt(e,t,l,l,o+r/2-s,a-i/2+s,n)||(!!xt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!xt(e,t,l,l,o-r/2+s,a+i/2-s,n)))))}}},rs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:_t(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,l=n+a,u=r-o,c=r+o;return{topLeft:[s,u+i,s+i,u,s+i,u+i],topRight:[l-i,u,l,u+i,l-i,u+i],bottomRight:[l,c-i,l-i,c,l-i,c-i],bottomLeft:[s+i,c,s,c-i,s+i,c-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),l=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return St(i,o,l,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(yt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return gt(e,t,s.topLeft)||gt(e,t,s.topRight)||gt(e,t,s.bottomRight)||gt(e,t,s.bottomLeft)}}},rs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:_t(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),l=function(e){var t=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},u=[].concat(l(s.topLeft),l(s.topRight),l(s.bottomRight),l(s.bottomLeft));return St(i,o,u,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,l=r-i,u=r+i,c=Ot(e,t),d=c.heightOffset,f=c.widthOffset,p=c.ctrlPtOffsetPct*e,h={topLeft:[a,l+d,a+p,l,a+f,l],topRight:[s-f,l,s-p,l,s,l+d],bottomRight:[s,u-d,s-p,u,s-f,u],bottomLeft:[a+f,u,a+p,u,a,u-d]};return h.topLeft.isTop=!0,h.topRight.isTop=!0,h.bottomLeft.isBottom=!0,h.bottomRight.isBottom=!0,h},checkPoint:function(e,t,n,r,i,o,a){var s=Ot(r,i),l=s.heightOffset,u=s.widthOffset;if(yt(e,t,this.points,o,a,r,i-2*l,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-2*u,i,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,i,o,a),d=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],l=n[5],u=n[1],c=Math.min(o,s),d=Math.max(o,s),f=Math.min(l,u),p=Math.max(l,u);if(c<=e&&e<=d&&f<=t&&t<=p){var h=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(h[0],h[1],h[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},f=Object.keys(c),p=0;p<f.length;p++){var h=c[f[p]],v=d(e,t,h);if(null!=v){var g=h[5],y=h[3],m=h[1],b=et(g,y,m,v);if(h.isTop&&b<=t)return!0;if(h.isBottom&&t<=b)return!0}}return!1}}},rs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:_t(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),l=kt(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return l.length>0?l:dt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Tt(r,i),l=2*s;if(yt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!gt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||(!!xt(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!xt(e,t,l,l,o-r/2+s,a+i/2-s,n))}}},rs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",_t(3,0)),this.generateRoundPolygon("round-triangle",_t(3,0)),this.generatePolygon("rectangle",_t(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",_t(5,0)),this.generateRoundPolygon("round-pentagon",_t(5,0)),this.generatePolygon("hexagon",_t(6,0)),this.generateRoundPolygon("round-hexagon",_t(6,0)),this.generatePolygon("heptagon",_t(7,0)),this.generateRoundPolygon("round-heptagon",_t(7,0)),this.generatePolygon("octagon",_t(8,0)),this.generateRoundPolygon("round-octagon",_t(8,0));var r=new Array(20),i=jt(5,0),o=jt(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=Ct(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var is={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||xe();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&he("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},os=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};is.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;Y((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){os(e,!0,r);var i=X();e.render(e.renderOptions);var o=e.lastDrawTime=X();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else os(e,!1,r);e.skipFrame=!1,Y(n)}}))}};var as=function(e){this.init(e)},ss=as.prototype;ss.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ss.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(f){var r=f.document,i=r.head,o="__________cytoscape_stylesheet",a="__________cytoscape_container",s=null!=r.getElementById(o);if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!s){var l=r.createElement("style");l.id=o,l.innerHTML="."+a+" { position: relative; }",i.insertBefore(l,i.children[0])}"static"===f.getComputedStyle(n).getPropertyValue("position")&&ge("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=k(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ss.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},ss.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},ss.isHeadless=function(){return!1},[Ra,es,ts,ns,rs,is].forEach((function(e){R(ss,e)}));var ls=1e3/60,us=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=i((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),o=e.priority||pe;n.beforeRender((function(i,o){var a=X(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],c=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var f=X(),p=f-a,h=f-o;if(l<ls){var v=ls-(i?s:0);if(h>=e.deqFastCost*v)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(h>=e.deqNoDrawCost*ls)break;var g=e.deq(t,d,c);if(!(g.length>0))break;for(var y=0;y<g.length;y++)u.push(g[y])}u.length>0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),o(t))}}},cs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de;s(this,e),this.idsByKey=new _e,this.keyForId=new _e,this.cachesByLvl=new _e,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return u(e,[{key:"getIdsFor",value:function(e){null==e&&he("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new je,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new _e,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),ds={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},fs=we({getKey:null,doesEleInvalidateKey:de,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ce,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ps=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=fs(t);R(n,r),n.lookup=new cs(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},hs=ps.prototype;hs.reasons=ds,hs.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},hs.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},hs.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new o((function(e,t){return t.reqs-e.reqs}))},hs.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},hs.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Ke(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,f=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,f))return null;var p,h=l.get(e,r);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=o.getTextureQueue(p),g=v[v.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidth<d&&(g=y());for(var m,b=function(e){return e&&e.scaledLabelShown===f},x=i&&i===ds.dequeue,w=i&&i===ds.highQuality,E=i&&i===ds.downscale,k=r+1;k<=3;k++){var S=l.get(e,k);if(S){m=S;break}}var P=m&&m.level===r+1?m:null,_=function(){g.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,g.usedWidth,0,d,c)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,p),b(P))_();else if(b(m)){if(!w)return o.queueElement(e,m.level-1),m;for(var C=m.level;C>r;C--)P=o.getElement(e,t,n,C,ds.downscale);_()}else{var j;if(!x&&!w&&!E)for(var T=r-1;T>=-4;T--){var D=l.get(e,T);if(D){j=D;break}}if(b(j))return o.queueElement(e,r),j;g.context.translate(g.usedWidth,0),g.context.scale(u,u),this.drawElement(g.context,e,t,f,!1),g.context.scale(1/u,1/u),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:r,scale:u,width:d,height:c,scaledLabelShown:f},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(h),l.set(e,r,h),o.checkTextureFullness(g),h},hs.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},hs.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=-4;i<=3;i++){var o=n.getForCachedKey(e,i);o&&r.push(o)}if(n.invalidate(e))for(var a=0;a<r.length;a++){var s=r[a],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},hs.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},hs.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ee(t,e):e.fullnessChecks++},hs.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ee(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}ke(i),this.getRetiredTextureQueue(t).push(e)},hs.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},hs.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,ke(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ee(r,o),n.push(o),o}},hs.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},hs.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,ds.dequeue)}}return i},hs.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=ue,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},hs.onDequeue=function(e){this.onDequeues.push(e)},hs.offDequeue=function(e){Ee(this.onDequeues,e)},hs.setupDequeueing=us({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(lt(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var vs=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=X()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=i((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new o((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},gs=vs.prototype,ys=0,ms=Math.pow(2,53)-1;gs.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:ys=++ys%ms,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,l=-a.bb.x1,u=-a.bb.y1;return s.scale(n,n),s.translate(l,u),a},gs.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(Ke(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ee(c,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=rt();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*u*(a.h*u)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,o)}else(void 0===t.insert||t.insert)&&c.unshift(o);return o};if(r.skipping&&!o)return null;for(var f=null,p=e.length/1,h=!o,v=0;v<e.length;v++){var g=e[v],y=g._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)f=b;else{if((!f||f.eles.length>=p||!ct(f.bb,g.boundingBox()))&&!(f=d({insert:!0,after:f})))return null;s||h?r.queueLayer(f,g):r.drawEleInLayer(f,g,n,t),f.eles.push(g),m[n]=f}}return s||(h?null:c)},gs.getEleLevelForLayerLevel=function(e,t){return e},gs.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,true),i.setImgSmoothing(o,!0))},gs.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},gs.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},gs.updateElementsInLayers=function(e,t){for(var n=_(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},l=-4;l<=2;l++){var u=s[l];u&&(i&&this.getEleLevelForLayerLevel(u.level)!==i.level||t(u,o,i))}},gs.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},gs.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=X(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},gs.invalidateLayer=function(e){if(this.lastInvalidationTime=X(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ee(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var o=n[i]._private.rscratch.imgLayerCaches;o&&(o[t]=null)}}},gs.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},gs.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},gs.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},gs.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<1&&0!==n.size();){var o=n.peek();if(o.replacement)n.pop();else if(o.replaces&&o!==o.replaces.replacement)n.pop();else if(o.invalid)n.pop();else{var a=o.elesQueue.shift();a&&(t.drawEleInLayer(o,a,o.level,e),i++),0===r.length&&r.push(!0),0===o.elesQueue.length&&(n.pop(),o.reqs=0,o.replaces&&t.applyLayerReplacement(o),t.requestRedraw())}}return r},gs.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},gs.requestRedraw=i((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),gs.setupDequeueing=us({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:pe,shouldRedraw:ce,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var bs,xs={};function ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Es(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function ks(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var o=r[i];e.lineTo(o.x,o.y)}var a=n,s=n[0];e.moveTo(s.x,s.y);for(i=1;i<a.length;i++){o=a[i];e.lineTo(o.x,o.y)}e.closePath&&e.closePath()}function Ss(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var l=o[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function Ps(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}xs.arrowShapeImpl=function(e){return(bs||(bs={polygon:ws,"triangle-backcurve":Es,"triangle-tee":ks,"circle-triangle":Ss,"triangle-cross":ks,circle:Ps}))[e]};var _s={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var l=this,u=n.getBoundingBox(t);if(0!==u.w&&0!==u.h){var c=n.getElement(t,u,r,i,o);if(null!=c){var d=s(l,t);if(0===d)return;var f,p,h,v,g,y,m=a(l,t),b=u.x1,x=u.y1,w=u.w,E=u.h;if(0!==m){var k=n.getRotationPoint(t);h=k.x,v=k.y,e.translate(h,v),e.rotate(m),(g=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var S=n.getRotationOffset(t);f=S.x,p=S.y}else f=b,p=x;1!==d&&(y=e.globalAlpha,e.globalAlpha=y*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,f,p,w,E),1!==d&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-h,-v),g||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Cs=function(){return 0},js=function(e,t){return e.getTextAngle(t,null)},Ts=function(e,t){return e.getTextAngle(t,"source")},Ds=function(e,t){return e.getTextAngle(t,"target")},Os=function(e,t){return t.effectiveOpacity()},Ns=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};_s.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,f=t.boundingBox(),p=!0===o?l.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&t.visible()&&(!r||lt(f,r))){var h=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,l,n,i,p,Cs,Os),h&&v||a.drawCachedElementPortion(e,t,u,n,i,p,js,Ns),h&&!v&&(a.drawCachedElementPortion(e,t,c,n,i,p,Ts,Ns),a.drawCachedElementPortion(e,t,d,n,i,p,Ds,Ns)),a.drawElementOverlay(e,t)}},_s.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},_s.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];this.drawCachedElement(e,o,n,r)}},_s.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},_s.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Ms={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,f=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,h=t.pstyle("line-cap").value,v=u*c,g=u*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=h,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,f),e.lineCap="butt")},m=function(){i&&a.drawEdgeOverlay(e,t)},b=function(){i&&a.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;a.drawArrowheads(e,t,n)},w=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var E="yes"===t.pstyle("ghost").value;if(E){var k=t.pstyle("ghost-offset-x").pfValue,S=t.pstyle("ghost-offset-y").pfValue,P=t.pstyle("ghost-opacity").value,_=v*P;e.translate(k,S),y(_),x(_),e.translate(-k,-S)}b(),y(),x(),m(),w(),n&&e.translate(l.x1,l.y1)}}},Ls=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};Ms.drawEdgeOverlay=Ls("overlay"),Ms.drawEdgeUnderlay=Ls("underlay"),Ms.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var f=2;f+3<n.length;f+=4)t.quadraticCurveTo(n[f],n[f+1],n[f+2],n[f+3]);break;case"straight":case"segments":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1])}t=a,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},Ms.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var o=[n[i+2]-n[i],n[i+3]-n[i+1]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/a,-o[0]/a],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},Ms.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Ms.drawArrowhead=function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if("none"!==l){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,f=t.pstyle("opacity").value;void 0===a&&(a=f);var p=e.globalCompositeOperation;1===a&&"hollow"!==c||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,u,d,l,r,i,o),e.globalCompositeOperation=p);var h=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,h[0],h[1],h[2],a),s.colorStrokeStyle(e,h[0],h[1],h[2],a),s.drawArrowShape(t,e,c,d,l,r,i,o)}}},Ms.drawArrowShape=function(e,t,n,r,i,o,a,s){var l,u=this,c=this.usePaths()&&"triangle-cross"!==i,d=!1,f=t,p={x:o,y:a},h=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,h),g=u.arrowShapes[i];if(c){var y=u.arrowPathCache=u.arrowPathCache||[],m=re(i),b=y[m];null!=b?(l=t=b,d=!0):(l=t=new Path2D,y[m]=l)}d||(t.beginPath&&t.beginPath(),c?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,p,r),t.closePath&&t.closePath()),t=f,c&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(c?t.fill(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(c?v:1),t.lineJoin="miter",c?t.stroke(l):t.stroke()),c&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))};var As={safeDrawImage:function(e,t,n,r,i,o,a,s,l,u){i<=0||o<=0||l<=0||u<=0||e.drawImage(t,n,r,i,o,a,s,l,u)},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,l=a.y,u=n.cy().style(),c=u.getIndexedStyle.bind(u),d=c(n,"background-fit","value",r),f=c(n,"background-repeat","value",r),p=n.width(),h=n.height(),v=2*n.padding(),g=p+("inner"===c(n,"background-width-relative-to","value",r)?0:v),y=h+("inner"===c(n,"background-height-relative-to","value",r)?0:v),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*i,w=c(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,k=t.height||t.cachedH;null!=E&&null!=k||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,k=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var S=E,P=k;if("auto"!==c(n,"background-width","value",r)&&(S="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*g:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(P="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==S&&0!==P){if("contain"===d)S*=_=Math.min(g/S,y/P),P*=_;else if("cover"===d){var _;S*=_=Math.max(g/S,y/P),P*=_}var C=s-g/2,j=c(n,"background-position-x","units",r),T=c(n,"background-position-x","pfValue",r);C+="%"===j?(g-S)*T:T;var D=c(n,"background-offset-x","units",r),O=c(n,"background-offset-x","pfValue",r);C+="%"===D?(g-S)*O:O;var N=l-y/2,M=c(n,"background-position-y","units",r),L=c(n,"background-position-y","pfValue",r);N+="%"===M?(y-P)*L:L;var A=c(n,"background-offset-y","units",r),I=c(n,"background-offset-y","pfValue",r);N+="%"===A?(y-P)*I:I,m.pathCache&&(C-=s,N-=l,s=0,l=0);var B=e.globalAlpha;e.globalAlpha=x;var z=o.getImgSmoothing(e),R=!1;if("no"===w&&z?(o.setImgSmoothing(e,!1),R=!0):"yes"!==w||z||(o.setImgSmoothing(e,!0),R=!0),"no-repeat"===f)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,y),e.clip())),o.safeDrawImage(e,t,0,0,E,k,C,N,S,P),b&&e.restore();else{var F=e.createPattern(t,f);e.fillStyle=F,o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,g,y),e.translate(C,N),e.fill(),e.translate(-C,-N)}e.globalAlpha=B,R&&o.setImgSmoothing(e,z)}}},Is={};function Bs(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}Is.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Ke(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Is.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),f=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!f||!f.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,h=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,h,o),t.isEdge()&&(a.drawText(e,t,"source",h,o),a.drawText(e,t,"target",h,o))):a.drawText(e,t,i,h,o),n&&e.translate(p.x1,p.y1)},Is.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},Is.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},Is.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Se(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},Is.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var l,u,c=Se(a,"labelX",n),d=Se(a,"labelY",n),f=this.getLabelText(t,n);if(null!=f&&""!==f&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,i);var p,h=n?n+"-":"",v=Se(a,"labelWidth",n),g=Se(a,"labelHeight",n),y=t.pstyle(h+"text-margin-x").pfValue,m=t.pstyle(h+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),c+=y,d+=m,0!==(p=r?this.getTextAngle(t,n):0)&&(l=c,u=d,e.translate(l,u),e.rotate(p),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var E=t.pstyle("text-background-opacity").value,k=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,P=t.pstyle("text-background-padding").pfValue;if(E>0||S>0&&k>0){var _=c-P;switch(x){case"left":_-=v;break;case"center":_-=v/2}var C=d-g-P,j=v+2*P,T=g+2*P;if(E>0){var D=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+E*s+")";var N=t.pstyle("text-background-shape").strValue;0===N.indexOf("round")?Bs(e,_,C,j,T,2):e.fillRect(_,C,j,T),e.fillStyle=D}if(S>0&&k>0){var M=e.strokeStyle,L=e.lineWidth,A=t.pstyle("text-border-color").value,I=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*s+")",e.lineWidth=S,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(_,C,j,T),"double"===I){var B=S/2;e.strokeRect(_+B,C+B,j-2*B,T-2*B)}e.setLineDash&&e.setLineDash([]),e.lineWidth=L,e.strokeStyle=M}}var z=2*t.pstyle("text-outline-width").pfValue;if(z>0&&(e.lineWidth=z),"wrap"===t.pstyle("text-wrap").value){var R=Se(a,"labelWrapCachedLines",n),F=Se(a,"labelLineHeight",n),V=v/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===x?"left"===G?c+=-v:"center"===G&&(c+=-V):"center"===x?"left"===G?c+=-V:"right"===G&&(c+=V):"right"===x&&("center"===G?c+=V:"right"===G&&(c+=v))),w){case"top":case"center":case"bottom":d-=(R.length-1)*F}for(var U=0;U<R.length;U++)z>0&&e.strokeText(R[U],c,d),e.fillText(R[U],c,d),d+=F}else z>0&&e.strokeText(f,c,d),e.fillText(f,c,d);0!==p&&(e.rotate(-p),e.translate(-l,-u))}}};var zs={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(k(d.x)&&k(d.y)&&(!s||t.visible())){var f,p,h=s?t.effectiveOpacity():1,v=l.usePaths(),g=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),E=0,S=0;S<b.length;S++){var P=b[S],_=x[S]=null!=P&&"none"!==P;if(_){var C=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",S);E++,w[S]=l.getCachedImage(P,C,(function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,T=t.pstyle("border-width").pfValue,D=t.pstyle("background-opacity").value*h,O=t.pstyle("border-color").value,N=t.pstyle("border-style").value,M=t.pstyle("border-opacity").value*h;e.lineJoin="miter";var L=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;l.eleFillStyle(e,t,n)},A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;l.colorStrokeStyle(e,O[0],O[1],O[2],t)},I=t.pstyle("shape").strValue,B=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var z=l.nodePathCache=l.nodePathCache||[],R=ie("polygon"===I?I+","+B.join(","):I,""+i,""+r),F=z[R];null!=F?(f=F,g=!0,c.pathCache=f):(f=new Path2D,z[R]=c.pathCache=f)}var V=function(){if(!g){var n=d;v&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(f||e,n.x,n.y,r,i)}v?e.fill(f):e.fill()},G=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,l.drawInscribedImage(e,w[a],t,a,n))}u.backgrounding=!(o===E),i!==u.backgrounding&&t.updateStyle(!1)},U=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(l.colorFillStyle(e,r,r,r,n),v?e.fill(f):e.fill())},q=function(){if(T>0){if(e.lineWidth=T,e.lineCap="butt",e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(f):e.stroke(),"double"===N){e.lineWidth=T/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(f):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},H=function(){a&&l.drawNodeOverlay(e,t,d,r,i)},Y=function(){a&&l.drawNodeUnderlay(e,t,d,r,i)},X=function(){l.drawElementText(e,t,null,o)},K="yes"===t.pstyle("ghost").value;if(K){var Q=t.pstyle("ghost-offset-x").pfValue,$=t.pstyle("ghost-offset-y").pfValue,Z=t.pstyle("ghost-opacity").value,J=Z*h;e.translate(Q,$),L(Z*D),V(),G(J,!0),A(Z*M),q(),U(0!==j||0!==T),G(J,!1),W(J),e.translate(-Q,-$)}v&&e.translate(-d.x,-d.y),Y(),v&&e.translate(d.x,d.y),L(),V(),G(h,!0),A(),q(),U(0!==j||0!==T),G(h,!1),W(),v&&e.translate(-d.x,-d.y),X(),H(),n&&e.translate(p.x1,p.y1)}}},Rs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,o){if(n.visible()){var a=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==o){var c=n.padding();i=n.width()+2*c,o=n.height()+2*c}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a),t.fill()}}}};zs.drawNodeOverlay=Rs("overlay"),zs.drawNodeUnderlay=Rs("underlay"),zs.hasPie=function(e){return(e=e[0])._private.hasPie},zs.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var f=1;f<=i.pieBackgroundN;f++){var p=t.pstyle("pie-"+f+"-background-size").value,h=t.pstyle("pie-"+f+"-background-color").value,v=t.pstyle("pie-"+f+"-background-opacity").value*n,g=p/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*g;0===p||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,h[0],h[1],h[2],v),e.fill(),d+=g)}};var Fs={};Fs.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},Fs.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},Fs.createGradientStyleFor=function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var u=n.sourceEndpoint(),c=n.targetEndpoint(),d=n.midpoint(),f=$e(u,d),p=$e(c,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var h=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(v,g))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();o=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var E=l.length===s.length,k=s.length,S=0;S<k;S++)o.addColorStop(E?l[S]:S/(k-1),"rgba("+s[S][0]+","+s[S][1]+","+s[S][2]+","+i+")");return o},Fs.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},Fs.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},Fs.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},Fs.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},Fs.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},Fs.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},Fs.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=s);var l,u=i*a,c=o*a;if(u!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=i+"px",d.style.height=o+"px";for(var f=0;f<t.CANVAS_LAYERS;f++)(l=n.canvases[f]).width=u,l.height=c,l.style.width=i+"px",l.style.height=o+"px";for(f=0;f<t.BUFFER_COUNT;f++)(l=n.bufferCanvases[f]).width=u,l.height=c,l.style.width=i+"px",l.style.height=o+"px";t.textureMult=1,a<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=u*t.textureMult,l.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},Fs.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Fs.render=function(e){var t=(e=e||xe()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=a.cy,u=a.data,c=u.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),f=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,p=a.motionBlurPxRatio,h=l.hasCompoundNodes(),v=a.hoverData.draggingEles,g=!(!a.hoverData.selecting&&!a.touchData.selecting),y=f=f&&!t&&a.motionBlurEnabled&&!g;t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),f&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(y=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},k={zoom:b,pan:{x:w.x,y:w.y}},S=a.prevViewport;void 0===S||k.zoom!==S.zoom||k.pan.x!==S.pan.x||k.pan.y!==S.pan.y||v&&!h||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var P=a.getCachedZSortedEles();function _(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function C(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?_(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var j=a.data.bufferContexts[a.TEXTURE_BUFFER];j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:j,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(k=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var T=u.contexts[a.NODE],D=a.textureCache.texture;k=a.textureCache.viewport;T.setTransform(1,0,0,1,0,0),f?_(T,0,0,k.width,k.height):T.clearRect(0,0,k.width,k.height);var O=m.core("outside-texture-bg-color").value,N=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(T,O[0],O[1],O[2],N),T.fillRect(0,0,k.width,k.height);b=l.zoom();C(T,!1),T.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/s,k.height/k.zoom/s),T.drawImage(D,k.mpan.x,k.mpan.y,k.width/k.zoom/s,k.height/k.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var M=l.extent(),L=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),A=a.hideEdgesOnViewport&&L,I=[];if(I[a.NODE]=!c[a.NODE]&&f&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,I[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),I[a.DRAG]=!c[a.DRAG]&&f&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,I[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||I[a.NODE]){var B=f&&!I[a.NODE]&&1!==p;C(T=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),f&&!B?"motionBlur":void 0),A?a.drawCachedNodes(T,P.nondrag,s,M):a.drawLayeredElements(T,P.nondrag,s,M),a.debug&&a.drawDebugPoints(T,P.nondrag),n||f||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||I[a.DRAG])){B=f&&!I[a.DRAG]&&1!==p;C(T=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),f&&!B?"motionBlur":void 0),A?a.drawCachedNodes(T,P.drag,s,M):a.drawCachedElements(T,P.drag,s,M),a.debug&&a.drawDebugPoints(T,P.drag),n||f||(c[a.DRAG]=!1)}if(a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(C(T=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var z=m.core("selection-box-border-width").value/b;T.lineWidth=z,T.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",T.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),z>0&&(T.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",T.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var R=u.bgActivePosistion;T.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",T.beginPath(),T.arc(R.x,R.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),T.fill()}var F=a.lastRedrawTime;if(a.showFps&&F){F=Math.round(F);var V=Math.round(1e3/F);T.setTransform(1,0,0,1,0,0),T.fillStyle="rgba(255, 0, 0, 0.75)",T.strokeStyle="rgba(255, 0, 0, 0.75)",T.lineWidth=1,T.fillText("1 frame = "+F+" ms = "+V+" fps",0,20);T.strokeRect(0,30,250,20),T.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(f&&1!==p){var G=u.contexts[a.NODE],U=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],W=u.contexts[a.DRAG],q=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):_(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||I[a.NODE])&&(H(G,U,I[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||I[a.DRAG])&&(H(W,q,I[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=k,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),f&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")};for(var Vs={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l<o.length/2;l++)e.lineTo(t+a*o[2*l],n+s*o[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,l=Dt(r,i);e.beginPath&&e.beginPath();for(var u=0;u<o.length/4;u++){var c,d=void 0;d=0===u?o.length-2:4*u-2,c=4*u+2;var f=t+a*o[4*u],p=n+s*o[4*u+1],h=-o[d]*o[c]-o[d+1]*o[c+1],v=l/Math.tan(Math.acos(h)/2),g=f-v*o[d],y=p-v*o[d+1],m=f+v*o[c],b=p+v*o[c+1];0===u?e.moveTo(g,y):e.lineTo(g,y),e.arcTo(f,p,m,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Tt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Tt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,l=t+o,u=n-a,c=n+a,d=Ot(r,i),f=d.widthOffset,p=d.heightOffset,h=d.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(s,u+p),e.lineTo(s,c-p),e.quadraticCurveTo(s+h,c,s+f,c),e.lineTo(l-f,c),e.quadraticCurveTo(l-h,c,l,c-p),e.lineTo(l,u+p),e.quadraticCurveTo(l-h,u,l-f,u),e.lineTo(s+f,u),e.quadraticCurveTo(s+h,u,s,u+p),e.closePath()}},Gs=Math.sin(0),Us=Math.cos(0),Ws={},qs={},Hs=Math.PI/40,Ys=0*Math.PI;Ys<2*Math.PI;Ys+=Hs)Ws[Ys]=Math.sin(Ys),qs[Ys]=Math.cos(Ys);Vs.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=Hs)o=t-s*Ws[u]*Gs+s*qs[u]*Us,a=n+l*qs[u]*Gs+l*Ws[u]*Us,0===u?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var Xs={};function Ks(e){var t=e.indexOf(",");return e.substr(t+1)}function Qs(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Wn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(Ks(r()),n);case"base64":return Ks(r());default:return r()}}Xs.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},Xs.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=k(e.maxWidth)||k(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,l=e.scale;else if(a){var u=1/0,c=1/0;k(e.maxWidth)&&(u=l*e.maxWidth/i),k(e.maxHeight)&&(c=l*e.maxHeight/o),i*=l=Math.min(u,c),o*=l}a||(i*=s,o*=s,l*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var f=d.getContext("2d");if(i>0&&o>0){f.clearRect(0,0,i,o),f.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*l,-n.y1*l),f.scale(l,l),this.drawElements(f,p),f.scale(1/l,1/l),f.translate(n.x1*l,n.y1*l);else{var h=t.pan(),v={x:h.x*l,y:h.y*l};l*=t.zoom(),f.translate(v.x,v.y),f.scale(l,l),this.drawElements(f,p),f.scale(1/l,1/l),f.translate(-v.x,-v.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,i,o),f.fill())}return d},Xs.png=function(e){return Qs(e,this.bufferCanvasImage(e),"image/png")},Xs.jpg=function(e){return Qs(e,this.bufferCanvasImage(e),"image/jpeg")};var $s={nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}},Zs=el,Js=el.prototype;function el(e){var t=this;t.data={canvases:new Array(Js.CANVAS_LAYERS),contexts:new Array(Js.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Js.CANVAS_LAYERS),bufferCanvases:new Array(Js.BUFFER_COUNT),bufferContexts:new Array(Js.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<Js.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(a).forEach((function(e){l.style[e]=a[e]})),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(Js.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[Js.NODE].setAttribute("data-id","layer"+Js.NODE+"-node"),t.data.canvases[Js.SELECT_BOX].setAttribute("data-id","layer"+Js.SELECT_BOX+"-selectbox"),t.data.canvases[Js.DRAG].setAttribute("data-id","layer"+Js.DRAG+"-drag");for(s=0;s<Js.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var u=rt(),c=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e.boundingBox(),e[0]._private.bodyBounds},f=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||u},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||u},v=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||u},g=function(e,t){return t},y=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},m=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},b=t.data.eleTxrCache=new ps(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:d,getRotationPoint:function(e){return{x:((t=d(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return c(d(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),x=t.data.lblTxrCache=new ps(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:f,getRotationPoint:function(e){return y("",m(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=f(e),n=c(f(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:g}),w=t.data.slbTxrCache=new ps(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:h,getRotationPoint:function(e){return y("source",m(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return c(h(e))},isVisible:g}),E=t.data.tlbTxrCache=new ps(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:v,getRotationPoint:function(e){return y("target",m(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return c(v(e))},isVisible:g}),k=t.data.lyrTxrCache=new vs(t);t.onUpdateEleCalcs((function(e,t){b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),E.invalidateElements(t),k.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var S=function(e){for(var t=0;t<e.length;t++)k.enqueueElementRefinement(e[t].ele)};b.onDequeue(S),x.onDequeue(S),w.onDequeue(S),E.onDequeue(S)}Js.CANVAS_LAYERS=3,Js.SELECT_BOX=0,Js.DRAG=1,Js.NODE=2,Js.BUFFER_COUNT=3,Js.TEXTURE_BUFFER=0,Js.MOTIONBLUR_BUFFER_NODE=1,Js.MOTIONBLUR_BUFFER_DRAG=2,Js.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[Js.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[Js.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[Js.SELECT_BOX]=t}};var tl="undefined"!=typeof Path2D;Js.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},Js.usePaths=function(){return tl&&this.pathsEnabled},Js.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},Js.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},Js.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":a(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[xs,_s,Ms,As,Is,zs,Fs,Vs,Xs,$s].forEach((function(e){R(Js,e)}));var nl=[{type:"layout",extensions:Aa},{type:"renderer",extensions:[{name:"null",impl:Ia},{name:"base",impl:as},{name:"canvas",impl:Zs}]}],rl={},il={};function ol(e,t,n){var r=n,i=function(n){ge("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(Ko.prototype[t])return i(t);Ko.prototype[t]=n}else if("collection"===e){if(fo.prototype[t])return i(t);fo.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),E(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var u=s[l];a[u]=a[u]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var c=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};R(a,{createEmitter:function(){return this._private.emitter=new Ti(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),Qn.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var p=al("renderer","base"),h=p.prototype,v=n,g=n.prototype,y=function(){p.apply(this,arguments),v.apply(this,arguments)},m=y.prototype;for(var b in h){var x=h[b];if(null!=g[b])return i(b);m[b]=x}for(var w in g)m[w]=g[w];h.clientFunctions.forEach((function(e){m[e]=m[e]||function(){he("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}return G({map:rl,keys:[e,t],value:r})}function al(e,t){return U({map:rl,keys:[e,t]})}function sl(e,t,n,r,i){return G({map:il,keys:[e,t,n,r],value:i})}function ll(e,t,n,r){return U({map:il,keys:[e,t,n,r]})}var ul=function(){return 2===arguments.length?al.apply(null,arguments):3===arguments.length?ol.apply(null,arguments):4===arguments.length?ll.apply(null,arguments):5===arguments.length?sl.apply(null,arguments):void he("Invalid extension access syntax")};Ko.prototype.extension=ul,nl.forEach((function(e){e.extensions.forEach((function(t){ol(e.type,t.name,t.impl)}))}));var cl=function e(){if(!(this instanceof e))return new e;this.length=0},dl=cl.prototype;dl.instanceString=function(){return"stylesheet"},dl.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},dl.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(E(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var l=Wo.properties[a]||Wo.properties[L(a)];if(null!=l){var u=l.name,c=s;this[n].properties.push({name:u,value:c})}}}return this},dl.style=dl.css,dl.generateStyle=function(e){var t=new Wo(e);return this.appendToStyle(t)},dl.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var o=0;o<i.length;o++){var a=i[o];e.css(a.name,a.value)}}return e};var fl=function(e){return void 0===e&&(e={}),E(e)?new Ko(e):b(e)?ul.apply(ul,arguments):void 0};fl.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(fl),e.apply(null,t),this},fl.warnings=function(e){return ve(e)},fl.version="3.20.0",fl.stylesheet=fl.Stylesheet=cl,e.exports=fl},"4e6e":(e,t,n)=>{e.exports={graphlib:n("vC4J"),layout:n("Pivv"),debug:n("zmx7"),util:{time:n("xxjf").time,notime:n("xxjf").notime},version:n("VQMV")}},"1yUy":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("fd5j");e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])}return r.forEach(e.nodes(),o),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},"0gKz":(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s<l;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},"+jFT":(e,t,n)=>{"use strict";var r=n("gjtd");function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},"ge/d":e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},zmx7:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf"),o=n("vC4J").Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},vC4J:(e,t,n)=>{var r;try{r=n("YlUH")}catch(i){}r||(r=window.graphlib),e.exports=r},fd5j:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph,o=n("ge/d");e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){var r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},Pivv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("1yUy"),o=n("RmLA"),a=n("4DVH"),s=n("xxjf").normalizeRanks,l=n("JUZX"),u=n("xxjf").removeEmptyRanks,c=n("wHMW"),d=n("0gKz"),f=n("+jFT"),p=n("erCh"),h=n("Nebv"),v=n("xxjf"),g=n("vC4J").Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=_(e.graph());return t.setGraph(r.merge({},m,P(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=_(e.node(n));t.setNode(n,r.defaults(P(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=_(e.edge(n));t.setEdge(n,r.merge({},k,P(i,E),r.pick(i,S)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){f.adjust(e)})),t(" position",(function(){h(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(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}}))}(e)})),t(" undoCoordinateSystem",(function(){f.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function P(e,t){return r.mapValues(r.pick(e,t),Number)}function _(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},gjtd:(e,t,n)=>{var r;try{r={cloneDeep:n("c2re"),constant:n("eN33"),defaults:n("WHWN"),each:n("h4um"),filter:n("+DnP"),find:n("6R5o"),flatten:n("1xil"),forEach:n("9SCj"),forIn:n("ZVKf"),has:n("1mr4"),isUndefined:n("CZlo"),last:n("p1C/"),map:n("mbB6"),mapValues:n("y2Ah"),max:n("LPC+"),merge:n("H8sf"),min:n("Z3AG"),minBy:n("PKEM"),now:n("ENE1"),pick:n("//nZ"),range:n("Cmkl"),reduce:n("veKZ"),sortBy:n("u6DZ"),uniqueId:n("w0mW"),values:n("0iyY"),zipObject:n("OUo6")}}catch(i){}r||(r=window._),e.exports=r},wHMW:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),f=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(f,u),p.borderBottom=f,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,h=i.borderTop?a:2*a,v=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:h,minlen:v,nestingEdge:!0}),e.setEdge(p,f,{weight:h,minlen:v,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},RmLA:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf");e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),f=d.labelRank;if(u===s+1)return;for(e.removeEdge(t),o=0,++s;s<u;++o,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=i.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,l,{weight:d.weight},c)}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),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),t=n,r=e.node(t)}))}}},DzXQ:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},gP9q:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},D5rW:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph;e.exports=function(e,t,n){var o=function(e){var t;for(;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},YZb2:(e,t,n)=>{"use strict";var r=n("gjtd");function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var l=r.map(new Array(s),(function(){return 0})),u=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},erCh:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("NI55"),o=n("YZb2"),a=n("Qsja"),s=n("D5rW"),l=n("DzXQ"),u=n("vC4J").Graph,c=n("xxjf");function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function f(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,h=0,v=0;v<4;++h,++v){f(h%2?n:a,h%4>=2),s=c.buildLayerMatrix(e);var g=o(e,s);g<u&&(v=0,l=r.cloneDeep(s),u=g)}p(e,l)}},NI55:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(r.has(t,i))return;t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)})),o}},Hp3j:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},Qsja:(e,t,n)=>{var r=n("gjtd"),i=n("gP9q"),o=n("Hp3j"),a=n("zBPj");e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,f=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==f})));var h=i(t,u);r.forEach(h,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(h,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,p);var g=a(v,l);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g}},zBPj:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n=i.partition(e,(function(e){return r.has(e,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(e){return-e.i})),l=[],u=0,c=0,d=0;a.sort((f=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:f?t.i-e.i:e.i-t.i})),d=o(l,s,d),r.forEach(a,(function(e){d+=e.vs.length,l.push(e.vs),u+=e.barycenter*e.weight,c+=e.weight,d=o(l,s,d)}));var f;var p={vs:r.flatten(l,!0)};c&&(p.barycenter=u/c,p.weight=c);return p}},JUZX:(e,t,n)=>{var r=n("gjtd");e.exports=function(e){var t=function(e){var t={},n=0;function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}}return r.forEach(e.children(),i),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));o=i,i=r;for(;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank<r.rank;)l++;u===s&&(c=!1)}if(!c){for(;l<a.length-1&&e.node(u=a[l+1]).minRank<=r.rank;)l++;u=a[l]}e.setParent(n,u),n=e.successors(n)[0]}}))}},xaOS:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("xxjf");function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),f=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||f<a)||i.dummy&&e.node(t).dummy||l(n,r,t)}))})),a=c+1,o=f)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var u;r.forEach(r.range(i,o),(function(i){u=t[i],e.node(u).dummy&&r.forEach(e.predecessors(u),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),f=Math.ceil(c);d<=f;++d){var p=l[d];a[e]===e&&t<s[p]&&!u(n,e,p)&&(a[p]=e,a[e]=o[e]=o[p],t=s[p])}}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},l=function(e,t,n,o){var a=new i,s=e.graph(),l=function(e,t,n){return function(i,o,a){var s,l=i.node(o),u=i.node(a),c=0;if(c+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(c+=n?s:-s),s=0,c+=(l.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2}return s&&(c+=n?s:-s),s=0,c}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(l(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),u=a?"borderLeft":"borderRight";function c(e,t){for(var n=l.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return c((function(e){s[e]=l.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+l.edge(t))}),0)}),l.predecessors.bind(l)),c((function(t){var n=l.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-l.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(s[t]=Math.max(s[t],n))}),l.successors.bind(l)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function f(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function p(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,l=n+a,u=e[l];if(u!==t){var c=r.values(u);(s="l"===a?i-r.min(c):o-r.max(c))&&(e[l]=r.mapValues(u,(function(e){return e+s})))}}))}))}function h(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),l={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=c(e,t,i,a),u=d(e,t,s.root,s.align,"r"===n);"r"===n&&(u=r.mapValues(u,(function(e){return-e}))),l[o+n]=u}))}));var u=f(e,l);return p(l,u),h(l,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:u,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:f,balance:h}},Nebv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf"),o=n("xaOS").positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},"58Ui":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("K8/D").slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();r.setNode(u,{});for(;a(r,e)<c;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),l(r,e,n);return r}},"4DVH":(e,t,n)=>{"use strict";var r=n("K8/D").longestPath,i=n("58Ui"),o=n("EMSI");e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){o(e)}},EMSI:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("58Ui"),o=n("K8/D").slack,a=n("K8/D").longestPath,s=n("vC4J").alg.preorder,l=n("vC4J").alg.postorder,u=n("xxjf").simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=v(n);)y(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)}))}function f(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,f=t.edge(r).weight;if(s+=d?f:-f,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),h(e,{},1,t)}function h(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=h(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(e,e.node(t.v),u)&&c!==m(e,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=f,c.leaveEdge=v,c.enterEdge=g,c.exchangeEdges=y},"K8/D":(e,t,n)=>{"use strict";var r=n("gjtd");e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},xxjf:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},VQMV:e=>{e.exports="0.8.5"},QzV0:e=>{e.exports=a,a.default=a,a.stable=c,a.stableStringify=c;var t="[...]",n="[Circular]",r=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=o()),l(e,"",0,[],void 0,0,a);try{s=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function s(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);void 0!==a.get?a.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,a])):i.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function l(e,r,i,o,a,u,c){var d;if(u+=1,"object"==typeof e&&null!==e){for(d=0;d<o.length;d++)if(o[d]===e)return void s(n,e,r,a);if(void 0!==c.depthLimit&&u>c.depthLimit)return void s(t,e,r,a);if(void 0!==c.edgesLimit&&i+1>c.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,o,e,u,c);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,o,e,u,c)}}o.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function c(e,t,n,a){void 0===a&&(a=o());var s,l=d(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(l,t,n):JSON.stringify(l,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var u=r.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return s}function d(e,i,o,a,l,c,f){var p;if(c+=1,"object"==typeof e&&null!==e){for(p=0;p<a.length;p++)if(a[p]===e)return void s(n,e,i,l);try{if("function"==typeof e.toJSON)return}catch(y){return}if(void 0!==f.depthLimit&&c>f.depthLimit)return void s(t,e,i,l);if(void 0!==f.edgesLimit&&o+1>f.edgesLimit)return void s(t,e,i,l);if(a.push(e),Array.isArray(e))for(p=0;p<e.length;p++)d(e[p],p,p,a,e,c,f);else{var h={},v=Object.keys(e).sort(u);for(p=0;p<v.length;p++){var g=v[p];d(e[g],g,p,a,e,c,f),h[g]=e[g]}if(void 0===l)return h;r.push([l,i,e]),l[i]=h}a.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var o=i[r];if(o[1]===t&&o[0]===n){n=o[2],i.splice(r,1);break}}return e.call(this,t,n)}}},YlUH:(e,t,n)=>{var r=n("1qSF");e.exports={Graph:r.Graph,json:n("M2c1"),alg:n("ZCKZ"),version:r.version}},qC43:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},"5Ck4":(e,t,n)=>{var r=n("Jl0P");function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},a271:(e,t,n)=>{var r=n("V9bN"),i=n("Jl0P");e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},V9bN:(e,t,n)=>{var r=n("Jl0P"),i=n("c9kG");e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u<r.distance&&(r.distance=u,r.predecessor=o,l.decrease(t,u))};e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)}));for(;l.size()>0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},W8B9:(e,t,n)=>{var r=n("Jl0P"),i=n("Pa7R");e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},hq5n:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},ZCKZ:(e,t,n)=>{e.exports={components:n("qC43"),dijkstra:n("V9bN"),dijkstraAll:n("a271"),findCycles:n("W8B9"),floydWarshall:n("hq5n"),isAcyclic:n("+WAL"),postorder:n("21zJ"),preorder:n("j+bJ"),prim:n("xGdc"),tarjan:n("Pa7R"),topsort:n("0Jj1")}},"+WAL":(e,t,n)=>{var r=n("0Jj1");e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},"21zJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"post")}},"j+bJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"pre")}},xGdc:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw"),o=n("c9kG");e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,l.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){l.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),l.decrease(e.nodes()[0],0);var c=!1;for(;l.size()>0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},Pa7R:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},"0Jj1":(e,t,n)=>{var r=n("Jl0P");function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},c9kG:(e,t,n)=>{var r=n("Jl0P");function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},buMw:(e,t,n)=>{"use strict";var r=n("Jl0P");e.exports=o;var i="\0";function o(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(r.isUndefined(i)?"\0":i)}function u(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function c(e,t){return l(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},o.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},o.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},o.prototype.setEdge=function(){var e,t,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(e,t,n);var d=u(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[c]=d,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][c]=d,this._out[e][c]=d,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},o.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},o.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},"1qSF":(e,t,n)=>{e.exports={Graph:n("buMw"),version:n("5AdH")}},M2c1:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw");function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};r.isUndefined(e.graph())||(t.value=r.clone(e.graph()));return t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},Jl0P:(e,t,n)=>{var r;try{r={clone:n("zr3P"),constant:n("eN33"),each:n("h4um"),filter:n("+DnP"),has:n("1mr4"),isArray:n("wxYD"),isEmpty:n("MwrP"),isFunction:n("2q8g"),isUndefined:n("CZlo"),keys:n("BlJA"),map:n("mbB6"),reduce:n("veKZ"),size:n("7seP"),transform:n("cZX/"),union:n("aGtI"),values:n("0iyY")}}catch(i){}r||(r=window._),e.exports=r},"5AdH":e=>{e.exports="2.1.8"},"3Ssf":(e,t,n)=>{e.exports=n("pvAv")},pvAv:function(e,t){var n,r,i;(function(){var o,a,s,l,u,c,d,f,p,h,v,g,y,m,b;s=Math.floor,h=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},p=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},c=function(e,t,n){return null==n&&(n=a),e.push(t),m(e,0,e.length-1,n)},u=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},f=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},l=function(e,t){var n,r,i,o,l,u;for(null==t&&(t=a),o=(function(){u=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse(),l=[],r=0,i=o.length;r<i;r++)n=o[r],l.push(b(e,n,t));return l},y=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s,u;if(null==n&&(n=a),!(i=e.slice(0,t)).length)return i;for(l(i,n),o=0,s=(u=e.slice(t)).length;o<s;o++)r=u[o],d(i,r,n);return i.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,c,d,f,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(f=e.slice(t)).length;s<d;s++)n(r=f[s],i)<0&&(p(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(l(e,n),g=[],c=0,v=h(t,e.length);0<=v?c<v:c>v;0<=v?++c:--c)g.push(u(e,n));return g},m=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,l;for(null==n&&(n=a),i=e.length,l=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,m(e,l,t,n)},o=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=c,e.pop=u,e.replace=f,e.pushpop=d,e.heapify=l,e.updateItem=y,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pop=function(){return u(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return f(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return l(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(i="function"==typeof(n=function(){return o})?n.apply(t,r):n)||(e.exports=i)}).call(this)},"9EWH":(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function i(e){return!!e&&!!e[J]}function o(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===te}(e)||Array.isArray(e)||!!e[Z]||!!e.constructor[Z]||p(e)||h(e))}function a(e){return i(e)||r(23,e),e[J].t}function s(e,t,n){void 0===n&&(n=!1),0===l(e)?(n?Object.keys:ne)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function l(e){var t=e[J];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:p(e)?2:h(e)?3:0}function u(e,t){return 2===l(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===l(e)?e.get(t):e[t]}function d(e,t,n){var r=l(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){return X&&e instanceof Map}function h(e){return K&&e instanceof Set}function v(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=re(e);delete t[J];for(var n=ne(t),r=0;r<n.length;r++){var i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function y(e,t){return void 0===t&&(t=!1),b(e)||i(e)||!o(e)||(l(e)>1&&(e.set=e.add=e.clear=e.delete=m),Object.freeze(e),t&&s(e,(function(e,t){return y(t,!0)}),!0)),e}function m(){r(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function x(e){var t=ie[e];return t||r(18,e),t}function w(e,t){ie[e]||(ie[e]=t)}function E(){return H}function k(e,t){t&&(x("Patches"),e.u=[],e.s=[],e.v=t)}function S(e){P(e),e.p.forEach(C),e.p=null}function P(e){e===H&&(H=e.l)}function _(e){return H={p:[],l:H,h:e,m:!0,_:0}}function C(e){var t=e[J];0===t.i||1===t.i?t.j():t.O=!0}function j(e,t){t._=t.p.length;var n=t.p[0],i=void 0!==e&&e!==n;return t.h.g||x("ES5").S(t,e,i),i?(n[J].P&&(S(t),r(4)),o(e)&&(e=T(t,e),t.l||O(t,e)),t.u&&x("Patches").M(n[J],e,t.u,t.s)):e=T(t,n,[]),S(t),t.u&&t.v(t.u,t.s),e!==$?e:void 0}function T(e,t,n){if(b(t))return t;var r=t[J];if(!r)return s(t,(function(i,o){return D(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return O(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=g(r.k):r.o;s(3===r.i?new Set(i):i,(function(t,o){return D(e,r,i,t,o,n)})),O(e,i,!1),n&&e.u&&x("Patches").R(r,n,e.u,e.s)}return r.o}function D(e,t,n,r,a,s){if(i(a)){var l=T(e,a,s&&t&&3!==t.i&&!u(t.D,r)?s.concat(r):void 0);if(d(n,r,l),!i(l))return;e.m=!1}if(o(a)&&!b(a)){if(!e.h.F&&e._<1)return;T(e,a),t&&t.A.l||O(e,a)}}function O(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&y(t,n)}function N(e,t){var n=e[J];return(n?v(n):e)[t]}function M(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function L(e){e.P||(e.P=!0,e.l&&L(e.l))}function A(e){e.o||(e.o=g(e.t))}function I(e,t,n){var r=p(t)?x("MapSet").N(t,n):h(t)?x("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:E(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=oe;n&&(i=[r],o=ae);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):x("ES5").J(t,n);return(n?n.A:E()).p.push(r),r}function B(e){return i(e)||r(22,e),function e(t){if(!o(t))return t;var n,r=t[J],i=l(t);if(r){if(!r.P&&(r.i<4||!x("ES5").K(r)))return r.t;r.I=!0,n=z(t,i),r.I=!1}else n=z(t,i);return s(n,(function(t,i){r&&c(r.t,t)===i||d(n,t,e(i))})),3===i?new Set(n):n}(e)}function z(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}function R(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[J];return oe.get(t,e)},set:function(t){var n=this[J];oe.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][J];if(!i.P)switch(i.i){case 5:r(i)&&L(i);break;case 4:n(i)&&L(i)}}}function n(e){for(var t=e.t,n=e.k,r=ne(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==J){var a=t[o];if(void 0===a&&!u(t,o))return!0;var s=n[o],l=s&&s[J];if(l?l.t!==a:!f(s,a))return!0}}var c=!!t[J];return r.length!==ne(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}var o={};w("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var o=re(n);delete o[J];for(var a=ne(o),s=0;s<a.length;s++){var l=a[s];o[l]=e(l,t||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(r,t),o={i:r?5:4,A:n?n.A:E(),P:!1,I:!1,D:{},l:n,t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,J,{value:o,writable:!0}),i},S:function(e,n,o){o?i(n)&&n[J].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[J];if(n){var i=n.t,o=n.k,a=n.D,l=n.i;if(4===l)s(o,(function(t){t!==J&&(void 0!==i[t]||u(i,t)?a[t]||e(o[t]):(a[t]=!0,L(n)))})),s(i,(function(e){void 0!==o[e]||u(o,e)||(a[e]=!1,L(n))}));else if(5===l){if(r(n)&&(L(n),a.length=!0),o.length<i.length)for(var c=o.length;c<i.length;c++)a[c]=!1;else for(var d=i.length;d<o.length;d++)a[d]=!0;for(var f=Math.min(o.length,i.length),p=0;p<f;p++)void 0===a[p]&&e(o[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}function F(){function e(t){if(!o(t))return t;if(Array.isArray(t))return t.map(e);if(p(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(h(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return u(t,Z)&&(n[Z]=t[Z]),n}function t(t){return i(t)?e(t):t}var n="add";w("Patches",{$:function(t,i){return i.forEach((function(i){for(var o=i.path,a=i.op,s=t,u=0;u<o.length-1;u++){var d=l(s),f=""+o[u];0!==d&&1!==d||"__proto__"!==f&&"constructor"!==f||r(24),"function"==typeof s&&"prototype"===f&&r(24),"object"!=typeof(s=c(s,f))&&r(15,o.join("/"))}var p=l(s),h=e(i.value),v=o[o.length-1];switch(a){case"replace":switch(p){case 2:return s.set(v,h);case 3:r(16);default:return s[v]=h}case n:switch(p){case 1:return s.splice(v,0,h);case 2:return s.set(v,h);case 3:return s.add(h);default:return s[v]=h}case"remove":switch(p){case 1:return s.splice(v,1);case 2:return s.delete(v);case 3:return s.delete(i.value);default:return delete s[v]}default:r(17,a)}})),t},R:function(e,r,i,o){switch(e.i){case 0:case 4:case 2:return function(e,r,i,o){var a=e.t,l=e.o;s(e.D,(function(e,s){var d=c(a,e),f=c(l,e),p=s?u(a,e)?"replace":n:"remove";if(d!==f||"replace"!==p){var h=r.concat(e);i.push("remove"===p?{op:p,path:h}:{op:p,path:h,value:f}),o.push(p===n?{op:"remove",path:h}:"remove"===p?{op:n,path:h,value:t(d)}:{op:"replace",path:h,value:t(d)})}}))}(e,r,i,o);case 5:case 1:return function(e,r,i,o){var a=e.t,s=e.D,l=e.o;if(l.length<a.length){var u=[l,a];a=u[0],l=u[1];var c=[o,i];i=c[0],o=c[1]}for(var d=0;d<a.length;d++)if(s[d]&&l[d]!==a[d]){var f=r.concat([d]);i.push({op:"replace",path:f,value:t(l[d])}),o.push({op:"replace",path:f,value:t(a[d])})}for(var p=a.length;p<l.length;p++){var h=r.concat([p]);i.push({op:n,path:h,value:t(l[p])})}a.length<l.length&&o.push({op:"replace",path:r.concat(["length"]),value:a.length})}(e,r,i,o);case 3:return function(e,t,r,i){var o=e.t,a=e.o,s=0;o.forEach((function(e){if(!a.has(e)){var o=t.concat([s]);r.push({op:"remove",path:o,value:e}),i.unshift({op:n,path:o,value:e})}s++})),s=0,a.forEach((function(e){if(!o.has(e)){var a=t.concat([s]);r.push({op:n,path:a,value:e}),i.unshift({op:"remove",path:a,value:e})}s++}))}(e,r,i,o)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===$?void 0:t}),r.push({op:"replace",path:[],value:e.t})}})}function V(){function e(e,t){function n(){this.constructor=e}a(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(o(t)){var n=I(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function i(e){e.O&&r(3,JSON.stringify(v(e)))}var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},l=function(){function n(e,t){return this[J]={i:2,l:t,A:t?t.A:E(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return v(this[J]).size}}),r.has=function(e){return v(this[J]).has(e)},r.set=function(e,n){var r=this[J];return i(r),v(r).has(e)&&v(r).get(e)===n||(t(r),L(r),r.D.set(e,!0),r.o.set(e,n),r.D.set(e,!0)),this},r.delete=function(e){if(!this.has(e))return!1;var n=this[J];return i(n),t(n),L(n),n.D.set(e,!1),n.o.delete(e),!0},r.clear=function(){var e=this[J];i(e),v(e).size&&(t(e),L(e),e.D=new Map,s(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},r.forEach=function(e,t){var n=this;v(this[J]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},r.get=function(e){var n=this[J];i(n);var r=v(n).get(e);if(n.I||!o(r))return r;if(r!==n.t.get(e))return r;var a=I(n.A.h,r,n);return t(n),n.o.set(e,a),a},r.keys=function(){return v(this[J]).keys()},r.values=function(){var e,t=this,n=this.keys();return(e={})[ee]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},r.entries=function(){var e,t=this,n=this.keys();return(e={})[ee]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},r[ee]=function(){return this.entries()},n}(),u=function(){function t(e,t){return this[J]={i:3,l:t,A:t?t.A:E(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var r=t.prototype;return Object.defineProperty(r,"size",{get:function(){return v(this[J]).size}}),r.has=function(e){var t=this[J];return i(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},r.add=function(e){var t=this[J];return i(t),this.has(e)||(n(t),L(t),t.o.add(e)),this},r.delete=function(e){if(!this.has(e))return!1;var t=this[J];return i(t),n(t),L(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},r.clear=function(){var e=this[J];i(e),v(e).size&&(n(e),L(e),e.o.clear())},r.values=function(){var e=this[J];return i(e),n(e),e.o.values()},r.entries=function(){var e=this[J];return i(e),n(e),e.o.entries()},r.keys=function(){return this.values()},r[ee]=function(){return this.values()},r.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();w("MapSet",{N:function(e,t){return new l(e,t)},T:function(e,t){return new u(e,t)}})}function G(){R(),V(),F()}function U(e){return e}function W(e){return e}n.r(t),n.d(t,{default:()=>ge,Immer:()=>se,applyPatches:()=>pe,castDraft:()=>U,castImmutable:()=>W,createDraft:()=>he,current:()=>B,enableAllPlugins:()=>G,enableES5:()=>R,enableMapSet:()=>V,enablePatches:()=>F,finishDraft:()=>ve,freeze:()=>y,immerable:()=>Z,isDraft:()=>i,isDraftable:()=>o,nothing:()=>$,original:()=>a,produce:()=>ue,produceWithPatches:()=>ce,setAutoFreeze:()=>de,setUseProxies:()=>fe});var q,H,Y="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,K="undefined"!=typeof Set,Q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,$=Y?Symbol.for("immer-nothing"):((q={})["immer-nothing"]=!0,q),Z=Y?Symbol.for("immer-draftable"):"__$immer_draftable",J=Y?Symbol.for("immer-state"):"__$immer_state",ee="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",te=""+Object.prototype.constructor,ne="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,re=Object.getOwnPropertyDescriptors||function(e){var t={};return ne(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ie={},oe={get:function(e,t){if(t===J)return e;var n=v(e);if(!u(n,t))return function(e,t,n){var r,i=M(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!o(r)?r:r===N(e.t,t)?(A(e),e.o[t]=I(e.A.h,r,e)):r},has:function(e,t){return t in v(e)},ownKeys:function(e){return Reflect.ownKeys(v(e))},set:function(e,t,n){var r=M(v(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=N(v(e),t),o=null==i?void 0:i[J];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(f(n,i)&&(void 0!==n||u(e.t,t)))return!0;A(e),L(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==N(e.t,t)||t in e.t?(e.D[t]=!1,A(e),L(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=v(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){r(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){r(12)}},ae={};s(oe,(function(e,t){ae[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ae.deleteProperty=function(e,t){return oe.deleteProperty.call(this,e[0],t)},ae.set=function(e,t,n){return oe.set.call(this,e[0],t,n,e[0])};var se=function(){function e(e){var t=this;this.g=Q,this.F=!0,this.produce=function(e,n,i){if("function"==typeof e&&"function"!=typeof n){var a=n;n=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return s.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var l;if("function"!=typeof n&&r(6),void 0!==i&&"function"!=typeof i&&r(7),o(e)){var u=_(t),c=I(t,e,void 0),d=!0;try{l=n(c),d=!1}finally{d?S(u):P(u)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then((function(e){return k(u,i),j(e,u)}),(function(e){throw S(u),e})):(k(u,i),j(l,u))}if(!e||"object"!=typeof e){if((l=n(e))===$)return;return void 0===l&&(l=e),t.F&&y(l,!0),l}r(21,e)},this.produceWithPatches=function(e,n){return"function"==typeof e?function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))}:[t.produce(e,n,(function(e,t){r=e,i=t})),r,i];var r,i},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){o(e)||r(8),i(e)&&(e=B(e));var t=_(this),n=I(this,e,void 0);return n[J].C=!0,P(t),n},t.finishDraft=function(e,t){var n=(e&&e[J]).A;return k(n,t),j(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Q&&r(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=x("Patches").$;return i(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(n+1))}))},e}(),le=new se,ue=le.produce,ce=le.produceWithPatches.bind(le),de=le.setAutoFreeze.bind(le),fe=le.setUseProxies.bind(le),pe=le.applyPatches.bind(le),he=le.createDraft.bind(le),ve=le.finishDraft.bind(le);const ge=ue},"E/ZA":e=>{var t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,l=a||s||Function("return this")(),u=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=p(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||i.test(e)?o(e.slice(2),s?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,l,u=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function b(e){return u=e,s=setTimeout(w,t),v?m(e):a}function x(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-u>=o}function w(){var e=f();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return g?d(n,o-(e-u)):n}(e))}function E(e){return s=void 0,y&&r?m(e):(r=i=void 0,a)}function k(){var e=f(),n=x(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return b(l);if(g)return s=setTimeout(w,t),m(l)}return void 0===s&&(s=setTimeout(w,t)),a}return t=h(t)||0,p(n)&&(v=!!n.leading,o=(g="maxWait"in n)?c(h(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},k.flush=function(){return void 0===s?a:E(f())},k}},QF3D:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"DataView");e.exports=r},Tv3l:(e,t,n)=>{var r=n("2Fbm"),i=n("VPai"),o=n("+fUG"),a=n("QMz8"),s=n("mUsV");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},"+ooz":(e,t,n)=>{var r=n("8Zrg"),i=n("kwr2"),o=n("5VYK"),a=n("Coc+"),s=n("LzM7");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},qeCs:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Map");e.exports=r},hyzI:(e,t,n)=>{var r=n("m5o6"),i=n("d0UJ"),o=n("eask"),a=n("9SKQ"),s=n("e63W");function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},IS0S:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Promise");e.exports=r},OBn4:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Set");e.exports=r},"JBn+":(e,t,n)=>{var r=n("hyzI"),i=n("qjF7"),o=n("cEmw");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},HsnV:(e,t,n)=>{var r=n("+ooz"),i=n("RNlM"),o=n("E4ao"),a=n("BSqe"),s=n("L6um"),l=n("4/ik");function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},Syyo:(e,t,n)=>{var r=n("IBsm").Symbol;e.exports=r},mGzy:(e,t,n)=>{var r=n("IBsm").Uint8Array;e.exports=r},"4+Vk":(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"WeakMap");e.exports=r},zaNA:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},LmOH:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},W0vE:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},OfKG:(e,t,n)=>{var r=n("c7Qd");e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},"sCL+":e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},rmhs:(e,t,n)=>{var r=n("2ZvR"),i=n("bvyN"),o=n("wxYD"),a=n("3ajY"),s=n("pnw1"),l=n("Qd2C"),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),f=!n&&!c&&!d&&l(e),p=n||c||d||f,h=p?r(e.length,String):[],v=h.length;for(var g in e)!t&&!u.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||h.push(g);return h}},H87J:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},"y/9h":e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},cPMt:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},myUI:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},"2wsP":(e,t,n)=>{var r=n("EI7Z")("length");e.exports=r},amiU:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx");e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},c72w:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx"),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},"6QIk":(e,t,n)=>{var r=n("pPzx");e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},tPQG:(e,t,n)=>{var r=n("LtXa"),i=n("BlJA");e.exports=function(e,t){return e&&r(t,i(t),e)}},QrYh:(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e,t){return e&&r(t,i(t),e)}},wC3K:(e,t,n)=>{var r=n("Pz+s");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},kn3Q:(e,t,n)=>{var r=n("HsnV"),i=n("LmOH"),o=n("c72w"),a=n("tPQG"),s=n("QrYh"),l=n("Grae"),u=n("QT01"),c=n("AjPR"),d=n("BjSP"),f=n("tlBq"),p=n("zF5n"),h=n("kkM+"),v=n("3Qlq"),g=n("7No3"),y=n("sD1O"),m=n("wxYD"),b=n("3ajY"),x=n("NbvU"),w=n("tQYX"),E=n("/iLo"),k=n("BlJA"),S=n("zH+d"),P="[object Arguments]",_="[object Function]",C="[object Object]",j={};j[P]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[C]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[_]=j["[object WeakMap]"]=!1,e.exports=function e(t,n,T,D,O,N){var M,L=1&n,A=2&n,I=4&n;if(T&&(M=O?T(t,D,O,N):T(t)),void 0!==M)return M;if(!w(t))return t;var B=m(t);if(B){if(M=v(t),!L)return u(t,M)}else{var z=h(t),R=z==_||"[object GeneratorFunction]"==z;if(b(t))return l(t,L);if(z==C||z==P||R&&!O){if(M=A||R?{}:y(t),!L)return A?d(t,s(M,t)):c(t,a(M,t))}else{if(!j[z])return O?t:{};M=g(t,z,L)}}N||(N=new r);var F=N.get(t);if(F)return F;N.set(t,M),E(t)?t.forEach((function(r){M.add(e(r,n,T,r,t,N))})):x(t)&&t.forEach((function(r,i){M.set(i,e(r,n,T,i,t,N))}));var V=B?void 0:(I?A?p:f:A?S:k)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(M,i,e(r,n,T,i,t,N))})),M}},vGGS:(e,t,n)=>{var r=n("tQYX"),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},Q4oW:(e,t,n)=>{var r=n("zKkv"),i=n("bz5b")(r);e.exports=i},JElN:(e,t,n)=>{var r=n("a88S");e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,u=a}return u}},sjzV:(e,t,n)=>{var r=n("Q4oW");e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},DuXo:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},YpBQ:(e,t,n)=>{var r=n("y/9h"),i=n("oCTG");e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l<u;){var c=t[l];n>0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},UdtX:(e,t,n)=>{var r=n("RFxK")();e.exports=r},zKkv:(e,t,n)=>{var r=n("UdtX"),i=n("BlJA");e.exports=function(e,t){return e&&r(e,t,i)}},w2Tz:(e,t,n)=>{var r=n("xoyU"),i=n("Ypsa");e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},pIod:(e,t,n)=>{var r=n("y/9h"),i=n("wxYD");e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},Dhk8:(e,t,n)=>{var r=n("Syyo"),i=n("KCLV"),o=n("kHoZ"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},FaiA:e=>{e.exports=function(e,t){return e>t}},SJov:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},JYmt:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},c7Qd:(e,t,n)=>{var r=n("DuXo"),i=n("z9Jh"),o=n("n1QJ");e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},"/30y":(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},NYSw:(e,t,n)=>{var r=n("BqUW"),i=n("tLQN");e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},BqUW:(e,t,n)=>{var r=n("HsnV"),i=n("ZZ+W"),o=n("R3gn"),a=n("yZHP"),s=n("kkM+"),l=n("wxYD"),u=n("3ajY"),c=n("Qd2C"),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var m=l(e),b=l(t),x=m?f:s(e),w=b?f:s(t),E=(x=x==d?p:x)==p,k=(w=w==d?p:w)==p,S=x==w;if(S&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(S&&!E)return y||(y=new r),m||c(e)?i(e,t,n,v,g,y):o(e,t,x,n,v,g,y);if(!(1&n)){var P=E&&h.call(e,"__wrapped__"),_=k&&h.call(t,"__wrapped__");if(P||_){var C=P?e.value():e,j=_?t.value():t;return y||(y=new r),g(C,j,n,v,y)}}return!!S&&(y||(y=new r),a(e,t,n,v,g,y))}},gEWz:(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},ZjRn:(e,t,n)=>{var r=n("HsnV"),i=n("NYSw");e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var c=(u=n[a])[0],d=e[c],f=u[1];if(l&&u[2]){if(void 0===d&&!(c in e))return!1}else{var p=new r;if(o)var h=o(d,f,c,e,t,p);if(!(void 0===h?i(f,d,3,o,p):h))return!1}}return!0}},z9Jh:e=>{e.exports=function(e){return e!=e}},"5nKN":(e,t,n)=>{var r=n("2q8g"),i=n("9vbJ"),o=n("tQYX"),a=n("c18h"),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:s).test(a(e))}},"6I2w":(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},"7/jS":(e,t,n)=>{var r=n("Dhk8"),i=n("t0L4"),o=n("tLQN"),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},S3pA:(e,t,n)=>{var r=n("7/we"),i=n("KAo/"),o=n("zWgn"),a=n("wxYD"),s=n("1EDM");e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},"4uJK":(e,t,n)=>{var r=n("CbIe"),i=n("OtNC"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},p2lg:(e,t,n)=>{var r=n("tQYX"),i=n("CbIe"),o=n("/UTG"),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},"n+p3":e=>{e.exports=function(e,t){return e<t}},bFjY:(e,t,n)=>{var r=n("Q4oW"),i=n("9y2L");e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},"7/we":(e,t,n)=>{var r=n("ZjRn"),i=n("hMsr"),o=n("0Ss3");e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},"KAo/":(e,t,n)=>{var r=n("NYSw"),i=n("2srY"),o=n("NW/2"),a=n("i7nn"),s=n("+tCn"),l=n("0Ss3"),u=n("Ypsa");e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},MzY2:(e,t,n)=>{var r=n("HsnV"),i=n("amiU"),o=n("UdtX"),a=n("cb1R"),s=n("tQYX"),l=n("zH+d"),u=n("LL3N");e.exports=function e(t,n,c,d,f){t!==n&&o(n,(function(o,l){if(f||(f=new r),s(o))a(t,n,l,c,e,d,f);else{var p=d?d(u(t,l),o,l+"",t,n,f):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},cb1R:(e,t,n)=>{var r=n("amiU"),i=n("Grae"),o=n("6Rtw"),a=n("QT01"),s=n("sD1O"),l=n("bvyN"),u=n("wxYD"),c=n("Ndl3"),d=n("3ajY"),f=n("2q8g"),p=n("tQYX"),h=n("Kkar"),v=n("Qd2C"),g=n("LL3N"),y=n("4ScB");e.exports=function(e,t,n,m,b,x,w){var E=g(e,n),k=g(t,n),S=w.get(k);if(S)r(e,n,S);else{var P=x?x(E,k,n+"",e,t,w):void 0,_=void 0===P;if(_){var C=u(k),j=!C&&d(k),T=!C&&!j&&v(k);P=k,C||j||T?u(E)?P=E:c(E)?P=a(E):j?(_=!1,P=i(k,!0)):T?(_=!1,P=o(k,!0)):P=[]:h(k)||l(k)?(P=E,l(E)?P=y(E):p(E)&&!f(E)||(P=s(k))):_=!1}_&&(w.set(k,P),b(P,k,m,x,w),w.delete(k)),r(e,n,P)}}},eHpp:(e,t,n)=>{var r=n("H87J"),i=n("w2Tz"),o=n("S3pA"),a=n("bFjY"),s=n("4jPf"),l=n("SU8Q"),u=n("5WP5"),c=n("zWgn"),d=n("wxYD");e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var f=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},QwI6:(e,t,n)=>{var r=n("O1Sc"),i=n("NW/2");e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},O1Sc:(e,t,n)=>{var r=n("w2Tz"),i=n("y4bl"),o=n("xoyU");e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a<s;){var u=t[a],c=r(e,u);n(c,u)&&i(l,o(u,e),c)}return l}},EI7Z:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},CEyS:(e,t,n)=>{var r=n("w2Tz");e.exports=function(e){return function(t){return r(t,e)}}},"9au6":e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},"5q8j":e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},R3TX:(e,t,n)=>{var r=n("zWgn"),i=n("UAs9"),o=n("7Pat");e.exports=function(e,t){return o(i(e,t,r),e+"")}},y4bl:(e,t,n)=>{var r=n("c72w"),i=n("xoyU"),o=n("pnw1"),a=n("tQYX"),s=n("Ypsa");e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,f=e;null!=f&&++u<c;){var p=s(t[u]),h=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=d){var v=f[p];void 0===(h=l?l(v,p,f):void 0)&&(h=a(v)?v:o(t[u+1])?[]:{})}r(f,p,h),f=f[p]}return e}},"+7q0":(e,t,n)=>{var r=n("eN33"),i=n("Pz+s"),o=n("zWgn"),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},"4jPf":e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},"2ZvR":e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},JcJ6:(e,t,n)=>{var r=n("Syyo"),i=n("H87J"),o=n("wxYD"),a=n("a88S"),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},I1fX:(e,t,n)=>{var r=n("6XIJ"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},SU8Q:e=>{e.exports=function(e){return function(t){return e(t)}}},"s+R0":(e,t,n)=>{var r=n("JBn+"),i=n("OfKG"),o=n("sCL+"),a=n("S0iI"),s=n("9TP6"),l=n("XlL0");e.exports=function(e,t,n){var u=-1,c=i,d=e.length,f=!0,p=[],h=p;if(n)f=!1,c=o;else if(d>=200){var v=t?null:s(e);if(v)return l(v);f=!1,c=a,h=new r}else h=t?[]:p;e:for(;++u<d;){var g=e[u],y=t?t(g):g;if(g=n||0!==g?g:0,f&&y==y){for(var m=h.length;m--;)if(h[m]===y)continue e;t&&h.push(y),p.push(g)}else c(h,y,n)||(h!==p&&h.push(y),p.push(g))}return p}},SJvO:(e,t,n)=>{var r=n("H87J");e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},WvmI:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}},S0iI:e=>{e.exports=function(e,t){return e.has(t)}},D49j:(e,t,n)=>{var r=n("zWgn");e.exports=function(e){return"function"==typeof e?e:r}},xoyU:(e,t,n)=>{var r=n("wxYD"),i=n("i7nn"),o=n("SoOq"),a=n("dw5g");e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},EAGB:(e,t,n)=>{var r=n("mGzy");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},Grae:(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},lN3w:(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},Bstx:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},bVbG:(e,t,n)=>{var r=n("Syyo"),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},"6Rtw":(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},"dnX/":(e,t,n)=>{var r=n("a88S");e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e<t||c&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!u)return-1}return 0}},"5WP5":(e,t,n)=>{var r=n("dnX/");e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i<s;){var u=r(o[i],a[i]);if(u)return i>=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},QT01:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},LtXa:(e,t,n)=>{var r=n("c72w"),i=n("wC3K");e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=o?o(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),a?i(n,u,c):r(n,u,c)}return n}},AjPR:(e,t,n)=>{var r=n("LtXa"),i=n("70Le");e.exports=function(e,t){return r(e,i(e),t)}},BjSP:(e,t,n)=>{var r=n("LtXa"),i=n("Xidw");e.exports=function(e,t){return r(e,i(e),t)}},"3KBa":(e,t,n)=>{var r=n("IBsm")["__core-js_shared__"];e.exports=r},wpQC:(e,t,n)=>{var r=n("R3TX"),i=n("R5u7");e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}},bz5b:(e,t,n)=>{var r=n("9y2L");e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},RFxK:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},"1aYn":(e,t,n)=>{var r=n("S3pA"),i=n("9y2L"),o=n("BlJA");e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},"2M3I":(e,t,n)=>{var r=n("9au6"),i=n("R5u7"),o=n("fWyh");e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},"9TP6":(e,t,n)=>{var r=n("OBn4"),i=n("nnm9"),o=n("XlL0"),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},"Pz+s":(e,t,n)=>{var r=n("vxC8"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},"ZZ+W":(e,t,n)=>{var r=n("JBn+"),i=n("myUI"),o=n("S0iI");e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var h=-1,v=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++h<c;){var y=e[h],m=t[h];if(a)var b=u?a(m,y,h,t,e,l):a(y,m,h,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(y===e||s(y,e,n,a,l)))return g.push(t)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},R3gn:(e,t,n)=>{var r=n("Syyo"),i=n("mGzy"),o=n("pPzx"),a=n("ZZ+W"),s=n("aURW"),l=n("XlL0"),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&r;if(p||(p=l),e.size!=t.size&&!h)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var g=a(p(e),p(t),r,u,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},yZHP:(e,t,n)=>{var r=n("tlBq"),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:i.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<c;){var y=e[f=u[d]],m=t[f];if(o)var b=l?o(m,y,f,t,e,s):o(y,m,f,e,t,s);if(!(void 0===b?y===m||a(y,m,n,o,s):b)){v=!1;break}g||(g="constructor"==f)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},cH1A:(e,t,n)=>{var r=n("1xil"),i=n("UAs9"),o=n("7Pat");e.exports=function(e){return o(i(e,void 0,r),e+"")}},e93E:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},tlBq:(e,t,n)=>{var r=n("pIod"),i=n("70Le"),o=n("BlJA");e.exports=function(e){return r(e,o,i)}},zF5n:(e,t,n)=>{var r=n("pIod"),i=n("Xidw"),o=n("zH+d");e.exports=function(e){return r(e,o,i)}},JNqh:(e,t,n)=>{var r=n("6UKJ");e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},hMsr:(e,t,n)=>{var r=n("+tCn"),i=n("BlJA");e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},vxC8:(e,t,n)=>{var r=n("5nKN"),i=n("4p/L");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},"/wCD":(e,t,n)=>{var r=n("TAtK")(Object.getPrototypeOf,Object);e.exports=r},KCLV:(e,t,n)=>{var r=n("Syyo"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(l){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},"70Le":(e,t,n)=>{var r=n("W0vE"),i=n("X4R2"),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},Xidw:(e,t,n)=>{var r=n("y/9h"),i=n("/wCD"),o=n("70Le"),a=n("X4R2"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},"kkM+":(e,t,n)=>{var r=n("QF3D"),i=n("qeCs"),o=n("IS0S"),a=n("OBn4"),s=n("4+Vk"),l=n("Dhk8"),u=n("c18h"),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",v=u(r),g=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=h||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=f||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case v:return h;case g:return c;case y:return d;case m:return f;case b:return p}return t}),e.exports=x},"4p/L":e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},"z+TE":(e,t,n)=>{var r=n("xoyU"),i=n("bvyN"),o=n("wxYD"),a=n("pnw1"),s=n("t0L4"),l=n("Ypsa");e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u<c;){var f=l(t[u]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&s(c)&&a(f,c)&&(o(e)||i(e))}},GZgP:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},"2Fbm":(e,t,n)=>{var r=n("5pfJ");e.exports=function(){this.__data__=r?r(null):{},this.size=0}},VPai:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},"+fUG":(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},QMz8:(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},mUsV:(e,t,n)=>{var r=n("5pfJ");e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},"3Qlq":e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},"7No3":(e,t,n)=>{var r=n("EAGB"),i=n("lN3w"),o=n("Bstx"),a=n("bVbG"),s=n("6Rtw");e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},sD1O:(e,t,n)=>{var r=n("vGGS"),i=n("/wCD"),o=n("CbIe");e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},oCTG:(e,t,n)=>{var r=n("Syyo"),i=n("bvyN"),o=n("wxYD"),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},pnw1:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},R5u7:(e,t,n)=>{var r=n("pPzx"),i=n("9y2L"),o=n("pnw1"),a=n("tQYX");e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},i7nn:(e,t,n)=>{var r=n("wxYD"),i=n("a88S"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},"6UKJ":e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},"9vbJ":(e,t,n)=>{var r,i=n("3KBa"),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},CbIe:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},"+tCn":(e,t,n)=>{var r=n("tQYX");e.exports=function(e){return e==e&&!r(e)}},"8Zrg":e=>{e.exports=function(){this.__data__=[],this.size=0}},kwr2:(e,t,n)=>{var r=n("6QIk"),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},"5VYK":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},"Coc+":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){return r(this.__data__,e)>-1}},LzM7:(e,t,n)=>{var r=n("6QIk");e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},m5o6:(e,t,n)=>{var r=n("Tv3l"),i=n("+ooz"),o=n("qeCs");e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},d0UJ:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},eask:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).get(e)}},"9SKQ":(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).has(e)}},e63W:(e,t,n)=>{var r=n("JNqh");e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},aURW:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},"0Ss3":e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},"0+aC":(e,t,n)=>{var r=n("pFSi");e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},"5pfJ":(e,t,n)=>{var r=n("vxC8")(Object,"create");e.exports=r},OtNC:(e,t,n)=>{var r=n("TAtK")(Object.keys,Object);e.exports=r},"/UTG":e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},T6vp:(e,t,n)=>{e=n.nmd(e);var r=n("e93E"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},kHoZ:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},TAtK:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},UAs9:(e,t,n)=>{var r=n("zaNA"),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=o[a];return u[t]=n(l),r(e,this,u)}}},IBsm:(e,t,n)=>{var r=n("e93E"),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},LL3N:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},qjF7:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},cEmw:e=>{e.exports=function(e){return this.__data__.has(e)}},XlL0:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},"7Pat":(e,t,n)=>{var r=n("+7q0"),i=n("kG2z")(r);e.exports=i},kG2z:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},RNlM:(e,t,n)=>{var r=n("+ooz");e.exports=function(){this.__data__=new r,this.size=0}},E4ao:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},BSqe:e=>{e.exports=function(e){return this.__data__.get(e)}},L6um:e=>{e.exports=function(e){return this.__data__.has(e)}},"4/ik":(e,t,n)=>{var r=n("+ooz"),i=n("qeCs"),o=n("hyzI");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},n1QJ:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},GVul:(e,t,n)=>{var r=n("2wsP"),i=n("GZgP"),o=n("QZ90");e.exports=function(e){return i(e)?o(e):r(e)}},SoOq:(e,t,n)=>{var r=n("0+aC"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},Ypsa:(e,t,n)=>{var r=n("a88S");e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},c18h:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},"6XIJ":e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},QZ90:e=>{var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")"+"?",l="[\\ufe0e\\ufe0f]?",u=l+s+("(?:\\u200d(?:"+[i,o,a].join("|")+")"+l+s+")*"),c="(?:"+[i+n+"?",n,o,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+c+u,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},zr3P:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,4)}},c2re:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,5)}},eN33:e=>{e.exports=function(e){return function(){return e}}},WHWN:(e,t,n)=>{var r=n("R3TX"),i=n("pPzx"),o=n("R5u7"),a=n("zH+d"),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n<r;)for(var c=t[n],d=a(c),f=-1,p=d.length;++f<p;){var h=d[f],v=e[h];(void 0===v||i(v,s[h])&&!l.call(e,h))&&(e[h]=c[h])}return e}));e.exports=u},h4um:(e,t,n)=>{e.exports=n("9SCj")},pPzx:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},"+DnP":(e,t,n)=>{var r=n("W0vE"),i=n("sjzV"),o=n("S3pA"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},"6R5o":(e,t,n)=>{var r=n("1aYn")(n("FllU"));e.exports=r},FllU:(e,t,n)=>{var r=n("DuXo"),i=n("S3pA"),o=n("m2YG"),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},"1xil":(e,t,n)=>{var r=n("YpBQ");e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},"9SCj":(e,t,n)=>{var r=n("LmOH"),i=n("Q4oW"),o=n("D49j"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},ZVKf:(e,t,n)=>{var r=n("UdtX"),i=n("D49j"),o=n("zH+d");e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},"2srY":(e,t,n)=>{var r=n("w2Tz");e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},"1mr4":(e,t,n)=>{var r=n("SJov"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"NW/2":(e,t,n)=>{var r=n("JYmt"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},zWgn:e=>{e.exports=function(e){return e}},bvyN:(e,t,n)=>{var r=n("/30y"),i=n("tLQN"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},wxYD:e=>{var t=Array.isArray;e.exports=t},"9y2L":(e,t,n)=>{var r=n("2q8g"),i=n("t0L4");e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},Ndl3:(e,t,n)=>{var r=n("9y2L"),i=n("tLQN");e.exports=function(e){return i(e)&&r(e)}},"3ajY":(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=n("DjCF"),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},MwrP:(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("bvyN"),a=n("wxYD"),s=n("9y2L"),l=n("3ajY"),u=n("CbIe"),c=n("Qd2C"),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},"2q8g":(e,t,n)=>{var r=n("Dhk8"),i=n("tQYX");e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},t0L4:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},NbvU:(e,t,n)=>{var r=n("gEWz"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isMap,s=a?i(a):r;e.exports=s},tQYX:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},tLQN:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},Kkar:(e,t,n)=>{var r=n("Dhk8"),i=n("/wCD"),o=n("tLQN"),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},"/iLo":(e,t,n)=>{var r=n("6I2w"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isSet,s=a?i(a):r;e.exports=s},nDih:(e,t,n)=>{var r=n("Dhk8"),i=n("wxYD"),o=n("tLQN");e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},a88S:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},Qd2C:(e,t,n)=>{var r=n("7/jS"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},CZlo:e=>{e.exports=function(e){return void 0===e}},BlJA:(e,t,n)=>{var r=n("rmhs"),i=n("4uJK"),o=n("9y2L");e.exports=function(e){return o(e)?r(e):i(e)}},"zH+d":(e,t,n)=>{var r=n("rmhs"),i=n("p2lg"),o=n("9y2L");e.exports=function(e){return o(e)?r(e,!0):i(e)}},"p1C/":e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},mbB6:(e,t,n)=>{var r=n("H87J"),i=n("S3pA"),o=n("bFjY"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},y2Ah:(e,t,n)=>{var r=n("wC3K"),i=n("zKkv"),o=n("S3pA");e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},"LPC+":(e,t,n)=>{var r=n("JElN"),i=n("FaiA"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},pFSi:(e,t,n)=>{var r=n("hyzI");function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},H8sf:(e,t,n)=>{var r=n("MzY2"),i=n("wpQC")((function(e,t,n){r(e,t,n)}));e.exports=i},Z3AG:(e,t,n)=>{var r=n("JElN"),i=n("n+p3"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},PKEM:(e,t,n)=>{var r=n("JElN"),i=n("S3pA"),o=n("n+p3");e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},nnm9:e=>{e.exports=function(){}},ENE1:(e,t,n)=>{var r=n("IBsm");e.exports=function(){return r.Date.now()}},"//nZ":(e,t,n)=>{var r=n("QwI6"),i=n("cH1A")((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},"1EDM":(e,t,n)=>{var r=n("EI7Z"),i=n("CEyS"),o=n("i7nn"),a=n("Ypsa");e.exports=function(e){return o(e)?r(a(e)):i(e)}},Cmkl:(e,t,n)=>{var r=n("2M3I")();e.exports=r},veKZ:(e,t,n)=>{var r=n("cPMt"),i=n("Q4oW"),o=n("S3pA"),a=n("5q8j"),s=n("wxYD");e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},"7seP":(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("9y2L"),a=n("nDih"),s=n("GVul");e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},u6DZ:(e,t,n)=>{var r=n("YpBQ"),i=n("eHpp"),o=n("R3TX"),a=n("R5u7"),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},X4R2:e=>{e.exports=function(){return[]}},DjCF:e=>{e.exports=function(){return!1}},fWyh:(e,t,n)=>{var r=n("nvU9"),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},m2YG:(e,t,n)=>{var r=n("fWyh");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},nvU9:(e,t,n)=>{var r=n("I1fX"),i=n("tQYX"),o=n("a88S"),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},"4ScB":(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e){return r(e,i(e))}},dw5g:(e,t,n)=>{var r=n("JcJ6");e.exports=function(e){return null==e?"":r(e)}},"cZX/":(e,t,n)=>{var r=n("LmOH"),i=n("vGGS"),o=n("zKkv"),a=n("S3pA"),s=n("/wCD"),l=n("wxYD"),u=n("3ajY"),c=n("2q8g"),d=n("tQYX"),f=n("Qd2C");e.exports=function(e,t,n){var p=l(e),h=p||u(e)||f(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=h?p?new v:[]:d(e)&&c(v)?i(s(e)):{}}return(h?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},aGtI:(e,t,n)=>{var r=n("YpBQ"),i=n("R3TX"),o=n("s+R0"),a=n("Ndl3"),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},w0mW:(e,t,n)=>{var r=n("dw5g"),i=0;e.exports=function(e){var t=++i;return r(e)+t}},"0iyY":(e,t,n)=>{var r=n("SJvO"),i=n("BlJA");e.exports=function(e){return null==e?[]:r(e,i(e))}},OUo6:(e,t,n)=>{var r=n("c72w"),i=n("WvmI");e.exports=function(e,t){return i(e||[],t||[],r)}},maj8:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),u=1;u<arguments.length;u++){for(var c in a=Object(arguments[u]))n.call(a,c)&&(l[c]=a[c]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(l[s[d]]=a[s[d]])}}return l}},"w/UT":(e,t,n)=>{"use strict";var r=n("ERkP"),i=n("maj8"),o=n("jiMj");function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,l={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},v={};function g(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function x(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(v,e)||!p.call(h,e)&&(f.test(e)?v[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=60103,k=60106,S=60107,P=60108,_=60114,C=60109,j=60110,T=60112,D=60113,O=60120,N=60115,M=60116,L=60121,A=60128,I=60129,B=60130,z=60131;if("function"==typeof Symbol&&Symbol.for){var R=Symbol.for;E=R("react.element"),k=R("react.portal"),S=R("react.fragment"),P=R("react.strict_mode"),_=R("react.profiler"),C=R("react.provider"),j=R("react.context"),T=R("react.forward_ref"),D=R("react.suspense"),O=R("react.suspense_list"),N=R("react.memo"),M=R("react.lazy"),L=R("react.block"),R("react.scope"),A=R("react.opaque.id"),I=R("react.debug_trace_mode"),B=R("react.offscreen"),z=R("react.legacy_hidden")}var F,V="function"==typeof Symbol&&Symbol.iterator;function G(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=V&&e[V]||e["@@iterator"])?e:null}function U(e){if(void 0===F)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var W=!1;function q(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"==typeof l.stack){for(var i=l.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?U(e):""}function H(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1);case 11:return e=q(e.type.render,!1);case 22:return e=q(e.type._render,!1);case 1:return e=q(e.type,!0);default:return""}}function Y(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case k:return"Portal";case _:return"Profiler";case P:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case N:return Y(e.type);case L:return Y(e._render);case M:t=e._payload,e=e._init;try{return Y(e(t))}catch(n){}}return null}function X(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function K(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Q(e){e._valueTracker||(e._valueTracker=function(e){var t=K(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function $(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=K(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Z(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=X(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=X(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,X(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&Z(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+X(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:X(n)}}function ue(e,t){var n=X(t.value),r=X(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ve,ge,ye=(ge=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((ve=ve||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ve.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function me(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xe=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function Ee(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){xe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var ke=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Se(e,t){if(t){if(ke[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function Pe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ce=null,je=null,Te=null;function De(e){if(e=ri(e)){if("function"!=typeof Ce)throw Error(a(280));var t=e.stateNode;t&&(t=oi(t),Ce(e.stateNode,e.type,t))}}function Oe(e){je?Te?Te.push(e):Te=[e]:je=e}function Ne(){if(je){var e=je,t=Te;if(Te=je=null,De(e),t)for(e=0;e<t.length;e++)De(t[e])}}function Me(e,t){return e(t)}function Le(e,t,n,r,i){return e(t,n,r,i)}function Ae(){}var Ie=Me,Be=!1,ze=!1;function Re(){null===je&&null===Te||(Ae(),Ne())}function Fe(e,t){var n=e.stateNode;if(null===n)return null;var r=oi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var Ve=!1;if(d)try{var Ge={};Object.defineProperty(Ge,"passive",{get:function(){Ve=!0}}),window.addEventListener("test",Ge,Ge),window.removeEventListener("test",Ge,Ge)}catch(ge){Ve=!1}function Ue(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var We=!1,qe=null,He=!1,Ye=null,Xe={onError:function(e){We=!0,qe=e}};function Ke(e,t,n,r,i,o,a,s,l){We=!1,qe=null,Ue.apply(Xe,arguments)}function Qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function $e(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ze(e){if(Qe(e)!==e)throw Error(a(188))}function Je(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Qe(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ze(i),e;if(o===r)return Ze(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,it,ot=!1,at=[],st=null,lt=null,ut=null,ct=new Map,dt=new Map,ft=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function vt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":ut=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function gt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e=ht(t,n,r,i,o),null!==t&&(null!==(t=ri(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function yt(e){var t=ni(e.target);if(null!==t){var n=Qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=$e(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function mt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ri(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){mt(e)&&n.delete(t)}function xt(){for(ot=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ri(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&mt(st)&&(st=null),null!==lt&&mt(lt)&&(lt=null),null!==ut&&mt(ut)&&(ut=null),ct.forEach(bt),dt.forEach(bt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,xt)))}function Et(e){function t(t){return wt(t,e)}if(0<at.length){wt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&wt(st,e),null!==lt&&wt(lt,e),null!==ut&&wt(ut,e),ct.forEach(t),dt.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)yt(n),null===n.blockedOn&&ft.shift()}function kt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var St={animationend:kt("Animation","AnimationEnd"),animationiteration:kt("Animation","AnimationIteration"),animationstart:kt("Animation","AnimationStart"),transitionend:kt("Transition","TransitionEnd")},Pt={},_t={};function Ct(e){if(Pt[e])return Pt[e];if(!St[e])return e;var t,n=St[e];for(t in n)if(n.hasOwnProperty(t)&&t in _t)return Pt[e]=n[t];return e}d&&(_t=document.createElement("div").style,"AnimationEvent"in window||(delete St.animationend.animation,delete St.animationiteration.animation,delete St.animationstart.animation),"TransitionEvent"in window||delete St.transitionend.transition);var jt=Ct("animationend"),Tt=Ct("animationiteration"),Dt=Ct("animationstart"),Ot=Ct("transitionend"),Nt=new Map,Mt=new Map,Lt=["abort","abort",jt,"animationEnd",Tt,"animationIteration",Dt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ot,"transitionEnd","waiting","waiting"];function At(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Mt.set(r,t),Nt.set(r,i),u(i,[r])}}(0,o.unstable_now)();var It=8;function Bt(e){if(0!=(1&e))return It=15,1;if(0!=(2&e))return It=14,2;if(0!=(4&e))return It=13,4;var t=24&e;return 0!==t?(It=12,t):0!=(32&e)?(It=11,32):0!==(t=192&e)?(It=10,t):0!=(256&e)?(It=9,256):0!==(t=3584&e)?(It=8,t):0!=(4096&e)?(It=7,4096):0!==(t=4186112&e)?(It=6,t):0!==(t=62914560&e)?(It=5,t):67108864&e?(It=4,67108864):0!=(134217728&e)?(It=3,134217728):0!==(t=805306368&e)?(It=2,t):0!=(1073741824&e)?(It=1,1073741824):(It=8,e)}function zt(e,t){var n=e.pendingLanes;if(0===n)return It=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=It=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=Bt(l),i=It):0!==(s&=o)&&(r=Bt(s),i=It)}else 0!==(o=n&~a)?(r=Bt(o),i=It):0!==s&&(r=Bt(s),i=It);if(0===r)return 0;if(r=n&((0>(r=31-Wt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(Bt(t),i<=It)return t;It=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Wt(t)),r|=e[n],t&=~i;return r}function Rt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Ft(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Vt(24&~t))?Ft(10,t):e;case 10:return 0===(e=Vt(192&~t))?Ft(8,t):e;case 8:return 0===(e=Vt(3584&~t))&&(0===(e=Vt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Vt(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Vt(e){return e&-e}function Gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ut(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Wt(t)]=n}var Wt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(qt(e)/Ht|0)|0},qt=Math.log,Ht=Math.LN2;var Yt=o.unstable_UserBlockingPriority,Xt=o.unstable_runWithPriority,Kt=!0;function Qt(e,t,n,r){Be||Ae();var i=Zt,o=Be;Be=!0;try{Le(i,e,t,n,r)}finally{(Be=o)||Re()}}function $t(e,t,n,r){Xt(Yt,Zt.bind(null,e,t,n,r))}function Zt(e,t,n,r){var i;if(Kt)if((i=0==(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var o=Jt(e,t,n,r);if(null===o)i&&vt(e,r);else{if(i){if(-1<pt.indexOf(e))return e=ht(o,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return st=gt(st,e,t,n,r,i),!0;case"dragenter":return lt=gt(lt,e,t,n,r,i),!0;case"mouseover":return ut=gt(ut,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return ct.set(o,gt(ct.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,dt.set(o,gt(dt.get(o)||null,e,t,n,r,i)),!0}return!1}(o,e,t,n,r))return;vt(e,r)}Ar(e,t,r,null,n)}}}function Jt(e,t,n,r){var i=_e(r);if(null!==(i=ni(i))){var o=Qe(i);if(null===o)i=null;else{var a=o.tag;if(13===a){if(null!==(i=$e(o)))return i;i=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Ar(e,t,r,i,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,i="value"in en?en.value:en.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return nn=i.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function ln(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:sn,this.isPropagationStopped=sn,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var un,cn,dn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=ln(fn),hn=i({},fn,{view:0,detail:0}),vn=ln(hn),gn=i({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dn&&(dn&&"mousemove"===e.type?(un=e.screenX-dn.screenX,cn=e.screenY-dn.screenY):cn=un=0,dn=e),un)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),yn=ln(gn),mn=ln(i({},gn,{dataTransfer:0})),bn=ln(i({},hn,{relatedTarget:0})),xn=ln(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=i({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),En=ln(wn),kn=ln(i({},fn,{data:0})),Sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function jn(){return Cn}var Tn=i({},hn,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Pn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Dn=ln(Tn),On=ln(i({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=ln(i({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Mn=ln(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=i({},gn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),An=ln(Ln),In=[9,13,27,32],Bn=d&&"CompositionEvent"in window,zn=null;d&&"documentMode"in document&&(zn=document.documentMode);var Rn=d&&"TextEvent"in window&&!zn,Fn=d&&(!Bn||zn&&8<zn&&11>=zn),Vn=String.fromCharCode(32),Gn=!1;function Un(e,t){switch(e){case"keyup":return-1!==In.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var qn=!1;var Hn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hn[e.type]:"textarea"===t}function Xn(e,t,n,r){Oe(r),0<(t=Br(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Qn=null;function $n(e){Tr(e,0)}function Zn(e){if($(ii(e)))return e}function Jn(e,t){if("change"===e)return t}var er=!1;if(d){var tr;if(d){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"==typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Kn&&(Kn.detachEvent("onpropertychange",or),Qn=Kn=null)}function or(e){if("value"===e.propertyName&&Zn(Qn)){var t=[];if(Xn(t,Qn,e,_e(e)),e=$n,Be)e(t);else{Be=!0;try{Me(e,t)}finally{Be=!1,Re()}}}}function ar(e,t,n){"focusin"===e?(ir(),Qn=n,(Kn=t).attachEvent("onpropertychange",or)):"focusout"===e&&ir()}function sr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Zn(Qn)}function lr(e,t){if("click"===e)return Zn(t)}function ur(e,t){if("input"===e||"change"===e)return Zn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},dr=Object.prototype.hasOwnProperty;function fr(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!dr.call(t,n[r])||!cr(e[n[r]],t[n[r]]))return!1;return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=pr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pr(r)}}function vr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?vr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){for(var e=window,t=Z();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Z((e=t.contentWindow).document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var mr=d&&"documentMode"in document&&11>=document.documentMode,br=null,xr=null,wr=null,Er=!1;function kr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Er||null==br||br!==Z(r)||("selectionStart"in(r=br)&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&fr(wr,r)||(wr=r,0<(r=Br(xr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}At("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),At("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),At(Lt,2);for(var Sr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Pr=0;Pr<Sr.length;Pr++)Mt.set(Sr[Pr],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _r="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cr=new Set("cancel close invalid load scroll toggle".split(" ").concat(_r));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,u){if(Ke.apply(this,arguments),We){if(!We)throw Error(a(198));var c=qe;We=!1,qe=null,He||(He=!0,Ye=c)}}(r,t,void 0,e),e.currentTarget=null}function Tr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;jr(i,s,u),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;jr(i,s,u),o=l}}}if(He)throw e=Ye,He=!1,Ye=null,e}function Dr(e,t){var n=ai(t),r=e+"__bubble";n.has(r)||(Lr(t,e,2,!1),n.add(r))}var Or="_reactListening"+Math.random().toString(36).slice(2);function Nr(e){e[Or]||(e[Or]=!0,s.forEach((function(t){Cr.has(t)||Mr(t,!1,e,null),Mr(t,!0,e,null)})))}function Mr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&Cr.has(e)){if("scroll"!==e)return;i|=2,o=r}var a=ai(o),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(i|=4),Lr(o,e,i,t),a.add(s))}function Lr(e,t,n,r){var i=Mt.get(t);switch(void 0===i?2:i){case 0:i=Qt;break;case 1:i=$t;break;default:i=Zt}n=i.bind(null,t,n,e),i=void 0,!Ve||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ar(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=ni(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(ze)return e(t,n);ze=!0;try{Ie(e,t,n)}finally{ze=!1,Re()}}((function(){var r=o,i=_e(n),a=[];e:{var s=Nt.get(e);if(void 0!==s){var l=pn,u=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":l=Dn;break;case"focusin":u="focus",l=bn;break;case"focusout":u="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=yn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Nn;break;case jt:case Tt:case Dt:l=xn;break;case Ot:l=Mn;break;case"scroll":l=vn;break;case"wheel":l=An;break;case"copy":case"cut":case"paste":l=En;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=On}var c=0!=(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var v=(p=h).stateNode;if(5===p.tag&&null!==v&&(p=v,null!==f&&(null!=(v=Fe(h,f))&&c.push(Ir(h,v,p)))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,i),a.push({event:s,listeners:c}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(u=n.relatedTarget||n.fromElement)||!ni(u)&&!u[ei])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?ni(u):null)&&(u!==(d=Qe(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=yn,v="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=On,v="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==l?s:ii(l),p=null==u?s:ii(u),(s=new c(v,h+"leave",l,n,i)).target=d,s.relatedTarget=p,v=null,ni(i)===r&&((c=new c(f,h+"enter",u,n,i)).target=p,c.relatedTarget=d,v=c),d=v,l&&u)e:{for(f=u,h=0,p=c=l;p;p=zr(p))h++;for(p=0,v=f;v;v=zr(v))p++;for(;0<h-p;)c=zr(c),h--;for(;0<p-h;)f=zr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=zr(c),f=zr(f)}c=null}else c=null;null!==l&&Rr(a,s,l,c,!1),null!==u&&null!==d&&Rr(a,d,u,c,!0)}if("select"===(l=(s=r?ii(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Jn;else if(Yn(s))if(er)g=ur;else{g=sr;var y=ar}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=lr);switch(g&&(g=g(e,r))?Xn(a,g,n,i):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&ie(s,"number",s.value)),y=r?ii(r):window,e){case"focusin":(Yn(y)||"true"===y.contentEditable)&&(br=y,xr=r,wr=null);break;case"focusout":wr=xr=br=null;break;case"mousedown":Er=!0;break;case"contextmenu":case"mouseup":case"dragend":Er=!1,kr(a,n,i);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":kr(a,n,i)}var m;if(Bn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else qn?Un(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Fn&&"ko"!==n.locale&&(qn||"onCompositionStart"!==b?"onCompositionEnd"===b&&qn&&(m=rn()):(tn="value"in(en=i)?en.value:en.textContent,qn=!0)),0<(y=Br(r,b)).length&&(b=new kn(b,e,null,n,i),a.push({event:b,listeners:y}),m?b.data=m:null!==(m=Wn(n))&&(b.data=m))),(m=Rn?function(e,t){switch(e){case"compositionend":return Wn(t);case"keypress":return 32!==t.which?null:(Gn=!0,Vn);case"textInput":return(e=t.data)===Vn&&Gn?null:e;default:return null}}(e,n):function(e,t){if(qn)return"compositionend"===e||!Bn&&Un(e,t)?(e=rn(),nn=tn=en=null,qn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Br(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=m))}Tr(a,t)}))}function Ir(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Br(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Fe(e,n))&&r.unshift(Ir(e,o,i)),null!=(o=Fe(e,t))&&r.push(Ir(e,o,i))),e=e.return}return r}function zr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Rr(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=Fe(n,o))&&a.unshift(Ir(n,l,s)):i||null!=(l=Fe(n,o))&&a.push(Ir(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Fr(){}var Vr=null,Gr=null;function Ur(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Wr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var qr="function"==typeof setTimeout?setTimeout:void 0,Hr="function"==typeof clearTimeout?clearTimeout:void 0;function Yr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Xr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Kr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Qr=0;var $r=Math.random().toString(36).slice(2),Zr="__reactFiber$"+$r,Jr="__reactProps$"+$r,ei="__reactContainer$"+$r,ti="__reactEvents$"+$r;function ni(e){var t=e[Zr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ei]||n[Zr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Kr(e);null!==e;){if(n=e[Zr])return n;e=Kr(e)}return t}n=(e=n).parentNode}return null}function ri(e){return!(e=e[Zr]||e[ei])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ii(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function oi(e){return e[Jr]||null}function ai(e){var t=e[ti];return void 0===t&&(t=e[ti]=new Set),t}var si=[],li=-1;function ui(e){return{current:e}}function ci(e){0>li||(e.current=si[li],si[li]=null,li--)}function di(e,t){li++,si[li]=e.current,e.current=t}var fi={},pi=ui(fi),hi=ui(!1),vi=fi;function gi(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function yi(e){return null!=(e=e.childContextTypes)}function mi(){ci(hi),ci(pi)}function bi(e,t,n){if(pi.current!==fi)throw Error(a(168));di(pi,t),di(hi,n)}function xi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,Y(t)||"Unknown",o));return i({},n,r)}function wi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,vi=pi.current,di(pi,e),di(hi,hi.current),!0}function Ei(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=xi(e,t,vi),r.__reactInternalMemoizedMergedChildContext=e,ci(hi),ci(pi),di(pi,e)):ci(hi),di(hi,n)}var ki=null,Si=null,Pi=o.unstable_runWithPriority,_i=o.unstable_scheduleCallback,Ci=o.unstable_cancelCallback,ji=o.unstable_shouldYield,Ti=o.unstable_requestPaint,Di=o.unstable_now,Oi=o.unstable_getCurrentPriorityLevel,Ni=o.unstable_ImmediatePriority,Mi=o.unstable_UserBlockingPriority,Li=o.unstable_NormalPriority,Ai=o.unstable_LowPriority,Ii=o.unstable_IdlePriority,Bi={},zi=void 0!==Ti?Ti:function(){},Ri=null,Fi=null,Vi=!1,Gi=Di(),Ui=1e4>Gi?Di:function(){return Di()-Gi};function Wi(){switch(Oi()){case Ni:return 99;case Mi:return 98;case Li:return 97;case Ai:return 96;case Ii:return 95;default:throw Error(a(332))}}function qi(e){switch(e){case 99:return Ni;case 98:return Mi;case 97:return Li;case 96:return Ai;case 95:return Ii;default:throw Error(a(332))}}function Hi(e,t){return e=qi(e),Pi(e,t)}function Yi(e,t,n){return e=qi(e),_i(e,t,n)}function Xi(){if(null!==Fi){var e=Fi;Fi=null,Ci(e)}Ki()}function Ki(){if(!Vi&&null!==Ri){Vi=!0;var e=0;try{var t=Ri;Hi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ri=null}catch(n){throw null!==Ri&&(Ri=Ri.slice(e+1)),_i(Ni,Xi),n}finally{Vi=!1}}}var Qi=w.ReactCurrentBatchConfig;function $i(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Zi=ui(null),Ji=null,eo=null,to=null;function no(){to=eo=Ji=null}function ro(e){var t=Zi.current;ci(Zi),e.type._context._currentValue=t}function io(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function oo(e,t){Ji=e,to=eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Ba=!0),e.firstContext=null)}function ao(e,t){if(to!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(to=e,t=1073741823),t={context:e,observedBits:t,next:null},null===eo){if(null===Ji)throw Error(a(308));eo=t,Ji.dependencies={lanes:0,firstContext:t,responders:null}}else eo=eo.next=t;return e._currentValue}var so=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function uo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ho(e,t,n,r){var o=e.updateQueue;so=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?a=c:s.next=c,s=u;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==s&&(null===f?d.firstBaseUpdate=c:f.next=c,d.lastBaseUpdate=u)}}if(null!==a){for(f=o.baseState,s=0,d=c=u=null;;){l=a.lane;var p=a.eventTime;if((r&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,v=a;switch(l=t,p=n,v.tag){case 1:if("function"==typeof(h=v.payload)){f=h.call(p,f,l);break e}f=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(l="function"==typeof(h=v.payload)?h.call(p,f,l):h))break e;f=i({},f,l);break e;case 2:so=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else p={eventTime:p,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(c=d=p,u=f):d=d.next=p,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===d&&(u=f),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=d,Vs|=s,e.lanes=s,e.memoizedState=f}}function vo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(a(191,i));i.call(r)}}}var go=(new r.Component).refs;function yo(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var mo={isMounted:function(e){return!!(e=e._reactInternals)&&Qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fl(),i=pl(e),o=co(r,i);o.payload=t,null!=n&&(o.callback=n),fo(e,o),hl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fl(),i=pl(e),o=co(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),fo(e,o),hl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fl(),r=pl(e),i=co(n,r);i.tag=2,null!=t&&(i.callback=t),fo(e,i),hl(e,r,n)}};function bo(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!fr(n,r)||!fr(i,o))}function xo(e,t,n){var r=!1,i=fi,o=t.contextType;return"object"==typeof o&&null!==o?o=ao(o):(i=yi(t)?vi:pi.current,o=(r=null!=(r=t.contextTypes))?gi(e,i):fi),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=mo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function wo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mo.enqueueReplaceState(t,t.state,null)}function Eo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=go,lo(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=ao(o):(o=yi(t)?vi:pi.current,i.context=gi(e,o)),ho(e,n,i,r),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(yo(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&mo.enqueueReplaceState(i,i.state,null),ho(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var ko=Array.isArray;function So(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===go&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Po(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function _o(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Hl(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ql(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=So(e,t,n),r.return=e,r):((r=Yl(n.type,n.key,n.props,null,e.mode,r)).ref=So(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=$l(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Xl(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ql(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case E:return(n=Yl(t.type,t.key,t.props,null,e.mode,n)).ref=So(e,null,t),n.return=e,n;case k:return(t=$l(t,e.mode,n)).return=e,t}if(ko(t)||G(t))return(t=Xl(t,e.mode,n,null)).return=e,t;Po(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case E:return n.key===i?n.type===S?d(e,t,n.props.children,r,i):u(e,t,n,r):null;case k:return n.key===i?c(e,t,n,r):null}if(ko(n)||G(n))return null!==i?null:d(e,t,n,r,null);Po(e,n)}return null}function h(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case E:return e=e.get(null===r.key?n:r.key)||null,r.type===S?d(t,e,r.props.children,i,r.key):u(t,e,r,i);case k:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(ko(r)||G(r))return d(t,e=e.get(n)||null,r,i,null);Po(t,r)}return null}function v(i,a,s,l){for(var u=null,c=null,d=a,v=a=0,g=null;null!==d&&v<s.length;v++){d.index>v?(g=d,d=null):g=d.sibling;var y=p(i,d,s[v],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(i,d),a=o(y,a,v),null===c?u=y:c.sibling=y,c=y,d=g}if(v===s.length)return n(i,d),u;if(null===d){for(;v<s.length;v++)null!==(d=f(i,s[v],l))&&(a=o(d,a,v),null===c?u=d:c.sibling=d,c=d);return u}for(d=r(i,d);v<s.length;v++)null!==(g=h(d,i,v,s[v],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?v:g.key),a=o(g,a,v),null===c?u=g:c.sibling=g,c=g);return e&&d.forEach((function(e){return t(i,e)})),u}function g(i,s,l,u){var c=G(l);if("function"!=typeof c)throw Error(a(150));if(null==(l=c.call(l)))throw Error(a(151));for(var d=c=null,v=s,g=s=0,y=null,m=l.next();null!==v&&!m.done;g++,m=l.next()){v.index>g?(y=v,v=null):y=v.sibling;var b=p(i,v,m.value,u);if(null===b){null===v&&(v=y);break}e&&v&&null===b.alternate&&t(i,v),s=o(b,s,g),null===d?c=b:d.sibling=b,d=b,v=y}if(m.done)return n(i,v),c;if(null===v){for(;!m.done;g++,m=l.next())null!==(m=f(i,m.value,u))&&(s=o(m,s,g),null===d?c=m:d.sibling=m,d=m);return c}for(v=r(i,v);!m.done;g++,m=l.next())null!==(m=h(v,i,g,m.value,u))&&(e&&null!==m.alternate&&v.delete(null===m.key?g:m.key),s=o(m,s,g),null===d?c=m:d.sibling=m,d=m);return e&&v.forEach((function(e){return t(i,e)})),c}return function(e,r,o,l){var u="object"==typeof o&&null!==o&&o.type===S&&null===o.key;u&&(o=o.props.children);var c="object"==typeof o&&null!==o;if(c)switch(o.$$typeof){case E:e:{for(c=o.key,u=r;null!==u;){if(u.key===c){if(7===u.tag){if(o.type===S){n(e,u.sibling),(r=i(u,o.props.children)).return=e,e=r;break e}}else if(u.elementType===o.type){n(e,u.sibling),(r=i(u,o.props)).ref=So(e,u,o),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}o.type===S?((r=Xl(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=Yl(o.type,o.key,o.props,null,e.mode,l)).ref=So(e,r,o),l.return=e,e=l)}return s(e);case k:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=$l(o,e.mode,l)).return=e,e=r}return s(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Ql(o,e.mode,l)).return=e,e=r),s(e);if(ko(o))return v(e,r,o,l);if(G(o))return g(e,r,o,l);if(c&&Po(e,o),void 0===o&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,Y(e.type)||"Component"))}return n(e,r)}}var Co=_o(!0),jo=_o(!1),To={},Do=ui(To),Oo=ui(To),No=ui(To);function Mo(e){if(e===To)throw Error(a(174));return e}function Lo(e,t){switch(di(No,t),di(Oo,e),di(Do,To),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ci(Do),di(Do,t)}function Ao(){ci(Do),ci(Oo),ci(No)}function Io(e){Mo(No.current);var t=Mo(Do.current),n=he(t,e.type);t!==n&&(di(Oo,e),di(Do,n))}function Bo(e){Oo.current===e&&(ci(Do),ci(Oo))}var zo=ui(0);function Ro(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fo=null,Vo=null,Go=!1;function Uo(e,t){var n=Wl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Wo(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function qo(e){if(Go){var t=Vo;if(t){var n=t;if(!Wo(e,t)){if(!(t=Xr(n.nextSibling))||!Wo(e,t))return e.flags=-1025&e.flags|2,Go=!1,void(Fo=e);Uo(Fo,n)}Fo=e,Vo=Xr(t.firstChild)}else e.flags=-1025&e.flags|2,Go=!1,Fo=e}}function Ho(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Fo=e}function Yo(e){if(e!==Fo)return!1;if(!Go)return Ho(e),Go=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Wr(t,e.memoizedProps))for(t=Vo;t;)Uo(e,t),t=Xr(t.nextSibling);if(Ho(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Vo=Xr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Vo=null}}else Vo=Fo?Xr(e.stateNode.nextSibling):null;return!0}function Xo(){Vo=Fo=null,Go=!1}var Ko=[];function Qo(){for(var e=0;e<Ko.length;e++)Ko[e]._workInProgressVersionPrimary=null;Ko.length=0}var $o=w.ReactCurrentDispatcher,Zo=w.ReactCurrentBatchConfig,Jo=0,ea=null,ta=null,na=null,ra=!1,ia=!1;function oa(){throw Error(a(321))}function aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function sa(e,t,n,r,i,o){if(Jo=o,ea=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$o.current=null===e||null===e.memoizedState?Ma:La,e=n(r,i),ia){o=0;do{if(ia=!1,!(25>o))throw Error(a(301));o+=1,na=ta=null,t.updateQueue=null,$o.current=Aa,e=n(r,i)}while(ia)}if($o.current=Na,t=null!==ta&&null!==ta.next,Jo=0,na=ta=ea=null,ra=!1,t)throw Error(a(300));return e}function la(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===na?ea.memoizedState=na=e:na=na.next=e,na}function ua(){if(null===ta){var e=ea.alternate;e=null!==e?e.memoizedState:null}else e=ta.next;var t=null===na?ea.memoizedState:na.next;if(null!==t)na=t,ta=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ta=e).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===na?ea.memoizedState=na=e:na=na.next=e}return na}function ca(e,t){return"function"==typeof t?t(e):t}function da(e){var t=ua(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ta,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=o=null,u=i;do{var c=u.lane;if((Jo&c)===c)null!==l&&(l=l.next={lane:0,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),r=u.eagerReducer===e?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===l?(s=l=d,o=r):l=l.next=d,ea.lanes|=c,Vs|=c}u=u.next}while(null!==u&&u!==i);null===l?o=r:l.next=s,cr(r,t.memoizedState)||(Ba=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function fa(e){var t=ua(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);cr(o,t.memoizedState)||(Ba=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function pa(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Jo&e)===e)&&(t._workInProgressVersionPrimary=r,Ko.push(t))),e)return n(t._source);throw Ko.push(t),Error(a(350))}function ha(e,t,n,r){var i=Ms;if(null===i)throw Error(a(349));var o=t._getVersion,s=o(t._source),l=$o.current,u=l.useState((function(){return pa(i,t,n)})),c=u[1],d=u[0];u=na;var f=e.memoizedState,p=f.refs,h=p.getSnapshot,v=f.source;f=f.subscribe;var g=ea;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=o(t._source);if(!cr(s,e)){e=n(t._source),cr(d,e)||(c(e),e=pl(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,a=e;0<a;){var l=31-Wt(a),u=1<<l;r[l]|=e,a&=~u}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pl(g);i.mutableReadLanes|=r&i.pendingLanes}catch(o){n((function(){throw o}))}}))}),[t,r]),cr(h,n)&&cr(v,t)&&cr(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:d}).dispatch=c=Oa.bind(null,ea,e),u.queue=e,u.baseQueue=null,d=pa(i,t,n),u.memoizedState=u.baseState=d),d}function va(e,t,n){return ha(ua(),e,t,n)}function ga(e){var t=la();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e}).dispatch=Oa.bind(null,ea,e),[t.memoizedState,e]}function ya(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ea.updateQueue)?(t={lastEffect:null},ea.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ma(e){return e={current:e},la().memoizedState=e}function ba(){return ua().memoizedState}function xa(e,t,n,r){var i=la();ea.flags|=e,i.memoizedState=ya(1|t,n,void 0,void 0===r?null:r)}function wa(e,t,n,r){var i=ua();r=void 0===r?null:r;var o=void 0;if(null!==ta){var a=ta.memoizedState;if(o=a.destroy,null!==r&&aa(r,a.deps))return void ya(t,n,o,r)}ea.flags|=e,i.memoizedState=ya(1|t,n,o,r)}function Ea(e,t){return xa(516,4,e,t)}function ka(e,t){return wa(516,4,e,t)}function Sa(e,t){return wa(4,2,e,t)}function Pa(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function _a(e,t,n){return n=null!=n?n.concat([e]):null,wa(4,2,Pa.bind(null,t,e),n)}function Ca(){}function ja(e,t){var n=ua();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ta(e,t){var n=ua();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Da(e,t){var n=Wi();Hi(98>n?98:n,(function(){e(!0)})),Hi(97<n?97:n,(function(){var n=Zo.transition;Zo.transition=1;try{e(!1),t()}finally{Zo.transition=n}}))}function Oa(e,t,n){var r=fl(),i=pl(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===ea||null!==a&&a===ea)ia=ra=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,cr(l,s))return}catch(u){}hl(e,i,r)}}var Na={readContext:ao,useCallback:oa,useContext:oa,useEffect:oa,useImperativeHandle:oa,useLayoutEffect:oa,useMemo:oa,useReducer:oa,useRef:oa,useState:oa,useDebugValue:oa,useDeferredValue:oa,useTransition:oa,useMutableSource:oa,useOpaqueIdentifier:oa,unstable_isNewReconciler:!1},Ma={readContext:ao,useCallback:function(e,t){return la().memoizedState=[e,void 0===t?null:t],e},useContext:ao,useEffect:Ea,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,xa(4,2,Pa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xa(4,2,e,t)},useMemo:function(e,t){var n=la();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=la();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Oa.bind(null,ea,e),[r.memoizedState,e]},useRef:ma,useState:ga,useDebugValue:Ca,useDeferredValue:function(e){var t=ga(e),n=t[0],r=t[1];return Ea((function(){var t=Zo.transition;Zo.transition=1;try{r(e)}finally{Zo.transition=t}}),[e]),n},useTransition:function(){var e=ga(!1),t=e[0];return ma(e=Da.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=la();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},ha(r,e,t,n)},useOpaqueIdentifier:function(){if(Go){var e=!1,t=function(e){return{$$typeof:A,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Qr++).toString(36))),Error(a(355))})),n=ga(t)[1];return 0==(2&ea.mode)&&(ea.flags|=516,ya(5,(function(){n("r:"+(Qr++).toString(36))}),void 0,null)),t}return ga(t="r:"+(Qr++).toString(36)),t},unstable_isNewReconciler:!1},La={readContext:ao,useCallback:ja,useContext:ao,useEffect:ka,useImperativeHandle:_a,useLayoutEffect:Sa,useMemo:Ta,useReducer:da,useRef:ba,useState:function(){return da(ca)},useDebugValue:Ca,useDeferredValue:function(e){var t=da(ca),n=t[0],r=t[1];return ka((function(){var t=Zo.transition;Zo.transition=1;try{r(e)}finally{Zo.transition=t}}),[e]),n},useTransition:function(){var e=da(ca)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return da(ca)[0]},unstable_isNewReconciler:!1},Aa={readContext:ao,useCallback:ja,useContext:ao,useEffect:ka,useImperativeHandle:_a,useLayoutEffect:Sa,useMemo:Ta,useReducer:fa,useRef:ba,useState:function(){return fa(ca)},useDebugValue:Ca,useDeferredValue:function(e){var t=fa(ca),n=t[0],r=t[1];return ka((function(){var t=Zo.transition;Zo.transition=1;try{r(e)}finally{Zo.transition=t}}),[e]),n},useTransition:function(){var e=fa(ca)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return fa(ca)[0]},unstable_isNewReconciler:!1},Ia=w.ReactCurrentOwner,Ba=!1;function za(e,t,n,r){t.child=null===e?jo(t,null,n,r):Co(t,e.child,n,r)}function Ra(e,t,n,r,i){n=n.render;var o=t.ref;return oo(t,i),r=sa(e,t,n,r,o,i),null===e||Ba?(t.flags|=1,za(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,os(e,t,i))}function Fa(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||ql(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Yl(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Va(e,t,a,r,i,o))}return a=e.child,0==(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:fr)(i,r)&&e.ref===t.ref)?os(e,t,o):(t.flags|=1,(e=Hl(a,r)).ref=t.ref,e.return=t,t.child=e)}function Va(e,t,n,r,i,o){if(null!==e&&fr(e.memoizedProps,r)&&e.ref===t.ref){if(Ba=!1,0==(o&i))return t.lanes=e.lanes,os(e,t,o);0!=(16384&e.flags)&&(Ba=!0)}return Wa(e,t,n,r,o)}function Ga(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},El(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},El(t,e),null;t.memoizedState={baseLanes:0},El(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,El(t,r);return za(e,t,i,n),t.child}function Ua(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Wa(e,t,n,r,i){var o=yi(n)?vi:pi.current;return o=gi(t,o),oo(t,i),n=sa(e,t,n,r,o,i),null===e||Ba?(t.flags|=1,za(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,os(e,t,i))}function qa(e,t,n,r,i){if(yi(n)){var o=!0;wi(t)}else o=!1;if(oo(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),xo(t,n,r),Eo(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"==typeof u&&null!==u?u=ao(u):u=gi(t,u=yi(n)?vi:pi.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&wo(t,a,r,u),so=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),l=t.memoizedState,s!==r||f!==l||hi.current||so?("function"==typeof c&&(yo(t,n,c,r),l=t.memoizedState),(s=so||bo(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,uo(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:$i(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=ao(l):l=gi(t,l=yi(n)?vi:pi.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&wo(t,a,r,l),so=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i);var h=t.memoizedState;s!==d||f!==h||hi.current||so?("function"==typeof p&&(yo(t,n,p,r),h=t.memoizedState),(u=so||bo(t,n,u,r,f,h,l))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Ha(e,t,n,r,o,i)}function Ha(e,t,n,r,i,o){Ua(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&Ei(t,n,!1),os(e,t,o);r=t.stateNode,Ia.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Co(t,e.child,null,o),t.child=Co(t,null,s,o)):za(e,t,s,o),t.memoizedState=r.state,i&&Ei(t,n,!0),t.child}function Ya(e){var t=e.stateNode;t.pendingContext?bi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bi(0,t.context,!1),Lo(e,t.containerInfo)}var Xa,Ka,Qa,$a={dehydrated:null,retryLane:0};function Za(e,t,n){var r,i=t.pendingProps,o=zo.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),di(zo,1&o),null===e?(void 0!==i.fallback&&qo(t),e=i.children,o=i.fallback,a?(e=Ja(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=$a,e):"number"==typeof i.unstable_expectedLoadTime?(e=Ja(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=$a,t.lanes=33554432,e):((n=Kl({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=ts(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=$a,i):(n=es(e,t,i.children,n),t.memoizedState=null,n))}function Ja(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Kl(t,i,0,null),n=Xl(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function es(e,t,n,r){var i=e.child;return e=i.sibling,n=Hl(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Hl(a,s),null!==e?r=Hl(e,r):(r=Xl(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),io(e.return,t)}function rs(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function is(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(za(e,t,r.children,n),0!=(2&(r=zo.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(di(zo,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ro(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rs(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ro(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rs(t,!0,n,null,o,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function os(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Vs|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Hl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Hl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function as(e,t){if(!Go)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return yi(t.type)&&mi(),null;case 3:return Ao(),ci(hi),ci(pi),Qo(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Yo(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Bo(t);var o=Mo(No.current);if(n=t.type,null!==e&&null!=t.stateNode)Ka(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Mo(Do.current),Yo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Zr]=t,r[Jr]=s,n){case"dialog":Dr("cancel",r),Dr("close",r);break;case"iframe":case"object":case"embed":Dr("load",r);break;case"video":case"audio":for(e=0;e<_r.length;e++)Dr(_r[e],r);break;case"source":Dr("error",r);break;case"img":case"image":case"link":Dr("error",r),Dr("load",r);break;case"details":Dr("toggle",r);break;case"input":ee(r,s),Dr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Dr("invalid",r);break;case"textarea":le(r,s),Dr("invalid",r)}for(var u in Se(n,s),e=null,s)s.hasOwnProperty(u)&&(o=s[u],"children"===u?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):l.hasOwnProperty(u)&&null!=o&&"onScroll"===u&&Dr("scroll",r));switch(n){case"input":Q(r),re(r,s,!0);break;case"textarea":Q(r),ce(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Fr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===o.nodeType?o:o.ownerDocument,e===de&&(e=pe(n)),e===de?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Zr]=t,e[Jr]=r,Xa(e,t),t.stateNode=e,u=Pe(n,r),n){case"dialog":Dr("cancel",e),Dr("close",e),o=r;break;case"iframe":case"object":case"embed":Dr("load",e),o=r;break;case"video":case"audio":for(o=0;o<_r.length;o++)Dr(_r[o],e);o=r;break;case"source":Dr("error",e),o=r;break;case"img":case"image":case"link":Dr("error",e),Dr("load",e),o=r;break;case"details":Dr("toggle",e),o=r;break;case"input":ee(e,r),o=J(e,r),Dr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=i({},r,{value:void 0}),Dr("invalid",e);break;case"textarea":le(e,r),o=se(e,r),Dr("invalid",e);break;default:o=r}Se(n,o);var c=o;for(s in c)if(c.hasOwnProperty(s)){var d=c[s];"style"===s?Ee(e,d):"dangerouslySetInnerHTML"===s?null!=(d=d?d.__html:void 0)&&ye(e,d):"children"===s?"string"==typeof d?("textarea"!==n||""!==d)&&me(e,d):"number"==typeof d&&me(e,""+d):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=d&&"onScroll"===s&&Dr("scroll",e):null!=d&&x(e,s,d,u))}switch(n){case"input":Q(e),re(e,r,!1);break;case"textarea":Q(e),ce(e);break;case"option":null!=r.value&&e.setAttribute("value",""+X(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Fr)}Ur(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Qa(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));n=Mo(No.current),Mo(Do.current),Yo(t)?(r=t.stateNode,n=t.memoizedProps,r[Zr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Zr]=t,t.stateNode=r)}return null;case 13:return ci(zo),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Yo(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&zo.current)?0===zs&&(zs=3):(0!==zs&&3!==zs||(zs=4),null===Ms||0==(134217727&Vs)&&0==(134217727&Gs)||ml(Ms,As))),(r||n)&&(t.flags|=4),null);case 4:return Ao(),null===e&&Nr(t.stateNode.containerInfo),null;case 10:return ro(t),null;case 19:if(ci(zo),null===(r=t.memoizedState))return null;if(s=0!=(64&t.flags),null===(u=r.rendering))if(s)as(r,!1);else{if(0!==zs||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(u=Ro(e))){for(t.flags|=64,as(r,!1),null!==(s=u.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(u=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return di(zo,1&zo.current|2),t.child}e=e.sibling}null!==r.tail&&Ui()>Hs&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ro(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),as(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!Go)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ui()-r.renderingStartTime>Hs&&1073741824!==n&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ui(),n.sibling=null,t=zo.current,di(zo,s?1&t|2:1&t),n):null;case 23:case 24:return kl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function ls(e){switch(e.tag){case 1:yi(e.type)&&mi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ao(),ci(hi),ci(pi),Qo(),0!=(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Bo(e),null;case 13:return ci(zo),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ci(zo),null;case 4:return Ao(),null;case 10:return ro(e),null;case 23:case 24:return kl(),null;default:return null}}function us(e,t){try{var n="",r=t;do{n+=H(r),r=r.return}while(r);var i=n}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:i}}function cs(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Xa=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ka=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Mo(Do.current);var a,s=null;switch(n){case"input":o=J(e,o),r=J(e,r),s=[];break;case"option":o=oe(e,o),r=oe(e,r),s=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":o=se(e,o),r=se(e,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Fr)}for(d in Se(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var u=o[d];for(a in u)u.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(u=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&c!==u&&(null!=c||null!=u))if("style"===d)if(u){for(a in u)!u.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&u[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(d,c)):"children"===d?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&Dr("scroll",e),s||u===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===A?c.toString():(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Qa=function(e,t,n,r){n!==r&&(t.flags|=4)};var ds="function"==typeof WeakMap?WeakMap:Map;function fs(e,t,n){(n=co(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Qs||(Qs=!0,$s=r),cs(0,t)},n}function ps(e,t,n){(n=co(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return cs(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Zs?Zs=new Set([this]):Zs.add(this),cs(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"==typeof WeakSet?WeakSet:Set;function vs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){Fl(e,n)}else t.current=null}function gs(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:$i(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Yr(t.stateNode.containerInfo))}throw Error(a(163))}function ys(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(Bl(n,e),Il(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:$i(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&vo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}vo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Ur(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Et(n)))))}throw Error(a(163))}function ms(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=we("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(Si&&"function"==typeof Si.onCommitFiberUnmount)try{Si.onCommitFiberUnmount(ki,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))Bl(t,n);else{r=t;try{i()}catch(o){Fl(r,o)}}n=n.next}while(n!==e)}break;case 1:if(vs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){Fl(t,o)}break;case 5:vs(t);break;case 4:Ps(e,t)}}function xs(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function Es(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(me(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?ks(e,n,t):Ss(e,n,t)}function ks(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Fr));else if(4!==r&&null!==(e=e.child))for(ks(e,t,n),e=e.sibling;null!==e;)ks(e,t,n),e=e.sibling}function Ss(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Ss(e,t,n),e=e.sibling;null!==e;)Ss(e,t,n),e=e.sibling}function Ps(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,u=l;;)if(bs(s,u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(s=n,l=i.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(bs(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function _s(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Jr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Pe(e,i),t=Pe(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];"style"===s?Ee(n,l):"dangerouslySetInnerHTML"===s?ye(n,l):"children"===s?me(n,l):x(n,s,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?ae(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,Et(n.containerInfo)));case 13:return null!==t.memoizedState&&(qs=Ui(),ms(t.child,!0)),void Cs(t);case 19:return void Cs(t);case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(a(163))}function Cs(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=Gl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function js(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ts=Math.ceil,Ds=w.ReactCurrentDispatcher,Os=w.ReactCurrentOwner,Ns=0,Ms=null,Ls=null,As=0,Is=0,Bs=ui(0),zs=0,Rs=null,Fs=0,Vs=0,Gs=0,Us=0,Ws=null,qs=0,Hs=1/0;function Ys(){Hs=Ui()+500}var Xs,Ks=null,Qs=!1,$s=null,Zs=null,Js=!1,el=null,tl=90,nl=[],rl=[],il=null,ol=0,al=null,sl=-1,ll=0,ul=0,cl=null,dl=!1;function fl(){return 0!=(48&Ns)?Ui():-1!==sl?sl:sl=Ui()}function pl(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Wi()?1:2;if(0===ll&&(ll=Fs),0!==Qi.transition){0!==ul&&(ul=null!==Ws?Ws.pendingLanes:0),e=ll;var t=4186112&~ul;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Wi(),0!=(4&Ns)&&98===e?e=Ft(12,ll):e=Ft(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function hl(e,t,n){if(50<ol)throw ol=0,al=null,Error(a(185));if(null===(e=vl(e,t)))return null;Ut(e,t,n),e===Ms&&(Gs|=t,4===zs&&ml(e,As));var r=Wi();1===t?0!=(8&Ns)&&0==(48&Ns)?bl(e):(gl(e,n),0===Ns&&(Ys(),Xi())):(0==(4&Ns)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),gl(e,n)),Ws=e}function vl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function gl(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Wt(s),u=1<<l,c=o[l];if(-1===c){if(0==(u&r)||0!=(u&i)){c=t,Bt(u);var d=It;o[l]=10<=d?c+250:6<=d?c+5e3:-1}}else c<=t&&(e.expiredLanes|=u);s&=~u}if(r=zt(e,e===Ms?As:0),t=It,0===r)null!==n&&(n!==Bi&&Ci(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Bi&&Ci(n)}15===t?(n=bl.bind(null,e),null===Ri?(Ri=[n],Fi=_i(Ni,Ki)):Ri.push(n),n=Bi):14===t?n=Yi(99,bl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=Yi(n,yl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yl(e){if(sl=-1,ul=ll=0,0!=(48&Ns))throw Error(a(327));var t=e.callbackNode;if(Al()&&e.callbackNode!==t)return null;var n=zt(e,e===Ms?As:0);if(0===n)return null;var r=n,i=Ns;Ns|=16;var o=_l();for(Ms===e&&As===r||(Ys(),Sl(e,r));;)try{Tl();break}catch(l){Pl(e,l)}if(no(),Ds.current=o,Ns=i,null!==Ls?r=0:(Ms=null,As=0,r=zs),0!=(Fs&Gs))Sl(e,0);else if(0!==r){if(2===r&&(Ns|=64,e.hydrate&&(e.hydrate=!1,Yr(e.containerInfo)),0!==(n=Rt(e))&&(r=Cl(e,n))),1===r)throw t=Rs,Sl(e,0),ml(e,n),gl(e,Ui()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:case 5:Nl(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(r=qs+500-Ui())){if(0!==zt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){fl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=qr(Nl.bind(null,e),r);break}Nl(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-Wt(n);o=1<<s,(s=r[s])>i&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Ui()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ts(n/1960))-n)){e.timeoutHandle=qr(Nl.bind(null,e),n);break}Nl(e);break;default:throw Error(a(329))}}return gl(e,Ui()),e.callbackNode===t?yl.bind(null,e):null}function ml(e,t){for(t&=~Us,t&=~Gs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Wt(t),r=1<<n;e[n]=-1,t&=~r}}function bl(e){if(0!=(48&Ns))throw Error(a(327));if(Al(),e===Ms&&0!=(e.expiredLanes&As)){var t=As,n=Cl(e,t);0!=(Fs&Gs)&&(n=Cl(e,t=zt(e,t)))}else n=Cl(e,t=zt(e,0));if(0!==e.tag&&2===n&&(Ns|=64,e.hydrate&&(e.hydrate=!1,Yr(e.containerInfo)),0!==(t=Rt(e))&&(n=Cl(e,t))),1===n)throw n=Rs,Sl(e,0),ml(e,t),gl(e,Ui()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nl(e),gl(e,Ui()),null}function xl(e,t){var n=Ns;Ns|=1;try{return e(t)}finally{0===(Ns=n)&&(Ys(),Xi())}}function wl(e,t){var n=Ns;Ns&=-2,Ns|=8;try{return e(t)}finally{0===(Ns=n)&&(Ys(),Xi())}}function El(e,t){di(Bs,Is),Is|=t,Fs|=t}function kl(){Is=Bs.current,ci(Bs)}function Sl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Hr(n)),null!==Ls)for(n=Ls.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&mi();break;case 3:Ao(),ci(hi),ci(pi),Qo();break;case 5:Bo(r);break;case 4:Ao();break;case 13:case 19:ci(zo);break;case 10:ro(r);break;case 23:case 24:kl()}n=n.return}Ms=e,Ls=Hl(e.current,null),As=Is=Fs=t,zs=0,Rs=null,Us=Gs=Vs=0}function Pl(e,t){for(;;){var n=Ls;try{if(no(),$o.current=Na,ra){for(var r=ea.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ra=!1}if(Jo=0,na=ta=ea=null,ia=!1,Os.current=null,null===n||null===n.return){zs=1,Rs=t,Ls=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=As,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!=(1&zo.current),f=a;do{var p;if(p=13===f.tag){var h=f.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var v=f.memoizedProps;p=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!d)}}if(p){var g=f.updateQueue;if(null===g){var y=new Set;y.add(u),f.updateQueue=y}else g.add(u);if(0==(2&f.mode)){if(f.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var m=co(-1,1);m.tag=2,fo(s,m)}s.lanes|=1;break e}l=void 0,s=t;var b=o.pingCache;if(null===b?(b=o.pingCache=new ds,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(s)){l.add(s);var x=Vl.bind(null,o,u,s);u.then(x,x)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);l=Error((Y(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==zs&&(zs=2),l=us(l,s),f=a;do{switch(f.tag){case 3:o=l,f.flags|=4096,t&=-t,f.lanes|=t,po(f,fs(0,o,t));break e;case 1:o=l;var w=f.type,E=f.stateNode;if(0==(64&f.flags)&&("function"==typeof w.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===Zs||!Zs.has(E)))){f.flags|=4096,t&=-t,f.lanes|=t,po(f,ps(f,o,t));break e}}f=f.return}while(null!==f)}Ol(n)}catch(k){t=k,Ls===n&&null!==n&&(Ls=n=n.return);continue}break}}function _l(){var e=Ds.current;return Ds.current=Na,null===e?Na:e}function Cl(e,t){var n=Ns;Ns|=16;var r=_l();for(Ms===e&&As===t||Sl(e,t);;)try{jl();break}catch(i){Pl(e,i)}if(no(),Ns=n,Ds.current=r,null!==Ls)throw Error(a(261));return Ms=null,As=0,zs}function jl(){for(;null!==Ls;)Dl(Ls)}function Tl(){for(;null!==Ls&&!ji();)Dl(Ls)}function Dl(e){var t=Xs(e.alternate,e,Is);e.memoizedProps=e.pendingProps,null===t?Ol(e):Ls=t,Os.current=null}function Ol(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=ss(n,t,Is)))return void(Ls=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Is)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=ls(t)))return n.flags&=2047,void(Ls=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ls=t);Ls=t=e}while(null!==t);0===zs&&(zs=5)}function Nl(e){var t=Wi();return Hi(99,Ml.bind(null,e,t)),null}function Ml(e,t){do{Al()}while(null!==el);if(0!=(48&Ns))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var u=31-Wt(o),c=1<<u;i[u]=0,s[u]=-1,l[u]=-1,o&=~c}if(null!==il&&0==(24&r)&&il.has(e)&&il.delete(e),e===Ms&&(Ls=Ms=null,As=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ns,Ns|=32,Os.current=null,Vr=Kt,yr(s=gr())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(c=l.getSelection&&l.getSelection())&&0!==c.rangeCount){l=c.anchorNode,o=c.anchorOffset,u=c.focusNode,c=c.focusOffset;try{l.nodeType,u.nodeType}catch(_){l=null;break e}var d=0,f=-1,p=-1,h=0,v=0,g=s,y=null;t:for(;;){for(var m;g!==l||0!==o&&3!==g.nodeType||(f=d+o),g!==u||0!==c&&3!==g.nodeType||(p=d+c),3===g.nodeType&&(d+=g.nodeValue.length),null!==(m=g.firstChild);)y=g,g=m;for(;;){if(g===s)break t;if(y===l&&++h===o&&(f=d),y===u&&++v===c&&(p=d),null!==(m=g.nextSibling))break;y=(g=y).parentNode}g=m}l=-1===f||-1===p?null:{start:f,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;Gr={focusedElem:s,selectionRange:l},Kt=!1,cl=null,dl=!1,Ks=r;do{try{Ll()}catch(_){if(null===Ks)throw Error(a(330));Fl(Ks,_),Ks=Ks.nextEffect}}while(null!==Ks);cl=null,Ks=r;do{try{for(s=e;null!==Ks;){var b=Ks.flags;if(16&b&&me(Ks.stateNode,""),128&b){var x=Ks.alternate;if(null!==x){var w=x.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&b){case 2:Es(Ks),Ks.flags&=-3;break;case 6:Es(Ks),Ks.flags&=-3,_s(Ks.alternate,Ks);break;case 1024:Ks.flags&=-1025;break;case 1028:Ks.flags&=-1025,_s(Ks.alternate,Ks);break;case 4:_s(Ks.alternate,Ks);break;case 8:Ps(s,l=Ks);var E=l.alternate;xs(l),null!==E&&xs(E)}Ks=Ks.nextEffect}}catch(_){if(null===Ks)throw Error(a(330));Fl(Ks,_),Ks=Ks.nextEffect}}while(null!==Ks);if(w=Gr,x=gr(),b=w.focusedElem,s=w.selectionRange,x!==b&&b&&b.ownerDocument&&vr(b.ownerDocument.documentElement,b)){null!==s&&yr(b)&&(x=s.start,void 0===(w=s.end)&&(w=x),"selectionStart"in b?(b.selectionStart=x,b.selectionEnd=Math.min(w,b.value.length)):(w=(x=b.ownerDocument||document)&&x.defaultView||window).getSelection&&(w=w.getSelection(),l=b.textContent.length,E=Math.min(s.start,l),s=void 0===s.end?E:Math.min(s.end,l),!w.extend&&E>s&&(l=s,s=E,E=l),l=hr(b,E),o=hr(b,s),l&&o&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==o.node||w.focusOffset!==o.offset)&&((x=x.createRange()).setStart(l.node,l.offset),w.removeAllRanges(),E>s?(w.addRange(x),w.extend(o.node,o.offset)):(x.setEnd(o.node,o.offset),w.addRange(x))))),x=[];for(w=b;w=w.parentNode;)1===w.nodeType&&x.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<x.length;b++)(w=x[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Kt=!!Vr,Gr=Vr=null,e.current=n,Ks=r;do{try{for(b=e;null!==Ks;){var k=Ks.flags;if(36&k&&ys(b,Ks.alternate,Ks),128&k){x=void 0;var S=Ks.ref;if(null!==S){var P=Ks.stateNode;Ks.tag,x=P,"function"==typeof S?S(x):S.current=x}}Ks=Ks.nextEffect}}catch(_){if(null===Ks)throw Error(a(330));Fl(Ks,_),Ks=Ks.nextEffect}}while(null!==Ks);Ks=null,zi(),Ns=i}else e.current=n;if(Js)Js=!1,el=e,tl=t;else for(Ks=r;null!==Ks;)t=Ks.nextEffect,Ks.nextEffect=null,8&Ks.flags&&((k=Ks).sibling=null,k.stateNode=null),Ks=t;if(0===(r=e.pendingLanes)&&(Zs=null),1===r?e===al?ol++:(ol=0,al=e):ol=0,n=n.stateNode,Si&&"function"==typeof Si.onCommitFiberRoot)try{Si.onCommitFiberRoot(ki,n,void 0,64==(64&n.current.flags))}catch(_){}if(gl(e,Ui()),Qs)throw Qs=!1,e=$s,$s=null,e;return 0!=(8&Ns)||Xi(),null}function Ll(){for(;null!==Ks;){var e=Ks.alternate;dl||null===cl||(0!=(8&Ks.flags)?et(Ks,cl)&&(dl=!0):13===Ks.tag&&js(e,Ks)&&et(Ks,cl)&&(dl=!0));var t=Ks.flags;0!=(256&t)&&gs(e,Ks),0==(512&t)||Js||(Js=!0,Yi(97,(function(){return Al(),null}))),Ks=Ks.nextEffect}}function Al(){if(90!==tl){var e=97<tl?97:tl;return tl=90,Hi(e,zl)}return!1}function Il(e,t){nl.push(t,e),Js||(Js=!0,Yi(97,(function(){return Al(),null})))}function Bl(e,t){rl.push(t,e),Js||(Js=!0,Yi(97,(function(){return Al(),null})))}function zl(){if(null===el)return!1;var e=el;if(el=null,0!=(48&Ns))throw Error(a(331));var t=Ns;Ns|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(u){if(null===o)throw Error(a(330));Fl(o,u)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(u){if(null===o)throw Error(a(330));Fl(o,u)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ns=t,Xi(),!0}function Rl(e,t,n){fo(e,t=fs(0,t=us(n,t),1)),t=fl(),null!==(e=vl(e,1))&&(Ut(e,1,t),gl(e,t))}function Fl(e,t){if(3===e.tag)Rl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Rl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Zs||!Zs.has(r))){var i=ps(n,e=us(t,e),1);if(fo(n,i),i=fl(),null!==(n=vl(n,1)))Ut(n,1,i),gl(n,i);else if("function"==typeof r.componentDidCatch&&(null===Zs||!Zs.has(r)))try{r.componentDidCatch(t,e)}catch(o){}break}}n=n.return}}function Vl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=fl(),e.pingedLanes|=e.suspendedLanes&n,Ms===e&&(As&n)===n&&(4===zs||3===zs&&(62914560&As)===As&&500>Ui()-qs?Sl(e,0):Us|=n),gl(e,t)}function Gl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Wi()?1:2:(0===ll&&(ll=Fs),0===(t=Vt(62914560&~ll))&&(t=4194304))),n=fl(),null!==(e=vl(e,t))&&(Ut(e,t,n),gl(e,n))}function Ul(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Wl(e,t,n,r){return new Ul(e,t,n,r)}function ql(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Hl(e,t){var n=e.alternate;return null===n?((n=Wl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Yl(e,t,n,r,i,o){var s=2;if(r=e,"function"==typeof e)ql(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case S:return Xl(n.children,i,o,t);case I:s=8,i|=16;break;case P:s=8,i|=1;break;case _:return(e=Wl(12,n,t,8|i)).elementType=_,e.type=_,e.lanes=o,e;case D:return(e=Wl(13,n,t,i)).type=D,e.elementType=D,e.lanes=o,e;case O:return(e=Wl(19,n,t,i)).elementType=O,e.lanes=o,e;case B:return Kl(n,i,o,t);case z:return(e=Wl(24,n,t,i)).elementType=z,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case j:s=9;break e;case T:s=11;break e;case N:s=14;break e;case M:s=16,r=null;break e;case L:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Wl(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Xl(e,t,n,r){return(e=Wl(7,e,r,t)).lanes=n,e}function Kl(e,t,n,r){return(e=Wl(23,e,r,t)).elementType=B,e.lanes=n,e}function Ql(e,t,n){return(e=Wl(6,e,null,t)).lanes=n,e}function $l(e,t,n){return(t=Wl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Gt(0),this.expirationTimes=Gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.mutableSourceEagerHydrationData=null}function Jl(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:k,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function eu(e,t,n,r){var i=t.current,o=fl(),s=pl(i);e:if(n){t:{if(Qe(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(yi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(a(171))}if(1===n.tag){var u=n.type;if(yi(u)){n=xi(n,u,l);break e}}n=l}else n=fi;return null===t.context?t.context=n:t.pendingContext=n,(t=co(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),fo(i,t),hl(i,s,o),s}function tu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ru(e,t){nu(e,t),(e=e.alternate)&&nu(e,t)}function iu(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Zl(e,t,null!=n&&!0===n.hydrate),t=Wl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,lo(t),e[ei]=n.current,Nr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function ou(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function au(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=tu(a);s.call(e)}}eu(t,a,e,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new iu(e,0,t?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"==typeof i){var l=i;i=function(){var e=tu(a);l.call(e)}}wl((function(){eu(t,a,e,i)}))}return tu(a)}function su(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ou(t))throw Error(a(200));return Jl(e,t,null,n)}Xs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||hi.current)Ba=!0;else{if(0==(n&r)){switch(Ba=!1,t.tag){case 3:Ya(t),Xo();break;case 5:Io(t);break;case 1:yi(t.type)&&wi(t);break;case 4:Lo(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;di(Zi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Za(e,t,n):(di(zo,1&zo.current),null!==(t=os(e,t,n))?t.sibling:null);di(zo,1&zo.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return is(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),di(zo,zo.current),r)break;return null;case 23:case 24:return t.lanes=0,Ga(e,t,n)}return os(e,t,n)}Ba=0!=(16384&e.flags)}else Ba=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=gi(t,pi.current),oo(t,n),i=sa(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,yi(r)){var o=!0;wi(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,lo(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&yo(t,r,s,e),i.updater=mo,t.stateNode=i,i._reactInternals=t,Eo(t,r,e,n),t=Ha(null,t,r,!0,o,n)}else t.tag=0,za(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return ql(e)?1:0;if(null!=e){if((e=e.$$typeof)===T)return 11;if(e===N)return 14}return 2}(i),e=$i(i,e),o){case 0:t=Wa(null,t,i,e,n);break e;case 1:t=qa(null,t,i,e,n);break e;case 11:t=Ra(null,t,i,e,n);break e;case 14:t=Fa(null,t,i,$i(i.type,e),r,n);break e}throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Wa(e,t,r,i=t.elementType===r?i:$i(r,i),n);case 1:return r=t.type,i=t.pendingProps,qa(e,t,r,i=t.elementType===r?i:$i(r,i),n);case 3:if(Ya(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,uo(e,t),ho(t,r,null,n),(r=t.memoizedState.element)===i)Xo(),t=os(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Vo=Xr(t.stateNode.containerInfo.firstChild),Fo=t,o=Go=!0),o){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(o=e[i])._workInProgressVersionPrimary=e[i+1],Ko.push(o);for(n=jo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else za(e,t,r,n),Xo();t=t.child}return t;case 5:return Io(t),null===e&&qo(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Wr(r,i)?s=null:null!==o&&Wr(r,o)&&(t.flags|=16),Ua(e,t),za(e,t,s,n),t.child;case 6:return null===e&&qo(t),null;case 13:return Za(e,t,n);case 4:return Lo(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Co(t,null,r,n):za(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Ra(e,t,r,i=t.elementType===r?i:$i(r,i),n);case 7:return za(e,t,t.pendingProps,n),t.child;case 8:case 12:return za(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(di(Zi,l._currentValue),l._currentValue=o,null!==s)if(l=s.value,0===(o=cr(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!hi.current){t=os(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){s=l.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===l.tag&&((c=co(-1,n&-n)).tag=2,fo(l,c)),l.lanes|=n,null!==(c=l.alternate)&&(c.lanes|=n),io(l.return,n),u.lanes|=n;break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}za(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,oo(t,n),r=r(i=ao(i,o.unstable_observedBits)),t.flags|=1,za(e,t,r,n),t.child;case 14:return o=$i(i=t.type,t.pendingProps),Fa(e,t,i,o=$i(i.type,o),r,n);case 15:return Va(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:$i(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,yi(r)?(e=!0,wi(t)):e=!1,oo(t,n),xo(t,r,i),Eo(t,r,i,n),Ha(null,t,r,!0,e,n);case 19:return is(e,t,n);case 23:case 24:return Ga(e,t,n)}throw Error(a(156,t.tag))},iu.prototype.render=function(e){eu(e,this._internalRoot,null,null)},iu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;eu(null,e,null,(function(){t[ei]=null}))},tt=function(e){13===e.tag&&(hl(e,4,fl()),ru(e,4))},nt=function(e){13===e.tag&&(hl(e,67108864,fl()),ru(e,67108864))},rt=function(e){if(13===e.tag){var t=fl(),n=pl(e);hl(e,n,t),ru(e,n)}},it=function(e,t){return t()},Ce=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=oi(r);if(!i)throw Error(a(90));$(r),ne(r,i)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Me=xl,Le=function(e,t,n,r,i){var o=Ns;Ns|=4;try{return Hi(98,e.bind(null,t,n,r,i))}finally{0===(Ns=o)&&(Ys(),Xi())}},Ae=function(){0==(49&Ns)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gl(e,Ui())}))}Xi()}(),Al())},Ie=function(e,t){var n=Ns;Ns|=2;try{return e(t)}finally{0===(Ns=n)&&(Ys(),Xi())}};var lu={Events:[ri,ii,oi,Oe,Ne,Al,{current:!1}]},uu={findFiberByHostInstance:ni,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},cu={bundleType:uu.bundleType,version:uu.version,rendererPackageName:uu.rendererPackageName,rendererConfig:uu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Je(e))?null:e.stateNode},findFiberByHostInstance:uu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!du.isDisabled&&du.supportsFiber)try{ki=du.inject(cu),Si=du}catch(ge){}}t.createPortal=su,t.render=function(e,t,n){if(!ou(t))throw Error(a(200));return au(null,e,t,!1,n)}},"7nmT":(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n("w/UT")},"32oc":(e,t,n)=>{"use strict";n("maj8");var r=n("ERkP"),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,o={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:o,_owner:a.current}}t.jsx=u,t.jsxs=u},hLw4:(e,t,n)=>{"use strict";var r=n("maj8"),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),o=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),s=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),u=d("react.memo"),c=d("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function g(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}function y(){}function m(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var b=m.prototype=new y;b.constructor=m,r(b,g.prototype),b.isPureReactComponent=!0;var x={current:null},w=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var r,o={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,r)&&!E.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:i,type:e,key:a,ref:s,props:o,_owner:x.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var P=/\/+/g;function _(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function C(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case o:l=!0}}if(l)return a=a(l=e),e=""===r?"."+_(l,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(P,"$&/")+"/"),C(a,t,n,"",(function(e){return e}))):null!=a&&(S(a)&&(a=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var c=r+_(s=e[u],u);l+=C(s,t,n,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(s=e.next()).done;)l+=C(s=s.value,t,n,c=r+_(s,u++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function j(e,t,n){if(null==e)return e;var r=[],i=0;return C(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function T(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var D={current:null};function O(){var e=D.current;if(null===e)throw Error(p(321));return e}var N={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:j,forEach:function(e,t,n){j(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return j(e,(function(){t++})),t},toArray:function(e){return j(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error(p(143));return e}},t.Component=g,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var o=r({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=x.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)w.call(t,c)&&!E.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){u=Array(c);for(var d=0;d<c;d++)u[d]=arguments[d+2];o.children=u}return{$$typeof:i,type:e.type,key:a,ref:s,props:o,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:T}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return O().useCallback(e,t)},t.useContext=function(e,t){return O().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return O().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return O().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return O().useLayoutEffect(e,t)},t.useMemo=function(e,t){return O().useMemo(e,t)},t.useReducer=function(e,t,n){return O().useReducer(e,t,n)},t.useRef=function(e){return O().useRef(e)},t.useState=function(e){return O().useState(e)},t.version="17.0.2"},ERkP:(e,t,n)=>{"use strict";e.exports=n("hLw4")},jg1C:(e,t,n)=>{"use strict";e.exports=n("32oc")},hf2P:(e,t)=>{"use strict";var n,r,i,o;if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(n){throw setTimeout(d,0),n}};n=function(e){null!==u?setTimeout(n,0,e):(u=e,setTimeout(d,0))},r=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var h=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof h&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,g=null,y=-1,m=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,w=x.port2;x.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();b=e+m;try{g(!0,e)?w.postMessage(null):(v=!1,g=null)}catch(n){throw w.postMessage(null),n}}else v=!1},n=function(e){g=e,v||(v=!0,w.postMessage(null))},r=function(e,n){y=f((function(){e(t.unstable_now())}),n)},i=function(){p(y),y=-1}}function E(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<P(i,t)))break e;e[r]=t,e[n]=i,n=r}}function k(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var o=2*(r+1)-1,a=e[o],s=o+1,l=e[s];if(void 0!==a&&0>P(a,n))void 0!==l&&0>P(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==l&&0>P(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var _=[],C=[],j=1,T=null,D=3,O=!1,N=!1,M=!1;function L(e){for(var t=k(C);null!==t;){if(null===t.callback)S(C);else{if(!(t.startTime<=e))break;S(C),t.sortIndex=t.expirationTime,E(_,t)}t=k(C)}}function A(e){if(M=!1,L(e),!N)if(null!==k(_))N=!0,n(I);else{var t=k(C);null!==t&&r(A,t.startTime-e)}}function I(e,n){N=!1,M&&(M=!1,i()),O=!0;var o=D;try{for(L(n),T=k(_);null!==T&&(!(T.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=T.callback;if("function"==typeof a){T.callback=null,D=T.priorityLevel;var s=a(T.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?T.callback=s:T===k(_)&&S(_),L(n)}else S(_);T=k(_)}if(null!==T)var l=!0;else{var u=k(C);null!==u&&r(A,u.startTime-n),l=!1}return l}finally{T=null,D=o,O=!1}}var B=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||O||(N=!0,n(I))},t.unstable_getCurrentPriorityLevel=function(){return D},t.unstable_getFirstCallbackNode=function(){return k(_)},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:j++,callback:o,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>s?(e.sortIndex=a,E(C,e),null===k(_)&&e===k(C)&&(M?i():M=!0,r(A,a-s))):(e.sortIndex=l,E(_,e),N||O||(N=!0,n(I))),e},t.unstable_wrapCallback=function(e){var t=D;return function(){var n=D;D=t;try{return e.apply(this,arguments)}finally{D=n}}}},jiMj:(e,t,n)=>{"use strict";e.exports=n("hf2P")},"3a9g":(e,t,n)=>{"use strict";var r=n("maj8"),i=n("ERkP");t.useSubscription=function(e){var t=e.getCurrentValue,n=e.subscribe,o=i.useState((function(){return{getCurrentValue:t,subscribe:n,value:t()}}));e=o[0];var a=o[1];return o=e.value,e.getCurrentValue===t&&e.subscribe===n||(o=t(),a({getCurrentValue:t,subscribe:n,value:o})),i.useDebugValue(o),i.useEffect((function(){function e(){if(!i){var e=t();a((function(i){return i.getCurrentValue!==t||i.subscribe!==n||i.value===e?i:r({},i,{value:e})}))}}var i=!1,o=n(e);return e(),function(){i=!0,o()}}),[t,n]),o}},D3Vl:(e,t,n)=>{"use strict";e.exports=n("3a9g")},IXFX:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionTypes:()=>A,Interpreter:()=>ct,InterpreterStatus:()=>lt,Machine:()=>Ke,SpecialTargets:()=>I,State:()=>Be,StateNode:()=>Xe,actions:()=>vt,assign:()=>be,createMachine:()=>Qe,createSchema:()=>ht,doneInvoke:()=>Ee,forwardTo:()=>Se,interpret:()=>ft,mapState:()=>W,matchState:()=>pt,matchesState:()=>d,send:()=>fe,sendParent:()=>pe,sendUpdate:()=>he,spawn:()=>dt});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(ne){i={error:ne}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}var l={},u="xstate.guard";function c(e){return Object.keys(e)}function d(e,t,n){void 0===n&&(n=".");var r=h(e,n),i=h(t,n);return O(i)?!!O(r)&&i===r:O(r)?r in i:c(r).every((function(e){return e in i&&d(r[e],i[e])}))}function f(e){try{return O(e)||"number"==typeof e?""+e:e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function p(e,t){try{return T(e)?e:e.toString().split(t)}catch(n){throw new Error("'"+e+"' is not a valid state path.")}}function h(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:T(e)?v(e):"string"!=typeof e?e:v(p(e,t));var n}function v(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function g(e,t){for(var n={},r=c(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function y(e,t,n){var r,i,a={};try{for(var s=o(c(e)),l=s.next();!l.done;l=s.next()){var u=l.value,d=e[u];n(d)&&(a[u]=t(d,u,e))}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}var m=function(e){return function(t){var n,r,i=t;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){i=i[s.value]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}};function b(e){return e?O(e)?[[e]]:x(c(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?b(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function x(e){var t;return(t=[]).concat.apply(t,s([],a(e)))}function w(e){return T(e)?e:[e]}function E(e){return void 0===e?[]:w(e)}function k(e,t,n){var r,i;if(D(e))return e(t,n.data);var a={};try{for(var s=o(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];D(c)?a[u]=c(t,n.data):a[u]=c}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function S(e){return e instanceof Promise||!(null===e||!D(e)&&"object"!=typeof e||!D(e.then))}function P(e,t){var n,r,i=a([[],[]],2),s=i[0],l=i[1];try{for(var u=o(e),c=u.next();!c.done;c=u.next()){var d=c.value;t(d)?s.push(d):l.push(d)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[s,l]}function _(e,t){return g(e.states,(function(e,n){if(e){var r=(O(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:_(e,r)}}}))}function C(e,t,n,r){return e?n.reduce((function(e,n){var i,a,s=n.assignment,l={state:r,action:n,_event:t},u={};if(D(s))u=s(e,t.data,l);else try{for(var d=o(c(s)),f=d.next();!f.done;f=d.next()){var p=f.value,h=s[p];u[p]=D(h)?h(e,t.data,l):h}}catch(v){i={error:v}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}return Object.assign({},e,u)}),e):e}var j=function(){};function T(e){return Array.isArray(e)}function D(e){return"function"==typeof e}function O(e){return"string"==typeof e}function N(e,t){if(e)return O(e)?{type:u,name:e,predicate:t?t[e]:void 0}:D(e)?{type:u,name:e.name,predicate:e}:e}var M=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function L(e){try{return"__xstatenode"in e}catch(t){return!1}}var A,I,B=function(){var e=0;return function(){return(++e).toString(16)}}();function z(e,t){return O(e)||"number"==typeof e?r({type:e},t):e}function R(e,t){if(!O(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=z(e);return r({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function F(e,t){return w(t).map((function(t){return void 0===t||"string"==typeof t||L(t)?{target:t,event:e}:r(r({},t),{event:e})}))}function V(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===u)return((null==o?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o[t.type];if(!s)throw new Error("Guard '"+t.type+"' is not implemented on machine '"+e.id+"'.");return s(n,r.data,a)}function G(e){return"string"==typeof e?{type:e}:e}function U(e,t,n){if("object"==typeof e)return e;var r=function(){};return{next:e,error:t||r,complete:n||r}}function W(e,t){var n,r,i;try{for(var a=o(c(e)),s=a.next();!s.done;s=a.next()){var l=s.value;d(l,t)&&(!i||t.length>i.length)&&(i=l)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e[i]}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(A||(A={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(I||(I={}));var q=A.Start,H=A.Stop,Y=A.Raise,X=A.Send,K=A.Cancel,Q=A.NullEvent,$=A.Assign,Z=(A.After,A.DoneState,A.Log),J=A.Init,ee=A.Invoke,te=(A.ErrorExecution,A.ErrorPlatform),ne=A.ErrorCustom,re=A.Update,ie=A.Choose,oe=A.Pure,ae=R({type:J});function se(e,t){return t&&t[e]||void 0}function le(e,t){var n;if(O(e)||"number"==typeof e)n=D(i=se(e,t))?{type:e,exec:i}:i||{type:e,exec:void 0};else if(D(e))n={type:e.name||e.toString(),exec:e};else{var i;if(D(i=se(e.type,t)))n=r(r({},e),{exec:i});else if(i){var o=i.type||e.type;n=r(r(r({},i),e),{type:o})}else n=e}return n}var ue=function(e,t){return e?(T(e)?e:[e]).map((function(e){return le(e,t)})):[]};function ce(e){var t=le(e);return r(r({id:O(e)?e:t.id},t),{type:t.type})}function de(e){return O(e)?{type:Y,event:e}:fe(e,{to:I.Internal})}function fe(e,t){return{to:t?t.to:void 0,type:X,event:D(e)?e:z(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:D(e)?e.name:f(e)}}function pe(e,t){return fe(e,r(r({},t),{to:I.Parent}))}function he(){return pe(re)}var ve=function(e,t){return{context:e,event:t}};var ge=function(e){return{type:K,sendId:e}};function ye(e){var t=ce(e);return{type:A.Start,activity:t,exec:void 0}}function me(e){var t=D(e)?e:ce(e);return{type:A.Stop,activity:t,exec:void 0}}var be=function(e){return{type:$,assignment:e}};function xe(e,t){var n=t?"#"+t:"";return A.After+"("+e+")"+n}function we(e,t){var n=A.DoneState+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function Ee(e,t){var n=A.DoneInvoke+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function ke(e,t){var n=A.ErrorPlatform+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function Se(e,t){return fe((function(e,t){return t}),r(r({},t),{to:e}))}function Pe(e,t,n,i,o,l){void 0===l&&(l=!1);var u=a(l?[[],o]:P(o,(function(e){return e.type===$})),2),c=u[0],d=u[1],f=c.length?C(n,i,c,t):n,p=l?[n]:void 0,h=x(d.map((function(n){var o;switch(n.type){case Y:return{type:Y,_event:R(n.event)};case X:var u=function(e,t,n,i){var o,a={_event:n},s=R(D(e.event)?e.event(t,n.data,a):e.event);if(O(e.delay)){var l=i&&i[e.delay];o=D(l)?l(t,n.data,a):l}else o=D(e.delay)?e.delay(t,n.data,a):e.delay;var u=D(e.to)?e.to(t,n.data,a):e.to;return r(r({},e),{to:u,_event:s,event:s.data,delay:o})}(n,f,i,e.options.delays);return u;case Z:return function(e,t,n){return r(r({},e),{value:O(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(n,f,i);case ie:if(!(v=null===(o=n.conds.find((function(n){var r=N(n.cond,e.options.guards);return!r||V(e,r,f,i,t)})))||void 0===o?void 0:o.actions))return[];var c=a(Pe(e,t,f,i,ue(E(v),e.options.actions),l),2),d=c[0],h=c[1];return f=h,null==p||p.push(f),d;case oe:var v;if(!(v=n.get(f,i.data)))return[];var g=a(Pe(e,t,f,i,ue(E(v),e.options.actions),l),2),y=g[0],m=g[1];return f=m,null==p||p.push(f),y;case H:return function(e,t,n){var r=D(e.activity)?e.activity(t,n.data):e.activity,i="string"==typeof r?{id:r}:r;return{type:A.Stop,activity:i}}(n,f,i);case $:f=C(f,i,[n],t),null==p||p.push(f);break;default:var b=le(n,e.options.actions),x=b.exec;if(x&&p){var w=p.length-1;b=r(r({},b),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];x.apply(void 0,s([p[w]],a(t)))}})}return b}})).filter((function(e){return!!e})));return[h,f]}var _e=function(e){return"atomic"===e.type||"final"===e.type};function Ce(e){return c(e.states).map((function(t){return e.states[t]}))}function je(e){var t=[e];return _e(e)?t:t.concat(x(Ce(e).map(je)))}function Te(e,t){var n,r,i,a,s,l,u,c,d=Oe(new Set(e)),f=new Set(t);try{for(var p=o(f),h=p.next();!h.done;h=p.next())for(var v=(S=h.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(P){n={error:P}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var g=Oe(f);try{for(var y=o(f),m=y.next();!m.done;m=y.next()){if("compound"!==(S=m.value).type||g.get(S)&&g.get(S).length){if("parallel"===S.type)try{for(var b=(s=void 0,o(Ce(S))),x=b.next();!x.done;x=b.next()){var w=x.value;"history"!==w.type&&(f.has(w)||(f.add(w),d.get(w)?d.get(w).forEach((function(e){return f.add(e)})):w.initialStateNodes.forEach((function(e){return f.add(e)}))))}}catch(_){s={error:_}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}}else d.get(S)?d.get(S).forEach((function(e){return f.add(e)})):S.initialStateNodes.forEach((function(e){return f.add(e)}))}}catch(C){i={error:C}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}try{for(var E=o(f),k=E.next();!k.done;k=E.next()){var S;for(v=(S=k.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(j){u={error:j}}finally{try{k&&!k.done&&(c=E.return)&&c.call(E)}finally{if(u)throw u.error}}return f}function De(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(_e(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=De(e,t)})),i}function Oe(e){var t,n,r=new Map;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=a.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function Ne(e,t){return De(e,Oe(Te([e],t)))}function Me(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function Le(e,t){return"compound"===t.type?Ce(t).some((function(t){return"final"===t.type&&Me(e,t)})):"parallel"===t.type&&Ce(t).every((function(t){return Le(e,t)}))}function Ae(e){return new Set(x(e.map((function(e){return e.tags}))))}function Ie(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(O(e)||O(t))return e===t;var n=c(e),r=c(t);return n.length===r.length&&n.every((function(n){return Ie(e[n],t[n])}))}var Be=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=l,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||l,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return s([],a(new Set(x(s([],a(e.map((function(e){return e.ownEvents}))))))))}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:ae,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ae;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),O(e))return[e];var r=c(e);return r.concat.apply(r,s([],a(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))})))))},e.prototype.toJSON=function(){var e=this,t=(e.configuration,e.transitions,e.tags),n=(e.machine,i(e,["configuration","transitions","tags","machine"]));return r(r({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return d(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;return j(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false."),!!(null===(t=this.machine)||void 0===t?void 0:t.transition(this,e).changed)},e}(),ze=[],Re=function(e,t){ze.push(e);var n=t(e);return ze.pop(),n};function Fe(e){return{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}}}function Ve(e,t,n){var r=Fe(t);if(r.deferred=!0,L(e)){var i=r.state=Re(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return i}}return r}function Ge(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Ue(e){return r(r({type:ee},e),{toJSON:function(){e.onDone,e.onError;var t=i(e,["onDone","onError"]);return r(r({},t),{type:ee,src:Ge(e.src)})}})}var We="",qe="*",He={},Ye=function(e){return"#"===e[0]},Xe=function(){function e(t,n,i){var l,u=this;void 0===i&&(i="context"in t?t.context:void 0),this.config=t,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=this.options._parent,this.key=this.config.key||this.options._key||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||s([this.machine.key],a(this.path)).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&c(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(l=this.config.schema)&&void 0!==l?l:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?g(this.config.states,(function(t,n){var i,o=new e(t,{_parent:u,_key:n});return Object.assign(u.idMap,r(((i={})[o.id]=o,i),o.idMap)),o})):He;var d=0;!function e(t){var n,r;t.order=d++;try{for(var i=o(Ce(t)),a=i.next();!a.done;a=i.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===We})):We in this.config.on),this.strict=!!this.config.strict,this.onEntry=E(this.config.entry||this.config.onEntry).map((function(e){return le(e)})),this.onExit=E(this.config.exit||this.config.onExit).map((function(e){return le(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=E(this.config.invoke).map((function(e,t){var n,i;if(L(e))return u.machine.options.services=r(((n={})[e.id]=e,n),u.machine.options.services),Ue({src:e.id,id:e.id});if(O(e.src))return Ue(r(r({},e),{id:e.id||e.src,src:e.src}));if(L(e.src)||D(e.src)){var o=u.id+":invocation["+t+"]";return u.machine.options.services=r(((i={})[o]=e.src,i),u.machine.options.services),Ue(r(r({id:o},e),{src:o}))}var a=e.src;return Ue(r(r({id:a.type},e),{src:a}))})),this.activities=E(this.config.activities).concat(this.invoke).map((function(e){return ce(e)})),this.transition=this.transition.bind(this),this.tags=E(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||je(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var i=this.options,o=i.actions,a=i.activities,s=i.guards,l=i.services,u=i.delays;return new e(this.config,{actions:r(r({},o),t.actions),activities:r(r({},a),t.activities),guards:r(r({},s),t.guards),services:r(r({},l),t.services),delays:r(r({},u),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return D(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:g(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===We,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===qe}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=xe(D(t)?e.id+":delay["+n+"]":t,e.id);return e.onEntry.push(fe(r,{delay:t})),e.onExit.push(ge(r)),r};return(T(t)?t.map((function(e,t){var i=n(e.delay,t);return r(r({},e),{event:i})})):x(c(t).map((function(e,i){var o=t[e],a=O(o)?{target:o}:o,s=isNaN(+e)?e:+e,l=n(s,i);return E(a).map((function(e){return r(r({},e),{event:l,delay:s})}))})))).map((function(t){var n=t.delay;return r(r({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof Be?e.value:h(e,this.delimiter);if(O(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((t={})[r]=i,t)):[this,this.states[r]]}var o=c(r),a=o.map((function(e){return n.getStateNode(e)}));return a.push(this),a.concat(o.reduce((function(e,t){var i=n.getStateNode(t).getStateNodes(r[t]);return e.concat(i)}),[]))},e.prototype.handles=function(e){var t=f(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=Array.from(Te([],this.getStateNodes(e.value)));return new Be(r(r({},e),{value:this.resolve(e.value),configuration:t,done:Le(t,this),tags:Ae(t)}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=c(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,i,a={};try{for(var s=o(c(e)),l=s.next();!l.done;l=s.next()){var u=l.value,d=e[u];if(d){var f=this.getStateNode(u)._transition(d,t,n);f&&(a[u]=f)}}}catch(y){r={error:y}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}var p=c(a).map((function(e){return a[e]})),h=x(p.map((function(e){return e.transitions})));if(!p.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=x(p.map((function(e){return e.entrySet}))),g=x(c(a).map((function(e){return a[e].configuration})));return{transitions:h,entrySet:v,exitSet:x(p.map((function(e){return e.exitSet}))),configuration:g,source:t,actions:x(c(a).map((function(e){return a[e].actions})))}},e.prototype._transition=function(e,t,n){return O(e)?this.transitionLeafNode(e,t,n):1===c(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.next=function(e,t){var n,r,i,l=this,u=t.name,c=[],f=[];try{for(var p=o(this.getCandidates(u)),v=p.next();!v.done;v=p.next()){var g=v.value,y=g.cond,b=g.in,w=e.context,E=!b||(O(b)&&Ye(b)?e.matches(h(this.getStateNodeById(b).path,this.delimiter)):d(h(b,this.delimiter),m(this.path.slice(0,-2))(e.value))),k=!1;try{k=!y||V(this.machine,y,w,t,e)}catch(_){throw new Error("Unable to evaluate guard '"+(y.name||y.type)+"' in transition for event '"+u+"' in state node '"+this.id+"':\n"+_.message)}if(k&&E){void 0!==g.target&&(f=g.target),c.push.apply(c,s([],a(g.actions))),i=g;break}}}catch(C){n={error:C}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}if(i){if(!f.length)return{transitions:[i],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:c};var S=x(f.map((function(t){return l.getRelativeStateNodes(t,e.historyValue)}))),P=!!i.internal;return{transitions:[i],entrySet:P?[]:x(S.map((function(e){return l.nodesFromChild(e)}))),exitSet:P?[]:[this],configuration:S,source:e,actions:c}}},e.prototype.nodesFromChild=function(e){if(e.escapes(this))return[];for(var t=[],n=e;n&&n!==this;)t.push(n),n=n.parent;return t.push(this),t},e.prototype.escapes=function(e){if(this===e)return!1;for(var t=this.parent;t;){if(t===e)return!1;t=t.parent}return!0},e.prototype.getActions=function(e,t,n,r){var i,l,u,c,d=Te([],r?this.getStateNodes(r.value):[this]),f=e.configuration.length?Te(d,e.configuration):d;try{for(var p=o(f),h=p.next();!h.done;h=p.next()){Me(d,y=h.value)||e.entrySet.push(y)}}catch(_){i={error:_}}finally{try{h&&!h.done&&(l=p.return)&&l.call(p)}finally{if(i)throw i.error}}try{for(var v=o(d),g=v.next();!g.done;g=v.next()){var y;Me(f,y=g.value)&&!Me(e.exitSet,y.parent)||e.exitSet.push(y)}}catch(C){u={error:C}}finally{try{g&&!g.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}e.source||(e.exitSet=[],e.entrySet.push(this));var m=x(e.entrySet.map((function(r){var i=[];if("final"!==r.type)return i;var o=r.parent;if(!o.parent)return i;i.push(we(r.id,r.doneData),we(o.id,r.doneData?k(r.doneData,t,n):void 0));var a=o.parent;return"parallel"===a.type&&Ce(a).every((function(t){return Le(e.configuration,t)}))&&i.push(we(a.id)),i})));e.exitSet.sort((function(e,t){return t.order-e.order})),e.entrySet.sort((function(e,t){return e.order-t.order}));var b=new Set(e.entrySet),w=new Set(e.exitSet),E=a([x(Array.from(b).map((function(e){return s(s([],a(e.activities.map((function(e){return ye(e)})))),a(e.onEntry))}))).concat(m.map(de)),x(Array.from(w).map((function(e){return s(s([],a(e.onExit)),a(e.activities.map((function(e){return me(e)}))))})))],2),S=E[0],P=E[1];return ue(P.concat(e.actions).concat(S),this.machine.options.actions)},e.prototype.transition=function(e,t,n){void 0===e&&(e=this.initialState);var r,i,o=R(t);if(e instanceof Be)r=void 0===n?e:this.resolveState(Be.from(e,n));else{var l=O(e)?this.resolve(v(this.getResolvedPath(e))):this.resolve(e),u=null!=n?n:this.machine.context;r=this.resolveState(Be.from(l,u))}if(this.strict&&!this.events.includes(o.name)&&(i=o.name,!/^(done|error)\./.test(i)))throw new Error("Machine '"+this.id+"' does not accept event '"+o.name+"'");var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:r,actions:[]},d=Te([],this.getStateNodes(r.value)),f=c.configuration.length?Te(d,c.configuration):d;return c.configuration=s([],a(f)),this.resolveTransition(c,r,o)},e.prototype.resolveRaisedTransition=function(e,t,n){var r,i=e.actions;return(e=this.transition(e,t))._event=n,e.event=n.data,(r=e.actions).unshift.apply(r,s([],a(i))),e},e.prototype.resolveTransition=function(e,t,n,i){var s,l,u=this;void 0===n&&(n=ae),void 0===i&&(i=this.machine.context);var c=e.configuration,d=!t||e.transitions.length>0,f=d?Ne(this.machine,c):void 0,p=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,h=t?t.context:i,v=this.getActions(e,h,n,t),g=t?r({},t.activities):{};try{for(var y=o(v),m=y.next();!m.done;m=y.next()){var b=m.value;b.type===q?g[b.activity.id||b.activity.type]=b:b.type===H&&(g[b.activity.id||b.activity.type]=!1)}}catch(W){s={error:W}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}var x,w,E=a(Pe(this,t,h,n,v,this.machine.config.preserveActionOrder),2),S=E[0],C=E[1],j=a(P(S,(function(e){return e.type===Y||e.type===X&&e.to===I.Internal})),2),T=j[0],D=j[1],O=S.filter((function(e){var t;return e.type===q&&(null===(t=e.activity)||void 0===t?void 0:t.type)===ee})),N=O.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var i,o=G(e.src),a=null===(i=null==t?void 0:t.options.services)||void 0===i?void 0:i[o.type],s=e.data?k(e.data,n,r):void 0,l=a?Ve(a,e.id,s):Fe(e.id);return l.meta=e,l}(t.activity,u.machine,C,n),e}),t?r({},t.children):{}),M=f?e.configuration:t?t.configuration:[],L=Le(M,this),A=new Be({value:f||t.value,context:C,_event:n,_sessionid:t?t._sessionid:null,historyValue:f?p?(x=p,w=f,{current:w,states:_(x,w)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?D:[],activities:f?g:t?t.activities:{},events:[],configuration:M,transitions:e.transitions,children:N,done:L,tags:null==t?void 0:t.tags,machine:this}),B=h!==C;A.changed=n.name===re||B;var z=A.history;z&&delete z.history;var R=!L&&(this._transient||c.some((function(e){return e._transient})));if(!(d||R&&n.name!==We))return A;var F=A;if(!L)for(R&&(F=this.resolveRaisedTransition(F,{type:Q},n));T.length;){var V=T.shift();F=this.resolveRaisedTransition(F,V._event,n)}var U=F.changed||(z?!!F.actions.length||B||typeof z.value!=typeof F.value||!Ie(F.value,z.value):void 0);return F.changed=U,F.history=z,F.tags=Ae(F.configuration),F},e.prototype.getStateNode=function(e){if(Ye(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '"+e+"' from '"+this.id+"'; no child states exist.");var t=this.states[e];if(!t)throw new Error("Child state '"+e+"' does not exist on '"+this.id+"'");return t},e.prototype.getStateNodeById=function(e){var t=Ye(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#"+t+"' does not exist on machine '"+this.id+"'");return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&Ye(e))try{return this.getStateNodeById(e.slice(1))}catch(i){}for(var t=p(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||He;switch(this.type){case"parallel":return g(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):He}));case"compound":if(O(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return c(e).length?g(e,(function(e,t){return e?n.getStateNode(t).resolve(e):He})):this.initialStateValue||{};default:return e||He}},e.prototype.getResolvedPath=function(e){if(Ye(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '"+e+"'");return t.path}return p(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=y(this.states,(function(e){return e.initialStateValue||He}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '"+this.initial+"' not found on '"+this.key+"'");t=_e(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,void 0,t)},Object.defineProperty(e.prototype,"initialState",{get:function(){this._init();var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '"+this.id+"'.");return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=O(t.target)&&Ye(t.target)?v(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return _e(this)?[this]:"compound"!==this.type||this.initial?x(b(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):[this]},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=a(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '"+n+"' from node with no states");var i=this.getStateNode(n);if("history"===i.type)return i.resolveHistory();if(!this.states[n])throw new Error("Child state '"+n+"' does not exist on '"+this.id+"'");return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(c(this.states).length)return{current:e||this.initialStateValue,states:y(this.states,(function(t,n){if(!e)return t.historyValue();var r=O(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?x(b(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var i,a,s=(i=n.path,a="states",function(e){var t,n,r=e;try{for(var s=o(i),l=s.next();!l.done;l=s.next()){var u=l.value;r=r[a][u]}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return r})(e).current;return O(s)?[n.getStateNode(s)]:x(b(s).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=x(c(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var s=o(c(i)),l=s.next();!l.done;l=s.next()){var u=i[l.value];if(u.states)try{for(var d=(n=void 0,o(u.events)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add(""+p)}}catch(h){n={error:h}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}}catch(v){e={error:v}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!O(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(i){throw new Error("Invalid transition definition for state node '"+t.id+"':\n"+i.message)}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return E(e)}(e.target),i="internal"in e?e.internal:!n||n.some((function(e){return O(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,a=this.resolveTarget(n),s=r(r({},e),{actions:ue(E(e.actions)),cond:N(e.cond,o),target:a,source:this,internal:i,eventType:e.event,toJSON:function(){return r(r({},s),{target:s.target?s.target.map((function(e){return"#"+e.id})):void 0,source:"#"+t.id})}});return s},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var l=this.config.on,u=qe,d=l[u],f=void 0===d?[]:d,p=i(l,["*"]);n=x(c(p).map((function(e){var t=F(e,p[e]);return t})).concat(F(qe,f)))}else n=[];var h=this.config.always?F("",this.config.always):[],v=this.config.onDone?F(String(we(this.id)),this.config.onDone):[];var g=x(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,s([],a(F(String(Ee(e.id)),e.onDone)))),e.onError&&t.push.apply(t,s([],a(F(String(ke(e.id)),e.onError)))),t}))),y=this.after,m=x(s(s(s(s([],a(v)),a(g)),a(n)),a(h)).map((function(e){return E(e).map((function(e){return r.formatTransition(e)}))})));try{for(var b=o(y),w=b.next();!w.done;w=b.next()){var k=w.value;m.push(k)}}catch(S){e={error:S}}finally{try{w&&!w.done&&(t=b.return)&&t.call(b)}finally{if(e)throw e.error}}return m},e}();function Ke(e,t,n){return void 0===n&&(n=e.context),new Xe(e,t,n)}function Qe(e,t){return new Xe(e,t)}var $e={deferEvents:!1},Ze=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=r(r({},$e),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}(),Je=new Map,et=0,tt=function(){return"x:"+et++},nt=function(e,t){return Je.set(e,t),e},rt=function(e){return Je.get(e)},it=function(e){Je.delete(e)};function ot(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}function at(e){if(ot()){var t=function(){var e=ot();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function st(e,t){void 0===t&&(t={});var n,i=e.initialState,o=new Set,a=[],s=!1,l=(n={id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();i=e.transition(i,t,u),o.forEach((function(e){return e.next(i)}))}s=!1}}()},getSnapshot:function(){return i},subscribe:function(e,t,n){var r=U(e,t,n);return o.add(r),r.next(i),{unsubscribe:function(){o.delete(r)}}}},r({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},n)),u={parent:t.parent,self:l,id:t.id||"anonymous",observers:o};return i=e.start?e.start(u):i,l}var lt,ut={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(lt||(lt={}));var ct=function(){function e(t,n){var i=this;void 0===n&&(n=e.defaultOptions),this.machine=t,this.scheduler=new Ze,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=lt.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(e,t){if(T(e))return i.batch(e),i.state;var n=R(z(e,t));if(i.status===lt.Stopped)return i.state;if(i.status!==lt.Running&&!i.options.deferEvents)throw new Error('Event "'+n.name+'" was sent to uninitialized service "'+i.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: '+JSON.stringify(n.data));return i.scheduler.schedule((function(){i.forward(n);var e=i.nextState(n);i.update(e,n)})),i._state},this.sendTo=function(e,t){var n,o=i.parent&&(t===I.Parent||i.parent.id===t),a=o?i.parent:O(t)?i.children.get(t)||rt(t):(n=t)&&"function"==typeof n.send?t:void 0;if(a)"machine"in a?a.send(r(r({},e),{name:e.name===ne?""+ke(i.id):e.name,origin:i.sessionId})):a.send(e.data);else if(!o)throw new Error("Unable to send event to child '"+t+"' from service '"+i.id+"'.")};var o=r(r({},e.defaultOptions),n),a=o.clock,s=o.logger,l=o.parent,u=o.id,c=void 0!==u?u:t.id;this.id=c,this.logger=s,this.clock=a,this.parent=l,this.options=o,this.scheduler=new Ze({deferEvents:this.options.deferEvents}),this.sessionId=tt()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Re(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=o(e.actions),a=i.next();!a.done;a=i.next()){var s=a.value;this.exec(s,e,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,s,l,u,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.options.execute&&this.execute(this.state),this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var f=o(this.eventListeners),p=f.next();!p.done;p=f.next()){(0,p.value)(e.event)}}catch(S){n={error:S}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var h=o(this.listeners),v=h.next();!v.done;v=h.next()){(0,v.value)(e,e.event)}}catch(P){i={error:P}}finally{try{v&&!v.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}try{for(var g=o(this.contextListeners),y=g.next();!y.done;y=g.next()){(0,y.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(_){s={error:_}}finally{try{y&&!y.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}var m=Le(e.configuration||[],this.machine);if(this.state.configuration&&m){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),x=b&&b.doneData?k(b.doneData,e.context,t):void 0;try{for(var w=o(this.doneListeners),E=w.next();!E.done;E=w.next()){(0,E.value)(Ee(this.id,x))}}catch(C){u={error:C}}finally{try{E&&!E.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}this.stop()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===lt.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r,i=this;if(!e)return{unsubscribe:function(){}};var o=n;return"function"==typeof e?r=e:(r=e.next.bind(e),o=e.complete.bind(e)),this.listeners.add(r),this.status===lt.Running&&r(this.state),o&&this.onDone(o),{unsubscribe:function(){r&&i.listeners.delete(r),o&&i.doneListeners.delete(o)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===lt.Running)return this;nt(this.sessionId,this),this.initialized=!0,this.status=lt.Running;var n=void 0===e?this.initialState:Re(this,(function(){return!O(n=e)&&"value"in n&&"history"in n?t.machine.resolveState(e):t.machine.resolveState(Be.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,ae)})),this},e.prototype.stop=function(){var e,t,n,r,i,a,s,l,u,d,f=this;try{for(var p=o(this.listeners),h=p.next();!h.done;h=p.next()){var v=h.value;this.listeners.delete(v)}}catch(P){e={error:P}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}try{for(var g=o(this.stopListeners),y=g.next();!y.done;y=g.next()){(v=y.value)(),this.stopListeners.delete(v)}}catch(_){n={error:_}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}try{for(var m=o(this.contextListeners),b=m.next();!b.done;b=m.next()){v=b.value;this.contextListeners.delete(v)}}catch(C){i={error:C}}finally{try{b&&!b.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var x=o(this.doneListeners),w=x.next();!w.done;w=x.next()){v=w.value;this.doneListeners.delete(v)}}catch(j){s={error:j}}finally{try{w&&!w.done&&(l=x.return)&&l.call(x)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.state.configuration.forEach((function(e){var t,n;try{for(var r=o(e.definition.exit),i=r.next();!i.done;i=r.next()){var a=i.value;f.exec(a,f.state)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}})),this.children.forEach((function(e){D(e.stop)&&e.stop()}));try{for(var E=o(c(this.delayedEventsMap)),k=E.next();!k.done;k=E.next()){var S=k.value;this.clock.clearTimeout(this.delayedEventsMap[S])}}catch(T){u={error:T}}finally{try{k&&!k.done&&(d=E.return)&&d.call(E)}finally{if(u)throw u.error}}return this.scheduler.clear(),this.initialized=!1,this.status=lt.Stopped,it(this.sessionId),this},e.prototype.batch=function(e){var t=this;if(this.status===lt.NotStarted&&this.options.deferEvents)0;else if(this.status!==lt.Running)throw new Error(e.length+' event(s) were sent to uninitialized service "'+this.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.');this.scheduler.schedule((function(){var n,i,l=t.state,u=!1,c=[],d=function(e){var n=R(e);t.forward(n),l=Re(t,(function(){return t.machine.transition(l,n)})),c.push.apply(c,s([],a(l.actions.map((function(e){return n=l,i=(t=e).exec,r(r({},t),{exec:void 0!==i?function(){return i(n.context,n.event,{action:t,state:n,_event:n._event})}:void 0});var t,n,i}))))),u=u||!!l.changed};try{for(var f=o(e),p=f.next();!p.done;p=f.next()){d(p.value)}}catch(h){n={error:h}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}l.changed=u,l.actions=c,t.update(l,R(e[e.length-1]))}))},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype.nextState=function(e){var t=this,n=R(e);if(0===n.name.indexOf(te)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(te)})))throw n.data.data;return Re(this,(function(){return t.machine.transition(t.state,n)}))},e.prototype.forward=function(e){var t,n;try{for(var r=o(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '"+e+"' from interpreter '"+this.id+"' to nonexistant child '"+a+"'.");s.send(e)}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions);var r=t.context,i=t._event,o=e.exec||se(e.type,n),a=D(o)?o:o?o.exec:e.exec;if(a)try{return a(r,i.data,{action:e,state:this.state,_event:i})}catch(b){throw this.parent&&this.parent.send({type:"xstate.error",data:b}),b}switch(e.type){case X:var s=e;if("number"==typeof s.delay)return void this.defer(s);s.to?this.sendTo(s._event,s.to):this.send(s._event);break;case K:this.cancel(e.sendId);break;case q:var l=e.activity;if(!this.state.activities[l.id||l.type])break;if(l.type===A.Invoke){var u=G(l.src),c=this.machine.options.services?this.machine.options.services[u.type]:void 0,d=l.id,f=l.data;0;var p="autoForward"in l?l.autoForward:!!l.forward;if(!c)return void 0;var h=f?k(f,r,i):void 0;if("string"==typeof c)return;var v=D(c)?c(r,i.data,{data:h,src:u,meta:l.meta}):c;if(!v)return;var g=void 0;L(v)&&(v=h?v.withContext(h):v,g={autoForward:p}),this.spawn(v,d,g)}else this.spawnActivity(l);break;case H:this.stopChild(e.activity.id);break;case Z:var y=e.label,m=e.value;y?this.logger(y,m):this.logger(m)}},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),D(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(S(e))return this.spawnPromise(Promise.resolve(e),t);if(D(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(t){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&D(e.subscribe)}catch(t){return!1}}(e))return this.spawnObservable(e,t);if(L(e))return this.spawnMachine(e,r(r({},n),{id:t}));if(null!==(i=e)&&"object"==typeof i&&"transition"in i&&"function"==typeof i.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'+t+'" of type "'+typeof e+'".');var i,o},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var o=new e(t,r(r({},this.options),{parent:this,id:n.id||t.id})),a=r(r({},ut),n);a.sync&&o.onTransition((function(e){i.send(re,{state:e,id:o.id})}));var s=o;return this.children.set(o.id,s),a.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){i.removeChild(o.id),i.send(R(e,{origin:o.id}))})).start(),s},e.prototype.spawnBehavior=function(e,t){var n=st(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r=this,i=!1;e.then((function(e){i||(n=e,r.removeChild(t),r.send(R(Ee(t,e),{origin:t})))}),(function(e){if(!i){r.removeChild(t);var n=ke(t,e);try{r.send(R(n,{origin:t}))}catch(ne){r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}}));var o={id:t,send:function(){},subscribe:function(t,n,r){var i=U(t,n,r),o=!1;return e.then((function(e){o||(i.next(e),o||i.complete())}),(function(e){o||i.error(e)})),{unsubscribe:function(){return o=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return n}};return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r,i=this,o=!1,a=new Set,s=new Set;try{r=e((function(e){n=e,s.forEach((function(t){return t(e)})),o||i.send(R(e,{origin:t}))}),(function(e){a.add(e)}))}catch(u){this.send(ke(t,u))}if(S(r))return this.spawnPromise(r,t);var l={id:t,send:function(e){return a.forEach((function(t){return t(e)}))},subscribe:function(e){return s.add(e),{unsubscribe:function(){s.delete(e)}}},stop:function(){o=!0,D(r)&&r()},toJSON:function(){return{id:t}},getSnapshot:function(){return n}};return this.children.set(t,l),l},e.prototype.spawnObservable=function(e,t){var n,r=this,i=e.subscribe((function(e){n=e,r.send(R(e,{origin:t}))}),(function(e){r.removeChild(t),r.send(R(ke(t,e),{origin:t}))}),(function(){r.removeChild(t),r.send(R(Ee(t),{origin:t}))})),o={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:t}}};return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}},e.prototype.spawnEffect=function(e,t){this.children.set(e,{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})},e.prototype.attachDev=function(){var e=ot();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(r(r({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:r({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}at(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[M]=function(){return this},e.prototype.getSnapshot=function(){return this.status===lt.NotStarted?this.initialState:this._state},e.defaultOptions=function(e){return{execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:e.console.log.bind(console),devTools:!1}}("undefined"!=typeof self?self:global),e.interpret=ft,e}();function dt(e,t){var n=function(e){return O(e)?r(r({},ut),{name:e}):r(r(r({},ut),{name:B()}),e)}(t);return function(t){return t?t.spawn(e,n.name,n):Ve(e,n.name)}(ze[ze.length-1])}function ft(e,t){return new ct(e,t)}function pt(e,t,n){var r,i,s=Be.from(e,e instanceof Be?e.context:void 0);try{for(var l=o(t),u=l.next();!u.done;u=l.next()){var c=a(u.value,2),d=c[0],f=c[1];if(s.matches(d))return f(s)}}catch(p){r={error:p}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return n(s)}function ht(e){return e}var vt={raise:de,send:fe,sendParent:pe,sendUpdate:he,log:function(e,t){return void 0===e&&(e=ve),{type:Z,label:t,expr:e}},cancel:ge,start:ye,stop:me,assign:be,after:xe,done:we,respond:function(e,t){return fe(e,r(r({},t),{to:function(e,t,n){return n._event.origin}}))},forwardTo:Se,escalate:function(e,t){return pe((function(t,n,r){return{type:ne,data:D(e)?e(t,n,r):e}}),r(r({},t),{to:I.Parent}))},choose:function(e){return{type:A.Choose,conds:e}},pure:function(e){return{type:A.Pure,get:e}}}},aora:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("VQ03"),i=n("4K4U"),o=n("IW9A");function a(e){return{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}}}function s(e,t,n){var r=a(t);if(r.deferred=!0,i.isMachine(e)){var s=r.state=o.provide(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function l(e){try{return"function"==typeof e.send}catch(t){return!1}}t.createDeferredActor=s,t.createInvocableActor=function(e,t,n,r){var o,l=i.toInvokeSource(e.src),u=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[l.type],c=e.data?i.mapContext(e.data,n,r):void 0,d=u?s(u,e.id,c):a(e.id);return d.meta=e,d},t.createNullActor=a,t.isActor=l,t.isSpawnedActor=function(e){return l(e)&&"id"in e},t.toActorRef=function(e){return r.__assign({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e)}},VQ03:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.__assign.apply(this,arguments)},t.__read=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},t.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},t.__spreadArray=function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},t.__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}},Oshl:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("vMs3"),i=r.ActionTypes.Start,o=r.ActionTypes.Stop,a=r.ActionTypes.Raise,s=r.ActionTypes.Send,l=r.ActionTypes.Cancel,u=r.ActionTypes.NullEvent,c=r.ActionTypes.Assign,d=r.ActionTypes.After,f=r.ActionTypes.DoneState,p=r.ActionTypes.Log,h=r.ActionTypes.Init,v=r.ActionTypes.Invoke,g=r.ActionTypes.ErrorExecution,y=r.ActionTypes.ErrorPlatform,m=r.ActionTypes.ErrorCustom,b=r.ActionTypes.Update,x=r.ActionTypes.Choose,w=r.ActionTypes.Pure;t.after=d,t.assign=c,t.cancel=l,t.choose=x,t.doneState=f,t.error=m,t.errorExecution=g,t.errorPlatform=y,t.init=h,t.invoke=v,t.log=p,t.nullEvent=u,t.pure=w,t.raise=a,t.send=s,t.start=i,t.stop=o,t.update=b},Mgrw:(e,t,n)=>{"use strict";n("JMJn");var r=n("4K4U");n("vMs3"),n("Oshl");var i=n("aora")},XmYR:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DEFAULT_GUARD_TYPE="xstate.guard",t.EMPTY_ACTIVITY_MAP={},t.STATE_DELIMITER=".",t.TARGETLESS_KEY=""},JMJn:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IS_PRODUCTION=!0},IW9A:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=[];t.consume=function(e){return e(n[n.length-1])},t.provide=function(e,t){n.push(e);var r=t(e);return n.pop(),r}},vMs3:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.ActionTypes||(t.ActionTypes={})).Start="xstate.start",n.Stop="xstate.stop",n.Raise="xstate.raise",n.Send="xstate.send",n.Cancel="xstate.cancel",n.NullEvent="",n.Assign="xstate.assign",n.After="xstate.after",n.DoneState="done.state",n.DoneInvoke="done.invoke",n.Log="xstate.log",n.Init="xstate.init",n.Invoke="xstate.invoke",n.ErrorExecution="error.execution",n.ErrorCommunication="error.communication",n.ErrorPlatform="error.platform",n.ErrorCustom="xstate.error",n.Update="xstate.update",n.Pure="xstate.pure",n.Choose="xstate.choose",(r=t.SpecialTargets||(t.SpecialTargets={})).Parent="#_parent",r.Internal="#_internal"},"4K4U":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("VQ03"),i=n("XmYR"),o=n("JMJn");function a(e){return Object.keys(e)}function s(e,t){try{return g(e)?e:e.toString().split(t)}catch(n){throw new Error("'"+e+"' is not a valid state path.")}}function l(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function u(e,t){return l(e)?e.value:g(e)?c(e):"string"!=typeof e?e:c(s(e,t))}function c(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function d(e,t){for(var n={},r=a(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function f(e){var t;return(t=[]).concat.apply(t,r.__spreadArray([],r.__read(e)))}function p(e){return g(e)?e:[e]}function h(e){return void 0===e?[]:p(e)}function v(e,t){return d(e.states,(function(e,n){if(e){var r=(m(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:v(e,r)}}}))}function g(e){return Array.isArray(e)}function y(e){return"function"==typeof e}function m(e){return"string"==typeof e}t.warn=function(){},o.IS_PRODUCTION||(t.warn=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: "+t];n&&r.push(n),console.warn.apply(console,r)}});var b=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function x(e){try{return"__xstatenode"in e}catch(t){return!1}}var w=function(){var e=0;return function(){return(++e).toString(16)}}();function E(e,t){return m(e)||"number"==typeof e?r.__assign({type:e},t):e}t.evaluateGuard=function(e,t,n,r,o){var a=e.options.guards,s={state:o,cond:t,_event:r};if(t.type===i.DEFAULT_GUARD_TYPE)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var l=a[t.type];if(!l)throw new Error("Guard '"+t.type+"' is not implemented on machine '"+e.id+"'.");return l(n,r.data,s)},t.flatten=f,t.getEventType=function(e){try{return m(e)||"number"==typeof e?""+e:e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}},t.isActor=function(e){return!!e&&"function"==typeof e.send},t.isArray=g,t.isBehavior=function(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition},t.isBuiltInEvent=function(e){return/^(done|error)\./.test(e)},t.isFunction=y,t.isMachine=x,t.isObservable=function(e){try{return"subscribe"in e&&y(e.subscribe)}catch(t){return!1}},t.isPromiseLike=function(e){return e instanceof Promise||!(null===e||!y(e)&&"object"!=typeof e||!y(e.then))},t.isStateLike=l,t.isString=m,t.keys=a,t.mapContext=function(e,t,n){var i,o;if(y(e))return e(t,n.data);var a={};try{for(var s=r.__values(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];y(c)?a[u]=c(t,n.data):a[u]=c}}catch(d){i={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a},t.mapFilterValues=function(e,t,n){var i,o,s={};try{for(var l=r.__values(a(e)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e[c];n(d)&&(s[c]=t(d,c,e))}}catch(f){i={error:f}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return s},t.mapValues=d,t.matchesState=function e(t,n,r){void 0===r&&(r=i.STATE_DELIMITER);var o=u(t,r),s=u(n,r);return m(s)?!!m(o)&&s===o:m(o)?o in s:a(o).every((function(t){return t in s&&e(o[t],s[t])}))},t.nestedPath=function(e,t){return function(n){var i,o,a=n;try{for(var s=r.__values(e),l=s.next();!l.done;l=s.next()){var u=l.value;a=a[t][u]}}catch(c){i={error:c}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}},t.normalizeTarget=function(e){if(void 0!==e&&e!==i.TARGETLESS_KEY)return h(e)},t.partition=function(e,t){var n,i,o=r.__read([[],[]],2),a=o[0],s=o[1];try{for(var l=r.__values(e),u=l.next();!u.done;u=l.next()){var c=u.value;t(c)?a.push(c):s.push(c)}}catch(d){n={error:d}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return[a,s]},t.path=function(e){return function(t){var n,i,o=t;try{for(var a=r.__values(e),s=a.next();!s.done;s=a.next()){o=o[s.value]}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}},t.pathToStateValue=c,t.reportUnhandledExceptionOnInvocation=function(e,t,n){if(!o.IS_PRODUCTION){var r=e.stack?" Stacktrace was '"+e.stack+"'":"";if(e===t)console.error("Missing onError handler for invocation '"+n+"', error was '"+e+"'."+r);else{var i=t.stack?" Stacktrace was '"+t.stack+"'":"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '"+n+"'. Original error: '"+e+"'. "+r+" Current error is '"+t+"'."+i)}}},t.symbolObservable=b,t.toArray=h,t.toArrayStrict=p,t.toEventObject=E,t.toGuard=function(e,t){if(e)return m(e)?{type:i.DEFAULT_GUARD_TYPE,name:e,predicate:t?t[e]:void 0}:y(e)?{type:i.DEFAULT_GUARD_TYPE,name:e.name,predicate:e}:e},t.toInvokeSource=function(e){return"string"==typeof e?{type:e}:e},t.toObserver=function(e,t,n){if("object"==typeof e)return e;var r=function(){};return{next:e,error:t||r,complete:n||r}},t.toSCXMLEvent=function(e,t){if(!m(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=E(e);return r.__assign({name:n.type,data:n,$$type:"scxml",type:"external"},t)},t.toStatePath=s,t.toStatePaths=function e(t){return t?m(t)?[[t]]:f(a(t).map((function(n){var r=t[n];return"string"==typeof r||r&&Object.keys(r).length?e(t[n]).map((function(e){return[n].concat(e)})):[[n]]}))):[[]]},t.toStateValue=u,t.toTransitionConfigArray=function(e,t){return p(t).map((function(t){return void 0===t||"string"==typeof t||x(t)?{target:t,event:e}:r.__assign(r.__assign({},t),{event:e})}))},t.uniqueId=w,t.updateContext=function(e,n,i,s){return o.IS_PRODUCTION||t.warn(!!e,"Attempting to update undefined context"),e?i.reduce((function(e,t){var i,o,l=t.assignment,u={state:s,action:t,_event:n},c={};if(y(l))c=l(e,n.data,u);else try{for(var d=r.__values(a(l)),f=d.next();!f.done;f=d.next()){var p=f.value,h=l[p];c[p]=y(h)?h(e,n.data,u):h}}catch(v){i={error:v}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}return Object.assign({},e,c)}),e):e},t.updateHistoryStates=v,t.updateHistoryValue=function(e,t){return{current:t,states:v(e,t)}}}},e=>{var t;t="0K9E",e(e.s=t)}]);
2
+ (self.webpackChunk=self.webpackChunk||[]).push([[179],{ibCq:(e,t,n)=>{"use strict";var r=n("wwsc"),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=n("IXFX"),a=n("4K4U"),s=n("QzV0"),u=n.n(s);function l(e){return"function"==typeof e?e():e}function c(e){try{return JSON.stringify(e)}catch(Rt){return u()(e)}}var d=new Map;var f={url:"https://statecharts.io/inspect",iframe:function(){return document.querySelector("iframe[data-xstate]")},devTools:function(){var e,t,n=(e=new Set,t=new Set,{services:e,register:function(n){e.add(n),d.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),d.delete(n.sessionId)}))},unregister:function(t){e.delete(t),d.delete(t.sessionId)},onRegister:function(n){return t.add(n),e.forEach((function(e){return n(e)})),{unsubscribe:function(){t.delete(n)}}}});return globalThis.__xstate__=n,n}};var h="top",p="bottom",v="right",g="left",y="auto",m=[h,p,v,g],b="start",x="end",w="viewport",_="popper",E=m.reduce((function(e,t){return e.concat([t+"-"+b,t+"-"+x])}),[]),k=[].concat(m,[y]).reduce((function(e,t){return e.concat([t,t+"-"+b,t+"-"+x])}),[]),S=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function j(e){return e instanceof C(e).Element||e instanceof Element}function D(e){return e instanceof C(e).HTMLElement||e instanceof HTMLElement}function O(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}const T={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];D(i)&&P(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});D(r)&&P(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function N(e){return e.split("-")[0]}var A=Math.max,M=Math.min,B=Math.round;function L(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(D(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=B(n.width)/a||1),o>0&&(i=B(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function I(e){var t=L(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function R(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&O(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function z(e){return C(e).getComputedStyle(e)}function F(e){return["table","td","th"].indexOf(P(e))>=0}function V(e){return((j(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return"html"===P(e)?e:e.assignedSlot||e.parentNode||(O(e)?e.host:null)||V(e)}function Y(e){return D(e)&&"fixed"!==z(e).position?e.offsetParent:null}function q(e){for(var t=C(e),n=Y(e);n&&F(n)&&"static"===z(n).position;)n=Y(n);return n&&("html"===P(n)||"body"===P(n)&&"static"===z(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&D(e)&&"fixed"===z(e).position)return null;for(var n=G(e);D(n)&&["html","body"].indexOf(P(n))<0;){var r=z(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function W(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function H(e,t,n){return A(e,M(t,n))}function U(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const K={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=N(n.placement),u=W(s),l=[g,v].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return U("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,m))}(i.padding,n),d=I(o),f="y"===u?h:g,y="y"===u?p:v,b=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],x=a[u]-n.rects.reference[u],w=q(o),_=w?"y"===u?w.clientHeight||0:w.clientWidth||0:0,E=b/2-x/2,k=c[f],S=_-d[l]-c[y],P=_/2-d[l]/2+E,C=H(k,P,S),j=u;n.modifiersData[r]=((t={})[j]=C,t.centerOffset=C-P,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&R(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:B(t*r)/r||0,y:B(n*r)/r||0}}(a):"function"==typeof c?c(a):a,y=f.x,m=void 0===y?0:y,b=f.y,w=void 0===b?0:b,_=a.hasOwnProperty("x"),E=a.hasOwnProperty("y"),k=g,S=h,P=window;if(l){var j=q(n),D="clientHeight",O="clientWidth";if(j===C(n)&&"static"!==z(j=V(n)).position&&"absolute"===s&&(D="scrollHeight",O="scrollWidth"),j=j,i===h||(i===g||i===v)&&o===x)S=p,w-=(d&&P.visualViewport?P.visualViewport.height:j[D])-r.height,w*=u?1:-1;if(i===g||(i===h||i===p)&&o===x)k=v,m-=(d&&P.visualViewport?P.visualViewport.width:j[O])-r.width,m*=u?1:-1}var T,N=Object.assign({position:s},l&&Z);return u?Object.assign({},N,((T={})[S]=E?"0":"",T[k]=_?"0":"",T.transform=(P.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",T)):Object.assign({},N,((t={})[S]=E?w+"px":"",t[k]=_?m+"px":"",t.transform="",t))}const $={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,u=void 0===s||s,l={placement:N(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ee={passive:!0};const te={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,u=C(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",n.update,ee)})),s&&u.addEventListener("resize",n.update,ee),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",n.update,ee)})),s&&u.removeEventListener("resize",n.update,ee)}},data:{}};var ne={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ne[e]}))}var ie={start:"end",end:"start"};function oe(e){return e.replace(/start|end/g,(function(e){return ie[e]}))}function ae(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function se(e){return L(V(e)).left+ae(e).scrollLeft}function ue(e){var t=z(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function le(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:D(e)&&ue(e)?e:le(G(e))}function ce(e,t){var n;void 0===t&&(t=[]);var r=le(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=C(r),a=i?[o].concat(o.visualViewport||[],ue(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(ce(G(a)))}function de(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fe(e,t){return t===w?de(function(e){var t=C(e),n=V(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+se(e),y:s}}(e)):j(t)?function(e){var t=L(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):de(function(e){var t,n=V(e),r=ae(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=A(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=A(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+se(e),u=-r.scrollTop;return"rtl"===z(i||n).direction&&(s+=A(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(V(e)))}function he(e,t,n){var r="clippingParents"===t?function(e){var t=ce(G(e)),n=["absolute","fixed"].indexOf(z(e).position)>=0,r=n&&D(e)?q(e):e;return j(r)?t.filter((function(e){return j(e)&&R(e,r)&&"body"!==P(e)&&(!n||"static"!==z(e).position)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=fe(e,n);return t.top=A(r.top,t.top),t.right=M(r.right,t.right),t.bottom=M(r.bottom,t.bottom),t.left=A(r.left,t.left),t}),fe(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function pe(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?N(i):null,a=i?Q(i):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(o){case h:t={x:s,y:n.y-r.height};break;case p:t={x:s,y:n.y+n.height};break;case v:t={x:n.x+n.width,y:u};break;case g:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=o?W(o):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case b:t[l]=t[l]-(n[c]/2-r[c]/2);break;case x:t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}function ve(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,u=void 0===s?w:s,l=n.elementContext,c=void 0===l?_:l,d=n.altBoundary,f=void 0!==d&&d,g=n.padding,y=void 0===g?0:g,b=U("number"!=typeof y?y:X(y,m)),x=c===_?"reference":_,E=e.rects.popper,k=e.elements[f?x:c],S=he(j(k)?k:k.contextElement||V(e.elements.popper),a,u),P=L(e.elements.reference),C=pe({reference:P,element:E,strategy:"absolute",placement:i}),D=de(Object.assign({},E,C)),O=c===_?D:P,T={top:S.top-O.top+b.top,bottom:O.bottom-S.bottom+b.bottom,left:S.left-O.left+b.left,right:O.right-S.right+b.right},N=e.modifiersData.offset;if(c===_&&N){var A=N[i];Object.keys(T).forEach((function(e){var t=[v,p].indexOf(e)>=0?1:-1,n=[h,p].indexOf(e)>=0?"y":"x";T[e]+=A[n]*t}))}return T}const ge={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,l=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,x=n.flipVariations,w=void 0===x||x,_=n.allowedAutoPlacements,S=t.options.placement,P=N(S),C=u||(P===S||!w?[re(S)]:function(e){if(N(e)===y)return[];var t=re(e);return[oe(e),t,oe(t)]}(S)),j=[S].concat(C).reduce((function(e,n){return e.concat(N(n)===y?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=void 0===u?k:u,c=Q(r),d=c?s?E:E.filter((function(e){return Q(e)===c})):m,f=d.filter((function(e){return l.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=ve(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[N(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:c,rootBoundary:d,padding:l,flipVariations:w,allowedAutoPlacements:_}):n)}),[]),D=t.rects.reference,O=t.rects.popper,T=new Map,A=!0,M=j[0],B=0;B<j.length;B++){var L=j[B],I=N(L),R=Q(L)===b,z=[h,p].indexOf(I)>=0,F=z?"width":"height",V=ve(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:f,padding:l}),G=z?R?v:g:R?p:h;D[F]>O[F]&&(G=re(G));var Y=re(G),q=[];if(o&&q.push(V[I]<=0),s&&q.push(V[G]<=0,V[Y]<=0),q.every((function(e){return e}))){M=L,A=!1;break}T.set(L,q)}if(A)for(var W=function(e){var t=j.find((function(t){var n=T.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},H=w?3:1;H>0;H--){if("break"===W(H))break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[h,v,p,g].some((function(t){return e[t]>=0}))}const be={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ve(t,{elementContext:"reference"}),s=ve(t,{altBoundary:!0}),u=ye(a,r),l=ye(s,i,o),c=me(u),d=me(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};const xe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=k.reduce((function(e,n){return e[n]=function(e,t,n){var r=N(e),i=[g,h].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[g,v].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],u=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}};const we={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=pe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const _e={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,l=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,y=void 0===f||f,m=n.tetherOffset,x=void 0===m?0:m,w=ve(t,{boundary:u,rootBoundary:l,padding:d,altBoundary:c}),_=N(t.placement),E=Q(t.placement),k=!E,S=W(_),P="x"===S?"y":"x",C=t.modifiersData.popperOffsets,j=t.rects.reference,D=t.rects.popper,O="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,T="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(C){if(o){var R,z="y"===S?h:g,F="y"===S?p:v,V="y"===S?"height":"width",G=C[S],Y=G+w[z],U=G-w[F],X=y?-D[V]/2:0,K=E===b?j[V]:D[V],Z=E===b?-D[V]:-j[V],J=t.elements.arrow,$=y&&J?I(J):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[z],ne=ee[F],re=H(0,j[V],$[V]),ie=k?j[V]/2-X-re-te-T.mainAxis:K-re-te-T.mainAxis,oe=k?-j[V]/2+X+re+ne+T.mainAxis:Z+re+ne+T.mainAxis,ae=t.elements.arrow&&q(t.elements.arrow),se=ae?"y"===S?ae.clientTop||0:ae.clientLeft||0:0,ue=null!=(R=null==B?void 0:B[S])?R:0,le=G+oe-ue,ce=H(y?M(Y,G+ie-ue-se):Y,G,y?A(U,le):U);C[S]=ce,L[S]=ce-G}if(s){var de,fe="x"===S?h:g,he="x"===S?p:v,pe=C[P],ge="y"===P?"height":"width",ye=pe+w[fe],me=pe-w[he],be=-1!==[h,g].indexOf(_),xe=null!=(de=null==B?void 0:B[P])?de:0,we=be?ye:pe-j[ge]-D[ge]-xe+T.altAxis,_e=be?pe+j[ge]+D[ge]-xe-T.altAxis:me,Ee=y&&be?function(e,t,n){var r=H(e,t,n);return r>n?n:r}(we,pe,_e):H(y?we:ye,pe,y?_e:me);C[P]=Ee,L[P]=Ee-pe}t.modifiersData[r]=L}},requiresIfExists:["offset"]};function Ee(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=B(t.width)/e.offsetWidth||1,r=B(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=V(t),u=L(e,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==P(t)||ue(s))&&(l=(r=t)!==C(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ae(r)),D(t)?((c=L(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=se(s))),{x:u.left+l.scrollLeft-c.x,y:u.top+l.scrollTop-c.y,width:u.width,height:u.height}}function ke(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Se={placement:"bottom",modifiers:[],strategy:"absolute"};function Pe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Ce(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Se:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Se,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],l=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:j(e)?ce(e):e.contextElement?ce(e.contextElement):[],popper:ce(t)};var a=function(e){var t=ke(e);return S.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r}),a=function(){};u.push(o||a)}})),c.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,n=e.popper;if(Pe(t,n)){s.rects={reference:Ee(t,q(n),"fixed"===s.options.strategy),popper:I(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,u=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:u,name:d,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),l=!0}};if(!Pe(e,t))return c;function d(){u.forEach((function(e){return e()})),u=[]}return c.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var je=Ce({defaultModifiers:[te,we,$,T,xe,ge,_e,K,be]}),De="tippy-content",Oe="tippy-backdrop",Te="tippy-arrow",Ne="tippy-svg-arrow",Ae={passive:!0,capture:!0},Me=function(){return document.body};function Be(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Le(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Ie(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Re(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function ze(e){return[].concat(e)}function Fe(e,t){-1===e.indexOf(t)&&e.push(t)}function Ve(e){return e.split("-")[0]}function Ge(e){return[].slice.call(e)}function Ye(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function qe(){return document.createElement("div")}function We(e){return["Element","Fragment"].some((function(t){return Le(e,t)}))}function He(e){return Le(e,"MouseEvent")}function Ue(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Xe(e){return We(e)?[e]:function(e){return Le(e,"NodeList")}(e)?Ge(e):Array.isArray(e)?e:Ge(document.querySelectorAll(e))}function Ke(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Qe(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ze(e){var t,n=ze(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Je(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function $e(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var et={isTouch:!1},tt=0;function nt(){et.isTouch||(et.isTouch=!0,window.performance&&document.addEventListener("mousemove",rt))}function rt(){var e=performance.now();e-tt<20&&(et.isTouch=!1,document.removeEventListener("mousemove",rt)),tt=e}function it(){var e=document.activeElement;if(Ue(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var ot=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var at={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},st=Object.assign({appendTo:Me,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},at,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ut=Object.keys(st);function lt(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=st[i])?r:o);return t}),{});return Object.assign({},e,t)}function ct(e,t){var n=Object.assign({},t,{content:Ie(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(lt(Object.assign({},st,{plugins:t}))):ut).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(Rt){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},st.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function dt(e,t){e.innerHTML=t}function ft(e){var t=qe();return!0===e?t.className=Te:(t.className=Ne,We(e)?t.appendChild(e):dt(t,e)),t}function ht(e,t){We(t.content)?(dt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?dt(e,t.content):e.textContent=t.content)}function pt(e){var t=e.firstElementChild,n=Ge(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(De)})),arrow:n.find((function(e){return e.classList.contains(Te)||e.classList.contains(Ne)})),backdrop:n.find((function(e){return e.classList.contains(Oe)}))}}function vt(e){var t=qe(),n=qe();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=qe();function i(n,r){var i=pt(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||ht(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(ft(r.arrow))):o.appendChild(ft(r.arrow)):s&&o.removeChild(s)}return r.className=De,r.setAttribute("data-state","hidden"),ht(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}vt.$$tippy=!0;var gt=1,yt=[],mt=[];function bt(e,t){var n,r,i,o,a,s,u,l,c=ct(e,Object.assign({},st,lt(Ye(t)))),d=!1,f=!1,h=!1,p=!1,v=[],g=Re(U,c.interactiveDebounce),y=gt++,m=(l=c.plugins).filter((function(e,t){return l.indexOf(e)===t})),b={id:y,reference:e,popper:qe(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:m,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){0;if(b.state.isDestroyed)return;A("onBeforeUpdate",[b,t]),W();var n=b.props,r=ct(e,Object.assign({},n,Ye(t),{ignoreAttributes:!0}));b.props=r,q(),n.interactiveDebounce!==r.interactiveDebounce&&(L(),g=Re(U,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?ze(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");B(),N(),_&&_(n,r);b.popperInstance&&(Z(),$().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));A("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=et.isTouch&&!b.props.touch,i=Be(b.props.duration,0,st.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(A("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,C()&&(w.style.visibility="visible");N(),F(),b.state.isMounted||(w.style.transition="none");if(C()){var o=O(),a=o.box,u=o.content;Ke([a,u],0)}s=function(){var e;if(b.state.isVisible&&!p){if(p=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,C()&&b.props.animation){var t=O(),n=t.box,r=t.content;Ke([n,r],i),Qe([n,r],"visible")}M(),B(),Fe(mt,b),null==(e=b.popperInstance)||e.forceUpdate(),A("onMount",[b]),b.props.animation&&C()&&function(e,t){G(e,t)}(i,(function(){b.state.isShown=!0,A("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===Me||"parent"===t?n.parentNode:Ie(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,Z(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Be(b.props.duration,1,st.duration);if(e||t||n)return;if(A("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,p=!1,d=!1,C()&&(w.style.visibility="hidden");if(L(),V(),N(!0),C()){var i=O(),o=i.box,a=i.content;b.props.animation&&(Ke([o,a],r),Qe([o,a],"hidden"))}M(),B(),b.props.animation?C()&&function(e,t){G(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;D().addEventListener("mousemove",g),Fe(yt,g),g(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;J(),$().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);mt=mt.filter((function(e){return e!==b})),b.state.isMounted=!1,A("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),W(),delete e._tippy,b.state.isDestroyed=!0,A("onDestroy",[b])}};if(!c.render)return b;var x=c.render(b),w=x.popper,_=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var E=m.map((function(e){return e.fn(b)})),k=e.hasAttribute("aria-expanded");return q(),B(),N(),A("onCreate",[b]),c.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",g)})),b;function S(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function P(){return"hold"===S()[0]}function C(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return u||e}function D(){var e=j().parentNode;return e?Ze(e):document}function O(){return pt(w)}function T(e){return b.state.isMounted&&!b.state.isVisible||et.isTouch||o&&"focus"===o.type?0:Be(b.props.delay,e?0:1,st.delay)}function N(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function A(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function M(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;ze(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function B(){!k&&b.props.aria.expanded&&ze(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function L(){D().removeEventListener("mousemove",g),yt=yt.filter((function(e){return e!==g}))}function I(t){if(!et.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!$e(w,n)){if(ze(b.props.triggerTarget||e).some((function(e){return $e(e,n)}))){if(et.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else A("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),f=!0,setTimeout((function(){f=!1})),b.state.isMounted||V())}}}function R(){h=!0}function z(){h=!1}function F(){var e=D();e.addEventListener("mousedown",I,!0),e.addEventListener("touchend",I,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function V(){var e=D();e.removeEventListener("mousedown",I,!0),e.removeEventListener("touchend",I,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function G(e,t){var n=O().box;function r(e){e.target===n&&(Je(n,"remove",r),t())}if(0===e)return t();Je(n,"remove",a),Je(n,"add",r),a=r}function Y(t,n,r){void 0===r&&(r=!1),ze(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function q(){var e;P()&&(Y("touchstart",H,{passive:!0}),Y("touchend",X,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(Y(e,H),e){case"mouseenter":Y("mouseleave",X);break;case"focus":Y(ot?"focusout":"blur",K);break;case"focusin":Y("focusout",K)}}))}function W(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function H(e){var t,n=!1;if(b.state.isEnabled&&!Q(e)&&!f){var r="focus"===(null==(t=o)?void 0:t.type);o=e,u=e.currentTarget,B(),!b.state.isVisible&&He(e)&&yt.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||d)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function U(e){var t=e.target,n=j().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=$().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Ve(i.placement),s=i.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,d="left"===a?s.right.x:0,f=t.top-r+u>o,h=r-t.bottom-l>o,p=t.left-n+c>o,v=n-t.right-d>o;return f||h||p||v}))})(r,e)&&(L(),te(e))}}function X(e){Q(e)||b.props.trigger.indexOf("click")>=0&&d||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function K(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function Q(e){return!!et.isTouch&&P()!==e.type.indexOf("touch")>=0}function Z(){J();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,u=C()?pt(w).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=O().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},c];C()&&u&&d.push({name:"arrow",options:{element:u,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),b.popperInstance=je(l,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:d}))}function J(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function $(){return Ge(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&A("onTrigger",[b,e]),F();var t=T(!0),r=S(),i=r[0],o=r[1];et.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),A("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=T(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else V()}}function xt(e,t){void 0===t&&(t={});var n=st.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",nt,Ae),window.addEventListener("blur",it);var r=Object.assign({},t,{plugins:n}),i=Xe(e).reduce((function(e,t){var n=t&&bt(t,r);return n&&e.push(n),e}),[]);return We(e)?i[0]:i}xt.defaultProps=st,xt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){st[t]=e[t]}))},xt.currentInput=et;Object.assign({},T,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});xt.setDefaultProps({render:vt});const wt=xt;function _t(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Et="undefined"!=typeof window&&"undefined"!=typeof document;function kt(e,t){e&&("function"==typeof e&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function St(){return Et&&document.createElement("div")}function Pt(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e){if(!t.hasOwnProperty(n))return!1;if(!Pt(e[n],t[n]))return!1}return!0}return!1}function Ct(e){var t=[];return e.forEach((function(e){t.find((function(t){return Pt(e,t)}))||t.push(e)})),t}function jt(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Ct([].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],(null==(r=t.popperOptions)?void 0:r.modifiers)||[]))})})}var Dt=Et?r.useLayoutEffect:r.useEffect;function Ot(e){var t=(0,r.useRef)();return t.current||(t.current="function"==typeof e?e():e),t.current}function Tt(e,t,n){n.split(/\s+/).forEach((function(n){n&&e.classList[t](n)}))}var Nt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,n=function(){var t;return!!(null==(t=e.props.render)?void 0:t.$$tippy)};function r(){e.props.className&&!n()||Tt(t,"add",e.props.className)}return{onCreate:r,onBeforeUpdate:function(){n()&&Tt(t,"remove",e.props.className)},onAfterUpdate:r}}};function At(e){return function(t){var n=t.children,i=t.content,o=t.visible,a=t.singleton,s=t.render,u=t.reference,l=t.disabled,c=void 0!==l&&l,d=t.ignoreAttributes,f=void 0===d||d,h=(t.__source,t.__self,_t(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"])),p=void 0!==o,v=void 0!==a,g=(0,r.useState)(!1),y=g[0],m=g[1],b=(0,r.useState)({}),x=b[0],w=b[1],_=(0,r.useState)(),E=_[0],k=_[1],S=Ot((function(){return{container:St(),renders:1}})),P=Object.assign({ignoreAttributes:f},h,{content:S.container});p&&(P.trigger="manual",P.hideOnClick=!1),v&&(c=!0);var C=P,j=P.plugins||[];s&&(C=Object.assign({},P,{plugins:v&&null!=a.data?[].concat(j,[{fn:function(){return{onTrigger:function(e,t){var n=a.data.children.find((function(e){return e.instance.reference===t.currentTarget}));e.state.$$activeSingletonInstance=n.instance,k(n.content)}}}}]):j,render:function(){return{popper:S.container}}}));var D=[u].concat(n?[n.type]:[]);return Dt((function(){var t=u;u&&u.hasOwnProperty("current")&&(t=u.current);var n=e(t||S.ref||St(),Object.assign({},C,{plugins:[Nt].concat(P.plugins||[])}));return S.instance=n,c&&n.disable(),o&&n.show(),v&&a.hook({instance:n,content:i,props:C,setSingletonContent:k}),m(!0),function(){n.destroy(),null==a||a.cleanup(n)}}),D),Dt((function(){var e;if(1!==S.renders){var t=S.instance;t.setProps(jt(t.props,C)),null==(e=t.popperInstance)||e.forceUpdate(),c?t.disable():t.enable(),p&&(o?t.show():t.hide()),v&&a.hook({instance:t,content:i,props:C,setSingletonContent:k})}else S.renders++})),Dt((function(){var e;if(s){var t=S.instance;t.setProps({popperOptions:Object.assign({},t.props.popperOptions,{modifiers:[].concat(((null==(e=t.props.popperOptions)?void 0:e.modifiers)||[]).filter((function(e){return"$$tippyReact"!==e.name})),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t,n=e.state,r=null==(t=n.modifiersData)?void 0:t.hide;x.placement===n.placement&&x.referenceHidden===(null==r?void 0:r.isReferenceHidden)&&x.escaped===(null==r?void 0:r.hasPopperEscaped)||w({placement:n.placement,referenceHidden:null==r?void 0:r.isReferenceHidden,escaped:null==r?void 0:r.hasPopperEscaped}),n.attributes.popper={}}}])})})}}),[x.placement,x.referenceHidden,x.escaped].concat(D)),r.default.createElement(r.default.Fragment,null,n?(0,r.cloneElement)(n,{ref:function(e){S.ref=e,kt(n.ref,e)}}):null,y&&(0,r.createPortal)(s?s(function(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}(x),E,S.instance):i,S.container))}}var Mt=function(e,t){return(0,r.forwardRef)((function(n,i){var o=n.children,a=_t(n,["children"]);return r.default.createElement(e,Object.assign({},t,a),o?(0,r.cloneElement)(o,{ref:function(e){kt(i,e),kt(o.ref,e)}}):null)}))};const Bt=Mt(At(wt));var Lt=n("sL3o"),It=0;function Rt(e,t,n,r,i){var o,a,s={};for(a in t)"ref"==a?o=t[a]:s[a]=t[a];var u={type:e,props:s,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--It,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===s[a]&&(s[a]=o[a]);return Lt.YM.vnode&&Lt.YM.vnode(u),u}const zt=(0,r.memo)((function({projectGraphs:e,selectedProjectGraph:t,projectGraphChange:n,lastPerfReport:r}){return Rt("div",{id:"debugger-panel",className:" w-auto text-gray-700 bg-gray-50 border-b border-gray-200 p-4 flex flex-column items-center justify-items-center gap-4 ",children:[Rt("h4",{className:"text-lg font-bold mr-4",children:"Debugger"}),Rt("select",{className:"w-auto flex items-center px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white","data-cy":"project-select",onChange:e=>n(e.target.value),value:t,children:e.map((e=>Rt("option",{value:e.id,children:e.label},e.id)))}),Rt("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",Rt("b",{className:"font-mono text-medium",children:[r.numNodes," nodes"]})," ","|"," ",Rt("b",{className:"font-mono text-medium",children:[r.numEdges," edges"]}),"."]})]})}));var Ft=n("t6Oc");const Vt={entry:o.actions.choose([{cond:"selectActionCannotBePersistedToRoute",actions:["notifyRouteClearSelect"]}]),on:{updateGraph:{target:"customSelected",actions:[(0,Ft.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,o.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Gt={entry:[(0,Ft.f0)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),(0,o.send)(((e,t)=>{if("focusProject"===t.type)return{type:"notifyRouteFocusProject",focusedProject:t.projectName}}),{to:e=>e.routeSetterActor}),"notifyGraphFocusProject"],exit:[(0,Ft.f0)((e=>{e.focusedProject=null})),"notifyRouteUnfocusProject"],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject","notifyRouteSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject","notifyRouteSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject","notifyRouteSearchDepth"]},setSearchDepth:{actions:["setSearchDepth","notifyGraphFocusProject","notifyRouteSearchDepth"]},unfocusProject:{target:"unselected",actions:["notifyRouteUnfocusProject"]},updateGraph:{actions:["setGraph",(0,o.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFocusProject"]}}};var Yt=n("rFOX"),qt=n.n(Yt),Wt=n("Ded0"),Ht=n.n(Wt),Ut=n("CQyY"),Xt=n.n(Ut);class Kt{constructor(e){this.node=e}render(){const e=document.createElement("div"),t=this.createHeader(),n=this.createTags(),r=this.createButtons();return e.appendChild(t),e.appendChild(n),e.appendChild(r),e}createHeader(){const e=document.createElement("h4"),t=document.createElement("span"),n=document.createTextNode(this.node.attr("id"));return t.classList.add("tag"),t.innerText=this.node.attr("type"),e.appendChild(t),e.appendChild(n),e}createTags(){var e,t;const n=document.createElement("p"),r=document.createElement("strong"),i=document.createTextNode(null!=(e=null==(t=this.node.attr("tags"))?void 0:t.join(", "))?e:"");return r.innerText="tags",n.appendChild(r),n.appendChild(document.createElement("br")),n.appendChild(i),n}createButtons(){const e=document.createElement("div"),t=document.createElement("button"),n=document.createElement("button");e.classList.add("flex");const r=An();return t.addEventListener("click",(()=>r.send({type:"focusProject",projectName:this.node.attr("id")}))),t.innerText="Focus",n.addEventListener("click",(()=>{r.send({type:"deselectProject",projectName:this.node.attr("id")})})),n.innerText="Exclude",e.appendChild(t),e.appendChild(n),e}}let Qt;!function(e){e.blue="hsla(214, 62%, 21%, 1)",e.green="hsla(162, 47%, 50%, 1)",e.lightBlue="hsla(192, 75%, 59%, 1)",e.gray="hsla(0, 0%, 92%, 1)",e.darkGray="hsla(0, 0%, 72%, 1)",e.black="hsla(220, 9%, 46%, 1)",e.red="hsla(347, 92%, 65%, 1)",e.white="#fff"}(Qt||(Qt={}));const Zt=[{selector:"edge",style:{width:"1px","line-color":Qt.black,"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":Qt.black}},{selector:"edge.affected",style:{"line-color":Qt.red,"target-arrow-color":Qt.red,"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","edge-text-rotation":"autorotate","curve-style":"unbundled-bezier"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}}],Jt=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',"border-style":"solid","border-color":Qt.darkGray,"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:Qt.black,label:"data(id)",width:"label",backgroundColor:Qt.white,"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out"}},{selector:'node[type="app"]',style:{shape:"round-rectangle"}},{selector:'node[type="lib"]',style:{shape:"round-rectangle"}},{selector:'node[type="e2e"]',style:{shape:"round-rectangle"}},{selector:"node.focused",style:{color:Qt.white,"border-color":Qt.gray,backgroundColor:Qt.green}},{selector:"node.affected",style:{color:Qt.white,"border-color":Qt.gray,backgroundColor:Qt.red}},{selector:":parent",style:{"background-opacity":.5,"background-color":Qt.gray,"border-color":Qt.darkGray,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:Qt.white,"border-color":Qt.gray,backgroundColor:Qt.blue}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"edge.highlight",style:{"mid-target-arrow-color":Qt.blue}},{selector:"edge.transparent",style:{opacity:.2}}];class $t{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target}},t.classes=null!=(e=this.dep.type)?e:"",this.affected&&(t.classes+=" affected"),t}}class en{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}function tn(e){return e.replace(/\/$/,"")}function nn(e,t){const n=tn(e).split("/");return n[0]===tn(t)&&n.shift(),n.pop(),n}class rn{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null}}getClasses(){var e;let t=null!=(e=this.project.type)?e:"";return this.affected&&(t+=" affected"),t}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return nn(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:`dir-${r}`,parentId:t>0?`dir-${[...n].slice(0,t).join("/")}`:null}}))}}class on{constructor(e,t){this.tooltipService=e,this.containerId=t,this.traversalGraph=void 0,this.renderGraph=void 0,this.openTooltip=null,qt().use(Ht()),qt().use(Xt())}handleEvent(e){const t=Date.now();switch(this.renderGraph&&"notifyGraphUpdateGraph"!==e.type&&this.renderGraph.nodes(".focused").removeClass("focused"),this.tooltipService.hideAll(),e.type){case"notifyGraphInitGraph":this.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects);break;case"notifyGraphUpdateGraph":this.initGraph(e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects),this.setShownProjects(e.selectedProjects.length>0?e.selectedProjects:this.renderGraph.nodes(":childless").map((e=>e.id())));break;case"notifyGraphFocusProject":this.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":this.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProject":this.showProjects([e.projectName]);break;case"notifyGraphHideProject":this.hideProject(e.projectName);break;case"notifyGraphShowAllProjects":this.showAllProjects();break;case"notifyGraphHideAllProjects":this.hideAllProjects();break;case"notifyGraphShowAffectedProjects":this.showAffectedProjects()}let n=[],r={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph){this.renderGraph.elements().sort(((e,t)=>e.id().localeCompare(t.id()))).layout({name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"}).run(),this.renderGraph.fit().center().resize(),n=this.renderGraph.nodes('[type!="dir"]').map((e=>e.id()));r={renderTime:Date.now()-t,numNodes:this.renderGraph.nodes().length,numEdges:this.renderGraph.edges().length}}return{selectedProjectNames:n,perfReport:r}}setShownProjects(e){let t=this.traversalGraph.collection();e.forEach((e=>{t=t.union(this.traversalGraph.$id(e))}));const n=t.ancestors(),r=t.union(n),i=r.edgesTo(r);this.transferToRenderGraph(r.union(i))}showProjects(e){var t,n;const r=null!=(t=null==(n=this.renderGraph)?void 0:n.nodes())?t:this.traversalGraph.collection();let i=this.traversalGraph.collection();e.forEach((e=>{i=i.union(this.traversalGraph.$id(e))}));const o=i.ancestors(),a=r.union(i).union(o),s=a.edgesTo(a);this.transferToRenderGraph(a.union(s))}hideProject(e){var t,n;const r=null!=(t=null==(n=this.renderGraph)?void 0:n.nodes())?t:this.traversalGraph.collection(),i=this.renderGraph.$id(e),o=r.difference(i).difference(i.ancestors()),a=o.ancestors();let s=o.union(a);const u=s.edgesTo(s);this.transferToRenderGraph(s.union(u))}showAffectedProjects(){const e=this.traversalGraph.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);this.transferToRenderGraph(n.union(r))}focusProject(e,t=1){const n=this.traversalGraph.$id(e),r=this.includeProjectsByDepth(n,t),i=n.union(r),o=i.ancestors(),a=i.union(o),s=a.edgesTo(a);this.transferToRenderGraph(a.union(s)),this.renderGraph.$id(e).addClass("focused")}showAllProjects(){this.transferToRenderGraph(this.traversalGraph.elements())}hideAllProjects(){this.transferToRenderGraph(this.traversalGraph.collection())}filterProjectsByText(e,t,n=-1){if(""===e)this.transferToRenderGraph(this.traversalGraph.collection());else{const r=e.split(",");let i=this.traversalGraph.nodes().filter((e=>r.findIndex((t=>e.id().includes(t)))>-1));t&&(i=i.union(this.includeProjectsByDepth(i,n))),i=i.union(i.ancestors());const o=i.edgesTo(i);this.transferToRenderGraph(i.union(o))}}transferToRenderGraph(e){let t;this.renderGraph&&(t=this.renderGraph.nodes(".focused").first().id(),this.renderGraph.destroy(),delete this.renderGraph);const n=document.getElementById(this.containerId);this.renderGraph=qt()({container:n,headless:!n,boxSelectionEnabled:!1,style:[...Jt,...Zt]}),this.renderGraph.add(e),t&&this.renderGraph.$id(t).addClass("focused"),this.renderGraph.on("zoom",(()=>{this.openTooltip&&(this.openTooltip.hide(),this.openTooltip=null)})),this.listenForProjectNodeClicks(),this.listenForProjectNodeHovers()}includeProjectsByDepth(e,t=-1){let n=this.traversalGraph.collection();if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}let r=this.traversalGraph.collection();if(-1===t)r=e.successors();else{r=e.outgoers();for(let e=1;e<t;e++)r=r.union(r.outgoers())}return e.union(n).union(r)}initGraph(e,t,n,r,i){this.tooltipService.hideAll(),this.generateCytoscapeLayout(e,t,n,r,i)}generateCytoscapeLayout(e,t,n,r,i){const o=this.createElements(e,t,n,r,i);this.traversalGraph=qt()({headless:!0,elements:[...o],boxSelectionEnabled:!1,style:[...Jt,...Zt]})}createElements(e,t,n,r,i){let o=[];const a=e.map((e=>e.name)),s=[],u=[],l={};e.forEach((e=>{const o="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,c=new rn(e,o);if(c.affected=i.includes(e.name),s.push(c),r[e.name].forEach((e=>{if(a.includes(e.target)){const t=new $t(e);u.push(t)}})),t){c.getAncestors().forEach((e=>l[e.id]=e))}}));const c=s.map((e=>e.getCytoscapeNodeDef(t))),d=u.map((e=>e.getCytosacpeNodeDef()));if(o=c.concat(d),t){o=Object.keys(l).map((e=>new en(l[e]).getCytoscapeNodeDef())).concat(o)}return o}listenForProjectNodeClicks(){this.renderGraph.$("node:childless").on("click",(e=>{const t=e.target;let n=t.popperRef();const r=new Kt(t).render();this.openTooltip=this.tooltipService.open(n,r)}))}listenForProjectNodeHovers(){this.renderGraph.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.renderGraph.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.renderGraph.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.renderGraph.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}getImage(){return this.renderGraph.png({bg:"#fff",full:!0})}}class an{open(e,t){let n=wt(document.createElement("div"),{trigger:"manual",theme:"nx",interactive:!0,appendTo:document.body,content:t,getReferenceClientRect:e.getBoundingClientRect});return n.show(),n}hideAll(){var e,t,n,r;n=(t=void 0===e?{}:e).exclude,r=t.duration,mt.forEach((function(e){var t=!1;if(n&&(t=Ue(n)?e.reference===n:e.popper===n.popper),!t){var i=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:i})}}))}}let sn;function un(){return sn||(sn=new on(new an,"cytoscape-graph")),sn}const ln=(e,t)=>{const n=un();t((t=>{const{selectedProjectNames:r,perfReport:i}=n.handleEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:i})}))};function cn(){return cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn.apply(this,arguments)}function dn(e){return"/"===e.charAt(0)}function fn(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}const hn=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],i=t&&t.split("/")||[],o=e&&dn(e),a=t&&dn(t),s=o||a;if(e&&dn(e)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var l=0,c=i.length;c>=0;c--){var d=i[c];"."===d?fn(i,c):".."===d?(fn(i,c),l++):l&&(fn(i,c),l--)}if(!s)for(;l--;l)i.unshift("..");!s||""===i[0]||i[0]&&dn(i[0])||i.unshift("");var f=i.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};var pn="Invariant failed";function vn(e){return"/"===e.charAt(0)?e:"/"+e}function gn(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function yn(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function mn(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function bn(e,t,n,r){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),i.state=t):(void 0===(i=cn({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(Rt){throw Rt instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):Rt}return n&&(i.key=n),r?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=hn(i.pathname,r.pathname)):i.pathname=r.pathname:i.pathname||(i.pathname="/"),i}function xn(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var wn=!("undefined"==typeof window||!window.document||!window.document.createElement);function _n(e,t){t(window.confirm(e))}var En="popstate",kn="hashchange";function Sn(){try{return window.history.state||{}}catch(Rt){return{}}}function Pn(e){void 0===e&&(e={}),wn||function(e,t){if(!e)throw new Error(pn)}(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,i=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,a=o.forceRefresh,s=void 0!==a&&a,u=o.getUserConfirmation,l=void 0===u?_n:u,c=o.keyLength,d=void 0===c?6:c,f=e.basename?yn(vn(e.basename)):"";function h(e){var t=e||{},n=t.key,r=t.state,i=window.location,o=i.pathname+i.search+i.hash;return f&&(o=gn(o,f)),bn(o,r,n)}function p(){return Math.random().toString(36).substr(2,d)}var v=xn();function g(e){cn(j,e),j.length=n.length,v.notifyListeners(j.location,j.action)}function y(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||x(h(e.state))}function m(){x(h(Sn()))}var b=!1;function x(e){if(b)b=!1,g();else{v.confirmTransitionTo(e,"POP",l,(function(t){t?g({action:"POP",location:e}):function(e){var t=j.location,n=_.indexOf(t.key);-1===n&&(n=0);var r=_.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(b=!0,k(i))}(e)}))}}var w=h(Sn()),_=[w.key];function E(e){return f+mn(e)}function k(e){n.go(e)}var S=0;function P(e){1===(S+=e)&&1===e?(window.addEventListener(En,y),i&&window.addEventListener(kn,m)):0===S&&(window.removeEventListener(En,y),i&&window.removeEventListener(kn,m))}var C=!1;var j={length:n.length,action:"POP",location:w,createHref:E,push:function(e,t){var i="PUSH",o=bn(e,t,p(),j.location);v.confirmTransitionTo(o,i,l,(function(e){if(e){var t=E(o),a=o.key,u=o.state;if(r)if(n.pushState({key:a,state:u},null,t),s)window.location.href=t;else{var l=_.indexOf(j.location.key),c=_.slice(0,l+1);c.push(o.key),_=c,g({action:i,location:o})}else window.location.href=t}}))},replace:function(e,t){var i="REPLACE",o=bn(e,t,p(),j.location);v.confirmTransitionTo(o,i,l,(function(e){if(e){var t=E(o),a=o.key,u=o.state;if(r)if(n.replaceState({key:a,state:u},null,t),s)window.location.replace(t);else{var l=_.indexOf(j.location.key);-1!==l&&(_[l]=o.key),g({action:i,location:o})}else window.location.replace(t)}}))},go:k,goBack:function(){k(-1)},goForward:function(){k(1)},block:function(e){void 0===e&&(e=!1);var t=v.setPrompt(e);return C||(P(1),C=!0),function(){return C&&(C=!1,P(-1)),t()}},listen:function(e){var t=v.appendListener(e);return P(1),function(){P(-1),t()}}};return j}function Cn(e){const t=Object.entries(e).reduce(((e,[t,n])=>(null!==n&&(e[t]=n),e)),{});return new URLSearchParams(t).toString()}const jn={entry:[(0,Ft.f0)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,Ft.f0)((e=>{e.includePath=!1,e.textFilter=""}))},setIncludeProjectsByPath:{actions:["setIncludeProjectsByPath","notifyGraphFilterProjectsByText"]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFilterProjectsByText"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFilterProjectsByText"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFilterProjectsByText"]},updateGraph:{actions:["setGraph",(0,o.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFilterProjectsByText"]}}};const Dn=e=>{(function(e){const t=[];return new URLSearchParams(e).forEach(((e,n)=>{switch(n){case"select":"all"===e?t.push({type:"selectAll"}):"affected"===e&&t.push({type:"selectAffected"});break;case"focus":t.push({type:"focusProject",projectName:e});break;case"groupByFolder":t.push({type:"setGroupByFolder",groupByFolder:!0});break;case"searchDepth":t.push({type:"setSearchDepth",searchDepth:parseInt(e)})}})),t})(Pn().location.search).forEach((t=>e(t)))},On={entry:["notifyGraphHideAllProjects",(0,Ft.f0)(((e,t)=>{null===e.routeListenerActor&&(e.routeListenerActor=(0,o.spawn)(Dn,"routeListener"))})),"notifyRouteClearSelect"],on:{updateGraph:{target:"customSelected",actions:[(0,Ft.f0)(((e,t)=>{const n=e.projects.map((e=>e.name)),r=t.projects.map((e=>e.name)).filter((e=>!n.includes(e)));e.selectedProjects=[...e.selectedProjects,...r]})),"setGraph",(0,o.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Tn=(0,o.Machine)({id:"DepGraph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!1,groupByFolder:!1,workspaceLayout:{libsDir:"",appsDir:""},graphActor:null,routeSetterActor:null,routeListenerActor:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0}},states:{idle:{},unselected:On,customSelected:Vt,focused:Gt,textFiltered:jn},on:{initGraph:{target:"unselected",actions:["setGraph",(0,o.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder})),{to:e=>e.graphActor})]},setSelectedProjectsFromGraph:{actions:[(0,Ft.f0)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))]},selectProject:{target:"customSelected",actions:["notifyGraphShowProject"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects","notifyRouteSelectAll"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects","notifyRouteSelectAffected"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProject"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setGroupByFolder:{actions:["setGroupByFolder",(0,o.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),(0,o.send)(((e,t)=>{if("setGroupByFolder"===t.type)return{type:"notifyRouteGroupByFolder",groupByFolder:t.groupByFolder}}),{to:e=>e.routeSetterActor})]},setIncludeProjectsByPath:{actions:[(0,Ft.f0)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth","notifyRouteSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyRouteSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyRouteSearchDepth"]},setSearchDepth:{actions:["setSearchDepth","notifyRouteSearchDepth"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1,selectActionCannotBePersistedToRoute:(e,t)=>"selectAffected"!==t.type&&"selectAll"!==t.type},actions:{setGroupByFolder:(0,Ft.f0)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),incrementSearchDepth:(0,Ft.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,Ft.f0)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepth:(0,Ft.f0)(((e,t)=>{"setSearchDepth"===t.type&&(e.searchDepthEnabled=!0,e.searchDepth=t.searchDepth>1?t.searchDepth:1)})),setSearchDepthEnabled:(0,Ft.f0)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,Ft.f0)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,Ft.f0)(((e,t)=>{"initGraph"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.graphActor=(0,o.spawn)(ln,"graphActor"),e.routeSetterActor=(0,o.spawn)((()=>{const e=Pn(),t=new URLSearchParams(e.location.search),n={focus:t.get("focus"),groupByFolder:t.get("groupByFolder"),searchDepth:t.get("searchDepth"),select:t.get("select")},r={currentParamString:Cn(n),params:n};return(0,o.Machine)({id:"route",context:{currentParamString:"",params:{focus:null,groupByFolder:null,searchDepth:null,select:null}},always:{actions:(0,Ft.f0)((e=>{const t=Pn(),n=Cn(e.params);t.push({search:n}),e.currentParamString=n})),cond:"didParamsChange"},on:{notifyRouteSelectAll:{actions:(0,Ft.f0)((e=>{e.params.select="all",e.params.focus=null}))},notifyRouteSelectAffected:{actions:(0,Ft.f0)((e=>{e.params.select="affected",e.params.focus=null}))},notifyRouteClearSelect:{actions:(0,Ft.f0)((e=>{e.params.select=null}))},notifyRouteFocusProject:{actions:(0,Ft.f0)(((e,t)=>{e.params.focus=t.focusedProject,e.params.select=null}))},notifyRouteUnfocusProject:{actions:(0,Ft.f0)(((e,t)=>{e.params.focus=null}))},notifyRouteGroupByFolder:{actions:(0,Ft.f0)(((e,t)=>{e.params.groupByFolder=t.groupByFolder?"true":null}))},notifyRouteSearchDepth:{actions:(0,Ft.f0)(((e,t)=>{e.params.searchDepth=t.searchDepthEnabled?t.searchDepth.toString():null}))}}},{guards:{didParamsChange:e=>e.currentParamString!==Cn(e.params)}}).withContext(r)})(),{name:"route"}),"initGraph"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphShowProject:(0,o.send)(((e,t)=>{if("selectProject"===t.type)return{type:"notifyGraphShowProject",projectName:t.projectName}}),{to:e=>e.graphActor}),notifyGraphHideProject:(0,o.send)(((e,t)=>{if("deselectProject"===t.type)return{type:"notifyGraphHideProject",projectName:t.projectName}}),{to:e=>e.graphActor}),notifyGraphShowAllProjects:(0,o.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graphActor}),notifyGraphHideAllProjects:(0,o.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graphActor}),notifyGraphShowAffectedProjects:(0,o.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graphActor}),notifyGraphFocusProject:(0,o.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor}),notifyRouteUnfocusProject:(0,o.send)((()=>({type:"notifyRouteUnfocusProject"})),{to:e=>e.routeSetterActor}),notifyRouteSelectAll:(0,o.send)((()=>({type:"notifyRouteSelectAll"})),{to:e=>e.routeSetterActor}),notifyRouteSelectAffected:(0,o.send)((()=>({type:"notifyRouteSelectAffected"})),{to:e=>e.routeSetterActor}),notifyRouteClearSelect:(0,o.send)((()=>({type:"notifyRouteClearSelect"})),{to:e=>e.routeSetterActor}),notifyRouteSearchDepth:(0,o.send)(((e,t)=>({type:"notifyRouteSearchDepth",searchDepth:e.searchDepth,searchDepthEnabled:e.searchDepthEnabled})),{to:e=>e.routeSetterActor}),notifyGraphFilterProjectsByText:(0,o.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor})}});let Nn;function An(){return Nn||(Nn=(0,o.interpret)(Tn,{devTools:!!window.useXstateInspect}),Nn.start()),Nn}const Mn=(0,r.createContext)({}),Bn=e=>{const t=An();return Rt(Mn.Provider,{value:t,children:e.children})};function Ln(){return(0,r.useContext)(Mn)}var In;!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(In||(In={}));const Rn=r.useLayoutEffect;function zn(e){return"state"in e}var Fn=n("D3Vl");var Vn=function(e,t){return e===t},Gn=function(e){return"state"in(n=e)&&"machine"in n?0!==("status"in(t=e)?t.status:t._status)?t.state:t.machine.initialState:zn(e)?e.state:void 0;var t,n};n("Mgrw");function Yn(e){return function(e,t,n,i){void 0===n&&(n=Vn),void 0===i&&(i=Gn);var o=(0,r.useRef)(t),a=(0,r.useMemo)((function(){var r,a=i(e),s=t(a);return{getSnapshot:function(){return a},getCurrentValue:function(){return s},setCurrentValue:function(e){s=e,null==r||r()},subscribe:function(t){r=t;var i=e.subscribe((function(e){a=e;var r=o.current(e);n(s,r)||(s=r,t())}));return function(){i.unsubscribe()}}}}),[e]),s=(0,Fn.useSubscription)(a),u=!1;if(o.current!==t){var l=t(a.getSnapshot());n(s,l)||(u=!0,s=l)}return Rn((function(){o.current=t,u&&a.setCurrentValue(s)})),s}(Ln(),e)}class qn{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}class Wn{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}}class Hn{constructor(e=5e3){this.response={hash:"79054025255fb1a26e4bc422aef54eb4",layout:{appsDir:"apps",libsDir:"libs"},projects:[{name:"existing-app-1",type:"app",data:{root:"apps/app1",tags:[]}},{name:"existing-lib-1",type:"lib",data:{root:"libs/lib1",tags:[]}}],dependencies:{"existing-app-1":[{source:"existing-app-1",target:"existing-lib-1",type:"statis"}],"existing-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1},setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.response.hash)))}getProjectGraph(e){return new Promise((e=>e(this.response)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.response.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[]}}}updateResponse(){const e=this.createNewProject(),t=this.response.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.response=Object.assign({},this.response,{projects:[...this.response.projects,e],dependencies:Object.assign({},this.response.dependencies,{[e.name]:r})})}}let Un;function Xn(){return void 0===Un&&("dev"===window.environment?Un=new qn:"watch"===window.environment?Un=new Hn:"release"===window.environment&&(Un="build"===window.localMode?new Wn:new qn)),Un}const Kn=e=>e.context.projects,Qn=e=>e.context.workspaceLayout,Zn=e=>e.context.selectedProjects,Jn=e=>e.context.selectedProjects.length>0,$n=e=>e.context.lastPerfReport,er=e=>e.context.focusedProject,tr=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),nr=e=>e.context.includePath,rr=e=>e.context.groupByFolder,ir=e=>e.context.textFilter,or=e=>e.context.affectedProjects.length>0,ar=(0,r.memo)((({focusedProject:e,resetFocus:t})=>Rt("div",{className:"mt-10 px-4",children:Rt("div",{className:"p-2 shadow-sm bg-green-nx-base text-gray-50 border border-gray-200 rounded-md flex items-center group relative cursor-pointer overflow-hidden","data-cy":"unfocusButton",onClick:()=>t(),children:[Rt("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 inline -mt-1 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),Rt("span",{id:"focused-project-name",children:["Focused on ",e]})]}),Rt("div",{className:"absolute right-2 flex transition-all translate-x-32 transition duration-200 ease-in-out group-hover:translate-x-0 pl-2 rounded-md text-gray-700 items-center text-sm font-medium bg-white shadow-sm ring-1 ring-gray-500",children:["Reset",Rt("span",{className:"p-1 rounded-md",children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})]})}))),sr=(0,r.memo)((({groupByFolder:e,groupByFolderChanged:t})=>Rt("div",{className:"mt-8 px-4",children:Rt("div",{className:"flex items-start",children:[Rt("div",{className:"flex items-center h-5",children:Rt("input",{id:"displayOptions",name:"displayOptions",value:"groupByFolder",type:"checkbox",className:"h-4 w-4 border-gray-300 rounded",onChange:e=>t(e.target.checked),checked:e})}),Rt("div",{className:"ml-3 text-sm",children:[Rt("label",{htmlFor:"displayOptions",className:"cursor-pointer font-medium text-gray-700",children:"Group by folder"}),Rt("p",{className:"text-gray-500",children:"Visually arrange libraries by folders with different colors."})]})]})})));function ur(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function lr(e,t,n){let r={};return e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,o=nn(e.data.root,i).join("/");r.hasOwnProperty(o)||(r[o]=[]),r[o].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function cr({project:e,toggleProject:t,focusProject:n}){return Rt("li",{className:"text-xs text-gray-600 block cursor-default select-none relative py-1 pl-3 pr-9",children:[Rt("div",{className:"flex items-center",children:[Rt("button",{type:"button",className:"flex rounded-md",title:"Focus on this library",onClick:()=>n(e.projectGraphNode.name),children:Rt("span",{className:"p-1 rounded-md flex items-center font-medium bg-white transition hover:bg-gray-50 shadow-sm ring-1 ring-gray-200",children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[Rt("path",{d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2h-1.528A6 6 0 004 9.528V4z"}),Rt("path",{fillRule:"evenodd",d:"M8 10a4 4 0 00-3.446 6.032l-1.261 1.26a1 1 0 101.414 1.415l1.261-1.261A4 4 0 108 10zm-2 4a2 2 0 114 0 2 2 0 01-4 0z",clipRule:"evenodd"})]})})}),Rt("label",{className:"font-mono font-normal ml-3 p-2 transition hover:bg-gray-50 cursor-pointer block rounded-md truncate w-full","data-project":e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>t(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name})]}),e.isSelected?Rt("span",{title:"This library is visible",className:"text-green-nx-base absolute inset-y-0 right-0 flex items-center cursor-pointer",onClick:()=>t(e.projectGraphNode.name,e.isSelected),children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}):null]})}function dr({headerText:e,projects:t,selectProject:n,deselectProject:r,focusProject:i}){let o=[...t];function a(e,t){t?r(e):n(e)}return o.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),Rt(Lt.HY,{children:[Rt("h3",{className:"mt-4 py-2 uppercase tracking-wide font-semibold text-sm lg:text-xs text-gray-900 cursor-text",children:e}),Rt("ul",{className:"mt-2 -ml-3",children:o.map((e=>Rt(cr,{project:e,toggleProject:a,focusProject:i},e.projectGraphNode.name)))})]})}const fr=function(){const e=Ln();function t(t){e.send({type:"deselectProject",projectName:t})}function n(t){e.send({type:"selectProject",projectName:t})}function r(t){e.send({type:"focusProject",projectName:t})}const i=Yn(Kn),o=Yn(Qn),a=Yn(Zn),s=ur("app",i),u=ur("lib",i),l=ur("e2e",i),c=lr(s,a,o),d=lr(u,a,o),f=lr(l,a,o),h=Object.keys(c).sort(),p=Object.keys(d).sort(),v=Object.keys(f).sort();return Rt("div",{id:"project-lists",className:"mt-8 px-4 border-t border-gray-200",children:[Rt("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"app projects"}),h.map((e=>Rt(dr,{headerText:e,projects:c[e],deselectProject:t,selectProject:n,focusProject:r},"app-"+e))),Rt("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"e2e projects"}),v.map((e=>Rt(dr,{headerText:e,projects:f[e],deselectProject:t,selectProject:n,focusProject:r},"e2e-"+e))),Rt("h2",{className:"mt-8 text-lg font-bold border-b border-gray-50 border-solid",children:"lib projects"}),p.map((e=>Rt(dr,{headerText:e,projects:d[e],deselectProject:t,selectProject:n,focusProject:r},"lib-"+e)))]})},hr=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:i})=>Rt("div",{className:"mt-4 px-4",children:[Rt("div",{className:"mt-4 flex items-start",children:[Rt("div",{className:"flex items-center h-5",children:Rt("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 border-gray-300 rounded",checked:t,onChange:e=>n(e.target.checked)})}),Rt("div",{className:"ml-3 text-sm",children:[Rt("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-gray-700",children:"Activate proximity"}),Rt("p",{className:"text-gray-500",children:"Explore connected libraries step by step."})]})]}),Rt("div",{className:"mt-3 px-10",children:Rt("div",{className:"flex rounded-md shadow-sm text-gray-500",children:[Rt("button",{title:"Remove ancestor level",className:"inline-flex items-center py-2 px-4 rounded-l-md border border-gray-300 bg-gray-50 text-gray-500 hover:bg-gray-100",onClick:r,children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 12H4"})})}),Rt("span",{id:"depthFilterValue",className:"p-1.5 bg-white flex-1 block w-full rounded-none border-t border-b border-gray-300 text-center font-mono",children:e}),Rt("button",{title:"Add ancestor level",className:"inline-flex items-center py-2 px-4 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 hover:bg-gray-100",onClick:i,children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})})]})})]}))),pr=(0,r.memo)((({showAllProjects:e,hideAllProjects:t,showAffectedProjects:n,hasAffectedProjects:r})=>Rt("div",{className:"mt-8 px-4",children:[Rt("button",{onClick:e,type:"button",className:"w-full flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50","data-cy":"selectAllButton",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),"Show all projects"]}),r?Rt("button",{onClick:n,type:"button",className:"mt-3 w-full flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-500 bg-white hover:bg-red-50","data-cy":"affectedButton",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Show affected projects"]}):null,Rt("button",{onClick:t,type:"button",className:"mt-3 w-full flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50","data-cy":"deselectAllButton",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"-ml-1 mr-2 h-5 w-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}),"Hide all projects"]})]})));const vr=function({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:i,includePath:o}){const[a,s]=(0,r.useState)(""),u=function(e,t){const[n,i]=(0,r.useState)(e);return(0,r.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),n}(a,500);return(0,r.useEffect)((()=>{""!==u&&n(u)}),[u,n]),Rt("div",{children:[Rt("div",{className:"mt-10 px-4",children:Rt("form",{className:"flex rounded-md shadow-sm relative",onSubmit:e=>e.preventDefault(),children:[Rt("span",{className:"inline-flex items-center p-2 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500",children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})}),Rt("input",{type:"text",className:"p-1.5 bg-white text-gray-600 flex-1 block w-full rounded-none rounded-r-md border border-gray-300",placeholder:"lib name, other lib name","data-cy":"textFilterInput",name:"filter",value:a,onKeyUp:function(e){"Enter"===e.key&&n(e.currentTarget.value)},onChange:e=>{var n;""===(n=e.currentTarget.value)?(s(""),t()):s(n)}}),a.length>0?Rt("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){s(""),t()},className:"p-1 top-1 right-1 absolute bg-white inline-block rounded-md text-gray-500",children:Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z"})})}):null]})}),Rt("div",{className:"mt-4 px-4",children:Rt("div",{className:"flex items-start",children:[Rt("div",{className:"flex items-center h-5",children:Rt("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 border-gray-300 rounded",checked:o,onChange:i})}),Rt("div",{className:"ml-3 text-sm",children:[Rt("label",{htmlFor:"includeInPath",className:"font-medium text-gray-700 cursor-pointer",children:"Include related libraries"}),Rt("p",{className:"text-gray-500",children:"Show libraries that are related to your search."})]})]})})]})};const gr=function(){const e=Ln(),t=Yn(er),n=Yn(tr),i=Yn(nr),o=Yn(ir),a=Yn(or),s=Yn(rr),u=(0,r.useCallback)((t=>{e.send({type:"filterByText",search:t})}),[e]);return Rt("div",{className:" flex flex-col h-full overflow-scroll w-72 pb-10 shadow-lg ring-1 ring-gray-400 ring-opacity-10 relative ",id:"sidebar",children:[Rt("div",{className:"bg-blue-nx-base",children:Rt("div",{className:"flex items-center justify-start mx-4 my-5 text-white",children:[Rt("svg",{className:"h-10 w-auto",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[Rt("title",{children:"Nx"}),Rt("path",{d:"M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z"})]}),Rt("span",{className:"ml-4 text-xl font-medium",children:" Dependency Graph "})]})}),Rt("a",{id:"help",className:" mt-3 px-4 text-xs text-gray-500 flex items-center cursor-pointer hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"nofollow noreferrer",target:"_blank",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Analyse and visualize your workspace."]}),t?Rt(ar,{focusedProject:t,resetFocus:function(){e.send({type:"unfocusProject"})}}):null,Rt(vr,{includePath:i,resetTextFilter:function(){e.send({type:"clearTextFilter"})},textFilter:o,toggleIncludeLibsInPathChange:function(){e.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!i})},updateTextFilter:u}),Rt("div",{children:[Rt(pr,{hideAllProjects:function(){e.send({type:"deselectAll"})},showAllProjects:function(){e.send({type:"selectAll"})},showAffectedProjects:function(){e.send({type:"selectAffected"})},hasAffectedProjects:a}),Rt(sr,{groupByFolder:s,groupByFolderChanged:function(t){e.send({type:"setGroupByFolder",groupByFolder:t})}}),Rt(hr,{searchDepth:n.searchDepth,searchDepthEnabled:n.searchDepthEnabled,searchDepthFilterEnabledChange:function(t){e.send({type:"setSearchDepthEnabled",searchDepthEnabled:t})},incrementDepthFilter:function(){e.send({type:"incrementSearchDepth"})},decrementDepthFilter:function(){e.send({type:"decrementSearchDepth"})}})]}),Rt(fr,{})]})};function yr(){const e=Ln(),t=Xn(),n=(0,r.useRef)({exclude:window.exclude,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:window.appConfig,useXstateInspect:window.useXstateInspect}).current,i=Yn($n),o=Yn(Jn),[a,s]=(0,r.useState)(n.appConfig.defaultProjectGraph);return(0,r.useEffect)((()=>{const{appConfig:r}=n,i=r.projectGraphs.find((e=>e.id===a));(async()=>{const n=await t.getProjectGraph(i.url),r=null==n?void 0:n.layout;e.send({type:"initGraph",projects:n.projects,dependencies:n.dependencies,affectedProjects:n.affected,workspaceLayout:r})})()}),[a,n,e,t]),((e,t,n)=>{const i=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(i.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n){const e=()=>{i.current()};if(null!==t){let n=setInterval(e,t);return()=>clearInterval(n)}}}),[t,n])})((()=>{const r=n.appConfig.projectGraphs.find((e=>e.id===a));(async()=>{const n=await t.getProjectGraph(r.url);e.send({type:"updateGraph",projects:n.projects,dependencies:n.dependencies})})()}),5e3,n.watch),Rt(Lt.HY,{children:[Rt(gr,{}),Rt("div",{id:"main-content",className:"flex-grow overflow-hidden",children:[n.appConfig.showDebugger?Rt(zt,{projectGraphs:n.appConfig.projectGraphs,selectedProjectGraph:a,lastPerfReport:i,projectGraphChange:function(e){s(e)}}):null,o?null:Rt("div",{id:"no-projects-chosen",className:"flex text-gray-700",children:[Rt("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z"})}),Rt("h4",{children:"Please select projects in the sidebar."})]}),Rt("div",{id:"graph-container",children:[Rt("div",{id:"cytoscape-graph"}),Rt(Bt,{content:"Download Graph as PNG",placement:"right",theme:"nx",children:Rt("button",{type:"button",className:`\n fixed\n z-50\n bottom-4\n right-4\n w-16\n h-16\n rounded-full\n bg-green-nx-base\n shadow-sm\n text-white\n block\n transition\n duration-300\n transform\n ${o?"":"opacity-0"}\n `,"data-cy":"downloadImageButton",onClick:function(){const e=un().getImage();let t=document.createElement("a");t.href=e,t.download="graph.png",t.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},children:Rt("svg",{height:"24",width:"24",className:"absolute top-1/2 left-1/2 -mt-3 -ml-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:Rt("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})})]})]})]})}const mr=function(){return Rt(Bn,{children:Rt(yr,{})})};!0===window.useXstateInspect&&function(e){var t=function(e){var t=i(i({},f),e);return i(i({},t),{url:new URL(t.url),iframe:l(t.iframe),devTools:l(t.devTools)})}(e),n=t.iframe,r=t.url,s=t.devTools;if(null!==n){var u,d,h=function(e){void 0===e&&(e=globalThis.__xstate__);var t=new Map,n=e.onRegister((function(e){t.set(e.sessionId,e)}));return(0,o.createMachine)({initial:"pendingConnection",context:{client:void 0},states:{pendingConnection:{},connected:{on:{"service.state":{actions:function(e,t){return e.client.send(t)}},"service.event":{actions:function(e,t){return e.client.send(t)}},"service.register":{actions:function(e,t){return e.client.send(t)}},"service.stop":{actions:function(e,t){return e.client.send(t)}},"xstate.event":{actions:function(e,n){var r=n.event,i=JSON.parse(r),o=t.get(i.origin);null==o||o.send(i)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){n.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,o.assign)({client:function(e,t){return t.client}}),function(t){e.services.forEach((function(e){var n;null===(n=t.client)||void 0===n||n.send({type:"service.register",machine:c(e.machine),state:c(e.state||e.initialState),sessionId:e.sessionId})}))}]}}})}(s),p=(0,o.interpret)(h).start(),v=new Set,g=p.subscribe((function(e){v.forEach((function(t){return t.next(e)}))})),y=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!u&&(u=n.contentWindow),d||(d={send:function(e){u.postMessage(e,r.origin)}});var t=i(i({},e.data),{client:d});p.send(t)}};return window.addEventListener("message",y),window.addEventListener("unload",(function(){p.send({type:"unload"})})),s.onRegister((function(e){var t;p.send({type:"service.register",machine:c(e.machine),state:c(e.state||e.initialState),sessionId:e.sessionId,id:e.id,parent:null===(t=e.parent)||void 0===t?void 0:t.sessionId}),p.send({type:"service.event",event:c((e.state||e.initialState)._event),sessionId:e.sessionId});var n=e.send.bind(e);e.send=function(t,r){return p.send({type:"service.event",event:c((0,a.toSCXMLEvent)((0,a.toEventObject)(t,r))),sessionId:e.sessionId}),n(t,r)},e.subscribe((function(t){void 0!==t&&p.send({type:"service.state",state:c(t),sessionId:e.sessionId})})),e.onStop((function(){p.send({type:"service.stop",sessionId:e.sessionId})}))})),n?(n.addEventListener("load",(function(){u=n.contentWindow})),n.setAttribute("src",String(r))):u=window.open(String(r),"xstateinspector"),{send:function(e){p.send(e)},subscribe:function(e,t,n){var r=(0,a.toObserver)(e,t,n);return v.add(r),r.next(p.state),{unsubscribe:function(){v.delete(r)}}},disconnect:function(){p.send("disconnect"),window.removeEventListener("message",y),g.unsubscribe()}}}console.warn("No suitable <iframe> found to embed the inspector. Please pass an <iframe> element to `inspect(iframe)` or create an <iframe data-xstate></iframe> element.")}({url:"https://stately.ai/viz?inspect",iframe:!1}),r.render(Rt(r.StrictMode,{children:Rt(mr,{})}),document.getElementById("app"))},"1ajG":(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>_,afterRead:()=>b,afterWrite:()=>S,applyStyles:()=>N,arrow:()=>Q,auto:()=>s,basePlacements:()=>u,beforeMain:()=>x,beforeRead:()=>y,beforeWrite:()=>E,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>ee,createPopper:()=>Te,createPopperBase:()=>De,createPopperLite:()=>Oe,detectOverflow:()=>ge,end:()=>c,eventListeners:()=>ne,flip:()=>ye,hide:()=>xe,left:()=>a,main:()=>w,modifierPhases:()=>P,offset:()=>we,placements:()=>g,popper:()=>h,popperGenerator:()=>je,popperOffsets:()=>_e,preventOverflow:()=>Ee,read:()=>m,reference:()=>p,right:()=>o,start:()=>l,top:()=>r,variationPlacements:()=>v,viewport:()=>f,write:()=>k});var r="top",i="bottom",o="right",a="left",s="auto",u=[r,i,o,a],l="start",c="end",d="clippingParents",f="viewport",h="popper",p="reference",v=u.reduce((function(e,t){return e.concat([t+"-"+l,t+"-"+c])}),[]),g=[].concat(u,[s]).reduce((function(e,t){return e.concat([t,t+"-"+l,t+"-"+c])}),[]),y="beforeRead",m="read",b="afterRead",x="beforeMain",w="main",_="afterMain",E="beforeWrite",k="write",S="afterWrite",P=[y,m,b,x,w,_,E,k,S];function C(e){return e?(e.nodeName||"").toLowerCase():null}function j(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function D(e){return e instanceof j(e).Element||e instanceof Element}function O(e){return e instanceof j(e).HTMLElement||e instanceof HTMLElement}function T(e){return"undefined"!=typeof ShadowRoot&&(e instanceof j(e).ShadowRoot||e instanceof ShadowRoot)}const N={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];O(i)&&C(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});O(r)&&C(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function A(e){return e.split("-")[0]}function M(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect();return{width:n.width/1,height:n.height/1,top:n.top/1,right:n.right/1,bottom:n.bottom/1,left:n.left/1,x:n.left/1,y:n.top/1}}function B(e){var t=M(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function L(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&T(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return j(e).getComputedStyle(e)}function R(e){return["table","td","th"].indexOf(C(e))>=0}function z(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===C(e)?e:e.assignedSlot||e.parentNode||(T(e)?e.host:null)||z(e)}function V(e){return O(e)&&"fixed"!==I(e).position?e.offsetParent:null}function G(e){for(var t=j(e),n=V(e);n&&R(n)&&"static"===I(n).position;)n=V(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===I(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&O(e)&&"fixed"===I(e).position)return null;for(var n=F(e);O(n)&&["html","body"].indexOf(C(n))<0;){var r=I(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Y(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var q=Math.max,W=Math.min,H=Math.round;function U(e,t,n){return q(e,W(t,n))}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function K(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}const Q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,s=e.name,l=e.options,c=n.elements.arrow,d=n.modifiersData.popperOffsets,f=A(n.placement),h=Y(f),p=[a,o].indexOf(f)>=0?"height":"width";if(c&&d){var v=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:K(e,u))}(l.padding,n),g=B(c),y="y"===h?r:a,m="y"===h?i:o,b=n.rects.reference[p]+n.rects.reference[h]-d[h]-n.rects.popper[p],x=d[h]-n.rects.reference[h],w=G(c),_=w?"y"===h?w.clientHeight||0:w.clientWidth||0:0,E=b/2-x/2,k=v[y],S=_-g[p]-v[m],P=_/2-g[p]/2+E,C=U(k,P,S),j=h;n.modifiersData[s]=((t={})[j]=C,t.centerOffset=C-P,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&L(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(e){return e.split("-")[1]}var J={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $(e){var t,n=e.popper,s=e.popperRect,u=e.placement,l=e.variation,d=e.offsets,f=e.position,h=e.gpuAcceleration,p=e.adaptive,v=e.roundOffsets,g=!0===v?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:H(H(t*r)/r)||0,y:H(H(n*r)/r)||0}}(d):"function"==typeof v?v(d):d,y=g.x,m=void 0===y?0:y,b=g.y,x=void 0===b?0:b,w=d.hasOwnProperty("x"),_=d.hasOwnProperty("y"),E=a,k=r,S=window;if(p){var P=G(n),C="clientHeight",D="clientWidth";P===j(n)&&"static"!==I(P=z(n)).position&&"absolute"===f&&(C="scrollHeight",D="scrollWidth"),P=P,u!==r&&(u!==a&&u!==o||l!==c)||(k=i,x-=P[C]-s.height,x*=h?1:-1),u!==a&&(u!==r&&u!==i||l!==c)||(E=o,m-=P[D]-s.width,m*=h?1:-1)}var O,T=Object.assign({position:f},p&&J);return h?Object.assign({},T,((O={})[k]=_?"0":"",O[E]=w?"0":"",O.transform=(S.devicePixelRatio||1)<=1?"translate("+m+"px, "+x+"px)":"translate3d("+m+"px, "+x+"px, 0)",O)):Object.assign({},T,((t={})[k]=_?x+"px":"",t[E]=w?m+"px":"",t.transform="",t))}const ee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,u=void 0===s||s,l={placement:A(t.placement),variation:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,$(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,$(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var te={passive:!0};const ne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,u=j(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",n.update,te)})),s&&u.addEventListener("resize",n.update,te),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",n.update,te)})),s&&u.removeEventListener("resize",n.update,te)}},data:{}};var re={left:"right",right:"left",bottom:"top",top:"bottom"};function ie(e){return e.replace(/left|right|bottom|top/g,(function(e){return re[e]}))}var oe={start:"end",end:"start"};function ae(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function se(e){var t=j(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ue(e){return M(z(e)).left+se(e).scrollLeft}function le(e){var t=I(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ce(e){return["html","body","#document"].indexOf(C(e))>=0?e.ownerDocument.body:O(e)&&le(e)?e:ce(F(e))}function de(e,t){var n;void 0===t&&(t=[]);var r=ce(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=j(r),a=i?[o].concat(o.visualViewport||[],le(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(de(F(a)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function he(e,t){return t===f?fe(function(e){var t=j(e),n=z(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+ue(e),y:s}}(e)):O(t)?function(e){var t=M(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):fe(function(e){var t,n=z(e),r=se(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=q(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=q(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ue(e),u=-r.scrollTop;return"rtl"===I(i||n).direction&&(s+=q(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(z(e)))}function pe(e,t,n){var r="clippingParents"===t?function(e){var t=de(F(e)),n=["absolute","fixed"].indexOf(I(e).position)>=0&&O(e)?G(e):e;return D(n)?t.filter((function(e){return D(e)&&L(e,n)&&"body"!==C(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=he(e,n);return t.top=q(r.top,t.top),t.right=W(r.right,t.right),t.bottom=W(r.bottom,t.bottom),t.left=q(r.left,t.left),t}),he(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ve(e){var t,n=e.reference,s=e.element,u=e.placement,d=u?A(u):null,f=u?Z(u):null,h=n.x+n.width/2-s.width/2,p=n.y+n.height/2-s.height/2;switch(d){case r:t={x:h,y:n.y-s.height};break;case i:t={x:h,y:n.y+n.height};break;case o:t={x:n.x+n.width,y:p};break;case a:t={x:n.x-s.width,y:p};break;default:t={x:n.x,y:n.y}}var v=d?Y(d):null;if(null!=v){var g="y"===v?"height":"width";switch(f){case l:t[v]=t[v]-(n[g]/2-s[g]/2);break;case c:t[v]=t[v]+(n[g]/2-s[g]/2)}}return t}function ge(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,l=n.boundary,c=void 0===l?d:l,v=n.rootBoundary,g=void 0===v?f:v,y=n.elementContext,m=void 0===y?h:y,b=n.altBoundary,x=void 0!==b&&b,w=n.padding,_=void 0===w?0:w,E=X("number"!=typeof _?_:K(_,u)),k=m===h?p:h,S=e.rects.popper,P=e.elements[x?k:m],C=pe(D(P)?P:P.contextElement||z(e.elements.popper),c,g),j=M(e.elements.reference),O=ve({reference:j,element:S,strategy:"absolute",placement:s}),T=fe(Object.assign({},S,O)),N=m===h?T:j,A={top:C.top-N.top+E.top,bottom:N.bottom-C.bottom+E.bottom,left:C.left-N.left+E.left,right:N.right-C.right+E.right},B=e.modifiersData.offset;if(m===h&&B){var L=B[s];Object.keys(A).forEach((function(e){var t=[o,i].indexOf(e)>=0?1:-1,n=[r,i].indexOf(e)>=0?"y":"x";A[e]+=L[n]*t}))}return A}const ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,c=e.name;if(!t.modifiersData[c]._skip){for(var d=n.mainAxis,f=void 0===d||d,h=n.altAxis,p=void 0===h||h,y=n.fallbackPlacements,m=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,_=n.flipVariations,E=void 0===_||_,k=n.allowedAutoPlacements,S=t.options.placement,P=A(S),C=y||(P===S||!E?[ie(S)]:function(e){if(A(e)===s)return[];var t=ie(e);return[ae(e),t,ae(t)]}(S)),j=[S].concat(C).reduce((function(e,n){return e.concat(A(n)===s?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?g:l,d=Z(r),f=d?s?v:v.filter((function(e){return Z(e)===d})):u,h=f.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=f);var p=h.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[A(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:b,rootBoundary:x,padding:m,flipVariations:E,allowedAutoPlacements:k}):n)}),[]),D=t.rects.reference,O=t.rects.popper,T=new Map,N=!0,M=j[0],B=0;B<j.length;B++){var L=j[B],I=A(L),R=Z(L)===l,z=[r,i].indexOf(I)>=0,F=z?"width":"height",V=ge(t,{placement:L,boundary:b,rootBoundary:x,altBoundary:w,padding:m}),G=z?R?o:a:R?i:r;D[F]>O[F]&&(G=ie(G));var Y=ie(G),q=[];if(f&&q.push(V[I]<=0),p&&q.push(V[G]<=0,V[Y]<=0),q.every((function(e){return e}))){M=L,N=!1;break}T.set(L,q)}if(N)for(var W=function(e){var t=j.find((function(t){var n=T.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},H=E?3:1;H>0;H--){if("break"===W(H))break}t.placement!==M&&(t.modifiersData[c]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function me(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function be(e){return[r,o,i,a].some((function(t){return e[t]>=0}))}const xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ge(t,{elementContext:"reference"}),s=ge(t,{altBoundary:!0}),u=me(a,r),l=me(s,i,o),c=be(u),d=be(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};const we={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,u=void 0===s?[0,0]:s,l=g.reduce((function(e,n){return e[n]=function(e,t,n){var i=A(e),s=[a,r].indexOf(i)>=0?-1:1,u="function"==typeof n?n(Object.assign({},t,{placement:e})):n,l=u[0],c=u[1];return l=l||0,c=(c||0)*s,[a,o].indexOf(i)>=0?{x:c,y:l}:{x:l,y:c}}(n,t.rects,u),e}),{}),c=l[t.placement],d=c.x,f=c.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=f),t.modifiersData[i]=l}};const _e={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ve({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Ee={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,s=e.name,u=n.mainAxis,c=void 0===u||u,d=n.altAxis,f=void 0!==d&&d,h=n.boundary,p=n.rootBoundary,v=n.altBoundary,g=n.padding,y=n.tether,m=void 0===y||y,b=n.tetherOffset,x=void 0===b?0:b,w=ge(t,{boundary:h,rootBoundary:p,padding:g,altBoundary:v}),_=A(t.placement),E=Z(t.placement),k=!E,S=Y(_),P="x"===S?"y":"x",C=t.modifiersData.popperOffsets,j=t.rects.reference,D=t.rects.popper,O="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,T={x:0,y:0};if(C){if(c||f){var N="y"===S?r:a,M="y"===S?i:o,L="y"===S?"height":"width",I=C[S],R=C[S]+w[N],z=C[S]-w[M],F=m?-D[L]/2:0,V=E===l?j[L]:D[L],H=E===l?-D[L]:-j[L],X=t.elements.arrow,K=m&&X?B(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=Q[N],$=Q[M],ee=U(0,j[L],K[L]),te=k?j[L]/2-F-ee-J-O:V-ee-J-O,ne=k?-j[L]/2+F+ee+$+O:H+ee+$+O,re=t.elements.arrow&&G(t.elements.arrow),ie=re?"y"===S?re.clientTop||0:re.clientLeft||0:0,oe=t.modifiersData.offset?t.modifiersData.offset[t.placement][S]:0,ae=C[S]+te-oe-ie,se=C[S]+ne-oe;if(c){var ue=U(m?W(R,ae):R,I,m?q(z,se):z);C[S]=ue,T[S]=ue-I}if(f){var le="x"===S?r:a,ce="x"===S?i:o,de=C[P],fe=de+w[le],he=de-w[ce],pe=U(m?W(fe,ae):fe,de,m?q(he,se):he);C[P]=pe,T[P]=pe-de}}t.modifiersData[s]=T}},requiresIfExists:["offset"]};function ke(e,t,n){void 0===n&&(n=!1);var r,i,o=O(t),a=O(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return 1!==n||1!==r}(t),s=z(t),u=M(e,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==C(t)||le(s))&&(l=(r=t)!==j(r)&&O(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:se(r)),O(t)?((c=M(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=ue(s))),{x:u.left+l.scrollLeft-c.x,y:u.top+l.scrollTop-c.y,width:u.width,height:u.height}}function Se(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Pe={placement:"bottom",modifiers:[],strategy:"absolute"};function Ce(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function je(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Pe:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},Pe,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],l=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:D(e)?de(e):e.contextElement?de(e.contextElement):[],popper:de(t)};var a=function(e){var t=Se(e);return P.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,s.options.modifiers)));return s.orderedModifiers=a.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r}),a=function(){};u.push(o||a)}})),c.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,n=e.popper;if(Ce(t,n)){s.rects={reference:ke(t,G(n),"fixed"===s.options.strategy),popper:B(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,u=void 0===a?{}:a,d=i.name;"function"==typeof o&&(s=o({state:s,options:u,name:d,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){d(),l=!0}};if(!Ce(e,t))return c;function d(){u.forEach((function(e){return e()})),u=[]}return c.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var De=je(),Oe=je({defaultModifiers:[ne,_e,ee,N]}),Te=je({defaultModifiers:[ne,_e,ee,N,we,ye,Ee,Q,xe]})},t6Oc:(e,t,n)=>{"use strict";t.f0=void 0;var r=n("IXFX"),i=n("9EWH");function o(e){return r.assign((function(t,n,r){return i.produce(t,(function(t){e(t,n,r)}))}))}t.f0=o},Ded0:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),u={},l=function(e,t){null!=t&&(u[e]=t)};l("nodesep",e.nodeSep),l("edgesep",e.edgeSep),l("ranksep",e.rankSep),l("rankdir",e.rankDir),l("ranker",e.ranker),s.setGraph(u),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var c=n.nodes(),d=0;d<c.length;d++){var f=c[d],h=f.layoutDimensions(e);s.setNode(f.id(),{width:h.w,height:h.h,name:f.id()})}for(var p=0;p<c.length;p++){var v=c[p];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),y=0;y<g.length;y++){var m=g[y];s.setEdge(m.source().id(),m.target().id(),{minlen:i(m,e.minLen),weight:i(m,e.edgeWeight),name:m.id()},m.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var _=x[w],E=s.node(_);t.getElementById(_).scratch().dagre=E}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},c.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,c.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){if(e.boundingBox){var n=0===b.w?0:(t.x-b.x1)/b.w,r=0===b.h?0:(t.y-b.y1)/b.h;return{x:o.x1+n*o.w,y:o.y1+r*o.h}}return t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){var n={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}};e.exports=n},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n("4e6e"))},CQyY:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),u=o(e,t.content),l=r({},a,t.popper);return s(n,u,l)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy(),o={renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e),i=r.w/2,o=r.h/2;return{x:n.x-i,y:n.y-o}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i};return r({},o,t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.cy,i=t.renderedDimensions,o=r.container().getBoundingClientRect(),a=i(e),s=n(e);return{top:s.y+o.top,left:s.x+o.left,right:s.x+a.w+o.left,bottom:s.y+a.h+o.top,width:a.w,height:a.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n=null;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n("1ajG"))},rFOX:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n("E/ZA")),o=r(n("3Ssf"));function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var f="undefined"==typeof window?null:window,h=f?f.navigator:null,p=(f&&f.document,a("")),v=a({}),g=a((function(){})),y="undefined"==typeof HTMLElement?"undefined":a(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&a(e)==p},x=function(e){return null!=e&&a(e)===g},w=function(e){return!S(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},_=function(e){return null!=e&&a(e)===v&&!w(e)&&e.constructor===Object},E=function(e){return null!=e&&a(e)===a(1)&&!isNaN(e)},k=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},S=function(e){return P(e)||C(e)},P=function(e){return"collection"===m(e)&&e._private.single},C=function(e){return"collection"===m(e)&&!e._private.single},j=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},O=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},T=function(e){return function(e){return null!=e&&a(e)===v}(e)&&x(e.then)},N=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},A=N((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),M=N((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),B=N((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),L=function(e){return O(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},I="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",R=function(e,t){return e<t?-1:e>t?1:0},z=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},F=function(e){return(w(e)?e:null)||function(e){return V[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,r,i,o,a,s,u;function l(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=u=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,f=2*i-d;a=Math.round(255*l(f,d,n+1/3)),s=Math.round(255*l(f,d,n)),u=Math.round(255*l(f,d,n-1/3))}t=[a,s,u,o]}return t}(e)},V={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},G=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(_(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},Y=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(_(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},q=f?f.performance:null,W=q&&q.now?function(){return q.now()}:function(){return Date.now()},H=function(){if(f){if(f.requestAnimationFrame)return function(e){f.requestAnimationFrame(e)};if(f.mozRequestAnimationFrame)return function(e){f.mozRequestAnimationFrame(e)};if(f.webkitRequestAnimationFrame)return function(e){f.webkitRequestAnimationFrame(e)};if(f.msRequestAnimationFrame)return function(e){f.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(W())}),1e3/60)}}(),U=function(e){return H(e)},X=W,K=9261,Q=65599,Z=5381,J=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K,r=n;!(t=e.next()).done;)r=r*Q+t.value|0;return r},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;return t*Q+e|0},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z;return(t<<5)+t+e|0},te=function(e){return 2097152*e[0]+e[1]},ne=function(e,t){return[$(e[0],t[0]),ee(e[1],t[1])]},re=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return J({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ie=function(){return oe(arguments)},oe=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?re(r):re(r,t)}return t},ae=!0,se=null!=console.warn,ue=null!=console.trace,le=Number.MAX_SAFE_INTEGER||9007199254740991,ce=function(){return!0},de=function(){return!1},fe=function(){return 0},he=function(){},pe=function(e){throw new Error(e)},ve=function(e){if(void 0===e)return ae;ae=!!e},ge=function(e){ve()&&(se?console.warn(e):(console.log(e),ue&&console.trace()))},ye=function(e){return null==e?e:w(e)?e.slice():_(e)?function(e){return z({},e)}(e):e},me=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},be={},xe=function(){return be},we=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},_e=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Ee=function(e){e.splice(0,e.length)},ke=function(e,t,n){return n&&(t=B(n,t)),e[t]},Se=function(e,t,n,r){n&&(t=B(n,t)),e[t]=r},Pe="undefined"!=typeof Map?Map:function(){function e(){s(this,e),this._obj={}}return l(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ce=function(){function e(t){if(s(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return l(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),je="undefined"!==("undefined"==typeof Set?"undefined":a(Set))?Set:Ce,De=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&j(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new je,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var u=[];w(t.classes)?u=t.classes:b(t.classes)&&(u=t.classes.split(/\s+/));for(var l=0,c=u.length;l<c;l++){var d=u[l];d&&""!==d&&i.classes.add(d)}this.createEmitter();var f=t.style||t.css;f&&(ge("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f)),(void 0===n||n)&&this.restore()}else pe("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else pe("An element must have a core reference and parameters set")},Oe=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;_(t)&&!S(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var o,a=this._private.cy,s=t=b(t)?this.filter(t):t,u=[],l=[],c={},d={},f={},h=0,p=this.byGroup(),v=p.nodes,g=p.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(u.unshift(m),e.bfs&&(f[w]=!0,l.push(m)),d[w]=0)}var E=function(){var t=e.bfs?u.shift():u.pop(),i=t.id();if(e.dfs){if(f[i])return"continue";f[i]=!0,l.push(t)}var a,s=d[i],p=c[i],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,p,b,h++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var _=x[w],E=_.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),k=E.id();0===E.length||f[k]||(E=E[0],u.push(E),e.bfs&&(f[k]=!0,l.push(E)),c[k]=_,d[k]=d[i]+1)}};e:for(;0!==u.length;){var k=E();switch(k){case"continue":continue;case"break":break e}}for(var P=a.collection(),C=0;C<l.length;C++){var j=l[C],D=c[j.id()];null!=D&&P.push(D),P.push(j)}return{path:a.collection(P),found:a.collection(o)}}},Te={breadthFirstSearch:Oe({bfs:!0}),depthFirstSearch:Oe({dfs:!0})};Te.bfs=Te.breadthFirstSearch,Te.dfs=Te.depthFirstSearch;var Ne=we({root:null,weight:function(e){return 1},directed:!1}),Ae={dijkstra:function(e){if(!_(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ne(e),r=n.root,i=n.weight,a=n.directed,s=this,u=i,l=b(r)?this.filter(r)[0]:r[0],c={},d={},f={},h=this.byGroup(),p=h.nodes,v=h.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return c[e.id()]},y=function(e,t){c[e.id()]=t,m.updateItem(e)},m=new o((function(e,t){return g(e)-g(t)})),x=0;x<p.length;x++){var w=p[x];c[w.id()]=w.same(l)?0:1/0,m.push(w)}for(var E=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,o=0;o<r.length;o++){var s=r[o],l=u(s);(l<i||!n)&&(i=l,n=s)}return{edge:n,dist:i}};m.size()>0;){var k=m.pop(),S=g(k),P=k.id();if(f[P]=S,S!==1/0)for(var C=k.neighborhood().intersect(p),j=0;j<C.length;j++){var D=C[j],O=D.id(),T=E(k,D),N=S+T.dist;N<g(D)&&(y(D,N),d[O]={node:k,edge:T.edge})}}return{distanceTo:function(e){var t=b(e)?p.filter(e)[0]:e[0];return f[t.id()]},pathTo:function(e){var t=b(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return s.spawn(n)}}}},Me={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var l=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<l.length;c++){var d=l[c],f=d.source()[0],h=d.target()[0],p=s(f),v=s(h),g=o[p],y=o[v];p!==v&&(a.merge(d),g.merge(y),o.splice(v,1))}return a}},Be=we({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Le={aStar:function(e){var t=this.cy(),n=Be(e),r=n.root,i=n.goal,a=n.heuristic,s=n.directed,u=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,d=r.id(),f=i.id(),h={},p={},v={},g=new o((function(e,t){return p[e.id()]-p[t.id()]})),y=new je,m={},b={},x=function(e,t){g.push(e),y.add(t)};x(r,d),h[d]=0,p[d]=a(r);for(var w,_=0;g.size()>0;){if(l=g.pop(),c=l.id(),y.delete(c),_++,c===f){for(var E=[],k=i,S=f,P=b[S];E.unshift(k),null!=P&&E.unshift(P),null!=(k=m[S]);)P=b[S=k.id()];return{found:!0,distance:h[c],path:this.spawn(E),steps:_}}v[c]=!0;for(var C=l._private.edges,j=0;j<C.length;j++){var D=C[j];if(this.hasElementWithId(D.id())&&(!s||D.data("source")===c)){var O=D.source(),T=D.target(),N=O.id()!==c?O:T,A=N.id();if(this.hasElementWithId(A)&&!v[A]){var M=h[c]+u(D);w=A,y.has(w)?M<h[A]&&(h[A]=M,p[A]=M+a(N),m[A]=l,b[A]=D):(h[A]=M,p[A]=M+a(N),x(N,A),m[A]=l,b[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},Ie=we({weight:function(e){return 1},directed:!1}),Re={floydWarshall:function(e){for(var t=this.cy(),n=Ie(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,u=a.edges,l=s.length,c=l*l,d=function(e){return s.indexOf(e)},f=function(e){return s[e]},h=new Array(c),p=0;p<c;p++){var v=p%l,g=(p-v)/l;h[p]=g===v?0:1/0}for(var y=new Array(c),m=new Array(c),x=0;x<u.length;x++){var w=u[x],_=w.source()[0],E=w.target()[0];if(_!==E){var k=d(_),S=d(E),P=k*l+S,C=o(w);if(h[P]>C&&(h[P]=C,y[P]=S,m[P]=w),!i){var j=S*l+k;!i&&h[j]>C&&(h[j]=C,y[j]=k,m[j]=w)}}}for(var D=0;D<l;D++)for(var O=0;O<l;O++)for(var T=O*l+D,N=0;N<l;N++){var A=O*l+N,M=D*l+N;h[T]+h[M]<h[A]&&(h[A]=h[T]+h[M],y[A]=y[T])}var B=function(e){return d(function(e){return(b(e)?t.filter(e):e)[0]}(e))},L={distance:function(e,t){var n=B(e),r=B(t);return h[n*l+r]},path:function(e,n){var r=B(e),i=B(n),o=f(r);if(r===i)return o.collection();if(null==y[r*l+i])return t.collection();var a,s=t.collection(),u=r;for(s.merge(o);r!==i;)u=r,r=y[r*l+i],a=m[u*l+r],s.merge(a),s.merge(f(r));return s}};return L}},ze=we({weight:function(e){return 1},directed:!1,root:null}),Fe={bellmanFord:function(e){var t=this,n=ze(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,u=this.cy(),l=this.byGroup(),c=l.edges,d=l.nodes,f=d.length,h=new Pe,p=!1;o=u.collection(o)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var v=c.length,g=function(e){var t=h.get(e.id());return t||(t={},h.set(e.id(),t)),t},y=function(e){return(b(e)?u.$(e):e)[0]},m=0;m<f;m++){var x=d[m],w=g(x);x.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var _=!1,E=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,_=!0)},k=1;k<f;k++){_=!1;for(var S=0;S<v;S++){var P=c[S],C=P.source(),j=P.target(),D=a(P),O=g(C),T=g(j);E(C,0,P,O,T,D),i||E(j,0,P,T,O,D)}if(!_)break}if(_)for(var N=0;N<v;N++){var A=c[N],M=A.source(),B=A.target(),L=a(A),I=g(M).dist,R=g(B).dist;if(I+L<R||!i&&R+L<I){ge("Graph contains a negative weight cycle for Bellman-Ford"),p=!0;break}}return{distanceTo:function(e){return g(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=y(e),i=[],a=r;;){if(null==a)return t.spawn();var u=g(a),l=u.edge,c=u.pred;if(i.unshift(a[0]),a.same(n)&&i.length>0)break;null!=l&&i.unshift(l),a=c}return s.spawn(i)},hasNegativeWeightCycle:p,negativeWeightCycles:[]}}},Ve=Math.sqrt(2),Ge=function(e,t,n){0===n.length&&pe("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],u=n,l=u.length-1;l>=0;l--){var c=u[l],d=c[1],f=c[2];(t[d]===a&&t[f]===s||t[d]===s&&t[f]===a)&&u.splice(l,1)}for(var h=0;h<u.length;h++){var p=u[h];p[1]===s?(u[h]=p.slice(),u[h][1]=a):p[2]===s&&(u[h]=p.slice(),u[h][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return u},Ye=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Ge(i,e,t),n--}return t},qe={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Ve);if(!(i<2)){for(var u=[],l=0;l<o;l++){var c=r[l];u.push([l,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,f=[],h=new Array(i),p=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)p[m]=m;var b=Ye(p,u.slice(),i,s),x=b.slice();g(p,v);var w=Ye(p,b,s,2),_=Ye(v,x,s,2);w.length<=_.length&&w.length<d?(d=w.length,f=w,g(p,h)):_.length<=w.length&&_.length<d&&(d=_.length,f=_,g(v,h))}for(var E=this.spawn(f.map((function(e){return r[e[0]]}))),k=this.spawn(),S=this.spawn(),P=h[0],C=0;C<h.length;C++){var j=h[C],D=n[C];j===P?k.merge(D):S.merge(D)}var O=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!E.contains(t)&&n.merge(t)}))})),n},T=[O(k),O(S)];return{cut:E,components:T,partition1:k,partition2:S}}pe("At least 2 nodes are required for Karger-Stein algorithm")}},We=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},He=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Ue=function(e){return{x:e[0],y:e[1]}},Xe=function(e,t){return Math.atan2(t,e)-Math.PI/2},Ke=Math.log2||function(e){return Math.log(e)/Math.log(2)},Qe=function(e){return e>0?1:e<0?-1:0},Ze=function(e,t){return Math.sqrt(Je(e,t))},Je=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},$e=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},et=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},tt=function(e,t,n,r){return{x:et(e.x,t.x,n.x,r),y:et(e.y,t.y,n.y,r)}},nt=function(e,t,n){return Math.max(e,Math.min(n,t))},rt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},it=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},ot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},at=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=d(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},st=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ut=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},lt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ct=function(e,t){return lt(e,t.x1,t.y1)&&lt(e,t.x2,t.y2)},dt=function(e,t,n,r,i,o,a){var s,u=Dt(i,o),l=i/2,c=o/2,d=r-c-a;if((s=Et(e,t,n,r,n-l+u-a,d,n+l-u+a,d,!1)).length>0)return s;var f=n+l+a;if((s=Et(e,t,n,r,f,r-c+u-a,f,r+c-u+a,!1)).length>0)return s;var h=r+c+a;if((s=Et(e,t,n,r,n-l+u-a,h,n+l-u+a,h,!1)).length>0)return s;var p,v=n-l-a;if((s=Et(e,t,n,r,v,r-c+u-a,v,r+c-u+a,!1)).length>0)return s;var g=n-l+u,y=r-c+u;if((p=wt(e,t,n,r,g,y,u+a)).length>0&&p[0]<=g&&p[1]<=y)return[p[0],p[1]];var m=n+l-u,b=r-c+u;if((p=wt(e,t,n,r,m,b,u+a)).length>0&&p[0]>=m&&p[1]<=b)return[p[0],p[1]];var x=n+l-u,w=r+c-u;if((p=wt(e,t,n,r,x,w,u+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var _=n-l+u,E=r+c-u;return(p=wt(e,t,n,r,_,E,u+a)).length>0&&p[0]<=_&&p[1]>=E?[p[0],p[1]]:[]},ft=function(e,t,n,r,i,o,a){var s=a,u=Math.min(n,i),l=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return u-s<=e&&e<=l+s&&c-s<=t&&t<=d+s},ht=function(e,t,n,r,i,o,a,s,u){var l=Math.min(n,a,i)-u,c=Math.max(n,a,i)+u,d=Math.min(r,s,o)-u,f=Math.max(r,s,o)+u;return!(e<l||e>c||t<d||t>f)},pt=function(e,t,n,r,i,o,a,s){var u=[];!function(e,t,n,r,i){var o,a,s,u,l,c,d,f;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,d=t/3,o>0?(l=(l=s+Math.sqrt(o))<0?-Math.pow(-l,1/3):Math.pow(l,1/3),c=(c=s-Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+l+c,d+=(l+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+l)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===o?(f=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*f-d,i[4]=i[2]=-(f+d)):(u=(a=-a)*a*a,u=Math.acos(s/Math.sqrt(u)),f=2*Math.sqrt(a),i[0]=-d+f*Math.cos(u/3),i[2]=-d+f*Math.cos((u+2*Math.PI)/3),i[4]=-d+f*Math.cos((u+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,u);for(var l=[],c=0;c<6;c+=2)Math.abs(u[c+1])<1e-7&&u[c]>=0&&u[c]<=1&&l.push(u[c]);l.push(1),l.push(0);for(var d,f,h,p=-1,v=0;v<l.length;v++)d=Math.pow(1-l[v],2)*n+2*(1-l[v])*l[v]*i+l[v]*l[v]*a,f=Math.pow(1-l[v],2)*r+2*(1-l[v])*l[v]*o+l[v]*l[v]*s,h=Math.pow(d-e,2)+Math.pow(f-t,2),p>=0?h<p&&(p=h):p=h;return p},vt=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],u=s[0]*s[0]+s[1]*s[1],l=a[0]*a[0]+a[1]*a[1],c=a[0]*s[0]+a[1]*s[1],d=c*c/u;return c<0?l:d>u?(e-i)*(e-i)+(t-o)*(t-o):l-d},gt=function(e,t,n){for(var r,i,o,a,s=0,u=0;u<n.length/2;u++)if(r=n[2*u],i=n[2*u+1],u+1<n.length/2?(o=n[2*(u+1)],a=n[2*(u+1)+1]):(o=n[2*(u+1-n.length/2)],a=n[2*(u+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},yt=function(e,t,n,r,i,o,a,s,u){var l,c=new Array(n.length);null!=s[0]?(l=Math.atan(s[1]/s[0]),s[0]<0?l+=Math.PI/2:l=-l-Math.PI/2):l=s;for(var d,f=Math.cos(-l),h=Math.sin(-l),p=0;p<c.length/2;p++)c[2*p]=o/2*(n[2*p]*f-n[2*p+1]*h),c[2*p+1]=a/2*(n[2*p+1]*f+n[2*p]*h),c[2*p]+=r,c[2*p+1]+=i;if(u>0){var v=bt(c,-u);d=mt(v)}else d=c;return gt(e,t,d)},mt=function(e){for(var t,n,r,i,o,a,s,u,l=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],i=e[4*c+3],c<e.length/4-1?(o=e[4*(c+1)],a=e[4*(c+1)+1],s=e[4*(c+1)+2],u=e[4*(c+1)+3]):(o=e[0],a=e[1],s=e[2],u=e[3]);var d=Et(t,n,r,i,o,a,s,u,!0);l[2*c]=d[0],l[2*c+1]=d[1]}return l},bt=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var u=o-r,l=-(i-n),c=Math.sqrt(u*u+l*l),d=u/c,f=l/c;a[4*s]=n+d*t,a[4*s+1]=r+f*t,a[4*s+2]=i+d*t,a[4*s+3]=o+f*t}return a},xt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},wt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],u=[e-i,t-o],l=s[0]*s[0]+s[1]*s[1],c=2*(u[0]*s[0]+u[1]*s[1]),d=c*c-4*l*(u[0]*u[0]+u[1]*u[1]-a*a);if(d<0)return[];var f=(-c+Math.sqrt(d))/(2*l),h=(-c-Math.sqrt(d))/(2*l),p=Math.min(f,h),v=Math.max(f,h),g=[];if(p>=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},_t=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Et=function(e,t,n,r,i,o,a,s,u){var l=e-i,c=n-e,d=a-i,f=t-o,h=r-t,p=s-o,v=d*f-p*l,g=c*f-h*l,y=p*c-d*h;if(0!==y){var m=v/y,b=g/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||u?[e+m*c,t+m*h]:[]}return 0===v||0===g?_t(e,n,a)===a?[a,s]:_t(e,n,i)===i?[i,o]:_t(i,a,n)===n?[n,r]:[]:[]},kt=function(e,t,n,r,i,o,a,s){var u,l,c,d,f,h,p=[],v=new Array(n.length),g=!0;if(null==o&&(g=!1),g){for(var y=0;y<v.length/2;y++)v[2*y]=n[2*y]*o+r,v[2*y+1]=n[2*y+1]*a+i;if(s>0){var m=bt(v,-s);l=mt(m)}else l=v}else l=n;for(var b=0;b<l.length/2;b++)c=l[2*b],d=l[2*b+1],b<l.length/2-1?(f=l[2*(b+1)],h=l[2*(b+1)+1]):(f=l[0],h=l[1]),0!==(u=Et(e,t,r,i,c,d,f,h)).length&&p.push(u[0],u[1]);return p},St=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},Pt=function(e,t){var n=jt(e,t);return n=Ct(n)},Ct=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,u=0;u<r;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var l=2/(a-i),c=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*l,n=e[2*d+1]=e[2*d+1]*c,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var f=0;f<r;f++)n=e[2*f+1]=e[2*f+1]+(-1-o);return e},jt=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Dt=function(e,t){return Math.min(e/4,t/4,8)},Ot=function(e,t){return Math.min(e/10,t/10,8)},Tt=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Nt=we({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),At={pageRank:function(e){for(var t=Nt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),u=s.nodes,l=s.edges,c=u.length,d=c*c,f=l.length,h=new Array(d),p=new Array(c),v=(1-n)/c,g=0;g<c;g++){for(var y=0;y<c;y++){h[g*c+y]=0}p[g]=0}for(var m=0;m<f;m++){var b=l[m],x=b.data("source"),w=b.data("target");if(x!==w){var _=u.indexOfId(x),E=u.indexOfId(w),k=o(b);h[E*c+_]+=k,p[_]+=k}}for(var S=1/c+v,P=0;P<c;P++)if(0===p[P])for(var C=0;C<c;C++){h[C*c+P]=S}else for(var j=0;j<c;j++){var D=j*c+P;h[D]=h[D]/p[P]+v}for(var O,T=new Array(c),N=new Array(c),A=0;A<c;A++)T[A]=1;for(var M=0;M<i;M++){for(var B=0;B<c;B++)N[B]=0;for(var L=0;L<c;L++)for(var I=0;I<c;I++){var R=L*c+I;N[L]+=h[R]*T[I]}$e(N),O=T,T=N,N=O;for(var z=0,F=0;F<c;F++){var V=O[F]-T[F];z+=V*V}if(z<r)break}return{rank:function(e){return e=a.collection(e)[0],T[u.indexOf(e)]}}}},Mt=we({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Bt={degreeCentralityNormalized:function(e){e=Mt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,u=0;u<r;u++){var l=n[u],c=l.id();e.root=l;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[c]=d.indegree,o[c]=d.outdegree}return{indegree:function(e){return 0==a?0:(b(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var f={},h=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);h<g.degree&&(h=g.degree),f[v.id()]=g.degree}return{degree:function(e){return 0===h?0:(b(e)&&(e=t.filter(e)),f[e.id()]/h)}}},degreeCentrality:function(e){e=Mt(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var u=i.connectedEdges(),l=u.filter((function(e){return e.target().same(i)&&n.has(e)})),c=u.filter((function(e){return e.source().same(i)&&n.has(e)})),d=l.length,f=c.length,h=0,p=0,v=0;v<l.length;v++)h+=o(l[v]);for(var g=0;g<c.length;g++)p+=o(c[g]);return{indegree:Math.pow(d,1-s)*Math.pow(h,s),outdegree:Math.pow(f,1-s)*Math.pow(p,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=o(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};Bt.dc=Bt.degreeCentrality,Bt.dcn=Bt.degreeCentralityNormalised=Bt.degreeCentralityNormalized;var Lt=we({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),It={closenessCentralityNormalized:function(e){for(var t=Lt(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,u=this.nodes(),l=this.floydWarshall({weight:r,directed:i}),c=0;c<u.length;c++){for(var d=0,f=u[c],h=0;h<u.length;h++)if(c!==h){var p=l.distance(f,u[h]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),a[f.id()]=d}return{closeness:function(e){return 0==s?0:(e=b(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Lt(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,u=this.nodes(),l=0;l<u.length;l++){var c=u[l];if(!c.same(n)){var d=a.distanceTo(c);s+=o?1/d:d}}return o?s:1/s}};It.cc=It.closenessCentrality,It.ccn=It.closenessCentralityNormalised=It.closenessCentralityNormalized;var Rt=we({weight:null,directed:!1}),zt={betweennessCentrality:function(e){for(var t=Rt(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),s=this.nodes(),u={},l={},c=0,d=function(e,t){l[e]=t,t>c&&(c=t)},f=function(e){return l[e]},h=0;h<s.length;h++){var p=s[h],v=p.id();u[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=s[e].id(),n=[],l={},c={},h={},p=new o((function(e,t){return h[e]-h[t]})),v=0;v<s.length;v++){var g=s[v].id();l[g]=[],c[g]=0,h[g]=1/0}for(c[t]=1,h[t]=0,p.push(t);!p.empty();){var y=p.pop();if(n.push(y),i)for(var m=0;m<u[y].length;m++){var b=u[y][m],x=a.getElementById(y),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var _=r(w);b=b.id(),h[b]>h[y]+_&&(h[b]=h[y]+_,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),c[b]=0,l[b]=[]),h[b]==h[y]+_&&(c[b]=c[b]+c[y],l[b].push(y))}else for(var E=0;E<u[y].length;E++){var k=u[y][E].id();h[k]==1/0&&(p.push(k),h[k]=h[y]+1),h[k]==h[y]+1&&(c[k]=c[k]+c[y],l[k].push(y))}}for(var S={},P=0;P<s.length;P++)S[s[P].id()]=0;for(;n.length>0;){for(var C=n.pop(),j=0;j<l[C].length;j++){var D=l[C][j];S[D]=S[D]+c[D]/c[C]*(1+S[C])}C!=s[e].id()&&d(C,f(C)+S[C])}},y=0;y<s.length;y++)g(y);var m={betweenness:function(e){var t=a.collection(e).id();return f(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=a.collection(e).id();return f(t)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};zt.bc=zt.betweennessCentrality;var Ft=we({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Vt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Gt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Yt=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},qt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Yt(e,r,t);return e},Wt=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Gt(r,t),r},Ht=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Ut=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Xt=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Ft(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,u=t.length,l=u*u,c=new Array(l),d=0;d<l;d++)c[d]=0;for(var f=0;f<n.length;f++){var h=n[f],p=o[h.source().id()],v=o[h.target().id()],g=Vt(h,i.attributes);c[p*u+v]+=g,c[v*u+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,u,i.multFactor),Gt(c,u);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=qt(c,u,i.expandFactor),c=Wt(s,u,i.inflateFactor),Ht(c,s,l,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,u,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Ut(e[t],e[n])&&e.splice(n,1);return e}(b),b},Kt={markovClustering:Xt,mcl:Xt},Qt=function(e){return e},Zt=function(e,t){return Math.abs(t-e)},Jt=function(e,t,n){return e+Zt(t,n)},$t=function(e,t,n){return e+Math.pow(n-t,2)},en=function(e){return Math.sqrt(e)},tn=function(e,t,n){return Math.max(e,Zt(t,n))},nn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Qt,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},rn={euclidean:function(e,t,n){return e>=2?nn(e,t,n,0,$t,en):nn(e,t,n,0,Jt)},squaredEuclidean:function(e,t,n){return nn(e,t,n,0,$t)},manhattan:function(e,t,n){return nn(e,t,n,0,Jt)},max:function(e,t,n){return nn(e,t,n,-1/0,tn)}};function on(e,t,n,r,i,o){var a;return a=x(e)?e:rn[e]||rn.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}rn["squared-euclidean"]=rn.squaredEuclidean,rn.squaredeuclidean=rn.squaredEuclidean;var an=we({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),sn=function(e){return an(e)},un=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return on(e,r.length,o,(function(e){return r[e](t)}),a,s)},ln=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,u=0;u<r;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var l=0;l<t;l++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(o[c]-i[c])+i[c];a[l]=s}return a},cn=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var u=un(n,e,t[s],r,i);u<o&&(o=u,a=s)}return a},dn=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},fn=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},hn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},pn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];hn(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},vn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=un("manhattan",t[i],e,n,"kMedoids");return r},gn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var u=0;u<e.length;u++)r[s][u]=Math.pow(n[s][u],i.m);for(var l=0;l<e.length;l++)for(var c=0;c<i.attributes.length;c++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][l]*i.attributes[c](t[d]),a+=r[d][l];e[l][c]=o/a}},yn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,u,l=2/(i.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){a=0;for(var f=0;f<n.length;f++)s=un(i.distance,r[d],n[c],i.attributes,"cmeans"),u=un(i.distance,r[d],n[f],i.attributes,"cmeans"),a+=Math.pow(s/u,l);e[d][c]=1/a}},mn=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),u=sn(e);i=new Array(s.length);for(var l=0;l<s.length;l++)i[l]=new Array(u.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(u.k);for(var d=0;d<s.length;d++){for(var f=0,h=0;h<u.k;h++)r[d][h]=Math.random(),f+=r[d][h];for(var p=0;p<u.k;p++)r[d][p]=r[d][p]/f}n=new Array(u.k);for(var v=0;v<u.k;v++)n[v]=new Array(u.attributes.length);o=new Array(s.length);for(var g=0;g<s.length;g++)o[g]=new Array(u.k);for(var y=!0,m=0;y&&m<u.maxIterations;)y=!1,gn(n,s,r,o,u),yn(r,i,n,s,u),fn(r,i,u.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var u=0;u<t.length;u++){i=-1/0,o=-1;for(var l=0;l<t[0].length;l++)t[u][l]>i&&(i=t[u][l],o=l);a[o].push(e[u])}for(var c=0;c<a.length;c++)a[c]=r.collection(a[c]);return a}(s,r,u,a),{clusters:t,degreeOfMembership:r}},bn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=sn(e),s=new Array(o.k),u={};t=o.testMode?"number"==typeof o.testCentroids?ln(r,o.k,o.attributes):"object"===a(o.testCentroids)?o.testCentroids:ln(r,o.k,o.attributes):ln(r,o.k,o.attributes);for(var l,c,d,f=!0,h=0;f&&h<o.maxIterations;){for(var p=0;p<r.length;p++)u[(i=r[p]).id()]=cn(i,t,o.distance,o.attributes,"kMeans");f=!1;for(var v=0;v<o.k;v++){var g=dn(v,r,u);if(0!==g.length){for(var y=o.attributes.length,m=t[v],b=new Array(y),x=new Array(y),w=0;w<y;w++){x[w]=0;for(var _=0;_<g.length;_++)i=g[_],x[w]+=o.attributes[w](i);b[w]=x[w]/g.length,l=b[w],c=m[w],d=o.sensitivityThreshold,Math.abs(c-l)<=d||(f=!0)}t[v]=b,s[v]=n.collection(g)}}h++}return s},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,s=sn(e),u=new Array(s.k),l={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(t="object"===a(s.testCentroids)?s.testCentroids:pn(i,s.k)):t=pn(i,s.k);for(var d=!0,f=0;d&&f<s.maxIterations;){for(var h=0;h<i.length;h++)l[(o=i[h]).id()]=cn(o,t,s.distance,s.attributes,"kMedoids");d=!1;for(var p=0;p<t.length;p++){var v=dn(p,i,l);if(0!==v.length){c[p]=vn(t[p],v,s.attributes);for(var g=0;g<v.length;g++)(n=vn(v[g],v,s.attributes))<c[p]&&(c[p]=n,t[p]=v[g],d=!0);u[p]=r.collection(v)}}f++}return u},fuzzyCMeans:mn,fcm:mn},xn=we({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),wn={single:"min",complete:"max"},_n=function(e,t,n,r,i){for(var o,a=0,s=1/0,u=i.attributes,l=function(e,t){return on(i.distance,u.length,(function(t){return u[t](e)}),(function(e){return u[e](t)}),e,t)},c=0;c<e.length;c++){var d=e[c].key,f=n[d][r[d]];f<s&&(a=d,s=f)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var h,p=t[a],v=t[r[a]];h="dendrogram"===i.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=h,e.splice(v.index,1),t[p.key]=h;for(var g=0;g<e.length;g++){var y=e[g];p.key===y.key?o=1/0:"min"===i.linkage?(o=n[p.key][y.key],n[p.key][y.key]>n[v.key][y.key]&&(o=n[v.key][y.key])):"max"===i.linkage?(o=n[p.key][y.key],n[p.key][y.key]<n[v.key][y.key]&&(o=n[v.key][y.key])):o="mean"===i.linkage?(n[p.key][y.key]*p.size+n[v.key][y.key]*v.size)/(p.size+v.size):"dendrogram"===i.mode?l(y.value,p.value):l(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=o}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var _=e[w].key;n[b][_]<n[b][x]&&(x=_)}r[b]=x}e[m].index=m}return p.key=v.key=p.index=v.index=null,!0},En=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},kn=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0},Sn=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&En(t.left,i),t.right&&En(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&En(t.left,i),t.right&&En(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))},Pn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=xn(e),n=wn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return on(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],u=[],l=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};a[c]=d,l[c]=d,s[c]=[],u[c]=0}for(var f=0;f<a.length;f++)for(var h=0;h<=f;h++){var p=void 0;p="dendrogram"===r.mode?f===h?1/0:o(a[f].value,a[h].value):f===h?1/0:o(a[f].value[0],a[h].value[0]),s[f][h]=p,s[h][f]=p,p<s[f][u[f]]&&(u[f]=h)}for(var v,g=_n(a,l,s,u,r);g;)g=_n(a,l,s,u,r);return"dendrogram"===r.mode?(v=Sn(a[0],r.dendrogramDepth,t),r.addDendrogram&&kn(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},Cn={hierarchicalClustering:Pn,hca:Pn},jn=we({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Dn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-on(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},On=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var u=e.length,l=Math.floor(u/2);return u%2!=0?e[l+1+o]:(e[l-1+o]+e[l+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t,n},Tn=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var u=n[s];t[i*e+u]>a&&(o=u,a=t[i*e+u])}o>0&&r.push(o)}for(var l=0;l<n.length;l++)r[n[l]]=n[l];return r},Nn=function(e){for(var t,n,r,i,o,a,s=this.cy(),u=this.nodes(),l=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||pe("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||E(n)||pe("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),jn(e)}(e),c={},d=0;d<u.length;d++)c[u[d].id()]=d;n=(t=u.length)*t,r=new Array(n);for(var f=0;f<n;f++)r[f]=-1/0;for(var h=0;h<t;h++)for(var p=0;p<t;p++)h!==p&&(r[h*t+p]=Dn(l.distance,u[h],u[p],l.attributes));i=On(r,l.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var y=0;y<n;y++)a[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var _,k=new Array(t*l.minIterations),S=0;S<k.length;S++)k[S]=0;for(_=0;_<l.maxIterations;_++){for(var P=0;P<t;P++){for(var C=-1/0,j=-1/0,D=-1,O=0,T=0;T<t;T++)m[T]=o[P*t+T],(O=a[P*t+T]+r[P*t+T])>=C?(j=C,C=O,D=T):O>j&&(j=O);for(var N=0;N<t;N++)o[P*t+N]=(1-l.damping)*(r[P*t+N]-C)+l.damping*m[N];o[P*t+D]=(1-l.damping)*(r[P*t+D]-j)+l.damping*m[D]}for(var A=0;A<t;A++){for(var M=0,B=0;B<t;B++)m[B]=a[B*t+A],b[B]=Math.max(0,o[B*t+A]),M+=b[B];M-=b[A],b[A]=o[A*t+A],M+=b[A];for(var L=0;L<t;L++)a[L*t+A]=(1-l.damping)*Math.min(0,M-b[L])+l.damping*m[L];a[A*t+A]=(1-l.damping)*(M-b[A])+l.damping*m[A]}for(var I=0,R=0;R<t;R++){var z=a[R*t+R]+o[R*t+R]>0?1:0;k[_%l.minIterations*t+R]=z,I+=z}if(I>0&&(_>=l.minIterations-1||_==l.maxIterations-1)){for(var F=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<l.minIterations;G++)x[V]+=k[G*t+V];0!==x[V]&&x[V]!==l.minIterations||F++}if(F===t)break}}for(var Y=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),q=function(e,t,n){for(var r=Tn(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,u=-1/0,l=0;l<o.length;l++){for(var c=0,d=0;d<o.length;d++)c+=t[o[d]*e+o[l]];c>u&&(s=l,u=c)}n[i]=o[s]}return Tn(e,t,n)}(t,r,Y),W={},H=0;H<Y.length;H++)W[Y[H]]=[];for(var U=0;U<u.length;U++){var X=q[c[u[U].id()]];null!=X&&W[X].push(u[U])}for(var K=new Array(Y.length),Q=0;Q<Y.length;Q++)K[Q]=s.collection(W[Y[Q]]);return K},An={affinityPropagation:Nn,ap:Nn},Mn=we({root:void 0,directed:!1}),Bn=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={},s=function s(u,l,c){u===c&&(r+=1),t[l]={id:n,low:n++,cutVertex:!1};var d,f,h,p,v=e.getElementById(l).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(l))):v.forEach((function(n){d=n.source().id(),f=n.target().id(),(h=d===l?f:d)!==c&&(p=n.id(),a[p]||(a[p]=!0,o.push({x:l,y:h,edge:n})),h in t?t[l].low=Math.min(t[l].low,t[h].id):(s(u,h,l),t[l].low=Math.min(t[l].low,t[h].low),t[l].id<=t[h].low&&(t[l].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],u=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);u.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);u.merge(n),t[r].cutVertex?u.merge(i.filter((function(e){return e.isLoop()}))):u.merge(i)}))})),i.push(u)}(l,h))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var u=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(u),components:i}},Ln=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var u=e.spawn();;){var l=i.pop();if(u.merge(e.getElementById(l)),t[l].low=t[s].index,t[l].explored=!0,l===s)break}var c=u.edgesWith(u),d=u.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},In={};[Te,Ae,Me,Le,Re,Fe,qe,At,Bt,It,zt,Kt,bn,Cn,An,{hierholzer:function(e){if(!_(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=Mn(e),a=o.root,s=o.directed,u=this,l=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?u.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?l=!0:n=t:1==s?r?l=!0:r=t:(s>1||a>1)&&(l=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):u.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?l=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var f={found:!1,trail:void 0};if(l)return f;if(r&&n)if(s){if(i&&r!=i)return f;i=r}else{if(i&&r!=i&&n!=i)return f;i||(i=r)}else i||(i=u[0].id());var h=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},p=[],v=[];for(v=h(i);1!=v.length;)0==c[v[0]].length?(p.unshift(u.getElementById(v.shift())),p.unshift(u.getElementById(v.shift()))):v=h(v.shift()).concat(v);for(var g in p.unshift(u.getElementById(v.shift())),c)if(c[g].length)return f;return f.found=!0,f.trail=this.spawn(p,!0),f}},{hopcroftTarjanBiconnected:Bn,htbc:Bn,htb:Bn,hopcroftTarjanBiconnectedComponents:Bn},{tarjanStronglyConnected:Ln,tsc:Ln,tscc:Ln,tarjanStronglyConnectedComponents:Ln}].forEach((function(e){z(In,e)}));var Rn=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Rn.prototype={fulfill:function(e){return zn(this,1,"fulfillValue",e)},reject:function(e){return zn(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new Rn;return n.onFulfilled.push(Gn(e,r,"fulfill")),n.onRejected.push(Gn(t,r,"reject")),Fn(n),r.proxy}};var zn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Fn(e)),e},Fn=function(e){1===e.state?Vn(e,"onFulfilled",e.fulfillValue):2===e.state&&Vn(e,"onRejected",e.rejectReason)},Vn=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Gn=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}Yn(t,i)}}},Yn=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===a(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};Rn.all=function(e){return new Rn((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},Rn.resolve=function(e){return new Rn((function(t,n){t(e)}))},Rn.reject=function(e){return new Rn((function(t,n){n(e)}))};var qn="undefined"!=typeof Promise?Promise:Rn,Wn=function(e,t,n){var r=j(e),i=!r,o=this._private=z({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&x(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Hn=Wn.prototype;z(Hn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),S(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new qn((function(e,n){t.push((function(){e()}))}))}}),Hn.complete=Hn.completed,Hn.run=Hn.play,Hn.running=Hn.playing;var Un={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){t[n]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,i=r?n:[n],o=this._private.cy||this,a=!r,s=!a;if(!o.styleEnabled())return this;var u=o.style();if(e=z({},e,t),0===Object.keys(e).length)return new Wn(i[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=u.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var l=e.renderedPosition,c=o.pan(),d=o.zoom();e.position=He(l,d,c)}if(a&&null!=e.panBy){var f=e.panBy,h=o.pan();e.pan={x:h.x+f.x,y:h.y+f.y}}var p=e.center||e.centre;if(a&&null!=p){var v=o.getCenterPan(p.eles,e.zoom);null!=v&&(e.pan=v)}if(a&&null!=e.fit){var g=e.fit,y=o.getFitViewport(g.eles||g.boundingBox,g.padding);null!=y&&(e.pan=y.pan,e.zoom=y.zoom)}if(a&&_(e.zoom)){var m=o.getZoomedViewport(e.zoom);null!=m?(m.zoomed&&(e.zoom=m.zoom),m.panned&&(e.pan=m.pan)):e.zoom=null}return new Wn(i[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=z({},e,t));for(var i=0;i<r.length;i++){var o=r[i],a=o.animated()&&(void 0===e.queue||e.queue);o.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<r.length;o++){for(var a=r[o]._private,s=a.animation.current,u=0;u<s.length;u++){var l=s[u]._private;t&&(l.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return i.notify("draw"),this}}},Xn={data:function(e){return e=z({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,o=void 0!==i.length,a=o?i:[i],s=o?i[0]:i;if(b(t)){var u;if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),u=s._private[r.field][t]),u;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var l=c({},t,n);r.beforeSet(i,l);for(var d=0,f=a.length;d<f;d++){var h=a[d];r.canSet(h)&&(h._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&_(t)){var p,v,g=t,y=Object.keys(g);r.beforeSet(i,g);for(var m=0;m<y.length;m++){if(v=g[p=y[m]],!r.immutableKeys[p])for(var w=0;w<a.length;w++){var E=a[w];r.canSet(E)&&(E._private[r.field][p]=v)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t)){var k=t;i.on(r.bindingEvent,k)}else if(r.allowGetting&&void 0===t){var S;return s&&(r.beforeGet(s),S=s._private[r.field]),S}return i}},removeData:function(e){return e=z({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=void 0!==r.length?r:[r];if(b(t)){for(var o=t.split(/\s+/),a=o.length,s=0;s<a;s++){var u=o[s];if(!O(u))if(!n.immutableKeys[u])for(var l=0,c=i.length;l<c;l++)i[l]._private[n.field][u]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var d=0,f=i.length;d<f;d++)for(var h=i[d]._private[n.field],p=Object.keys(h),v=0;v<p.length;v++){var g=p[v];!n.immutableKeys[g]&&(h[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},Kn={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new qn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}},Qn={};[Un,Xn,Kn].forEach((function(e){z(Qn,e)}));var Zn={animate:Qn.animate(),animation:Qn.animation(),animated:Qn.animated(),clearQueue:Qn.clearQueue(),delay:Qn.delay(),delayAnimation:Qn.delayAnimation(),stop:Qn.stop()},Jn={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new je(e),o=0;o<t.length;o++){for(var a=t[o],s=a._private,u=s.classes,l=!1,c=0;c<e.length;c++){var d=e[c];if(!u.has(d)){l=!0;break}}l||(l=u.size!==e.length),l&&(s.classes=i,r.push(a))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o<a;o++)for(var s=n[o],u=s._private.classes,l=!1,c=0;c<e.length;c++){var d=e[c],f=u.has(d),h=!1;t||r&&!f?(u.add(d),h=!0):(!t||r&&f)&&(u.delete(d),h=!0),!l&&h&&(i.push(s),l=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Jn.className=Jn.classNames=Jn.classes;var $n={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:I,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};$n.variable="(?:[\\w-]|(?:\\\\"+$n.metaChar+"))+",$n.value=$n.string+"|"+$n.number,$n.className=$n.variable,$n.id=$n.variable,function(){var e,t,n;for(e=$n.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],$n.comparatorOp+="|@"+t;for(e=$n.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&($n.comparatorOp+="|\\!"+t)}();var er=0,tr=1,nr=2,rr=3,ir=4,or=5,ar=6,sr=7,ur=8,lr=9,cr=10,dr=11,fr=12,hr=13,pr=14,vr=15,gr=16,yr=17,mr=18,br=19,xr=20,wr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*R(e,t)}(e.selector,t.selector)})),_r=function(){for(var e,t={},n=0;n<wr.length;n++)t[(e=wr[n]).selector]=e.matches;return t}(),Er="("+wr.map((function(e){return e.selector})).join("|")+")",kr=function(e){return e.replace(new RegExp("\\\\("+$n.metaChar+")","g"),(function(e,t){return t}))},Sr=function(e,t,n){e[e.length-1]=n},Pr=[{name:"group",query:!0,regex:"("+$n.group+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:er,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Er,populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:sr,value:r})}},{name:"id",query:!0,regex:"\\#("+$n.id+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:ur,value:kr(r)})}},{name:"className",query:!0,regex:"\\.("+$n.className+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:lr,value:kr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+$n.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:ir,field:kr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+$n.variable+")\\s*("+$n.comparatorOp+")\\s*("+$n.value+")\\s*\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+$n.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:rr,field:kr(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+$n.boolOp+")\\s*("+$n.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,2),i=r[0],o=r[1];t.checks.push({type:or,field:kr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+$n.meta+")\\s*("+$n.comparatorOp+")\\s*("+$n.number+")\\s*\\]\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];t.checks.push({type:ar,field:kr(i),operator:o,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:$n.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:$n.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:dr,source:r,target:i}),Sr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:fr,source:a,target:s}),Sr(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:$n.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:cr,nodes:[r,i]}),Sr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:pr,node:a,neighbor:s}),Sr(e,0,o),s}},{name:"child",separator:!0,regex:$n.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:vr,parent:i,child:r}),Sr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},u={checks:[]},l={checks:[]},c={checks:[]};return o.checks.push({type:br,left:a,right:s,subject:u}),u.checks=t.checks,t.checks=[{type:xr}],c.checks.push({type:xr}),s.checks.push({type:yr,parent:c,child:l}),Sr(e,0,o),e.currentSubject=u,e.compoundCount++,l}var d={checks:[]},f={checks:[]},h=[{type:yr,parent:d,child:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"descendant",separator:!0,regex:$n.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:gr,ancestor:i,descendant:r}),Sr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},a=e[e.length-1],s={checks:[]},u={checks:[]},l={checks:[]},c={checks:[]};return o.checks.push({type:br,left:a,right:s,subject:u}),u.checks=t.checks,t.checks=[{type:xr}],c.checks.push({type:xr}),s.checks.push({type:mr,ancestor:c,descendant:l}),Sr(e,0,o),e.currentSubject=u,e.compoundCount++,l}var d={checks:[]},f={checks:[]},h=[{type:mr,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"subject",modifier:!0,regex:$n.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return ge("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===dr?n.type=hr:r===cr&&(n.type=pr,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Pr.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Cr=function(e){for(var t,n,r,i=0;i<Pr.length;i++){var o=Pr[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a;var u=s[0];e=e.substring(u.length);break}}return{expr:t,match:n,name:r,remaining:e}},jr={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(n);;){var i=Cr(n);if(null==i.expr)return ge("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),a=i.expr.populate(t,r,o);if(!1===a)return!1;if(null!=a&&(r=a),(n=i.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var l=t[u];if(l.compoundCount>0&&l.edgeCount>0)return ge("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return ge("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===l.edgeCount&&ge("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,o){var a=r.type,s=r.value;switch(a){case er:var u=e(s);return u.substring(0,u.length-1);case rr:var l=r.field,c=r.operator;return"["+l+n(e(c))+t(s)+"]";case or:var d=r.operator,f=r.field;return"["+e(d)+f+"]";case ir:return"["+r.field+"]";case ar:var h=r.operator;return"[["+r.field+n(e(h))+t(s)+"]]";case sr:return s;case ur:return"#"+s;case lr:return"."+s;case yr:case vr:return i(r.parent,o)+n(">")+i(r.child,o);case mr:case gr:return i(r.ancestor,o)+" "+i(r.descendant,o);case br:var p=i(r.left,o),v=i(r.subject,o),g=i(r.right,o);return p+(p.length>0?" ":"")+v+g;case xr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,o){return n+(t===e&&0===o?"$":"")+r(i,t)}),"")},o="",a=0;a<this.length;a++){var s=this[a];o+=i(s,s.subject),this.length>1&&a<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},Dr=function(e,t,n){var r,i,o,a=b(e),s=E(e),u=b(n),l=!1,c=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),l=!0),(a||u||l)&&(i=a||s?""+e:"",o=""+n),l&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!c||null==e&&d||(r=!r),r},Or=function(e,t){return e.data(t)},Tr=[],Nr=function(e,t){return e.checks.every((function(e){return Tr[e.type](e,t)}))};Tr[er]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Tr[sr]=function(e,t){return function(e,t){return _r[e](t)}(e.value,t)},Tr[ur]=function(e,t){var n=e.value;return t.id()===n},Tr[lr]=function(e,t){var n=e.value;return t.hasClass(n)},Tr[ar]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Dr(function(e,t){return e[t]()}(t,n),r,i)},Tr[rr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Dr(Or(t,n),r,i)},Tr[or]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Or(t,n),r)},Tr[ir]=function(e,t){var n=e.field;e.operator;return void 0!==Or(t,n)},Tr[cr]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return Nr(n,i)&&Nr(r,o)||Nr(r,i)&&Nr(n,o)},Tr[pr]=function(e,t){return Nr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Nr(e.neighbor,t)}))},Tr[dr]=function(e,t){return Nr(e.source,t.source())&&Nr(e.target,t.target())},Tr[fr]=function(e,t){return Nr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Nr(e.target,t)}))},Tr[hr]=function(e,t){return Nr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Nr(e.source,t)}))},Tr[vr]=function(e,t){return Nr(e.child,t)&&Nr(e.parent,t.parent())},Tr[yr]=function(e,t){return Nr(e.parent,t)&&t.children().some((function(t){return Nr(e.child,t)}))},Tr[gr]=function(e,t){return Nr(e.descendant,t)&&t.ancestors().some((function(t){return Nr(e.ancestor,t)}))},Tr[mr]=function(e,t){return Nr(e.ancestor,t)&&t.descendants().some((function(t){return Nr(e.descendant,t)}))},Tr[br]=function(e,t){return Nr(e.subject,t)&&Nr(e.left,t)&&Nr(e.right,t)},Tr[xr]=function(){return!0},Tr[tr]=function(e,t){return e.value.has(t)},Tr[nr]=function(e,t){return(0,e.value)(t)};var Ar={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Nr(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===ur)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Nr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Mr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(S(e)?this.addQuery({checks:[{type:tr,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:nr,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):pe("A selector must be created from a string; found "))},Br=Mr.prototype;[jr,Ar].forEach((function(e){return z(Br,e)})),Br.text=function(){return this.inputText},Br.size=function(){return this.length},Br.eq=function(e){return this[e]},Br.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Br.addQuery=function(e){this[this.length++]=e},Br.selector=Br.toString;var Lr={allAre:function(e){var t=new Mr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Mr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};Lr.allAreNeighbours=Lr.allAreNeighbors,Lr.has=Lr.contains,Lr.equal=Lr.equals=Lr.same;var Ir,Rr,zr=function(e,t){return function(n,r,i,o){var a,s=n,u=this;if(null==s?a="":S(s)&&1===s.length&&(a=s.id()),1===u.length&&a){var l=u[0]._private,c=l.traversalCache=l.traversalCache||{},d=c[t]=c[t]||[],f=re(a),h=d[f];return h||(d[f]=e.call(u,n,r,i,o))}return e.call(u,n,r,i,o)}},Fr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:zr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Vr(e,t,n,r){for(var i=[],o=new je,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var u=e[s];n?i.push(u):a&&r(i,o,u)}for(;i.length>0;){var l=i.shift();t(l),o.add(l.id()),a&&r(i,o,l)}return e}function Gr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function Yr(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function qr(e,t,n){Yr(e,t,n),Gr(e,t,n)}Fr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,Gr)},Fr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,Yr)},Fr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Vr(this,e,t,qr)},Fr.ancestors=Fr.parents,(Ir=Rr={data:Qn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Qn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Qn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ir.data,Ir.removeAttr=Ir.removeData;var Wr,Hr,Ur=Rr,Xr={};function Kr(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;a<o.length;a++){var s=o[a];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function Qr(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}z(Xr,{degree:Kr((function(e,t){return t.source().same(t.target())?2:1})),indegree:Kr((function(e,t){return t.target().same(e)?1:0})),outdegree:Kr((function(e,t){return t.source().same(e)?1:0}))}),z(Xr,{minDegree:Qr("degree",(function(e,t){return e<t})),maxDegree:Qr("degree",(function(e,t){return e>t})),minIndegree:Qr("indegree",(function(e,t){return e<t})),maxIndegree:Qr("indegree",(function(e,t){return e>t})),minOutdegree:Qr("outdegree",(function(e,t){return e<t})),maxOutdegree:Qr("outdegree",(function(e,t){return e>t}))}),z(Xr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Zr=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},Jr={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Zr(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Wr=Hr={position:Qn.data(Jr),silentPosition:Qn.data(z({},Jr,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Zr(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(_(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(_(e)?(r={x:E(e.x)?e.x:0,y:E(e.y)?e.y:0},n=t):b(e)&&E(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o],s=a.position(),u={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(u):a.position(u)}i.endBatch()}return this},silentShift:function(e,t){return _(e)?this.shift(e,!0):b(e)&&E(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=_(e)?e:void 0,s=void 0!==a||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var u=n.position();return a=We(u,i,o),void 0===e?a:a[e]}for(var l=0;l<this.length;l++){var c=this[l];void 0!==t?c.position(e,(t-o[e])/i):void 0!==a&&c.position(He(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=_(e)?e:void 0,o=void 0!==i||void 0!==t&&b(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),u=a?n.parent():null,l=u&&u.length>0,c=l;l&&(u=u[0]);var d=c?u.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var f=0;f<this.length;f++){var h=this[f],p=a?h.parent():null,v=p&&p.length>0,g=v;v&&(p=p[0]);var y=g?p.position():{x:0,y:0};void 0!==t?h.position(e,t+y[e]):void 0!==i&&h.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Wr.modelPosition=Wr.point=Wr.position,Wr.modelPositions=Wr.points=Wr.positions,Wr.renderedPoint=Wr.renderedPosition,Wr.relativePoint=Wr.relativePosition;var $r,ei,ti=Hr;$r=ei={},ei.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,u=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:u,w:a-o,h:u-s}},ei.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},ei.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var u=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(u=100*u/i.width.val);var l=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(l=100*l/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,u),f=d.biasDiff,h=d.biasComplementDiff,p=y(i.height.val-o.h,l,c),v=p.biasDiff,g=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-f+o.x1+o.x2+h)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var ni=function(e){return e===1/0||e===-1/0?0:e},ri=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ii=function(e,t){return null==t?e:ri(e,t.x1,t.y1,t.x2,t.y2)},oi=function(e,t,n){return ke(e,t,n)},ai=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var u=o.arrowBounds=o.arrowBounds||{},l=u[n]=u[n]||{};l.x1=r-s,l.y1=i-s,l.x2=r+s,l.y2=i+s,l.w=l.x2-l.x1,l.h=l.y2-l.y1,ot(l,1),ri(e,l.x1,l.y1,l.x2,l.y2)}}},si=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,u,l,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),f=oi(o,"labelWidth",n),h=oi(o,"labelHeight",n),p=oi(o,"labelX",n),v=oi(o,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,_=t.pstyle("text-background-padding").pfValue,E=h,k=f,S=k/2,P=E/2;if(m)a=p-S,s=p+S,u=v-P,l=v+P;else{switch(c.value){case"left":a=p-k,s=p;break;case"center":a=p-S,s=p+S;break;case"right":a=p,s=p+k}switch(d.value){case"top":u=v-E,l=v;break;case"center":u=v-P,l=v+P;break;case"bottom":u=v,l=v+E}}a+=g-Math.max(x,w)-_-2,s+=g+Math.max(x,w)+_+2,u+=y-Math.max(x,w)-_-2,l+=y+Math.max(x,w)+_+2;var C=n||"main",j=i.labelBounds,D=j[C]=j[C]||{};D.x1=a,D.y1=u,D.x2=s,D.y2=l,D.w=s-a,D.h=l-u;var O=m&&"autorotate"===b.strValue,T=null!=b.pfValue&&0!==b.pfValue;if(O||T){var N=O?oi(i.rstyle,"labelAngle",n):b.pfValue,A=Math.cos(N),M=Math.sin(N),B=(a+s)/2,L=(u+l)/2;if(!m){switch(c.value){case"left":B=s;break;case"right":B=a}switch(d.value){case"top":L=l;break;case"bottom":L=u}}var I=function(e,t){return{x:(e-=B)*A-(t-=L)*M+B,y:e*M+t*A+L}},R=I(a,u),z=I(a,l),F=I(s,u),V=I(s,l);a=Math.min(R.x,z.x,F.x,V.x),s=Math.max(R.x,z.x,F.x,V.x),u=Math.min(R.y,z.y,F.y,V.y),l=Math.max(R.y,z.y,F.y,V.y)}var G=C+"Rot",Y=j[G]=j[G]||{};Y.x1=a,Y.y1=u,Y.x2=s,Y.y2=l,Y.w=s-a,Y.h=l-u,ri(e,a,u,s,l),ri(i.labelBounds.all,a,u,s,l)}return e}},ui=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},li=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return J({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},ci=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?fi:ui(t))===fi,a=li(e),s=r.bbCachePosKey===a,u=t.useCache&&s,l=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!u||l(e)||i&&l(e.source())||l(e.target())?(s||e.recalculateRenderedStyle(u),n=function(e,t){var n,r,i,o,a,s,u,l=e._private.cy,c=l.styleEnabled(),d=l.headless(),f=rt(),h=e._private,p=e.isNode(),v=e.isEdge(),g=h.rstyle,y=p&&c?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!c||m(e)&&(!v||m(e.source())&&m(e.target()));if(b){var x=0;c&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;if(c&&(w=e.pstyle("width").pfValue/2),p&&t.includeNodes){var _=e.position();a=_.x,s=_.y;var E=e.outerWidth()/2,k=e.outerHeight()/2;ri(f,n=a-E,i=s-k,r=a+E,o=s+k)}else if(v&&t.includeEdges)if(c&&!d){var S=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),ri(f,n-=w,i-=w,r+=w,o+=w),"haystack"===S){var P=g.haystackPts;if(P&&2===P.length){if(n=P[0].x,i=P[0].y,n>(r=P[1].x)){var C=n;n=r,r=C}if(i>(o=P[1].y)){var j=i;i=o,o=j}ri(f,n-w,i-w,r+w,o+w)}}else if("bezier"===S||"unbundled-bezier"===S||"segments"===S||"taxi"===S){var D;switch(S){case"bezier":case"unbundled-bezier":D=g.bezierPts;break;case"segments":case"taxi":D=g.linePts}if(null!=D)for(var O=0;O<D.length;O++){var T=D[O];n=T.x-w,r=T.x+w,i=T.y-w,o=T.y+w,ri(f,n,i,r,o)}}}else{var N=e.source().position(),A=e.target().position();if((n=N.x)>(r=A.x)){var M=n;n=r,r=M}if((i=N.y)>(o=A.y)){var B=i;i=o,o=B}ri(f,n-=w,i-=w,r+=w,o+=w)}if(c&&t.includeEdges&&v&&(ai(f,e,"mid-source"),ai(f,e,"mid-target"),ai(f,e,"source"),ai(f,e,"target")),c&&"yes"===e.pstyle("ghost").value){var L=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue;ri(f,f.x1+L,f.y1+I,f.x2+L,f.y2+I)}var R=h.bodyBounds=h.bodyBounds||{};st(R,f),at(R,y),ot(R,1),c&&(n=f.x1,r=f.x2,i=f.y1,o=f.y2,ri(f,n-x,i-x,r+x,o+x));var z=h.overlayBounds=h.overlayBounds||{};st(z,f),at(z,y),ot(z,1);var F=h.labelBounds=h.labelBounds||{};null!=F.all?((u=F.all).x1=1/0,u.y1=1/0,u.x2=-1/0,u.y2=-1/0,u.w=0,u.h=0):F.all=rt(),c&&t.includeLabels&&(t.includeMainLabels&&si(f,e,null),v&&(t.includeSourceLabels&&si(f,e,"source"),t.includeTargetLabels&&si(f,e,"target")))}return f.x1=ni(f.x1),f.y1=ni(f.y1),f.x2=ni(f.x2),f.y2=ni(f.y2),f.w=ni(f.x2-f.x1),f.h=ni(f.y2-f.y1),f.w>0&&f.h>0&&b&&(at(f,y),ot(f,1)),f}(e,di),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=rt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ii(n,r.overlayBounds):ii(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ii(n,r.labelBounds.all):(t.includeMainLabels&&ii(n,r.labelBounds.mainRot),t.includeSourceLabels&&ii(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ii(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},di={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},fi=ui(di),hi=we(di);ei.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=rt();var n=hi(e=e||di),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var o=r[i],a=o._private,s=li(o),u=a.bbCachePosKey===s,l=n.useCache&&u&&!a.styleDirty;o.recalculateRenderedStyle(l)}this.updateCompoundBounds(!e.useCache);for(var c=0;c<r.length;c++){var d=r[c];ii(t,ci(d,n))}}else e=void 0===e?di:hi(e),t=ci(this[0],e);return t.x1=ni(t.x1),t.y1=ni(t.y1),t.x2=ni(t.x2),t.y2=ni(t.y2),t.w=ni(t.x2-t.x1),t.h=ni(t.y2-t.y1),t},ei.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},ei.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),_(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},$r.boundingbox=$r.bb=$r.boundingBox,$r.renderedBoundingbox=$r.renderedBoundingBox;var pi,vi,gi=ei;pi=vi={};var yi=function(e){e.uppercaseName=L(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=L(e.outerName),pi[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}return 1}},pi["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},pi["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},pi["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};yi({name:"width"}),yi({name:"height"}),vi.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},vi.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},vi.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var mi=vi,bi={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},xi=Object.keys(bi).reduce((function(e,t){var n=bi[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return We(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return We(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),wi=z({},ti,gi,mi,xi),_i=function(e,t){this.recycle(e,t)};function Ei(){return!1}function ki(){return!0}_i.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ei,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ki:Ei):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=ki;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=ki;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ki,this.stopPropagation()},isDefaultPrevented:Ei,isPropagationStopped:Ei,isImmediatePropagationStopped:Ei};var Si=/^([^.]+)(\.(?:[^.]+))?$/,Pi={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ci=Object.keys(Pi),ji={};function Di(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ji,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ci.length;n++){var r=Ci[n];this[r]=e[r]||Pi[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Oi=Di.prototype,Ti=function(e,t,n,r,i,o,a){x(r)&&(i=r,r=null),a&&(o=null==o?a:z({},o,a));for(var s=w(n)?n:n.split(/\s+/),u=0;u<s.length;u++){var l=s[u];if(!O(l)){var c=l.match(Si);if(c)if(!1===t(e,l,c[1],c[2]?c[2]:null,r,i,o))break}}},Ni=function(e,t){return e.addEventFields(e.context,t),new _i(t.type,t)},Ai=function(e,t,n){if("event"!==m(n))if(_(n))t(e,Ni(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!O(o)){var a=o.match(Si);if(a){var s=a[1],u=a[2]?a[2]:null;t(e,Ni(e,{type:s,namespace:u,target:e.context}))}}}else t(e,n)};Oi.on=Oi.addListener=function(e,t,n,r,i){return Ti(this,(function(e,t,n,r,i,o,a){x(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Oi.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Oi.removeListener=Oi.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];Ti(i,(function(t,n,r,i,u,l){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!u||t.qualifierCompare(s.qualifier,u))&&(!l||s.callback===l))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(s);return this},Oi.removeAllListeners=function(){return this.removeListener("*")},Oi.emit=Oi.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),Ai(this,(function(e,o){null!=n&&(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}],i=r.length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),u=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===u&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var Mi={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&P(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Bi=function(e){return b(e)?new Mr(e):e},Li={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Di(Mi,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Bi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=Bi(t),i=0;i<this.length;i++){this[i].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=Bi(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=Bi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Qn.eventAliasesOn(Li);var Ii={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||S(e))return new Mr(e).filter(this);if(x(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var o=r[i];(t?e.apply(t,[o,i,r]):e(o,i,r))&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,i=this.length<e.length,o=i?this:r,a=i?r:this,s=0;s<o.length;s++){var u=o[s];a.has(u)&&n.push(u)}return n},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],o=i._private.data.id;t.hasElementWithId(o)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],a=o._private.data.id;t.hasElementWithId(a)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],a=!this.has(o);a&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var u=this.length++;this[u]=a,i.set(s,{ele:a,index:u})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var o=r[i],a=t?e.apply(t,[o,i,r]):e(o,i,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n,r=-1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s>r&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);s<r&&(r=s,n=a)}return{value:r,ele:n}}},Ri=Ii;Ri.u=Ri["|"]=Ri["+"]=Ri.union=Ri.or=Ri.add,Ri["\\"]=Ri["!"]=Ri["-"]=Ri.difference=Ri.relativeComplement=Ri.subtract=Ri.not,Ri.n=Ri["&"]=Ri["."]=Ri.and=Ri.intersection=Ri.intersect,Ri["^"]=Ri["(+)"]=Ri["(-)"]=Ri.symmetricDifference=Ri.symdiff=Ri.xor,Ri.fnFilter=Ri.filterFn=Ri.stdFilter=Ri.filter,Ri.complement=Ri.abscomp=Ri.absoluteComplement;var zi=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?le:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},Fi={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(zi)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:le-1}var r=t.source,i=t.target,o=r.zDepth(),a=i.zDepth();return Math.max(o,a,0)}}};Fi.each=Fi.forEach;var Vi;Vi="undefined",("undefined"==typeof Symbol?"undefined":a(Symbol))!=Vi&&a(Symbol.iterator)!=Vi&&(Fi[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return c({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Gi=we({nodeDimensionsIncludeLabels:!1}),Yi={layoutDimensions:function(e){var t;if(e=Gi(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=N(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=t.spacingFactor&&1!==t.spacingFactor,l=function(){if(!u)return null;for(var e=rt(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);it(e,i.x,i.y)}return e}(),c=N((function(e,n){var r=s(e,n);u&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),l,r));return null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var f=r[d],h=c(f,d);if(null==t.animateFilter||t.animateFilter(f,d)){var p=f.animation({position:h,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else f.position(h)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),qn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(c),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(z({},e,{eles:this}))}};function qi(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function Wi(e,t){return e=re(e),function(n){return qi(e,t,n)}}function Hi(e,t){e=re(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return qi(e,n,t)}}Yi.createLayout=Yi.makeLayout=Yi.layout;var Ui={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(_(e)){var i=e;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var o=this[0];return o?r.getStylePropertyValue(o,e):void 0}r.applyBypass(this,e,t,false),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style(),r=this;if(void 0===e)for(var i=0;i<r.length;i++){var o=r[i];n.removeAllBypasses(o,false)}else{e=e.split(/\s+/);for(var a=0;a<r.length;a++){var s=r[a];n.removeBypasses(s,e,false)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++){i*=o[a].pstyle("opacity").value}return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function Xi(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function Ki(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||Xi(i,r);var s=a.source,u=a.target;return n(s)&&(!o||Xi(s,n))&&(s===u||n(u)&&(!o||Xi(u,n)))}}}var Qi=Wi("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));Ui.takesUpSpace=Hi("takesUpSpace",Ki({ok:Qi}));var Zi=Wi("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&Qi(e)})),Ji=Wi("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&Qi(e)}));Ui.interactive=Hi("interactive",Ki({ok:Zi,parentOk:Ji,edgeOkViaNode:Qi})),Ui.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var $i=Wi("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&Qi(e)})),eo=Qi;Ui.visible=Hi("visible",Ki({ok:$i,edgeOkViaNode:eo})),Ui.hidden=function(){var e=this[0];if(e)return!e.visible()},Ui.isBundledBezier=Hi("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),Ui.bypass=Ui.css=Ui.style,Ui.renderedCss=Ui.renderedStyle,Ui.removeBypass=Ui.removeCss=Ui.removeStyle,Ui.pstyle=Ui.parsedStyle;var to={};function no(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&w(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var u=this[s],l=!e.ableField||u._private[e.ableField],c=u._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(u);if(void 0!==d&&(l=d,!d))return this}l&&(u._private[e.field]=e.value,c&&n.push(u))}var f=this.spawn(n);f.updateStyle(),f.emit(e.event),a&&f.emit(a)}return this}}function ro(e){to[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},to[e.on]=no({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),to[e.off]=no({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}ro({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),ro({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),ro({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),ro({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),to.deselect=to.unselect,to.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},ro({field:"active",on:"activate",off:"unactivate"}),ro({field:"pannable",on:"panify",off:"unpanify"}),to.inactive=function(){var e=this[0];if(e)return!e._private.active};var io={},oo=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var u=a[s],l=u.source(),c=u.target();if(e.noIncomingEdges&&c===i&&l!==i||e.noOutgoingEdges&&l===i&&c!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},ao=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),l=s.target();e.outgoing&&u===i?(n.push(s),n.push(l)):e.incoming&&l===i&&(n.push(s),n.push(u))}}return this.spawn(n,!0).filter(t)}},so=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var u=o[s],l=u.id();i[l]||(i[l]=!0,r.push(u),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function uo(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function lo(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var u=a[s],l=u._private.data,c=this.hasElementWithId(l.source)&&t.hasElementWithId(l.target),d=t.hasElementWithId(l.source)&&this.hasElementWithId(l.target);if(c||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c)continue;if(i.thisIsTgt&&!d)continue}n.push(u)}}return this.spawn(n,!0)}}function co(e){return e=z({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,u=s._private.data.id,l=a.data.target,c=s._private.edges,d=0;d<c.length;d++){var f=c[d],h=f._private.data,p=h.target,v=h.source,g=p===l&&v===u,y=u===p&&l===v;(i.codirected&&g||!i.codirected&&(g||y))&&n.push(f)}return this.spawn(n,!0).filter(t)}}io.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},z(io,{roots:oo({noIncomingEdges:!0}),leaves:oo({noOutgoingEdges:!0}),outgoers:zr(ao({outgoing:!0}),"outgoers"),successors:so({outgoing:!0}),incomers:zr(ao({incoming:!0}),"incomers"),predecessors:so({incoming:!0})}),z(io,{neighborhood:zr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),l=s.target(),c=i===u?l:u;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),io.neighbourhood=io.neighborhood,io.closedNeighbourhood=io.closedNeighborhood,io.openNeighbourhood=io.openNeighborhood,z(io,{source:zr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:zr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:uo({attr:"source"}),targets:uo({attr:"target"})}),z(io,{edgesWith:zr(lo(),"edgesWith"),edgesTo:zr(lo({thisIsSrc:!0}),"edgesTo")}),z(io,{connectedEdges:zr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++){var a=i[o];t.push(a)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:zr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:zr(co(),"parallelEdges"),codirectedEdges:zr(co({codirected:!0}),"codirectedEdges")}),z(io,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),io.componentsOf=io.components;var fo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){var r=new Pe,i=!1;if(t){if(t.length>0&&_(t[0])&&!P(t[0])){i=!0;for(var o=[],a=new je,s=0,u=t.length;s<u;s++){var l=t[s];null==l.data&&(l.data={});var c=l.data;if(null==c.id)c.id=me();else if(e.hasElementWithId(c.id)||a.has(c.id))continue;var d=new De(e,l,!1);o.push(d),a.add(c.id)}t=o}}else t=[];this.length=0;for(var f=0,h=t.length;f<h;f++){var p=t[f][0];if(null!=p){var v=p._private.data.id;n&&r.has(v)||(n&&r.set(v,{index:this.length,ele:p}),this[this.length]=p,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Pe,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=r),i&&this.restore()}else pe("A collection must have a reference to the core")},ho=De.prototype=fo.prototype=Object.create(Array.prototype);ho.instanceString=function(){return"collection"},ho.spawn=function(e,t){return new fo(this.cy(),e,t)},ho.spawnSelf=function(){return this.spawn(this)},ho.cy=function(){return this._private.cy},ho.renderer=function(){return this._private.cy.renderer()},ho.element=function(){return this[0]},ho.collection=function(){return C(this)?this:new fo(this._private.cy,[this])},ho.unique=function(){return new fo(this._private.cy,this,!0)},ho.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},ho.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new fo(t)},ho.$id=ho.getElementById,ho.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},ho.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},ho.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},ho.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(_(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,u=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=u&&u!=i.target&&(a.target=""+u,o=!0),o&&(t=t.move(a))}else{var l="parent"in e.data,c=e.data.parent;!l||null==c&&null==i.parent||c==i.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var d=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var f={data:ye(r.data),position:ye(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},h=0;return r.classes.forEach((function(e){return f.classes+=0==h++?e:" "+e})),f}}},ho.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},ho.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new De(e,r,!1);t.push(i)}return new fo(e,t)},ho.copy=ho.clone,ho.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],u=[],l=0,c=i.length;l<c;l++){var d=i[l];r&&!d.removed()||(d.isNode()?s.push(d):u.push(d))}e=s.concat(u);var f=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var h=e[t],p=h._private,v=p.data;if(h.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=me();else if(E(v.id))v.id=""+v.id;else{if(O(v.id)||!b(v.id)){pe("Can not create element with invalid string ID `"+v.id+"`"),f();continue}if(o.hasElementWithId(v.id)){pe("Can not create second element with ID `"+v.id+"`"),f();continue}}else;var g=v.id;if(h.isNode()){var y=p.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(h.isEdge()){for(var m=h,x=["source","target"],w=x.length,_=!1,k=0;k<w;k++){var S=x[k],P=v[S];E(P)&&(P=v[S]=""+v[S]),null==P||""===P?(pe("Can not create edge `"+g+"` with unspecified "+S),_=!0):o.hasElementWithId(P)||(pe("Can not create edge `"+g+"` with nonexistant "+S+" `"+P+"`"),_=!0)}if(_){f();continue}var C=o.getElementById(v.source),j=o.getElementById(v.target);C.same(j)?C._private.edges.push(m):(C._private.edges.push(m),j._private.edges.push(m)),m._private.source=C,m._private.target=j}p.map=new Pe,p.map.set(g,{ele:h,index:0}),p.removed=!1,r&&o.addToPool(h)}for(var D=0;D<s.length;D++){var T=s[D],N=T._private.data;E(N.parent)&&(N.parent=""+N.parent);var A=N.parent,M=null!=A;if(M){var B=o.getElementById(A);if(B.empty())N.parent=void 0;else{for(var L=!1,I=B;!I.empty();){if(T.same(I)){L=!0,N.parent=void 0;break}I=I.parent()}L||(B[0]._private.children.push(T),T._private.parent=B[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var R=e.length===i.length?i:new fo(o,e),z=0;z<R.length;z++){var F=R[z];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(R).merge(R.connectedNodes()).merge(R.parent()):R).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?R.emitAndNotify("add"):r&&R.emit("add")}return i},ho.removed=function(){var e=this[0];return e&&e._private.removed},ho.inside=function(){var e=this[0];return e&&!e._private.removed},ho.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)u(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)u(t[n])}function u(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var l=0,c=n.length;l<c;l++){var d=n[l];u(d)}function f(e,t){var n=e._private.edges;_e(n,t),e.clearTraversalCache()}function h(e){e.clearTraversalCache()}var p=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();_e(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var y=r[g];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];f(m,y),f(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var _=x[w];h(_),_.isBundledBezier()&&_.dirtyBoundingBoxCache()}}else{var E=y.parent();0!==E.length&&v(E,y)}t&&(y._private.removed=!0)}var k=o._private.elements;o._private.hasCompoundNodes=!1;for(var S=0;S<k.length;S++){var P=k[S];if(P.isParent()){o._private.hasCompoundNodes=!0;break}}var C=new fo(this.cy(),r);C.size()>0&&(e?C.emitAndNotify("remove"):t&&C.emit("remove"));for(var j=0;j<p.length;j++){var D=p[j];t&&D.removed()||D.updateStyle()}return C},ho.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,o=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var a=o(e.source),s=o(e.target),u=null!=a&&t.hasElementWithId(a),l=null!=s&&t.hasElementWithId(s);(u||l)&&(t.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],o=t._private.data;t.isEdge()&&(u&&(o.source=a),l&&(o.target=s))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var c=o(e.parent);if(null===c||t.hasElementWithId(c)){var d=null===c?void 0:c;t.batch((function(){var e=n.remove(r,i);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var o=n[t],a=o._private.data;o.isNode()&&(a.parent=d)}e.restore(r,i)})),n.emitAndNotify("move")}}return this},[In,Zn,Jn,Lr,Fr,Ur,Xr,wi,Li,Ii,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Fi,Yi,Ui,to,io].forEach((function(e){z(ho,e)}));var po={add:function(e){var t,n=this;if(S(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(a.json())}t=new fo(n,i)}}else if(w(e)){t=new fo(n,e)}else if(_(e)&&(w(e.nodes)||w(e.edges))){for(var s=e,u=[],l=["nodes","edges"],c=0,d=l.length;c<d;c++){var f=l[c],h=s[f];if(w(h))for(var p=0,v=h.length;p<v;p++){var g=z({group:f},h[p]);u.push(g)}}t=new fo(n,u)}else{t=new De(n,e).collection()}return t},remove:function(e){if(S(e));else if(b(e)){var t=e;e=this.$(t)}return e.remove()}};var vo=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),u=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),l=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+u*r,n.v=n.v+l*r,n}return function e(t,r,i){var o,a,s,u={x:-1,v:0,tension:null,friction:null},l=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,u.tension=t,u.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||u,a),l.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return l[e*(l.length-1)|0]}:c}}(),go=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=1e-7,s=10,u=11,l=1/(u-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var f=c?new Float32Array(u):new Array(u);function h(e,t){return 1-3*t+3*e}function p(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((h(t,n)*e+p(t,n))*e+v(t))*e}function y(e,t,n){return 3*h(t,n)*e*e+2*p(t,n)*e+v(t)}function m(t,r){for(var o=0;o<i;++o){var a=y(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<u;++t)f[t]=g(t*l,e,n)}function x(t,r,i){var o,u,l=0;do{(o=g(u=r+(i-r)/2,e,n)-t)>0?i=u:r=u}while(Math.abs(o)>a&&++l<s);return u}function w(t){for(var r=0,i=1,a=u-1;i!==a&&f[i]<=t;++i)r+=l;--i;var s=r+(t-f[i])/(f[i+1]-f[i])*l,c=y(s,e,n);return c>=o?m(t,s):0===c?s:x(t,r,r+l)}var _=!1;function E(){_=!0,e===t&&n===r||b()}var k=function(i){return _||E(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};k.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return k.toString=function(){return S},k}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},yo={linear:function(e,t,n){return e+(t-e)*n},ease:go(.25,.1,.25,1),"ease-in":go(.42,0,1,1),"ease-out":go(0,0,.58,1),"ease-in-out":go(.42,0,.58,1),"ease-in-sine":go(.47,0,.745,.715),"ease-out-sine":go(.39,.575,.565,1),"ease-in-out-sine":go(.445,.05,.55,.95),"ease-in-quad":go(.55,.085,.68,.53),"ease-out-quad":go(.25,.46,.45,.94),"ease-in-out-quad":go(.455,.03,.515,.955),"ease-in-cubic":go(.55,.055,.675,.19),"ease-out-cubic":go(.215,.61,.355,1),"ease-in-out-cubic":go(.645,.045,.355,1),"ease-in-quart":go(.895,.03,.685,.22),"ease-out-quart":go(.165,.84,.44,1),"ease-in-out-quart":go(.77,0,.175,1),"ease-in-quint":go(.755,.05,.855,.06),"ease-out-quint":go(.23,1,.32,1),"ease-in-out-quint":go(.86,0,.07,1),"ease-in-expo":go(.95,.05,.795,.035),"ease-out-expo":go(.19,1,.22,1),"ease-in-out-expo":go(1,0,0,1),"ease-in-circ":go(.6,.04,.98,.335),"ease-out-circ":go(.075,.82,.165,1),"ease-in-out-circ":go(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return yo.linear;var r=vo(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":go};function mo(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function bo(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function xo(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=bo(e,i),s=bo(t,i);if(E(a)&&E(s))return mo(o,a,s,n,r);if(w(a)&&w(s)){for(var u=[],l=0;l<s.length;l++){var c=a[l],d=s[l];if(null!=c&&null!=d){var f=mo(o,c,d,n,r);u.push(f)}else u.push(d)}return u}}function wo(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,u=a.startTime,l=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=yo.linear;else{var c,d,f;if(b(s))c=l.parse("transition-timing-function",s).value;else c=s;b(c)?(d=c,f=[]):(d=c[1],f=c.slice(2).map((function(e){return+e}))),f.length>0?("spring"===d&&f.push(a.duration),a.easingImpl=yo[d].apply(null,f)):a.easingImpl=yo[d]}var h,p=a.easingImpl;if(h=0===a.duration?1:(n-u)/a.duration,a.applying&&(h=a.progress),h<0?h=0:h>1&&(h=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var y={};_o(v.x,g.x)&&(y.x=xo(v.x,g.x,h,p)),_o(v.y,g.y)&&(y.y=xo(v.y,g.y,h,p)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,_=null!=x&&r;_&&(_o(m.x,x.x)&&(w.x=xo(m.x,x.x,h,p)),_o(m.y,x.y)&&(w.y=xo(m.y,x.y,h,p)),e.emit("pan"));var E=a.startZoom,k=a.zoom,S=null!=k&&r;S&&(_o(E,k)&&(o.zoom=nt(o.minZoom,xo(E,k,h,p),o.maxZoom)),e.emit("zoom")),(_||S)&&e.emit("viewport");var P=a.style;if(P&&P.length>0&&i){for(var C=0;C<P.length;C++){var j=P[C],D=j.name,O=j,T=a.startStyle[D],N=xo(T,O,h,p,l.properties[T.name]);l.overrideBypass(e,D,N)}e.emit("style")}}return a.progress=h,h}function _o(e,t){return null!=e&&null!=t&&(!(!E(e)||!E(t))||!(!e||!t))}function Eo(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function ko(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var u=a.shift();u&&o.push(u)}for(var l=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],f=d._private;f.stopped?(o.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.frames)):(f.playing||f.applying)&&(f.playing&&f.applying&&(f.applying=!1),f.started||Eo(0,d,e),wo(t,d,e,n),f.applying&&(f.applying=!1),l(f.frames),null!=f.step&&f.step(e),d.completed()&&(o.splice(c,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var u=i(t,!0);(o||u)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var So={animate:Qn.animate(),animation:Qn.animation(),animated:Qn.animated(),clearQueue:Qn.clearQueue(),delay:Qn.delay(),delayAnimation:Qn.delayAnimation(),stop:Qn.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){ko(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&U((function(n){ko(n,e),t()}))}()}}},Po={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&P(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Co=function(e){return b(e)?new Mr(e):e},jo={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Di(Po,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Co(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Co(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Co(t),n),this},once:function(e,t,n){return this.emitter().one(e,Co(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Qn.eventAliasesOn(jo);var Do={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Do.jpeg=Do.jpg;var Oo={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var o=new r(z({},e,{cy:t,eles:i}));return o}pe("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else pe("A `name` must be specified to make a layout");else pe("Layout options must be specified to make a layout")}};Oo.createLayout=Oo.makeLayout=Oo.layout;var To={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},No=we({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Ao={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&ge("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var r=No(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else pe("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Ao.invalidateDimensions=Ao.resize;var Mo={collection:function(e,t){return b(e)?this.$(e):S(e)?e.collection():w(e)?new fo(this,e,t):new fo(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Mo.elements=Mo.filter=Mo.$;var Bo={},Lo="t";Bo.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],o=t.getContextMeta(i);if(!o.empty){var a=t.getContextStyle(o),s=t.applyContextStyle(o,a,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Bo.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+"-"+t,o=r[i];if(o)return o;for(var a=[],s={},u=0;u<n.length;u++){var l=n[u],c=e[u]===Lo,d=t[u]===Lo,f=c!==d,h=l.mappedProperties.length>0;if(f||d&&h){var p=void 0;f&&h||f?p=l.properties:h&&(p=l.mappedProperties);for(var v=0;v<p.length;v++){for(var g=p[v],y=g.name,m=!1,b=u+1;b<n.length;b++){var x=n[b];if(t[b]===Lo&&(m=null!=x.properties[g.name]))break}s[y]||m||(s[y]=!0,a.push(y))}}}return r[i]=a,a},Bo.getContextMeta=function(e){for(var t,n=this,r="",i=e._private.styleCxtKey||"",o=0;o<n.length;o++){var a=n[o];r+=a.selector&&a.selector.matches(e)?Lo:"f"}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Bo.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if(t[i]===Lo)for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},Bo.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],u=t[s],l=n.pstyle(s);if(!u){if(!l)continue;u=l.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(l!==u){if(u.mapped===o.fn&&null!=l&&null!=l.mapping&&l.mapping.value===u.value){var c=l.mapping;if((c.fnValue=u.value(n))===c.prevFnValue)continue}var d=i[s]={prev:l};this.applyParsedProperty(n,u),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},Bo.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,o=function(e,t,r){return n.getPropertiesHash(e,t,r)},a=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,u=e._private.style;r=Object.keys(u);for(var l=0;l<i.length;l++){var c=i[l];t.styleKeys[c]=[K,Z]}for(var d,f=function(e,n){return t.styleKeys[n][0]=$(e,t.styleKeys[n][0])},h=function(e,n){return t.styleKeys[n][1]=ee(e,t.styleKeys[n][1])},p=function(e,t){f(e,t),h(e,t)},v=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);f(r,t),h(r,t)}},g=0;g<r.length;g++){var y=r[g],m=u[y];if(null!=m){var b=this.properties[y],x=b.type,w=b.groupKey,_=void 0;null!=b.hashOverride?_=b.hashOverride(e,m):null!=m.pfValue&&(_=m.pfValue);var E=null==b.enums?m.value:null,k=null!=_,S=k||null!=E,P=m.units;if(x.number&&S&&!x.multiple)p(-128<(d=k?_:E)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),k||null==P||v(P,w);else v(m.strValue,w)}}for(var C,j,D=[K,Z],O=0;O<i.length;O++){var T=i[O],N=t.styleKeys[T];D[0]=$(N[0],D[0]),D[1]=ee(N[1],D[1])}t.styleKey=(C=D[0],j=D[1],2097152*C+j);var A=t.styleKeys;t.labelDimsKey=te(A.labelDimensions);var M=o(e,["label"],A.labelDimensions);if(t.labelKey=te(M),t.labelStyleKey=te(ne(A.commonLabel,M)),!s){var B=o(e,["source-label"],A.labelDimensions);t.sourceLabelKey=te(B),t.sourceLabelStyleKey=te(ne(A.commonLabel,B));var L=o(e,["target-label"],A.labelDimensions);t.targetLabelKey=te(L),t.targetLabelStyleKey=te(ne(A.commonLabel,L))}if(s){var I=t.styleKeys,R=I.nodeBody,z=I.nodeBorder,F=I.backgroundImage,V=I.compound,G=I.pie,Y=[R,z,F,V,G].filter((function(e){return null!=e})).reduce(ne,[K,Z]);t.nodeKey=te(Y),t.hasPie=null!=G&&G[0]!==K&&G[1]!==Z}return a!==t.styleKey},Bo.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Bo.applyParsedProperty=function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,u=i.bypass,l=o[i.name],c=l&&l.bypass,d=e._private,f="mapping",h=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=h(l),n=h(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&ge("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",u)),i.delete)return o[i.name]=void 0,p(),!0;if(i.deleteBypassed)return l?!!l.bypass&&(l.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return l?!!l.bypass&&(o[i.name]=l.bypassed,p(),!0):(p(),!0);var v=function(){ge("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var g,y=i.field.split("."),m=d.data,b=0;b<y.length&&m;b++){m=m[y[b]]}if(null==m)return v(),!1;if(!E(m))return ge("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+m+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((g=0===x?0:(m-i.fieldMin)/x)<0?g=0:g>1&&(g=1),s.color){var w=i.valueMin[0],_=i.valueMax[0],k=i.valueMin[1],S=i.valueMax[1],P=i.valueMin[2],C=i.valueMax[2],j=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],O=[Math.round(w+(_-w)*g),Math.round(k+(S-k)*g),Math.round(P+(C-P)*g),Math.round(j+(D-j)*g)];n={bypass:i.bypass,name:i.name,value:O,strValue:"rgb("+O[0]+", "+O[1]+", "+O[2]+")"}}else{if(!s.number)return!1;var T=i.valueMin+(i.valueMax-i.valueMin)*g;n=this.parse(i.name,T,i.bypass,f)}if(!n)return v(),!1;n.mapping=i,i=n;break;case a.data:for(var N=i.field.split("."),A=d.data,M=0;M<N.length&&A;M++){A=A[N[M]]}if(null!=A&&(n=this.parse(i.name,A,i.bypass,f)),!n)return v(),!1;n.mapping=i,i=n;break;case a.fn:var B=i.value,L=null!=i.fnValue?i.fnValue:B(e);if(i.prevFnValue=L,null==L)return ge("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,L,i.bypass,f)))return ge("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=ye(i),i=n;break;case void 0:break;default:return!1}return u?(i.bypassed=c?l.bypassed:l,o[i.name]=i):c?l.bypassed=i:o[i.name]=i,p(),!0},Bo.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],u=i[s];null!=u&&(u.bypass?u.bypassed=null:i[s]=null)}else r._private.style={}}},Bo.update=function(){this._private.cy.mutableElements().updateStyle()},Bo.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},u=!1,l=0;l<i.length;l++){var c=i[l],d=e.pstyle(c),f=t[c];if(f){var h=f.prev,p=null!=f.next?f.next:d,v=!1,g=void 0,y=1e-6;h&&(E(h.pfValue)&&E(p.pfValue)?(v=p.pfValue-h.pfValue,g=h.pfValue+y*v):E(h.value)&&E(p.value)?(v=p.value-h.value,g=h.value+y*v):w(h.value)&&w(p.value)&&(v=h.value[0]!==p.value[0]||h.value[1]!==p.value[1]||h.value[2]!==p.value[2],g=h.strValue),v&&(s[c]=p.strValue,this.applyBypass(e,c,g),u=!0))}}if(!u)return;r.transitioning=!0,new qn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Bo.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Bo.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Bo.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"curve-style"!==t||"bezier"!==n&&"bezier"!==r||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Bo.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Io={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.properties[o].name,s=this.parse(a,n,!0);s&&i.push(s)}}else if(b(t)){var u=this.parse(t,n,!0);u&&i.push(u)}else{if(!_(t))return!1;var l=t;r=n;for(var c=Object.keys(l),d=0;d<c.length;d++){var f=c[d],h=l[f];if(void 0===h&&(h=l[M(f)]),void 0!==h){var p=this.parse(f,h,!0);p&&i.push(p)}}}if(0===i.length)return!1;for(var v=!1,g=0;g<e.length;g++){for(var y=e[g],m={},x=void 0,w=0;w<i.length;w++){var E=i[w];if(r){var k=y.pstyle(E.name);x=m[E.name]={prev:k}}v=this.applyParsedProperty(y,ye(E))||v,r&&(x.next=y.pstyle(E.name))}v&&this.updateStyleHints(y),r&&this.updateTransitions(y,m,true)}return v},overrideBypass:function(e,t,n){t=A(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,u=a.mutiple,l=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":u?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,l,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],u=this.properties[s],l=i.pstyle(u.name);if(l&&l.bypass){var c=this.parse(s,"",!0),d=o[u.name]={prev:l};this.applyParsedProperty(i,c),d.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,true)}}},Ro={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(f&&t&&f.getComputedStyle)return f.getComputedStyle(t).getPropertyValue(e)}},zo={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},i=0;i<n.properties.length;i++){var o=n.properties[i],a=n.getStylePropertyValue(e,o.name,t);null!=a&&(r[o.name]=a,r[M(o.name)]=a)}return r}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,u=o.strValue;if(n&&i.number&&null!=a&&E(a)){var l=e.cy().zoom(),c=function(e){return e*l},d=function(e,t){return c(e)+t},f=w(a);return(f?s.every((function(e){return null!=e})):null!=s)?f?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):f?a.map((function(e){return b(e)?e:""+c(e)})).join(" "):""+c(a)}if(null!=u)return u}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=_(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],u=r[a]||r[A(a)],l=this.parse(u.name,s);l&&t.push(l)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,u,l=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)l[0]=$(a,l[0]),l[1]=ee(a,l[1]);else for(o=i.strValue,u=0;u<o.length;u++)a=o.charCodeAt(u),l[0]=$(a,l[0]),l[1]=ee(a,l[1]);return l}};zo.getPropertiesHash=zo.getNonDefaultPropertiesHash;var Fo={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,o=r.style||r.css,a=Object.keys(o);t.selector(i);for(var s=0;s<a.length;s++){var u=a[s],l=o[u];t.css(u,l)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},Vo={appendFromString:function(e){var t,n,r,i=this,o=""+e;function a(){o=o.length>t.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(o.match(/^\s*$/))break;var u=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){ge("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=u[0];var l=u[1];if("core"!==l)if(new Mr(l).invalid){ge("Skipping parsing of block: Invalid selector found in string stylesheet: "+l),a();continue}var c=u[2],d=!1;n=c;for(var f=[];;){if(n.match(/^\s*$/))break;var h=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!h){ge("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=h[0];var p=h[1],v=h[2];if(this.properties[p])i.parse(p,v)?(f.push({name:p,val:v}),s()):(ge("Skipping property: Invalid property definition in: "+r),s());else ge("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}i.selector(l);for(var g=0;g<f.length;g++){var y=f[g];i.css(y.name,y.val)}a()}return i},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Go={};!function(){var e=I,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Go.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=O(e),r=O(t);return n&&!r||!n&&r}},o=Go.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],u=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],l=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],c=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],f=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],h=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:o.overlayShape,triggersBounds:i.any}],p=[{name:"underlay-padding",type:o.size,triggersBounds:i.any},{name:"underlay-color",type:o.color},{name:"underlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:o.overlayShape,triggersBounds:i.any}],v=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],g=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},y=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:g},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],m=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],x=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],w=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],_=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],E=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],k=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],S=[];Go.pieBackgroundN=16,S.push({name:"pie-size",type:o.sizeMaybePercent});for(var P=1;P<=Go.pieBackgroundN;P++)S.push({name:"pie-"+P+"-background-color",type:o.color}),S.push({name:"pie-"+P+"-background-size",type:o.percent}),S.push({name:"pie-"+P+"-background-opacity",type:o.zeroOneNumber});var C=[],j=Go.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;C.push({name:n,type:r,triggersBounds:i})}))}),{});var D=Go.properties=[].concat(d,v,f,h,p,E,c,l,a,s,u,y,m,x,S,w,_,C,k),T=Go.propertyGroups={behavior:d,transition:v,visibility:f,overlay:h,underlay:p,ghost:E,commonLabel:c,labelDimensions:l,mainLabel:a,sourceLabel:s,targetLabel:u,nodeBody:y,nodeBorder:m,backgroundImage:x,pie:S,compound:w,edgeLine:_,edgeArrow:C,core:k},N=Go.propertyGroupNames={};(Go.propertyGroupKeys=Object.keys(T)).forEach((function(e){N[e]=T[e].map((function(e){return e.name})),T[e].forEach((function(t){return t.groupKey=e}))}));var A=Go.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Go.propertyNames=D.map((function(e){return e.name}));for(var M=0;M<D.length;M++){var B=D[M];D[B.name]=B}for(var L=0;L<A.length;L++){var R=A[L],z=D[R.pointsTo],F={name:R.name,alias:!0,pointsTo:z};D.push(F),D[R.name]=F}}(),Go.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Go.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=z({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=Go.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return Go.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=t[o],s=this.parse(o,a);n[o]=s}}return e.defaultProperties=n,e.defaultProperties},Go.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Yo={parse:function(e,t,n,r){var i=this;if(x(t))return i.parseImplWarn(e,t,n,r);var o,a=ie(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=i.propCache=i.propCache||[];return(o=s[a])||(o=s[a]=i.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(o=ye(o))&&(o.value=ye(o.value)),o},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||ge("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||ge("The style value of `label` is deprecated for `"+i.name+"`"),i}};Yo.parseImpl=function(e,t,n,r){var i=this;e=A(e);var o=i.properties[e],a=t,s=i.types;if(!o)return null;if(void 0===t)return null;o.alias&&(o=o.pointsTo,e=o.name);var u=b(t);u&&(t=t.trim());var l,c,d=o.type;if(!d)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!u||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(l=new RegExp(s.data.regex).exec(t))){if(n)return!1;var f=s.data;return{name:e,value:l,strValue:""+t,mapped:f,field:l[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var h=s.mapData;if(!d.color&&!d.number)return!1;var p=this.parse(e,c[4]);if(!p||p.mapped)return!1;var v=this.parse(e,c[5]);if(!v||v.mapped)return!1;if(p.pfValue===v.pfValue||p.strValue===v.strValue)return ge("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var g=p.value,y=v.value;if(!(g[0]!==y[0]||g[1]!==y[1]||g[2]!==y[2]||g[3]!==y[3]&&(null!=g[3]&&1!==g[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:h,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:p.value,valueMax:v.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=u?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var _=[],k=[],S=[],P="",C=!1,j=0;j<m.length;j++){var D=i.parse(e,m[j],n,"multiple");C=C||b(D.value),_.push(D.value),S.push(null!=D.pfValue?D.pfValue:D.value),k.push(D.units),P+=(j>0?" ":"")+D.strValue}return d.validate&&!d.validate(_,k)?null:d.singleEnum&&C?1===_.length&&b(_[0])?{name:e,value:_[0],strValue:_[0],bypass:n}:null:{name:e,value:_,pfValue:S,strValue:P,bypass:n,units:k}}var O,T,N=function(){for(var r=0;r<d.enums.length;r++){if(d.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var M,B="px";if(d.units&&(M=d.units),d.implicitUnits&&(B=d.implicitUnits),!d.unitless)if(u){var L="px|em"+(d.allowPercent?"|\\%":"");M&&(L=M);var R=t.match("^("+I+")("+L+")?$");R&&(t=R[1],M=R[2]||B)}else M&&!d.implicitUnits||(M=B);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,N();if(d.integer&&(!E(T=t)||Math.floor(T)!==T))return null;if(void 0!==d.min&&(t<d.min||d.strictMin&&t===d.min)||void 0!==d.max&&(t>d.max||d.strictMax&&t===d.max))return null;var z={name:e,value:t,strValue:""+t+(M||""),units:M,bypass:n};return d.unitless||"px"!==M&&"em"!==M?z.pfValue=t:z.pfValue="px"!==M&&M?this.getEmSizeInPixels()*t:t,"ms"!==M&&"s"!==M||(z.pfValue="ms"===M?t:1e3*t),"deg"!==M&&"rad"!==M||(z.pfValue="rad"===M?t:(O=t,Math.PI*O/180)),"%"===M&&(z.pfValue=t/100),z}if(d.propList){var V=[],G=""+t;if("none"===G);else{for(var Y=G.split(/\s*,\s*|\s+/),q=0;q<Y.length;q++){var W=Y[q].trim();i.properties[W]?V.push(W):ge("`"+W+"` is not a valid property name")}if(0===V.length)return null}return{name:e,value:V,strValue:0===V.length?"none":V.join(" "),bypass:n}}if(d.color){var H=F(t);return H?{name:e,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var U=N();if(U)return U}for(var X=d.regexes?d.regexes:[d.regex],K=0;K<X.length;K++){var Q=new RegExp(X[K]).exec(t);if(Q)return{name:e,value:d.singleRegexMatchValue?Q[1]:Q,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?N():null};var qo=function e(t){if(!(this instanceof e))return new e(t);j(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):pe("A style must have a core reference")},Wo=qo.prototype;Wo.instanceString=function(){return"style"},Wo.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},Wo.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Wo.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},Wo.selector=function(e){var t="core"===e?null:new Mr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},Wo.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[M(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},Wo.style=Wo.css,Wo.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},Wo.append=function(e){return D(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},qo.fromJson=function(e,t){var n=new qo(e);return n.fromJson(t),n},qo.fromString=function(e,t){return new qo(e).fromString(t)},[Bo,Io,Ro,zo,Fo,Vo,Go,Yo].forEach((function(e){z(Wo,e)})),qo.types=Wo.types,qo.properties=Wo.properties,qo.propertyGroups=Wo.propertyGroups,qo.propertyGroupNames=Wo.propertyGroupNames,qo.propertyGroupKeys=Wo.propertyGroupKeys;var Ho={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return D(e)?t.style=e.generateStyle(this):w(e)?t.style=qo.fromJson(this,e):b(e)?t.style=qo.fromString(this,e):t.style=qo(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Uo={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(b(o[0]))return a[e=o[0]];if(_(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,E(r)&&(a.x=r),E(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=o[0],t=o[1],"x"!==e&&"y"!==e||!E(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,u=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:_(e)&&(o=(i=s[0]).x,a=i.y,E(o)&&(u.x+=o),E(a)&&(u.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!E(r)||(u[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(E(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(b(e)){var i=e;e=this.$(i)}else if(_(r=e)&&E(r.x1)&&E(r.x2)&&E(r.y1)&&E(r.y2)){var o=e;(n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else S(e)||(e=this.mutableElements());if(!S(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),u=this.height();if(t=E(t)?t:0,!isNaN(s)&&!isNaN(u)&&s>0&&u>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(u-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(n.x1+n.x2))/2,y:(u-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return E(e)&&E(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):E(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:E(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),E(e)?n=e:_(e)&&(n=e.level,null!=e.position?t=We(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,a||!E(n)||n===o||null!=t&&(!E(t.x)||!E(t.y)))return null;if(null!=t){var s=i,u=o,l=n;return{zoomed:!0,panned:!0,zoom:l,pan:{x:-l/u*(t.x-s.x)+t.x,y:-l/u*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(E(e.zoom)||(n=!1),_(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;E(u.x)&&(t.pan.x=u.x,a=!1),E(u.y)&&(t.pan.y=u.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else S(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=f.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};Uo.centre=Uo.center,Uo.autolockNodes=Uo.autolock,Uo.autoungrabifyNodes=Uo.autoungrabify;var Xo={data:Qn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Xo.attr=Xo.data,Xo.removeAttr=Xo.removeData;var Ko=function(e){var t=this,n=(e=z({},e)).container;n&&!k(n)&&k(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==f&&void 0!==n&&!e.headless,a=e;a.layout=z({name:o?"grid":"null"},a.layout),a.renderer=z({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},u=this._private={container:n,ready:!1,options:a,elements:new fo(this),listeners:[],aniEles:new fo(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:E(a.zoom)?a.zoom:1,pan:{x:_(a.pan)&&E(a.pan.x)?a.pan.x:0,y:_(a.pan)&&E(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});u.styleEnabled&&t.setStyle([]);var l=z({},a,a.renderer);t.initRenderer(l);!function(e,t){if(e.some(T))return qn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];u.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(_(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=z({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),u.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),a.done)}))},Qo=Ko.prototype;z(Qo,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!k(e)&&k(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(z({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return ye(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(_(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var u=""+s.data.id,l=t.getElementById(u);i[u]=!0,0!==l.length?o.push({ele:l,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else ge("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var c=0;c<o.length;c++){var d=o[c],f=d.ele,h=d.json;f.json(h)}};if(w(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var u=a[s],l=e.elements[u];w(l)&&o(l,u)}var c=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?c.merge(e):e.remove()})),c.forEach((function(e){return e.children().move({parent:null})})),c.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],f=0;f<d.length;f++){var h=d[f];null!=e[h]&&t[h](e[h])}return t.endBatch(),this}var p={};!!e?p.elements=this.elements().map((function(e){return e.json()})):(p.elements={},r.forEach((function(e){var t=e.group();p.elements[t]||(p.elements[t]=[]),p.elements[t].push(e.json())}))),this._private.styleEnabled&&(p.style=t.style().json()),p.data=ye(t.data());var v=n.options;return p.zoomingEnabled=n.zoomingEnabled,p.userZoomingEnabled=n.userZoomingEnabled,p.zoom=n.zoom,p.minZoom=n.minZoom,p.maxZoom=n.maxZoom,p.panningEnabled=n.panningEnabled,p.userPanningEnabled=n.userPanningEnabled,p.pan=ye(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=ye(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),Qo.$id=Qo.getElementById,[po,So,jo,Do,Oo,To,Ao,Mo,Ho,Uo,Xo].forEach((function(e){z(Qo,e)}));var Zo={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Jo=function(e){return e.scratch("breadthfirst")},$o=function(e,t){return e.scratch("breadthfirst",t)};function ea(e){this.options=z({},Zo,e)}ea.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,u=n.maximal||n.maximalAdjustments>0,l=rt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(S(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d<n.roots.length;d++){var f=n.roots[d],h=r.getElementById(f);c.push(h)}e=r.collection(c)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var p=i.components();e=r.collection();for(var v=function(t){var n=p[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},g=0;g<p.length;g++)v(g)}var y=[],m={},x=function(e,t){null==y[t]&&(y[t]=[]);var n=y[t].length;y[t].push(e),$o(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();x(o,i),m[a]=!0}});for(var _=[],E=0;E<o.length;E++){var k=o[E];m[k.id()]||_.push(k)}var P=function(e){for(var t=y[e],n=0;n<t.length;n++){var r=t[n];null!=r?$o(r,{depth:e,index:n}):(t.splice(n,1),n--)}},C=function(){for(var e=0;e<y.length;e++)P(e)},j=function(e,t){for(var n=Jo(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var u=r[s],l=Jo(u);o=Math.max(o,l.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=Jo(e),r=n.depth,i=n.index;y[r][i]=null,x(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&u){var D=[],O={},T=function(e){return D.push(e)};for(o.forEach((function(e){return D.push(e)}));D.length>0;){var N=D.shift(),A=j(N,O);if(A)N.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(T);else if(null===A){ge("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}C();var M=0;if(n.avoidOverlap)for(var B=0;B<o.length;B++){var L=o[B].layoutDimensions(n),I=L.w,z=L.h;M=Math.max(M,I,z)}for(var F={},V=function(e){if(F[e.id()])return F[e.id()];for(var t=Jo(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var u=Jo(s);if(null!=u){var l=u.index,c=u.depth;if(null!=l&&null!=c){var d=y[c].length;c<t&&(r+=l/d,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[e.id()]=r,r},G=function(e,t){var n=V(e)-V(t);return 0===n?R(e.id(),t.id()):n},Y=0;Y<y.length;Y++)y[Y].sort(G),P(Y);for(var q=[],W=0;W<_.length;W++)q.push(_[W]);y.unshift(q),C();for(var H=0,U=0;U<y.length;U++)H=Math.max(y[U].length,H);var X=l.x1+l.w/2,K=l.x1+l.h/2,Q=y.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=Jo(e),r=t.depth,i=t.index,o=y[r].length,a=Math.max(l.w/((n.grid?Q:o)+1),M),s=Math.max(l.h/(y.length+1),M),u=Math.min(l.w/2/y.length,l.h/2/y.length);if(u=Math.max(u,M),n.circle){var c=u*r+u-(y.length>0&&y[0].length<=3?u/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:X+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:X+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var ta={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function na(e){this.options=z({},ta,e)}na.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u=s.x1+s.w/2,l=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,f=0;f<o.length;f++){var h=o[f].layoutDimensions(t),p=h.w,v=h.h;d=Math.max(d,p,v)}if(a=E(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(g*g+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:u+o,y:l+s}})),this};var ra,ia={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oa(e){this.options=z({},ia,e)}oa.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,u=a.y1+a.h/2,l=[],c=0,d=0;d<o.length;d++){var f,h=o[d];f=t.concentric(h),l.push({value:f,node:h}),h._private.scratch.concentric=f}o.updateStyle();for(var p=0;p<o.length;p++){var v=o[p].layoutDimensions(t);c=Math.max(c,v.w,v.h)}l.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),y=[[]],m=y[0],b=0;b<l.length;b++){var x=l[b];if(m.length>0)Math.abs(m[0].value-x.value)>=g&&(m=[],y.push(m));m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var _=y.length>0&&y[0].length>1,E=(Math.min(a.w,a.h)/2-w)/(y.length+_?1:0);w=Math.min(w,E)}for(var k=0,S=0;S<y.length;S++){var P=y[S],C=void 0===t.sweep?2*Math.PI-2*Math.PI/P.length:t.sweep,j=P.dTheta=C/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var D=Math.cos(j)-Math.cos(0),O=Math.sin(j)-Math.sin(0),T=Math.sqrt(w*w/(D*D+O*O));k=Math.max(T,k)}P.r=k,k+=w}if(t.equidistant){for(var N=0,A=0,M=0;M<y.length;M++){var B=y[M].r-A;N=Math.max(N,B)}A=0;for(var L=0;L<y.length;L++){var I=y[L];0===L&&(A=I.r),I.r=A,A+=N}}for(var R={},z=0;z<y.length;z++)for(var F=y[z],V=F.dTheta,G=F.r,Y=0;Y<F.length;Y++){var q=F[Y],W=t.startAngle+(n?1:-1)*V*Y,H={x:s+G*Math.cos(W),y:u+G*Math.sin(W)};R[q.node.id()]=H}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return R[t]})),this};var aa={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function sa(e){this.options=z({},aa,e),this.options.layout=this}sa.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),ra=!0===e.debug;var r=ua(t,n,e);ra&&undefined(r),e.randomize&&da(r);var i=X(),o=function(){ha(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter)&&(pa(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=fa(r,e,t);t.layoutPositions(n,e,i)}},u=0,l=!0;if(!0===e.animate){!function t(){for(var n=0;l&&n<e.refresh;)l=a(u),u++,n++;l?(X()-i>=e.animationThreshold&&o(),U(t)):(Pa(r,e),s())}()}else{for(;l;)l=a(u),u++;Pa(r,e),s()}return this},sa.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},sa.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var ua=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:rt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},u=0;u<a.length;u++)for(var l=a[u],c=0;c<l.length;c++){s[l[c].id()]=u}for(u=0;u<o.nodeSize;u++){var d=(g=i[u]).layoutDimensions(n);(A={}).isLocked=g.locked(),A.id=g.data("id"),A.parentId=g.data("parent"),A.cmptId=s[g.id()],A.children=[],A.positionX=g.position("x"),A.positionY=g.position("y"),A.offsetX=0,A.offsetY=0,A.height=d.w,A.width=d.h,A.maxX=A.positionX+A.width/2,A.minX=A.positionX-A.width/2,A.maxY=A.positionY+A.height/2,A.minY=A.positionY-A.height/2,A.padLeft=parseFloat(g.style("padding")),A.padRight=parseFloat(g.style("padding")),A.padTop=parseFloat(g.style("padding")),A.padBottom=parseFloat(g.style("padding")),A.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(A),o.idToIndex[A.id]=u}var f=[],h=0,p=-1,v=[];for(u=0;u<o.nodeSize;u++){var g,y=(g=o.layoutNodes[u]).parentId;null!=y?o.layoutNodes[o.idToIndex[y]].children.push(g.id):(f[++p]=g.id,v.push(g.id))}for(o.graphSet.push(v);h<=p;){var m=f[h++],b=o.idToIndex[m],w=o.layoutNodes[b].children;if(w.length>0){o.graphSet.push(w);for(u=0;u<w.length;u++)f[++p]=w[u]}}for(u=0;u<o.graphSet.length;u++){var _=o.graphSet[u];for(c=0;c<_.length;c++){var E=o.idToIndex[_[c]];o.indexToGraph[E]=u}}for(u=0;u<o.edgeSize;u++){var k=r[u],S={};S.id=k.data("id"),S.sourceId=k.data("source"),S.targetId=k.data("target");var P=x(n.idealEdgeLength)?n.idealEdgeLength(k):n.idealEdgeLength,C=x(n.edgeElasticity)?n.edgeElasticity(k):n.edgeElasticity,j=o.idToIndex[S.sourceId],D=o.idToIndex[S.targetId];if(o.indexToGraph[j]!=o.indexToGraph[D]){for(var O=la(S.sourceId,S.targetId,o),T=o.graphSet[O],N=0,A=o.layoutNodes[j];-1===T.indexOf(A.id);)A=o.layoutNodes[o.idToIndex[A.parentId]],N++;for(A=o.layoutNodes[D];-1===T.indexOf(A.id);)A=o.layoutNodes[o.idToIndex[A.parentId]],N++;P*=N*n.nestingFactor}S.idealLength=P,S.elasticity=C,o.layoutEdges.push(S)}return o},la=function(e,t,n){var r=ca(e,t,0,n);return 2>r.count?0:r.graph},ca=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var u=o[s],l=i.idToIndex[u],c=i.layoutNodes[l].children;if(0!==c.length){var d=e(t,n,i.indexToGraph[i.idToIndex[c[0]]],i);if(0!==d.count){if(1!==d.count)return d;if(2===++a)break}}}return{count:a,graph:r}},da=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},fa=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(a.positionX-i.x1)/i.w,u=(a.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+u*r.h}}return{x:a.positionX,y:a.positionY}}},ha=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=fa(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},pa=function(e,t,n){va(e,t),xa(e),wa(e,t),_a(e),Ea(e)},va=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++){var u=e.layoutNodes[e.idToIndex[r[s]]];ya(a,u,e,t)}},ga=function(e){return-e+2*e*Math.random()},ya=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=ga(1),o=ga(1));var a=ma(e,t,i,o);if(a>0)var s=(l=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),u=l*o/v;else{var l,c=ba(e,i,o),d=ba(t,-1*i,-1*o),f=d.x-c.x,h=d.y-c.y,p=f*f+h*h,v=Math.sqrt(p);s=(l=(e.nodeRepulsion+t.nodeRepulsion)/p)*f/v,u=l*h/v}e.isLocked||(e.offsetX-=s,e.offsetY-=u),t.isLocked||(t.offsetX+=s,t.offsetY+=u)}},ma=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},ba=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,u=o/a,l={};return 0===t&&0<n||0===t&&0>n?(l.x=r,l.y=i+o/2,l):0<t&&-1*u<=s&&s<=u?(l.x=r+a/2,l.y=i+a*n/2/t,l):0>t&&-1*u<=s&&s<=u?(l.x=r-a/2,l.y=i-a*n/2/t,l):0<n&&(s<=-1*u||s>=u)?(l.x=r+o*t/2/n,l.y=i+o/2,l):0>n&&(s<=-1*u||s>=u)?(l.x=r-o*t/2/n,l.y=i-o/2,l):l},xa=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],o=e.layoutNodes[i],a=e.idToIndex[r.targetId],s=e.layoutNodes[a],u=s.positionX-o.positionX,l=s.positionY-o.positionY;if(0!==u||0!==l){var c=ba(o,u,l),d=ba(s,-1*u,-1*l),f=d.x-c.x,h=d.y-c.y,p=Math.sqrt(f*f+h*h),v=Math.pow(r.idealLength-p,2)/r.elasticity;if(0!==p)var g=v*f/p,y=v*h/p;else g=0,y=0;o.isLocked||(o.offsetX+=g,o.offsetY+=y),s.isLocked||(s.offsetX-=g,s.offsetY-=y)}}},wa=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],u=e.layoutNodes[e.idToIndex[s.parentId]];o=u.positionX,a=u.positionY}for(var l=0;l<i;l++){var c=e.layoutNodes[e.idToIndex[r[l]]];if(!c.isLocked){var d=o-c.positionX,f=a-c.positionY,h=Math.sqrt(d*d+f*f);if(h>1){var p=t.gravity*d/h,v=t.gravity*f/h;c.offsetX+=p,c.offsetY+=v}}}}},_a=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],u=s.children;if(0<u.length&&!s.isLocked){for(var l=s.offsetX,c=s.offsetY,d=0;d<u.length;d++){var f=e.layoutNodes[e.idToIndex[u[d]]];f.offsetX+=l,f.offsetY+=c,n[++i]=u[d]}s.offsetX=0,s.offsetY=0}}},Ea=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=ka(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Sa(i,e)}}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},ka=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Sa=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},Pa=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++){if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var u=0;u<v.length;u++){var l=v[u];v.x1=Math.min(v.x1,l.positionX-l.width/2),v.x2=Math.max(v.x2,l.positionX+l.width/2),v.y1=Math.min(v.y1,l.positionY-l.height/2),v.y2=Math.max(v.y2,l.positionY+l.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,d=0,f=0,h=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(u=0;u<v.length;u++){(l=v[u]).isLocked||(l.positionX+=c-v.x1,l.positionY+=d-v.y1)}c+=v.w+t.componentSpacing,f+=v.w+t.componentSpacing,h=Math.max(h,v.h),f>p&&(d+=h+t.componentSpacing,c=0,f=0,h=0)}}},Ca={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ja(e){this.options=z({},Ca,e)}ja.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=rt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),u=Math.round(s),l=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(u,l);Math.min(u,l)==u?u=e:l=e},d=function(e){if(null==e)return Math.max(u,l);Math.max(u,l)==u?u=e:l=e},f=t.rows,h=null!=t.cols?t.cols:t.columns;if(null!=f&&null!=h)u=f,l=h;else if(null!=f&&null==h)u=f,l=Math.ceil(a/u);else if(null==f&&null!=h)l=h,u=Math.ceil(a/l);else if(l*u>a){var p=c(),v=d();(p-1)*v>=a?c(p-1):(v-1)*p>=a&&d(v-1)}else for(;l*u<a;){var g=c(),y=d();(y+1)*g>=a?d(y+1):c(g+1)}var m=o.w/l,b=o.h/u;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],_=w._private.position;null!=_.x&&null!=_.y||(_.x=0,_.y=0);var E=w.layoutDimensions(t),k=t.avoidOverlapPadding,S=E.w+k,P=E.h+k;m=Math.max(m,S),b=Math.max(b,P)}for(var C={},j=function(e,t){return!!C["c-"+e+"-"+t]},D=function(e,t){C["c-"+e+"-"+t]=!0},O=0,T=0,N=function(){++T>=l&&(T=0,O++)},A={},M=0;M<i.length;M++){var B=i[M],L=t.position(B);if(L&&(void 0!==L.row||void 0!==L.col)){var I={row:L.row,col:L.col};if(void 0===I.col)for(I.col=0;j(I.row,I.col);)I.col++;else if(void 0===I.row)for(I.row=0;j(I.row,I.col);)I.row++;A[B.id()]=I,D(I.row,I.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=A[e.id()];if(i)n=i.col*m+m/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;j(O,T);)N();n=T*m+m/2+o.x1,r=O*b+b/2+o.y1,D(O,T),N()}return{x:n,y:r}}))}return this};var Da={ready:function(){},stop:function(){}};function Oa(e){this.options=z({},Da,e)}Oa.prototype.run=function(){var e=this.options,t=e.eles,n=this;e.cy;return n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Oa.prototype.stop=function(){return this};var Ta={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Na(e){this.options=z({},Ta,e)}Na.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var Aa={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ma(e){this.options=z({},Aa,e)}Ma.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=rt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Ba=[{name:"breadthfirst",impl:ea},{name:"circle",impl:na},{name:"concentric",impl:oa},{name:"cose",impl:sa},{name:"grid",impl:ja},{name:"null",impl:Oa},{name:"preset",impl:Na},{name:"random",impl:Ma}];function La(e){this.options=e,this.notifications=0}var Ia=function(){},Ra=function(){throw new Error("A headless instance can not render images")};La.prototype={recalculateRenderedStyle:Ia,notify:function(){this.notifications++},init:Ia,isHeadless:function(){return!0},png:Ra,jpg:Ra};var za={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){var s=i.x-n/2-a,u=i.x+n/2+a,l=i.y-n/2-a,c=i.y+n/2+a;return s<=e&&e<=u&&l<=t&&t<=c},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:o*n+i.x,y:a+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2){var s=e[a],u=e[a+1];o.push(r(s,u,t,n,i))}return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=z({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var u=o(i(this.points,n+2*s,r,a));return gt(e,t,u)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:de,roughCollide:de,draw:he,spacing:fe,gap:fe}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var u=i(this.points,n,o,a),l=this.controlPoint,c=r(l[0],l[1],n,o,a);t.arrowShapeImpl(this.name)(e,u,c)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,u){var l=o(i(this.points,n+2*u,r,a)),c=o(i(this.pointsTee,n+2*u,r,a));return gt(e,t,l)||gt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,u){var l=a,c=Math.pow(l.x-e,2)+Math.pow(l.y-t,2)<=Math.pow((n+2*u)*this.radius,2),d=o(i(this.points,n+2*u,r,a));return gt(e,t,d)||c},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,u){var l=o(i(this.points,n+2*u,r,a)),c=o(i(this.crossLinePts(n,s),n+2*u,r,a));return gt(e,t,l)||gt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},Fa={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),u=n.zoom();return[((e-i)/a-s.x)/u,((t-o)/a-s.y)/u]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=f.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),u=r("border-left-width"),l=r("border-right-width"),c=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),h=e.clientHeight,p=i+o,v=a+s,g=u+l,y=t.width/(d+g),m=d-p,b=h-v,x=t.left+i+u,w=t.top+a+c;return this.containerBB=[x,w,m,b,y]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,u=s.getCachedZSortedEles(),l=[],c=s.cy.zoom(),d=s.cy.hasCompoundNodes(),f=(r?24:8)/c,h=(r?8:2)/c,p=(r?8:2)/c,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,l.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<l.length;n++)if(l[n].isEdge()){l[n]=e,i=e,v=null!=t?t:v;break}}else l.push(e),i=e,v=null!=t?t:v}function y(n){var r=n.outerWidth()+2*h,i=n.outerHeight()+2*h,o=r/2,u=i/2,l=n.position();if(l.x-o<=e&&e<=l.x+o&&l.y-u<=t&&t<=l.y+u&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,l.x,l.y))return g(n,0),!0}function m(n){var r,i=n._private,o=i.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,h=u/2+f,p=h*h,v=2*h,m=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(ft(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=vt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(ht(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=pt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;m=m||i.source,b=b||i.target;var _=a.getArrowWidth(u,c),E=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<E.length;w++){var k=E[w],S=s.arrowShapes[n.pstyle(k.name+"-arrow-shape").value],P=n.pstyle("width").pfValue;if(S.roughCollide(e,t,_,k.angle,{x:k.x,y:k.y},P,f)&&S.collide(e,t,_,k.angle,{x:k.x,y:k.y},P,f))return g(n),!0}d&&l.length>0&&(y(m),y(b))}function b(e,t,n){return ke(e,t,n)}function x(n,r){var i,o=n._private,a=p;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],u=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&u){var l=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),f=n.pstyle(i+"text-margin-x").pfValue,h=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-f,y=s.x2+a-f,m=s.y1-a-h,x=s.y2+a-h;if(d){var w=Math.cos(d),_=Math.sin(d),E=function(e,t){return{x:(e-=l)*w-(t-=c)*_+l,y:e*_+t*w+c}},k=E(v,m),S=E(v,x),P=E(y,m),C=E(y,x),j=[k.x+f,k.y+h,P.x+f,P.y+h,C.x+f,C.y+h,S.x+f,S.y+h];if(gt(e,t,j))return g(n),!0}else if(lt(s,e,t))return g(n),!0}}n&&(u=u.interactive);for(var w=u.length-1;w>=0;w--){var _=u[w];_.isNode()?y(_)||x(_):m(_)||x(_)||x(_,"source")||x(_,"target")}return l},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],u=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),f=rt({x1:e=u,y1:t=c,x2:n=l,y2:r=d}),h=0;h<a.length;h++){var p=a[h];if(p.isNode()){var v=p,g=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});ut(f,g)&&!ct(g,f)&&s.push(v)}else{var y=p,m=y._private,b=m.rscratch;if(null!=b.startX&&null!=b.startY&&!lt(f,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!lt(f,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,_=0;_<x.length;_++)if(i=f,o=x[_],!lt(i,o.x,o.y)){w=!1;break}w&&s.push(y)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(y)}}return s}},Va={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,u="haystack"===s.edgeType,l="bezier"===s.edgeType,c="multibezier"===s.edgeType,d="segments"===s.edgeType,f="compound"===s.edgeType,h="self"===s.edgeType;if(u?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),v=s.midX,g=s.midY,d)t=r-s.segpts[0],n=i-s.segpts[1];else if(c||f||h||l){var p=s.allpts;t=r-et(p[0],p[2],p[4],.1),n=i-et(p[1],p[3],p[5],.1)}else t=r-v,n=i-g;s.srcArrowAngle=Xe(t,n);var v=s.midX,g=s.midY;if(u&&(v=(r+o)/2,g=(i+a)/2),t=o-r,n=a-i,d)if((p=s.allpts).length/2%2==0){var y=(m=p.length/2)-2;t=p[m]-p[y],n=p[m+1]-p[y+1]}else{y=(m=p.length/2-1)-2;var m,b=m+2;t=p[m]-p[y],n=p[m+1]-p[y+1]}else if(c||f||h){var x,w,_,E,p=s.allpts;if(s.ctrlpts.length/2%2==0){var k=(S=(P=p.length/2-1)+2)+2;x=et(p[P],p[S],p[k],0),w=et(p[P+1],p[S+1],p[k+1],0),_=et(p[P],p[S],p[k],1e-4),E=et(p[P+1],p[S+1],p[k+1],1e-4)}else{var S,P;k=(S=p.length/2-1)+2;x=et(p[P=S-2],p[S],p[k],.4999),w=et(p[P+1],p[S+1],p[k+1],.4999),_=et(p[P],p[S],p[k],.5),E=et(p[P+1],p[S+1],p[k+1],.5)}t=_-x,n=E-w}(s.midtgtArrowAngle=Xe(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((p=s.allpts).length/2%2==0||(t=-(p[b=(m=p.length/2-1)+2]-p[m]),n=-(p[b+1]-p[m+1])));if(s.midsrcArrowAngle=Xe(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(c||f||h||l){var C=(p=s.allpts).length;t=o-et(p[C-6],p[C-4],p[C-2],.9),n=a-et(p[C-5],p[C-3],p[C-1],.9)}else t=o-v,n=a-g;s.tgtArrowAngle=Xe(t,n)}};Va.getArrowWidth=Va.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Ga={};function Ya(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Ga.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,u=a.position(),l=s.position(),c=a.width(),d=s.width(),f=a.height(),h=s.height(),p=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*p+u.x,i.source.y*f*p+u.y,i.target.x*d*p+l.x,i.target.y*h*p+l.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Ga.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),u=e.pstyle("segment-distances"),l=Math.min(s.pfValue.length,u.pfValue.length);n.edgeType="segments",n.segpts=[];for(var c=0;c<l;c++){var d=s.pfValue[c],f=u.pfValue[c],h=1-d,p=d,v="node-position"===a?r:i,g={x:v.x1*h+v.x2*p,y:v.y1*h+v.y2*p};n.segpts.push(g.x+o.x*f,g.y+o.y*f)}},Ga.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var f=n,h=d;r&&(f=0,h=u);var p=l-Math.PI/2,v=p-c/2,g=p+c/2,y=String(l+"_"+c);f=void 0===o[y]?o[y]=0:++o[y],i.ctrlpts=[a.x+1.4*Math.cos(v)*h*(f/3+1),a.y+1.4*Math.sin(v)*h*(f/3+1),a.x+1.4*Math.cos(g)*h*(f/3+1),a.y+1.4*Math.sin(g)*h*(f/3+1)]},Ga.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,u=t.srcH,l=t.tgtW,c=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,f=e.pstyle("control-point-distances"),h=f?f.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=h);var g={x:o.x-s/2,y:o.y-u/2},y={x:a.x-l/2,y:a.y-c/2},m={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*l));i.ctrlpts=[m.x,m.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*b,m.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*x,m.y]},Ga.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Ga.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,u=t.intersectionPts,l=e.pstyle("edge-distances").value,c=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),f=e.pstyle("control-point-weights"),h=d&&f?Math.min(d.value.length,f.value.length):1,p=d?d.pfValue[0]:void 0,v=f.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var y=0;y<h;y++){var m=(.5-t.eles.length/2+n)*c*(i?-1:1),b=void 0,x=Qe(m);g&&(p=d?d.pfValue[y]:c,v=f.value[y]);var w=void 0!==(b=r?p:void 0!==p?x*p:void 0)?b:m,_=1-v,E=v,k="node-position"===l?s:u,S={x:k.x1*_+k.x2*E,y:k.y1*_+k.y2*E};o.ctrlpts.push(S.x+a.x*w,S.y+a.y*w)}},Ga.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",o="leftward",a="rightward",s="downward",u="upward",l=t.posPts,c=t.srcW,d=t.srcH,f=t.tgtW,h=t.tgtH,p="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,g=v,y=e.pstyle("taxi-turn"),m="%"===y.units,b=y.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,_=p?(c+f)/2:0,E=p?(d+h)/2:0,k=l.x2-l.x1,S=l.y2-l.y1,P=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},C=P(k,_),j=P(S,E),D=!1;"auto"===g?v=Math.abs(C)>Math.abs(j)?i:r:g===u||g===s?(v=r,D=!0):g!==o&&g!==a||(v=i,D=!0);var O,T=v===r,N=T?j:C,A=T?S:k,M=Qe(A),B=!1;(D&&(m||x)||!(g===s&&A<0||g===u&&A>0||g===o&&A>0||g===a&&A<0)||(N=(M*=-1)*Math.abs(N),B=!0),m)?O=(b<0?1+b:b)*N:O=(b<0?N:0)+b*M;var L=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(N)},I=L(O),R=L(Math.abs(N)-Math.abs(O));if((I||R)&&!B)if(T){var z=Math.abs(A)<=d/2,F=Math.abs(k)<=f/2;if(z){var V=(l.x1+l.x2)/2,G=l.y1,Y=l.y2;n.segpts=[V,G,V,Y]}else if(F){var q=(l.y1+l.y2)/2,W=l.x1,H=l.x2;n.segpts=[W,q,H,q]}else n.segpts=[l.x1,l.y2]}else{var U=Math.abs(A)<=c/2,X=Math.abs(S)<=h/2;if(U){var K=(l.y1+l.y2)/2,Q=l.x1,Z=l.x2;n.segpts=[Q,K,Z,K]}else if(X){var J=(l.x1+l.x2)/2,$=l.y1,ee=l.y2;n.segpts=[J,$,J,ee]}else n.segpts=[l.x2,l.y1]}else if(T){var te=l.y1+O+(p?d/2*M:0),ne=l.x1,re=l.x2;n.segpts=[ne,te,re,te]}else{var ie=l.x1+O+(p?c/2*M:0),oe=l.y1,ae=l.y2;n.segpts=[ie,oe,ie,ae]}},Ga.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,c=t.tgtShape,d=!E(n.startX)||!E(n.startY),f=!E(n.arrowStartX)||!E(n.arrowStartY),h=!E(n.endX)||!E(n.endY),p=!E(n.arrowEndX)||!E(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=Ze({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=g<v,m=Ze({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<v,x=!1;if(d||f||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(w.x*w.x+w.y*w.y),k={x:w.x/_,y:w.y/_},S=Math.max(o,a),P={x:n.ctrlpts[0]+2*k.x*S,y:n.ctrlpts[1]+2*k.y*S},C=l.intersectLine(r.x,r.y,o,a,P.x,P.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+k.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+k.y*(v-g)):(n.ctrlpts[0]=C[0]+k.x*v,n.ctrlpts[1]=C[1]+k.y*v)}if(h||p||b){x=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},D=Math.sqrt(j.x*j.x+j.y*j.y),O={x:j.x/D,y:j.y/D},T=Math.max(o,a),N={x:n.ctrlpts[0]+2*O.x*T,y:n.ctrlpts[1]+2*O.y*T},A=c.intersectLine(i.x,i.y,s,u,N.x,N.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+O.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+O.y*(v-m)):(n.ctrlpts[0]=A[0]+O.x*v,n.ctrlpts[1]=A[1]+O.y*v)}x&&this.findEndpoints(e)}},Ga.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=et(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=et(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},Ga.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||E(t.startX)&&E(t.startY)&&E(t.endX)&&E(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,ge("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Ga.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Pe,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Pe,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var u=e[s],l=u._private,c=u.pstyle("curve-style").value;if(!u.removed()&&u.takesUpSpace())if("haystack"!==c){var d="unbundled-bezier"===c||"segments"===c||"straight"===c||"straight-triangle"===c||"taxi"===c,f="unbundled-bezier"===c||"bezier"===c,h=l.source,p=l.target,v=[h.poolIndex(),p.poolIndex()].sort(),g=i.get(v);null==g&&(g={eles:[]},i.set(v,g),o.push(v)),g.eles.push(u),d&&(g.hasUnbundled=!0),f&&(g.hasBezier=!0)}else a.push(u)}for(var y=function(e){var a=o[e],s=i.get(a),u=void 0;if(!s.hasUnbundled){var l=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Ee(s.eles),l.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=s.eles[0],d=c.source(),f=c.target();if(d.poolIndex()>f.poolIndex()){var h=d;d=f,f=h}var p=s.srcPos=d.position(),v=s.tgtPos=f.position(),g=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=f.outerWidth(),b=s.tgtH=f.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(f)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_<s.eles.length;_++){var k=s.eles[_],S=k[0]._private.rscratch,P=k.pstyle("curve-style").value,C="unbundled-bezier"===P||"segments"===P||"taxi"===P,j=!d.same(k.source());if(!s.calculatedIntersection&&d!==f&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var D=x.intersectLine(p.x,p.y,g,y,v.x,v.y,0),O=s.srcIntn=D,T=w.intersectLine(v.x,v.y,m,b,p.x,p.y,0),N=s.tgtIntn=T,A=s.intersectionPts={x1:D[0],x2:T[0],y1:D[1],y2:T[1]},M=s.posPts={x1:p.x,x2:v.x,y1:p.y,y2:v.y},B=T[1]-D[1],L=T[0]-D[0],I=Math.sqrt(L*L+B*B),R=s.vector={x:L,y:B},z=s.vectorNorm={x:R.x/I,y:R.y/I},F={x:-z.y,y:z.x};s.nodesOverlap=!E(I)||w.checkPoint(D[0],D[1],0,m,b,v.x,v.y)||x.checkPoint(T[0],T[1],0,g,y,p.x,p.y),s.vectorNormInverse=F,u={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:p,srcW:m,srcH:b,tgtW:g,tgtH:y,srcIntn:N,tgtIntn:O,srcShape:w,tgtShape:x,posPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},intersectionPts:{x1:A.x2,y1:A.y2,x2:A.x1,y2:A.y1},vector:{x:-R.x,y:-R.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-F.x,y:-F.y}}}var V=j?u:s;S.nodesOverlap=V.nodesOverlap,S.srcIntn=V.srcIntn,S.tgtIntn=V.tgtIntn,r&&(d.isParent()||d.isChild()||f.isParent()||f.isChild())&&(d.parents().anySame(f)||f.parents().anySame(d)||d.same(f)&&d.isParent())?t.findCompoundLoopPoints(k,V,_,C):d===f?t.findLoopPoints(k,V,_,C):"segments"===P?t.findSegmentsPoints(k,V):"taxi"===P?t.findTaxiPoints(k,V):"straight"===P||!C&&s.eles.length%2==1&&_===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(k):t.findBezierPoints(k,V,_,C,j),t.findEndpoints(k),t.tryToCorrectInvalidPoints(k,V),t.checkForInvalidEdgeWarning(k),t.storeAllpts(k),t.storeEdgeProjections(k),t.calculateArrowAngles(k),t.recalculateEdgeLabelProjections(k),t.calculateLabelAngles(k)}},m=0;m<o.length;m++)y(m);this.findHaystackPoints(a)}},Ga.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),Ya(t.segpts)},Ga.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),Ya(t.ctrlpts)},Ga.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var qa={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),u=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,u[0],u[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],u=e.target()[0],l=s.position(),c=u.position(),d=e.pstyle("target-arrow-shape").value,f=e.pstyle("source-arrow-shape").value,h=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,y=g.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,_="segments"===y,k=b||x||w,S=m||"taxi"===v,P=e.pstyle("source-endpoint"),C=S?"outside-to-node":P.value,j=e.pstyle("target-endpoint"),D=S?"outside-to-node":j.value;if(g.srcManEndpt=P,g.tgtManEndpt=j,b){var O=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:O,r=O}else if(w){var T=_?g.segpts.slice(0,2):[c.x,c.y];n=_?g.segpts.slice(g.segpts.length-2):[l.x,l.y],r=T}if("inside-to-node"===D)t=[c.x,c.y];else if(j.units)t=this.manualEndptToPx(u,j);else if("outside-to-line"===D)t=g.tgtIntn;else if("outside-to-node"===D||"outside-to-node-or-label"===D?i=n:"outside-to-line"!==D&&"outside-to-line-or-label"!==D||(i=[l.x,l.y]),t=a.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===D||"outside-to-line-or-label"===D){var N=u._private.rscratch,A=N.labelWidth,M=N.labelHeight,B=N.labelX,L=N.labelY,I=A/2,R=M/2,z=u.pstyle("text-valign").value;"top"===z?L-=R:"bottom"===z&&(L+=R);var F=u.pstyle("text-halign").value;"left"===F?B-=I:"right"===F&&(B+=I);var V=kt(i[0],i[1],[B-I,L-R,B+I,L-R,B+I,L+R,B-I,L+R],c.x,c.y);if(V.length>0){var G=l,Y=Je(G,Ue(t)),q=Je(G,Ue(V)),W=Y;if(q<Y&&(t=V,W=q),V.length>2)Je(G,{x:V[2],y:V[3]})<W&&(t=[V[2],V[3]])}}var H=St(t,n,a.arrowShapes[d].spacing(e)+h),U=St(t,n,a.arrowShapes[d].gap(e)+h);if(g.endX=U[0],g.endY=U[1],g.arrowEndX=H[0],g.arrowEndY=H[1],"inside-to-node"===C)t=[l.x,l.y];else if(P.units)t=this.manualEndptToPx(s,P);else if("outside-to-line"===C)t=g.srcIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?o=r:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(o=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===C||"outside-to-line-or-label"===C){var X=s._private.rscratch,K=X.labelWidth,Q=X.labelHeight,Z=X.labelX,J=X.labelY,$=K/2,ee=Q/2,te=s.pstyle("text-valign").value;"top"===te?J-=ee:"bottom"===te&&(J+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?Z-=$:"right"===ne&&(Z+=$);var re=kt(o[0],o[1],[Z-$,J-ee,Z+$,J-ee,Z+$,J+ee,Z-$,J+ee],l.x,l.y);if(re.length>0){var ie=c,oe=Je(ie,Ue(t)),ae=Je(ie,Ue(re)),se=oe;if(ae<oe&&(t=[re[0],re[1]],se=ae),re.length>2)Je(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var ue=St(t,r,a.arrowShapes[f].spacing(e)+p),le=St(t,r,a.arrowShapes[f].gap(e)+p);g.startX=le[0],g.startY=le[1],g.arrowStartX=ue[0],g.arrowStartY=ue[1],k&&(E(g.startX)&&E(g.startY)&&E(g.endX)&&E(g.endY)?g.badLine=!1:g.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},Wa={};function Ha(e,t,n){for(var r=function(e,t,n,r){return et(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}Wa.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)Ha(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},Wa.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Ua={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!O(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),u=e.position(),l=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,d=i.rscratch,f=i.rstyle;switch(l){case"left":n=u.x-o/2-s;break;case"right":n=u.x+o/2+s;break;default:n=u.x}switch(c){case"top":r=u.y-a/2-s;break;case"bottom":r=u.y+a/2+s;break;default:r=u.y}d.labelX=n,d.labelY=r,f.labelX=n,f.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},Xa=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},Ka=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Xa(n,r)};Ua.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){t={x:r.midX,y:r.midY};var a=function(e,t,r){Se(n.rscratch,e,t,r),Se(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=Xa(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var u=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4){var a={x:r.allpts[o],y:r.allpts[o+1]},s={x:r.allpts[o+2],y:r.allpts[o+3]},u={x:r.allpts[o+4],y:r.allpts[o+5]};t.push({p0:a,p1:s,p2:u,startDist:0,length:0,segments:[]})}var l=n.rstyle.bezierPts,c=i.bezierProjPcts.length;function d(e,t,n,r,i){var o=Ze(t,n),a=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o};e.segments.push(s),e.length+=o}for(var f=0;f<t.length;f++){var h=t[f],p=t[f-1];p&&(h.startDist=p.startDist+p.length),d(h,h.p0,l[f*c],0,i.bezierProjPcts[0]);for(var v=0;v<c-1;v++)d(h,l[f*c+v],l[f*c+v+1],i.bezierProjPcts[v],i.bezierProjPcts[v+1]);d(h,l[f*c+c-1],h.p2,i.bezierProjPcts[c-1],1)}return e.cache=t},l=function(n){var i,s="source"===n;if(o[n]){var l=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var c,d=u(),f=0,h=0,p=0;p<d.length;p++){for(var v=d[s?p:d.length-1-p],g=0;g<v.segments.length;g++){var y=v.segments[s?g:v.segments.length-1-g],m=p===d.length-1&&g===v.segments.length-1;if(f=h,(h+=y.length)>=l||m){c={cp:v,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(l-f)/x.length,_=x.t1-x.t0,E=s?x.t0+_*w:x.t1-_*w;E=nt(0,E,1),t=tt(b.p0,b.p1,b.p2,E),i=function(e,t,n,r){var i=nt(0,r-.001,1),o=nt(0,r+.001,1),a=tt(e,t,n,i),s=tt(e,t,n,o);return Ka(a,s)}(b.p0,b.p1,b.p2,E);break;case"straight":case"segments":case"haystack":for(var k,S,P,C,j=0,D=r.allpts.length,O=0;O+3<D&&(s?(P={x:r.allpts[O],y:r.allpts[O+1]},C={x:r.allpts[O+2],y:r.allpts[O+3]}):(P={x:r.allpts[D-2-O],y:r.allpts[D-1-O]},C={x:r.allpts[D-4-O],y:r.allpts[D-3-O]}),S=j,!((j+=k=Ze(P,C))>=l));O+=2);var T=(l-S)/k;T=nt(0,T,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Ze(e,t),s=i/a,u=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+u*r}}(P,C,T),i=Ka(P,C)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};l("source"),l("target"),this.applyLabelDimensions(e)}},Ua.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},Ua.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=ke(n.rscratch,"labelWrapCachedLines",t)||[],u="wrap"!==a?1:Math.max(s.length,1),l=i.height/u,c=l*o,d=i.width,f=i.height+(u-1)*(o-1)*l;Se(n.rstyle,"labelWidth",t,d),Se(n.rscratch,"labelWidth",t,d),Se(n.rstyle,"labelHeight",t,f),Se(n.rscratch,"labelHeight",t,f),Se(n.rscratch,"labelLineHeight",t,c)},Ua.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Se(n.rscratch,e,t,r),r):ke(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var u=a("labelKey");if(null!=u&&a("labelWrapKey")===u)return a("labelWrapCachedText");for(var l=i.split("\n"),c=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,f=[],h=/[\s\u200b]+/,p=d?"":" ",v=0;v<l.length;v++){var g=l[v],y=this.calculateLabelDimensions(e,g).width;if(d){var m=g.split("").join("\u200b");g=m}if(y>c){for(var b=g.split(h),x="",w=0;w<b.length;w++){var _=b[w],E=0===x.length?_:x+p+_;this.calculateLabelDimensions(e,E).width<=c?x+=_+p:(x&&f.push(x),x=_+p)}x.match(/^[\s\u200b]+$/)||f.push(x)}else f.push(g)}a("labelWrapCachedLines",f),i=a("labelWrapCachedText",f.join("\n")),a("labelWrapKey",u)}else if("ellipsis"===s){var k=e.pstyle("text-max-width").pfValue,S="",P=!1;if(this.calculateLabelDimensions(e,i).width<k)return i;for(var C=0;C<i.length;C++){if(this.calculateLabelDimensions(e,S+i[C]+"\u2026").width>k)break;S+=i[C],C===i.length-1&&(P=!0)}return P||(S+="\u2026"),S}return i},Ua.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},Ua.calculateLabelDimensions=function(e,t){var n=re(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,l=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=l.getContext("2d");var d=l.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(o," ").concat(u," ").concat(a,"px ").concat(s);for(var f=0,h=0,p=t.split("\n"),v=0;v<p.length;v++){var g=p[v],y=c.measureText(g),m=Math.ceil(y.width),b=a;f=Math.max(m,f),h+=b}return f+=0,h+=0,r[n]={width:f,height:h}},Ua.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",o=e.pstyle(i+"text-rotation"),a=o.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:o.pfValue},Ua.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var Qa={},Za=!1;Qa.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return Za||(ge("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Za=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var Ja={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],u=s._private.rstyle;s.isNode()&&!u.cleanConnected&&(r(s.connectedEdges()),u.cleanConnected=!0)}if(o)for(var l=0;l<o.length;l++){(0,o[l])(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,u=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(u.clean=!1),t&&u.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),u.clean=!0)}for(var l=0;l<i.length;l++){var c=i[l],d=c._private.rstyle,f=c.position();this.recalculateNodeLabelProjection(c),d.nodeX=f.x,d.nodeY=f.y,d.nodeW=c.pstyle("width").pfValue,d.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var h=0;h<r.length;h++){var p=r[h]._private,v=p.rstyle,g=p.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},$a={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(zi),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},es={};[Fa,Va,Ga,qa,Wa,Ua,Qa,Ja,$a].forEach((function(e){z(es,e)}));var ts={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0}));var a="data:";return e.substring(0,a.length).toLowerCase()===a||(o.crossOrigin=t),o.src=e,o}},ns={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)}};ns.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});window.addEventListener("test",null,o)}catch(s){}n.supportsPassiveEvents=i}var a=function(t,i,o){var a=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),n.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:a,addEventListener:a,addListener:a,bind:a}},ns.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ns.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ns.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++){var a=n[o];t.emit({originalEvent:r,type:a,position:i})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},a=function(e){e[0]._private.rscratch.inDragLayer=!0},s=function(e){e[0]._private.rscratch.isGrabTarget=!0},u=function(e,t){var n=t.addToList;n.has(e)||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(a),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(a)),n.addToList&&t.forEach((function(e){u(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(a),n.connectedEdges().forEach(a)),t.addToList&&t.addToList.unmerge(n)}}(t,n),f(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},c=l,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},f=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(a),r.forEach(a)),t.addToList&&r.forEach((function(e){u(e,t)}))}}},h=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},p="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;p?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=i((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],u=!1,l=0;l<s.length;l++){var c=s[l];if(r<=c.clientX&&c.clientX<=r+o&&i<=c.clientY&&c.clientY<=i+a){u=!0;break}}if(!u)return!1;for(var d=e.container,f=t.target.parentNode,h=!1;f;){if(f===d){h=!0;break}f=f.parentNode}return!!h};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),h(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),a=e.selection,u=e.findNearestElements(o[0],o[1],!0,!1),d=u[0],f=e.dragData.possibleDragElements;e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i;if(3==t.which){e.hoverData.cxtStarted=!0;var p={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(p),e.hoverData.down=d):r.emit(p),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(s(d),d.selected()){f=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(g,{addToList:f}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else f=e.dragData.possibleDragElements=r.collection(),c(d,{addToList:f}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=u,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(a[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(a[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}a[0]=a[2]=o[0],a[1]=a[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var i=!1,a=e.cy,s=a.zoom(),u=[t.clientX,t.clientY],c=e.projectIntoViewport(u[0],u[1]),f=e.hoverData.mdownPos,h=e.hoverData.mdownGPos,p=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(c[0],c[1],!0,!1));var g,y=e.hoverData.last,m=e.hoverData.down,b=[c[0]-p[2],c[1]-p[3]],x=e.dragData.possibleDragElements;if(h){var _=u[0]-h[0],k=_*_,S=u[1]-h[1],P=k+S*S;e.hoverData.isOverThresholdDrag=g=P>=e.desktopTapThreshold2}var C=r(t);g&&(e.hoverData.tapholdCancelled=!0);i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var j=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};m?m.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(i=!0,a.panningEnabled()&&a.userPanningEnabled()){var O;if(e.hoverData.justStartedPan){var T=e.hoverData.mdownPos;O={x:(c[0]-T[0])*s,y:(c[1]-T[1])*s},e.hoverData.justStartedPan=!1}else O={x:b[0]*s,y:b[1]*s};a.panBy(O),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||v==y||(y&&n(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=v),m)if(g){if(a.boxSelectionEnabled()&&C)m&&m.grabbed()&&(d(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),j();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var N=!e.dragData.didDrag;N&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var A=a.collection();e.hoverData.draggingEles||l(x,{inDragLayer:!0});var M={x:0,y:0};if(E(b[0])&&E(b[1])&&(M.x+=b[0],M.y+=b[1],N)){var B=e.hoverData.dragDelta;B&&E(B[0])&&E(B[1])&&(M.x+=B[0],M.y+=B[1])}for(var L=0;L<x.length;L++){var I=x[L];e.nodeIsDraggable(I)&&I.grabbed()&&A.push(I)}e.hoverData.draggingEles=!0,A.silentShift(M).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();i=!0}else if(g){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!C&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){o(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=Ue(f),e.redrawHint("select",!0),e.redraw())}}else j();m&&m.pannable()&&m.active()&&m.unactivate()}return p[2]=c[0],p[3]=c[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,u=e.findNearestElement(a[0],a[1],!0,!1),l=e.dragData.possibleDragElements,c=e.hoverData.down,f=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var h={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(h):o.emit(h),!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(p):o.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(u,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(c,["click","tap","vclick"],i,{x:a[0],y:a[1]}),b=!1,i.timeStamp-x<=o.multiClickDebounceTime()?(m&&clearTimeout(m),b=!0,x=null,n(c,["dblclick","dbltap","vdblclick"],i,{x:a[0],y:a[1]})):(m=setTimeout((function(){b||n(c,["oneclick","onetap","voneclick"],i,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),x=i.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),l.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=o.collection()),u!=c||e.dragData.didDrag||e.hoverData.selecting||null!=u&&u._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||f?u.selected()?u.unselect(["tapunselect"]):u.select(["tapselect"]):f||(o.$(t).unmerge(u).unselect(["tapunselect"]),u.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===o.selectionType()||f||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();d(l),y&&(c.emit("freeon"),l.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),l.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var _,k,S,P,C,j,D,O,T,N,A,M,B,L=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var u=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(u=e.gestureStartZoom*t.scale),n.zoom({level:u,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",L,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||L(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var I,R,z,F,V,G,Y,q=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},W=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",I=function(t){if(e.hasTouchStarted=!0,w(t)){h(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]){a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=a[0],i[3]=a[1]}if(t.touches[2]){a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=a[0],i[5]=a[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();T=u[0],N=u[1],A=u[2],M=u[3],_=t.touches[0].clientX-T,k=t.touches[0].clientY-N,S=t.touches[1].clientX-T,P=t.touches[1].clientY-N,B=0<=_&&_<=A&&0<=S&&S<=A&&0<=k&&k<=M&&0<=P&&P<=M;var f=r.pan(),p=r.zoom();C=q(_,k,S,P),j=W(_,k,S,P),O=[((D=[(_+S)/2,(k+P)/2])[0]-f.x)/p,(D[1]-f.y)/p];if(j<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),g=e.findNearestElement(i[2],i[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),m=y[0];if(null!=m&&(m.activate(),e.touchData.start=m,e.touchData.starts=y,e.nodeIsGrabbable(m))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),m.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):c(m,{addToList:b}),s(m);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};m.emit(E("grabon")),x?x.forEach((function(e){e.emit(E("grab"))})):m.emit(E("grab"))}n(m,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==m&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var L=e.touchData.startPosition=[],I=0;I<i.length;I++)L[I]=o[I]=i[I];var R=t.touches[0];e.touchData.startGPosition=[R.clientX,R.clientY]}}},!1),e.registerBinding(window,"touchmove",R=function(t){var r=e.touchData.capture;if(r||w(t)){var i=e.selection,a=e.cy,s=e.touchData.now,u=e.touchData.earlier,c=a.zoom();if(t.touches[0]){var f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}var h,p=e.touchData.startGPosition;if(r&&t.touches[0]&&p){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-u[g];var y=t.touches[0].clientX-p[0],m=y*y,b=t.touches[0].clientY-p[1];h=m+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-T,D=t.touches[0].clientY-N,A=t.touches[1].clientX-T,M=t.touches[1].clientY-N,L=W(x,D,A,M);if(L/j>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var I={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(I),e.touchData.start=null):a.emit(I)}}if(r&&e.touchData.cxt){I={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(I):a.emit(I),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var R=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&R===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=R,R&&R.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z<ee.length;z++){var F=ee[z]._private;F.grabbed=!1,F.rscratch.inDragLayer=!1}}var V=e.touchData.start,G=(x=t.touches[0].clientX-T,D=t.touches[0].clientY-N,A=t.touches[1].clientX-T,M=t.touches[1].clientY-N,q(x,D,A,M)),Y=G/C;if(B){var H=(x-_+(A-S))/2,U=(D-k+(M-P))/2,X=a.zoom(),K=X*Y,Q=a.pan(),Z=O[0]*X+Q.x,J=O[1]*X+Q.y,$={x:-K/X*(Z-Q.x-H)+Z,y:-K/X*(J-Q.y-U)+J};if(V&&V.active()){var ee=e.dragData.touchDragEles;d(ee),e.redrawHint("drag",!0),e.redrawHint("eles",!0),V.unactivate().emit("freeon"),ee.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),ee.emit("dragfree"))}a.viewport({zoom:K,pan:$,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),C=G,_=x,k=D,S=A,P=M,e.pinching=!0}if(t.touches[0]){f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}if(t.touches[1]){f=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=f[0],s[3]=f[1]}if(t.touches[2]){f=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=f[0],s[5]=f[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var te=e.touchData.start,ne=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(R=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=te&&t.preventDefault(),r&&null!=te&&e.nodeIsDraggable(te))if(h){ee=e.dragData.touchDragEles;var re=!e.dragData.didDrag;re&&l(ee,{inDragLayer:!0}),e.dragData.didDrag=!0;var ie={x:0,y:0};if(E(v[0])&&E(v[1]))if(ie.x+=v[0],ie.y+=v[1],re)e.redrawHint("eles",!0),(oe=e.touchData.dragDelta)&&E(oe[0])&&E(oe[1])&&(ie.x+=oe[0],ie.y+=oe[1]);e.hoverData.draggingEles=!0,ee.silentShift(ie).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==u[0]&&e.touchData.startPosition[1]==u[1]&&e.redrawHint("eles",!0),e.redraw()}else{var oe;0===(oe=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(oe.push(v[0]),oe.push(v[1])):(oe[0]+=v[0],oe[1]+=v[1])}if(n(te||R,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||R==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),R&&R.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=R,r)for(z=0;z<s.length;z++)s[z]&&e.touchData.startPosition[z]&&h&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){o(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Ue(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:v[0]*c,y:v[1]*c}),a.emit("dragpan")):h&&(e.swipePanning=!0,a.panBy({x:y*c,y:b*c}),a.emit("dragpan"),te&&(te.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));f=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=f[0],s[1]=f[1]}}for(g=0;g<s.length;g++)u[g]=s[g];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",z=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",F=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,u=s.zoom(),l=e.touchData.now,c=e.touchData.earlier;if(r.touches[0]){var f=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=f[0],l[1]=f[1]}if(r.touches[1]){f=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=f[0],l[3]=f[1]}if(r.touches[2]){f=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=f[0],l[5]=f[1]}if(i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:l[0],y:l[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var h={originalEvent:r,type:"cxttap",position:{x:l[0],y:l[1]}};i?i.emit(h):s.emit(h)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:l[0],y:l[1]}});p.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=i){var g=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(i.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),v.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(l[0],l[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]})}var m=e.touchData.startPosition[0]-l[0],b=m*m,x=e.touchData.startPosition[1]-l[1],w=(b+x*x)*u*u;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:l[0],y:l[1]}),V=!1,r.timeStamp-Y<=s.multiClickDebounceTime()?(G&&clearTimeout(G),V=!0,Y=null,n(i,["dbltap","vdblclick"],r,{x:l[0],y:l[1]})):(G=setTimeout((function(){V||n(i,["onetap","voneclick"],r,{x:l[0],y:l[1]})}),s.multiClickDebounceTime()),Y=r.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var _=0;_<l.length;_++)c[_]=l[_];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var H=[],U=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},X=function(e){H.push(function(e){return{event:e,touch:U(e)}}(e))},K=function(e){for(var t=0;t<H.length;t++){if(H[t].event.pointerId===e.pointerId)return void H.splice(t,1)}},Q=function(e){e.touches=H.map((function(e){return e.touch}))},Z=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){Z(e)||(e.preventDefault(),X(e),Q(e),I(e))})),e.registerBinding(e.container,"pointerup",(function(e){Z(e)||(K(e),Q(e),F(e))})),e.registerBinding(e.container,"pointercancel",(function(e){Z(e)||(K(e),Q(e),z())})),e.registerBinding(e.container,"pointermove",(function(e){Z(e)||(e.preventDefault(),function(e){var t=H.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=U(e)}(e),Q(e),R(e))}))}};var rs={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return kt(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return yt(e,t,this.points,o,a,r,i,[0,-1],n)}}}};rs.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var u=Math.sqrt(a*a+s*s),l=u-1;if(l<0)return[];var c=l/u;return[(n-e)*c+e,(r-t)*c+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return xt(e,t,r,i,o,a,n)}}},rs.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,o=void 0;o=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var a=t[o]-t[i],s=t[o+1]-t[i+1],u=Math.sqrt(a*a+s*s);n[4*r+2]=a/u,n[4*r+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var u,l=[],c=new Array(n.length),d=o/2,f=a/2,h=Ot(o,a),p=0;p<n.length/4;p++){var v,g=void 0;g=0===p?n.length-2:4*p-2,v=4*p+2;var y=r+d*n[4*p],m=i+f*n[4*p+1],b=-n[g]*n[v]-n[g+1]*n[v+1],x=h/Math.tan(Math.acos(b)/2),w=y-x*n[g],_=m-x*n[g+1],E=y+x*n[v],k=m+x*n[v+1];0===p?(c[n.length-2]=w,c[n.length-1]=_):(c[4*p-2]=w,c[4*p-1]=_),c[4*p]=E,c[4*p+1]=k;var S=n[g+1],P=-n[g];S*n[v]+P*n[v+1]<0&&(S*=-1,P*=-1),0!==(u=wt(e,t,r,i,w+S*h,_+P*h,h)).length&&l.push(u[0],u[1])}for(var C=0;C<c.length/4;C++)0!==(u=Et(e,t,r,i,c[4*C],c[4*C+1],c[4*C+2],c[4*C+3],!1)).length&&l.push(u[0],u[1]);if(l.length>2){for(var j=[l[0],l[1]],D=Math.pow(j[0]-e,2)+Math.pow(j[1]-t,2),O=1;O<l.length/2;O++){var T=Math.pow(l[2*O]-e,2)+Math.pow(l[2*O+1]-t,2);T<=D&&(j[0]=l[2*O],j[1]=l[2*O+1],D=T)}return j}return l}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),u=o/2,l=a/2,c=Ot(o,a),d=c*c,f=0;f<n.length/4;f++){var h,p=void 0;p=0===f?n.length-2:4*f-2,h=4*f+2;var v=r+u*n[4*f],g=i+l*n[4*f+1],y=-n[p]*n[h]-n[p+1]*n[h+1],m=c/Math.tan(Math.acos(y)/2),b=v-m*n[p],x=g-m*n[p+1],w=v+m*n[h],_=g+m*n[h+1];s[4*f]=b,s[4*f+1]=x,s[4*f+2]=w,s[4*f+3]=_;var E=n[p+1],k=-n[p];E*n[h]+k*n[h+1]<0&&(E*=-1,k*=-1);var S=b+E*c,P=x+k*c;if(Math.pow(S-e,2)+Math.pow(P-t,2)<=d)return!0}return gt(e,t,s)}(e,t,this.points,o,a,r,i)}}},rs.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return dt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Dt(r,i),u=2*s;return!!yt(e,t,this.points,o,a,r,i-u,[0,-1],n)||(!!yt(e,t,this.points,o,a,r-u,i,[0,-1],n)||(!!xt(e,t,u,u,o-r/2+s,a-i/2+s,n)||(!!xt(e,t,u,u,o+r/2-s,a-i/2+s,n)||(!!xt(e,t,u,u,o+r/2-s,a+i/2-s,n)||!!xt(e,t,u,u,o-r/2+s,a+i/2-s,n)))))}}},rs.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,u=n+a,l=r-o,c=r+o;return{topLeft:[s,l+i,s+i,l,s+i,l+i],topRight:[u-i,l,u,l+i,u-i,l+i],bottomRight:[u,c-i,u-i,c,u-i,c-i],bottomLeft:[s+i,c,s,c-i,s+i,c-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),u=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return kt(i,o,u,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(yt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return gt(e,t,s.topLeft)||gt(e,t,s.topRight)||gt(e,t,s.bottomRight)||gt(e,t,s.bottomLeft)}}},rs.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),u=function(e){var t=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=tt({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},l=[].concat(u(s.topLeft),u(s.topRight),u(s.bottomRight),u(s.bottomLeft));return kt(i,o,l,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,u=r-i,l=r+i,c=Tt(e,t),d=c.heightOffset,f=c.widthOffset,h=c.ctrlPtOffsetPct*e,p={topLeft:[a,u+d,a+h,u,a+f,u],topRight:[s-f,u,s-h,u,s,u+d],bottomRight:[s,l-d,s-h,l,s-f,l],bottomLeft:[a+f,l,a+h,l,a,l-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,i,o,a){var s=Tt(r,i),u=s.heightOffset,l=s.widthOffset;if(yt(e,t,this.points,o,a,r,i-2*u,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-2*l,i,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,i,o,a),d=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],u=n[5],l=n[1],c=Math.min(o,s),d=Math.max(o,s),f=Math.min(u,l),h=Math.max(u,l);if(c<=e&&e<=d&&f<=t&&t<=h){var p=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(p[0],p[1],p[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},f=Object.keys(c),h=0;h<f.length;h++){var p=c[f[h]],v=d(e,t,p);if(null!=v){var g=p[5],y=p[3],m=p[1],b=et(g,y,m,v);if(p.isTop&&b<=t)return!0;if(p.isBottom&&t<=b)return!0}}return!1}}},rs.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),u=Et(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return u.length>0?u:dt(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Dt(r,i),u=2*s;if(yt(e,t,this.points,o,a,r,i-u,[0,-1],n))return!0;if(yt(e,t,this.points,o,a,r-u,i,[0,-1],n))return!0;var l=r/2+2*n,c=i/2+2*n;return!!gt(e,t,[o-l,a-c,o-l,a,o+l,a,o+l,a-c])||(!!xt(e,t,u,u,o+r/2-s,a+i/2-s,n)||!!xt(e,t,u,u,o-r/2+s,a+i/2-s,n))}}},rs.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Pt(3,0)),this.generateRoundPolygon("round-triangle",Pt(3,0)),this.generatePolygon("rectangle",Pt(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Pt(5,0)),this.generateRoundPolygon("round-pentagon",Pt(5,0)),this.generatePolygon("hexagon",Pt(6,0)),this.generateRoundPolygon("round-hexagon",Pt(6,0)),this.generatePolygon("heptagon",Pt(7,0)),this.generateRoundPolygon("round-heptagon",Pt(7,0)),this.generatePolygon("octagon",Pt(8,0)),this.generateRoundPolygon("round-octagon",Pt(8,0));var r=new Array(20),i=jt(5,0),o=jt(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=Ct(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var is={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||xe();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&pe("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},os=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};is.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;U((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){os(e,!0,r);var i=X();e.render(e.renderOptions);var o=e.lastDrawTime=X();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else os(e,!1,r);e.skipFrame=!1,U(n)}}))}};var as=function(e){this.init(e)},ss=as.prototype;ss.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ss.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(f){var r=f.document,i=r.head,o="__________cytoscape_stylesheet",a="__________cytoscape_container",s=null!=r.getElementById(o);if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!s){var u=r.createElement("style");u.id=o,u.innerHTML="."+a+" { position: relative; }",i.insertBefore(u,i.children[0])}"static"===f.getComputedStyle(n).getPropertyValue("position")&&ge("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=E(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ss.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},ss.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},ss.isHeadless=function(){return!1},[za,es,ts,ns,rs,is].forEach((function(e){z(ss,e)}));var us=1e3/60,ls=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=i((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),o=e.priority||he;n.beforeRender((function(i,o){var a=X(),s=n.averageRedrawTime,u=n.lastRedrawTime,l=[],c=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var f=X(),h=f-a,p=f-o;if(u<us){var v=us-(i?s:0);if(p>=e.deqFastCost*v)break}else if(i){if(h>=e.deqCost*u||h>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*us)break;var g=e.deq(t,d,c);if(!(g.length>0))break;for(var y=0;y<g.length;y++)l.push(g[y])}l.length>0&&(e.onDeqd(t,l),!i&&e.shouldRedraw(t,l,d,c)&&r())}),o(t))}}},cs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de;s(this,e),this.idsByKey=new Pe,this.keyForId=new Pe,this.cachesByLvl=new Pe,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return l(e,[{key:"getIdsFor",value:function(e){null==e&&pe("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new je,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Pe,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),ds={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},fs=we({getKey:null,doesEleInvalidateKey:de,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ce,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),hs=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=fs(t);z(n,r),n.lookup=new cs(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},ps=hs.prototype;ps.reasons=ds,ps.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},ps.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},ps.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new o((function(e,t){return t.reqs-e.reqs}))},ps.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},ps.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),u=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Ke(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var l=Math.pow(2,r),c=t.h*l,d=t.w*l,f=a.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,f))return null;var h,p=u.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(h=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=o.getTextureQueue(h),g=v[v.length-2],y=function(){return o.recycleTexture(h,d)||o.addTexture(h,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidth<d&&(g=y());for(var m,b=function(e){return e&&e.scaledLabelShown===f},x=i&&i===ds.dequeue,w=i&&i===ds.highQuality,_=i&&i===ds.downscale,E=r+1;E<=3;E++){var k=u.get(e,E);if(k){m=k;break}}var S=m&&m.level===r+1?m:null,P=function(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,d,c)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,h),b(S))P();else if(b(m)){if(!w)return o.queueElement(e,m.level-1),m;for(var C=m.level;C>r;C--)S=o.getElement(e,t,n,C,ds.downscale);P()}else{var j;if(!x&&!w&&!_)for(var D=r-1;D>=-4;D--){var O=u.get(e,D);if(O){j=O;break}}if(b(j))return o.queueElement(e,r),j;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,e,t,f,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:l,width:d,height:c,scaledLabelShown:f},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),u.set(e,r,p),o.checkTextureFullness(g),p},ps.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},ps.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=-4;i<=3;i++){var o=n.getForCachedKey(e,i);o&&r.push(o)}if(n.invalidate(e))for(var a=0;a<r.length;a++){var s=r[a],u=s.texture;u.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(u)}t.removeFromQueue(e)}},ps.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},ps.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?_e(t,e):e.fullnessChecks++},ps.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;_e(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}Ee(i),this.getRetiredTextureQueue(t).push(e)},ps.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},ps.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Ee(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),_e(r,o),n.push(o),o}},ps.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},ps.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),u=s.key,l=s.eles[0],c=o.hasCache(l,s.level);if(r[u]=null,!c){i.push(s);var d=t.getBoundingBox(l);t.getElement(l,d,e,s.level,ds.dequeue)}}return i},ps.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=le,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},ps.onDequeue=function(e){this.onDequeues.push(e)},ps.offDequeue=function(e){_e(this.onDequeues,e)},ps.setupDequeueing=ls({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(ut(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var vs=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=X()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=i((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new o((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},gs=vs.prototype,ys=0,ms=Math.pow(2,53)-1;gs.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:ys=++ys%ms,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,u=-a.bb.x1,l=-a.bb.y1;return s.scale(n,n),s.translate(u,l),a},gs.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(Ke(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,u=r.layersByLevel,l=Math.pow(2,n),c=u[n]=u[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=u[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&_e(c,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=rt();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*l*(a.h*l)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,o)}else(void 0===t.insert||t.insert)&&c.unshift(o);return o};if(r.skipping&&!o)return null;for(var f=null,h=e.length/1,p=!o,v=0;v<e.length;v++){var g=e[v],y=g._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)f=b;else{if((!f||f.eles.length>=h||!ct(f.bb,g.boundingBox()))&&!(f=d({insert:!0,after:f})))return null;s||p?r.queueLayer(f,g):r.drawEleInLayer(f,g,n,t),f.eles.push(g),m[n]=f}}return s||(p?null:c)},gs.getEleLevelForLayerLevel=function(e,t){return e},gs.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,true),i.setImgSmoothing(o,!0))},gs.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},gs.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},gs.updateElementsInLayers=function(e,t){for(var n=P(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},u=-4;u<=2;u++){var l=s[u];l&&(i&&this.getEleLevelForLayerLevel(l.level)!==i.level||t(l,o,i))}},gs.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},gs.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=X(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},gs.invalidateLayer=function(e){if(this.lastInvalidationTime=X(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];_e(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var o=n[i]._private.rscratch.imgLayerCaches;o&&(o[t]=null)}}},gs.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},gs.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},gs.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},gs.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<1&&0!==n.size();){var o=n.peek();if(o.replacement)n.pop();else if(o.replaces&&o!==o.replaces.replacement)n.pop();else if(o.invalid)n.pop();else{var a=o.elesQueue.shift();a&&(t.drawEleInLayer(o,a,o.level,e),i++),0===r.length&&r.push(!0),0===o.elesQueue.length&&(n.pop(),o.reqs=0,o.replaces&&t.applyLayerReplacement(o),t.requestRedraw())}}return r},gs.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},gs.requestRedraw=i((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),gs.setupDequeueing=ls({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:he,shouldRedraw:ce,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var bs,xs={};function ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function _s(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Es(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var o=r[i];e.lineTo(o.x,o.y)}var a=n,s=n[0];e.moveTo(s.x,s.y);for(i=1;i<a.length;i++){o=a[i];e.lineTo(o.x,o.y)}e.closePath&&e.closePath()}function ks(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var u=o[s];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function Ss(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}xs.arrowShapeImpl=function(e){return(bs||(bs={polygon:ws,"triangle-backcurve":_s,"triangle-tee":Es,"circle-triangle":ks,"triangle-cross":Es,circle:Ss}))[e]};var Ps={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var u=this,l=n.getBoundingBox(t);if(0!==l.w&&0!==l.h){var c=n.getElement(t,l,r,i,o);if(null!=c){var d=s(u,t);if(0===d)return;var f,h,p,v,g,y,m=a(u,t),b=l.x1,x=l.y1,w=l.w,_=l.h;if(0!==m){var E=n.getRotationPoint(t);p=E.x,v=E.y,e.translate(p,v),e.rotate(m),(g=u.getImgSmoothing(e))||u.setImgSmoothing(e,!0);var k=n.getRotationOffset(t);f=k.x,h=k.y}else f=b,h=x;1!==d&&(y=e.globalAlpha,e.globalAlpha=y*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,f,h,w,_),1!==d&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-p,-v),g||u.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Cs=function(){return 0},js=function(e,t){return e.getTextAngle(t,null)},Ds=function(e,t){return e.getTextAngle(t,"source")},Os=function(e,t){return e.getTextAngle(t,"target")},Ts=function(e,t){return t.effectiveOpacity()},Ns=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Ps.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,u=s.eleTxrCache,l=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,f=t.boundingBox(),h=!0===o?u.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&t.visible()&&(!r||ut(f,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,u,n,i,h,Cs,Ts),p&&v||a.drawCachedElementPortion(e,t,l,n,i,h,js,Ns),p&&!v&&(a.drawCachedElementPortion(e,t,c,n,i,h,Ds,Ns),a.drawCachedElementPortion(e,t,d,n,i,h,Os,Ns)),a.drawElementOverlay(e,t)}},Ps.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Ps.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];this.drawCachedElement(e,o,n,r)}},Ps.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Ps.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var As={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var u;n&&(u=n,e.translate(-u.x1,-u.y1));var l=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,f=t.pstyle("line-style").value,h=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=l*c,g=l*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=h,e.lineCap=p,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,f),e.lineCap="butt")},m=function(){i&&a.drawEdgeOverlay(e,t)},b=function(){i&&a.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;a.drawArrowheads(e,t,n)},w=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var _="yes"===t.pstyle("ghost").value;if(_){var E=t.pstyle("ghost-offset-x").pfValue,k=t.pstyle("ghost-offset-y").pfValue,S=t.pstyle("ghost-opacity").value,P=v*S;e.translate(E,k),y(P),x(P),e.translate(-E,-k)}b(),y(),x(),m(),w(),n&&e.translate(u.x1,u.y1)}}},Ms=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,u[0],u[1],u[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};As.drawEdgeOverlay=Ms("overlay"),As.drawEdgeUnderlay=Ms("underlay"),As.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,u=this.usePaths(),l=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(u){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(l),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var f=2;f+3<n.length;f+=4)t.quadraticCurveTo(n[f],n[f+1],n[f+2],n[f+3]);break;case"straight":case"segments":case"haystack":for(var h=2;h+1<n.length;h+=2)t.lineTo(n[h],n[h+1])}t=a,u?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},As.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var o=[n[i+2]-n[i],n[i+3]-n[i+1]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/a,-o[0]/a],u=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-u[0],n[i+1]-u[1]),t.lineTo(n[i]+u[0],n[i+1]+u[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},As.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},As.drawArrowhead=function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=this,u=t.pstyle(n+"-arrow-shape").value;if("none"!==u){var l="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,f=t.pstyle("opacity").value;void 0===a&&(a=f);var h=e.globalCompositeOperation;1===a&&"hollow"!==c||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,l,d,u,r,i,o),e.globalCompositeOperation=h);var p=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,p[0],p[1],p[2],a),s.colorStrokeStyle(e,p[0],p[1],p[2],a),s.drawArrowShape(t,e,c,d,u,r,i,o)}}},As.drawArrowShape=function(e,t,n,r,i,o,a,s){var u,l=this,c=this.usePaths()&&"triangle-cross"!==i,d=!1,f=t,h={x:o,y:a},p=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,p),g=l.arrowShapes[i];if(c){var y=l.arrowPathCache=l.arrowPathCache||[],m=re(i),b=y[m];null!=b?(u=t=b,d=!0):(u=t=new Path2D,y[m]=u)}d||(t.beginPath&&t.beginPath(),c?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,h,r),t.closePath&&t.closePath()),t=f,c&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(c?t.fill(u):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(c?v:1),t.lineJoin="miter",c?t.stroke(u):t.stroke()),c&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))};var Bs={safeDrawImage:function(e,t,n,r,i,o,a,s,u,l){i<=0||o<=0||u<=0||l<=0||e.drawImage(t,n,r,i,o,a,s,u,l)},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,u=a.y,l=n.cy().style(),c=l.getIndexedStyle.bind(l),d=c(n,"background-fit","value",r),f=c(n,"background-repeat","value",r),h=n.width(),p=n.height(),v=2*n.padding(),g=h+("inner"===c(n,"background-width-relative-to","value",r)?0:v),y=p+("inner"===c(n,"background-height-relative-to","value",r)?0:v),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*i,w=c(n,"background-image-smoothing","value",r),_=t.width||t.cachedW,E=t.height||t.cachedH;null!=_&&null!=E||(document.body.appendChild(t),_=t.cachedW=t.width||t.offsetWidth,E=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var k=_,S=E;if("auto"!==c(n,"background-width","value",r)&&(k="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*g:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(S="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==k&&0!==S){if("contain"===d)k*=P=Math.min(g/k,y/S),S*=P;else if("cover"===d){var P;k*=P=Math.max(g/k,y/S),S*=P}var C=s-g/2,j=c(n,"background-position-x","units",r),D=c(n,"background-position-x","pfValue",r);C+="%"===j?(g-k)*D:D;var O=c(n,"background-offset-x","units",r),T=c(n,"background-offset-x","pfValue",r);C+="%"===O?(g-k)*T:T;var N=u-y/2,A=c(n,"background-position-y","units",r),M=c(n,"background-position-y","pfValue",r);N+="%"===A?(y-S)*M:M;var B=c(n,"background-offset-y","units",r),L=c(n,"background-offset-y","pfValue",r);N+="%"===B?(y-S)*L:L,m.pathCache&&(C-=s,N-=u,s=0,u=0);var I=e.globalAlpha;e.globalAlpha=x;var R=o.getImgSmoothing(e),z=!1;if("no"===w&&R?(o.setImgSmoothing(e,!1),z=!0):"yes"!==w||R||(o.setImgSmoothing(e,!0),z=!0),"no-repeat"===f)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.clip())),o.safeDrawImage(e,t,0,0,_,E,C,N,k,S),b&&e.restore();else{var F=e.createPattern(t,f);e.fillStyle=F,o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.translate(C,N),e.fill(),e.translate(-C,-N)}e.globalAlpha=I,z&&o.setImgSmoothing(e,R)}}},Ls={};function Is(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}Ls.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Ke(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Ls.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var u=a.getLabelJustification(t);e.textAlign=u,e.textBaseline="bottom"}else{var l=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),f=t.pstyle("target-label");if(l||(!c||!c.value)&&(!d||!d.value)&&(!f||!f.value))return;e.textAlign="center",e.textBaseline="bottom"}var h,p=!n;n&&(h=n,e.translate(-h.x1,-h.y1)),null==i?(a.drawText(e,t,null,p,o),t.isEdge()&&(a.drawText(e,t,"source",p,o),a.drawText(e,t,"target",p,o))):a.drawText(e,t,i,p,o),n&&e.translate(h.x1,h.y1)},Ls.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},Ls.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*s,l=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,l[0],l[1],l[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],u)},Ls.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=ke(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},Ls.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var u,l,c=ke(a,"labelX",n),d=ke(a,"labelY",n),f=this.getLabelText(t,n);if(null!=f&&""!==f&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",v=ke(a,"labelWidth",n),g=ke(a,"labelHeight",n),y=t.pstyle(p+"text-margin-x").pfValue,m=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),c+=y,d+=m,0!==(h=r?this.getTextAngle(t,n):0)&&(u=c,l=d,e.translate(u,l),e.rotate(h),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var _=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,S=t.pstyle("text-background-padding").pfValue;if(_>0||k>0&&E>0){var P=c-S;switch(x){case"left":P-=v;break;case"center":P-=v/2}var C=d-g-S,j=v+2*S,D=g+2*S;if(_>0){var O=e.fillStyle,T=t.pstyle("text-background-color").value;e.fillStyle="rgba("+T[0]+","+T[1]+","+T[2]+","+_*s+")";var N=t.pstyle("text-background-shape").strValue;0===N.indexOf("round")?Is(e,P,C,j,D,2):e.fillRect(P,C,j,D),e.fillStyle=O}if(k>0&&E>0){var A=e.strokeStyle,M=e.lineWidth,B=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+E*s+")",e.lineWidth=k,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(P,C,j,D),"double"===L){var I=k/2;e.strokeRect(P+I,C+I,j-2*I,D-2*I)}e.setLineDash&&e.setLineDash([]),e.lineWidth=M,e.strokeStyle=A}}var R=2*t.pstyle("text-outline-width").pfValue;if(R>0&&(e.lineWidth=R),"wrap"===t.pstyle("text-wrap").value){var z=ke(a,"labelWrapCachedLines",n),F=ke(a,"labelLineHeight",n),V=v/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===x?"left"===G?c+=-v:"center"===G&&(c+=-V):"center"===x?"left"===G?c+=-V:"right"===G&&(c+=V):"right"===x&&("center"===G?c+=V:"right"===G&&(c+=v))),w){case"top":case"center":case"bottom":d-=(z.length-1)*F}for(var Y=0;Y<z.length;Y++)R>0&&e.strokeText(z[Y],c,d),e.fillText(z[Y],c,d),d+=F}else R>0&&e.strokeText(f,c,d),e.fillText(f,c,d);0!==h&&(e.rotate(-h),e.translate(-u,-l))}}};var Rs={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=this,l=t._private,c=l.rscratch,d=t.position();if(E(d.x)&&E(d.y)&&(!s||t.visible())){var f,h,p=s?t.effectiveOpacity():1,v=u.usePaths(),g=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(h=n,e.translate(-h.x1,-h.y1));for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),_=0,k=0;k<b.length;k++){var S=b[k],P=x[k]=null!=S&&"none"!==S;if(P){var C=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",k);_++,w[k]=u.getCachedImage(S,C,(function(){l.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,D=t.pstyle("border-width").pfValue,O=t.pstyle("background-opacity").value*p,T=t.pstyle("border-color").value,N=t.pstyle("border-style").value,A=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var M=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O;u.eleFillStyle(e,t,n)},B=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;u.colorStrokeStyle(e,T[0],T[1],T[2],t)},L=t.pstyle("shape").strValue,I=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var R=u.nodePathCache=u.nodePathCache||[],z=ie("polygon"===L?L+","+I.join(","):L,""+i,""+r),F=R[z];null!=F?(f=F,g=!0,c.pathCache=f):(f=new Path2D,R[z]=c.pathCache=f)}var V=function(){if(!g){var n=d;v&&(n={x:0,y:0}),u.nodeShapes[u.getNodeShape(t)].draw(f||e,n.x,n.y,r,i)}v?e.fill(f):e.fill()},G=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=l.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,u.drawInscribedImage(e,w[a],t,a,n))}l.backgrounding=!(o===_),i!==l.backgrounding&&t.updateStyle(!1)},Y=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;u.hasPie(t)&&(u.drawPie(e,t,o),n&&(v||u.nodeShapes[u.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(u.colorFillStyle(e,r,r,r,n),v?e.fill(f):e.fill())},W=function(){if(D>0){if(e.lineWidth=D,e.lineCap="butt",e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(f):e.stroke(),"double"===N){e.lineWidth=D/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(f):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},H=function(){a&&u.drawNodeOverlay(e,t,d,r,i)},U=function(){a&&u.drawNodeUnderlay(e,t,d,r,i)},X=function(){u.drawElementText(e,t,null,o)},K="yes"===t.pstyle("ghost").value;if(K){var Q=t.pstyle("ghost-offset-x").pfValue,Z=t.pstyle("ghost-offset-y").pfValue,J=t.pstyle("ghost-opacity").value,$=J*p;e.translate(Q,Z),M(J*O),V(),G($,!0),B(J*A),W(),Y(0!==j||0!==D),G($,!1),q($),e.translate(-Q,-Z)}v&&e.translate(-d.x,-d.y),U(),v&&e.translate(d.x,d.y),M(),V(),G(p,!0),B(),W(),Y(0!==j||0!==D),G(p,!1),q(),v&&e.translate(-d.x,-d.y),X(),H(),n&&e.translate(h.x1,h.y1)}}},zs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,o){if(n.visible()){var a=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,u=n.pstyle("".concat(e,"-color")).value,l=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==o){var c=n.padding();i=n.width()+2*c,o=n.height()+2*c}this.colorFillStyle(t,u[0],u[1],u[2],s),this.nodeShapes[l].draw(t,r.x,r.y,i+2*a,o+2*a),t.fill()}}}};Rs.drawNodeOverlay=zs("overlay"),Rs.drawNodeUnderlay=zs("underlay"),Rs.hasPie=function(e){return(e=e[0])._private.hasPie},Rs.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,u=t.width(),l=t.height(),c=Math.min(u,l)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var f=1;f<=i.pieBackgroundN;f++){var h=t.pstyle("pie-"+f+"-background-size").value,p=t.pstyle("pie-"+f+"-background-color").value,v=t.pstyle("pie-"+f+"-background-opacity").value*n,g=h/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*g;0===h||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}};var Fs={};Fs.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},Fs.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},Fs.createGradientStyleFor=function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,u=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var l=n.sourceEndpoint(),c=n.targetEndpoint(),d=n.midpoint(),f=Ze(l,d),h=Ze(c,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,h))}else{var p=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,g))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();o=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var _=u.length===s.length,E=s.length,k=0;k<E;k++)o.addColorStop(_?u[k]:k/(E-1),"rgba("+s[k][0]+","+s[k][1]+","+s[k][2]+","+i+")");return o},Fs.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},Fs.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},Fs.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},Fs.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},Fs.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},Fs.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},Fs.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=s);var u,l=i*a,c=o*a;if(l!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=i+"px",d.style.height=o+"px";for(var f=0;f<t.CANVAS_LAYERS;f++)(u=n.canvases[f]).width=l,u.height=c,u.style.width=i+"px",u.style.height=o+"px";for(f=0;f<t.BUFFER_COUNT;f++)(u=n.bufferCanvases[f]).width=l,u.height=c,u.style.width=i+"px",u.style.height=o+"px";t.textureMult=1,a<=1&&(u=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,u.width=l*t.textureMult,u.height=c*t.textureMult),t.canvasWidth=l,t.canvasHeight=c}},Fs.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Fs.render=function(e){var t=(e=e||xe()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,u=a.cy,l=a.data,c=l.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),f=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,h=a.motionBlurPxRatio,p=u.hasCompoundNodes(),v=a.hoverData.draggingEles,g=!(!a.hoverData.selecting&&!a.touchData.selecting),y=f=f&&!t&&a.motionBlurEnabled&&!g;t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),f&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(y=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=u.style(),b=u.zoom(),x=void 0!==i?i:b,w=u.pan(),_={x:w.x,y:w.y},E={zoom:b,pan:{x:w.x,y:w.y}},k=a.prevViewport;void 0===k||E.zoom!==k.zoom||E.pan.x!==k.pan.x||E.pan.y!==k.pan.y||v&&!p||(a.motionBlurPxRatio=1),o&&(_=o),x*=s,_.x*=s,_.y*=s;var S=a.getCachedZSortedEles();function P(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function C(e,r){var s,u,c,d;a.clearingMotionBlur||e!==l.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==l.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=_,u=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*h,y:w.y*h},u=b*h,c=a.canvasWidth*h,d=a.canvasHeight*h),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?P(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(u,u)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=u.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var j=a.data.bufferContexts[a.TEXTURE_BUFFER];j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:j,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(E=a.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=l.contexts[a.NODE],O=a.textureCache.texture;E=a.textureCache.viewport;D.setTransform(1,0,0,1,0,0),f?P(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var T=m.core("outside-texture-bg-color").value,N=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,T[0],T[1],T[2],N),D.fillRect(0,0,E.width,E.height);b=u.zoom();C(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),D.drawImage(O,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var A=u.extent(),M=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),B=a.hideEdgesOnViewport&&M,L=[];if(L[a.NODE]=!c[a.NODE]&&f&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,L[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),L[a.DRAG]=!c[a.DRAG]&&f&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,L[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||L[a.NODE]){var I=f&&!L[a.NODE]&&1!==h;C(D=t||(I?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:l.contexts[a.NODE]),f&&!I?"motionBlur":void 0),B?a.drawCachedNodes(D,S.nondrag,s,A):a.drawLayeredElements(D,S.nondrag,s,A),a.debug&&a.drawDebugPoints(D,S.nondrag),n||f||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||L[a.DRAG])){I=f&&!L[a.DRAG]&&1!==h;C(D=t||(I?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:l.contexts[a.DRAG]),f&&!I?"motionBlur":void 0),B?a.drawCachedNodes(D,S.drag,s,A):a.drawCachedElements(D,S.drag,s,A),a.debug&&a.drawDebugPoints(D,S.drag),n||f||(c[a.DRAG]=!1)}if(a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(C(D=t||l.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var R=m.core("selection-box-border-width").value/b;D.lineWidth=R,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),R>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(l.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=l.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var F=a.lastRedrawTime;if(a.showFps&&F){F=Math.round(F);var V=Math.round(1e3/F);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+F+" ms = "+V+" fps",0,20);D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(f&&1!==h){var G=l.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],q=l.contexts[a.DRAG],W=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):P(e,0,0,a.canvasWidth,a.canvasHeight);var r=h;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||L[a.NODE])&&(H(G,Y,L[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||L[a.DRAG])&&(H(q,W,L[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=E,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),f&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||u.emit("render")};for(var Vs={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var u=1;u<o.length/2;u++)e.lineTo(t+a*o[2*u],n+s*o[2*u+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,u=Ot(r,i);e.beginPath&&e.beginPath();for(var l=0;l<o.length/4;l++){var c,d=void 0;d=0===l?o.length-2:4*l-2,c=4*l+2;var f=t+a*o[4*l],h=n+s*o[4*l+1],p=-o[d]*o[c]-o[d+1]*o[c+1],v=u/Math.tan(Math.acos(p)/2),g=f-v*o[d],y=h-v*o[d+1],m=f+v*o[c],b=h+v*o[c+1];0===l?e.moveTo(g,y):e.lineTo(g,y),e.arcTo(f,h,m,b,u)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Dt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Dt(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,u=t+o,l=n-a,c=n+a,d=Tt(r,i),f=d.widthOffset,h=d.heightOffset,p=d.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(s,l+h),e.lineTo(s,c-h),e.quadraticCurveTo(s+p,c,s+f,c),e.lineTo(u-f,c),e.quadraticCurveTo(u-p,c,u,c-h),e.lineTo(u,l+h),e.quadraticCurveTo(u-p,l,u-f,l),e.lineTo(s+f,l),e.quadraticCurveTo(s+p,l,s,l+h),e.closePath()}},Gs=Math.sin(0),Ys=Math.cos(0),qs={},Ws={},Hs=Math.PI/40,Us=0*Math.PI;Us<2*Math.PI;Us+=Hs)qs[Us]=Math.sin(Us),Ws[Us]=Math.cos(Us);Vs.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,u=i/2,l=0*Math.PI;l<2*Math.PI;l+=Hs)o=t-s*qs[l]*Gs+s*Ws[l]*Ys,a=n+u*Ws[l]*Gs+u*qs[l]*Ys,0===l?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var Xs={};function Ks(e){var t=e.indexOf(",");return e.substr(t+1)}function Qs(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new qn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(Ks(r()),n);case"base64":return Ks(r());default:return r()}}Xs.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},Xs.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=E(e.maxWidth)||E(e.maxHeight),s=this.getPixelRatio(),u=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,u=e.scale;else if(a){var l=1/0,c=1/0;E(e.maxWidth)&&(l=u*e.maxWidth/i),E(e.maxHeight)&&(c=u*e.maxHeight/o),i*=u=Math.min(l,c),o*=u}a||(i*=s,o*=s,u*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var f=d.getContext("2d");if(i>0&&o>0){f.clearRect(0,0,i,o),f.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*u,-n.y1*u),f.scale(u,u),this.drawElements(f,h),f.scale(1/u,1/u),f.translate(n.x1*u,n.y1*u);else{var p=t.pan(),v={x:p.x*u,y:p.y*u};u*=t.zoom(),f.translate(v.x,v.y),f.scale(u,u),this.drawElements(f,h),f.scale(1/u,1/u),f.translate(-v.x,-v.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,i,o),f.fill())}return d},Xs.png=function(e){return Qs(e,this.bufferCanvasImage(e),"image/png")},Xs.jpg=function(e){return Qs(e,this.bufferCanvasImage(e),"image/jpeg")};var Zs={nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}},Js=eu,$s=eu.prototype;function eu(e){var t=this;t.data={canvases:new Array($s.CANVAS_LAYERS),contexts:new Array($s.CANVAS_LAYERS),canvasNeedsRedraw:new Array($s.CANVAS_LAYERS),bufferCanvases:new Array($s.BUFFER_COUNT),bufferContexts:new Array($s.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[n]=r;var a={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};h&&h.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<$s.CANVAS_LAYERS;s++){var u=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=u.getContext("2d"),Object.keys(a).forEach((function(e){u.style[e]=a[e]})),u.style.position="absolute",u.setAttribute("data-id","layer"+s),u.style.zIndex=String($s.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[$s.NODE].setAttribute("data-id","layer"+$s.NODE+"-node"),t.data.canvases[$s.SELECT_BOX].setAttribute("data-id","layer"+$s.SELECT_BOX+"-selectbox"),t.data.canvases[$s.DRAG].setAttribute("data-id","layer"+$s.DRAG+"-drag");for(s=0;s<$s.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var l=rt(),c=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){return e.boundingBox(),e[0]._private.bodyBounds},f=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||l},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||l},v=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||l},g=function(e,t){return t},y=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},m=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},b=t.data.eleTxrCache=new hs(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:d,getRotationPoint:function(e){return{x:((t=d(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return c(d(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),x=t.data.lblTxrCache=new hs(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:f,getRotationPoint:function(e){return y("",m(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=f(e),n=c(f(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:g}),w=t.data.slbTxrCache=new hs(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:p,getRotationPoint:function(e){return y("source",m(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return c(p(e))},isVisible:g}),_=t.data.tlbTxrCache=new hs(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:v,getRotationPoint:function(e){return y("target",m(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return c(v(e))},isVisible:g}),E=t.data.lyrTxrCache=new vs(t);t.onUpdateEleCalcs((function(e,t){b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),_.invalidateElements(t),E.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var k=function(e){for(var t=0;t<e.length;t++)E.enqueueElementRefinement(e[t].ele)};b.onDequeue(k),x.onDequeue(k),w.onDequeue(k),_.onDequeue(k)}$s.CANVAS_LAYERS=3,$s.SELECT_BOX=0,$s.DRAG=1,$s.NODE=2,$s.BUFFER_COUNT=3,$s.TEXTURE_BUFFER=0,$s.MOTIONBLUR_BUFFER_NODE=1,$s.MOTIONBLUR_BUFFER_DRAG=2,$s.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[$s.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[$s.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[$s.SELECT_BOX]=t}};var tu="undefined"!=typeof Path2D;$s.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},$s.usePaths=function(){return tu&&this.pathsEnabled},$s.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},$s.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},$s.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":a(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[xs,Ps,As,Bs,Ls,Rs,Fs,Vs,Xs,Zs].forEach((function(e){z($s,e)}));var nu=[{type:"layout",extensions:Ba},{type:"renderer",extensions:[{name:"null",impl:La},{name:"base",impl:as},{name:"canvas",impl:Js}]}],ru={},iu={};function ou(e,t,n){var r=n,i=function(n){ge("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(Ko.prototype[t])return i(t);Ko.prototype[t]=n}else if("collection"===e){if(fo.prototype[t])return i(t);fo.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),_(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],u=0;u<s.length;u++){var l=s[u];a[l]=a[l]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var c=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},f={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};z(a,{createEmitter:function(){return this._private.emitter=new Di(f,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),Qn.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var h=au("renderer","base"),p=h.prototype,v=n,g=n.prototype,y=function(){h.apply(this,arguments),v.apply(this,arguments)},m=y.prototype;for(var b in p){var x=p[b];if(null!=g[b])return i(b);m[b]=x}for(var w in g)m[w]=g[w];p.clientFunctions.forEach((function(e){m[e]=m[e]||function(){pe("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}return G({map:ru,keys:[e,t],value:r})}function au(e,t){return Y({map:ru,keys:[e,t]})}function su(e,t,n,r,i){return G({map:iu,keys:[e,t,n,r],value:i})}function uu(e,t,n,r){return Y({map:iu,keys:[e,t,n,r]})}var lu=function(){return 2===arguments.length?au.apply(null,arguments):3===arguments.length?ou.apply(null,arguments):4===arguments.length?uu.apply(null,arguments):5===arguments.length?su.apply(null,arguments):void pe("Invalid extension access syntax")};Ko.prototype.extension=lu,nu.forEach((function(e){e.extensions.forEach((function(t){ou(e.type,t.name,t.impl)}))}));var cu=function e(){if(!(this instanceof e))return new e;this.length=0},du=cu.prototype;du.instanceString=function(){return"stylesheet"},du.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},du.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(_(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var u=qo.properties[a]||qo.properties[M(a)];if(null!=u){var l=u.name,c=s;this[n].properties.push({name:l,value:c})}}}return this},du.style=du.css,du.generateStyle=function(e){var t=new qo(e);return this.appendToStyle(t)},du.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var o=0;o<i.length;o++){var a=i[o];e.css(a.name,a.value)}}return e};var fu=function(e){return void 0===e&&(e={}),_(e)?new Ko(e):b(e)?lu.apply(lu,arguments):void 0};fu.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(fu),e.apply(null,t),this},fu.warnings=function(e){return ve(e)},fu.version="3.20.0",fu.stylesheet=fu.Stylesheet=cu,e.exports=fu},"4e6e":(e,t,n)=>{e.exports={graphlib:n("vC4J"),layout:n("Pivv"),debug:n("zmx7"),util:{time:n("xxjf").time,notime:n("xxjf").notime},version:n("VQMV")}},"1yUy":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("fd5j");e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])}return r.forEach(e.nodes(),o),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},"0gKz":(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},u=o[t][a-1],l=i.addDummyNode(e,"border",s,n);o[t][a]=l,e.setParent(l,r),u&&e.setEdge(u,l,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},"+jFT":(e,t,n)=>{"use strict";var r=n("gjtd");function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e);"lr"!==t&&"rl"!==t||(!function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},"ge/d":e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},zmx7:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf"),o=n("vC4J").Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},vC4J:(e,t,n)=>{var r;try{r=n("YlUH")}catch(i){}r||(r=window.graphlib),e.exports=r},fd5j:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph,o=n("ge/d");e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var l=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){u(l,c,n.node(e))})),{graph:n,buckets:l,zeroIdx:c}}(e,t||a),l=function(e,t,n){var r,i=[],o=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(r=t[u].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(l,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,u(t,n,a)})),e.removeNode(i.v),a}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},Pivv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("1yUy"),o=n("RmLA"),a=n("4DVH"),s=n("xxjf").normalizeRanks,u=n("JUZX"),l=n("xxjf").removeEmptyRanks,c=n("wHMW"),d=n("0gKz"),f=n("+jFT"),h=n("erCh"),p=n("Nebv"),v=n("xxjf"),g=n("vC4J").Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=P(e.graph());return t.setGraph(r.merge({},m,S(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=P(e.node(n));t.setNode(n,r.defaults(S(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=P(e.edge(n));t.setEdge(n,r.merge({},E,S(i,_),r.pick(i,k)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){l(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){u(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){h(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){f.adjust(e)})),t(" position",(function(){p(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(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}}))}(e)})),t(" undoCoordinateSystem",(function(){f.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,u=a.marginy||0;function l(e){var r=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(e.nodes(),(function(t){l(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&l(n)})),t-=s,i-=u,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+u}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function S(e,t){return r.mapValues(r.pick(e,t),Number)}function P(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},gjtd:(e,t,n)=>{var r;try{r={cloneDeep:n("c2re"),constant:n("eN33"),defaults:n("WHWN"),each:n("h4um"),filter:n("+DnP"),find:n("6R5o"),flatten:n("1xil"),forEach:n("9SCj"),forIn:n("ZVKf"),has:n("1mr4"),isUndefined:n("CZlo"),last:n("p1C/"),map:n("mbB6"),mapValues:n("y2Ah"),max:n("LPC+"),merge:n("H8sf"),min:n("Z3AG"),minBy:n("PKEM"),now:n("ENE1"),pick:n("//nZ"),range:n("Cmkl"),reduce:n("veKZ"),sortBy:n("u6DZ"),uniqueId:n("w0mW"),values:n("0iyY"),zipObject:n("OUo6")}}catch(i){}r||(r=window._),e.exports=r},wHMW:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n,a,s,u,l){var c=e.children(l);if(c.length){var d=i.addBorderNode(e,"_bt"),f=i.addBorderNode(e,"_bb"),h=e.node(l);e.setParent(d,l),h.borderTop=d,e.setParent(f,l),h.borderBottom=f,r.forEach(c,(function(r){o(e,t,n,a,s,u,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,h=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=c!==h?1:s-u[l]+1;e.setEdge(d,c,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(h,f,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(l)||e.setEdge(t,d,{weight:0,minlen:s+u[l]})}else l!==t&&e.setEdge(t,l,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var u=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,u,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},RmLA:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf");e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,u=t.w,l=e.node(u).rank,c=t.name,d=e.edge(t),f=d.labelRank;if(l===s+1)return;for(e.removeEdge(t),o=0,++s;s<l;++o,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=i.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,u,{weight:d.weight},c)}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),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),t=n,r=e.node(t)}))}}},DzXQ:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},gP9q:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},D5rW:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph;e.exports=function(e,t,n){var o=function(e){var t;for(;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),u=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},YZb2:(e,t,n)=>{"use strict";var r=n("gjtd");function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),l=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;u[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=u[t+1]),u[t=t-1>>1]+=e.weight;l+=e.weight*n}))),l}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},erCh:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("NI55"),o=n("YZb2"),a=n("Qsja"),s=n("D5rW"),u=n("DzXQ"),l=n("vC4J").Graph,c=n("xxjf");function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function f(e,t){var n=new l;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),u(e,n,o.vs)}))}function h(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);h(e,s);for(var u,l=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){f(p%2?n:a,p%4>=2),s=c.buildLayerMatrix(e);var g=o(e,s);g<l&&(v=0,u=r.cloneDeep(s),l=g)}h(e,u)}},NI55:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(r.has(t,i))return;t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)})),o}},Hp3j:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},Qsja:(e,t,n)=>{var r=n("gjtd"),i=n("gP9q"),o=n("Hp3j"),a=n("zBPj");e.exports=function e(t,n,s,u){var l=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,f=c?c.borderRight:void 0,h={};d&&(l=r.filter(l,(function(e){return e!==d&&e!==f})));var p=i(t,l);r.forEach(p,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,u);h[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(p,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,h);var g=a(v,u);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g}},zBPj:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n=i.partition(e,(function(e){return r.has(e,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(e){return-e.i})),u=[],l=0,c=0,d=0;a.sort((f=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:f?t.i-e.i:e.i-t.i})),d=o(u,s,d),r.forEach(a,(function(e){d+=e.vs.length,u.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,d=o(u,s,d)}));var f;var h={vs:r.flatten(u,!0)};c&&(h.barycenter=l/c,h.weight=c);return h}},JUZX:(e,t,n)=>{var r=n("gjtd");e.exports=function(e){var t=function(e){var t={},n=0;function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}}return r.forEach(e.children(),i),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],u=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>u||l>t[i].lim));o=i,i=r;for(;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(l=a[u])!==s&&e.node(l).maxRank<r.rank;)u++;l===s&&(c=!1)}if(!c){for(;u<a.length-1&&e.node(l=a[u+1]).minRank<=r.rank;)u++;l=a[u]}e.setParent(n,l),n=e.successors(n)[0]}}))}},xaOS:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("xxjf");function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,l=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),f=d?e.node(d).order:s;(d||t===l)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||f<a)||i.dummy&&e.node(t).dummy||u(n,r,t)}))})),a=c+1,o=f)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var l;r.forEach(r.range(i,o),(function(i){l=t[i],e.node(l).dummy&&r.forEach(e.predecessors(l),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&u(n,t,l)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===e.node(r).dummy){var l=e.predecessors(r);l.length&&(o=e.node(l[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function u(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function l(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var u=i(e);if(u.length){u=r.sortBy(u,(function(e){return s[e]}));for(var c=(u.length-1)/2,d=Math.floor(c),f=Math.ceil(c);d<=f;++d){var h=u[d];a[e]===e&&t<s[h]&&!l(n,e,h)&&(a[h]=e,a[e]=o[e]=o[h],t=s[h])}}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},u=function(e,t,n,o){var a=new i,s=e.graph(),u=function(e,t,n){return function(i,o,a){var s,u=i.node(o),l=i.node(a),c=0;if(c+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(c+=n?s:-s),s=0,c+=(u.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=l.width/2;break;case"r":s=-l.width/2}return s&&(c+=n?s:-s),s=0,c}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),l=a?"borderLeft":"borderRight";function c(e,t){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return c((function(e){s[e]=u.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),c((function(t){var n=u.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==l&&(s[t]=Math.max(s[t],n))}),u.successors.bind(u)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function f(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function h(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,l=e[u];if(l!==t){var c=r.values(l);(s="l"===a?i-r.min(c):o-r.max(c))&&(e[u]=r.mapValues(l,(function(e){return e+s})))}}))}))}function p(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),u={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=c(e,t,i,a),l=d(e,t,s.root,s.align,"r"===n);"r"===n&&(l=r.mapValues(l,(function(e){return-e}))),u[o+n]=l}))}));var l=f(e,u);return h(u,l),p(u,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p}},Nebv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf"),o=n("xaOS").positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},"58Ui":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("K8/D").slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function u(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),l=e.nodes()[0],c=e.nodeCount();r.setNode(l,{});for(;a(r,e)<c;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),u(r,e,n);return r}},"4DVH":(e,t,n)=>{"use strict";var r=n("K8/D").longestPath,i=n("58Ui"),o=n("EMSI");e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){o(e)}},EMSI:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("58Ui"),o=n("K8/D").slack,a=n("K8/D").longestPath,s=n("vC4J").alg.preorder,u=n("vC4J").alg.postorder,l=n("xxjf").simplify;function c(e){e=l(e),a(e);var t,n=i(e);for(h(n),d(n,e);t=v(n);)y(n,e,t,g(n,e,t))}function d(e,t){var n=u(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)}))}function f(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,u,l=r.v===n,c=l?r.w:r.v;if(c!==i){var d=l===o,f=t.edge(r).weight;if(s+=d?f:-f,a=n,u=c,e.hasEdge(a,u)){var h=e.edge(n,c).cutvalue;s+=d?-h:h}}})),s}function h(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=p(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),u=e.node(a),l=s,c=!1;s.lim>u.lim&&(l=u,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(e,e.node(t.v),l)&&c!==m(e,e.node(t.w),l)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),h(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=h,c.initCutValues=d,c.calcCutValue=f,c.leaveEdge=v,c.enterEdge=g,c.exchangeEdges=y},"K8/D":(e,t,n)=>{"use strict";var r=n("gjtd");e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},xxjf:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,u=e.width/2,l=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},VQMV:e=>{e.exports="0.8.5"},QzV0:e=>{e.exports=a,a.default=a,a.stable=c,a.stableStringify=c;var t="[...]",n="[Circular]",r=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=o()),u(e,"",0,[],void 0,0,a);try{s=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function s(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);void 0!==a.get?a.configurable?(Object.defineProperty(o,n,{value:e}),r.push([o,n,t,a])):i.push([t,n,e]):(o[n]=e,r.push([o,n,t]))}function u(e,r,i,o,a,l,c){var d;if(l+=1,"object"==typeof e&&null!==e){for(d=0;d<o.length;d++)if(o[d]===e)return void s(n,e,r,a);if(void 0!==c.depthLimit&&l>c.depthLimit)return void s(t,e,r,a);if(void 0!==c.edgesLimit&&i+1>c.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(d=0;d<e.length;d++)u(e[d],d,d,o,e,l,c);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var h=f[d];u(e[h],h,d,o,e,l,c)}}o.pop()}}function l(e,t){return e<t?-1:e>t?1:0}function c(e,t,n,a){void 0===a&&(a=o());var s,u=d(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(u,t,n):JSON.stringify(u,f(t),n)}catch(c){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function d(e,i,o,a,u,c,f){var h;if(c+=1,"object"==typeof e&&null!==e){for(h=0;h<a.length;h++)if(a[h]===e)return void s(n,e,i,u);try{if("function"==typeof e.toJSON)return}catch(y){return}if(void 0!==f.depthLimit&&c>f.depthLimit)return void s(t,e,i,u);if(void 0!==f.edgesLimit&&o+1>f.edgesLimit)return void s(t,e,i,u);if(a.push(e),Array.isArray(e))for(h=0;h<e.length;h++)d(e[h],h,h,a,e,c,f);else{var p={},v=Object.keys(e).sort(l);for(h=0;h<v.length;h++){var g=v[h];d(e[g],g,h,a,e,c,f),p[g]=e[g]}if(void 0===u)return p;r.push([u,i,e]),u[i]=p}a.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var o=i[r];if(o[1]===t&&o[0]===n){n=o[2],i.splice(r,1);break}}return e.call(this,t,n)}}},YlUH:(e,t,n)=>{var r=n("1qSF");e.exports={Graph:r.Graph,json:n("M2c1"),alg:n("ZCKZ"),version:r.version}},qC43:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},"5Ck4":(e,t,n)=>{var r=n("Jl0P");function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},a271:(e,t,n)=>{var r=n("V9bN"),i=n("Jl0P");e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},V9bN:(e,t,n)=>{var r=n("Jl0P"),i=n("c9kG");e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},u=new i,l=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),l=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);l<r.distance&&(r.distance=l,r.predecessor=o,u.decrease(t,l))};e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},u.add(e,n)}));for(;u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(l);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},W8B9:(e,t,n)=>{var r=n("Jl0P"),i=n("Pa7R");e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},hq5n:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},ZCKZ:(e,t,n)=>{e.exports={components:n("qC43"),dijkstra:n("V9bN"),dijkstraAll:n("a271"),findCycles:n("W8B9"),floydWarshall:n("hq5n"),isAcyclic:n("+WAL"),postorder:n("21zJ"),preorder:n("j+bJ"),prim:n("xGdc"),tarjan:n("Pa7R"),topsort:n("0Jj1")}},"+WAL":(e,t,n)=>{var r=n("0Jj1");e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},"21zJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"post")}},"j+bJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"pre")}},xGdc:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw"),o=n("c9kG");e.exports=function(e,t){var n,a=new i,s={},u=new o;function l(e){var r=e.v===n?e.w:e.v,i=u.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);var c=!1;for(;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(l)}return a}},Pa7R:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var u=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(u.lowlink=Math.min(u.lowlink,i[e].index)):(a(e),u.lowlink=Math.min(u.lowlink,i[e].lowlink))})),u.lowlink===u.index){var l,c=[];do{l=n.pop(),i[l].onStack=!1,c.push(l)}while(s!==l);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},"0Jj1":(e,t,n)=>{var r=n("Jl0P");function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},c9kG:(e,t,n)=>{var r=n("Jl0P");function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},buMw:(e,t,n)=>{"use strict";var r=n("Jl0P");e.exports=o;var i="\0";function o(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function u(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(r.isUndefined(i)?"\0":i)}function l(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function c(e,t){return u(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},o.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},o.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},o.prototype.setEdge=function(){var e,t,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=u(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?i:this._defaultEdgeLabelFn(e,t,n);var d=l(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[c]=d,a(this._preds[t],e),a(this._sucs[e],t),this._in[t][c]=d,this._out[e][c]=d,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):u(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},o.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},o.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},"1qSF":(e,t,n)=>{e.exports={Graph:n("buMw"),version:n("5AdH")}},M2c1:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw");function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};r.isUndefined(e.graph())||(t.value=r.clone(e.graph()));return t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},Jl0P:(e,t,n)=>{var r;try{r={clone:n("zr3P"),constant:n("eN33"),each:n("h4um"),filter:n("+DnP"),has:n("1mr4"),isArray:n("wxYD"),isEmpty:n("MwrP"),isFunction:n("2q8g"),isUndefined:n("CZlo"),keys:n("BlJA"),map:n("mbB6"),reduce:n("veKZ"),size:n("7seP"),transform:n("cZX/"),union:n("aGtI"),values:n("0iyY")}}catch(i){}r||(r=window._),e.exports=r},"5AdH":e=>{e.exports="2.1.8"},"3Ssf":(e,t,n)=>{e.exports=n("pvAv")},pvAv:function(e,t){var n,r,i;(function(){var o,a,s,u,l,c,d,f,h,p,v,g,y,m,b;s=Math.floor,p=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},h=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},c=function(e,t,n){return null==n&&(n=a),e.push(t),m(e,0,e.length-1,n)},l=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},f=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},u=function(e,t){var n,r,i,o,u,l;for(null==t&&(t=a),o=(function(){l=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}).apply(this).reverse(),u=[],r=0,i=o.length;r<i;r++)n=o[r],u.push(b(e,n,t));return u},y=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s,l;if(null==n&&(n=a),!(i=e.slice(0,t)).length)return i;for(u(i,n),o=0,s=(l=e.slice(t)).length;o<s;o++)r=l[o],d(i,r,n);return i.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,c,d,f,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(f=e.slice(t)).length;s<d;s++)n(r=f[s],i)<0&&(h(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(u(e,n),g=[],c=0,v=p(t,e.length);0<=v?c<v:c>v;0<=v?++c:--c)g.push(l(e,n));return g},m=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,u;for(null==n&&(n=a),i=e.length,u=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,m(e,u,t,n)},o=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=c,e.pop=l,e.replace=f,e.pushpop=d,e.heapify=u,e.updateItem=y,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pop=function(){return l(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return f(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return u(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(i="function"==typeof(n=function(){return o})?n.apply(t,r):n)||(e.exports=i)}).call(this)},"9EWH":(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function i(e){return!!e&&!!e[$]}function o(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===te}(e)||Array.isArray(e)||!!e[J]||!!e.constructor[J]||h(e)||p(e))}function a(e){return i(e)||r(23,e),e[$].t}function s(e,t,n){void 0===n&&(n=!1),0===u(e)?(n?Object.keys:ne)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function u(e){var t=e[$];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:h(e)?2:p(e)?3:0}function l(e,t){return 2===u(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===u(e)?e.get(t):e[t]}function d(e,t,n){var r=u(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e){return X&&e instanceof Map}function p(e){return K&&e instanceof Set}function v(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=re(e);delete t[$];for(var n=ne(t),r=0;r<n.length;r++){var i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function y(e,t){return void 0===t&&(t=!1),b(e)||i(e)||!o(e)||(u(e)>1&&(e.set=e.add=e.clear=e.delete=m),Object.freeze(e),t&&s(e,(function(e,t){return y(t,!0)}),!0)),e}function m(){r(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function x(e){var t=ie[e];return t||r(18,e),t}function w(e,t){ie[e]||(ie[e]=t)}function _(){return H}function E(e,t){t&&(x("Patches"),e.u=[],e.s=[],e.v=t)}function k(e){S(e),e.p.forEach(C),e.p=null}function S(e){e===H&&(H=e.l)}function P(e){return H={p:[],l:H,h:e,m:!0,_:0}}function C(e){var t=e[$];0===t.i||1===t.i?t.j():t.O=!0}function j(e,t){t._=t.p.length;var n=t.p[0],i=void 0!==e&&e!==n;return t.h.g||x("ES5").S(t,e,i),i?(n[$].P&&(k(t),r(4)),o(e)&&(e=D(t,e),t.l||T(t,e)),t.u&&x("Patches").M(n[$],e,t.u,t.s)):e=D(t,n,[]),k(t),t.u&&t.v(t.u,t.s),e!==Z?e:void 0}function D(e,t,n){if(b(t))return t;var r=t[$];if(!r)return s(t,(function(i,o){return O(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return T(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=g(r.k):r.o;s(3===r.i?new Set(i):i,(function(t,o){return O(e,r,i,t,o,n)})),T(e,i,!1),n&&e.u&&x("Patches").R(r,n,e.u,e.s)}return r.o}function O(e,t,n,r,a,s){if(i(a)){var u=D(e,a,s&&t&&3!==t.i&&!l(t.D,r)?s.concat(r):void 0);if(d(n,r,u),!i(u))return;e.m=!1}if(o(a)&&!b(a)){if(!e.h.F&&e._<1)return;D(e,a),t&&t.A.l||T(e,a)}}function T(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&y(t,n)}function N(e,t){var n=e[$];return(n?v(n):e)[t]}function A(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function M(e){e.P||(e.P=!0,e.l&&M(e.l))}function B(e){e.o||(e.o=g(e.t))}function L(e,t,n){var r=h(t)?x("MapSet").N(t,n):p(t)?x("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=oe;n&&(i=[r],o=ae);var a=Proxy.revocable(i,o),s=a.revoke,u=a.proxy;return r.k=u,r.j=s,u}(t,n):x("ES5").J(t,n);return(n?n.A:_()).p.push(r),r}function I(e){return i(e)||r(22,e),function e(t){if(!o(t))return t;var n,r=t[$],i=u(t);if(r){if(!r.P&&(r.i<4||!x("ES5").K(r)))return r.t;r.I=!0,n=R(t,i),r.I=!1}else n=R(t,i);return s(n,(function(t,i){r&&c(r.t,t)===i||d(n,t,e(i))})),3===i?new Set(n):n}(e)}function R(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}function z(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[$];return oe.get(t,e)},set:function(t){var n=this[$];oe.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][$];if(!i.P)switch(i.i){case 5:r(i)&&M(i);break;case 4:n(i)&&M(i)}}}function n(e){for(var t=e.t,n=e.k,r=ne(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==$){var a=t[o];if(void 0===a&&!l(t,o))return!0;var s=n[o],u=s&&s[$];if(u?u.t!==a:!f(s,a))return!0}}var c=!!t[$];return r.length!==ne(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}var o={};w("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var o=re(n);delete o[$];for(var a=ne(o),s=0;s<a.length;s++){var u=a[s];o[u]=e(u,t||!!o[u].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(r,t),o={i:r?5:4,A:n?n.A:_(),P:!1,I:!1,D:{},l:n,t,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,$,{value:o,writable:!0}),i},S:function(e,n,o){o?i(n)&&n[$].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[$];if(n){var i=n.t,o=n.k,a=n.D,u=n.i;if(4===u)s(o,(function(t){t!==$&&(void 0!==i[t]||l(i,t)?a[t]||e(o[t]):(a[t]=!0,M(n)))})),s(i,(function(e){void 0!==o[e]||l(o,e)||(a[e]=!1,M(n))}));else if(5===u){if(r(n)&&(M(n),a.length=!0),o.length<i.length)for(var c=o.length;c<i.length;c++)a[c]=!1;else for(var d=i.length;d<o.length;d++)a[d]=!0;for(var f=Math.min(o.length,i.length),h=0;h<f;h++)void 0===a[h]&&e(o[h])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}function F(){function e(t){if(!o(t))return t;if(Array.isArray(t))return t.map(e);if(h(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(p(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return l(t,J)&&(n[J]=t[J]),n}function t(t){return i(t)?e(t):t}var n="add";w("Patches",{$:function(t,i){return i.forEach((function(i){for(var o=i.path,a=i.op,s=t,l=0;l<o.length-1;l++){var d=u(s),f=""+o[l];0!==d&&1!==d||"__proto__"!==f&&"constructor"!==f||r(24),"function"==typeof s&&"prototype"===f&&r(24),"object"!=typeof(s=c(s,f))&&r(15,o.join("/"))}var h=u(s),p=e(i.value),v=o[o.length-1];switch(a){case"replace":switch(h){case 2:return s.set(v,p);case 3:r(16);default:return s[v]=p}case n:switch(h){case 1:return s.splice(v,0,p);case 2:return s.set(v,p);case 3:return s.add(p);default:return s[v]=p}case"remove":switch(h){case 1:return s.splice(v,1);case 2:return s.delete(v);case 3:return s.delete(i.value);default:return delete s[v]}default:r(17,a)}})),t},R:function(e,r,i,o){switch(e.i){case 0:case 4:case 2:return function(e,r,i,o){var a=e.t,u=e.o;s(e.D,(function(e,s){var d=c(a,e),f=c(u,e),h=s?l(a,e)?"replace":n:"remove";if(d!==f||"replace"!==h){var p=r.concat(e);i.push("remove"===h?{op:h,path:p}:{op:h,path:p,value:f}),o.push(h===n?{op:"remove",path:p}:"remove"===h?{op:n,path:p,value:t(d)}:{op:"replace",path:p,value:t(d)})}}))}(e,r,i,o);case 5:case 1:return function(e,r,i,o){var a=e.t,s=e.D,u=e.o;if(u.length<a.length){var l=[u,a];a=l[0],u=l[1];var c=[o,i];i=c[0],o=c[1]}for(var d=0;d<a.length;d++)if(s[d]&&u[d]!==a[d]){var f=r.concat([d]);i.push({op:"replace",path:f,value:t(u[d])}),o.push({op:"replace",path:f,value:t(a[d])})}for(var h=a.length;h<u.length;h++){var p=r.concat([h]);i.push({op:n,path:p,value:t(u[h])})}a.length<u.length&&o.push({op:"replace",path:r.concat(["length"]),value:a.length})}(e,r,i,o);case 3:return function(e,t,r,i){var o=e.t,a=e.o,s=0;o.forEach((function(e){if(!a.has(e)){var o=t.concat([s]);r.push({op:"remove",path:o,value:e}),i.unshift({op:n,path:o,value:e})}s++})),s=0,a.forEach((function(e){if(!o.has(e)){var a=t.concat([s]);r.push({op:n,path:a,value:e}),i.unshift({op:"remove",path:a,value:e})}s++}))}(e,r,i,o)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===Z?void 0:t}),r.push({op:"replace",path:[],value:e.t})}})}function V(){function e(e,t){function n(){this.constructor=e}a(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(o(t)){var n=L(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function i(e){e.O&&r(3,JSON.stringify(v(e)))}var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},u=function(){function n(e,t){return this[$]={i:2,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return v(this[$]).size}}),r.has=function(e){return v(this[$]).has(e)},r.set=function(e,n){var r=this[$];return i(r),v(r).has(e)&&v(r).get(e)===n||(t(r),M(r),r.D.set(e,!0),r.o.set(e,n),r.D.set(e,!0)),this},r.delete=function(e){if(!this.has(e))return!1;var n=this[$];return i(n),t(n),M(n),n.D.set(e,!1),n.o.delete(e),!0},r.clear=function(){var e=this[$];i(e),v(e).size&&(t(e),M(e),e.D=new Map,s(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},r.forEach=function(e,t){var n=this;v(this[$]).forEach((function(r,i){e.call(t,n.get(i),i,n)}))},r.get=function(e){var n=this[$];i(n);var r=v(n).get(e);if(n.I||!o(r))return r;if(r!==n.t.get(e))return r;var a=L(n.A.h,r,n);return t(n),n.o.set(e,a),a},r.keys=function(){return v(this[$]).keys()},r.values=function(){var e,t=this,n=this.keys();return(e={})[ee]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},r.entries=function(){var e,t=this,n=this.keys();return(e={})[ee]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},r[ee]=function(){return this.entries()},n}(),l=function(){function t(e,t){return this[$]={i:3,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var r=t.prototype;return Object.defineProperty(r,"size",{get:function(){return v(this[$]).size}}),r.has=function(e){var t=this[$];return i(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},r.add=function(e){var t=this[$];return i(t),this.has(e)||(n(t),M(t),t.o.add(e)),this},r.delete=function(e){if(!this.has(e))return!1;var t=this[$];return i(t),n(t),M(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},r.clear=function(){var e=this[$];i(e),v(e).size&&(n(e),M(e),e.o.clear())},r.values=function(){var e=this[$];return i(e),n(e),e.o.values()},r.entries=function(){var e=this[$];return i(e),n(e),e.o.entries()},r.keys=function(){return this.values()},r[ee]=function(){return this.values()},r.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();w("MapSet",{N:function(e,t){return new u(e,t)},T:function(e,t){return new l(e,t)}})}function G(){z(),V(),F()}function Y(e){return e}function q(e){return e}n.r(t),n.d(t,{default:()=>ge,Immer:()=>se,applyPatches:()=>he,castDraft:()=>Y,castImmutable:()=>q,createDraft:()=>pe,current:()=>I,enableAllPlugins:()=>G,enableES5:()=>z,enableMapSet:()=>V,enablePatches:()=>F,finishDraft:()=>ve,freeze:()=>y,immerable:()=>J,isDraft:()=>i,isDraftable:()=>o,nothing:()=>Z,original:()=>a,produce:()=>le,produceWithPatches:()=>ce,setAutoFreeze:()=>de,setUseProxies:()=>fe});var W,H,U="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,K="undefined"!=typeof Set,Q="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Z=U?Symbol.for("immer-nothing"):((W={})["immer-nothing"]=!0,W),J=U?Symbol.for("immer-draftable"):"__$immer_draftable",$=U?Symbol.for("immer-state"):"__$immer_state",ee="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",te=""+Object.prototype.constructor,ne="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,re=Object.getOwnPropertyDescriptors||function(e){var t={};return ne(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ie={},oe={get:function(e,t){if(t===$)return e;var n=v(e);if(!l(n,t))return function(e,t,n){var r,i=A(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!o(r)?r:r===N(e.t,t)?(B(e),e.o[t]=L(e.A.h,r,e)):r},has:function(e,t){return t in v(e)},ownKeys:function(e){return Reflect.ownKeys(v(e))},set:function(e,t,n){var r=A(v(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=N(v(e),t),o=null==i?void 0:i[$];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(f(n,i)&&(void 0!==n||l(e.t,t)))return!0;B(e),M(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==N(e.t,t)||t in e.t?(e.D[t]=!1,B(e),M(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=v(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){r(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){r(12)}},ae={};s(oe,(function(e,t){ae[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ae.deleteProperty=function(e,t){return oe.deleteProperty.call(this,e[0],t)},ae.set=function(e,t,n){return oe.set.call(this,e[0],t,n,e[0])};var se=function(){function e(e){var t=this;this.g=Q,this.F=!0,this.produce=function(e,n,i){if("function"==typeof e&&"function"!=typeof n){var a=n;n=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return s.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var u;if("function"!=typeof n&&r(6),void 0!==i&&"function"!=typeof i&&r(7),o(e)){var l=P(t),c=L(t,e,void 0),d=!0;try{u=n(c),d=!1}finally{d?k(l):S(l)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then((function(e){return E(l,i),j(e,l)}),(function(e){throw k(l),e})):(E(l,i),j(u,l))}if(!e||"object"!=typeof e){if((u=n(e))===Z)return;return void 0===u&&(u=e),t.F&&y(u,!0),u}r(21,e)},this.produceWithPatches=function(e,n){return"function"==typeof e?function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))}:[t.produce(e,n,(function(e,t){r=e,i=t})),r,i];var r,i},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){o(e)||r(8),i(e)&&(e=I(e));var t=P(this),n=L(this,e,void 0);return n[$].C=!0,S(t),n},t.finishDraft=function(e,t){var n=(e&&e[$]).A;return E(n,t),j(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Q&&r(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=x("Patches").$;return i(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(n+1))}))},e}(),ue=new se,le=ue.produce,ce=ue.produceWithPatches.bind(ue),de=ue.setAutoFreeze.bind(ue),fe=ue.setUseProxies.bind(ue),he=ue.applyPatches.bind(ue),pe=ue.createDraft.bind(ue),ve=ue.finishDraft.bind(ue);const ge=le},"E/ZA":e=>{var t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return u.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(h(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=h(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||i.test(e)?o(e.slice(2),s?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,u,l=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function b(e){return l=e,s=setTimeout(w,t),v?m(e):a}function x(e){var n=e-u;return void 0===u||n>=t||n<0||g&&e-l>=o}function w(){var e=f();if(x(e))return _(e);s=setTimeout(w,function(e){var n=t-(e-u);return g?d(n,o-(e-l)):n}(e))}function _(e){return s=void 0,y&&r?m(e):(r=i=void 0,a)}function E(){var e=f(),n=x(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return b(u);if(g)return s=setTimeout(w,t),m(u)}return void 0===s&&(s=setTimeout(w,t)),a}return t=p(t)||0,h(n)&&(v=!!n.leading,o=(g="maxWait"in n)?c(p(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},E.flush=function(){return void 0===s?a:_(f())},E}},QF3D:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"DataView");e.exports=r},Tv3l:(e,t,n)=>{var r=n("2Fbm"),i=n("VPai"),o=n("+fUG"),a=n("QMz8"),s=n("mUsV");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},"+ooz":(e,t,n)=>{var r=n("8Zrg"),i=n("kwr2"),o=n("5VYK"),a=n("Coc+"),s=n("LzM7");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},qeCs:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Map");e.exports=r},hyzI:(e,t,n)=>{var r=n("m5o6"),i=n("d0UJ"),o=n("eask"),a=n("9SKQ"),s=n("e63W");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},IS0S:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Promise");e.exports=r},OBn4:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Set");e.exports=r},"JBn+":(e,t,n)=>{var r=n("hyzI"),i=n("qjF7"),o=n("cEmw");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},HsnV:(e,t,n)=>{var r=n("+ooz"),i=n("RNlM"),o=n("E4ao"),a=n("BSqe"),s=n("L6um"),u=n("4/ik");function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},Syyo:(e,t,n)=>{var r=n("IBsm").Symbol;e.exports=r},mGzy:(e,t,n)=>{var r=n("IBsm").Uint8Array;e.exports=r},"4+Vk":(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"WeakMap");e.exports=r},zaNA:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},LmOH:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},W0vE:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},OfKG:(e,t,n)=>{var r=n("c7Qd");e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},"sCL+":e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},rmhs:(e,t,n)=>{var r=n("2ZvR"),i=n("bvyN"),o=n("wxYD"),a=n("3ajY"),s=n("pnw1"),u=n("Qd2C"),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),f=!n&&!c&&!d&&u(e),h=n||c||d||f,p=h?r(e.length,String):[],v=p.length;for(var g in e)!t&&!l.call(e,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},H87J:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},"y/9h":e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},cPMt:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},myUI:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},"2wsP":(e,t,n)=>{var r=n("EI7Z")("length");e.exports=r},amiU:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx");e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},c72w:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx"),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},"6QIk":(e,t,n)=>{var r=n("pPzx");e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},tPQG:(e,t,n)=>{var r=n("LtXa"),i=n("BlJA");e.exports=function(e,t){return e&&r(t,i(t),e)}},QrYh:(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e,t){return e&&r(t,i(t),e)}},wC3K:(e,t,n)=>{var r=n("Pz+s");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},kn3Q:(e,t,n)=>{var r=n("HsnV"),i=n("LmOH"),o=n("c72w"),a=n("tPQG"),s=n("QrYh"),u=n("Grae"),l=n("QT01"),c=n("AjPR"),d=n("BjSP"),f=n("tlBq"),h=n("zF5n"),p=n("kkM+"),v=n("3Qlq"),g=n("7No3"),y=n("sD1O"),m=n("wxYD"),b=n("3ajY"),x=n("NbvU"),w=n("tQYX"),_=n("/iLo"),E=n("BlJA"),k=n("zH+d"),S="[object Arguments]",P="[object Function]",C="[object Object]",j={};j[S]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[C]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[P]=j["[object WeakMap]"]=!1,e.exports=function e(t,n,D,O,T,N){var A,M=1&n,B=2&n,L=4&n;if(D&&(A=T?D(t,O,T,N):D(t)),void 0!==A)return A;if(!w(t))return t;var I=m(t);if(I){if(A=v(t),!M)return l(t,A)}else{var R=p(t),z=R==P||"[object GeneratorFunction]"==R;if(b(t))return u(t,M);if(R==C||R==S||z&&!T){if(A=B||z?{}:y(t),!M)return B?d(t,s(A,t)):c(t,a(A,t))}else{if(!j[R])return T?t:{};A=g(t,R,M)}}N||(N=new r);var F=N.get(t);if(F)return F;N.set(t,A),_(t)?t.forEach((function(r){A.add(e(r,n,D,r,t,N))})):x(t)&&t.forEach((function(r,i){A.set(i,e(r,n,D,i,t,N))}));var V=I?void 0:(L?B?h:f:B?k:E)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(A,i,e(r,n,D,i,t,N))})),A}},vGGS:(e,t,n)=>{var r=n("tQYX"),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},Q4oW:(e,t,n)=>{var r=n("zKkv"),i=n("bz5b")(r);e.exports=i},JElN:(e,t,n)=>{var r=n("a88S");e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,l=a}return l}},sjzV:(e,t,n)=>{var r=n("Q4oW");e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},DuXo:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},YpBQ:(e,t,n)=>{var r=n("y/9h"),i=n("oCTG");e.exports=function e(t,n,o,a,s){var u=-1,l=t.length;for(o||(o=i),s||(s=[]);++u<l;){var c=t[u];n>0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},UdtX:(e,t,n)=>{var r=n("RFxK")();e.exports=r},zKkv:(e,t,n)=>{var r=n("UdtX"),i=n("BlJA");e.exports=function(e,t){return e&&r(e,t,i)}},w2Tz:(e,t,n)=>{var r=n("xoyU"),i=n("Ypsa");e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},pIod:(e,t,n)=>{var r=n("y/9h"),i=n("wxYD");e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},Dhk8:(e,t,n)=>{var r=n("Syyo"),i=n("KCLV"),o=n("kHoZ"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},FaiA:e=>{e.exports=function(e,t){return e>t}},SJov:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},JYmt:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},c7Qd:(e,t,n)=>{var r=n("DuXo"),i=n("z9Jh"),o=n("n1QJ");e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},"/30y":(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},NYSw:(e,t,n)=>{var r=n("BqUW"),i=n("tLQN");e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},BqUW:(e,t,n)=>{var r=n("HsnV"),i=n("ZZ+W"),o=n("R3gn"),a=n("yZHP"),s=n("kkM+"),u=n("wxYD"),l=n("3ajY"),c=n("Qd2C"),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var m=u(e),b=u(t),x=m?f:s(e),w=b?f:s(t),_=(x=x==d?h:x)==h,E=(w=w==d?h:w)==h,k=x==w;if(k&&l(e)){if(!l(t))return!1;m=!0,_=!1}if(k&&!_)return y||(y=new r),m||c(e)?i(e,t,n,v,g,y):o(e,t,x,n,v,g,y);if(!(1&n)){var S=_&&p.call(e,"__wrapped__"),P=E&&p.call(t,"__wrapped__");if(S||P){var C=S?e.value():e,j=P?t.value():t;return y||(y=new r),g(C,j,n,v,y)}}return!!k&&(y||(y=new r),a(e,t,n,v,g,y))}},gEWz:(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},ZjRn:(e,t,n)=>{var r=n("HsnV"),i=n("NYSw");e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var l=n[a];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){var c=(l=n[a])[0],d=e[c],f=l[1];if(u&&l[2]){if(void 0===d&&!(c in e))return!1}else{var h=new r;if(o)var p=o(d,f,c,e,t,h);if(!(void 0===p?i(f,d,3,o,h):p))return!1}}return!0}},z9Jh:e=>{e.exports=function(e){return e!=e}},"5nKN":(e,t,n)=>{var r=n("2q8g"),i=n("9vbJ"),o=n("tQYX"),a=n("c18h"),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:s).test(a(e))}},"6I2w":(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},"7/jS":(e,t,n)=>{var r=n("Dhk8"),i=n("t0L4"),o=n("tLQN"),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},S3pA:(e,t,n)=>{var r=n("7/we"),i=n("KAo/"),o=n("zWgn"),a=n("wxYD"),s=n("1EDM");e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},"4uJK":(e,t,n)=>{var r=n("CbIe"),i=n("OtNC"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},p2lg:(e,t,n)=>{var r=n("tQYX"),i=n("CbIe"),o=n("/UTG"),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},"n+p3":e=>{e.exports=function(e,t){return e<t}},bFjY:(e,t,n)=>{var r=n("Q4oW"),i=n("9y2L");e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},"7/we":(e,t,n)=>{var r=n("ZjRn"),i=n("hMsr"),o=n("0Ss3");e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},"KAo/":(e,t,n)=>{var r=n("NYSw"),i=n("2srY"),o=n("NW/2"),a=n("i7nn"),s=n("+tCn"),u=n("0Ss3"),l=n("Ypsa");e.exports=function(e,t){return a(e)&&s(t)?u(l(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},MzY2:(e,t,n)=>{var r=n("HsnV"),i=n("amiU"),o=n("UdtX"),a=n("cb1R"),s=n("tQYX"),u=n("zH+d"),l=n("LL3N");e.exports=function e(t,n,c,d,f){t!==n&&o(n,(function(o,u){if(f||(f=new r),s(o))a(t,n,u,c,e,d,f);else{var h=d?d(l(t,u),o,u+"",t,n,f):void 0;void 0===h&&(h=o),i(t,u,h)}}),u)}},cb1R:(e,t,n)=>{var r=n("amiU"),i=n("Grae"),o=n("6Rtw"),a=n("QT01"),s=n("sD1O"),u=n("bvyN"),l=n("wxYD"),c=n("Ndl3"),d=n("3ajY"),f=n("2q8g"),h=n("tQYX"),p=n("Kkar"),v=n("Qd2C"),g=n("LL3N"),y=n("4ScB");e.exports=function(e,t,n,m,b,x,w){var _=g(e,n),E=g(t,n),k=w.get(E);if(k)r(e,n,k);else{var S=x?x(_,E,n+"",e,t,w):void 0,P=void 0===S;if(P){var C=l(E),j=!C&&d(E),D=!C&&!j&&v(E);S=E,C||j||D?l(_)?S=_:c(_)?S=a(_):j?(P=!1,S=i(E,!0)):D?(P=!1,S=o(E,!0)):S=[]:p(E)||u(E)?(S=_,u(_)?S=y(_):h(_)&&!f(_)||(S=s(E))):P=!1}P&&(w.set(E,S),b(S,E,m,x,w),w.delete(E)),r(e,n,S)}}},eHpp:(e,t,n)=>{var r=n("H87J"),i=n("w2Tz"),o=n("S3pA"),a=n("bFjY"),s=n("4jPf"),u=n("SU8Q"),l=n("5WP5"),c=n("zWgn"),d=n("wxYD");e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var f=-1;t=r(t,u(o));var h=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return s(h,(function(e,t){return l(e,t,n)}))}},QwI6:(e,t,n)=>{var r=n("O1Sc"),i=n("NW/2");e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},O1Sc:(e,t,n)=>{var r=n("w2Tz"),i=n("y4bl"),o=n("xoyU");e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var l=t[a],c=r(e,l);n(c,l)&&i(u,o(l,e),c)}return u}},EI7Z:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},CEyS:(e,t,n)=>{var r=n("w2Tz");e.exports=function(e){return function(t){return r(t,e)}}},"9au6":e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=e,e+=i;return u}},"5q8j":e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},R3TX:(e,t,n)=>{var r=n("zWgn"),i=n("UAs9"),o=n("7Pat");e.exports=function(e,t){return o(i(e,t,r),e+"")}},y4bl:(e,t,n)=>{var r=n("c72w"),i=n("xoyU"),o=n("pnw1"),a=n("tQYX"),s=n("Ypsa");e.exports=function(e,t,n,u){if(!a(e))return e;for(var l=-1,c=(t=i(t,e)).length,d=c-1,f=e;null!=f&&++l<c;){var h=s(t[l]),p=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(l!=d){var v=f[h];void 0===(p=u?u(v,h,f):void 0)&&(p=a(v)?v:o(t[l+1])?[]:{})}r(f,h,p),f=f[h]}return e}},"+7q0":(e,t,n)=>{var r=n("eN33"),i=n("Pz+s"),o=n("zWgn"),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},"4jPf":e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},"2ZvR":e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},JcJ6:(e,t,n)=>{var r=n("Syyo"),i=n("H87J"),o=n("wxYD"),a=n("a88S"),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},I1fX:(e,t,n)=>{var r=n("6XIJ"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},SU8Q:e=>{e.exports=function(e){return function(t){return e(t)}}},"s+R0":(e,t,n)=>{var r=n("JBn+"),i=n("OfKG"),o=n("sCL+"),a=n("S0iI"),s=n("9TP6"),u=n("XlL0");e.exports=function(e,t,n){var l=-1,c=i,d=e.length,f=!0,h=[],p=h;if(n)f=!1,c=o;else if(d>=200){var v=t?null:s(e);if(v)return u(v);f=!1,c=a,p=new r}else p=t?[]:h;e:for(;++l<d;){var g=e[l],y=t?t(g):g;if(g=n||0!==g?g:0,f&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue e;t&&p.push(y),h.push(g)}else c(p,y,n)||(p!==h&&p.push(y),h.push(g))}return h}},SJvO:(e,t,n)=>{var r=n("H87J");e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},WvmI:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}},S0iI:e=>{e.exports=function(e,t){return e.has(t)}},D49j:(e,t,n)=>{var r=n("zWgn");e.exports=function(e){return"function"==typeof e?e:r}},xoyU:(e,t,n)=>{var r=n("wxYD"),i=n("i7nn"),o=n("SoOq"),a=n("dw5g");e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},EAGB:(e,t,n)=>{var r=n("mGzy");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},Grae:(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},lN3w:(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},Bstx:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},bVbG:(e,t,n)=>{var r=n("Syyo"),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},"6Rtw":(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},"dnX/":(e,t,n)=>{var r=n("a88S");e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,u=null===t,l=t==t,c=r(t);if(!u&&!c&&!a&&e>t||a&&s&&l&&!u&&!c||i&&s&&l||!n&&l||!o)return 1;if(!i&&!a&&!c&&e<t||c&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}},"5WP5":(e,t,n)=>{var r=n("dnX/");e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++i<s;){var l=r(o[i],a[i]);if(l)return i>=u?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}},QT01:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},LtXa:(e,t,n)=>{var r=n("c72w"),i=n("wC3K");e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var l=t[s],c=o?o(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?i(n,l,c):r(n,l,c)}return n}},AjPR:(e,t,n)=>{var r=n("LtXa"),i=n("70Le");e.exports=function(e,t){return r(e,i(e),t)}},BjSP:(e,t,n)=>{var r=n("LtXa"),i=n("Xidw");e.exports=function(e,t){return r(e,i(e),t)}},"3KBa":(e,t,n)=>{var r=n("IBsm")["__core-js_shared__"];e.exports=r},wpQC:(e,t,n)=>{var r=n("R3TX"),i=n("R5u7");e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t}))}},bz5b:(e,t,n)=>{var r=n("9y2L");e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},RFxK:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},"1aYn":(e,t,n)=>{var r=n("S3pA"),i=n("9y2L"),o=n("BlJA");e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var u=r(n,3);t=o(t),n=function(e){return u(s[e],e,s)}}var l=e(t,n,a);return l>-1?s[u?t[l]:l]:void 0}}},"2M3I":(e,t,n)=>{var r=n("9au6"),i=n("R5u7"),o=n("fWyh");e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},"9TP6":(e,t,n)=>{var r=n("OBn4"),i=n("nnm9"),o=n("XlL0"),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},"Pz+s":(e,t,n)=>{var r=n("vxC8"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},"ZZ+W":(e,t,n)=>{var r=n("JBn+"),i=n("myUI"),o=n("S0iI");e.exports=function(e,t,n,a,s,u){var l=1&n,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var f=u.get(e),h=u.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,g=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p<c;){var y=e[p],m=t[p];if(a)var b=l?a(m,y,p,t,e,u):a(y,m,p,e,t,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(y===e||s(y,e,n,a,u)))return g.push(t)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,u)){v=!1;break}}return u.delete(e),u.delete(t),v}},R3gn:(e,t,n)=>{var r=n("Syyo"),i=n("mGzy"),o=n("pPzx"),a=n("ZZ+W"),s=n("aURW"),u=n("XlL0"),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&r;if(h||(h=u),e.size!=t.size&&!p)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var g=a(h(e),h(t),r,l,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},yZHP:(e,t,n)=>{var r=n("tlBq"),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,l=r(e),c=l.length;if(c!=r(t).length&&!u)return!1;for(var d=c;d--;){var f=l[d];if(!(u?f in t:i.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<c;){var y=e[f=l[d]],m=t[f];if(o)var b=u?o(m,y,f,t,e,s):o(y,m,f,e,t,s);if(!(void 0===b?y===m||a(y,m,n,o,s):b)){v=!1;break}g||(g="constructor"==f)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},cH1A:(e,t,n)=>{var r=n("1xil"),i=n("UAs9"),o=n("7Pat");e.exports=function(e){return o(i(e,void 0,r),e+"")}},e93E:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},tlBq:(e,t,n)=>{var r=n("pIod"),i=n("70Le"),o=n("BlJA");e.exports=function(e){return r(e,o,i)}},zF5n:(e,t,n)=>{var r=n("pIod"),i=n("Xidw"),o=n("zH+d");e.exports=function(e){return r(e,o,i)}},JNqh:(e,t,n)=>{var r=n("6UKJ");e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},hMsr:(e,t,n)=>{var r=n("+tCn"),i=n("BlJA");e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},vxC8:(e,t,n)=>{var r=n("5nKN"),i=n("4p/L");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},"/wCD":(e,t,n)=>{var r=n("TAtK")(Object.getPrototypeOf,Object);e.exports=r},KCLV:(e,t,n)=>{var r=n("Syyo"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(u){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},"70Le":(e,t,n)=>{var r=n("W0vE"),i=n("X4R2"),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},Xidw:(e,t,n)=>{var r=n("y/9h"),i=n("/wCD"),o=n("70Le"),a=n("X4R2"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},"kkM+":(e,t,n)=>{var r=n("QF3D"),i=n("qeCs"),o=n("IS0S"),a=n("OBn4"),s=n("4+Vk"),u=n("Dhk8"),l=n("c18h"),c="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=l(r),g=l(i),y=l(o),m=l(a),b=l(s),x=u;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=f||s&&x(new s)!=h)&&(x=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case v:return p;case g:return c;case y:return d;case m:return f;case b:return h}return t}),e.exports=x},"4p/L":e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},"z+TE":(e,t,n)=>{var r=n("xoyU"),i=n("bvyN"),o=n("wxYD"),a=n("pnw1"),s=n("t0L4"),u=n("Ypsa");e.exports=function(e,t,n){for(var l=-1,c=(t=r(t,e)).length,d=!1;++l<c;){var f=u(t[l]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++l!=c?d:!!(c=null==e?0:e.length)&&s(c)&&a(f,c)&&(o(e)||i(e))}},GZgP:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},"2Fbm":(e,t,n)=>{var r=n("5pfJ");e.exports=function(){this.__data__=r?r(null):{},this.size=0}},VPai:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},"+fUG":(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},QMz8:(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},mUsV:(e,t,n)=>{var r=n("5pfJ");e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},"3Qlq":e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},"7No3":(e,t,n)=>{var r=n("EAGB"),i=n("lN3w"),o=n("Bstx"),a=n("bVbG"),s=n("6Rtw");e.exports=function(e,t,n){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},sD1O:(e,t,n)=>{var r=n("vGGS"),i=n("/wCD"),o=n("CbIe");e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},oCTG:(e,t,n)=>{var r=n("Syyo"),i=n("bvyN"),o=n("wxYD"),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},pnw1:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},R5u7:(e,t,n)=>{var r=n("pPzx"),i=n("9y2L"),o=n("pnw1"),a=n("tQYX");e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},i7nn:(e,t,n)=>{var r=n("wxYD"),i=n("a88S"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},"6UKJ":e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},"9vbJ":(e,t,n)=>{var r,i=n("3KBa"),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},CbIe:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},"+tCn":(e,t,n)=>{var r=n("tQYX");e.exports=function(e){return e==e&&!r(e)}},"8Zrg":e=>{e.exports=function(){this.__data__=[],this.size=0}},kwr2:(e,t,n)=>{var r=n("6QIk"),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},"5VYK":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},"Coc+":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){return r(this.__data__,e)>-1}},LzM7:(e,t,n)=>{var r=n("6QIk");e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},m5o6:(e,t,n)=>{var r=n("Tv3l"),i=n("+ooz"),o=n("qeCs");e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},d0UJ:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},eask:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).get(e)}},"9SKQ":(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).has(e)}},e63W:(e,t,n)=>{var r=n("JNqh");e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},aURW:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},"0Ss3":e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},"0+aC":(e,t,n)=>{var r=n("pFSi");e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},"5pfJ":(e,t,n)=>{var r=n("vxC8")(Object,"create");e.exports=r},OtNC:(e,t,n)=>{var r=n("TAtK")(Object.keys,Object);e.exports=r},"/UTG":e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},T6vp:(e,t,n)=>{e=n.nmd(e);var r=n("e93E"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},kHoZ:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},TAtK:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},UAs9:(e,t,n)=>{var r=n("zaNA"),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=o[a];return l[t]=n(u),r(e,this,l)}}},IBsm:(e,t,n)=>{var r=n("e93E"),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},LL3N:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},qjF7:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},cEmw:e=>{e.exports=function(e){return this.__data__.has(e)}},XlL0:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},"7Pat":(e,t,n)=>{var r=n("+7q0"),i=n("kG2z")(r);e.exports=i},kG2z:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},RNlM:(e,t,n)=>{var r=n("+ooz");e.exports=function(){this.__data__=new r,this.size=0}},E4ao:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},BSqe:e=>{e.exports=function(e){return this.__data__.get(e)}},L6um:e=>{e.exports=function(e){return this.__data__.has(e)}},"4/ik":(e,t,n)=>{var r=n("+ooz"),i=n("qeCs"),o=n("hyzI");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},n1QJ:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},GVul:(e,t,n)=>{var r=n("2wsP"),i=n("GZgP"),o=n("QZ90");e.exports=function(e){return i(e)?o(e):r(e)}},SoOq:(e,t,n)=>{var r=n("0+aC"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},Ypsa:(e,t,n)=>{var r=n("a88S");e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},c18h:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},"6XIJ":e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},QZ90:e=>{var t="[\\ud800-\\udfff]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")"+"?",u="[\\ufe0e\\ufe0f]?",l=u+s+("(?:\\u200d(?:"+[i,o,a].join("|")+")"+u+s+")*"),c="(?:"+[i+n+"?",n,o,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+c+l,"g");e.exports=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}},zr3P:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,4)}},c2re:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,5)}},eN33:e=>{e.exports=function(e){return function(){return e}}},WHWN:(e,t,n)=>{var r=n("R3TX"),i=n("pPzx"),o=n("R5u7"),a=n("zH+d"),s=Object.prototype,u=s.hasOwnProperty,l=r((function(e,t){e=Object(e);var n=-1,r=t.length,l=r>2?t[2]:void 0;for(l&&o(t[0],t[1],l)&&(r=1);++n<r;)for(var c=t[n],d=a(c),f=-1,h=d.length;++f<h;){var p=d[f],v=e[p];(void 0===v||i(v,s[p])&&!u.call(e,p))&&(e[p]=c[p])}return e}));e.exports=l},h4um:(e,t,n)=>{e.exports=n("9SCj")},pPzx:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},"+DnP":(e,t,n)=>{var r=n("W0vE"),i=n("sjzV"),o=n("S3pA"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},"6R5o":(e,t,n)=>{var r=n("1aYn")(n("FllU"));e.exports=r},FllU:(e,t,n)=>{var r=n("DuXo"),i=n("S3pA"),o=n("m2YG"),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(e,i(t,3),u)}},"1xil":(e,t,n)=>{var r=n("YpBQ");e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},"9SCj":(e,t,n)=>{var r=n("LmOH"),i=n("Q4oW"),o=n("D49j"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},ZVKf:(e,t,n)=>{var r=n("UdtX"),i=n("D49j"),o=n("zH+d");e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},"2srY":(e,t,n)=>{var r=n("w2Tz");e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},"1mr4":(e,t,n)=>{var r=n("SJov"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"NW/2":(e,t,n)=>{var r=n("JYmt"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},zWgn:e=>{e.exports=function(e){return e}},bvyN:(e,t,n)=>{var r=n("/30y"),i=n("tLQN"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},wxYD:e=>{var t=Array.isArray;e.exports=t},"9y2L":(e,t,n)=>{var r=n("2q8g"),i=n("t0L4");e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},Ndl3:(e,t,n)=>{var r=n("9y2L"),i=n("tLQN");e.exports=function(e){return i(e)&&r(e)}},"3ajY":(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=n("DjCF"),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},MwrP:(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("bvyN"),a=n("wxYD"),s=n("9y2L"),u=n("3ajY"),l=n("CbIe"),c=n("Qd2C"),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(l(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},"2q8g":(e,t,n)=>{var r=n("Dhk8"),i=n("tQYX");e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},t0L4:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},NbvU:(e,t,n)=>{var r=n("gEWz"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isMap,s=a?i(a):r;e.exports=s},tQYX:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},tLQN:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},Kkar:(e,t,n)=>{var r=n("Dhk8"),i=n("/wCD"),o=n("tLQN"),a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==c}},"/iLo":(e,t,n)=>{var r=n("6I2w"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isSet,s=a?i(a):r;e.exports=s},nDih:(e,t,n)=>{var r=n("Dhk8"),i=n("wxYD"),o=n("tLQN");e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},a88S:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},Qd2C:(e,t,n)=>{var r=n("7/jS"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},CZlo:e=>{e.exports=function(e){return void 0===e}},BlJA:(e,t,n)=>{var r=n("rmhs"),i=n("4uJK"),o=n("9y2L");e.exports=function(e){return o(e)?r(e):i(e)}},"zH+d":(e,t,n)=>{var r=n("rmhs"),i=n("p2lg"),o=n("9y2L");e.exports=function(e){return o(e)?r(e,!0):i(e)}},"p1C/":e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},mbB6:(e,t,n)=>{var r=n("H87J"),i=n("S3pA"),o=n("bFjY"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},y2Ah:(e,t,n)=>{var r=n("wC3K"),i=n("zKkv"),o=n("S3pA");e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},"LPC+":(e,t,n)=>{var r=n("JElN"),i=n("FaiA"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},pFSi:(e,t,n)=>{var r=n("hyzI");function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},H8sf:(e,t,n)=>{var r=n("MzY2"),i=n("wpQC")((function(e,t,n){r(e,t,n)}));e.exports=i},Z3AG:(e,t,n)=>{var r=n("JElN"),i=n("n+p3"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},PKEM:(e,t,n)=>{var r=n("JElN"),i=n("S3pA"),o=n("n+p3");e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},nnm9:e=>{e.exports=function(){}},ENE1:(e,t,n)=>{var r=n("IBsm");e.exports=function(){return r.Date.now()}},"//nZ":(e,t,n)=>{var r=n("QwI6"),i=n("cH1A")((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},"1EDM":(e,t,n)=>{var r=n("EI7Z"),i=n("CEyS"),o=n("i7nn"),a=n("Ypsa");e.exports=function(e){return o(e)?r(a(e)):i(e)}},Cmkl:(e,t,n)=>{var r=n("2M3I")();e.exports=r},veKZ:(e,t,n)=>{var r=n("cPMt"),i=n("Q4oW"),o=n("S3pA"),a=n("5q8j"),s=n("wxYD");e.exports=function(e,t,n){var u=s(e)?r:a,l=arguments.length<3;return u(e,o(t,4),n,l,i)}},"7seP":(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("9y2L"),a=n("nDih"),s=n("GVul");e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},u6DZ:(e,t,n)=>{var r=n("YpBQ"),i=n("eHpp"),o=n("R3TX"),a=n("R5u7"),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},X4R2:e=>{e.exports=function(){return[]}},DjCF:e=>{e.exports=function(){return!1}},fWyh:(e,t,n)=>{var r=n("nvU9"),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},m2YG:(e,t,n)=>{var r=n("fWyh");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},nvU9:(e,t,n)=>{var r=n("I1fX"),i=n("tQYX"),o=n("a88S"),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},"4ScB":(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e){return r(e,i(e))}},dw5g:(e,t,n)=>{var r=n("JcJ6");e.exports=function(e){return null==e?"":r(e)}},"cZX/":(e,t,n)=>{var r=n("LmOH"),i=n("vGGS"),o=n("zKkv"),a=n("S3pA"),s=n("/wCD"),u=n("wxYD"),l=n("3ajY"),c=n("2q8g"),d=n("tQYX"),f=n("Qd2C");e.exports=function(e,t,n){var h=u(e),p=h||l(e)||f(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?h?new v:[]:d(e)&&c(v)?i(s(e)):{}}return(p?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},aGtI:(e,t,n)=>{var r=n("YpBQ"),i=n("R3TX"),o=n("s+R0"),a=n("Ndl3"),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},w0mW:(e,t,n)=>{var r=n("dw5g"),i=0;e.exports=function(e){var t=++i;return r(e)+t}},"0iyY":(e,t,n)=>{var r=n("SJvO"),i=n("BlJA");e.exports=function(e){return null==e?[]:r(e,i(e))}},OUo6:(e,t,n)=>{var r=n("c72w"),i=n("WvmI");e.exports=function(e,t){return i(e||[],t||[],r)}},maj8:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var a,s,u=i(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(u[c]=a[c]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(u[s[d]]=a[s[d]])}}return u}},wwsc:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>F,Component:()=>a.wA,Fragment:()=>a.HY,PureComponent:()=>M,StrictMode:()=>xe,Suspense:()=>Y,SuspenseList:()=>H,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>de,cloneElement:()=>ve,createContext:()=>a.kr,createElement:()=>a.az,createFactory:()=>he,createPortal:()=>Q,createRef:()=>a.Vf,default:()=>we,findDOMNode:()=>ye,flushSync:()=>be,forwardRef:()=>R,hydrate:()=>ne,isValidElement:()=>pe,lazy:()=>W,memo:()=>B,render:()=>te,unmountComponentAtNode:()=>ge,unstable_batchedUpdates:()=>me,useCallback:()=>_,useContext:()=>E,useDebugValue:()=>k,useEffect:()=>y,useErrorBoundary:()=>S,useImperativeHandle:()=>x,useLayoutEffect:()=>m,useMemo:()=>w,useReducer:()=>g,useRef:()=>b,useState:()=>v,version:()=>fe});var r,i,o,a=n("sL3o"),s=0,u=[],l=a.YM.__b,c=a.YM.__r,d=a.YM.diffed,f=a.YM.__c,h=a.YM.unmount;function p(e,t){a.YM.__h&&a.YM.__h(i,e,s||t),s=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return s=1,g(T,e)}function g(e,t,n){var o=p(r++,2);return o.t=e,o.__c||(o.__=[n?n(t):T(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=i),o.__}function y(e,t){var n=p(r++,3);!a.YM.__s&&O(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function m(e,t){var n=p(r++,4);!a.YM.__s&&O(n.__H,t)&&(n.__=e,n.__H=t,i.__h.push(n))}function b(e){return s=5,w((function(){return{current:e}}),[])}function x(e,t,n){s=6,m((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function w(e,t){var n=p(r++,7);return O(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _(e,t){return s=8,w((function(){return e}),t)}function E(e){var t=i.context[e.__c],n=p(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function k(e,t){a.YM.useDebugValue&&a.YM.useDebugValue(t?t(e):e)}function S(e){var t=p(r++,10),n=v();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function P(){var e;for(u.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=u.pop();)if(e.__P)try{e.__H.__h.forEach(j),e.__H.__h.forEach(D),e.__H.__h=[]}catch(i){e.__H.__h=[],a.YM.__e(i,e.__v)}}a.YM.__b=function(e){i=null,l&&l(e)},a.YM.__r=function(e){c&&c(e),r=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(j),t.__h.forEach(D),t.__h=[])},a.YM.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==u.push(t)&&o===a.YM.requestAnimationFrame||((o=a.YM.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),C&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);C&&(t=requestAnimationFrame(n))})(P)),i=null},a.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(j),e.__h=e.__h.filter((function(e){return!e.__||D(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.YM.__e(o,e.__v)}})),f&&f(e,t)},a.YM.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{j(e)}catch(e){t=e}})),t&&a.YM.__e(t,n.__v))};var C="function"==typeof requestAnimationFrame;function j(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function D(e){var t=i;e.__c=e.__(),i=t}function O(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function T(e,t){return"function"==typeof t?t(e):t}function N(e,t){for(var n in t)e[n]=t[n];return e}function A(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function M(e){this.props=e}function B(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:A(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,a.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(M.prototype=new a.wA).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(e,t){return A(this.props,e)||A(this.state,t)};var L=a.YM.__b;a.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),L&&L(e)};var I="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function R(e){function t(t,n){var r=N({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=I,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var z=function(e,t){return null==e?null:(0,a.bR)((0,a.bR)(e).map(t))},F={map:z,forEach:z,count:function(e){return e?(0,a.bR)(e).length:0},only:function(e){var t=(0,a.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:a.bR},V=a.YM.__e;a.YM.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);V(e,t,n)};var G=a.YM.unmount;function Y(){this.__u=0,this.t=null,this.__b=null}function q(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function W(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,a.az)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function H(){this.u=null,this.o=null}a.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),G&&G(e)},(Y.prototype=new a.wA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=q(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},Y.prototype.componentWillUnmount=function(){this.t=[]},Y.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=N({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&(0,a.az)(a.HY,null,e.fallback);return i&&(i.__h=null),[(0,a.az)(a.HY,null,t.__e?null:e.children),i]};var U=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function X(e){return this.getChildContext=function(){return e.context},e.children}function K(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,a.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,a.sY)((0,a.az)(X,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Q(e,t){return(0,a.az)(K,{__v:e,i:t})}(H.prototype=new a.wA).__e=function(e){var t=this,n=q(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),U(t,e,r)):i()};n?n(o):o()}},H.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,a.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},H.prototype.componentDidUpdate=H.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){U(e,n,t)}))};var Z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,J=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,$="undefined"!=typeof document,ee=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function te(e,t,n){return null==t.__k&&(t.textContent=""),(0,a.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function ne(e,t,n){return(0,a.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}a.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(a.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var re=a.YM.event;function ie(){}function oe(){return this.cancelBubble}function ae(){return this.defaultPrevented}a.YM.event=function(e){return re&&(e=re(e)),e.persist=ie,e.isPropagationStopped=oe,e.isDefaultPrevented=ae,e.nativeEvent=e};var se,ue={configurable:!0,get:function(){return this.class}},le=a.YM.vnode;a.YM.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];$&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ee(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&J.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,a.bR)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(ue.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ue))}e.$$typeof=Z,le&&le(e)};var ce=a.YM.__r;a.YM.__r=function(e){ce&&ce(e),se=e.__c};var de={ReactCurrentDispatcher:{current:{readContext:function(e){return se.__n[e.__c].props.value}}}},fe="17.0.2";function he(e){return a.az.bind(null,e)}function pe(e){return!!e&&e.$$typeof===Z}function ve(e){return pe(e)?a.Tm.apply(null,arguments):e}function ge(e){return!!e.__k&&((0,a.sY)(null,e),!0)}function ye(e){return e&&(e.base||1===e.nodeType&&e)||null}var me=function(e,t){return e(t)},be=function(e,t){return e(t)},xe=a.HY;const we={useState:v,useReducer:g,useEffect:y,useLayoutEffect:m,useRef:b,useImperativeHandle:x,useMemo:w,useCallback:_,useContext:E,useDebugValue:k,version:"17.0.2",Children:F,render:te,hydrate:ne,unmountComponentAtNode:ge,createPortal:Q,createElement:a.az,createContext:a.kr,createFactory:he,cloneElement:ve,createRef:a.Vf,Fragment:a.HY,isValidElement:pe,findDOMNode:ye,Component:a.wA,PureComponent:M,memo:B,forwardRef:R,flushSync:be,unstable_batchedUpdates:me,StrictMode:a.HY,Suspense:Y,SuspenseList:H,lazy:W,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:de}},sL3o:(e,t,n)=>{"use strict";n.d(t,{sY:()=>R,ZB:()=>z,az:()=>v,HY:()=>m,Vf:()=>y,wA:()=>b,Tm:()=>F,kr:()=>V,bR:()=>P,YM:()=>i});var r,i,o,a,s,u,l,c={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var i,o,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return g(e,s,i,o,null)}function g(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++o:a};return null==a&&null!=i.vnode&&i.vnode(s),s}function y(){return{current:null}}function m(e){return e.children}function b(e,t){this.props=e,this.context=t}function x(e,t){if(null==t)return e.__?x(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?x(e):null}function w(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w(e)}}function _(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!E.__r++||u!==i.debounceRendering)&&((u=i.debounceRendering)||s)(E)}function E(){for(var e;E.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=h({},i)).__v=i.__v+1,N(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?x(i):o,i.__h),A(n,i),i.__e!=o&&w(i)))}))}function k(e,t,n,r,i,o,a,s,u,l){var f,h,p,v,y,b,w,_=r&&r.__k||d,E=_.length;for(n.__k=[],f=0;f<t.length;f++)if(null!=(v=n.__k[f]=null==(v=t[f])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?g(null,v,null,null,v):Array.isArray(v)?g(m,{children:v},null,null,null):v.__b>0?g(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(p=_[f])||p&&v.key==p.key&&v.type===p.type)_[f]=void 0;else for(h=0;h<E;h++){if((p=_[h])&&v.key==p.key&&v.type===p.type){_[h]=void 0;break}p=null}N(e,v,p=p||c,i,o,a,s,u,l),y=v.__e,(h=v.ref)&&p.ref!=h&&(w||(w=[]),p.ref&&w.push(p.ref,null,v),w.push(h,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===p.__k?v.__d=u=S(v,u,e):u=C(e,v,p,_,y,u),"function"==typeof n.type&&(n.__d=u)):u&&p.__e==u&&u.parentNode!=e&&(u=x(p))}for(n.__e=b,f=E;f--;)null!=_[f]&&("function"==typeof n.type&&null!=_[f].__e&&_[f].__e==n.__d&&(n.__d=x(r,f+1)),L(_[f],_[f]));if(w)for(f=0;f<w.length;f++)B(w[f],w[++f],w[++f])}function S(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?S(r,t,n):C(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function C(e,t,n,r,i,o){var a,s,u;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,u=0;(s=s.nextSibling)&&u<r.length;u+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function j(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||f.test(t)?n:n+"px"}function D(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||j(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||j(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?T:O,o):e.removeEventListener(t,o?T:O,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function O(e){this.l[e.type+!1](i.event?i.event(e):e)}function T(e){this.l[e.type+!0](i.event?i.event(e):e)}function N(e,t,n,r,o,a,s,u,l){var c,d,f,p,v,g,y,x,w,_,E,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,u=t.__e=n.__e,t.__h=null,a=[u]),(c=i.__b)&&c(t);try{e:if("function"==typeof S){if(x=t.props,w=(c=S.contextType)&&r[c.__c],_=c?w?w.props.value:c.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(x,_):(t.__c=d=new b(x,_),d.constructor=S,d.render=I),w&&w.sub(d),d.props=x,d.state||(d.state={}),d.context=_,d.__n=r,f=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,S.getDerivedStateFromProps(x,d.__s))),p=d.props,v=d.state,f)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&x!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(x,_),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(x,d.__s,_)||t.__v===n.__v){d.props=x,d.state=d.__s,t.__v!==n.__v&&(d.__d=!1),d.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(x,d.__s,_),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}d.context=_,d.props=x,d.state=d.__s,(c=i.__r)&&c(t),d.__d=!1,d.__v=t,d.__P=e,c=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(r=h(h({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),E=null!=c&&c.type===m&&null==c.key?c.props.children:c,k(e,Array.isArray(E)?E:[E],t,n,r,o,a,s,u,l),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),y&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=M(n.__e,t,n,r,o,a,s,l);(c=i.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=a)&&(t.__e=u,t.__h=!!l,a[a.indexOf(u)]=null),i.__e(e,t,n)}}function A(e,t){i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function M(e,t,n,i,o,a,s,u){var l,d,f,h=n.props,v=t.props,g=t.type,y=0;if("svg"===g&&(o=!0),null!=a)for(;y<a.length;y++)if((l=a[y])&&"setAttribute"in l==!!g&&(g?l.localName===g:3===l.nodeType)){e=l,a[y]=null;break}if(null==e){if(null===g)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),a=null,u=!1}if(null===g)h===v||u&&e.data===v||(e.data=v);else{if(a=a&&r.call(e.childNodes),d=(h=n.props||c).dangerouslySetInnerHTML,f=v.dangerouslySetInnerHTML,!u){if(null!=a)for(h={},y=0;y<e.attributes.length;y++)h[e.attributes[y].name]=e.attributes[y].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===e.innerHTML)||(e.innerHTML=f&&f.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||D(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||D(e,o,t[o],n[o],r)}(e,v,h,o,u),f)t.__k=[];else if(y=t.props.children,k(e,Array.isArray(y)?y:[y],t,n,i,o&&"foreignObject"!==g,a,s,a?a[0]:n.__k&&x(n,0),u),null!=a)for(y=a.length;y--;)null!=a[y]&&p(a[y]);u||("value"in v&&void 0!==(y=v.value)&&(y!==h.value||y!==e.value||"progress"===g&&!y)&&D(e,"value",y,h.value,!1),"checked"in v&&void 0!==(y=v.checked)&&y!==e.checked&&D(e,"checked",y,h.checked,!1))}return e}function B(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,n)}}function L(e,t,n){var r,o;if(i.unmount&&i.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||B(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){i.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&L(r[o],t,"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function I(e,t,n){return this.constructor(e,n)}function R(e,t,n){var o,a,s;i.__&&i.__(e,t),a=(o="function"==typeof n)?null:n&&n.__k||t.__k,s=[],N(t,e=(!o&&n||t).__k=v(m,null,[e]),a||c,c,void 0!==t.ownerSVGElement,!o&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!o&&n?n:a?a.__e:t.firstChild,o),A(s,e)}function z(e,t){R(e,t,z)}function F(e,t,n){var i,o,a,s=h({},e.props);for(a in t)"key"==a?i=t[a]:"ref"==a?o=t[a]:s[a]=t[a];return arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),g(e.type,s,i||e.key,o||e.ref,null)}function V(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(_)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,i={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},o=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),_(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},b.prototype.render=m,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,E.__r=0,l=0},"3a9g":(e,t,n)=>{"use strict";var r=n("maj8"),i=n("wwsc");t.useSubscription=function(e){var t=e.getCurrentValue,n=e.subscribe,o=i.useState((function(){return{getCurrentValue:t,subscribe:n,value:t()}}));e=o[0];var a=o[1];return o=e.value,e.getCurrentValue===t&&e.subscribe===n||(o=t(),a({getCurrentValue:t,subscribe:n,value:o})),i.useDebugValue(o),i.useEffect((function(){function e(){if(!i){var e=t();a((function(i){return i.getCurrentValue!==t||i.subscribe!==n||i.value===e?i:r({},i,{value:e})}))}}var i=!1,o=n(e);return e(),function(){i=!0,o()}}),[t,n]),o}},D3Vl:(e,t,n)=>{"use strict";e.exports=n("3a9g")},IXFX:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionTypes:()=>B,Interpreter:()=>ct,InterpreterStatus:()=>ut,Machine:()=>Ke,SpecialTargets:()=>L,State:()=>Ie,StateNode:()=>Xe,actions:()=>vt,assign:()=>be,createMachine:()=>Qe,createSchema:()=>pt,doneInvoke:()=>_e,forwardTo:()=>ke,interpret:()=>ft,mapState:()=>q,matchState:()=>ht,matchesState:()=>d,send:()=>fe,sendParent:()=>he,sendUpdate:()=>pe,spawn:()=>dt});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(ne){i={error:ne}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}var u={},l="xstate.guard";function c(e){return Object.keys(e)}function d(e,t,n){void 0===n&&(n=".");var r=p(e,n),i=p(t,n);return T(i)?!!T(r)&&i===r:T(r)?r in i:c(r).every((function(e){return e in i&&d(r[e],i[e])}))}function f(e){try{return T(e)||"number"==typeof e?""+e:e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function h(e,t){try{return D(e)?e:e.toString().split(t)}catch(n){throw new Error("'"+e+"' is not a valid state path.")}}function p(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:D(e)?v(e):"string"!=typeof e?e:v(h(e,t));var n}function v(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function g(e,t){for(var n={},r=c(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function y(e,t,n){var r,i,a={};try{for(var s=o(c(e)),u=s.next();!u.done;u=s.next()){var l=u.value,d=e[l];n(d)&&(a[l]=t(d,l,e))}}catch(f){r={error:f}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}var m=function(e){return function(t){var n,r,i=t;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){i=i[s.value]}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}};function b(e){return e?T(e)?[[e]]:x(c(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?b(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function x(e){var t;return(t=[]).concat.apply(t,s([],a(e)))}function w(e){return D(e)?e:[e]}function _(e){return void 0===e?[]:w(e)}function E(e,t,n){var r,i;if(O(e))return e(t,n.data);var a={};try{for(var s=o(Object.keys(e)),u=s.next();!u.done;u=s.next()){var l=u.value,c=e[l];O(c)?a[l]=c(t,n.data):a[l]=c}}catch(d){r={error:d}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function k(e){return e instanceof Promise||!(null===e||!O(e)&&"object"!=typeof e||!O(e.then))}function S(e,t){var n,r,i=a([[],[]],2),s=i[0],u=i[1];try{for(var l=o(e),c=l.next();!c.done;c=l.next()){var d=c.value;t(d)?s.push(d):u.push(d)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[s,u]}function P(e,t){return g(e.states,(function(e,n){if(e){var r=(T(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:P(e,r)}}}))}function C(e,t,n,r){return e?n.reduce((function(e,n){var i,a,s=n.assignment,u={state:r,action:n,_event:t},l={};if(O(s))l=s(e,t.data,u);else try{for(var d=o(c(s)),f=d.next();!f.done;f=d.next()){var h=f.value,p=s[h];l[h]=O(p)?p(e,t.data,u):p}}catch(v){i={error:v}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}return Object.assign({},e,l)}),e):e}var j=function(){};function D(e){return Array.isArray(e)}function O(e){return"function"==typeof e}function T(e){return"string"==typeof e}function N(e,t){if(e)return T(e)?{type:l,name:e,predicate:t?t[e]:void 0}:O(e)?{type:l,name:e.name,predicate:e}:e}var A=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function M(e){try{return"__xstatenode"in e}catch(t){return!1}}var B,L,I=function(){var e=0;return function(){return(++e).toString(16)}}();function R(e,t){return T(e)||"number"==typeof e?r({type:e},t):e}function z(e,t){if(!T(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=R(e);return r({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function F(e,t){return w(t).map((function(t){return void 0===t||"string"==typeof t||M(t)?{target:t,event:e}:r(r({},t),{event:e})}))}function V(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===l)return((null==o?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o[t.type];if(!s)throw new Error("Guard '"+t.type+"' is not implemented on machine '"+e.id+"'.");return s(n,r.data,a)}function G(e){return"string"==typeof e?{type:e}:e}function Y(e,t,n){if("object"==typeof e)return e;var r=function(){};return{next:e,error:t||r,complete:n||r}}function q(e,t){var n,r,i;try{for(var a=o(c(e)),s=a.next();!s.done;s=a.next()){var u=s.value;d(u,t)&&(!i||t.length>i.length)&&(i=u)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return e[i]}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(B||(B={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(L||(L={}));var W=B.Start,H=B.Stop,U=B.Raise,X=B.Send,K=B.Cancel,Q=B.NullEvent,Z=B.Assign,J=(B.After,B.DoneState,B.Log),$=B.Init,ee=B.Invoke,te=(B.ErrorExecution,B.ErrorPlatform),ne=B.ErrorCustom,re=B.Update,ie=B.Choose,oe=B.Pure,ae=z({type:$});function se(e,t){return t&&t[e]||void 0}function ue(e,t){var n;if(T(e)||"number"==typeof e)n=O(i=se(e,t))?{type:e,exec:i}:i||{type:e,exec:void 0};else if(O(e))n={type:e.name||e.toString(),exec:e};else{var i;if(O(i=se(e.type,t)))n=r(r({},e),{exec:i});else if(i){var o=i.type||e.type;n=r(r(r({},i),e),{type:o})}else n=e}return n}var le=function(e,t){return e?(D(e)?e:[e]).map((function(e){return ue(e,t)})):[]};function ce(e){var t=ue(e);return r(r({id:T(e)?e:t.id},t),{type:t.type})}function de(e){return T(e)?{type:U,event:e}:fe(e,{to:L.Internal})}function fe(e,t){return{to:t?t.to:void 0,type:X,event:O(e)?e:R(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:O(e)?e.name:f(e)}}function he(e,t){return fe(e,r(r({},t),{to:L.Parent}))}function pe(){return he(re)}var ve=function(e,t){return{context:e,event:t}};var ge=function(e){return{type:K,sendId:e}};function ye(e){var t=ce(e);return{type:B.Start,activity:t,exec:void 0}}function me(e){var t=O(e)?e:ce(e);return{type:B.Stop,activity:t,exec:void 0}}var be=function(e){return{type:Z,assignment:e}};function xe(e,t){var n=t?"#"+t:"";return B.After+"("+e+")"+n}function we(e,t){var n=B.DoneState+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function _e(e,t){var n=B.DoneInvoke+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function Ee(e,t){var n=B.ErrorPlatform+"."+e,r={type:n,data:t,toString:function(){return n}};return r}function ke(e,t){return fe((function(e,t){return t}),r(r({},t),{to:e}))}function Se(e,t,n,i,o,u){void 0===u&&(u=!1);var l=a(u?[[],o]:S(o,(function(e){return e.type===Z})),2),c=l[0],d=l[1],f=c.length?C(n,i,c,t):n,h=u?[n]:void 0,p=x(d.map((function(n){var o;switch(n.type){case U:return{type:U,_event:z(n.event)};case X:var l=function(e,t,n,i){var o,a={_event:n},s=z(O(e.event)?e.event(t,n.data,a):e.event);if(T(e.delay)){var u=i&&i[e.delay];o=O(u)?u(t,n.data,a):u}else o=O(e.delay)?e.delay(t,n.data,a):e.delay;var l=O(e.to)?e.to(t,n.data,a):e.to;return r(r({},e),{to:l,_event:s,event:s.data,delay:o})}(n,f,i,e.options.delays);return l;case J:return function(e,t,n){return r(r({},e),{value:T(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(n,f,i);case ie:if(!(v=null===(o=n.conds.find((function(n){var r=N(n.cond,e.options.guards);return!r||V(e,r,f,i,t)})))||void 0===o?void 0:o.actions))return[];var c=a(Se(e,t,f,i,le(_(v),e.options.actions),u),2),d=c[0],p=c[1];return f=p,null==h||h.push(f),d;case oe:var v;if(!(v=n.get(f,i.data)))return[];var g=a(Se(e,t,f,i,le(_(v),e.options.actions),u),2),y=g[0],m=g[1];return f=m,null==h||h.push(f),y;case H:return function(e,t,n){var r=O(e.activity)?e.activity(t,n.data):e.activity,i="string"==typeof r?{id:r}:r;return{type:B.Stop,activity:i}}(n,f,i);case Z:f=C(f,i,[n],t),null==h||h.push(f);break;default:var b=ue(n,e.options.actions),x=b.exec;if(x&&h){var w=h.length-1;b=r(r({},b),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];x.apply(void 0,s([h[w]],a(t)))}})}return b}})).filter((function(e){return!!e})));return[p,f]}var Pe=function(e){return"atomic"===e.type||"final"===e.type};function Ce(e){return c(e.states).map((function(t){return e.states[t]}))}function je(e){var t=[e];return Pe(e)?t:t.concat(x(Ce(e).map(je)))}function De(e,t){var n,r,i,a,s,u,l,c,d=Te(new Set(e)),f=new Set(t);try{for(var h=o(f),p=h.next();!p.done;p=h.next())for(var v=(k=p.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(S){n={error:S}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var g=Te(f);try{for(var y=o(f),m=y.next();!m.done;m=y.next()){if("compound"!==(k=m.value).type||g.get(k)&&g.get(k).length){if("parallel"===k.type)try{for(var b=(s=void 0,o(Ce(k))),x=b.next();!x.done;x=b.next()){var w=x.value;"history"!==w.type&&(f.has(w)||(f.add(w),d.get(w)?d.get(w).forEach((function(e){return f.add(e)})):w.initialStateNodes.forEach((function(e){return f.add(e)}))))}}catch(P){s={error:P}}finally{try{x&&!x.done&&(u=b.return)&&u.call(b)}finally{if(s)throw s.error}}}else d.get(k)?d.get(k).forEach((function(e){return f.add(e)})):k.initialStateNodes.forEach((function(e){return f.add(e)}))}}catch(C){i={error:C}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}try{for(var _=o(f),E=_.next();!E.done;E=_.next()){var k;for(v=(k=E.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(j){l={error:j}}finally{try{E&&!E.done&&(c=_.return)&&c.call(_)}finally{if(l)throw l.error}}return f}function Oe(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(Pe(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=Oe(e,t)})),i}function Te(e){var t,n,r=new Map;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=a.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function Ne(e,t){return Oe(e,Te(De([e],t)))}function Ae(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function Me(e,t){return"compound"===t.type?Ce(t).some((function(t){return"final"===t.type&&Ae(e,t)})):"parallel"===t.type&&Ce(t).every((function(t){return Me(e,t)}))}function Be(e){return new Set(x(e.map((function(e){return e.tags}))))}function Le(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(T(e)||T(t))return e===t;var n=c(e),r=c(t);return n.length===r.length&&n.every((function(n){return Le(e[n],t[n])}))}var Ie=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=u,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||u,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return s([],a(new Set(x(s([],a(e.map((function(e){return e.ownEvents}))))))))}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:ae,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ae;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),T(e))return[e];var r=c(e);return r.concat.apply(r,s([],a(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))})))))},e.prototype.toJSON=function(){var e=this,t=(e.configuration,e.transitions,e.tags),n=(e.machine,i(e,["configuration","transitions","tags","machine"]));return r(r({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return d(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;return j(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false."),!!(null===(t=this.machine)||void 0===t?void 0:t.transition(this,e).changed)},e}(),Re=[],ze=function(e,t){Re.push(e);var n=t(e);return Re.pop(),n};function Fe(e){return{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}}}function Ve(e,t,n){var r=Fe(t);if(r.deferred=!0,M(e)){var i=r.state=ze(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return i}}return r}function Ge(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Ye(e){return r(r({type:ee},e),{toJSON:function(){e.onDone,e.onError;var t=i(e,["onDone","onError"]);return r(r({},t),{type:ee,src:Ge(e.src)})}})}var qe="",We="*",He={},Ue=function(e){return"#"===e[0]},Xe=function(){function e(t,n,i){var u,l=this;void 0===i&&(i="context"in t?t.context:void 0),this.config=t,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=this.options._parent,this.key=this.config.key||this.options._key||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||s([this.machine.key],a(this.path)).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&c(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(u=this.config.schema)&&void 0!==u?u:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?g(this.config.states,(function(t,n){var i,o=new e(t,{_parent:l,_key:n});return Object.assign(l.idMap,r(((i={})[o.id]=o,i),o.idMap)),o})):He;var d=0;!function e(t){var n,r;t.order=d++;try{for(var i=o(Ce(t)),a=i.next();!a.done;a=i.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===qe})):qe in this.config.on),this.strict=!!this.config.strict,this.onEntry=_(this.config.entry||this.config.onEntry).map((function(e){return ue(e)})),this.onExit=_(this.config.exit||this.config.onExit).map((function(e){return ue(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=_(this.config.invoke).map((function(e,t){var n,i;if(M(e))return l.machine.options.services=r(((n={})[e.id]=e,n),l.machine.options.services),Ye({src:e.id,id:e.id});if(T(e.src))return Ye(r(r({},e),{id:e.id||e.src,src:e.src}));if(M(e.src)||O(e.src)){var o=l.id+":invocation["+t+"]";return l.machine.options.services=r(((i={})[o]=e.src,i),l.machine.options.services),Ye(r(r({id:o},e),{src:o}))}var a=e.src;return Ye(r(r({id:a.type},e),{src:a}))})),this.activities=_(this.config.activities).concat(this.invoke).map((function(e){return ce(e)})),this.transition=this.transition.bind(this),this.tags=_(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||je(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var i=this.options,o=i.actions,a=i.activities,s=i.guards,u=i.services,l=i.delays;return new e(this.config,{actions:r(r({},o),t.actions),activities:r(r({},a),t.activities),guards:r(r({},s),t.guards),services:r(r({},u),t.services),delays:r(r({},l),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return O(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:g(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===qe,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===We}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=xe(O(t)?e.id+":delay["+n+"]":t,e.id);return e.onEntry.push(fe(r,{delay:t})),e.onExit.push(ge(r)),r};return(D(t)?t.map((function(e,t){var i=n(e.delay,t);return r(r({},e),{event:i})})):x(c(t).map((function(e,i){var o=t[e],a=T(o)?{target:o}:o,s=isNaN(+e)?e:+e,u=n(s,i);return _(a).map((function(e){return r(r({},e),{event:u,delay:s})}))})))).map((function(t){var n=t.delay;return r(r({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof Ie?e.value:p(e,this.delimiter);if(T(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((t={})[r]=i,t)):[this,this.states[r]]}var o=c(r),a=o.map((function(e){return n.getStateNode(e)}));return a.push(this),a.concat(o.reduce((function(e,t){var i=n.getStateNode(t).getStateNodes(r[t]);return e.concat(i)}),[]))},e.prototype.handles=function(e){var t=f(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=Array.from(De([],this.getStateNodes(e.value)));return new Ie(r(r({},e),{value:this.resolve(e.value),configuration:t,done:Me(t,this),tags:Be(t)}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=c(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,i,a={};try{for(var s=o(c(e)),u=s.next();!u.done;u=s.next()){var l=u.value,d=e[l];if(d){var f=this.getStateNode(l)._transition(d,t,n);f&&(a[l]=f)}}}catch(y){r={error:y}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}var h=c(a).map((function(e){return a[e]})),p=x(h.map((function(e){return e.transitions})));if(!h.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=x(h.map((function(e){return e.entrySet}))),g=x(c(a).map((function(e){return a[e].configuration})));return{transitions:p,entrySet:v,exitSet:x(h.map((function(e){return e.exitSet}))),configuration:g,source:t,actions:x(c(a).map((function(e){return a[e].actions})))}},e.prototype._transition=function(e,t,n){return T(e)?this.transitionLeafNode(e,t,n):1===c(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.next=function(e,t){var n,r,i,u=this,l=t.name,c=[],f=[];try{for(var h=o(this.getCandidates(l)),v=h.next();!v.done;v=h.next()){var g=v.value,y=g.cond,b=g.in,w=e.context,_=!b||(T(b)&&Ue(b)?e.matches(p(this.getStateNodeById(b).path,this.delimiter)):d(p(b,this.delimiter),m(this.path.slice(0,-2))(e.value))),E=!1;try{E=!y||V(this.machine,y,w,t,e)}catch(P){throw new Error("Unable to evaluate guard '"+(y.name||y.type)+"' in transition for event '"+l+"' in state node '"+this.id+"':\n"+P.message)}if(E&&_){void 0!==g.target&&(f=g.target),c.push.apply(c,s([],a(g.actions))),i=g;break}}}catch(C){n={error:C}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}if(i){if(!f.length)return{transitions:[i],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:c};var k=x(f.map((function(t){return u.getRelativeStateNodes(t,e.historyValue)}))),S=!!i.internal;return{transitions:[i],entrySet:S?[]:x(k.map((function(e){return u.nodesFromChild(e)}))),exitSet:S?[]:[this],configuration:k,source:e,actions:c}}},e.prototype.nodesFromChild=function(e){if(e.escapes(this))return[];for(var t=[],n=e;n&&n!==this;)t.push(n),n=n.parent;return t.push(this),t},e.prototype.escapes=function(e){if(this===e)return!1;for(var t=this.parent;t;){if(t===e)return!1;t=t.parent}return!0},e.prototype.getActions=function(e,t,n,r){var i,u,l,c,d=De([],r?this.getStateNodes(r.value):[this]),f=e.configuration.length?De(d,e.configuration):d;try{for(var h=o(f),p=h.next();!p.done;p=h.next()){Ae(d,y=p.value)||e.entrySet.push(y)}}catch(P){i={error:P}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(i)throw i.error}}try{for(var v=o(d),g=v.next();!g.done;g=v.next()){var y;Ae(f,y=g.value)&&!Ae(e.exitSet,y.parent)||e.exitSet.push(y)}}catch(C){l={error:C}}finally{try{g&&!g.done&&(c=v.return)&&c.call(v)}finally{if(l)throw l.error}}e.source||(e.exitSet=[],e.entrySet.push(this));var m=x(e.entrySet.map((function(r){var i=[];if("final"!==r.type)return i;var o=r.parent;if(!o.parent)return i;i.push(we(r.id,r.doneData),we(o.id,r.doneData?E(r.doneData,t,n):void 0));var a=o.parent;return"parallel"===a.type&&Ce(a).every((function(t){return Me(e.configuration,t)}))&&i.push(we(a.id)),i})));e.exitSet.sort((function(e,t){return t.order-e.order})),e.entrySet.sort((function(e,t){return e.order-t.order}));var b=new Set(e.entrySet),w=new Set(e.exitSet),_=a([x(Array.from(b).map((function(e){return s(s([],a(e.activities.map((function(e){return ye(e)})))),a(e.onEntry))}))).concat(m.map(de)),x(Array.from(w).map((function(e){return s(s([],a(e.onExit)),a(e.activities.map((function(e){return me(e)}))))})))],2),k=_[0],S=_[1];return le(S.concat(e.actions).concat(k),this.machine.options.actions)},e.prototype.transition=function(e,t,n){void 0===e&&(e=this.initialState);var r,i,o=z(t);if(e instanceof Ie)r=void 0===n?e:this.resolveState(Ie.from(e,n));else{var u=T(e)?this.resolve(v(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;r=this.resolveState(Ie.from(u,l))}if(this.strict&&!this.events.includes(o.name)&&(i=o.name,!/^(done|error)\./.test(i)))throw new Error("Machine '"+this.id+"' does not accept event '"+o.name+"'");var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:r,actions:[]},d=De([],this.getStateNodes(r.value)),f=c.configuration.length?De(d,c.configuration):d;return c.configuration=s([],a(f)),this.resolveTransition(c,r,o)},e.prototype.resolveRaisedTransition=function(e,t,n){var r,i=e.actions;return(e=this.transition(e,t))._event=n,e.event=n.data,(r=e.actions).unshift.apply(r,s([],a(i))),e},e.prototype.resolveTransition=function(e,t,n,i){var s,u,l=this;void 0===n&&(n=ae),void 0===i&&(i=this.machine.context);var c=e.configuration,d=!t||e.transitions.length>0,f=d?Ne(this.machine,c):void 0,h=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,p=t?t.context:i,v=this.getActions(e,p,n,t),g=t?r({},t.activities):{};try{for(var y=o(v),m=y.next();!m.done;m=y.next()){var b=m.value;b.type===W?g[b.activity.id||b.activity.type]=b:b.type===H&&(g[b.activity.id||b.activity.type]=!1)}}catch(q){s={error:q}}finally{try{m&&!m.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}var x,w,_=a(Se(this,t,p,n,v,this.machine.config.preserveActionOrder),2),k=_[0],C=_[1],j=a(S(k,(function(e){return e.type===U||e.type===X&&e.to===L.Internal})),2),D=j[0],O=j[1],T=k.filter((function(e){var t;return e.type===W&&(null===(t=e.activity)||void 0===t?void 0:t.type)===ee})),N=T.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var i,o=G(e.src),a=null===(i=null==t?void 0:t.options.services)||void 0===i?void 0:i[o.type],s=e.data?E(e.data,n,r):void 0,u=a?Ve(a,e.id,s):Fe(e.id);return u.meta=e,u}(t.activity,l.machine,C,n),e}),t?r({},t.children):{}),A=f?e.configuration:t?t.configuration:[],M=Me(A,this),B=new Ie({value:f||t.value,context:C,_event:n,_sessionid:t?t._sessionid:null,historyValue:f?h?(x=h,w=f,{current:w,states:P(x,w)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?O:[],activities:f?g:t?t.activities:{},events:[],configuration:A,transitions:e.transitions,children:N,done:M,tags:null==t?void 0:t.tags,machine:this}),I=p!==C;B.changed=n.name===re||I;var R=B.history;R&&delete R.history;var z=!M&&(this._transient||c.some((function(e){return e._transient})));if(!(d||z&&n.name!==qe))return B;var F=B;if(!M)for(z&&(F=this.resolveRaisedTransition(F,{type:Q},n));D.length;){var V=D.shift();F=this.resolveRaisedTransition(F,V._event,n)}var Y=F.changed||(R?!!F.actions.length||I||typeof R.value!=typeof F.value||!Le(F.value,R.value):void 0);return F.changed=Y,F.history=R,F.tags=Be(F.configuration),F},e.prototype.getStateNode=function(e){if(Ue(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '"+e+"' from '"+this.id+"'; no child states exist.");var t=this.states[e];if(!t)throw new Error("Child state '"+e+"' does not exist on '"+this.id+"'");return t},e.prototype.getStateNodeById=function(e){var t=Ue(e)?e.slice("#".length):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#"+t+"' does not exist on machine '"+this.id+"'");return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&Ue(e))try{return this.getStateNodeById(e.slice(1))}catch(i){}for(var t=h(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||He;switch(this.type){case"parallel":return g(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):He}));case"compound":if(T(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return c(e).length?g(e,(function(e,t){return e?n.getStateNode(t).resolve(e):He})):this.initialStateValue||{};default:return e||He}},e.prototype.getResolvedPath=function(e){if(Ue(e)){var t=this.machine.idMap[e.slice("#".length)];if(!t)throw new Error("Unable to find state node '"+e+"'");return t.path}return h(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=y(this.states,(function(e){return e.initialStateValue||He}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '"+this.initial+"' not found on '"+this.key+"'");t=Pe(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,void 0,t)},Object.defineProperty(e.prototype,"initialState",{get:function(){this._init();var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '"+this.id+"'.");return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=T(t.target)&&Ue(t.target)?v(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Pe(this)?[this]:"compound"!==this.type||this.initial?x(b(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):[this]},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=a(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '"+n+"' from node with no states");var i=this.getStateNode(n);if("history"===i.type)return i.resolveHistory();if(!this.states[n])throw new Error("Child state '"+n+"' does not exist on '"+this.id+"'");return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(c(this.states).length)return{current:e||this.initialStateValue,states:y(this.states,(function(t,n){if(!e)return t.historyValue();var r=T(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?x(b(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var i,a,s=(i=n.path,a="states",function(e){var t,n,r=e;try{for(var s=o(i),u=s.next();!u.done;u=s.next()){var l=u.value;r=r[a][l]}}catch(c){t={error:c}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return r})(e).current;return T(s)?[n.getStateNode(s)]:x(b(s).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=x(c(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var s=o(c(i)),u=s.next();!u.done;u=s.next()){var l=i[u.value];if(l.states)try{for(var d=(n=void 0,o(l.events)),f=d.next();!f.done;f=d.next()){var h=f.value;a.add(""+h)}}catch(p){n={error:p}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}}catch(v){e={error:v}}finally{try{u&&!u.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!T(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(i){throw new Error("Invalid transition definition for state node '"+t.id+"':\n"+i.message)}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return _(e)}(e.target),i="internal"in e?e.internal:!n||n.some((function(e){return T(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,a=this.resolveTarget(n),s=r(r({},e),{actions:le(_(e.actions)),cond:N(e.cond,o),target:a,source:this,internal:i,eventType:e.event,toJSON:function(){return r(r({},s),{target:s.target?s.target.map((function(e){return"#"+e.id})):void 0,source:"#"+t.id})}});return s},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var u=this.config.on,l=We,d=u[l],f=void 0===d?[]:d,h=i(u,["*"]);n=x(c(h).map((function(e){var t=F(e,h[e]);return t})).concat(F(We,f)))}else n=[];var p=this.config.always?F("",this.config.always):[],v=this.config.onDone?F(String(we(this.id)),this.config.onDone):[];var g=x(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,s([],a(F(String(_e(e.id)),e.onDone)))),e.onError&&t.push.apply(t,s([],a(F(String(Ee(e.id)),e.onError)))),t}))),y=this.after,m=x(s(s(s(s([],a(v)),a(g)),a(n)),a(p)).map((function(e){return _(e).map((function(e){return r.formatTransition(e)}))})));try{for(var b=o(y),w=b.next();!w.done;w=b.next()){var E=w.value;m.push(E)}}catch(k){e={error:k}}finally{try{w&&!w.done&&(t=b.return)&&t.call(b)}finally{if(e)throw e.error}}return m},e}();function Ke(e,t,n){return void 0===n&&(n=e.context),new Xe(e,t,n)}function Qe(e,t){return new Xe(e,t)}var Ze={deferEvents:!1},Je=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=r(r({},Ze),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},e}(),$e=new Map,et=0,tt=function(){return"x:"+et++},nt=function(e,t){return $e.set(e,t),e},rt=function(e){return $e.get(e)},it=function(e){$e.delete(e)};function ot(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}function at(e){if(ot()){var t=function(){var e=ot();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function st(e,t){void 0===t&&(t={});var n,i=e.initialState,o=new Set,a=[],s=!1,u=(n={id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();i=e.transition(i,t,l),o.forEach((function(e){return e.next(i)}))}s=!1}}()},getSnapshot:function(){return i},subscribe:function(e,t,n){var r=Y(e,t,n);return o.add(r),r.next(i),{unsubscribe:function(){o.delete(r)}}}},r({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},n)),l={parent:t.parent,self:u,id:t.id||"anonymous",observers:o};return i=e.start?e.start(l):i,u}var ut,lt={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(ut||(ut={}));var ct=function(){function e(t,n){var i=this;void 0===n&&(n=e.defaultOptions),this.machine=t,this.scheduler=new Je,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=ut.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(e,t){if(D(e))return i.batch(e),i.state;var n=z(R(e,t));if(i.status===ut.Stopped)return i.state;if(i.status!==ut.Running&&!i.options.deferEvents)throw new Error('Event "'+n.name+'" was sent to uninitialized service "'+i.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: '+JSON.stringify(n.data));return i.scheduler.schedule((function(){i.forward(n);var e=i.nextState(n);i.update(e,n)})),i._state},this.sendTo=function(e,t){var n,o=i.parent&&(t===L.Parent||i.parent.id===t),a=o?i.parent:T(t)?i.children.get(t)||rt(t):(n=t)&&"function"==typeof n.send?t:void 0;if(a)"machine"in a?a.send(r(r({},e),{name:e.name===ne?""+Ee(i.id):e.name,origin:i.sessionId})):a.send(e.data);else if(!o)throw new Error("Unable to send event to child '"+t+"' from service '"+i.id+"'.")};var o=r(r({},e.defaultOptions),n),a=o.clock,s=o.logger,u=o.parent,l=o.id,c=void 0!==l?l:t.id;this.id=c,this.logger=s,this.clock=a,this.parent=u,this.options=o,this.scheduler=new Je({deferEvents:this.options.deferEvents}),this.sessionId=tt()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:ze(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=o(e.actions),a=i.next();!a.done;a=i.next()){var s=a.value;this.exec(s,e,t)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,s,u,l,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.options.execute&&this.execute(this.state),this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var f=o(this.eventListeners),h=f.next();!h.done;h=f.next()){(0,h.value)(e.event)}}catch(k){n={error:k}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var p=o(this.listeners),v=p.next();!v.done;v=p.next()){(0,v.value)(e,e.event)}}catch(S){i={error:S}}finally{try{v&&!v.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}try{for(var g=o(this.contextListeners),y=g.next();!y.done;y=g.next()){(0,y.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(P){s={error:P}}finally{try{y&&!y.done&&(u=g.return)&&u.call(g)}finally{if(s)throw s.error}}var m=Me(e.configuration||[],this.machine);if(this.state.configuration&&m){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),x=b&&b.doneData?E(b.doneData,e.context,t):void 0;try{for(var w=o(this.doneListeners),_=w.next();!_.done;_=w.next()){(0,_.value)(_e(this.id,x))}}catch(C){l={error:C}}finally{try{_&&!_.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}this.stop()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===ut.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r,i=this;if(!e)return{unsubscribe:function(){}};var o=n;return"function"==typeof e?r=e:(r=e.next.bind(e),o=e.complete.bind(e)),this.listeners.add(r),this.status===ut.Running&&r(this.state),o&&this.onDone(o),{unsubscribe:function(){r&&i.listeners.delete(r),o&&i.doneListeners.delete(o)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===ut.Running)return this;nt(this.sessionId,this),this.initialized=!0,this.status=ut.Running;var n=void 0===e?this.initialState:ze(this,(function(){return!T(n=e)&&"value"in n&&"history"in n?t.machine.resolveState(e):t.machine.resolveState(Ie.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,ae)})),this},e.prototype.stop=function(){var e,t,n,r,i,a,s,u,l,d,f=this;try{for(var h=o(this.listeners),p=h.next();!p.done;p=h.next()){var v=p.value;this.listeners.delete(v)}}catch(S){e={error:S}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var g=o(this.stopListeners),y=g.next();!y.done;y=g.next()){(v=y.value)(),this.stopListeners.delete(v)}}catch(P){n={error:P}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}try{for(var m=o(this.contextListeners),b=m.next();!b.done;b=m.next()){v=b.value;this.contextListeners.delete(v)}}catch(C){i={error:C}}finally{try{b&&!b.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var x=o(this.doneListeners),w=x.next();!w.done;w=x.next()){v=w.value;this.doneListeners.delete(v)}}catch(j){s={error:j}}finally{try{w&&!w.done&&(u=x.return)&&u.call(x)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.state.configuration.forEach((function(e){var t,n;try{for(var r=o(e.definition.exit),i=r.next();!i.done;i=r.next()){var a=i.value;f.exec(a,f.state)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}})),this.children.forEach((function(e){O(e.stop)&&e.stop()}));try{for(var _=o(c(this.delayedEventsMap)),E=_.next();!E.done;E=_.next()){var k=E.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(D){l={error:D}}finally{try{E&&!E.done&&(d=_.return)&&d.call(_)}finally{if(l)throw l.error}}return this.scheduler.clear(),this.initialized=!1,this.status=ut.Stopped,it(this.sessionId),this},e.prototype.batch=function(e){var t=this;if(this.status===ut.NotStarted&&this.options.deferEvents)0;else if(this.status!==ut.Running)throw new Error(e.length+' event(s) were sent to uninitialized service "'+this.machine.id+'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.');this.scheduler.schedule((function(){var n,i,u=t.state,l=!1,c=[],d=function(e){var n=z(e);t.forward(n),u=ze(t,(function(){return t.machine.transition(u,n)})),c.push.apply(c,s([],a(u.actions.map((function(e){return n=u,i=(t=e).exec,r(r({},t),{exec:void 0!==i?function(){return i(n.context,n.event,{action:t,state:n,_event:n._event})}:void 0});var t,n,i}))))),l=l||!!u.changed};try{for(var f=o(e),h=f.next();!h.done;h=f.next()){d(h.value)}}catch(p){n={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}u.changed=l,u.actions=c,t.update(u,z(e[e.length-1]))}))},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype.nextState=function(e){var t=this,n=z(e);if(0===n.name.indexOf(te)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(te)})))throw n.data.data;return ze(this,(function(){return t.machine.transition(t.state,n)}))},e.prototype.forward=function(e){var t,n;try{for(var r=o(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '"+e+"' from interpreter '"+this.id+"' to nonexistant child '"+a+"'.");s.send(e)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this;this.delayedEventsMap[e.id]=this.clock.setTimeout((function(){e.to?t.sendTo(e._event,e.to):t.send(e._event)}),e.delay)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions);var r=t.context,i=t._event,o=e.exec||se(e.type,n),a=O(o)?o:o?o.exec:e.exec;if(a)try{return a(r,i.data,{action:e,state:this.state,_event:i})}catch(b){throw this.parent&&this.parent.send({type:"xstate.error",data:b}),b}switch(e.type){case X:var s=e;if("number"==typeof s.delay)return void this.defer(s);s.to?this.sendTo(s._event,s.to):this.send(s._event);break;case K:this.cancel(e.sendId);break;case W:var u=e.activity;if(!this.state.activities[u.id||u.type])break;if(u.type===B.Invoke){var l=G(u.src),c=this.machine.options.services?this.machine.options.services[l.type]:void 0,d=u.id,f=u.data;0;var h="autoForward"in u?u.autoForward:!!u.forward;if(!c)return void 0;var p=f?E(f,r,i):void 0;if("string"==typeof c)return;var v=O(c)?c(r,i.data,{data:p,src:l,meta:u.meta}):c;if(!v)return;var g=void 0;M(v)&&(v=p?v.withContext(p):v,g={autoForward:h}),this.spawn(v,d,g)}else this.spawnActivity(u);break;case H:this.stopChild(e.activity.id);break;case J:var y=e.label,m=e.value;y?this.logger(y,m):this.logger(m)}},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),O(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(k(e))return this.spawnPromise(Promise.resolve(e),t);if(O(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(t){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&O(e.subscribe)}catch(t){return!1}}(e))return this.spawnObservable(e,t);if(M(e))return this.spawnMachine(e,r(r({},n),{id:t}));if(null!==(i=e)&&"object"==typeof i&&"transition"in i&&"function"==typeof i.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'+t+'" of type "'+typeof e+'".');var i,o},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var o=new e(t,r(r({},this.options),{parent:this,id:n.id||t.id})),a=r(r({},lt),n);a.sync&&o.onTransition((function(e){i.send(re,{state:e,id:o.id})}));var s=o;return this.children.set(o.id,s),a.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){i.removeChild(o.id),i.send(z(e,{origin:o.id}))})).start(),s},e.prototype.spawnBehavior=function(e,t){var n=st(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r=this,i=!1;e.then((function(e){i||(n=e,r.removeChild(t),r.send(z(_e(t,e),{origin:t})))}),(function(e){if(!i){r.removeChild(t);var n=Ee(t,e);try{r.send(z(n,{origin:t}))}catch(ne){r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}}));var o={id:t,send:function(){},subscribe:function(t,n,r){var i=Y(t,n,r),o=!1;return e.then((function(e){o||(i.next(e),o||i.complete())}),(function(e){o||i.error(e)})),{unsubscribe:function(){return o=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return n}};return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r,i=this,o=!1,a=new Set,s=new Set;try{r=e((function(e){n=e,s.forEach((function(t){return t(e)})),o||i.send(z(e,{origin:t}))}),(function(e){a.add(e)}))}catch(l){this.send(Ee(t,l))}if(k(r))return this.spawnPromise(r,t);var u={id:t,send:function(e){return a.forEach((function(t){return t(e)}))},subscribe:function(e){return s.add(e),{unsubscribe:function(){s.delete(e)}}},stop:function(){o=!0,O(r)&&r()},toJSON:function(){return{id:t}},getSnapshot:function(){return n}};return this.children.set(t,u),u},e.prototype.spawnObservable=function(e,t){var n,r=this,i=e.subscribe((function(e){n=e,r.send(z(e,{origin:t}))}),(function(e){r.removeChild(t),r.send(z(Ee(t,e),{origin:t}))}),(function(){r.removeChild(t),r.send(z(_e(t),{origin:t}))})),o={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:t}}};return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}},e.prototype.spawnEffect=function(e,t){this.children.set(e,{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})},e.prototype.attachDev=function(){var e=ot();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(r(r({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:r({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}at(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[A]=function(){return this},e.prototype.getSnapshot=function(){return this.status===ut.NotStarted?this.initialState:this._state},e.defaultOptions=function(e){return{execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:e.console.log.bind(console),devTools:!1}}("undefined"!=typeof self?self:global),e.interpret=ft,e}();function dt(e,t){var n=function(e){return T(e)?r(r({},lt),{name:e}):r(r(r({},lt),{name:I()}),e)}(t);return function(t){return t?t.spawn(e,n.name,n):Ve(e,n.name)}(Re[Re.length-1])}function ft(e,t){return new ct(e,t)}function ht(e,t,n){var r,i,s=Ie.from(e,e instanceof Ie?e.context:void 0);try{for(var u=o(t),l=u.next();!l.done;l=u.next()){var c=a(l.value,2),d=c[0],f=c[1];if(s.matches(d))return f(s)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return n(s)}function pt(e){return e}var vt={raise:de,send:fe,sendParent:he,sendUpdate:pe,log:function(e,t){return void 0===e&&(e=ve),{type:J,label:t,expr:e}},cancel:ge,start:ye,stop:me,assign:be,after:xe,done:we,respond:function(e,t){return fe(e,r(r({},t),{to:function(e,t,n){return n._event.origin}}))},forwardTo:ke,escalate:function(e,t){return he((function(t,n,r){return{type:ne,data:O(e)?e(t,n,r):e}}),r(r({},t),{to:L.Parent}))},choose:function(e){return{type:B.Choose,conds:e}},pure:function(e){return{type:B.Pure,get:e}}}},aora:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("VQ03"),i=n("4K4U"),o=n("IW9A");function a(e){return{id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}}}function s(e,t,n){var r=a(t);if(r.deferred=!0,i.isMachine(e)){var s=r.state=o.provide(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return s}}return r}function u(e){try{return"function"==typeof e.send}catch(t){return!1}}t.createDeferredActor=s,t.createInvocableActor=function(e,t,n,r){var o,u=i.toInvokeSource(e.src),l=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[u.type],c=e.data?i.mapContext(e.data,n,r):void 0,d=l?s(l,e.id,c):a(e.id);return d.meta=e,d},t.createNullActor=a,t.isActor=u,t.isSpawnedActor=function(e){return u(e)&&"id"in e},t.toActorRef=function(e){return r.__assign({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e)}},VQ03:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.__assign.apply(this,arguments)},t.__read=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},t.__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},t.__spreadArray=function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},t.__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}},Oshl:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("vMs3"),i=r.ActionTypes.Start,o=r.ActionTypes.Stop,a=r.ActionTypes.Raise,s=r.ActionTypes.Send,u=r.ActionTypes.Cancel,l=r.ActionTypes.NullEvent,c=r.ActionTypes.Assign,d=r.ActionTypes.After,f=r.ActionTypes.DoneState,h=r.ActionTypes.Log,p=r.ActionTypes.Init,v=r.ActionTypes.Invoke,g=r.ActionTypes.ErrorExecution,y=r.ActionTypes.ErrorPlatform,m=r.ActionTypes.ErrorCustom,b=r.ActionTypes.Update,x=r.ActionTypes.Choose,w=r.ActionTypes.Pure;t.after=d,t.assign=c,t.cancel=u,t.choose=x,t.doneState=f,t.error=m,t.errorExecution=g,t.errorPlatform=y,t.init=p,t.invoke=v,t.log=h,t.nullEvent=l,t.pure=w,t.raise=a,t.send=s,t.start=i,t.stop=o,t.update=b},Mgrw:(e,t,n)=>{"use strict";n("JMJn");var r=n("4K4U");n("vMs3"),n("Oshl");var i=n("aora")},XmYR:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DEFAULT_GUARD_TYPE="xstate.guard",t.EMPTY_ACTIVITY_MAP={},t.STATE_DELIMITER=".",t.TARGETLESS_KEY=""},JMJn:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IS_PRODUCTION=!0},IW9A:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=[];t.consume=function(e){return e(n[n.length-1])},t.provide=function(e,t){n.push(e);var r=t(e);return n.pop(),r}},vMs3:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.ActionTypes||(t.ActionTypes={})).Start="xstate.start",n.Stop="xstate.stop",n.Raise="xstate.raise",n.Send="xstate.send",n.Cancel="xstate.cancel",n.NullEvent="",n.Assign="xstate.assign",n.After="xstate.after",n.DoneState="done.state",n.DoneInvoke="done.invoke",n.Log="xstate.log",n.Init="xstate.init",n.Invoke="xstate.invoke",n.ErrorExecution="error.execution",n.ErrorCommunication="error.communication",n.ErrorPlatform="error.platform",n.ErrorCustom="xstate.error",n.Update="xstate.update",n.Pure="xstate.pure",n.Choose="xstate.choose",(r=t.SpecialTargets||(t.SpecialTargets={})).Parent="#_parent",r.Internal="#_internal"},"4K4U":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("VQ03"),i=n("XmYR"),o=n("JMJn");function a(e){return Object.keys(e)}function s(e,t){try{return g(e)?e:e.toString().split(t)}catch(n){throw new Error("'"+e+"' is not a valid state path.")}}function u(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function l(e,t){return u(e)?e.value:g(e)?c(e):"string"!=typeof e?e:c(s(e,t))}function c(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function d(e,t){for(var n={},r=a(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function f(e){var t;return(t=[]).concat.apply(t,r.__spreadArray([],r.__read(e)))}function h(e){return g(e)?e:[e]}function p(e){return void 0===e?[]:h(e)}function v(e,t){return d(e.states,(function(e,n){if(e){var r=(m(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:v(e,r)}}}))}function g(e){return Array.isArray(e)}function y(e){return"function"==typeof e}function m(e){return"string"==typeof e}t.warn=function(){},o.IS_PRODUCTION||(t.warn=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: "+t];n&&r.push(n),console.warn.apply(console,r)}});var b=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function x(e){try{return"__xstatenode"in e}catch(t){return!1}}var w=function(){var e=0;return function(){return(++e).toString(16)}}();function _(e,t){return m(e)||"number"==typeof e?r.__assign({type:e},t):e}t.evaluateGuard=function(e,t,n,r,o){var a=e.options.guards,s={state:o,cond:t,_event:r};if(t.type===i.DEFAULT_GUARD_TYPE)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var u=a[t.type];if(!u)throw new Error("Guard '"+t.type+"' is not implemented on machine '"+e.id+"'.");return u(n,r.data,s)},t.flatten=f,t.getEventType=function(e){try{return m(e)||"number"==typeof e?""+e:e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}},t.isActor=function(e){return!!e&&"function"==typeof e.send},t.isArray=g,t.isBehavior=function(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition},t.isBuiltInEvent=function(e){return/^(done|error)\./.test(e)},t.isFunction=y,t.isMachine=x,t.isObservable=function(e){try{return"subscribe"in e&&y(e.subscribe)}catch(t){return!1}},t.isPromiseLike=function(e){return e instanceof Promise||!(null===e||!y(e)&&"object"!=typeof e||!y(e.then))},t.isStateLike=u,t.isString=m,t.keys=a,t.mapContext=function(e,t,n){var i,o;if(y(e))return e(t,n.data);var a={};try{for(var s=r.__values(Object.keys(e)),u=s.next();!u.done;u=s.next()){var l=u.value,c=e[l];y(c)?a[l]=c(t,n.data):a[l]=c}}catch(d){i={error:d}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a},t.mapFilterValues=function(e,t,n){var i,o,s={};try{for(var u=r.__values(a(e)),l=u.next();!l.done;l=u.next()){var c=l.value,d=e[c];n(d)&&(s[c]=t(d,c,e))}}catch(f){i={error:f}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return s},t.mapValues=d,t.matchesState=function e(t,n,r){void 0===r&&(r=i.STATE_DELIMITER);var o=l(t,r),s=l(n,r);return m(s)?!!m(o)&&s===o:m(o)?o in s:a(o).every((function(t){return t in s&&e(o[t],s[t])}))},t.nestedPath=function(e,t){return function(n){var i,o,a=n;try{for(var s=r.__values(e),u=s.next();!u.done;u=s.next()){var l=u.value;a=a[t][l]}}catch(c){i={error:c}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}},t.normalizeTarget=function(e){if(void 0!==e&&e!==i.TARGETLESS_KEY)return p(e)},t.partition=function(e,t){var n,i,o=r.__read([[],[]],2),a=o[0],s=o[1];try{for(var u=r.__values(e),l=u.next();!l.done;l=u.next()){var c=l.value;t(c)?a.push(c):s.push(c)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return[a,s]},t.path=function(e){return function(t){var n,i,o=t;try{for(var a=r.__values(e),s=a.next();!s.done;s=a.next()){o=o[s.value]}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}},t.pathToStateValue=c,t.reportUnhandledExceptionOnInvocation=function(e,t,n){if(!o.IS_PRODUCTION){var r=e.stack?" Stacktrace was '"+e.stack+"'":"";if(e===t)console.error("Missing onError handler for invocation '"+n+"', error was '"+e+"'."+r);else{var i=t.stack?" Stacktrace was '"+t.stack+"'":"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '"+n+"'. Original error: '"+e+"'. "+r+" Current error is '"+t+"'."+i)}}},t.symbolObservable=b,t.toArray=p,t.toArrayStrict=h,t.toEventObject=_,t.toGuard=function(e,t){if(e)return m(e)?{type:i.DEFAULT_GUARD_TYPE,name:e,predicate:t?t[e]:void 0}:y(e)?{type:i.DEFAULT_GUARD_TYPE,name:e.name,predicate:e}:e},t.toInvokeSource=function(e){return"string"==typeof e?{type:e}:e},t.toObserver=function(e,t,n){if("object"==typeof e)return e;var r=function(){};return{next:e,error:t||r,complete:n||r}},t.toSCXMLEvent=function(e,t){if(!m(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=_(e);return r.__assign({name:n.type,data:n,$$type:"scxml",type:"external"},t)},t.toStatePath=s,t.toStatePaths=function e(t){return t?m(t)?[[t]]:f(a(t).map((function(n){var r=t[n];return"string"==typeof r||r&&Object.keys(r).length?e(t[n]).map((function(e){return[n].concat(e)})):[[n]]}))):[[]]},t.toStateValue=l,t.toTransitionConfigArray=function(e,t){return h(t).map((function(t){return void 0===t||"string"==typeof t||x(t)?{target:t,event:e}:r.__assign(r.__assign({},t),{event:e})}))},t.uniqueId=w,t.updateContext=function(e,n,i,s){return o.IS_PRODUCTION||t.warn(!!e,"Attempting to update undefined context"),e?i.reduce((function(e,t){var i,o,u=t.assignment,l={state:s,action:t,_event:n},c={};if(y(u))c=u(e,n.data,l);else try{for(var d=r.__values(a(u)),f=d.next();!f.done;f=d.next()){var h=f.value,p=u[h];c[h]=y(p)?p(e,n.data,l):p}}catch(v){i={error:v}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}return Object.assign({},e,c)}),e):e},t.updateHistoryStates=v,t.updateHistoryValue=function(e,t){return{current:t,states:v(e,t)}}}},e=>{var t;t="ibCq",e(e.s=t)}]);