main.js 799 KB

1
  1. (self.webpackChunk=self.webpackChunk||[]).push([[0],{7645:(e,t,n)=>{"use strict";n.r(t);var r=n(33286),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)};var o=n(26916),a=n(14487),s=(n(71125),n(93884)),l=n(92185),u=n(4329),c=n.n(u);n(64e3);function d(e){return"function"==typeof e?e():e}function f(e,t){try{return JSON.stringify(e,t)}catch(w){return c()(e,t)}}function h(e,t,n){var r,o,a={};try{for(var s=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.")}(t),l=s.next();!l.done;l=s.next()){var u=l.value;a[u]=e[u]}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var c=JSON.parse(f(a,n));return f(i(i({},e),c))}function p(e,t){e.machine,e.configuration,e.history;var n=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}(e,["machine","configuration","history"]);return h(n,["context","event","_event"],t)}function v(e,t){return h(e.definition,["context"],t)}var m=new Map;var g={url:"https://stately.ai/viz?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),m.set(n.sessionId,n),t.forEach((function(e){return e(n)})),n.onStop((function(){e.delete(n),m.delete(n.sessionId)}))},unregister:function(t){e.delete(t),m.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},serialize:void 0},y=new Set;new WeakMap,new WeakMap;var b="undefined"==typeof Element;b||Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,!b&&Element.prototype.getRootNode;function x(e){return e.split("-")[1]}function w(e){return"y"===e?"height":"width"}function _(e){return e.split("-")[0]}function E(e){return["top","bottom"].includes(_(e))?"x":"y"}function k(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=E(t),l=w(s),u=r[l]/2-i[l]/2,c="x"===s;let d;switch(_(t)){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(x(t)){case"start":d[s]-=u*(n&&c?-1:1);break;case"end":d[s]+=u*(n&&c?-1:1)}return d}const N=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=k(u,r,l),f=r,h={},p=0;for(let v=0;v<s.length;v++){const{name:n,fn:o}=s[v],{x:m,y:g,data:y,reset:b}=await o({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});c=null!=m?m:c,d=null!=g?g:d,h={...h,[n]:{...h[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(u=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:d}=k(u,f,l))),v=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};function S(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function P(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function C(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=t,p=S(h),v=s[f?"floating"===d?"reference":"floating":d],m=P(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g="floating"===d?{...a.floating,x:r,y:i}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},x=P(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-x.top+p.top)/b.y,bottom:(x.bottom-m.bottom+p.bottom)/b.y,left:(m.left-x.left+p.left)/b.x,right:(x.right-m.right+p.right)/b.x}}const T=Math.min,j=Math.max;function D(e,t,n){return j(e,T(t,n))}const O=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(null==n)return{};const u=S(r),c={x:i,y:o},d=E(a),f=w(d),h=await l.getDimensions(n),p="y"===d?"top":"left",v="y"===d?"bottom":"right",m=s.reference[f]+s.reference[d]-c[d]-s.floating[f],g=c[d]-s.reference[d],y=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let b=y?"y"===d?y.clientHeight||0:y.clientWidth||0:0;0===b&&(b=s.floating[f]);const _=m/2-g/2,k=u[p],N=b-h[f]-u[v],P=b/2-h[f]/2+_,C=D(k,P,N),T=null!=x(a)&&P!=C&&s.reference[f]/2-(P<k?u[p]:u[v])-h[f]/2<0;return{[d]:c[d]-(T?P<k?k-P:N-P:0),data:{[d]:C,centerOffset:P-C}}}}),A=["top","right","bottom","left"],M=(A.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function R(e){return e.replace(/left|right|bottom|top/g,(e=>M[e]))}function I(e,t,n){void 0===n&&(n=!1);const r=x(e),i=E(e),o=w(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=R(a)),{main:a,cross:R(a)}}const L={start:"end",end:"start"};function B(e){return e.replace(/start|end/g,(e=>L[e]))}const F=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=e,m=_(r),g=_(a)===a,y=await(null==s.isRTL?void 0:s.isRTL(l.floating)),b=d||(g||!p?[R(a)]:function(e){const t=R(e);return[B(e),t,B(t)]}(a));d||"none"===h||b.push(...function(e,t,n,r){const i=x(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}(_(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(B)))),o}(a,p,h,y));const w=[a,...b],E=await C(t,v),k=[];let N=(null==(n=i.flip)?void 0:n.overflows)||[];if(u&&k.push(E[m]),c){const{main:e,cross:t}=I(r,o,y);k.push(E[e],E[t])}if(N=[...N,{placement:r,overflows:k}],!k.every((e=>e<=0))){var S,P;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:N},reset:{placement:t}};let n=null==(P=N.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=N.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=_(n),s=x(n),l="x"===E(n),u=["left","top"].includes(a)?-1:1,c=o&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function V(e){return"x"===e?"y":"x"}const G=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,u={x:n,y:r},c=await C(t,l),d=E(_(i)),f=V(d);let h=u[d],p=u[f];if(o){const e="y"===d?"bottom":"right";h=D(h+c["y"===d?"top":"left"],h,h-c[e])}if(a){const e="y"===f?"bottom":"right";p=D(p+c["y"===f?"top":"left"],p,p-c[e])}const v=s.fn({...t,[d]:h,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function U(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function W(e){return U(e).getComputedStyle(e)}const q=Math.min,H=Math.max,Y=Math.round;function X(e){const t=W(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=Y(n)!==i||Y(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function $(e){return ee(e)?(e.nodeName||"").toLowerCase():""}let K;function Z(){if(K)return K;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(K=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),K):navigator.userAgent}function Q(e){return e instanceof U(e).HTMLElement}function J(e){return e instanceof U(e).Element}function ee(e){return e instanceof U(e).Node}function te(e){return"undefined"!=typeof ShadowRoot&&(e instanceof U(e).ShadowRoot||e instanceof ShadowRoot)}function ne(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function re(e){return["table","td","th"].includes($(e))}function ie(e){const t=/firefox/i.test(Z()),n=W(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function oe(){return/^((?!chrome|android).)*safari/i.test(Z())}function ae(e){return["html","body","#document"].includes($(e))}function se(e){return J(e)?e:e.contextElement}const le={x:1,y:1};function ue(e){const t=se(e);if(!Q(t))return le;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=X(t);let a=(o?Y(n.width):n.width)/r,s=(o?Y(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function ce(e,t,n,r){var i,o;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=se(e);let l=le;t&&(r?J(r)&&(l=ue(r)):l=ue(e));const u=s?U(s):window,c=oe()&&n;let d=(a.left+(c&&(null==(i=u.visualViewport)?void 0:i.offsetLeft)||0))/l.x,f=(a.top+(c&&(null==(o=u.visualViewport)?void 0:o.offsetTop)||0))/l.y,h=a.width/l.x,p=a.height/l.y;if(s){const e=U(s),t=r&&J(r)?U(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ue(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,h*=e.x,p*=e.y,d+=t.x,f+=t.y,n=U(n).frameElement}}return{width:h,height:p,top:f,right:d+h,bottom:f+p,left:d,x:d,y:f}}function de(e){return((ee(e)?e.ownerDocument:e.document)||window.document).documentElement}function fe(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function he(e){return ce(de(e)).left+fe(e).scrollLeft}function pe(e){if("html"===$(e))return e;const t=e.assignedSlot||e.parentNode||te(e)&&e.host||de(e);return te(t)?t.host:t}function ve(e){const t=pe(e);return ae(t)?t.ownerDocument.body:Q(t)&&ne(t)?t:ve(t)}function me(e,t){var n;void 0===t&&(t=[]);const r=ve(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=U(r);return i?t.concat(o,o.visualViewport||[],ne(r)?r:[]):t.concat(r,me(r))}function ge(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=U(e),r=de(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=oe();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=de(e),n=fe(e),r=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+he(e);const s=-n.scrollTop;return"rtl"===W(r).direction&&(a+=H(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}(de(e));else if(J(t))r=function(e,t){const n=ce(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Q(e)?ue(e):{x:1,y:1};return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n={...t};if(oe()){var i,o;const t=U(e);n.x-=(null==(i=t.visualViewport)?void 0:i.offsetLeft)||0,n.y-=(null==(o=t.visualViewport)?void 0:o.offsetTop)||0}r=n}return P(r)}function ye(e,t){return Q(e)&&"fixed"!==W(e).position?t?t(e):e.offsetParent:null}function be(e,t){const n=U(e);let r=ye(e,t);for(;r&&re(r)&&"static"===W(r).position;)r=ye(r,t);return r&&("html"===$(r)||"body"===$(r)&&"static"===W(r).position&&!ie(r))?n:r||function(e){let t=pe(e);for(;Q(t)&&!ae(t);){if(ie(t))return t;t=pe(t)}return null}(e)||n}function xe(e,t,n){const r=Q(t),i=de(t),o=ce(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==$(t)||ne(i))&&(a=fe(t)),Q(t)){const e=ce(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=he(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const we={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=me(e).filter((e=>J(e)&&"body"!==$(e))),i=null;const o="fixed"===W(e).position;let a=o?pe(e):e;for(;J(a)&&!ae(a);){const e=W(a),t=ie(a);"fixed"===e.position?i=null:(o?t||i:t||"static"!==e.position||!i||!["absolute","fixed"].includes(i.position))?i=e:r=r.filter((e=>e!==a)),a=pe(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...o,r],s=a[0],l=a.reduce(((e,n)=>{const r=ge(t,n,i);return e.top=H(r.top,e.top),e.right=q(r.right,e.right),e.bottom=q(r.bottom,e.bottom),e.left=H(r.left,e.left),e}),ge(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Q(n),o=de(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==$(n)||ne(o))&&(a=fe(n)),Q(n))){const e=ce(n);s=ue(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:J,getDimensions:function(e){return Q(e)?X(e):e.getBoundingClientRect()},getOffsetParent:be,getDocumentElement:de,getScale:ue,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||be,o=this.getDimensions;return{reference:xe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===W(e).direction};function _e(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=l||o?[...J(e)?me(e):e.contextElement?me(e.contextElement):[],...me(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));let c,d=null;if(a){let r=!0;d=new ResizeObserver((()=>{r||n(),r=!1})),J(e)&&!s&&d.observe(e),J(e)||!e.contextElement||s||d.observe(e.contextElement),d.observe(t)}let f=s?ce(e):null;return s&&function t(){const r=ce(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n(),f=r,c=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(c)}}const Ee=(e,t,n)=>{const r=new Map,i={platform:we,...n},o={...i.platform,_c:r};return N(e,t,{...i,platform:o})},ke=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){return r=t,Object.prototype.hasOwnProperty.call(r,"current")?null!=t.current?O({element:t.current,padding:n}).fn(e):{}:t?O({element:t,padding:n}).fn(e):{};var r}}};var Ne="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function Se(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Se(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(("_owner"!==n||!e.$$typeof)&&!Se(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Pe(e){const t=r.useRef(e);return Ne((()=>{t.current=e})),t}var Ce="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;let Te=!1,je=0;const De=()=>"floating-ui-"+je++;const Oe=r["useId".toString()]||function(){const[e,t]=r.useState((()=>Te?De():void 0));return Ce((()=>{null==e&&t(De())}),[]),r.useEffect((()=>{Te||(Te=!0)}),[]),e};function Ae(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter((e=>e!==n)))}}}const Me=r.createContext(null),Re=r.createContext(null),Ie=()=>{var e;return(null==(e=r.useContext(Me))?void 0:e.id)||null},Le=()=>r.useContext(Re);function Be(e){return(null==e?void 0:e.ownerDocument)||document}function Fe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ze(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Ve(e){return Be(e).defaultView||window}function Ge(e){return!!e&&e instanceof Ve(e).Element}function Ue(e){return!!e&&e instanceof Ve(e).HTMLElement}function We(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Fe())||t.test(ze()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function qe(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function He(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ye(e){const t=(0,r.useRef)(e);return Ce((()=>{t.current=e})),t}const Xe="data-floating-ui-safe-polygon";function $e(e,t,n){return n&&!He(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Ke=function(e,t){let{enabled:n=!0,delay:i=0,handleClose:o=null,mouseOnly:a=!1,restMs:s=0,move:l=!0}=void 0===t?{}:t;const{open:u,onOpenChange:c,dataRef:d,events:f,elements:{domReference:h,floating:p},refs:v}=e,m=Le(),g=Ie(),y=Ye(o),b=Ye(i),x=r.useRef(),w=r.useRef(),_=r.useRef(),E=r.useRef(),k=r.useRef(!0),N=r.useRef(!1),S=r.useRef((()=>{})),P=r.useCallback((()=>{var e;const t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[d]);r.useEffect((()=>{if(n)return f.on("dismiss",e),()=>{f.off("dismiss",e)};function e(){clearTimeout(w.current),clearTimeout(E.current),k.current=!0}}),[n,f]),r.useEffect((()=>{if(!n||!y.current||!u)return;function e(){P()&&c(!1)}const t=Be(p).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[p,u,c,n,y,d,P]);const C=r.useCallback((function(e){void 0===e&&(e=!0);const t=$e(b.current,"close",x.current);t&&!_.current?(clearTimeout(w.current),w.current=setTimeout((()=>c(!1)),t)):e&&(clearTimeout(w.current),c(!1))}),[b,c]),T=r.useCallback((()=>{S.current(),_.current=void 0}),[]),j=r.useCallback((()=>{if(N.current){const e=Be(v.floating.current).body;e.style.pointerEvents="",e.removeAttribute(Xe),N.current=!1}}),[v]);return r.useEffect((()=>{if(n&&Ge(h)){const e=h;return u&&e.addEventListener("mouseleave",o),null==p||p.addEventListener("mouseleave",o),l&&e.addEventListener("mousemove",r,{once:!0}),e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",i),()=>{u&&e.removeEventListener("mouseleave",o),null==p||p.removeEventListener("mouseleave",o),l&&e.removeEventListener("mousemove",r),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",i)}}function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(w.current),k.current=!1,a&&!He(x.current)||s>0&&0===$e(b.current,"open"))return;d.current.openEvent=e;const t=$e(b.current,"open",x.current);t?w.current=setTimeout((()=>{c(!0)}),t):c(!0)}function i(n){if(t())return;S.current();const r=Be(p);if(clearTimeout(E.current),y.current){u||clearTimeout(w.current),_.current=y.current({...e,tree:m,x:n.clientX,y:n.clientY,onClose(){j(),T(),C()}});const t=_.current;return r.addEventListener("mousemove",t),void(S.current=()=>{r.removeEventListener("mousemove",t)})}C()}function o(n){t()||null==y.current||y.current({...e,tree:m,x:n.clientX,y:n.clientY,onClose(){j(),T(),C()}})(n)}}),[h,p,n,e,a,s,l,C,T,j,c,u,m,b,y,d]),Ce((()=>{var e;if(n&&u&&null!=(e=y.current)&&e.__options.blockPointerEvents&&P()){const e=Be(p).body;if(e.setAttribute(Xe,""),e.style.pointerEvents="none",N.current=!0,Ge(h)&&p){var t,r;const e=h,n=null==m||null==(t=m.nodesRef.current.find((e=>e.id===g)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",p.style.pointerEvents="auto",()=>{e.style.pointerEvents="",p.style.pointerEvents=""}}}}),[n,u,g,p,h,m,y,d,P]),Ce((()=>{u||(x.current=void 0,T(),j())}),[u,T,j]),r.useEffect((()=>()=>{T(),clearTimeout(w.current),clearTimeout(E.current),j()}),[n,T,j]),r.useMemo((()=>{if(!n)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(){u||0===s||(clearTimeout(E.current),E.current=setTimeout((()=>{k.current||c(!0)}),s))}},floating:{onMouseEnter(){clearTimeout(w.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),C(!1)}}}}),[f,n,s,u,c,C])};function Ze(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}))||[],r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))}))||[],n=n.concat(r);return n}function Qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Je="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function et(e){return Ue(e)&&e.matches(Je)}const tt=r["useInsertionEffect".toString()]||(e=>e());function nt(e){const t=r.useRef((()=>{throw new Error("Cannot call an event handler while rendering.")}));return tt((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function rt(e){return Ue(e.target)&&"BUTTON"===e.target.tagName}function it(e){return et(e)}const ot=function(e,t){let{open:n,onOpenChange:i,dataRef:o,elements:{domReference:a}}=e,{enabled:s=!0,event:l="click",toggle:u=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0}=void 0===t?{}:t;const f=r.useRef();return r.useMemo((()=>s?{reference:{onPointerDown(e){f.current=e.pointerType},onMouseDown(e){0===e.button&&(He(f.current,!0)&&c||"click"!==l&&(n?!u||o.current.openEvent&&"mousedown"!==o.current.openEvent.type||i(!1):(e.preventDefault(),i(!0)),o.current.openEvent=e.nativeEvent))},onClick(e){o.current.__syncReturnFocus||("mousedown"===l&&f.current?f.current=void 0:He(f.current,!0)&&c||(n?!u||o.current.openEvent&&"click"!==o.current.openEvent.type||i(!1):i(!0),o.current.openEvent=e.nativeEvent))},onKeyDown(e){f.current=void 0,d&&(rt(e)||(" "!==e.key||it(a)||e.preventDefault(),"Enter"===e.key&&(n?u&&i(!1):i(!0))))},onKeyUp(e){d&&(rt(e)||it(a)||" "===e.key&&(n?u&&i(!1):i(!0)))}}}:{}),[s,o,l,c,d,a,u,n,i])};function at(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}const st={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},lt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ut=function(e,t){let{open:n,onOpenChange:i,events:o,nodeId:a,elements:{reference:s,domReference:l,floating:u},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:g=!1,bubbles:y=!0}=void 0===t?{}:t;const b=Le(),x=null!=Ie(),w=nt("function"==typeof h?h:()=>!1),_="function"==typeof h?w:h,E=r.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:N}=function(e){var t,n;return void 0===e&&(e=!0),{escapeKeyBubbles:"boolean"==typeof e?e:null==(t=e.escapeKey)||t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=e.outsidePress)||n}}(y);return r.useEffect((()=>{if(!n||!d)return;function e(e){if("Escape"===e.key){const e=b?Ze(b.nodesRef.current,a):[];if(e.length>0){let t=!0;if(e.forEach((e=>{var n;null==(n=e.context)||!n.open||e.context.dataRef.current.__escapeKeyBubbles||(t=!1)})),!t)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),i(!1)}}function t(e){const t=E.current;if(E.current=!1,t)return;if("function"==typeof _&&!_(e))return;const n=Qe(e);if(Ue(n)&&u){const t=u.ownerDocument.defaultView||window,r=n.scrollWidth>n.clientWidth,i=n.scrollHeight>n.clientHeight;let o=i&&e.offsetX>n.clientWidth;if(i){"rtl"===t.getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||r&&e.offsetY>n.clientHeight)return}const r=b&&Ze(b.nodesRef.current,a).some((t=>{var n;return at(e,null==(n=t.context)?void 0:n.elements.floating)}));if(at(e,u)||at(e,l)||r)return;const s=b?Ze(b.nodesRef.current,a):[];if(s.length>0){let e=!0;if(s.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:We(e)||qe(e)}}),i(!1)}function r(){i(!1)}c.current.__escapeKeyBubbles=k,c.current.__outsidePressBubbles=N;const h=Be(u);f&&h.addEventListener("keydown",e),_&&h.addEventListener(p,t);let v=[];return g&&(Ge(l)&&(v=me(l)),Ge(u)&&(v=v.concat(me(u))),!Ge(s)&&s&&s.contextElement&&(v=v.concat(me(s.contextElement)))),v=v.filter((e=>{var t;return e!==(null==(t=h.defaultView)?void 0:t.visualViewport)})),v.forEach((e=>{e.addEventListener("scroll",r,{passive:!0})})),()=>{f&&h.removeEventListener("keydown",e),_&&h.removeEventListener(p,t),v.forEach((e=>{e.removeEventListener("scroll",r)}))}}),[c,u,l,s,f,_,p,o,b,a,n,i,g,d,k,N,x]),r.useEffect((()=>{E.current=!1}),[_,p]),r.useMemo((()=>d?{reference:{[st[m]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),i(!1))}},floating:{[lt[p]]:()=>{E.current=!0}}}:{}),[d,o,v,p,m,i])};const ct=function(e,t){let{open:n}=e,{enabled:i=!0,role:o="dialog"}=void 0===t?{}:t;const a=Oe(),s=Oe();return r.useMemo((()=>{const e={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":n?a:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":n?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:s}},floating:{...e,..."menu"===o&&{"aria-labelledby":s}}}:{}}),[i,o,n,a,s])};function dt(e){void 0===e&&(e={});const{open:t=!1,onOpenChange:n,nodeId:i}=e,o=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:o,whileElementsMounted:a,open:s}=e,[l,u]=r.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,d]=r.useState(i);Se(c,i)||d(i);const f=r.useRef(null),h=r.useRef(null),p=r.useRef(l),v=Pe(a),m=Pe(o),[g,y]=r.useState(null),[b,x]=r.useState(null),w=r.useCallback((e=>{f.current!==e&&(f.current=e,y(e))}),[]),_=r.useCallback((e=>{h.current!==e&&(h.current=e,x(e))}),[]),E=r.useCallback((()=>{if(!f.current||!h.current)return;const e={placement:t,strategy:n,middleware:c};m.current&&(e.platform=m.current),Ee(f.current,h.current,e).then((e=>{const t={...e,isPositioned:!0};k.current&&!Se(p.current,t)&&(p.current=t,r.flushSync((()=>{u(t)})))}))}),[c,t,n,m]);Ne((()=>{!1===s&&p.current.isPositioned&&(p.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[s]);const k=r.useRef(!1);Ne((()=>(k.current=!0,()=>{k.current=!1})),[]),Ne((()=>{if(g&&b){if(v.current)return v.current(g,b,E);E()}}),[g,b,E,v]);const N=r.useMemo((()=>({reference:f,floating:h,setReference:w,setFloating:_})),[w,_]),S=r.useMemo((()=>({reference:g,floating:b})),[g,b]);return r.useMemo((()=>({...l,update:E,refs:N,elements:S,reference:w,floating:_})),[l,E,N,S,w,_])}(e),a=Le(),s=r.useRef(null),l=r.useRef({}),u=r.useState((()=>Ae()))[0],[c,d]=r.useState(null),f=r.useCallback((e=>{const t=Ge(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;o.refs.setReference(t)}),[o.refs]),h=r.useCallback((e=>{(Ge(e)||null===e)&&(s.current=e,d(e)),(Ge(o.refs.reference.current)||null===o.refs.reference.current||null!==e&&!Ge(e))&&o.refs.setReference(e)}),[o.refs]),p=r.useMemo((()=>({...o.refs,setReference:h,setPositionReference:f,domReference:s})),[o.refs,h,f]),v=r.useMemo((()=>({...o.elements,domReference:c})),[o.elements,c]),m=nt(n),g=r.useMemo((()=>({...o,refs:p,elements:v,dataRef:l,nodeId:i,events:u,open:t,onOpenChange:m})),[o,i,u,t,m,p,v]);return Ce((()=>{const e=null==a?void 0:a.nodesRef.current.find((e=>e.id===i));e&&(e.context=g)})),r.useMemo((()=>({...o,context:g,refs:p,reference:h,positionReference:f})),[o,p,g,h,f])}function ft(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var o;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(o=r.get(n))||o.push(i),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null==(e=r.get(n))||e.forEach((e=>e(...i)))})):e[n]=i})),e):e),{})}}const ht=function(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>ft(t,e,"reference")),t),i=r.useCallback((t=>ft(t,e,"floating")),t),o=r.useCallback((t=>ft(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:i,getItemProps:o})),[n,i,o])};var pt=n(75644),vt=0;function mt(e,t,n,r,i){var o,a,s={};for(a in t)"ref"==a?o=t[a]:s[a]=t[a];var l={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:--vt,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===s[a]&&(s[a]=o[a]);return pt.options.vnode&&pt.options.vnode(l),l}var gt="/Users/distiller/repo/graph/ui-tooltips/src/lib/tooltip.tsx";function yt({children:e,open:t=!1,content:n,placement:i="top",reference:o,openAction:a="click",strategy:s="absolute"}){const[l,u]=(0,r.useState)(t),c=(0,r.useRef)(null),{x:d,y:f,refs:h,strategy:p,placement:v,middlewareData:{arrow:{x:m,y:g}={}},context:y}=dt({placement:i,whileElementsMounted:"fixed"===s?_e:void 0,open:l,onOpenChange:u,strategy:s,middleware:[z(6),F(),G({padding:6}),ke({element:c})]}),b={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]]||"bottom";(0,r.useLayoutEffect)((()=>{o&&h.setReference(o)}),[h,o]);const x=ot(y,{enabled:"click"===a}),w=ut(y,{enabled:"click"===a,referencePress:!1,outsidePress:!0,outsidePressEvent:"mousedown"}),_=Ke(y,{enabled:"hover"===a}),E=ct(y,{role:"tooltip"}),{getReferenceProps:k,getFloatingProps:N}=ht([x,_,w,E]),S={ref:h.setReference,...k()};return mt(pt.Fragment,{children:[!o&&e?(0,r.cloneElement)(e,S):e,l?mt("div",{ref:h.setFloating,style:{position:p,top:f??0,left:d??0,width:"max-content"},className:"z-10 min-w-[250px] rounded-md border border-slate-500",...N(),children:[mt("div",{style:{left:null!=m?`${m}px`:"",top:null!=g?`${g}px`:"",right:"",bottom:"",[b]:"-4px"},className:"absolute -z-10 h-4 w-4 rotate-45 bg-slate-500",ref:c},void 0,!1,{fileName:gt,lineNumber:127,columnNumber:11}),mt("div",{className:"select-text rounded-md bg-white p-3 dark:bg-slate-900 dark:text-slate-400",children:n},void 0,!1,{fileName:gt,lineNumber:138,columnNumber:11})]},void 0,!0,{fileName:gt,lineNumber:116,columnNumber:9}):null]},void 0,!0)}const bt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"}))}));const xt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75L14.25 12m0 0l2.25 2.25M14.25 12l2.25-2.25M14.25 12L12 14.25m-2.58 4.92l-6.375-6.375a1.125 1.125 0 010-1.59L9.42 4.83c.211-.211.498-.33.796-.33H19.5a2.25 2.25 0 012.25 2.25v10.5a2.25 2.25 0 01-2.25 2.25h-9.284c-.298 0-.585-.119-.796-.33z"}))}));var wt="/Users/distiller/repo/graph/ui-components/src/lib/debounced-text-input.tsx";function _t({initialText:e,placeholderText:t,resetTextFilter:n,updateTextFilter:i}){const[o,a]=(0,r.useState)(e??""),[s,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,i]}(o,500);function u(e){""===e?(a(""),l(""),n()):a(e)}return(0,r.useEffect)((()=>{""!==s&&i(s)}),[s,i]),mt("form",{className:"group relative flex rounded-md shadow-sm",onSubmit:e=>e.preventDefault(),children:[mt("span",{className:"inline-flex items-center rounded-l-md border border-r-0 border-slate-300 bg-slate-50 p-2 dark:border-slate-900 dark:bg-slate-800",children:mt(bt,{className:"h-4 w-4"},void 0,!1,{fileName:wt,lineNumber:61,columnNumber:9})},void 0,!1,{fileName:wt,lineNumber:60,columnNumber:7}),mt("input",{type:"text",className:"block w-full flex-1 rounded-none rounded-r-md border border-slate-300 bg-white p-1.5 font-light text-slate-400 placeholder:font-light placeholder:text-slate-400 dark:border-slate-900 dark:bg-slate-800 dark:text-white dark:hover:bg-slate-700",placeholder:t,"data-cy":"textFilterInput",name:"filter",value:o,onKeyUp:function(e){"Enter"===e.key&&u(e.currentTarget.value)},onChange:e=>u(e.currentTarget.value)},void 0,!1,{fileName:wt,lineNumber:63,columnNumber:7}),o.length>0?mt("button",{"data-cy":"textFilterReset",type:"reset",onClick:function(){a(""),l(""),n()},className:"absolute top-1 right-1 inline-block rounded-md bg-slate-50 p-1 text-slate-400 dark:bg-slate-800",children:mt(xt,{className:"h-5 w-5"},void 0,!1,{fileName:wt,lineNumber:80,columnNumber:11})},void 0,!1,{fileName:wt,lineNumber:74,columnNumber:9}):null]},void 0,!0,{fileName:wt,lineNumber:56,columnNumber:5})}var Et="/Users/distiller/repo/graph/ui-components/src/lib/tag.tsx";function kt({className:e,children:t,...n}){return mt("span",{className:`${e} inline-block rounded-md bg-slate-300 p-2 font-sans text-xs font-semibold uppercase leading-4 tracking-wide text-slate-700`,...n,children:t},void 0,!1,{fileName:Et,lineNumber:12,columnNumber:5})}var Nt="/Users/distiller/repo/graph/ui-components/src/lib/dropdown.tsx";function St(e){const{className:t,children:n,...r}=e;return mt("select",{className:`form-select flex items-center rounded-md rounded-md border border-slate-300 bg-white pl-4 pr-8 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700 ${t}`,...r,children:n},void 0,!1,{fileName:Nt,lineNumber:11,columnNumber:5})}var Pt="/Users/distiller/repo/graph/ui-tooltips/src/lib/project-edge-tooltip.tsx";function Ct({type:e,source:t,target:n,fileDependencies:r,description:i,fileClickCallback:o}){return mt("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[mt("h4",{className:"implicit"!==e?"mb-3":"",children:[mt(kt,{className:"mr-3",children:e??"unknown"},void 0,!1,{fileName:Pt,lineNumber:23,columnNumber:9}),mt("span",{className:"font-mono",children:[t," \u2192 ",n]},void 0,!0,{fileName:Pt,lineNumber:24,columnNumber:9})]},void 0,!0,{fileName:Pt,lineNumber:22,columnNumber:7}),i?mt("p",{children:i},void 0,!1,{fileName:Pt,lineNumber:28,columnNumber:22}):null,"implicit"!==e&&r?.length>0?mt("div",{className:"overflow-hidden rounded-md border border-slate-200 dark:border-slate-800",children:[mt("div",{className:"bg-slate-50 px-4 py-2 text-xs font-medium uppercase text-slate-500 dark:bg-slate-800 dark:text-slate-400",children:mt("span",{children:"Files"},void 0,!1,{fileName:Pt,lineNumber:32,columnNumber:13})},void 0,!1,{fileName:Pt,lineNumber:31,columnNumber:11}),mt("ul",{className:"max-h-[300px] divide-y divide-slate-200 overflow-auto dark:divide-slate-800",children:r.map((e=>mt("li",{className:"whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300 "+(void 0!==o?"hover:underline hover:cursor-pointer":""),onClick:void 0!==o?()=>o(e.fileName):()=>{},children:mt("span",{className:"block truncate font-normal",children:e.fileName},void 0,!1,{fileName:Pt,lineNumber:49,columnNumber:17})},e.fileName,!1,{fileName:Pt,lineNumber:36,columnNumber:15})))},void 0,!1,{fileName:Pt,lineNumber:34,columnNumber:11})]},void 0,!0,{fileName:Pt,lineNumber:30,columnNumber:9}):null]},void 0,!0,{fileName:Pt,lineNumber:21,columnNumber:5})}const Tt=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"}))}));var jt="/Users/distiller/repo/graph/ui-tooltips/src/lib/project-node-tooltip.tsx";function Dt({type:e,id:t,tags:n,children:r,description:i,openConfigCallback:o}){return mt("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[mt("h4",{className:"flex justify-between items-center gap-4",children:[mt("div",{className:"flex items-center",children:[mt(kt,{className:"mr-3",children:e},void 0,!1,{fileName:jt,lineNumber:27,columnNumber:11}),mt("span",{className:"font-mono",children:t},void 0,!1,{fileName:jt,lineNumber:28,columnNumber:11})]},void 0,!0,{fileName:jt,lineNumber:26,columnNumber:9}),o?mt("button",{className:" flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Edit project.json in editor",onClick:o,children:mt(Tt,{className:"h-5 w-5"},void 0,!1,{fileName:jt,lineNumber:36,columnNumber:13})},void 0,!1,{fileName:jt,lineNumber:31,columnNumber:11}):void 0]},void 0,!0,{fileName:jt,lineNumber:25,columnNumber:7}),n.length>0?mt("p",{className:"my-2",children:[mt("strong",{children:"tags"},void 0,!1,{fileName:jt,lineNumber:42,columnNumber:11}),mt("br",{},void 0,!1,{fileName:jt,lineNumber:43,columnNumber:11}),n.join(", ")]},void 0,!0,{fileName:jt,lineNumber:41,columnNumber:9}):null,i?mt("p",{className:"mt-4",children:i},void 0,!1,{fileName:jt,lineNumber:47,columnNumber:22}):null,r]},void 0,!0,{fileName:jt,lineNumber:24,columnNumber:5})}const Ot=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"}))}));var At,Mt="/Users/distiller/repo/graph/ui-tooltips/src/lib/task-node-tooltip.tsx";function Rt({id:e,executor:t,description:n,runTaskCallback:r,children:i}){return mt("div",{className:"text-sm text-slate-700 dark:text-slate-400",children:[mt("h4",{className:"flex justify-between items-center gap-4 mb-3",children:[mt("div",{className:"flex items-center",children:[mt(kt,{className:"mr-3",children:t},void 0,!1,{fileName:Mt,lineNumber:26,columnNumber:11}),mt("span",{className:"font-mono",children:e},void 0,!1,{fileName:Mt,lineNumber:27,columnNumber:11})]},void 0,!0,{fileName:Mt,lineNumber:25,columnNumber:9}),r?mt("button",{className:" flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Run Task",onClick:r,children:mt(Ot,{className:"h-5 w-5"},void 0,!1,{fileName:Mt,lineNumber:35,columnNumber:13})},void 0,!1,{fileName:Mt,lineNumber:30,columnNumber:11}):void 0]},void 0,!0,{fileName:Mt,lineNumber:24,columnNumber:7}),n?mt("p",{className:"mt-4",children:n},void 0,!1,{fileName:Mt,lineNumber:39,columnNumber:22}):null,i]},void 0,!0,{fileName:Mt,lineNumber:23,columnNumber:5})}function It(){return It=Object.assign?Object.assign.bind():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},It.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(At||(At={}));const Lt="popstate";function Bt(e){return void 0===e&&(e={}),Ht((function(e,t){let{pathname:n,search:r,hash:i}=e.location;return Ut("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:Wt(t)}),null,e)}function Ft(e){return void 0===e&&(e={}),Ht((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=qt(e.location.hash.substr(1));return Ut("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:Wt(t))}),(function(e,t){Vt("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function zt(e,t){if(!1===e||null==e)throw new Error(t)}function Vt(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(w){}}}function Gt(e,t){return{usr:e.state,key:e.key,idx:t}}function Ut(e,t,n,r){return void 0===n&&(n=null),It({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?qt(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function Wt(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function qt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Ht(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=At.Pop,l=null,u=c();function c(){return(a.state||{idx:null}).idx}function d(){s=At.Pop;let e=c(),t=null==e?null:e-u;u=e,l&&l({action:s,location:h.location,delta:t})}function f(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:Wt(e);return zt(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==u&&(u=0,a.replaceState(It({},a.state,{idx:u}),""));let h={get action(){return s},get location(){return e(i,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Lt,d),l=e,()=>{i.removeEventListener(Lt,d),l=null}},createHref:e=>t(i,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=At.Push;let r=Ut(h.location,e,t);n&&n(r,e),u=c()+1;let d=Gt(r,u),f=h.createHref(r);try{a.pushState(d,"",f)}catch(p){i.location.assign(f)}o&&l&&l({action:s,location:h.location,delta:1})},replace:function(e,t){s=At.Replace;let r=Ut(h.location,e,t);n&&n(r,e),u=c();let i=Gt(r,u),d=h.createHref(r);a.replaceState(i,"",d),o&&l&&l({action:s,location:h.location,delta:0})},go:e=>a.go(e)};return h}var Yt;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Yt||(Yt={}));const Xt=new Set(["lazy","caseSensitive","path","id","index","children"]);function $t(e,t,n,r){return void 0===n&&(n=[]),void 0===r&&(r={}),e.map(((e,i)=>{let o=[...n,i],a="string"==typeof e.id?e.id:o.join("-");if(zt(!0!==e.index||!e.children,"Cannot specify children on an index route"),zt(!r[a],'Found a route id collision on id "'+a+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=It({},e,t(e),{id:a});return r[a]=n,n}{let n=It({},e,t(e),{id:a,children:void 0});return r[a]=n,e.children&&(n.children=$t(e.children,t,o,r)),n}}))}function Kt(e,t,n){void 0===n&&(n="/");let r=dn(("string"==typeof t?qt(t):t).pathname||"/",n);if(null==r)return null;let i=Zt(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let a=0;null==o&&a<i.length;++a)o=ln(i[a],cn(r));return o}function Zt(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,o)=>{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(zt(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let s=vn([r,a.relativePath]),l=n.concat(a);e.children&&e.children.length>0&&(zt(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),Zt(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:sn(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of Qt(e.path))i(e,t,r);else i(e,t)})),t}function Qt(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=Qt(r.join("/")),s=[];return s.push(...a.map((e=>""===e?o:[o,e].join("/")))),i&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const Jt=/^:\w+$/,en=3,tn=2,nn=1,rn=10,on=-2,an=e=>"*"===e;function sn(e,t){let n=e.split("/"),r=n.length;return n.some(an)&&(r+=on),t&&(r+=tn),n.filter((e=>!an(e))).reduce(((e,t)=>e+(Jt.test(t)?en:""===t?nn:rn)),r)}function ln(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let a=0;a<n.length;++a){let e=n[a],s=a===n.length-1,l="/"===i?t:t.slice(i.length)||"/",u=un({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!u)return null;Object.assign(r,u.params);let c=e.route;o.push({params:r,pathname:vn([i,u.pathname]),pathnameBase:mn(vn([i,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(i=vn([i,u.pathnameBase]))}return o}function un(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);Vt("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(r.push(t),"/([^\\/]+)")));e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let o=new RegExp(i,t?void 0:"i");return[o,r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return Vt(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{});return{params:l,pathname:o,pathnameBase:a,pattern:e}}function cn(e){try{return decodeURI(e)}catch(t){return Vt(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function dn(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function fn(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function hn(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function pn(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=qt(e):(i=It({},e),zt(!i.pathname||!i.pathname.includes("?"),fn("?","pathname","search",i)),zt(!i.pathname||!i.pathname.includes("#"),fn("#","pathname","hash",i)),zt(!i.search||!i.search.includes("#"),fn("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(r||null==s)o=n;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?qt(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:gn(r),hash:yn(i)}}(i,o),u=s&&"/"!==s&&s.endsWith("/"),c=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!u&&!c||(l.pathname+="/"),l}const vn=e=>e.join("/").replace(/\/\/+/g,"/"),mn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gn=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",yn=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const bn=function(e,t){void 0===t&&(t=302);let n=t;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let r=new Headers(n.headers);return r.set("Location",e),new Response(null,It({},n,{headers:r}))};class ErrorResponse{constructor(e,t,n,r){void 0===r&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function xn(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const wn=["post","put","patch","delete"],_n=new Set(wn),En=["get",...wn],kn=new Set(En),Nn=new Set([301,302,303,307,308]),Sn=new Set([307,308]),Pn={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Cn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Tn={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,On=!Dn,An=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function Mn(e){let t;if(zt(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){let n=e.detectErrorBoundary;t=e=>({hasErrorBoundary:n(e)})}else t=An;let n,r={},i=$t(e.routes,t,void 0,r),o=e.basename||"/",a=It({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),s=null,l=new Set,u=null,c=null,d=null,f=null!=e.hydrationData,h=Kt(i,e.history.location,o),p=null;if(null==h){let t=Kn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=$n(i);h=n,p={[r.id]:t}}let v,m,g=!(h.some((e=>e.route.lazy))||h.some((e=>e.route.loader))&&null==e.hydrationData),y={historyAction:e.history.action,location:e.history.location,matches:h,initialized:g,navigation:Pn,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||p,fetchers:new Map,blockers:new Map},b=At.Pop,x=!1,w=!1,_=!1,E=[],k=[],N=new Map,S=0,P=-1,C=new Map,T=new Set,j=new Map,D=new Map,O=new Map,A=!1;function M(e){y=It({},y,e),l.forEach((e=>e(y)))}function R(t,r){var o,a;let s,l=null!=y.actionData&&null!=y.navigation.formMethod&&ir(y.navigation.formMethod)&&"loading"===y.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?y.actionData:null;let u=r.loaderData?Yn(y.loaderData,r.loaderData,r.matches||[],r.errors):y.loaderData;for(let[e]of O)Y(e);let c=!0===x||null!=y.navigation.formMethod&&ir(y.navigation.formMethod)&&!0!==(null==(a=t.state)?void 0:a._isRedirect);n&&(i=n,n=void 0),M(It({},r,{actionData:s,loaderData:u,historyAction:b,location:t,initialized:!0,navigation:Pn,revalidation:"idle",restoreScrollPosition:Z(t,r.matches||y.matches),preventScrollReset:c,blockers:new Map(y.blockers)})),w||b===At.Pop||(b===At.Push?e.history.push(t,t.state):b===At.Replace&&e.history.replace(t,t.state)),b=At.Pop,x=!1,w=!1,_=!1,E=[],k=[]}async function I(a,s,l){m&&m.abort(),m=null,b=a,w=!0===(l&&l.startUninterruptedRevalidation),function(e,t){if(u&&c&&d){let n=t.map((e=>lr(e,y.loaderData))),r=c(e,n)||e.key;u[r]=d()}}(y.location,y.matches),x=!0===(l&&l.preventScrollReset);let f=n||i,h=l&&l.overrideNavigation,p=Kt(f,s,o);if(!p){let e=Kn(404,{pathname:s.pathname}),{matches:t,route:n}=$n(f);return K(),void R(s,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(y.initialized&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(y.location,s)&&!(l&&l.submission&&ir(l.submission.formMethod)))return void R(s,{matches:p});m=new AbortController;let v,g,C=Un(e.history,s,m.signal,l&&l.submission);if(l&&l.pendingError)g={[Xn(p).route.id]:l.pendingError};else if(l&&l.submission&&ir(l.submission.formMethod)){let e=await async function(e,n,i,a,s){z();let l,u=It({state:"submitting",location:n},i);M({navigation:u});let c=ur(a,n);if(c.route.action||c.route.lazy){if(l=await Gn("action",e,c,a,r,t,o),e.signal.aborted)return{shortCircuited:!0}}else l={type:Yt.error,error:Kn(405,{method:e.method,pathname:n.pathname,routeId:c.route.id})};if(tr(l)){let e;return e=s&&null!=s.replace?s.replace:l.location===y.location.pathname+y.location.search,await B(y,l,{submission:i,replace:e}),{shortCircuited:!0}}if(er(l)){let e=Xn(a,c.route.id);return!0!==(s&&s.replace)&&(b=At.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Jn(l))throw Kn(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(C,s,l.submission,p,{replace:l.replace});if(e.shortCircuited)return;v=e.pendingActionData,g=e.pendingActionError,h=It({state:"loading",location:s},l.submission),C=new Request(C.url,{signal:C.signal})}let{shortCircuited:T,loaderData:O,errors:A}=await async function(t,r,a,s,l,u,c,d,f){let h=s;if(!h){h=It({state:"loading",location:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},l)}let p=l||u?l||u:h.formMethod&&h.formAction&&h.formData&&h.formEncType?{formMethod:h.formMethod,formAction:h.formAction,formData:h.formData,formEncType:h.formEncType}:void 0,v=n||i,[g,b]=Bn(e.history,y,a,p,r,_,E,k,j,v,o,d,f);if(K((e=>!(a&&a.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),0===g.length&&0===b.length){let e=q();return R(r,It({matches:a,loaderData:{},errors:f||null},d?{actionData:d}:{},e?{fetchers:new Map(y.fetchers)}:{})),{shortCircuited:!0}}if(!w){b.forEach((e=>{let t=y.fetchers.get(e.key),n={state:"loading",data:t&&t.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};y.fetchers.set(e.key,n)}));let e=d||y.actionData;M(It({navigation:h},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},b.length>0?{fetchers:new Map(y.fetchers)}:{}))}P=++S,b.forEach((e=>{e.controller&&N.set(e.key,e.controller)}));let x=()=>b.forEach((e=>U(e.key)));m&&m.signal.addEventListener("abort",x);let{results:C,loaderResults:T,fetcherResults:O}=await F(y.matches,a,g,b,t);if(t.signal.aborted)return{shortCircuited:!0};m&&m.signal.removeEventListener("abort",x);b.forEach((e=>N.delete(e.key)));let A=Zn(C);if(A)return await B(y,A,{replace:c}),{shortCircuited:!0};let{loaderData:I,errors:L}=Hn(y,a,g,T,f,b,O,D);D.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&D.delete(t)}))}));let z=q(),V=H(P),G=z||V||b.length>0;return It({loaderData:I,errors:L},G?{fetchers:new Map(y.fetchers)}:{})}(C,s,p,h,l&&l.submission,l&&l.fetcherSubmission,l&&l.replace,v,g);T||(m=null,R(s,It({matches:p},v?{actionData:v}:{},{loaderData:O,errors:A})))}function L(e){return y.fetchers.get(e)||Cn}async function B(t,n,r){var i;let{submission:a,replace:s,isFetchActionRedirect:l}=void 0===r?{}:r;n.revalidate&&(_=!0);let u=Ut(t.location,n.location,It({_isRedirect:!0},l?{_isFetchActionRedirect:!0}:{}));if(zt(u,"Expected a location on the redirect navigation"),jn.test(n.location)&&Dn&&void 0!==(null==(i=window)?void 0:i.location)){let t=e.history.createURL(n.location),r=null==dn(t.pathname,o);if(window.location.origin!==t.origin||r)return void(s?window.location.replace(n.location):window.location.assign(n.location))}m=null;let c=!0===s?At.Replace:At.Push,{formMethod:d,formAction:f,formEncType:h,formData:p}=t.navigation;!a&&d&&f&&p&&h&&(a={formMethod:d,formAction:f,formEncType:h,formData:p}),Sn.has(n.status)&&a&&ir(a.formMethod)?await I(c,u,{submission:It({},a,{formAction:n.location}),preventScrollReset:x}):l?await I(c,u,{overrideNavigation:{state:"loading",location:u,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:a,preventScrollReset:x}):await I(c,u,{overrideNavigation:{state:"loading",location:u,formMethod:a?a.formMethod:void 0,formAction:a?a.formAction:void 0,formEncType:a?a.formEncType:void 0,formData:a?a.formData:void 0},preventScrollReset:x})}async function F(n,i,a,s,l){let u=await Promise.all([...a.map((e=>Gn("loader",l,e,i,r,t,o))),...s.map((n=>{if(n.matches&&n.match&&n.controller)return Gn("loader",Un(e.history,n.path,n.controller.signal),n.match,n.matches,r,t,o);return{type:Yt.error,error:Kn(404,{pathname:n.path})}}))]),c=u.slice(0,a.length),d=u.slice(a.length);return await Promise.all([or(n,a,c,c.map((()=>l.signal)),!1,y.loaderData),or(n,s.map((e=>e.match)),d,s.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:u,loaderResults:c,fetcherResults:d}}function z(){_=!0,E.push(...K()),j.forEach(((e,t)=>{N.has(t)&&(k.push(t),U(t))}))}function V(e,t,n){let r=Xn(y.matches,t);G(e),M({errors:{[r.route.id]:n},fetchers:new Map(y.fetchers)})}function G(e){N.has(e)&&U(e),j.delete(e),C.delete(e),T.delete(e),y.fetchers.delete(e)}function U(e){let t=N.get(e);zt(t,"Expected fetch controller: "+e),t.abort(),N.delete(e)}function W(e){for(let t of e){let e={state:"idle",data:L(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};y.fetchers.set(t,e)}}function q(){let e=[],t=!1;for(let n of T){let r=y.fetchers.get(n);zt(r,"Expected fetcher: "+n),"loading"===r.state&&(T.delete(n),e.push(n),t=!0)}return W(e),t}function H(e){let t=[];for(let[n,r]of C)if(r<e){let e=y.fetchers.get(n);zt(e,"Expected fetcher: "+n),"loading"===e.state&&(U(n),C.delete(n),t.push(n))}return W(t),t.length>0}function Y(e){y.blockers.delete(e),O.delete(e)}function X(e,t){let n=y.blockers.get(e)||Tn;zt("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state),y.blockers.set(e,t),M({blockers:new Map(y.blockers)})}function $(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===O.size)return;O.size>1&&Vt(!1,"A router only supports one blocker at a time");let i=Array.from(O.entries()),[o,a]=i[i.length-1],s=y.blockers.get(o);return s&&"proceeding"===s.state?void 0:a({currentLocation:t,nextLocation:n,historyAction:r})?o:void 0}function K(e){let t=[];return D.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),D.delete(r))})),t}function Z(e,t){if(u&&c&&d){let n=t.map((e=>lr(e,y.loaderData))),r=c(e,n)||e.key,i=u[r];if("number"==typeof i)return i}return null}return v={get basename(){return o},get state(){return y},get routes(){return i},initialize:function(){return s=e.history.listen((t=>{let{action:n,location:r,delta:i}=t;if(A)return void(A=!1);Vt(0===O.size||null!=i,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=$({currentLocation:y.location,nextLocation:r,historyAction:n});return o&&null!=i?(A=!0,e.history.go(-1*i),void X(o,{state:"blocked",location:r,proceed(){X(o,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),e.history.go(i)},reset(){Y(o),M({blockers:new Map(v.state.blockers)})}})):I(n,r)})),y.initialized||I(At.Pop,y.location),v},subscribe:function(e){return l.add(e),()=>l.delete(e)},enableScrollRestoration:function(e,t,n){if(u=e,d=t,c=n||(e=>e.key),!f&&y.navigation===Pn){f=!0;let e=Z(y.location,y.matches);null!=e&&M({restoreScrollPosition:e})}return()=>{u=null,d=null,c=null}},navigate:async function t(n,r){if("number"==typeof n)return void e.history.go(n);let i=Rn(y.location,y.matches,o,a.v7_prependBasename,n,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:s,submission:l,error:u}=In(a.v7_normalizeFormMethod,!1,i,r),c=y.location,d=Ut(y.location,s,r&&r.state);d=It({},d,e.history.encodeLocation(d));let f=r&&null!=r.replace?r.replace:void 0,h=At.Push;!0===f?h=At.Replace:!1===f||null!=l&&ir(l.formMethod)&&l.formAction===y.location.pathname+y.location.search&&(h=At.Replace);let p=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,v=$({currentLocation:c,nextLocation:d,historyAction:h});if(!v)return await I(h,d,{submission:l,pendingError:u,preventScrollReset:p,replace:r&&r.replace});X(v,{state:"blocked",location:d,proceed(){X(v,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(n,r)},reset(){Y(v),M({blockers:new Map(y.blockers)})}})},fetch:function(s,l,u,c){if(On)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(s)&&U(s);let d=n||i,f=Rn(y.location,y.matches,o,a.v7_prependBasename,u,l,null==c?void 0:c.relative),h=Kt(d,f,o);if(!h)return void V(s,l,Kn(404,{pathname:f}));let{path:p,submission:v}=In(a.v7_normalizeFormMethod,!0,f,c),g=ur(h,p);x=!0===(c&&c.preventScrollReset),v&&ir(v.formMethod)?async function(a,s,l,u,c,d){if(z(),j.delete(a),!u.route.action&&!u.route.lazy){let e=Kn(405,{method:d.formMethod,pathname:l,routeId:s});return void V(a,s,e)}let f=y.fetchers.get(a),h=It({state:"submitting"},d,{data:f&&f.data," _hasFetcherDoneAnything ":!0});y.fetchers.set(a,h),M({fetchers:new Map(y.fetchers)});let p=new AbortController,v=Un(e.history,l,p.signal,d);N.set(a,p);let g=await Gn("action",v,u,c,r,t,o);if(v.signal.aborted)return void(N.get(a)===p&&N.delete(a));if(tr(g)){N.delete(a),T.add(a);let e=It({state:"loading"},d,{data:void 0," _hasFetcherDoneAnything ":!0});return y.fetchers.set(a,e),M({fetchers:new Map(y.fetchers)}),B(y,g,{submission:d,isFetchActionRedirect:!0})}if(er(g))return void V(a,s,g.error);if(Jn(g))throw Kn(400,{type:"defer-action"});let x=y.navigation.location||y.location,w=Un(e.history,x,p.signal),O=n||i,A="idle"!==y.navigation.state?Kt(O,y.navigation.location,o):y.matches;zt(A,"Didn't find any matches after fetcher action");let I=++S;C.set(a,I);let L=It({state:"loading",data:g.data},d,{" _hasFetcherDoneAnything ":!0});y.fetchers.set(a,L);let[G,W]=Bn(e.history,y,A,d,x,_,E,k,j,O,o,{[u.route.id]:g.data},void 0);W.filter((e=>e.key!==a)).forEach((e=>{let t=e.key,n=y.fetchers.get(t),r={state:"loading",data:n&&n.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};y.fetchers.set(t,r),e.controller&&N.set(t,e.controller)})),M({fetchers:new Map(y.fetchers)});let q=()=>W.forEach((e=>U(e.key)));p.signal.addEventListener("abort",q);let{results:Y,loaderResults:X,fetcherResults:$}=await F(y.matches,A,G,W,w);if(p.signal.aborted)return;p.signal.removeEventListener("abort",q),C.delete(a),N.delete(a),W.forEach((e=>N.delete(e.key)));let K=Zn(Y);if(K)return B(y,K);let{loaderData:Z,errors:Q}=Hn(y,y.matches,G,X,void 0,W,$,D),J={state:"idle",data:g.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};y.fetchers.set(a,J);let ee=H(I);"loading"===y.navigation.state&&I>P?(zt(b,"Expected pending action"),m&&m.abort(),R(y.navigation.location,{matches:A,loaderData:Z,errors:Q,fetchers:new Map(y.fetchers)})):(M(It({errors:Q,loaderData:Yn(y.loaderData,Z,A,Q)},ee?{fetchers:new Map(y.fetchers)}:{})),_=!1)}(s,l,p,g,h,v):(j.set(s,{routeId:l,path:p}),async function(n,i,a,s,l,u){let c=y.fetchers.get(n),d=It({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},u,{data:c&&c.data," _hasFetcherDoneAnything ":!0});y.fetchers.set(n,d),M({fetchers:new Map(y.fetchers)});let f=new AbortController,h=Un(e.history,a,f.signal);N.set(n,f);let p=await Gn("loader",h,s,l,r,t,o);Jn(p)&&(p=await ar(p,h.signal,!0)||p);N.get(n)===f&&N.delete(n);if(h.signal.aborted)return;if(tr(p))return T.add(n),void(await B(y,p));if(er(p)){let e=Xn(y.matches,i);return y.fetchers.delete(n),void M({fetchers:new Map(y.fetchers),errors:{[e.route.id]:p.error}})}zt(!Jn(p),"Unhandled fetcher deferred data");let v={state:"idle",data:p.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};y.fetchers.set(n,v),M({fetchers:new Map(y.fetchers)})}(s,l,p,g,h,v))},revalidate:function(){z(),M({revalidation:"loading"}),"submitting"!==y.navigation.state&&("idle"!==y.navigation.state?I(b||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation}):I(y.historyAction,y.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:L,deleteFetcher:G,dispose:function(){s&&s(),l.clear(),m&&m.abort(),y.fetchers.forEach(((e,t)=>G(t))),y.blockers.forEach(((e,t)=>Y(t)))},getBlocker:function(e,t){let n=y.blockers.get(e)||Tn;return O.get(e)!==t&&O.set(e,t),n},deleteBlocker:Y,_internalFetchControllers:N,_internalActiveDeferreds:D,_internalSetRoutes:function(e){r={},n=$t(e,t,void 0,r)}},v}Symbol("deferred");function Rn(e,t,n,r,i,o,a){let s,l;if(null!=o&&"path"!==a){s=[];for(let e of t)if(s.push(e),e.route.id===o){l=e;break}}else s=t,l=t[t.length-1];let u=pn(i||".",hn(s).map((e=>e.pathnameBase)),dn(e.pathname,n)||e.pathname,"path"===a);return null==i&&(u.search=e.search,u.hash=e.hash),null!=i&&""!==i&&"."!==i||!l||!l.route.index||sr(u.search)||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&"/"!==n&&(u.pathname="/"===u.pathname?n:vn([n,u.pathname])),Wt(u)}function In(e,t,n,r){if(!r||!function(e){return null!=e&&"formData"in e}(r))return{path:n};if(r.formMethod&&!rr(r.formMethod))return{path:n,error:Kn(405,{method:r.formMethod})};let i;if(r.formData){let t=r.formMethod||"get";if(i={formMethod:e?t.toUpperCase():t.toLowerCase(),formAction:Qn(n),formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:r.formData},ir(i.formMethod))return{path:n,submission:i}}let o=qt(n),a=Wn(r.formData);return t&&o.search&&sr(o.search)&&a.append("index",""),o.search="?"+a,{path:Wt(o),submission:i}}function Ln(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function Bn(e,t,n,r,i,o,a,s,l,u,c,d,f){let h=f?Object.values(f)[0]:d?Object.values(d)[0]:void 0,p=e.createURL(t.location),v=e.createURL(i),m=f?Object.keys(f)[0]:void 0,g=Ln(n,m).filter(((e,n)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=void 0===e[n.route.id];return r||i}(t.loaderData,t.matches[n],e)||a.some((t=>t===e.route.id)))return!0;let i=t.matches[n],s=e;return zn(e,It({currentUrl:p,currentParams:i.params,nextUrl:v,nextParams:s.params},r,{actionResult:h,defaultShouldRevalidate:o||p.pathname+p.search===v.pathname+v.search||p.search!==v.search||Fn(i,s)}))})),y=[];return l.forEach(((e,i)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let a=Kt(u,e.path,c);if(!a)return void y.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=ur(a,e.path);(s.includes(i)||zn(l,It({currentUrl:p,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:h,defaultShouldRevalidate:o})))&&y.push({key:i,routeId:e.routeId,path:e.path,matches:a,match:l,controller:new AbortController})})),[g,y]}function Fn(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function zn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}async function Vn(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];zt(i,"No route found in manifest");let o={};for(let a in r){let e=void 0!==i[a]&&"hasErrorBoundary"!==a;Vt(!e,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+a+'" will be ignored.'),e||Xt.has(a)||(o[a]=r[a])}Object.assign(i,o),Object.assign(i,It({},t(i),{lazy:void 0}))}async function Gn(e,t,n,r,i,o,a,s,l,u){let c,d,f;void 0===s&&(s=!1),void 0===l&&(l=!1);let h=e=>{let r,i=new Promise(((e,t)=>r=t));return f=()=>r(),t.signal.addEventListener("abort",f),Promise.race([e({request:t,params:n.params,context:u}),i])};try{let r=n.route[e];if(n.route.lazy)if(r){d=(await Promise.all([h(r),Vn(n.route,o,i)]))[0]}else{if(await Vn(n.route,o,i),r=n.route[e],!r){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw Kn(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:Yt.data,data:void 0}}d=await h(r)}else{if(!r){let e=new URL(t.url);throw Kn(404,{pathname:e.pathname+e.search})}d=await h(r)}zt(void 0!==d,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(w){c=Yt.error,d=w}finally{f&&t.signal.removeEventListener("abort",f)}if(nr(d)){let e,i=d.status;if(Nn.has(i)){let e=d.headers.get("Location");if(zt(e,"Redirects returned/thrown from loaders/actions must have a Location header"),jn.test(e)){if(!s){let n=new URL(t.url),r=e.startsWith("//")?new URL(n.protocol+e):new URL(e),i=null!=dn(r.pathname,a);r.origin===n.origin&&i&&(e=r.pathname+r.search+r.hash)}}else e=Rn(new URL(t.url),r.slice(0,r.indexOf(n)+1),a,!0,e);if(s)throw d.headers.set("Location",e),d;return{type:Yt.redirect,status:i,location:e,revalidate:null!==d.headers.get("X-Remix-Revalidate")}}if(l)throw{type:c||Yt.data,response:d};let o=d.headers.get("Content-Type");return e=o&&/\bapplication\/json\b/.test(o)?await d.json():await d.text(),c===Yt.error?{type:c,error:new ErrorResponse(i,d.statusText,e),headers:d.headers}:{type:Yt.data,data:e,statusCode:d.status,headers:d.headers}}return c===Yt.error?{type:c,error:d}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(d)?{type:Yt.deferred,deferredData:d,statusCode:null==(p=d.init)?void 0:p.status,headers:(null==(v=d.init)?void 0:v.headers)&&new Headers(d.init.headers)}:{type:Yt.data,data:d};var p,v}function Un(e,t,n,r){let i=e.createURL(Qn(t)).toString(),o={signal:n};if(r&&ir(r.formMethod)){let{formMethod:e,formEncType:t,formData:n}=r;o.method=e.toUpperCase(),o.body="application/x-www-form-urlencoded"===t?Wn(n):n}return new Request(i,o)}function Wn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function qn(e,t,n,r,i){let o,a={},s=null,l=!1,u={};return n.forEach(((n,c)=>{let d=t[c].route.id;if(zt(!tr(n),"Cannot handle redirect results in processLoaderData"),er(n)){let t=Xn(e,d),i=n.error;r&&(i=Object.values(r)[0],r=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=i),a[d]=void 0,l||(l=!0,o=xn(n.error)?n.error.status:500),n.headers&&(u[d]=n.headers)}else Jn(n)?(i.set(d,n.deferredData),a[d]=n.deferredData.data):a[d]=n.data,null==n.statusCode||200===n.statusCode||l||(o=n.statusCode),n.headers&&(u[d]=n.headers)})),r&&(s=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function Hn(e,t,n,r,i,o,a,s){let{loaderData:l,errors:u}=qn(t,n,r,i,s);for(let c=0;c<o.length;c++){let{key:t,match:n,controller:r}=o[c];zt(void 0!==a&&void 0!==a[c],"Did not find corresponding fetcher result");let i=a[c];if(!r||!r.signal.aborted)if(er(i)){let r=Xn(e.matches,null==n?void 0:n.route.id);u&&u[r.route.id]||(u=It({},u,{[r.route.id]:i.error})),e.fetchers.delete(t)}else if(tr(i))zt(!1,"Unhandled fetcher revalidation redirect");else if(Jn(i))zt(!1,"Unhandled fetcher deferred data");else{let n={state:"idle",data:i.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};e.fetchers.set(t,n)}}return{loaderData:l,errors:u}}function Yn(e,t,n,r){let i=It({},t);for(let o of n){let n=o.route.id;if(t.hasOwnProperty(n)?void 0!==t[n]&&(i[n]=t[n]):void 0!==e[n]&&o.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Xn(e,t){let n=t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e];return n.reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function $n(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Kn(e,t){let{pathname:n,routeId:r,method:i,type:o}=void 0===t?{}:t,a="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(a="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but did not provide a `loader` for route "'+r+'", so there is no way to handle the request.':"defer-action"===o&&(s="defer() is not supported in actions")):403===e?(a="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):404===e?(a="Not Found",s='No route matches URL "'+n+'"'):405===e&&(a="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but did not provide an `action` for route "'+r+'", so there is no way to handle the request.':i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new ErrorResponse(e||500,a,new Error(s),!0)}function Zn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(tr(n))return n}}function Qn(e){return Wt(It({},"string"==typeof e?qt(e):e,{hash:""}))}function Jn(e){return e.type===Yt.deferred}function er(e){return e.type===Yt.error}function tr(e){return(e&&e.type)===Yt.redirect}function nr(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function rr(e){return kn.has(e.toLowerCase())}function ir(e){return _n.has(e.toLowerCase())}async function or(e,t,n,r,i,o){for(let a=0;a<n.length;a++){let s=n[a],l=t[a];if(!l)continue;let u=e.find((e=>e.route.id===l.route.id)),c=null!=u&&!Fn(u,l)&&void 0!==(o&&o[l.route.id]);if(Jn(s)&&(i||c)){let e=r[a];zt(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await ar(s,e,i).then((e=>{e&&(n[a]=e||n[a])}))}}}async function ar(e,t,n){if(void 0===n&&(n=!1),!(await e.deferredData.resolveData(t))){if(n)try{return{type:Yt.data,data:e.deferredData.unwrappedData}}catch(w){return{type:Yt.error,error:w}}return{type:Yt.data,data:e.deferredData.data}}}function sr(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function lr(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function ur(e,t){let n="string"==typeof t?qt(t).search:t.search;if(e[e.length-1].route.index&&sr(n||""))return e[e.length-1];let r=hn(e);return r[r.length-1]}function cr(){return cr=Object.assign?Object.assign.bind():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},cr.apply(this,arguments)}const dr=r.createContext(null);dr.displayName="DataRouter";const fr=r.createContext(null);fr.displayName="DataRouterState";const hr=r.createContext(null);hr.displayName="Await";const pr=r.createContext(null);pr.displayName="Navigation";const vr=r.createContext(null);vr.displayName="Location";const mr=r.createContext({outlet:null,matches:[],isDataRoute:!1});mr.displayName="Route";const gr=r.createContext(null);function yr(){return null!=r.useContext(vr)}function br(){return yr()||zt(!1,"useLocation() may be used only in the context of a <Router> component."),r.useContext(vr).location}gr.displayName="RouteError";const xr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wr(e){r.useContext(pr).static||r.useLayoutEffect(e)}function _r(){let{isDataRoute:e}=r.useContext(mr);return e?function(){let{router:e}=Mr(Dr.UseNavigateStable),t=Ir(Or.UseNavigateStable),n=r.useRef(!1);wr((()=>{n.current=!0}));let i=r.useCallback((function(r,i){void 0===i&&(i={}),Vt(n.current,xr),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,cr({fromRouteId:t},i)))}),[e,t]);return i}():function(){yr()||zt(!1,"useNavigate() may be used only in the context of a <Router> component.");let e=r.useContext(dr),{basename:t,navigator:n}=r.useContext(pr),{matches:i}=r.useContext(mr),{pathname:o}=br(),a=JSON.stringify(hn(i).map((e=>e.pathnameBase))),s=r.useRef(!1);return wr((()=>{s.current=!0})),r.useCallback((function(r,i){if(void 0===i&&(i={}),Vt(s.current,xr),!s.current)return;if("number"==typeof r)return void n.go(r);let l=pn(r,JSON.parse(a),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:vn([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,a,o,e])}()}const Er=r.createContext(null);function kr(){let{matches:e}=r.useContext(mr),t=e[e.length-1];return t?t.params:{}}function Nr(e,t){let{relative:n}=void 0===t?{}:t,{matches:i}=r.useContext(mr),{pathname:o}=br(),a=JSON.stringify(hn(i).map((e=>e.pathnameBase)));return r.useMemo((()=>pn(e,JSON.parse(a),o,"path"===n)),[e,a,o,n])}function Sr(e,t,n){yr()||zt(!1,"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=r.useContext(pr),{matches:o}=r.useContext(mr),a=o[o.length-1],s=a?a.params:{},l=a?a.pathname:"/",u=a?a.pathnameBase:"/",c=a&&a.route;{let e=c&&c.path||"";d=l,f=!c||e.endsWith("*"),h='You rendered descendant <Routes> (or called `useRoutes()`) at "'+l+'" (under <Route path="'+e+'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="'+e+'"> to <Route path="'+("/"===e?"*":e+"/*")+'">.',f||Fr[d]||(Fr[d]=!0,Vt(!1,h))}var d,f,h;let p,v=br();if(t){var m;let e="string"==typeof t?qt(t):t;"/"===u||(null==(m=e.pathname)?void 0:m.startsWith(u))||zt(!1,'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'+u+'" but pathname "'+e.pathname+'" was given in the `location` prop.'),p=e}else p=v;let g=p.pathname||"/",y=Kt(e,{pathname:"/"===u?g:g.slice(u.length)||"/"});Vt(c||null!=y,'No routes matched location "'+p.pathname+p.search+p.hash+'" '),Vt(null==y||void 0!==y[y.length-1].route.element||void 0!==y[y.length-1].route.Component,'Matched leaf route at location "'+p.pathname+p.search+p.hash+'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.');let b=jr(y&&y.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:vn([u,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:vn([u,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),o,n);return t&&b?r.createElement(vr.Provider,{value:{location:cr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:At.Pop}},b):b}function Pr(){let e=Br(),t=xn(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:i},a={padding:"2px 4px",backgroundColor:i},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=r.createElement(r.Fragment,null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",r.createElement("code",{style:a},"ErrorBoundary")," or"," ",r.createElement("code",{style:a},"errorElement")," prop on your route.")),r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,s)}const Cr=r.createElement(Pr,null);class RenderErrorBoundary extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?r.createElement(mr.Provider,{value:this.props.routeContext},r.createElement(gr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Tr(e){let{routeContext:t,match:n,children:i}=e,o=r.useContext(dr);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(mr.Provider,{value:t},i)}function jr(e,t,n){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),null==e){var o;if(null==(o=n)||!o.errors)return null;e=n.matches}let a=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=a.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||zt(!1,"Could not find a matching route for errors on route IDs: "+Object.keys(s).join(",")),a=a.slice(0,Math.min(a.length,e+1))}return a.reduceRight(((e,i,o)=>{let l=i.route.id?null==s?void 0:s[i.route.id]:null,u=null;n&&(u=i.route.errorElement||Cr);let c=t.concat(a.slice(0,o+1)),d=()=>{let t;return t=l?u:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(Tr,{match:i,routeContext:{outlet:e,matches:c,isDataRoute:null!=n},children:t})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===o)?r.createElement(RenderErrorBoundary,{location:n.location,revalidation:n.revalidation,component:u,error:l,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var Dr,Or;function Ar(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Mr(e){let t=r.useContext(dr);return t||zt(!1,Ar(e)),t}function Rr(e){let t=r.useContext(fr);return t||zt(!1,Ar(e)),t}function Ir(e){let t=function(e){let t=r.useContext(mr);return t||zt(!1,Ar(e)),t}(e),n=t.matches[t.matches.length-1];return n.route.id||zt(!1,e+' can only be used on routes that contain a unique "id"'),n.route.id}function Lr(e){return Rr(Or.UseRouteLoaderData).loaderData[e]}function Br(){var e;let t=r.useContext(gr),n=Rr(Or.UseRouteError),i=Ir(Or.UseRouteError);return t||(null==(e=n.errors)?void 0:e[i])}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(Dr||(Dr={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(Or||(Or={}));const Fr={};function zr(e){let{fallbackElement:t,router:n}=e,[i,o]=r.useState(n.state);r.useLayoutEffect((()=>n.subscribe(o)),[n,o]);let a=r.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),s=n.basename||"/",l=r.useMemo((()=>({router:n,navigator:a,static:!1,basename:s})),[n,a,s]);return r.createElement(r.Fragment,null,r.createElement(dr.Provider,{value:l},r.createElement(fr.Provider,{value:i},r.createElement(Ur,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:a},n.state.initialized?r.createElement(Vr,{routes:n.routes,state:i}):t))),null)}function Vr(e){let{routes:t,state:n}=e;return Sr(t,void 0,n)}function Gr(e){return function(e){let t=r.useContext(mr).outlet;return t?r.createElement(Er.Provider,{value:e},t):t}(e.context)}function Ur(e){let{basename:t="/",children:n=null,location:i,navigationType:o=At.Pop,navigator:a,static:s=!1}=e;yr()&&zt(!1,"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=r.useMemo((()=>({basename:l,navigator:a,static:s})),[l,a,s]);"string"==typeof i&&(i=qt(i));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:p="default"}=i,v=r.useMemo((()=>{let e=dn(c,l);return null==e?null:{location:{pathname:e,search:d,hash:f,state:h,key:p},navigationType:o}}),[l,c,d,f,h,p,o]);return Vt(null!=v,'<Router basename="'+l+'"> is not able to match the URL "'+c+d+f+"\" because it does not start with the basename, so the <Router> won't render anything."),null==v?null:r.createElement(pr.Provider,{value:u},r.createElement(vr.Provider,{children:n,value:v}))}var Wr;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Wr||(Wr={}));new Promise((()=>{}));r.Component;function qr(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&Vt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.ErrorBoundary&&(e.errorElement&&Vt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}function Hr(){return Hr=Object.assign?Object.assign.bind():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},Hr.apply(this,arguments)}function Yr(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}const Xr="get",$r="application/x-www-form-urlencoded";function Kr(e){return null!=e&&"string"==typeof e.tagName}function Zr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}function Qr(e,t,n){let r,i,o,a=null;if(Kr(s=e)&&"form"===s.tagName.toLowerCase()){let s=t.submissionTrigger;if(t.action)a=t.action;else{let t=e.getAttribute("action");a=t?dn(t,n):null}r=t.method||e.getAttribute("method")||Xr,i=t.encType||e.getAttribute("enctype")||$r,o=new FormData(e),s&&s.name&&o.append(s.name,s.value)}else if(function(e){return Kr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Kr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');if(t.action)a=t.action;else{let t=e.getAttribute("formaction")||s.getAttribute("action");a=t?dn(t,n):null}r=t.method||e.getAttribute("formmethod")||s.getAttribute("method")||Xr,i=t.encType||e.getAttribute("formenctype")||s.getAttribute("enctype")||$r,o=new FormData(s),e.name&&o.append(e.name,e.value)}else{if(Kr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(r=t.method||Xr,a=t.action||null,i=t.encType||$r,e instanceof FormData)o=e;else if(o=new FormData,e instanceof URLSearchParams)for(let[t,n]of e)o.append(t,n);else if(null!=e)for(let t of Object.keys(e))o.append(t,e[t])}var s;return{action:a,method:r.toLowerCase(),encType:i,formData:o}}const Jr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],ei=["aria-current","caseSensitive","className","end","style","to","children"],ti=["reloadDocument","replace","method","action","onSubmit","fetcherKey","routeId","relative","preventScrollReset"];function ni(e,t){return Mn({basename:null==t?void 0:t.basename,future:Hr({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:Bt({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ii(),routes:e,mapRouteProperties:qr}).initialize()}function ri(e,t){return Mn({basename:null==t?void 0:t.basename,future:Hr({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:Ft({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ii(),routes:e,mapRouteProperties:qr}).initialize()}function ii(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Hr({},t,{errors:oi(t.errors)})),t}function oi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&"RouteErrorResponse"===i.__type)n[r]=new ErrorResponse(i.status,i.statusText,i.data,!0===i.internal);else if(i&&"Error"===i.__type){let e=new Error(i.message);e.stack="",n[r]=e}else n[r]=i;return n}const ai="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,si=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,li=r.forwardRef((function(e,t){let n,{onClick:i,relative:o,reloadDocument:a,replace:s,state:l,target:u,to:c,preventScrollReset:d}=e,f=Yr(e,Jr),{basename:h}=r.useContext(pr),p=!1;if("string"==typeof c&&si.test(c)&&(n=c,ai))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=dn(t.pathname,h);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:p=!0}catch(w){Vt(!1,'<Link to="'+c+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let v=function(e,t){let{relative:n}=void 0===t?{}:t;yr()||zt(!1,"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=r.useContext(pr),{hash:a,pathname:s,search:l}=Nr(e,{relative:n}),u=s;return"/"!==i&&(u="/"===s?i:vn([i,s])),o.createHref({pathname:u,search:l,hash:a})}(c,{relative:o}),m=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s}=void 0===t?{}:t,l=_r(),u=br(),c=Nr(e,{relative:s});return r.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:Wt(u)===Wt(c);l(e,{replace:n,state:o,preventScrollReset:a,relative:s})}}),[u,l,c,i,o,n,e,a,s])}(c,{replace:s,state:l,target:u,preventScrollReset:d,relative:o});return r.createElement("a",Hr({},f,{href:n||v,onClick:p||a?i:function(e){i&&i(e),e.defaultPrevented||m(e)},ref:t,target:u}))}));li.displayName="Link";r.forwardRef((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,children:u}=e,c=Yr(e,ei),d=Nr(l,{relative:c.relative}),f=br(),h=r.useContext(fr),{navigator:p}=r.useContext(pr),v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,m=f.pathname,g=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;i||(m=m.toLowerCase(),g=g?g.toLowerCase():null,v=v.toLowerCase());let y,b=m===v||!a&&m.startsWith(v)&&"/"===m.charAt(v.length),x=null!=g&&(g===v||!a&&g.startsWith(v)&&"/"===g.charAt(v.length)),w=b?n:void 0;y="function"==typeof o?o({isActive:b,isPending:x}):[o,b?"active":null,x?"pending":null].filter(Boolean).join(" ");let _="function"==typeof s?s({isActive:b,isPending:x}):s;return r.createElement(li,Hr({},c,{"aria-current":w,className:y,ref:t,style:_,to:l}),"function"==typeof u?u({isActive:b,isPending:x}):u)})).displayName="NavLink";r.forwardRef(((e,t)=>r.createElement(ui,Hr({},e,{ref:t})))).displayName="Form";const ui=r.forwardRef(((e,t)=>{let{reloadDocument:n,replace:i,method:o=Xr,action:a,onSubmit:s,fetcherKey:l,routeId:u,relative:c,preventScrollReset:d}=e,f=Yr(e,ti),h=vi(l,u),p="get"===o.toLowerCase()?"get":"post",v=function(e,t){let{relative:n}=void 0===t?{}:t,{basename:i}=r.useContext(pr),o=r.useContext(mr);o||zt(!1,"useFormAction must be used inside a RouteContext");let[a]=o.matches.slice(-1),s=Hr({},Nr(e||".",{relative:n})),l=br();if(null==e&&(s.search=l.search,s.hash=l.hash,a.route.index)){let e=new URLSearchParams(s.search);e.delete("index"),s.search=e.toString()?"?"+e.toString():""}e&&"."!==e||!a.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==i&&(s.pathname="/"===s.pathname?i:vn([i,s.pathname]));return Wt(s)}(a,{relative:c});return r.createElement("form",Hr({ref:t,method:p,action:v,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null==t?void 0:t.getAttribute("formmethod"))||o;h(t||e.currentTarget,{method:n,replace:i,relative:c,preventScrollReset:d})}},f))}));var ci,di;function fi(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function hi(e){let t=r.useContext(dr);return t||zt(!1,fi(e)),t}function pi(e){Vt("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params\n\nIf you're unsure how to load polyfills, we recommend you check out https://polyfill.io/v3/ which provides some recommendations about how to load polyfills only for users that need them, instead of for every user.");let t=r.useRef(Zr(e)),n=r.useRef(!1),i=br(),o=r.useMemo((()=>function(e,t){let n=Zr(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}));return n}(i.search,n.current?null:t.current)),[i.search]),a=_r(),s=r.useCallback(((e,t)=>{const r=Zr("function"==typeof e?e(o):e);n.current=!0,a("?"+r,t)}),[a,o]);return[o,s]}function vi(e,t){let{router:n}=hi(ci.UseSubmitImpl),{basename:i}=r.useContext(pr),o=Ir(Or.UseRouteId);return r.useCallback((function(r,a){if(void 0===a&&(a={}),"undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{action:s,method:l,encType:u,formData:c}=Qr(r,a,i),d={preventScrollReset:a.preventScrollReset,formData:c,formMethod:l,formEncType:u};e?(null==t&&zt(!1,"No routeId available for useFetcher()"),n.fetch(e,t,s,d)):n.navigate(s,Hr({},d,{replace:a.replace,fromRouteId:o}))}),[n,i,e,t,o])}ui.displayName="FormImpl",function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"}(ci||(ci={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(di||(di={}));var mi="/Users/distiller/repo/graph/ui-tooltips/src/lib/tooltip-button.tsx";const gi="inline-flex justify-center rounded-md border border-slate-300 bg-slate-50 py-2 px-4 mt-2 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700";function yi({className:e,children:t,...n}){return mt("button",{className:`${gi} ${e}`,...n,children:t},void 0,!1,{fileName:mi,lineNumber:14,columnNumber:5})}function bi({to:e,className:t,children:n,...r}){return mt(li,{className:`${gi} ${t}`,to:e,...r,children:n},void 0,!1,{fileName:mi,lineNumber:27,columnNumber:5})}class GraphTooltipService{subscribers=new Set;constructor(e){e.listen((t=>{switch(t.type){case"GraphRegenerated":case"BackgroundClick":this.hideAll();break;case"ProjectNodeClick":const n="nx-console"===e.renderMode?()=>e.broadcast({type:"ProjectOpenConfigClick",projectName:t.data.id}):void 0;this.openProjectNodeToolTip(t.ref,{id:t.data.id,tags:t.data.tags,type:t.data.type,description:t.data.description,openConfigCallback:n});break;case"TaskNodeClick":const r="nx-console"===e.renderMode?()=>e.broadcast({type:"RunTaskClick",taskId:t.data.id}):void 0;this.openTaskNodeTooltip(t.ref,{...t.data,runTaskCallback:r}),e.getTaskInputs&&e.getTaskInputs(t.data.id).then((e=>{"taskNode"===this.currentTooltip.type&&this.currentTooltip.props.id===t.data.id&&this.openTaskNodeTooltip(t.ref,{...t.data,runTaskCallback:r,inputs:e})}));break;case"EdgeClick":const i="nx-console"===e.renderMode?n=>e.broadcast({type:"FileLinkClick",sourceRoot:t.data.sourceRoot,file:n}):void 0;this.openEdgeToolTip(t.ref,{type:t.data.type,target:t.data.target,source:t.data.source,fileDependencies:t.data.fileDependencies,fileClickCallback:i})}}))}currentTooltip;openProjectNodeToolTip(e,t){this.currentTooltip={type:"projectNode",ref:e,props:t},this.broadcastChange()}openTaskNodeTooltip(e,t){this.currentTooltip={type:"taskNode",ref:e,props:t},this.broadcastChange()}openEdgeToolTip(e,t){this.currentTooltip={type:"projectEdge",ref:e,props:t},this.broadcastChange()}broadcastChange(){this.subscribers.forEach((e=>e(this.currentTooltip)))}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}hideAll(){this.currentTooltip=null,this.broadcastChange()}}var xi=n(25243);function wi(){return(0,r.useRef)(_i()).current}function _i(){return{exclude:window.exclude,watch:window.watch,localMode:window.localMode,projectGraphResponse:window.projectGraphResponse,environment:window.environment,appConfig:{...window.appConfig,showExperimentalFeatures:"true"===localStorage.getItem("showExperimentalFeatures")||window.appConfig.showExperimentalFeatures},useXstateInspect:window.useXstateInspect}}class FetchProjectGraphService{taskInputsUrl;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()}async getTaskGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}setTaskInputsUrl(e){this.taskInputsUrl=e}async getExpandedTaskInputs(e){if(!this.taskInputsUrl)return{};const t=new Request(`${this.taskInputsUrl}?taskId=${e}`,{mode:"no-cors"}),n=await fetch(t);return(await n.json())[e]}}class LocalProjectGraphService{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}async getTaskGraph(e){return new Promise((e=>e(window.taskGraphResponse)))}async getExpandedTaskInputs(e){return new Promise((t=>t(window.expandedTaskInputsResponse[e])))}}class MockProjectGraphService{projectGraphsResponse={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:"static"}],"existing-lib-1":[]},fileMap:{"existing-app-1":[{file:"some/file.ts",hash:"ecccd8481d2e5eae0e59928be1bc4c2d071729d7",deps:["existing-lib-1"]}],"exiting-lib-1":[]},affected:[],focus:null,exclude:[],groupByFolder:!1};taskGraphsResponse={taskGraphs:{},errors:{}};constructor(e=5e3){setInterval((()=>this.updateResponse()),e)}async getHash(){return new Promise((e=>e(this.projectGraphsResponse.hash)))}getProjectGraph(e){return new Promise((e=>e(this.projectGraphsResponse)))}getTaskGraph(e){return new Promise((e=>e(this.taskGraphsResponse)))}createNewProject(){const e=Math.random()>.25?"lib":"app",t=`${e}-${this.projectGraphsResponse.projects.length+1}`;return{name:t,type:e,data:{root:"app"===e?`apps/${t}`:`libs/${t}`,tags:[]}}}updateResponse(){const e=this.createNewProject(),t=this.projectGraphsResponse.projects.filter((e=>"lib"===e.type)),n=t[Math.floor(Math.random()*t.length)],r=[{source:e.name,target:n.name,type:"static"}];this.projectGraphsResponse={...this.projectGraphsResponse,projects:[...this.projectGraphsResponse.projects,e],dependencies:{...this.projectGraphsResponse.dependencies,[e.name]:r}}}}let Ei,ki;function Ni(){return void 0===Ei&&("dev"===window.environment?Ei=new FetchProjectGraphService:"watch"===window.environment?Ei=new MockProjectGraphService:"release"!==window.environment&&"nx-console"!==window.environment||(Ei="build"===window.localMode?new LocalProjectGraphService:new FetchProjectGraphService)),Ei}function Si(){const e=_i();if(!ki){const t=Ni();ki=new xi.GraphService("cytoscape-graph",Ai("dark","light"),"nx-console"===e.environment?"nx-console":void 0,"TB",(e=>t.getExpandedTaskInputs(e)))}return ki}const Pi=document.documentElement,Ci="nx-dep-graph-theme";let Ti;function ji(e){const t=e.matches?"dark":"light";Di(t),Ti=t}function Di(e){"dark"===e?(Pi.classList.add("dark"),Pi.classList.remove("light")):(Pi.classList.add("light"),Pi.classList.remove("dark"))}function Oi(e){if(!("matchMedia"in window))return;const t=window.matchMedia("(prefers-color-scheme: dark)");if("system"!==e)t.removeEventListener("change",ji),Di(e),Ti=e;else{const e=t.matches?"dark":"light";t.addEventListener("change",ji),Di(e),Ti=e}localStorage.setItem(Ci,e),Si().theme=Ti}function Ai(e,t){return"dark"===Ti?e:t}const Mi="nx-dep-graph-rankdir";let Ri;function Ii(e){Ri=e,localStorage.setItem(Mi,e),Si().rankDir=Ri}const Li=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))}));const Bi=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 9l-3 3m0 0l3 3m-3-3h7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Fi=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}))}));var zi=n(87608),Vi=n.n(zi),Gi="/Users/distiller/repo/graph/client/src/app/ui-components/debugger-panel.tsx";const Ui=(0,r.memo)((function({projects:e,selectedProject:t,selectedProjectChange:n,lastPerfReport:r}){return mt("div",{"data-cy":"debugger-panel",className:"flex-column flex w-auto items-center items-center justify-items-center justify-items-center gap-4 border-b border-slate-900/10 bg-slate-50 p-4 transition-all dark:border-slate-300/10 dark:bg-transparent",children:[mt("h4",{className:"dark:text-sidebar-title-dark mr-4 text-lg font-normal",children:"Debugger"},void 0,!1,{fileName:Gi,lineNumber:23,columnNumber:7}),mt(St,{"data-cy":"project-select",defaultValue:t,onChange:e=>n(e.currentTarget.value),children:e.map((e=>mt("option",{value:e.id,children:e.label},e.id,!1,{fileName:Gi,lineNumber:33,columnNumber:13})))},void 0,!1,{fileName:Gi,lineNumber:26,columnNumber:7}),mt("p",{className:"text-sm",children:["Last render took ",r.renderTime,"ms:"," ",mt("b",{className:"text-medium font-mono",children:[r.numNodes," nodes"]},void 0,!0,{fileName:Gi,lineNumber:41,columnNumber:9})," ","|"," ",mt("b",{className:"text-medium font-mono",children:[r.numEdges," edges"]},void 0,!0,{fileName:Gi,lineNumber:43,columnNumber:9}),"."]},void 0,!0,{fileName:Gi,lineNumber:39,columnNumber:7})]},void 0,!0,{fileName:Gi,lineNumber:19,columnNumber:5})}));function Wi(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Wi),r}var qi=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qi||{}),Hi=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Hi||{});function Yi({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=$i(t,e);if(o)return Xi(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return Xi(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return Wi(e?0:1,{0:()=>null,1:()=>Xi({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return Xi(s,n,r,a)}function Xi(e,t={},n,i){let{as:o=n,children:a,refName:s="ref",...l}=Qi(e,["unmount","static"]),u=void 0!==e.ref?{[s]:e.ref}:{},c="function"==typeof a?a(t):a;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(o===r.Fragment&&Object.keys(Zi(l)).length>0){if(!(0,r.isValidElement)(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,r.cloneElement)(c,Object.assign({},$i(c.props,Zi(Qi(l,["ref"]))),d,u,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(c.ref,u.ref)))}return(0,r.createElement)(o,Object.assign({},Qi(l,["ref"]),o!==r.Fragment&&u,o!==r.Fragment&&d),c)}function $i(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let r in n)Object.assign(t,{[r](e,...t){let i=n[r];for(let n of i){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;n(e,...t)}}});return t}function Ki(e){var t;return Object.assign((0,r.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Zi(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function Qi(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Ji(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function eo(){let[e]=(0,r.useState)(Ji);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}const to="undefined"==typeof window||"undefined"==typeof document;let no=to?r.useEffect:r.useLayoutEffect;function ro(e){let t=(0,r.useRef)(e);return no((()=>{t.current=e}),[e]),t}let io=function(e){let t=ro(e);return r.default.useCallback(((...e)=>t.current(...e)),[t])},oo=Symbol();function ao(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=io((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[oo])))?void 0:n}let so={serverHandoffComplete:!1};function lo(){let[e,t]=(0,r.useState)(so.serverHandoffComplete);return(0,r.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,r.useEffect)((()=>{!1===so.serverHandoffComplete&&(so.serverHandoffComplete=!0)}),[]),e}var uo;let co=0;function fo(){return++co}let ho=null!=(uo=r.default.useId)?uo:function(){let e=lo(),[t,n]=r.default.useState(e?fo:null);return no((()=>{null===t&&n(fo())}),[t]),null!=t?""+t:void 0};var po=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(po||{});var vo=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(vo||{});function mo(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function go(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function yo(e){return to?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let bo=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var xo=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(xo||{}),wo=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wo||{}),_o=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(_o||{});function Eo(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(bo))}var ko=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ko||{});function No(e,t=0){var n;return e!==(null==(n=yo(e))?void 0:n.body)&&Wi(t,{0:()=>e.matches(bo),1(){let t=e;for(;null!==t;){if(t.matches(bo))return!0;t=t.parentElement}return!1}})}function So(e){let t=yo(e);Ji().nextFrame((()=>{t&&!No(t.activeElement,0)&&function(e){null==e||e.focus({preventScroll:!0})}(e)}))}let Po=["textarea","input"].join(",");function Co(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function To(e,t){return function(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?Co(e):e:Eo(e);r=null!=r?r:i.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},c=0,d=o.length;do{if(c>=d||c+d<=0)return 0;let e=l+c;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=o[e],null==a||a.focus(u),c+=s}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Po))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}(Eo(),t,!0,e)}function jo(e,t,n){let i=ro(t);(0,r.useEffect)((()=>{function t(e){i.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}let Do=(0,r.createContext)(null);Do.displayName="OpenClosedContext";var Oo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Oo||{});function Ao(){return(0,r.useContext)(Do)}function Mo({value:e,children:t}){return r.default.createElement(Do.Provider,{value:e},t)}function Ro(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Io(e,t){let[n,i]=(0,r.useState)((()=>Ro(e)));return no((()=>{i(Ro(e))}),[e.type,e.as]),no((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")}),[n,t]),n}var Lo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Lo||{}),Bo=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Bo||{}),Fo=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Fo||{});function zo(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=Co(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Vo={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=zo(e),i=mo(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=zo(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=zo(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Go=(0,r.createContext)(null);function Uo(e){let t=(0,r.useContext)(Go);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Uo),t}return t}function Wo(e,t){return Wi(t.type,Vo,e,t)}Go.displayName="MenuContext";let qo=r.Fragment,Ho=Ki((function(e,t){let n=(0,r.useReducer)(Wo,{menuState:1,buttonRef:(0,r.createRef)(),itemsRef:(0,r.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},s]=n,l=ao(t);!function(e,t,n=!0){let i=(0,r.useRef)(!1);function o(n,r){if(!i.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=r(n);if(null!==a&&a.ownerDocument.documentElement.contains(a)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!No(a,ko.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,r.useEffect)((()=>{requestAnimationFrame((()=>{i.current=n}))}),[n]);let a=(0,r.useRef)(null);jo("mousedown",(e=>{var t,n;i.current&&(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),jo("click",(e=>{!a.current||(o(e,(()=>a.current)),a.current=null)}),!0),jo("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}([a,o],((e,t)=>{var n;s({type:1}),No(t,ko.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let u=(0,r.useMemo)((()=>({open:0===i})),[i]),c=e,d={ref:l};return r.default.createElement(Go.Provider,{value:n},r.default.createElement(Mo,{value:Wi(i,{0:Oo.Open,1:Oo.Closed})},Yi({ourProps:d,theirProps:c,slot:u,defaultTag:qo,name:"Menu"})))})),Yo=Ki((function(e,t){var n;let[i,o]=Uo("Menu.Button"),a=ao(i.buttonRef,t),s=`headlessui-menu-button-${ho()}`,l=eo(),u=io((e=>{switch(e.key){case po.Space:case po.Enter:case po.ArrowDown:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:vo.First})));break;case po.ArrowUp:e.preventDefault(),e.stopPropagation(),o({type:0}),l.nextFrame((()=>o({type:2,focus:vo.Last})))}})),c=io((e=>{if(e.key===po.Space)e.preventDefault()})),d=io((t=>{if(go(t.currentTarget))return t.preventDefault();e.disabled||(0===i.menuState?(o({type:1}),l.nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),o({type:0})))})),f=(0,r.useMemo)((()=>({open:0===i.menuState})),[i]),h=e;return Yi({ourProps:{ref:a,id:s,type:Io(e,i.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=i.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===i.menuState,onKeyDown:u,onKeyUp:c,onClick:d},theirProps:h,slot:f,defaultTag:"button",name:"Menu.Button"})})),Xo=qi.RenderStrategy|qi.Static,$o=Ki((function(e,t){var n,i;let[o,a]=Uo("Menu.Items"),s=ao(o.itemsRef,t),l=function(...e){return(0,r.useMemo)((()=>yo(...e)),[...e])}(o.itemsRef),u=`headlessui-menu-items-${ho()}`,c=eo(),d=Ao(),f=null!==d?d===Oo.Open:0===o.menuState;(0,r.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==(null==l?void 0:l.activeElement)&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef,l]),function({container:e,accept:t,walk:n,enabled:i=!0}){let o=(0,r.useRef)(t),a=(0,r.useRef)(n);(0,r.useEffect)((()=>{o.current=t,a.current=n}),[t,n]),no((()=>{if(!e||!i)return;let t=yo(e);if(!t)return;let n=o.current,r=a.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)r(l.currentNode)}),[e,i,o,a])}({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=io((e=>{var t,n;switch(c.dispose(),e.key){case po.Space:if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),a({type:3,value:e.key});case po.Enter:if(e.preventDefault(),e.stopPropagation(),a({type:1}),null!==o.activeItemIndex){let{dataRef:e}=o.items[o.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}So(o.buttonRef.current);break;case po.ArrowDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:vo.Next});case po.ArrowUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:vo.Previous});case po.Home:case po.PageUp:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:vo.First});case po.End:case po.PageDown:return e.preventDefault(),e.stopPropagation(),a({type:2,focus:vo.Last});case po.Escape:e.preventDefault(),e.stopPropagation(),a({type:1}),Ji().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case po.Tab:e.preventDefault(),e.stopPropagation(),a({type:1}),Ji().nextFrame((()=>{To(o.buttonRef.current,e.shiftKey?xo.Previous:xo.Next)}));break;default:1===e.key.length&&(a({type:3,value:e.key}),c.setTimeout((()=>a({type:4})),350))}})),p=io((e=>{if(e.key===po.Space)e.preventDefault()})),v=(0,r.useMemo)((()=>({open:0===o.menuState})),[o]),m=e;return Yi({ourProps:{"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(i=o.buttonRef.current)?void 0:i.id,id:u,onKeyDown:h,onKeyUp:p,role:"menu",tabIndex:0,ref:s},theirProps:m,slot:v,defaultTag:"div",features:Xo,visible:f,name:"Menu.Items"})})),Ko=r.Fragment,Zo=Ki((function(e,t){let{disabled:n=!1,...i}=e,[o,a]=Uo("Menu.Item"),s=`headlessui-menu-item-${ho()}`,l=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===s,u=(0,r.useRef)(null),c=ao(t,u);no((()=>{if(0!==o.menuState||!l||0===o.activationTrigger)return;let e=Ji();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=u.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[u,l,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=(0,r.useRef)({disabled:n,domRef:u});no((()=>{d.current.disabled=n}),[d,n]),no((()=>{var e,t;d.current.textValue=null==(t=null==(e=u.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,u]),no((()=>(a({type:5,id:s,dataRef:d}),()=>a({type:6,id:s}))),[d,s]);let f=io((e=>{if(n)return e.preventDefault();a({type:1}),So(o.buttonRef.current)})),h=io((()=>{if(n)return a({type:2,focus:vo.Nothing});a({type:2,focus:vo.Specific,id:s})})),p=io((()=>{n||l||a({type:2,focus:vo.Specific,id:s,trigger:0})})),v=io((()=>{n||!l||a({type:2,focus:vo.Nothing})})),m=(0,r.useMemo)((()=>({active:l,disabled:n})),[l,n]);return Yi({ourProps:{id:s,ref:c,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:f,onFocus:h,onPointerMove:p,onMouseMove:p,onPointerLeave:v,onMouseLeave:v},theirProps:i,slot:m,defaultTag:Ko,name:"Menu.Item"})})),Qo=Object.assign(Ho,{Button:Yo,Items:$o,Item:Zo});function Jo(){let e=(0,r.useRef)(!1);return no((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function ea(e,...t){e&&t.length>0&&e.classList.add(...t)}function ta(e,...t){e&&t.length>0&&e.classList.remove(...t)}var na=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(na||{});function ra(e,t,n,r){let i=n?"enter":"leave",o=Ji(),a=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=Wi(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Wi(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=Wi(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return ta(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),ea(e,...s,...u),o.nextFrame((()=>{ta(e,...u),ea(e,...l),function(e,t){let n=Ji();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(ta(e,...s),ea(e,...t.entered)),a(n))))})),o.dispose}function ia(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let oa=(0,r.createContext)(null);oa.displayName="TransitionContext";var aa=(e=>(e.Visible="visible",e.Hidden="hidden",e))(aa||{});let sa=(0,r.createContext)(null);function la(e){return"children"in e?la(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function ua(e,t){let n=ro(e),i=(0,r.useRef)([]),o=Jo(),a=eo(),s=io(((e,t=Hi.Hidden)=>{let r=i.current.findIndex((({el:t})=>t===e));-1!==r&&(Wi(t,{[Hi.Unmount](){i.current.splice(r,1)},[Hi.Hidden](){i.current[r].state="hidden"}}),a.microTask((()=>{var e;!la(i)&&o.current&&(null==(e=n.current)||e.call(n))})))})),l=io((e=>{let t=i.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):i.current.push({el:e,state:"visible"}),()=>s(e,Hi.Unmount)})),u=(0,r.useRef)([]),c=(0,r.useRef)(Promise.resolve()),d=(0,r.useRef)({enter:[],leave:[],idle:[]}),f=io(((e,n,r)=>{u.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{u.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?c.current=c.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=io(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=u.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:i,register:l,unregister:s,onStart:f,onStop:h,wait:c,chains:d})),[l,s,i,f,h,d,c])}function ca(){}sa.displayName="NestingContext";let da=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function fa(e){var t;let n={};for(let r of da)n[r]=null!=(t=e[r])?t:ca;return n}let ha=qi.RenderStrategy,pa=Ki((function(e,t){let{beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a,enter:s,enterFrom:l,enterTo:u,entered:c,leave:d,leaveFrom:f,leaveTo:h,...p}=e,v=(0,r.useRef)(null),m=ao(v,t),g=p.unmount?Hi.Unmount:Hi.Hidden,{show:y,appear:b,initial:x}=function(){let e=(0,r.useContext)(oa);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,_]=(0,r.useState)(y?"visible":"hidden"),E=function(){let e=(0,r.useContext)(sa);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:k,unregister:N}=E,S=(0,r.useRef)(null);(0,r.useEffect)((()=>k(v)),[k,v]),(0,r.useEffect)((()=>{if(g===Hi.Hidden&&v.current)return y&&"visible"!==w?void _("visible"):Wi(w,{hidden:()=>N(v),visible:()=>k(v)})}),[w,v,k,N,y,g]);let P=ro({enter:ia(s),enterFrom:ia(l),enterTo:ia(u),entered:ia(c),leave:ia(d),leaveFrom:ia(f),leaveTo:ia(h)}),C=function(e){let t=(0,r.useRef)(fa(e));return(0,r.useEffect)((()=>{t.current=fa(e)}),[e]),t}({beforeEnter:n,afterEnter:i,beforeLeave:o,afterLeave:a}),T=lo();(0,r.useEffect)((()=>{if(T&&"visible"===w&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,w,T]);let j=x&&!b,D=!T||j||S.current===y?"idle":y?"enter":"leave",O=io((e=>Wi(e,{enter:()=>C.current.beforeEnter(),leave:()=>C.current.beforeLeave(),idle:()=>{}}))),A=io((e=>Wi(e,{enter:()=>C.current.afterEnter(),leave:()=>C.current.afterLeave(),idle:()=>{}}))),M=ua((()=>{_("hidden"),N(v)}),E);(function({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=Jo(),a=eo(),s=ro(t);no((()=>{let t=Ji();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(ra(l,n.current,"enter"===s.current,(e=>{t.dispose(),Wi(e,{[na.Ended](){i.current(s.current)},[na.Cancelled]:()=>{}})}))),t.dispose}),[t])})({container:v,classes:P,direction:D,onStart:ro((e=>{M.onStart(v,e,O)})),onStop:ro((e=>{M.onStop(v,e,A),"leave"===e&&!la(M)&&(_("hidden"),N(v))}))}),(0,r.useEffect)((()=>{!j||(g===Hi.Hidden?S.current=null:S.current=y)}),[y,j,w]);let R=p,I={ref:m};return r.default.createElement(sa.Provider,{value:M},r.default.createElement(Mo,{value:Wi(w,{visible:Oo.Open,hidden:Oo.Closed})},Yi({ourProps:I,theirProps:R,defaultTag:"div",features:ha,visible:"visible"===w,name:"Transition.Child"})))})),va=Ki((function(e,t){let{show:n,appear:i=!1,unmount:o,...a}=e,s=(0,r.useRef)(null),l=ao(s,t);lo();let u=Ao();if(void 0===n&&null!==u&&(n=Wi(u,{[Oo.Open]:!0,[Oo.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=(0,r.useState)(n?"visible":"hidden"),f=ua((()=>{d("hidden")})),[h,p]=(0,r.useState)(!0),v=(0,r.useRef)([n]);no((()=>{!1!==h&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))}),[v,n]);let m=(0,r.useMemo)((()=>({show:n,appear:i,initial:h})),[n,i,h]);(0,r.useEffect)((()=>{if(n)d("visible");else if(la(f)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")}),[n,f]);let g={unmount:o};return r.default.createElement(sa.Provider,{value:f},r.default.createElement(oa.Provider,{value:m},Yi({ourProps:{...g,as:r.Fragment,children:r.default.createElement(pa,{ref:l,...g,...a})},theirProps:{},defaultTag:r.Fragment,features:ha,visible:"visible"===c,name:"Transition"})))})),ma=Ki((function(e,t){let n=null!==(0,r.useContext)(oa),i=null!==Ao();return r.default.createElement(r.default.Fragment,null,!n&&i?r.default.createElement(va,{ref:t,...e}):r.default.createElement(pa,{ref:t,...e}))})),ga=Object.assign(va,{Child:ma,Root:va});const ya=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"}))}));const ba=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"}))}));const xa=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"}))}));var wa="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/theme-panel.tsx";function _a(){const[e,t]=(0,r.useState)(localStorage.getItem(Ci)||"system");return(0,r.useEffect)((()=>{Oi(e)}),[e]),mt(Qo,{as:"div",className:"relative inline-block text-left",children:[mt("div",{children:mt(Qo.Button,{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"theme-open-modal-button",children:[mt("span",{className:"sr-only",children:"Theme switcher"},void 0,!1,{fileName:wa,lineNumber:31,columnNumber:11}),"system"===e&&mt(ya,{className:"h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:33,columnNumber:13}),"light"===e&&mt(ba,{className:"h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:36,columnNumber:13}),"dark"===e&&mt(xa,{className:"h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:39,columnNumber:13})]},void 0,!0,{fileName:wa,lineNumber:27,columnNumber:9})},void 0,!1,{fileName:wa,lineNumber:26,columnNumber:7}),mt(ga,{as:r.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:mt(Qo.Items,{className:"absolute right-0 z-50 mt-2 w-36 origin-top-right rounded-md bg-white text-slate-500 shadow-lg ring-1 ring-slate-900/10 ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:text-slate-400 dark:ring-0",children:mt("div",{className:"px-1 py-1",children:[mt(Qo.Item,{children:({active:n})=>mt("button",{"data-cy":"system-theme-button",className:Vi()("system"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("system"),children:[mt(ya,{className:"mr-2 h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:65,columnNumber:19}),"System"]},void 0,!0,{fileName:wa,lineNumber:56,columnNumber:17})},void 0,!1,{fileName:wa,lineNumber:54,columnNumber:13}),mt(Qo.Item,{children:({active:n})=>mt("button",{"data-cy":"light-theme-button",className:Vi()("light"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("light"),children:[mt(ba,{className:"mr-2 h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:84,columnNumber:19}),"Light"]},void 0,!0,{fileName:wa,lineNumber:75,columnNumber:17})},void 0,!1,{fileName:wa,lineNumber:73,columnNumber:13}),mt(Qo.Item,{children:({active:n})=>mt("button",{"data-cy":"dark-theme-button",className:Vi()("dark"===e?"text-blue-500 dark:text-sky-500":"",n?"bg-slate-50 dark:bg-slate-600/30":"","group flex w-full items-center rounded-md px-2 py-2 text-sm"),onClick:()=>t("dark"),children:[mt(xa,{className:"mr-2 h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:wa,lineNumber:100,columnNumber:19}),"Dark"]},void 0,!0,{fileName:wa,lineNumber:91,columnNumber:17})},void 0,!1,{fileName:wa,lineNumber:89,columnNumber:13})]},void 0,!0,{fileName:wa,lineNumber:53,columnNumber:11})},void 0,!1,{fileName:wa,lineNumber:52,columnNumber:9})},void 0,!1,{fileName:wa,lineNumber:43,columnNumber:7})]},void 0,!0,{fileName:wa,lineNumber:25,columnNumber:5})}const Ea=()=>{const[e,t]=(0,r.useState)(),[n,i]=(0,r.useState)(),o=br();if(o.pathname===e)return n;t(o.pathname);const a=Kt(yl(),o).at(-1),{environment:s}=_i();let l;return l="dev"===s?{workspace:a.pathname.split("/")[1],currentPath:`/${a.pathname.split("/").slice(2).join("/")}`}:{workspace:"local",currentPath:a.pathname},i(l),l};function ka(e){return wi().appConfig.showExperimentalFeatures?r.Children.map(e.children,(e=>(0,r.cloneElement)(e,{"data-cy":"experimental-feature"}))):null}const Na=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))}));const Sa=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));var Pa="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/rankdir-panel.tsx";function Ca(){const[e,t]=(0,r.useState)(localStorage.getItem(Mi)||"TB");return(0,r.useEffect)((()=>{Ii(e)}),[e]),mt("div",{className:"relative inline-block text-left",children:mt("button",{className:"inline-flex w-full justify-center rounded-md p-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 dark:text-sky-500","data-cy":"rankdir-change-button",children:[mt("span",{className:"sr-only",children:"Graph layout direction switcher"},void 0,!1,{fileName:Pa,lineNumber:27,columnNumber:9}),"TB"===e&&mt("button",{title:"Set graph direction to left-to-right","data-cy":"lr-rankdir-button",onClick:()=>t("LR"),children:mt(Na,{className:"h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:Pa,lineNumber:34,columnNumber:13})},void 0,!1,{fileName:Pa,lineNumber:29,columnNumber:11}),"LR"===e&&mt("button",{title:"Set graph direction to top-to-bottom","data-cy":"tb-rankdir-button",onClick:()=>t("TB"),children:mt(Sa,{className:"h-4 w-4","aria-hidden":"true"},void 0,!1,{fileName:Pa,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Pa,lineNumber:38,columnNumber:11})]},void 0,!0,{fileName:Pa,lineNumber:23,columnNumber:7})},void 0,!1,{fileName:Pa,lineNumber:22,columnNumber:5})}var Ta=n(53536);const ja={on:{updateGraph:{target:"customSelected",actions:[(0,Ta.assign)(((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,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Da={entry:[(0,Ta.assign)(((e,t)=>{"focusProject"===t.type&&(e.focusedProject=t.projectName)})),"notifyGraphFocusProject"],exit:[(0,Ta.assign)((e=>{e.focusedProject=null}))],on:{incrementSearchDepth:{actions:["incrementSearchDepth","notifyGraphFocusProject"]},decrementSearchDepth:{actions:["decrementSearchDepth","notifyGraphFocusProject"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled","notifyGraphFocusProject"]},setSearchDepth:{actions:["setSearchDepth","notifyGraphFocusProject"]},unfocusProject:{target:"unselected"},updateGraph:{actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFocusProject"]}}},Oa=(e,t)=>{const n=Si();t((t=>{const{selectedProjectNames:r,perfReport:i}=n.handleProjectEvent(t);e({type:"setSelectedProjectsFromGraph",selectedProjectNames:r,perfReport:i})}))},Aa={entry:[(0,Ta.assign)(((e,t)=>{"filterByText"===t.type&&(e.textFilter=t.search)})),"notifyGraphFilterProjectsByText"],on:{clearTextFilter:{target:"unselected",actions:(0,Ta.assign)((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,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor}),"notifyGraphFilterProjectsByText"]}}},Ma={entry:[(0,Ta.assign)(((e,t)=>{"setTracingStart"===t.type?e.tracing.start=t.projectName:"setTracingEnd"===t.type&&(e.tracing.end=t.projectName)})),"notifyGraphTracing"],exit:[(0,Ta.assign)(((e,t)=>{"setTracingStart"!==t.type&&"setTracingEnd"!==t.type&&(e.tracing.start=null,e.tracing.end=null)}))],on:{clearTraceStart:{actions:[(0,Ta.assign)((e=>{e.tracing.start=null})),"notifyGraphTracing"]},clearTraceEnd:{actions:[(0,Ta.assign)((e=>{e.tracing.end=null})),"notifyGraphTracing"]}}},Ra={entry:["notifyGraphHideAllProjects"],on:{updateGraph:{target:"customSelected",actions:[(0,Ta.assign)(((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,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]}}},Ia=(0,s.createMachine)({predictableActionArguments:!0,id:"project-graph",initial:"idle",context:{projects:[],dependencies:{},affectedProjects:[],selectedProjects:[],focusedProject:null,textFilter:"",includePath:!1,searchDepth:1,searchDepthEnabled:!0,groupByFolder:!1,collapseEdges:!1,workspaceLayout:{libsDir:"",appsDir:""},fileMap:{},graphActor:null,lastPerfReport:{numEdges:0,numNodes:0,renderTime:0},tracing:{start:null,end:null,algorithm:"shortest"}},states:{idle:{},unselected:Ra,customSelected:ja,focused:Da,textFiltered:Aa,tracing:Ma},on:{setProjects:{target:"unselected",actions:["setGraph",(0,l.send)(((e,t)=>({type:"notifyGraphInitGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap,affectedProjects:e.affectedProjects,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges})),{to:e=>e.graphActor})]},setSelectedProjectsFromGraph:{actions:[(0,Ta.assign)(((e,t)=>{e.selectedProjects=t.selectedProjectNames,e.lastPerfReport=t.perfReport}))]},selectProject:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectProjects:{target:"customSelected",actions:["notifyGraphShowProjects"]},selectAll:{target:"customSelected",actions:["notifyGraphShowAllProjects"]},selectAffected:{target:"customSelected",actions:["notifyGraphShowAffectedProjects"]},deselectProject:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectProjects:[{target:"unselected",cond:"deselectLastProject"},{target:"customSelected",actions:["notifyGraphHideProjects"]}],deselectAll:{target:"unselected"},focusProject:{target:"focused"},setTracingStart:{target:"tracing"},setTracingEnd:{target:"tracing"},setCollapseEdges:{actions:["setCollapseEdges",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,fileMap:e.fileMap,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setGroupByFolder:{actions:["setGroupByFolder",(0,l.send)(((e,t)=>({type:"notifyGraphUpdateGraph",projects:e.projects,dependencies:e.dependencies,affectedProjects:e.affectedProjects,fileMap:e.fileMap,workspaceLayout:e.workspaceLayout,groupByFolder:e.groupByFolder,collapseEdges:e.collapseEdges,selectedProjects:e.selectedProjects})),{to:e=>e.graphActor})]},setIncludeProjectsByPath:{actions:[(0,Ta.assign)(((e,t)=>{e.includePath=t.includeProjectsByPath}))]},incrementSearchDepth:{actions:["incrementSearchDepth"]},decrementSearchDepth:{actions:["decrementSearchDepth"]},setSearchDepthEnabled:{actions:["setSearchDepthEnabled"]},setSearchDepth:{actions:["setSearchDepth"]},setTracingAlgorithm:{actions:[(0,Ta.assign)(((e,t)=>{e.tracing.algorithm=t.algorithm})),"notifyGraphTracing"]},filterByText:{target:"textFiltered"}}},{guards:{deselectLastProject:e=>e.selectedProjects.length<=1},actions:{setGroupByFolder:(0,Ta.assign)(((e,t)=>{"setGroupByFolder"===t.type&&(e.groupByFolder=t.groupByFolder)})),setCollapseEdges:(0,Ta.assign)(((e,t)=>{"setCollapseEdges"===t.type&&(e.collapseEdges=t.collapseEdges)})),incrementSearchDepth:(0,Ta.assign)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth+1})),decrementSearchDepth:(0,Ta.assign)((e=>{e.searchDepthEnabled=!0,e.searchDepth=e.searchDepth>1?e.searchDepth-1:1})),setSearchDepth:(0,Ta.assign)(((e,t)=>{"setSearchDepth"===t.type&&(e.searchDepthEnabled=!0,e.searchDepth=t.searchDepth>1?t.searchDepth:1)})),setSearchDepthEnabled:(0,Ta.assign)(((e,t)=>{"setSearchDepthEnabled"===t.type&&(e.searchDepthEnabled=t.searchDepthEnabled)})),setIncludeProjectsByPath:(0,Ta.assign)(((e,t)=>{"setIncludeProjectsByPath"===t.type&&(e.includePath=t.includeProjectsByPath)})),setGraph:(0,Ta.assign)(((e,t)=>{"setProjects"!==t.type&&"updateGraph"!==t.type||(e.projects=t.projects,e.dependencies=t.dependencies,e.fileMap=t.fileMap,e.graphActor=(0,o.spawn)(Oa,"graphActor"),"setProjects"===t.type&&(e.workspaceLayout=t.workspaceLayout,e.affectedProjects=t.affectedProjects))})),notifyGraphTracing:(0,l.send)(((e,t)=>({type:"notifyGraphTracing",start:e.tracing.start,end:e.tracing.end,algorithm:e.tracing.algorithm})),{to:e=>e.graphActor}),notifyGraphShowProjects:(0,l.send)(((e,t)=>{if("selectProject"===t.type||"selectProjects"===t.type)return"selectProject"===t.type?{type:"notifyGraphShowProjects",projectNames:[t.projectName]}:{type:"notifyGraphShowProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphHideProjects:(0,l.send)(((e,t)=>{if("deselectProject"===t.type||"deselectProjects"===t.type)return"deselectProject"===t.type?{type:"notifyGraphHideProjects",projectNames:[t.projectName]}:{type:"notifyGraphHideProjects",projectNames:t.projectNames}}),{to:e=>e.graphActor}),notifyGraphShowAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphShowAllProjects"})),{to:e=>e.graphActor}),notifyGraphHideAllProjects:(0,l.send)(((e,t)=>({type:"notifyGraphHideAllProjects"})),{to:e=>e.graphActor}),notifyGraphShowAffectedProjects:(0,l.send)({type:"notifyGraphShowAffectedProjects"},{to:e=>e.graphActor}),notifyGraphFocusProject:(0,l.send)(((e,t)=>({type:"notifyGraphFocusProject",projectName:e.focusedProject,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor}),notifyGraphFilterProjectsByText:(0,l.send)(((e,t)=>({type:"notifyGraphFilterProjectsByText",search:e.textFilter,includeProjectsByPath:e.includePath,searchDepth:e.searchDepthEnabled?e.searchDepth:-1})),{to:e=>e.graphActor})}});let La,Ba=(0,o.interpret)(Ia,{devTools:!!window.useXstateInspect});function Fa(){return Ba.status===o.InterpreterStatus.NotStarted&&Ba.start(),Ba}var za=n(83576);const Va=()=>{const{environment:e}=_i(),{selectedWorkspaceId:t}=kr(),[n]=pi();return(r,i)=>{let o="";return"object"==typeof r?(o="dev"===e?`/${t}${r.pathname}`:r.pathname,{...r,pathname:o,search:r.search?r.search.toString():i?n.toString():""}):"string"==typeof r?(o="dev"===e?`/${t}${r}`:r,{pathname:o,search:i?n.toString():""}):void 0}};function Ga(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}function Ua(e,t){return t.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}function Wa(e,t){let n={};return e.forEach((e=>{const r="app"===e.type||"e2e"===e.type?t.appsDir:t.libsDir,i=Ga(e.data.root,r).join("/");n.hasOwnProperty(i)||(n[i]=[]),n[i].push(e)})),n}function qa(e,t,n){return n?`${e}:${t}:${n}`:`${e}:${t}`}const Ha=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M11.54 22.351l.07.04.028.016a.76.76 0 00.723 0l.028-.015.071-.041a16.975 16.975 0 001.144-.742 19.58 19.58 0 002.683-2.282c1.944-1.99 3.963-4.98 3.963-8.827a8.25 8.25 0 00-16.5 0c0 3.846 2.02 6.837 3.963 8.827a19.58 19.58 0 002.682 2.282 16.975 16.975 0 001.145.742zM12 13.5a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))}));const Ya=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M3 2.25a.75.75 0 01.75.75v.54l1.838-.46a9.75 9.75 0 016.725.738l.108.054a8.25 8.25 0 005.58.652l3.109-.732a.75.75 0 01.917.81 47.784 47.784 0 00.005 10.337.75.75 0 01-.574.812l-3.114.733a9.75 9.75 0 01-6.594-.77l-.108-.054a8.25 8.25 0 00-5.69-.625l-2.202.55V21a.75.75 0 01-1.5 0V3A.75.75 0 013 2.25z",clipRule:"evenodd"}))}));var Xa="/Users/distiller/repo/graph/client/src/app/ui-tooltips/project-node-actions.tsx";function $a({id:e}){const t=Fa(),{start:n,end:r,algorithm:i}=t.getSnapshot().context.tracing,o=Va(),a=_r(),s=encodeURIComponent(e);return mt("div",{className:"grid grid-cols-3 gap-4",children:[mt(bi,{to:o(`/projects/${s}`,!0),children:"Focus"},void 0,!1,{fileName:Xa,lineNumber:39,columnNumber:7}),mt(yi,{onClick:function(){t.send({type:"deselectProject",projectName:e}),a(o("/projects",!0))},children:"Exclude"},void 0,!1,{fileName:Xa,lineNumber:42,columnNumber:7}),n?mt(yi,{className:"flex flex-row items-center",onClick:function(){a(o(`/projects/trace/${encodeURIComponent(n)}/${s}`,!0))},children:[mt(Ya,{className:"mr-2 h-5 w-5 text-slate-500"},void 0,!1,{fileName:Xa,lineNumber:56,columnNumber:11}),"End"]},void 0,!0,{fileName:Xa,lineNumber:52,columnNumber:9}):mt(yi,{className:"flex flex-row items-center",onClick:function(){a(o(`/projects/trace/${s}`,!0))},children:[mt(Ha,{className:"mr-2 h-5 w-5 text-slate-500"},void 0,!1,{fileName:Xa,lineNumber:48,columnNumber:11}),"Start"]},void 0,!0,{fileName:Xa,lineNumber:44,columnNumber:9})]},void 0,!0,{fileName:Xa,lineNumber:38,columnNumber:5})}const Ka=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"}))}));const Za=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}))}));var Qa="/Users/distiller/repo/graph/client/src/app/ui-tooltips/task-node-actions.tsx";function Ja(e){const[t,n]=(0,r.useState)(!1);(0,r.useEffect)((()=>{n(!1)}),[e.id]);const i=e.id.split(":")[0];return mt("div",{className:"overflow-auto w-full min-w-[350px] max-w-full rounded-md border border-slate-200 dark:border-slate-800 w-full",children:[mt("div",{className:"flex justify-between items-center w-full bg-slate-50 px-4 py-2 text-xs font-medium uppercase text-slate-500 dark:bg-slate-800 dark:text-slate-400",onClick:()=>n(!t),"data-cy":"inputs-accordion",children:[mt("span",{children:"Inputs"},void 0,!1,{fileName:Qa,lineNumber:18,columnNumber:9}),mt("span",{children:t?mt(Ka,{className:"h-4 w-4"},void 0,!1,{fileName:Qa,lineNumber:21,columnNumber:13}):mt(Za,{className:"h-4 w-4"},void 0,!1,{fileName:Qa,lineNumber:23,columnNumber:13})},void 0,!1,{fileName:Qa,lineNumber:19,columnNumber:9})]},void 0,!0,{fileName:Qa,lineNumber:13,columnNumber:7}),mt("ul",{className:`max-h-[300px] divide-y divide-slate-200 overflow-auto dark:divide-slate-800 ${!t&&"hidden"}`,children:Object.entries(e.inputs??{}).sort(ns(i)).map((([e,t])=>{if(t.length)return"general"===e||e===i?ts(t):es("external"===e?{section:"External Inputs",inputs:t}:{section:e,inputs:t})}))},void 0,!1,{fileName:Qa,lineNumber:27,columnNumber:7})]},void 0,!0,{fileName:Qa,lineNumber:12,columnNumber:5})}function es({section:e,inputs:t}){const[n,i]=(0,r.useState)(!1);return[mt("li",{className:"flex justify-between items-center whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300",onClick:()=>i(!n),"data-cy":"input-section-entry",children:[mt("span",{className:"block truncate font-normal font-bold",children:e},void 0,!1,{fileName:Qa,lineNumber:60,columnNumber:7}),mt("span",{children:n?mt(Ka,{className:"h-4 w-4"},void 0,!1,{fileName:Qa,lineNumber:63,columnNumber:11}):mt(Za,{className:"h-4 w-4"},void 0,!1,{fileName:Qa,lineNumber:65,columnNumber:11})},void 0,!1,{fileName:Qa,lineNumber:61,columnNumber:7})]},e,!0,{fileName:Qa,lineNumber:54,columnNumber:5}),n?ts(t):void 0]}function ts(e){return e.map((e=>mt("li",{className:"whitespace-nowrap px-4 py-2 text-sm font-medium text-slate-800 dark:text-slate-300",title:e,"data-cy":"input-list-entry",children:mt("span",{className:"block truncate font-normal",children:e},void 0,!1,{fileName:Qa,lineNumber:81,columnNumber:7})},e,!1,{fileName:Qa,lineNumber:75,columnNumber:5})))}function ns(e){return([t],[n])=>{const r="general",i="external";if(t===r||t===e||t===i||n===r||n===e||n===i){if(t===r)return-1;if(n===r)return 1;if(t===e)return-1;if(n===e)return 1;if(t===i)return 1;if(n===i)return-1}return t<n?-1:t>n?1:0}}var rs="/Users/distiller/repo/graph/client/src/app/ui-tooltips/graph-tooltip-display.tsx";const is=function(){if(!La){const e=Si();La=new GraphTooltipService(e)}return La}();function os(){const e=(0,za.useSyncExternalStore)((e=>is.subscribe(e)),(()=>is.currentTooltip));let t;if(e)switch(e.type){case"projectNode":t=mt(Dt,{...e.props,children:mt($a,{...e.props},void 0,!1,{fileName:rs,lineNumber:25,columnNumber:13})},void 0,!1,{fileName:rs,lineNumber:24,columnNumber:11});break;case"projectEdge":t=mt(Ct,{...e.props},void 0,!1,{fileName:rs,lineNumber:30,columnNumber:27});break;case"taskNode":t=mt(Rt,{...e.props,children:mt(Ja,{...e.props},void 0,!1,{fileName:rs,lineNumber:35,columnNumber:13})},void 0,!1,{fileName:rs,lineNumber:34,columnNumber:11})}return t?mt(yt,{content:t,open:!0,reference:e.ref,placement:"top",openAction:"manual"},void 0,!1,{fileName:rs,lineNumber:43,columnNumber:5}):null}var as="/Users/distiller/repo/graph/client/src/app/shell.tsx";function ss(){const e=Fa(),t=Si(),n=(0,za.useSyncExternalStore)((e=>t.listen(e)),(()=>t.lastPerformanceReport)),r=0!==n.numNodes,i=wi(),o=wi(),a=_r(),s=Ea(),{selectedWorkspaceId:l,selectedTaskId:u}=kr(),c=s.currentPath,d=c.startsWith("/tasks")?"/tasks":"/projects";return mt(pt.Fragment,{children:[mt("div",{className:("nx-console"===o.environment?"absolute top-5 left-5 z-50 bg-white":"relative flex h-full overflow-y-scroll")+" w-72 flex-col pb-10 shadow-lg ring-1 ring-slate-900/10 ring-opacity-10 transition-all dark:ring-slate-300/10",id:"sidebar",children:["nx-console"!==o.environment?mt(pt.Fragment,{children:[mt("div",{className:"border-b border-slate-900/10 text-slate-700 dark:border-slate-300/10 dark:bg-transparent dark:text-slate-400",children:mt("div",{className:"mx-4 my-2 flex items-center justify-between",children:[mt("svg",{className:"h-10 w-auto text-slate-900 dark:text-white",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[mt("title",{children:"Nx"},void 0,!1,{fileName:as,lineNumber:93,columnNumber:19}),mt("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"},void 0,!1,{fileName:as,lineNumber:94,columnNumber:19})]},void 0,!0,{fileName:as,lineNumber:87,columnNumber:17}),mt(St,{"data-cy":"route-select",defaultValue:c.startsWith("/projects")?"/projects":"/tasks",onChange:t=>{e.send("deselectAll"),"dev"===i.environment?a(`/${encodeURIComponent(s.workspace)}${t.currentTarget.value}`):a(`${t.currentTarget.value}`)},children:[{route:"/projects",label:"Projects"},{route:"/tasks",label:"Tasks"}].map((e=>mt("option",{value:e.route,children:e.label},e.label,!1,{fileName:as,lineNumber:117,columnNumber:21})))},void 0,!1,{fileName:as,lineNumber:96,columnNumber:17}),mt(ka,{children:mt(Ca,{},void 0,!1,{fileName:as,lineNumber:124,columnNumber:19})},void 0,!1,{fileName:as,lineNumber:123,columnNumber:17}),mt(_a,{},void 0,!1,{fileName:as,lineNumber:127,columnNumber:17})]},void 0,!0,{fileName:as,lineNumber:86,columnNumber:15})},void 0,!1,{fileName:as,lineNumber:85,columnNumber:13}),mt("a",{id:"help",className:" mt-3 flex cursor-pointer items-center px-4 text-xs hover:underline ",href:"https://nx.dev/structure/dependency-graph",rel:"noreferrer",target:"_blank",children:[mt(Li,{className:"mr-2 h-4 w-4"},void 0,!1,{fileName:as,lineNumber:145,columnNumber:15}),"Analyse and visualize your workspace."]},void 0,!0,{fileName:as,lineNumber:131,columnNumber:13})]},void 0,!0):null,mt(Gr,{},void 0,!1,{fileName:as,lineNumber:150,columnNumber:9})]},void 0,!0,{fileName:as,lineNumber:75,columnNumber:7}),mt("div",{id:"main-content",className:"flex-grow overflow-hidden transition-all",children:[i.appConfig.showDebugger?mt(Ui,{projects:i.appConfig.workspaces,selectedProject:l,lastPerfReport:n,selectedProjectChange:function(e){a(`/${encodeURIComponent(e)}${d}`)}},void 0,!1,{fileName:as,lineNumber:157,columnNumber:11}):null,r?null:mt("div",{"data-cy":"no-tasks-selected",className:"flex h-full w-full items-center justify-center text-slate-700 dark:text-slate-400",children:[mt(Bi,{className:"mr-4 h-6 w-6"},void 0,!1,{fileName:as,lineNumber:170,columnNumber:13}),mt("h4",{children:["Please select a"," ",c.startsWith("/tasks")?"task":"project"," in the sidebar."]},void 0,!0,{fileName:as,lineNumber:171,columnNumber:13})]},void 0,!0,{fileName:as,lineNumber:166,columnNumber:11}),mt("div",{className:"h-full w-full",children:[mt("div",{className:"h-full w-full cursor-pointer",id:"cytoscape-graph"},void 0,!1,{fileName:as,lineNumber:180,columnNumber:11}),mt(os,{},void 0,!1,{fileName:as,lineNumber:184,columnNumber:11}),mt(yt,{openAction:"hover",content:"Download Graph as PNG",placement:"left",children:mt("button",{type:"button",className:Vi()(r?"":"invisible opacity-0","fixed bottom-4 right-4 z-50 block h-16 w-16 transform rounded-full bg-blue-500 text-white shadow-sm transition duration-300 dark:bg-sky-500"),"data-cy":"downloadImageButton",onClick:function(){const e=Si().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:mt(Fi,{className:"absolute top-1/2 left-1/2 -mt-3 -ml-3 h-6 w-6"},void 0,!1,{fileName:as,lineNumber:200,columnNumber:15})},void 0,!1,{fileName:as,lineNumber:191,columnNumber:13})},void 0,!1,{fileName:as,lineNumber:186,columnNumber:11})]},void 0,!0,{fileName:as,lineNumber:179,columnNumber:9})]},void 0,!0,{fileName:as,lineNumber:152,columnNumber:7})]},void 0,!0)}var ls=n(52014);r.useLayoutEffect;function us(e){return"state"in e}var cs=function(e,t){return e===t},ds=function(e,t){if("state"in(i=e)&&"machine"in i){if(0===e.status&&t.current)return t.current;var n=0!==(r=e).status?r.state:r.machine.initialState;return t.current=0===e.status?n:null,n}var r,i;return us(e)?e.state:void 0};function fs(e){return function(e,t,n,i){void 0===n&&(n=cs);var o=(0,r.useRef)(null),a=(0,r.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]),s=(0,r.useCallback)((function(){return i?i(e):ds(e,o)}),[e,i]);return(0,ls.useSyncExternalStoreWithSelector)(a,s,s,t,n)}(Fa(),e)}const hs=e=>e.context.projects,ps=e=>e.context.workspaceLayout,vs=e=>e.context.selectedProjects,ms=e=>e.context.focusedProject,gs=e=>({searchDepth:e.context.searchDepth,searchDepthEnabled:e.context.searchDepthEnabled}),ys=e=>e.context.includePath,bs=e=>e.context.groupByFolder,xs=e=>e.context.collapseEdges,ws=e=>e.context.textFilter,_s=e=>e.context.affectedProjects.length>0,Es=e=>e.context.tracing;var ks="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/collapse-edges-panel.tsx";const Ns=(0,r.memo)((({collapseEdges:e,collapseEdgesChanged:t})=>mt("div",{className:"px-4",children:mt("div",{className:"flex items-start",children:[mt("div",{className:"flex h-5 items-center",children:mt("input",{id:"collapseEdges",name:"collapseEdges",value:"collapseEdges",type:"checkbox",className:"h-4 w-4 accent-purple-500",onChange:e=>t(e.target.checked),checked:e},void 0,!1,{fileName:ks,lineNumber:14,columnNumber:13})},void 0,!1,{fileName:ks,lineNumber:13,columnNumber:11}),mt("div",{className:"ml-3 text-sm",children:[mt("label",{htmlFor:"collapseEdges",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Collapse edges"},void 0,!1,{fileName:ks,lineNumber:25,columnNumber:13}),mt("p",{className:"text-slate-400 dark:text-slate-500",children:"Display edges between groups rather than libraries"},void 0,!1,{fileName:ks,lineNumber:31,columnNumber:13})]},void 0,!0,{fileName:ks,lineNumber:24,columnNumber:11})]},void 0,!0,{fileName:ks,lineNumber:12,columnNumber:9})},void 0,!1,{fileName:ks,lineNumber:11,columnNumber:7})));const Ss=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12.75 15l3-3m0 0l-3-3m3 3h-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));const Ps=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}));var Cs="/Users/distiller/repo/graph/client/src/app/ui-components/focused-panel.tsx";const Ts=(0,r.memo)((({focusedLabel:e,resetFocus:t})=>mt("div",{className:"mt-10 px-4",children:mt("div",{className:"group relative flex cursor-pointer items-center overflow-hidden rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm dark:border-slate-700 dark:bg-sky-500","data-cy":"unfocusButton",onClick:()=>t(),children:[mt("p",{className:"truncate transition duration-200 ease-in-out group-hover:opacity-60",children:[mt(Ss,{className:"-mt-1 mr-1 inline h-6 w-6"},void 0,!1,{fileName:Cs,lineNumber:19,columnNumber:13}),mt("span",{id:"focused-project-name",children:["Focused on ",e]},void 0,!0,{fileName:Cs,lineNumber:20,columnNumber:13})]},void 0,!0,{fileName:Cs,lineNumber:18,columnNumber:11}),mt("div",{className:"absolute right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300",children:["Reset",mt("span",{className:"rounded-md p-1",children:mt(Ps,{className:"h-5 w-5"},void 0,!1,{fileName:Cs,lineNumber:25,columnNumber:15})},void 0,!1,{fileName:Cs,lineNumber:24,columnNumber:13})]},void 0,!0,{fileName:Cs,lineNumber:22,columnNumber:11})]},void 0,!0,{fileName:Cs,lineNumber:13,columnNumber:9})},void 0,!1,{fileName:Cs,lineNumber:12,columnNumber:7})));var js="/Users/distiller/repo/graph/client/src/app/ui-components/checkbox-panel.tsx";const Ds=(0,r.memo)((({checked:e,checkChanged:t,label:n,description:r,name:i})=>mt("div",{className:"mt-8 px-4",children:mt("div",{className:"flex items-start",children:[mt("div",{className:"flex h-5 items-center",children:mt("input",{id:i,name:i,value:i,type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",onChange:e=>t(e.target.checked),checked:e},void 0,!1,{fileName:js,lineNumber:17,columnNumber:13})},void 0,!1,{fileName:js,lineNumber:16,columnNumber:11}),mt("div",{className:"ml-3 text-sm",children:[mt("label",{htmlFor:i,className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:n},void 0,!1,{fileName:js,lineNumber:28,columnNumber:13}),mt("p",{className:"text-slate-400 dark:text-slate-500",children:r},void 0,!1,{fileName:js,lineNumber:34,columnNumber:13})]},void 0,!0,{fileName:js,lineNumber:27,columnNumber:11})]},void 0,!0,{fileName:js,lineNumber:15,columnNumber:9})},void 0,!1,{fileName:js,lineNumber:14,columnNumber:7})));const Os=({groupByFolder:e,groupByFolderChanged:t})=>mt(Ds,{checked:e,checkChanged:t,name:"groupByFolder",label:"Group by folder",description:"Visually arrange libraries by folders."},void 0,!1,{fileName:"/Users/distiller/repo/graph/client/src/app/feature-projects/panels/group-by-folder-panel.tsx",lineNumber:13,columnNumber:5});const As=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9zm3.75 11.625a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}))}));const Ms=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"}))}));const Rs=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5"}))}));const Is=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}));var Ls="/Users/distiller/repo/graph/client/src/app/feature-projects/project-list.tsx";function Bs(e,t,n){let r={};return e.forEach((e=>{const i="app"===e.type||"e2e"===e.type?n.appsDir:n.libsDir,o=Ga(e.data.root,i).join("/");r.hasOwnProperty(o)||(r[o]=[]),r[o].push({projectGraphNode:e,isSelected:t.includes(e.name)})})),r}function Fs({project:e,tracingInfo:t}){const n=Fa(),r=_r(),i=Va();function o(e,t){t?n.send({type:"deselectProject",projectName:e}):n.send({type:"selectProject",projectName:e}),r(i("/projects",!0))}return mt("li",{className:"relative block cursor-default select-none py-1 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[mt("div",{className:"flex items-center",children:[mt(li,{"data-cy":`focus-button-${e.projectGraphNode.name}`,className:"mr-1 flex items-center rounded-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 ring-slate-200 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",title:"Focus on this library",to:i(`/projects/${encodeURIComponent(e.projectGraphNode.name)}`,!0),children:mt(As,{className:"h-5 w-5"},void 0,!1,{fileName:Ls,lineNumber:112,columnNumber:11})},void 0,!1,{fileName:Ls,lineNumber:103,columnNumber:9}),mt(ka,{children:mt("span",{className:"relative z-0 inline-flex rounded-md shadow-sm",children:[mt("button",{type:"button",title:"Start Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingStart",projectName:t});var t},className:(t.start===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-l-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:mt(Ms,{className:"h-5 w-5"},void 0,!1,{fileName:Ls,lineNumber:128,columnNumber:15})},void 0,!1,{fileName:Ls,lineNumber:118,columnNumber:13}),mt("button",{type:"button",title:"End Trace",onClick:()=>{return t=e.projectGraphNode.name,void n.send({type:"setTracingEnd",projectName:t});var t},className:(t.end===e.projectGraphNode.name?"ring-blue-500 dark:ring-sky-500":"ring-slate-200 dark:ring-slate-600")+" flex items-center rounded-r-md border-slate-300 bg-white p-1 font-medium text-slate-500 shadow-sm ring-1 transition hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:ring-slate-600 hover:dark:bg-slate-700",children:mt(Rs,{className:"h-5 w-5"},void 0,!1,{fileName:Ls,lineNumber:141,columnNumber:15})},void 0,!1,{fileName:Ls,lineNumber:131,columnNumber:13})]},void 0,!0,{fileName:Ls,lineNumber:116,columnNumber:11})},void 0,!1,{fileName:Ls,lineNumber:115,columnNumber:9}),mt("label",{className:"ml-2 block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:e.projectGraphNode.name},void 0,!1,{fileName:Ls,lineNumber:146,columnNumber:9})]},void 0,!0,{fileName:Ls,lineNumber:102,columnNumber:7}),e.isSelected?mt("span",{title:"This library is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>o(e.projectGraphNode.name,e.isSelected),children:mt(Is,{className:"h-5 w-5"},void 0,!1,{fileName:Ls,lineNumber:167,columnNumber:11})},void 0,!1,{fileName:Ls,lineNumber:160,columnNumber:9}):null]},void 0,!0,{fileName:Ls,lineNumber:101,columnNumber:5})}function zs({headerText:e="",projects:t,tracingInfo:n}){const r=Fa();let i=[...t];i.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name)));const o=t.every((e=>e.isSelected));return mt(pt.Fragment,{children:[""!==e?mt("div",{className:"relative mt-4 flex justify-between py-2 text-slate-800 dark:text-slate-200",children:[mt("h3",{className:"cursor-text text-sm font-semibold uppercase tracking-wide lg:text-xs",children:e},void 0,!1,{fileName:Ls,lineNumber:207,columnNumber:11}),mt("span",{title:o?`Hide all ${e} projects`:`Show all ${e} projects`,className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-sm font-semibold uppercase tracking-wide lg:text-xs","data-cy":`toggle-folder-visibility-button-${e}`,onClick:()=>function(e){const n=t.map((e=>e.projectGraphNode.name));e?r.send({type:"deselectProjects",projectNames:n}):r.send({type:"selectProjects",projectNames:n})}(o),children:mt(Is,{className:"h-5 w-5"},void 0,!1,{fileName:Ls,lineNumber:221,columnNumber:13})},void 0,!1,{fileName:Ls,lineNumber:211,columnNumber:11})]},void 0,!0,{fileName:Ls,lineNumber:206,columnNumber:9}):null,mt("ul",{className:"mt-2 -ml-3",children:i.map((e=>mt(Fs,{project:e,tracingInfo:n},e.projectGraphNode.name,!1,{fileName:Ls,lineNumber:228,columnNumber:13})))},void 0,!1,{fileName:Ls,lineNumber:225,columnNumber:7})]},void 0,!0)}function Vs(){const e=fs(Es),t=fs(hs),n=fs(ps),r=fs(vs),i=Ua("app",t),o=Ua("lib",t),a=Ua("e2e",t),s=Bs(i,r,n),l=Bs(o,r,n),u=Bs(a,r,n),c=Object.keys(s).sort(),d=Object.keys(l).sort(),f=Object.keys(u).sort();return mt("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"},void 0,!1,{fileName:Ls,lineNumber:275,columnNumber:7}),c.map((t=>mt(zs,{headerText:t,projects:s[t],tracingInfo:e},"app-"+t,!1,{fileName:Ls,lineNumber:281,columnNumber:11}))),mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"},void 0,!1,{fileName:Ls,lineNumber:290,columnNumber:7}),f.map((t=>mt(zs,{headerText:t,projects:u[t],tracingInfo:e},"e2e-"+t,!1,{fileName:Ls,lineNumber:296,columnNumber:11}))),mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"},void 0,!1,{fileName:Ls,lineNumber:305,columnNumber:7}),d.map((t=>mt(zs,{headerText:t,projects:l[t],tracingInfo:e},"lib-"+t,!1,{fileName:Ls,lineNumber:311,columnNumber:11})))]},void 0,!0,{fileName:Ls,lineNumber:274,columnNumber:5})}const Gs=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"}))}));const Us=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}));var Ws="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/search-depth.tsx";const qs=(0,r.memo)((({searchDepth:e,searchDepthEnabled:t,searchDepthFilterEnabledChange:n,decrementDepthFilter:r,incrementDepthFilter:i})=>mt("div",{className:"mt-4 px-4",children:[mt("div",{className:"mt-4 flex items-start",children:[mt("div",{className:"flex h-5 items-center",children:mt("input",{id:"depthFilter",name:"depthFilter",value:"depthFilterActivated",type:"checkbox",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:t,onChange:e=>n(e.target.checked)},void 0,!1,{fileName:Ws,lineNumber:24,columnNumber:13})},void 0,!1,{fileName:Ws,lineNumber:23,columnNumber:11}),mt("div",{className:"ml-3 text-sm",children:[mt("label",{htmlFor:"depthFilter",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Activate proximity"},void 0,!1,{fileName:Ws,lineNumber:37,columnNumber:13}),mt("p",{className:"text-slate-400 dark:text-slate-500",children:"Explore connected libraries step by step."},void 0,!1,{fileName:Ws,lineNumber:43,columnNumber:13})]},void 0,!0,{fileName:Ws,lineNumber:36,columnNumber:11})]},void 0,!0,{fileName:Ws,lineNumber:22,columnNumber:9}),mt("div",{className:"mt-3 px-10",children:mt("div",{className:"flex rounded-md shadow-sm",children:[mt("button",{"data-cy":"decrement-depth-filter",title:"Remove ancestor level",className:"inline-flex items-center rounded-l-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:r,children:mt(Gs,{className:"h-4 w-4"},void 0,!1,{fileName:Ws,lineNumber:56,columnNumber:15})},void 0,!1,{fileName:Ws,lineNumber:50,columnNumber:13}),mt("span",{id:"depthFilterValue","data-cy":"depth-value",className:"block w-full flex-1 rounded-none border-t border-b border-slate-300 bg-white p-1.5 text-center font-mono dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:e},void 0,!1,{fileName:Ws,lineNumber:58,columnNumber:13}),mt("button",{"data-cy":"increment-depth-filter",title:"Add ancestor level",className:"inline-flex items-center rounded-r-md border border-slate-300 bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",onClick:i,children:mt(Us,{className:"h-4 w-4"},void 0,!1,{fileName:Ws,lineNumber:71,columnNumber:15})},void 0,!1,{fileName:Ws,lineNumber:65,columnNumber:13})]},void 0,!0,{fileName:Ws,lineNumber:49,columnNumber:11})},void 0,!1,{fileName:Ws,lineNumber:48,columnNumber:9})]},void 0,!0,{fileName:Ws,lineNumber:21,columnNumber:7})));const Hs=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"}))}));const Ys=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"}))}));var Xs="/Users/distiller/repo/graph/client/src/app/ui-components/show-hide-all.tsx";const $s=(0,r.memo)((({showAll:e,hideAll:t,showAffected:n,hasAffected:r,label:i})=>mt("div",{className:"mt-8 px-4",children:[mt("button",{onClick:e,type:"button",className:"flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"selectAllButton",children:[mt(Is,{className:"-ml-1 mr-2 h-5 w-5 text-slate-400"},void 0,!1,{fileName:Xs,lineNumber:28,columnNumber:11}),"Show all ",i]},void 0,!0,{fileName:Xs,lineNumber:22,columnNumber:9}),r?mt("button",{onClick:n,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-pink-500 bg-pink-400 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-pink-500 dark:border-fuchsia-800 dark:bg-fuchsia-700 dark:text-white hover:dark:bg-fuchsia-600","data-cy":"affectedButton",children:[mt(Hs,{className:"-ml-1 mr-2 h-5 w-5 text-white"},void 0,!1,{fileName:Xs,lineNumber:39,columnNumber:13}),"Show affected ",i]},void 0,!0,{fileName:Xs,lineNumber:33,columnNumber:11}):null,mt("button",{onClick:t,type:"button",className:"mt-3 flex w-full items-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700","data-cy":"deselectAllButton",children:[mt(Ys,{className:"-ml-1 mr-2 h-5 w-5 text-slate-500"},void 0,!1,{fileName:Xs,lineNumber:50,columnNumber:11}),"Hide all ",i]},void 0,!0,{fileName:Xs,lineNumber:44,columnNumber:9})]},void 0,!0,{fileName:Xs,lineNumber:21,columnNumber:7})));var Ks="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/text-filter-panel.tsx";function Zs({textFilter:e,resetTextFilter:t,updateTextFilter:n,toggleIncludeLibsInPathChange:r,includePath:i}){return mt("div",{children:[mt("div",{className:"mt-10 px-4",children:mt(_t,{resetTextFilter:t,updateTextFilter:n,initialText:"",placeholderText:"lib name, other lib name"},void 0,!1,{fileName:Ks,lineNumber:21,columnNumber:9})},void 0,!1,{fileName:Ks,lineNumber:20,columnNumber:7}),mt("div",{className:"mt-4 px-4",children:mt("div",{className:"flex items-start",children:[mt("div",{className:"flex h-5 items-center",children:mt("input",{disabled:0===e.length,id:"includeInPath",name:"textFilterCheckbox",type:"checkbox",value:"includeInPath",className:"h-4 w-4 accent-blue-500 dark:accent-sky-500",checked:i,onChange:r},void 0,!1,{fileName:Ks,lineNumber:32,columnNumber:13})},void 0,!1,{fileName:Ks,lineNumber:31,columnNumber:11}),mt("div",{className:"ml-3 text-sm",children:[mt("label",{htmlFor:"includeInPath",className:"cursor-pointer font-medium text-slate-600 dark:text-slate-400",children:"Include related libraries"},void 0,!1,{fileName:Ks,lineNumber:44,columnNumber:13}),mt("p",{className:"text-slate-400 dark:text-slate-500",children:"Show libraries that are related to your search."},void 0,!1,{fileName:Ks,lineNumber:50,columnNumber:13})]},void 0,!0,{fileName:Ks,lineNumber:43,columnNumber:11})]},void 0,!0,{fileName:Ks,lineNumber:30,columnNumber:9})},void 0,!1,{fileName:Ks,lineNumber:29,columnNumber:7})]},void 0,!0,{fileName:Ks,lineNumber:19,columnNumber:5})}const Qs=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))}));var Js="/Users/distiller/repo/graph/client/src/app/feature-projects/panels/tracing-panel.tsx";const el=(0,r.memo)((({start:e,end:t,algorithm:n,setAlgorithm:r,resetStart:i,resetEnd:o})=>mt("div",{className:"mt-10 px-4",children:mt("div",{className:"transition duration-200 ease-in-out group-hover:opacity-60",children:[mt("h3",{className:"cursor-text pb-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Tracing Path"},void 0,!1,{fileName:Js,lineNumber:31,columnNumber:11}),mt("div",{className:"mb-3 flex cursor-pointer flex-row rounded-md border text-center text-xs dark:border-slate-600",children:[mt("button",{onClick:()=>r("shortest"),className:("shortest"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-l-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:mt("span",{children:"Shortest"},void 0,!1,{fileName:Js,lineNumber:43,columnNumber:15})},void 0,!1,{fileName:Js,lineNumber:35,columnNumber:13}),mt("button",{onClick:()=>r("all"),className:("all"===n?"border-blue-500 dark:border-sky-500":"border-slate-300 dark:border-slate-600")+" flex-1 rounded-r-md border bg-slate-50 py-2 px-4 text-slate-500 hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-300 hover:dark:bg-slate-700",children:mt("span",{children:"All"},void 0,!1,{fileName:Js,lineNumber:53,columnNumber:15})},void 0,!1,{fileName:Js,lineNumber:45,columnNumber:13})]},void 0,!0,{fileName:Js,lineNumber:34,columnNumber:11}),mt("div",{className:"flex flex-row items-center truncate ",children:[mt(Ms,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"},void 0,!1,{fileName:Js,lineNumber:58,columnNumber:13}),e?mt("div",{className:"group relative flex-1 cursor-pointer flex-col items-center overflow-hidden","data-cy":"resetTraceButton",onClick:i,children:[mt("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:mt("span",{children:e},void 0,!1,{fileName:Js,lineNumber:66,columnNumber:19})},void 0,!1,{fileName:Js,lineNumber:65,columnNumber:17}),mt("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",mt("span",{className:"rounded-md p-1",children:mt(Ps,{className:"h-5 w-5"},void 0,!1,{fileName:Js,lineNumber:72,columnNumber:21})},void 0,!1,{fileName:Js,lineNumber:71,columnNumber:19})]},void 0,!0,{fileName:Js,lineNumber:69,columnNumber:17})]},void 0,!0,{fileName:Js,lineNumber:60,columnNumber:15}):mt("p",{className:"text-sm text-slate-500",children:"Select start project"},void 0,!1,{fileName:Js,lineNumber:77,columnNumber:15})]},void 0,!0,{fileName:Js,lineNumber:57,columnNumber:11}),mt("div",{children:mt(Qs,{className:"h-5 w-5 text-slate-500 dark:text-slate-400"},void 0,!1,{fileName:Js,lineNumber:82,columnNumber:13})},void 0,!1,{fileName:Js,lineNumber:81,columnNumber:11}),mt("div",{className:"flex flex-row items-center truncate ",children:[mt(Rs,{className:"mr-2 h-5 w-5 text-slate-500 dark:text-slate-400"},void 0,!1,{fileName:Js,lineNumber:86,columnNumber:13}),t?mt("div",{className:" group relative flex-1 cursor-pointer flex-col items-center overflow-hidden ","data-cy":"resetTraceButton",onClick:o,children:[mt("div",{className:"flex-1 truncate rounded-md border border-slate-200 bg-blue-500 p-2 text-slate-50 shadow-sm transition duration-200 ease-in-out group-hover:opacity-60 dark:border-slate-700 dark:bg-sky-500",children:mt("span",{children:t},void 0,!1,{fileName:Js,lineNumber:95,columnNumber:19})},void 0,!1,{fileName:Js,lineNumber:94,columnNumber:17}),mt("div",{className:"absolute top-2 right-2 flex translate-x-32 items-center rounded-md bg-white pl-2 text-sm font-medium text-slate-700 shadow-sm ring-1 ring-slate-500 transition-all transition duration-200 ease-in-out group-hover:translate-x-0 dark:bg-slate-800 dark:text-slate-300 dark:ring-slate-700",children:["Reset",mt("span",{className:"rounded-md p-1",children:mt(Ps,{className:"h-5 w-5"},void 0,!1,{fileName:Js,lineNumber:101,columnNumber:21})},void 0,!1,{fileName:Js,lineNumber:100,columnNumber:19})]},void 0,!0,{fileName:Js,lineNumber:98,columnNumber:17})]},void 0,!0,{fileName:Js,lineNumber:89,columnNumber:15}):mt("p",{className:"text-sm text-slate-500",children:"Select end project"},void 0,!1,{fileName:Js,lineNumber:106,columnNumber:15})]},void 0,!0,{fileName:Js,lineNumber:85,columnNumber:11})]},void 0,!0,{fileName:Js,lineNumber:30,columnNumber:9})},void 0,!1,{fileName:Js,lineNumber:29,columnNumber:7})));var tl="/Users/distiller/repo/graph/client/src/app/feature-projects/projects-sidebar.tsx";function nl(){const e=wi(),t=Fa(),n=fs(ms),i=fs(gs),o=fs(ys),a=fs(ws),s=fs(_s),l=fs(bs),u=fs(xs),c=t.getSnapshot().matches("tracing"),d=fs(Es),f=Ni(),h=kr(),p=Ea(),[v,m]=pi(),g=Lr("selectedWorkspace"),y=kr(),b=_r(),x=Va();(0,r.useEffect)((()=>{t.send({type:"setProjects",projects:g.projects,dependencies:g.dependencies,fileMap:g.fileMap,affectedProjects:g.affected,workspaceLayout:g.layout})}),[g]),(0,r.useEffect)((()=>{switch(p.currentPath){case"/projects/all":t.send({type:"selectAll"});break;case"/projects/affected":t.send({type:"selectAffected"})}}),[p]),(0,r.useEffect)((()=>{h.focusedProject&&t.send({type:"focusProject",projectName:h.focusedProject}),h.startTrace&&t.send({type:"setTracingStart",projectName:h.startTrace}),h.endTrace&&t.send({type:"setTracingEnd",projectName:h.endTrace})}),[h]),(0,r.useEffect)((()=>{if(v.has("groupByFolder")&&!1===l?t.send({type:"setGroupByFolder",groupByFolder:!0}):v.has("groupByFolder")||!0!==l||t.send({type:"setGroupByFolder",groupByFolder:!1}),v.has("collapseEdges")&&!1===u?t.send({type:"setCollapseEdges",collapseEdges:!0}):v.has("collapseEdges")||!0!==u||t.send({type:"setCollapseEdges",collapseEdges:!1}),v.has("searchDepth")){const e=parseInt(v.get("searchDepth"),10);0===e&&!1!==i.searchDepthEnabled?t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!1}):0!==e&&t.send({type:"setSearchDepth",searchDepth:e})}else!1!==i.searchDepthEnabled&&1===i.searchDepth||(t.send({type:"setSearchDepthEnabled",searchDepthEnabled:!0}),t.send({type:"setSearchDepth",searchDepth:1}));if(v.has("traceAlgorithm")){const e=v.get("traceAlgorithm");"shortest"!==e&&"all"!==e||t.send({type:"setTracingAlgorithm",algorithm:e})}else"shortest"!==d.algorithm&&t.send({type:"setTracingAlgorithm",algorithm:"shortest"})}),[v]),((e,t,n)=>{const i=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{n&&(i.current=e)}),[e,n]),(0,r.useEffect)((()=>{if(n&&null!==t){let e=setInterval((()=>{i.current()}),t);return()=>clearInterval(e)}}),[t,n])})((()=>{const n=y.selectedWorkspaceId??e.appConfig.defaultWorkspaceId,r=e.appConfig.workspaces.find((e=>e.id===n));(async()=>{const e=await f.getProjectGraph(r.projectGraphUrl);t.send({type:"updateGraph",projects:e.projects,dependencies:e.dependencies,fileMap:e.fileMap})})()}),5e3,e.watch);const w=(0,r.useCallback)((e=>{t.send({type:"filterByText",search:e}),b(x("/projects",!0))}),[t]);return mt(pt.Fragment,{children:[n?mt(Ts,{focusedLabel:n,resetFocus:function(){t.send({type:"unfocusProject"}),b(x("/projects",!0))}},void 0,!1,{fileName:tl,lineNumber:333,columnNumber:9}):null,c?mt(el,{start:d.start,end:d.end,algorithm:d.algorithm,setAlgorithm:function(e){m((t=>(t.set("traceAlgorithm",e),t)))},resetStart:function(){t.send({type:"clearTraceStart"}),b(x("/projects",!0))},resetEnd:function(){t.send({type:"clearTraceEnd"}),b(x("/projects",!0))}},void 0,!1,{fileName:tl,lineNumber:339,columnNumber:9}):null,mt(Zs,{includePath:o,resetTextFilter:function(){t.send({type:"clearTextFilter"})},textFilter:a,toggleIncludeLibsInPathChange:function(){t.send({type:"setIncludeProjectsByPath",includeProjectsByPath:!o})},updateTextFilter:w},void 0,!1,{fileName:tl,lineNumber:349,columnNumber:7}),mt("div",{children:[mt($s,{hideAll:function(){t.send({type:"deselectAll"}),b(x("/projects",!0))},showAll:function(){b(x("/projects/all",!0))},showAffected:function(){b(x("/projects/affected",!0))},hasAffected:s,label:"projects"},void 0,!1,{fileName:tl,lineNumber:358,columnNumber:9}),mt(Os,{groupByFolder:l,groupByFolderChanged:function(e){m((t=>(e?t.set("groupByFolder","true"):t.delete("groupByFolder"),t)))}},void 0,!1,{fileName:tl,lineNumber:366,columnNumber:9}),mt(qs,{searchDepth:i.searchDepth,searchDepthEnabled:i.searchDepthEnabled,searchDepthFilterEnabledChange:function(e){m((t=>(e&&i.searchDepth>1?t.set("searchDepth",i.searchDepth.toString()):e&&1===i.searchDepth?t.delete("searchDepth"):t.set("searchDepth","0"),t)))},incrementDepthFilter:function(){const e=i.searchDepth+1;m((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))},decrementDepthFilter:function(){const e=1===i.searchDepth?1:i.searchDepth-1;m((t=>(1===e?t.delete("searchDepth"):t.set("searchDepth",e.toString()),t)))}},void 0,!1,{fileName:tl,lineNumber:371,columnNumber:9}),mt(ka,{children:mt("div",{className:"mx-4 mt-4 rounded-lg border-2 border-dashed border-purple-500 p-4 shadow-lg dark:border-purple-600 dark:bg-[#0B1221]",children:[mt("h3",{className:"cursor-text px-4 py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:"Experimental Features"},void 0,!1,{fileName:tl,lineNumber:381,columnNumber:13}),mt(Ns,{collapseEdges:u,collapseEdgesChanged:function(e){m((t=>(e?t.set("collapseEdges","true"):t.delete("collapseEdges"),t)))}},void 0,!1,{fileName:tl,lineNumber:384,columnNumber:13})]},void 0,!0,{fileName:tl,lineNumber:380,columnNumber:11})},void 0,!1,{fileName:tl,lineNumber:379,columnNumber:9})]},void 0,!0,{fileName:tl,lineNumber:357,columnNumber:7}),"nx-console"!==e.environment?mt(Vs,{},void 0,!1,{fileName:tl,lineNumber:393,columnNumber:9}):null]},void 0,!0)}const rl=r.forwardRef((function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}))}));var il="/Users/distiller/repo/graph/client/src/app/feature-tasks/task-graph-error-tooltip.tsx";const ol=({error:e})=>mt(pt.Fragment,{children:[mt("h2",{className:"text-lg font-light text-slate-400 dark:text-slate-500",children:"There was a problem calculating the task graph for this task"},void 0,!1,{fileName:il,lineNumber:4,columnNumber:7}),mt("p",{children:e},void 0,!1,{fileName:il,lineNumber:7,columnNumber:7})]},void 0,!0);var al="/Users/distiller/repo/graph/client/src/app/feature-tasks/task-list.tsx";function sl({project:e,toggleTask:t}){return mt("li",{className:"relative block cursor-default select-none pb-0 pl-2 pr-6 text-xs text-slate-600 dark:text-slate-400",children:[mt("div",{className:"flex items-center",children:mt("label",{className:"block w-full cursor-pointer truncate rounded-md p-2 font-mono font-normal transition hover:bg-slate-50 hover:dark:bg-slate-700","data-project":e.projectGraphNode.name,title:e.projectGraphNode.name,"data-active":e.isSelected.toString(),onClick:()=>e.error?null:t(e.projectGraphNode.name),children:e.projectGraphNode.name},void 0,!1,{fileName:al,lineNumber:32,columnNumber:9})},void 0,!1,{fileName:al,lineNumber:31,columnNumber:7}),e.error?mt(yt,{content:mt(ol,{error:e.error},void 0,!1,{fileName:al,lineNumber:47,columnNumber:21}),openAction:"click",strategy:"fixed",children:mt("span",{className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",children:mt(rl,{className:"h-5 w-5 text-yellow-500 dark:text-yellow-400","aria-hidden":"true"},void 0,!1,{fileName:al,lineNumber:52,columnNumber:13})},void 0,!1,{fileName:al,lineNumber:51,columnNumber:11})},void 0,!1,{fileName:al,lineNumber:46,columnNumber:9}):null,e.isSelected?mt("span",{title:"This task is visible",className:"absolute inset-y-0 right-0 flex cursor-pointer items-center text-blue-500 dark:text-sky-500",onClick:()=>t(e.projectGraphNode.name),children:mt(Is,{className:"h-5 w-5"},void 0,!1,{fileName:al,lineNumber:66,columnNumber:11})},void 0,!1,{fileName:al,lineNumber:61,columnNumber:9}):null]},void 0,!0,{fileName:al,lineNumber:30,columnNumber:5})}function ll({headerText:e="",projects:t,toggleTask:n}){let r=[...t];return r.sort(((e,t)=>e.projectGraphNode.name.localeCompare(t.projectGraphNode.name))),mt(pt.Fragment,{children:[""!==e?mt("h3",{className:"mt-4 cursor-text py-2 text-sm font-semibold uppercase tracking-wide text-slate-800 dark:text-slate-200 lg:text-xs",children:e},void 0,!1,{fileName:al,lineNumber:90,columnNumber:9}):null,mt("ul",{className:"mt-2 -ml-3",children:r.map((e=>mt(sl,{project:e,toggleTask:n},e.projectGraphNode.name,!1,{fileName:al,lineNumber:97,columnNumber:13})))},void 0,!1,{fileName:al,lineNumber:94,columnNumber:7})]},void 0,!0)}function ul(e,t,n,r){const i=qa(e.name,n);return{projectGraphNode:e,isSelected:t.includes(e.name),error:r?.[i]??null}}function cl({projects:e,workspaceLayout:t,selectedTarget:n,selectedProjects:r,toggleProject:i,children:o,errors:a}){const s=e.filter((e=>e.data.targets?.hasOwnProperty(n))).sort(((e,t)=>e.name.localeCompare(t.name))),l=Ua("app",s),u=Ua("lib",s),c=Ua("e2e",s),d=Wa(l,t),f=Wa(u,t),h=Wa(c,t),p=Object.keys(d).sort(),v=Object.keys(f).sort(),m=Object.keys(h).sort();return mt("div",{id:"project-lists",className:"mt-8 border-t border-slate-400/10 px-4",children:[o,mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"app projects"},void 0,!1,{fileName:al,lineNumber:172,columnNumber:7}),p.map((e=>mt(ll,{headerText:e,projects:d[e].map((e=>ul(e,r,n,a))),toggleTask:i},"app-"+e,!1,{fileName:al,lineNumber:178,columnNumber:11}))),mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"e2e projects"},void 0,!1,{fileName:al,lineNumber:194,columnNumber:7}),m.map((e=>mt(ll,{headerText:e,projects:h[e].map((e=>ul(e,r,n,a))),toggleTask:i},"e2e-"+e,!1,{fileName:al,lineNumber:200,columnNumber:11}))),mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"lib projects"},void 0,!1,{fileName:al,lineNumber:216,columnNumber:7}),v.map((e=>mt(ll,{headerText:e,projects:f[e].map((e=>ul(e,r,n,a))),toggleTask:i},"lib-"+e,!1,{fileName:al,lineNumber:222,columnNumber:11})))]},void 0,!0,{fileName:al,lineNumber:170,columnNumber:5})}var dl="/Users/distiller/repo/graph/client/src/app/feature-tasks/tasks-sidebar.tsx";function fl(){const e=Si(),t=_r(),n=kr(),i=Va(),[o,a]=pi(),s="true"===o.get("groupByProject"),l=Lr("selectedWorkspace"),u=l.layout,c=Lr("selectedTarget"),{taskGraphs:d,errors:f}=c;let{projects:h,targets:p}=l;const v=n.selectedTarget??p[0],m=Ea().currentPath===`/tasks/${v}/all`,g=h.filter((e=>e.data.targets?.hasOwnProperty(v)&&!f?.hasOwnProperty(qa(e.name,v)))),y=(0,r.useMemo)((()=>m?g.map((({name:e})=>e)):o.get("projects")?.split(" ")??[]),[g,o,m]);function b(){o.delete("projects"),t(i({pathname:`/tasks/${encodeURIComponent(v)}`,search:o.toString()},!1))}return(0,r.useEffect)((()=>{e.handleTaskEvent({type:"notifyTaskGraphSetProjects",projects:l.projects,taskGraphs:d})}),[l]),(0,r.useEffect)((()=>{s?e.handleTaskEvent({type:"setGroupByProject",groupByProject:!0}):e.handleTaskEvent({type:"setGroupByProject",groupByProject:!1})}),[o]),(0,r.useEffect)((()=>{e.handleTaskEvent({type:"notifyTaskGraphSetTasks",taskIds:y.map((e=>qa(e,v)))})}),[e,y,v]),mt(pt.Fragment,{children:[mt($s,{showAll:()=>(o.delete("projects"),void t(i({pathname:`/tasks/${encodeURIComponent(v)}/all`,search:o.toString()},!1))),hideAll:()=>b(),showAffected:()=>{},hasAffected:!1,label:"tasks"},void 0,!1,{fileName:dl,lineNumber:207,columnNumber:7}),mt(Ds,{checked:s,checkChanged:function(e){a((t=>(e?t.set("groupByProject","true"):t.delete("groupByProject"),t)),{relative:"path"})},name:"groupByProject",label:"Group by project",description:"Visually arrange tasks by project."},void 0,!1,{fileName:dl,lineNumber:215,columnNumber:7}),mt(cl,{projects:h,selectedProjects:y,workspaceLayout:u,selectedTarget:v,toggleProject:function(e){y.includes(e)?function(e){const n=y.filter((t=>t!==e));0===n.length?o.delete("projects"):o.set("projects",n.join(" "));t(i({pathname:`/tasks/${encodeURIComponent(v)}`,search:o.toString()},!1))}(e):function(e){const n=[...y,e],r=n.length===g.length;r?o.delete("projects"):o.set("projects",n.join(" "));t(i({pathname:r?`/tasks/${encodeURIComponent(v)}/all`:`/tasks/${encodeURIComponent(v)}`,search:o.toString()},!1))}(e)},errors:f,children:[mt("label",{htmlFor:"selectedTarget",className:"my-2 block text-sm font-medium text-gray-700",children:"Target Name"},void 0,!1,{fileName:dl,lineNumber:231,columnNumber:9}),mt(St,{id:"selectedTarget",className:"w-full","data-cy":"selected-target-dropdown",defaultValue:v,onChange:e=>{var r;(r=e.currentTarget.value)!==v&&(b(),n.selectedTarget?t({pathname:`../${encodeURIComponent(r)}`,search:o.toString()}):t({pathname:`${encodeURIComponent(r)}`,search:o.toString()}))},children:p.map((e=>mt("option",{value:e,children:e},e,!1,{fileName:dl,lineNumber:245,columnNumber:13})))},void 0,!1,{fileName:dl,lineNumber:237,columnNumber:9})]},void 0,!0,{fileName:dl,lineNumber:223,columnNumber:7})]},void 0,!0)}var hl="/Users/distiller/repo/graph/client/src/app/feature-tasks/tasks-sidebar-error-boundary.tsx";function pl(){let e=Br();return console.error(e),mt("div",{className:"mt-8 px-4",children:[mt("h2",{className:"mt-8 border-b border-solid border-slate-200/10 text-lg font-light text-slate-400 dark:text-slate-500",children:"Error"},void 0,!1,{fileName:hl,lineNumber:8,columnNumber:7}),mt("p",{children:"There was a problem loading your task graph."},void 0,!1,{fileName:hl,lineNumber:11,columnNumber:7})]},void 0,!0,{fileName:hl,lineNumber:7,columnNumber:5})}var vl="/Users/distiller/repo/graph/client/src/app/routes.tsx";const{appConfig:ml}=_i(),gl=Ni();function yl(){return"dev"===_i().environment?wl:_l}const bl=async e=>{const t=ml.workspaces.find((t=>t.id===e));gl.setTaskInputsUrl?.(t.taskInputsUrl);const n=await gl.getProjectGraph(t.projectGraphUrl),r=new Set;n.projects.forEach((e=>{Object.keys(e.data.targets??{}).forEach((e=>{r.add(e)}))}));const i=Array.from(r).sort(((e,t)=>e.localeCompare(t)));return{...n,targets:i}},xl=[{path:"projects",children:[{index:!0,element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:63,columnNumber:18})},{path:"all",element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:67,columnNumber:18})},{path:"affected",element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:71,columnNumber:18})},{path:":focusedProject",element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:75,columnNumber:18})},{path:"trace/:startTrace",element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:79,columnNumber:18})},{path:"trace/:startTrace/:endTrace",element:mt(nl,{},void 0,!1,{fileName:vl,lineNumber:83,columnNumber:18})}]},{loader:async({request:e,params:t})=>(async e=>{const t=ml.workspaces.find((t=>t.id===e));return await gl.getTaskGraph(t.taskGraphUrl)})(t.selectedWorkspaceId??ml.defaultWorkspaceId),path:"tasks",id:"selectedTarget",errorElement:mt(pl,{},void 0,!1,{fileName:vl,lineNumber:95,columnNumber:19}),shouldRevalidate:({currentParams:e,nextParams:t})=>!e.selectedWorkspaceId||e.selectedWorkspaceId!==t.selectedWorkspaceId,children:[{index:!0,element:mt(fl,{},void 0,!1,{fileName:vl,lineNumber:105,columnNumber:18})},{path:":selectedTarget",element:mt(fl,{},void 0,!1,{fileName:vl,lineNumber:109,columnNumber:18}),children:[{path:"all",element:mt(fl,{},void 0,!1,{fileName:vl,lineNumber:113,columnNumber:22})}]}]}],wl=[{path:"/",children:[{index:!0,loader:async({request:e,params:t})=>{const{search:n}=new URL(e.url);return bn(`/${ml.defaultWorkspaceId}/projects${n}`)}},{path:":selectedWorkspaceId",id:"selectedWorkspace",element:mt(ss,{},void 0,!1,{fileName:vl,lineNumber:136,columnNumber:18}),shouldRevalidate:({currentParams:e,nextParams:t})=>e.selectedWorkspaceId!==t.selectedWorkspaceId,loader:async({request:e,params:t})=>{const n=t.selectedWorkspaceId??ml.defaultWorkspaceId;return bl(n)},children:xl}]}],_l=[{path:"/",id:"selectedWorkspace",loader:async({request:e,params:t})=>{const n=ml.defaultWorkspaceId;return bl(n)},shouldRevalidate:()=>!1,element:mt(ss,{},void 0,!1,{fileName:vl,lineNumber:164,columnNumber:14}),children:[{index:!0,loader:({request:e})=>{const{search:t}=new URL(e.url);return bn(`/projects${t}`)}},...xl]}];let El;function kl(){if(!El){let e=ni;"build"===_i().localMode&&(e=ri),El=e(yl())}return El}function Nl(){return mt(zr,{router:kl()},void 0,!1,{fileName:"/Users/distiller/repo/graph/client/src/app/app.tsx",lineNumber:10,columnNumber:10})}Oi(localStorage.getItem(Ci)??"system"),Ii(localStorage.getItem(Mi)??"TB");var Sl="/Users/distiller/repo/graph/client/src/main.tsx";!0===window.useXstateInspect&&function(e){var t=function(e){var t=i(i({},g),e);return i(i({},t),{url:new URL(t.url),iframe:d(t.iframe),devTools:d(t.devTools)})}(e),n=t.iframe,r=t.url,u=t.devTools;if(null!==n){var c,h,m=function(e,t){void 0===e&&(e=globalThis.__xstate__);var n=new Map,r=e.onRegister((function(e){n.set(e.sessionId,e)}));return(0,s.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,t){var r=t.event,i=JSON.parse(r),o=n.get(i.origin);null==o||o.send(i)}},unload:{actions:function(e){e.client.send({type:"xstate.disconnect"})}},disconnect:"disconnected"}},disconnected:{entry:function(){r.unsubscribe()},type:"final"}},on:{"xstate.inspecting":{target:".connected",actions:[(0,l.assign)({client:function(e,t){return t.client}}),function(n){e.services.forEach((function(e){var r;null===(r=n.client)||void 0===r||r.send({type:"service.register",machine:v(e.machine,null==t?void 0:t.serialize),state:p(e.state||e.initialState,null==t?void 0:t.serialize),sessionId:e.sessionId})}))}]}}})}(u,e),b=(0,o.interpret)(m).start(),x=new Set,w=b.subscribe((function(e){x.forEach((function(t){return t.next(e)}))})),_=function(e){if("object"==typeof e.data&&null!==e.data&&"type"in e.data){n&&!c&&(c=n.contentWindow),h||(h={send:function(e){c.postMessage(e,r.origin)}});var t=i(i({},e.data),{client:h});b.send(t)}};window.addEventListener("message",_),window.addEventListener("unload",(function(){b.send({type:"unload"})}));var E=function(t){return f(t,null==e?void 0:e.serialize)};return u.onRegister((function(t){var n,r=t.state||t.initialState;if(b.send({type:"service.register",machine:v(t.machine,null==e?void 0:e.serialize),state:p(r,null==e?void 0:e.serialize),sessionId:t.sessionId,id:t.id,parent:null===(n=t.parent)||void 0===n?void 0:n.sessionId}),b.send({type:"service.event",event:E(r._event),sessionId:t.sessionId}),!y.has(t)){y.add(t);var i=t.send.bind(t);t.send=function(e,n){return b.send({type:"service.event",event:E((0,a.toSCXMLEvent)((0,a.toEventObject)(e,n))),sessionId:t.sessionId}),i(e,n)}}t.subscribe((function(n){void 0!==n&&b.send({type:"service.state",state:p(n,null==e?void 0:e.serialize),sessionId:t.sessionId})})),t.onStop((function(){b.send({type:"service.stop",sessionId:t.sessionId})}))})),n?(n.addEventListener("load",(function(){c=n.contentWindow})),n.setAttribute("src",String(r))):c=window.open(String(r),"xstateinspector"),{send:function(e){b.send(e)},subscribe:function(e,t,n){var r=(0,a.toObserver)(e,t,n);return x.add(r),r.next(b.state),{unsubscribe:function(){x.delete(r)}}},disconnect:function(){b.send("disconnect"),window.removeEventListener("message",_),w.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}),window.externalApi=new class ExternalApi{_projectGraphService=Fa();_graphIsReady=new Promise((e=>{this._projectGraphService.subscribe((t=>{t.matches("idle")||e()}))}));router=kl();graphService=Si();projectGraphService={send:e=>{this.handleLegacyProjectGraphEvent(e)}};fileClickCallbackListeners=[];openProjectConfigCallbackListeners=[];runTaskCallbackListeners=[];get depGraphService(){return this.projectGraphService}constructor(){this.graphService.listen((e=>{if("FileLinkClick"===e.type){const t=`${e.sourceRoot}/${e.file}`;this.fileClickCallbackListeners.forEach((e=>e(t)))}"ProjectOpenConfigClick"===e.type&&this.openProjectConfigCallbackListeners.forEach((t=>t(e.projectName))),"RunTaskClick"===e.type&&this.runTaskCallbackListeners.forEach((t=>t(e.taskId)))}))}focusProject(e){this.router.navigate(`/projects/${encodeURIComponent(e)}`)}selectAllProjects(){this.router.navigate("/projects/all")}enableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","true"),window.appConfig.showExperimentalFeatures=!0}disableExperimentalFeatures(){localStorage.setItem("showExperimentalFeatures","false"),window.appConfig.showExperimentalFeatures=!1}registerFileClickCallback(e){this.fileClickCallbackListeners.push(e)}registerOpenProjectConfigCallback(e){this.openProjectConfigCallbackListeners.push(e)}registerRunTaskCallback(e){this.runTaskCallbackListeners.push(e)}handleLegacyProjectGraphEvent(e){switch(e.type){case"focusProject":this.focusProject(e.projectName);break;case"selectAll":this.selectAllProjects();break;default:this._graphIsReady.then((()=>this._projectGraphService.send(e)))}}};const Pl=document.getElementById("app");window.appConfig?(0,pt.render)(mt(r.StrictMode,{children:mt(Nl,{},void 0,!1,{fileName:Sl,lineNumber:28,columnNumber:7})},void 0,!1,{fileName:Sl,lineNumber:27,columnNumber:5}),Pl):(0,pt.render)(mt("p",{children:["No environment could be found. Please run"," ",mt("pre",{children:"npx nx run graph-client:generate-dev-environment-js"},void 0,!1,{fileName:Sl,lineNumber:21,columnNumber:7}),"."]},void 0,!0,{fileName:Sl,lineNumber:19,columnNumber:5}),Pl)},25243:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraphService:()=>GraphService});var r=n(50413),i=n.n(r),o=n(46457),a=n.n(o),s=n(68420),l=n.n(s);let u=function(e){return e.blue_500="hsla(217, 91%, 60%, 1)",e.blue_600="hsla(221, 83%, 53%, 1)",e.sky_500="hsla(199, 89%, 48%, 1)",e.sky_600="hsla(200, 98%, 39%, 1)",e.pink_400="hsla(329, 86%, 70%, 1)",e.pink_500="hsla(330, 81%, 60%, 1)",e.fuchsia_500="hsla(292, 84%, 61%, 1)",e.fuchsia_600="hsla(293, 69%, 49%, 1)",e.fuchsia_700="hsla(295, 72%, 40%, 1)",e.fuchsia_800="hsla(295, 70%, 33%, 1)",e.slate_50="hsla(210, 40%, 98%, 1)",e.slate_100="hsla(210, 40%, 96%, 1)",e.slate_200="hsla(214, 32%, 91%, 1)",e.slate_300="hsla(213, 27%, 84%, 1)",e.slate_400="hsla(213, 27%, 84%, 1)",e.slate_500="hsla(215, 16%, 47%, 1)",e.slate_600="hsla(215, 19%, 35%, 1)",e.slate_700="hsla(215, 25%, 27%, 1)",e.slate_800="hsla(217, 33%, 17%, 1)",e.white="#fff",e}({});const c="NX_GRAPH_DARK_MODE";function d(e,t,n){return function(e){return!0===e.scratch(c)}(e)?t:n}const f=[{selector:"edge",style:{width:"1px","line-color":e=>d(e,u.slate_400,u.slate_500),"text-outline-color":e=>d(e,u.slate_400,u.slate_500),"text-outline-width":"0px",color:e=>d(e,u.slate_400,u.slate_500),"curve-style":"unbundled-bezier","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":e=>d(e,u.slate_400,u.slate_500)}},{selector:"edge.affected",style:{"line-color":e=>d(e,u.fuchsia_500,u.pink_500),"target-arrow-color":e=>d(e,u.fuchsia_500,u.pink_500),"curve-style":"unbundled-bezier"}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","curve-style":"unbundled-bezier","text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed","curve-style":"unbundled-bezier"}},{selector:"edge.transparent",style:{opacity:.2}}];const h=new class LabelWidthCalculator{cache=new Map;ctx;constructor(){}calculateWidth(e){this.ctx||(this.ctx=document.createElement("canvas").getContext("2d"));const t=e.data("id"),n=e.style("font-style"),r=e.style("font-size"),i=e.style("font-family"),o=e.style("font-weight");this.ctx.font=n+" "+o+" "+r+" "+i;const a=this.cache.get(t);if(a)return a;{const n=this.ctx.measureText(e.data("id")).width;return this.cache.set(t,n),n}}},p=[{selector:"node",style:{"font-size":"32px","font-family":'system-ui, "Helvetica Neue", sans-serif',backgroundColor:e=>d(e,u.slate_600,u.slate_200),"border-style":"solid","border-color":e=>d(e,u.slate_700,u.slate_300),"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",color:e=>d(e,u.slate_200,u.slate_600),label:"data(id)",width:e=>h.calculateWidth(e),"transition-property":"background-color, border-color, line-color, target-arrow-color","transition-duration":250,"transition-timing-function":"ease-out",shape:"round-rectangle"}},{selector:"node.focused",style:{color:u.white,"border-color":e=>d(e,u.slate_700,u.slate_200),backgroundColor:e=>d(e,u.sky_500,u.blue_500),width:e=>h.calculateWidth(e)}},{selector:"node.affected",style:{color:u.white,"border-color":e=>d(e,u.fuchsia_800,u.pink_500),backgroundColor:e=>d(e,u.fuchsia_700,u.pink_400)}},{selector:"node.parentNode",style:{"background-opacity":e=>d(e,.5,.8),backgroundColor:e=>d(e,u.slate_700,u.slate_50),"border-color":e=>d(e,u.slate_500,u.slate_400),"border-style":"dashed","border-width":2,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}},{selector:"node.highlight",style:{color:u.white,"border-color":e=>d(e,u.sky_600,u.blue_600),backgroundColor:e=>d(e,u.sky_500,u.blue_500)}},{selector:"node.transparent:childless",style:{opacity:.5}},{selector:"node.transparent:parent",style:{"text-opacity":.5,"background-opacity":.25,"border-opacity":.5}},{selector:"node.taskNode",style:{label:"data(label)"}}],v={name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,rankDir:"TB",edgeSep:50,ranker:"network-simplex"};class RenderGraph{cy;collapseEdges=!1;_theme;_rankDir="TB";listeners=new Map;constructor(e,t,n,r="TB"){this.container=e,this.renderMode=n,this._theme=t,this._rankDir=r}set theme(e){this._theme=e,this.render()}set rankDir(e){this._rankDir=e,this.render()}get activeContainer(){return"string"==typeof this.container?document.getElementById(this.container):this.container}broadcast(e){this.listeners.forEach((t=>t(e)))}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}setElements(e){let t;this.cy&&(t=this.cy.nodes(".focused").first().id(),this.cy.destroy(),delete this.cy),this.cy=i()({headless:null===this.activeContainer,container:this.activeContainer,boxSelectionEnabled:!1,style:[...p,...f],panningEnabled:!0,userZoomingEnabled:"nx-docs"!==this.renderMode}),this.cy.add(e),t&&this.cy.$id(t).addClass("focused"),this.cy.on("zoom pan",(()=>{this.broadcast({type:"GraphRegenerated"})})),this.listenForProjectNodeClicks(),this.listenForEdgeNodeClicks(),this.listenForProjectNodeHovers(),this.listenForTaskNodeClicks(),this.listenForEmptyClicks()}render(){if(this.cy){const e=this.cy.elements().sort(((e,t)=>e.id().localeCompare(t.id())));e.layout({...v,rankDir:this._rankDir}).run(),this.collapseEdges&&(this.cy.remove(this.cy.edges()),e.edges().forEach((e=>{const t=e.source(),n=e.target();if(t.parent().first().id()===n.parent().first().id())this.cy.add(e);else{let r,i;const o=e.connectedNodes().commonAncestors();let a,s;if(o.length>0?(r=t.ancestors().filter((e=>!o.contains(e))),i=n.ancestors().filter((e=>!o.contains(e)))):(r=t.ancestors(),i=n.ancestors()),r.length>0&&0===i.length?(a=r.last().id(),s=n.id()):i.length>0&&0===r.length?(a=t.id(),s=i.last().id()):(a=r.last().id(),s=i.last().id()),void 0!==a&&void 0!==s){const e=`${a}|${s}`;if(0===this.cy.$id(e).length){const t={group:"edges",data:{id:e,source:a,target:s}};this.cy.add(t)}}else console.log(`Couldn't figure out how to draw edge ${e.id()}`),console.log("source ancestors",r.map((e=>e.id()))),console.log("target ancestors",i.map((e=>e.id())))}}))),"nx-console"===this.renderMode?this.cy.fit(this.cy.elements(),175).center().resize().panBy({x:150,y:0}):this.cy.fit(this.cy.elements(),25).center().resize(),this.cy.scratch(c,"dark"===this._theme),this.cy.elements().scratch(c,"dark"===this._theme),this.cy.mount(this.activeContainer)}return{numNodes:this.cy?.nodes().length??0,numEdges:this.cy?.edges().length??0}}listenForProjectNodeClicks(){this.cy.$("node.projectNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"ProjectNodeClick",ref:n,id:t.id(),data:{id:t.id(),type:t.data("type"),tags:t.data("tags"),description:t.data("description")}})}))}listenForTaskNodeClicks(){this.cy.$("node.taskNode").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"TaskNodeClick",ref:n,id:t.id(),data:{id:t.id(),label:t.data("label"),executor:t.data("executor"),description:t.data("description")}})}))}listenForEdgeNodeClicks(){this.cy.$("edge.projectEdge").on("click",(e=>{const t=e.target;let n=t.popperRef();this.broadcast({type:"EdgeClick",ref:n,id:t.id(),data:{id:t.id(),type:t.data("type"),source:t.source().id(),target:t.target().id(),sourceRoot:t.source().data("root"),fileDependencies:t.source().data("files")?.filter((e=>e.deps&&e.deps.find((e=>("string"==typeof e?e:e[0])===t.target().id())))).map((e=>({fileName:e.file.replace(`${t.source().data("root")}/`,""),target:t.target().id()})))||[]}})}))}listenForProjectNodeHovers(){this.cy.on("mouseover",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().difference(t.outgoers().union(t.incomers())).not(t).addClass("transparent"),t.addClass("highlight").outgoers().union(t.incomers()).addClass("highlight"))})),this.cy.on("mouseout",(e=>{const t=e.target;t.isNode&&t.isNode()&&!t.isParent()&&(this.cy.elements().removeClass("transparent"),t.removeClass("highlight").outgoers().union(t.incomers()).removeClass("highlight"))}))}listenForEmptyClicks(){this.cy.on("click",(e=>{e.target===this.cy&&this.broadcast({type:"BackgroundClick"})}))}getImage(){const e=d(this.cy,"#0F172A","#FFFFFF");return this.cy.png({bg:e,full:!0})}setFocussedElement(e){this.cy.$id(e).addClass("focused")}clearFocussedElement(){this.cy?.nodes(".focused").removeClass("focused")}getCurrentlyShownProjectIds(){return this.cy?.nodes().map((e=>e.data("id")))??[]}}class ProjectNode{affected=!1;focused=!1;constructor(e,t,n){this.fileMap=e,this.project=t,this.workspaceRoot=n}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,files:(this.fileMap||{})[this.project.data.name]||[],root:this.project.data.root,description:this.project.data.description}}getClasses(){let e=`projectNode ${this.project.type}`;return this.affected&&(e+=" affected"),e}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){if(!this.project.data.root)return[];return function(e,t){const n=e.replace(t,"").split("/").filter((e=>""!==e));return n.pop(),n}(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 ProjectEdge{affected=!1;constructor(e){this.dep=e}getCytoscapeNodeDef(){let e;return e={group:"edges",classes:"projectEdge",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target,type:this.dep.type}},e.classes+=` ${this.dep.type}`??0,this.affected&&(e.classes+=" affected"),e}}class ParentNode{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",classes:"parentNode",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label,type:"dir"},selectable:!1,grabbable:!1,pannable:!0}}}class ProjectTraversalGraph{cy;setShownProjects(e){let t=this.cy.collection();e.forEach((e=>{t=t.union(this.cy.$id(e))}));const n=t.ancestors(),r=t.union(n),i=r.edgesTo(r);return r.union(i)}showProjects(e,t){let n=this.cy.collection();e.forEach((e=>{n=n.union(this.cy.$id(e))})),t.forEach((e=>{n=n.union(this.cy.$id(e))}));const r=n.ancestors(),i=n.union(r),o=i.edgesTo(i);return i.union(o)}hideProjects(e,t){let n=this.cy.collection();t.forEach((e=>{n=n.union(this.cy.$id(e))}));let r=this.cy.collection();e.forEach((e=>{r=r.union(this.cy.$id(e))}));const i=n.difference(r).difference(r.ancestors()),o=i.ancestors();let a=i.union(o);const s=a.edgesTo(a);return a.union(s)}showAffectedProjects(){const e=this.cy.nodes(".affected"),t=e.ancestors(),n=e.union(t),r=n.edgesTo(n);return n.union(r)}focusProject(e,t=1){const n=this.cy.$id(e),r=this.includeProjectsByDepth(n,t),i=n.union(r),o=i.ancestors(),a=i.union(o),s=a.edgesTo(a);return a.union(s)}showAllProjects(){return this.cy.elements()}hideAllProjects(){return this.cy.collection()}filterProjectsByText(e,t,n=-1){if(""===e)return this.cy.collection();{const r=e.split(",");let i=this.cy.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);return i.union(o)}}traceProjects(e,t){const n=this.cy.elements().dijkstra({root:`[id = "${e}"]`,directed:!0}).pathTo(this.cy.$(`[id = "${t}"]`));return n.union(n.ancestors())}traceAllProjects(e,t){const n=[[this.cy.$id(e).nodes().first()]],r=[];let i=0;for(;n.length>0&&i<=1e3;){const e=n.pop(),o=e[e.length-1].outgoers("node");o.length>0&&o.forEach((i=>{const o=[...e,i];i.id()===t?r.push(o):n.push(o)})),i++}i>=1e3&&console.log("failsafe triggered!");let o=this.cy.collection();return r.forEach((e=>{for(let t=0;t<e.length;t++){o=o.union(e[t]);const n=t+1;n<e.length&&(o=o.union(e[t].edgesTo(e[n])))}})),o.union(o.ancestors())}includeProjectsByDepth(e,t=-1){let n,r;if(-1===t)n=e.predecessors();else{n=e.incomers();for(let e=1;e<t;e++)n=n.union(n.incomers())}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,o,a){this.generateCytoscapeLayout(e,t,n,r,i,o)}generateCytoscapeLayout(e,t,n,r,o,a){const s=this.createElements(e,t,n,r,o,a);this.cy=i()({headless:!0,elements:[...s],boxSelectionEnabled:!1})}createElements(e,t,n,r,i,o){let a=[];const s=t.map((e=>e.name)),l=[],u=[],c={};t.forEach((t=>{const a="app"===t.type||"e2e"===t.type?r.appsDir:r.libsDir,d=new ProjectNode(e,t,a);if(d.affected=o.includes(t.name),l.push(d),i[t.name].forEach((e=>{if(s.includes(e.target)){const t=new ProjectEdge(e);u.push(t)}})),n){d.getAncestors().forEach((e=>c[e.id]=e))}}));const d=l.map((e=>e.getCytoscapeNodeDef(n))),f=u.map((e=>e.getCytoscapeNodeDef()));if(a=d.concat(f),n){a=Object.keys(c).map((e=>new ParentNode(c[e]).getCytoscapeNodeDef())).concat(a)}return a}}class TaskNode{constructor(e,t){this.task=e,this.project=t}getCytoscapeNodeDef(e){return{group:"nodes",classes:"taskNode",data:this.getData(e),selectable:!1,grabbable:!1,pannable:!0}}getData(e){const t=e?this.task.id.split(":").slice(1).join(":"):this.task.id;return{id:this.task.id,label:t,executor:this.project.data.targets[this.task.target.target].executor,parent:e?this.task.target.project:null,description:this.project.data.description}}}class TaskEdge{constructor(e,t){this.source=e,this.target=t}getCytoscapeNodeDef(){let e;return e={group:"edges",data:{id:`${this.source}|${this.target}`,source:this.source,target:this.target}},e}}class TaskTraversalGraph{projects=[];taskGraphs={};cy;groupByProject=!1;selectedTasks=new Set;setProjects(e,t){this.selectedTasks.clear(),this.projects=e,this.taskGraphs=t}setGroupByProject(e){return this.groupByProject=e,this.selectedTasks.size>0?this.createElements(Array.from(this.selectedTasks),e):this.cy=i()({headless:!0,elements:[]}),this.cy.elements()}setTasks(e){let t=!1;this.selectedTasks.forEach((n=>{e.includes(n)||(this.selectedTasks.delete(n),t=!0)}));for(const n of e)this.selectedTasks.has(n)||(this.selectedTasks.add(n),t=!0);return t&&this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}selectTask(e){return e.forEach((e=>{this.selectedTasks.add(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}deselectTask(e){return e.forEach((e=>{this.selectedTasks.delete(e)})),this.createElements(Array.from(this.selectedTasks),this.groupByProject),this.cy.elements()}createElements(e,t){const n=[];e.forEach((e=>{const r=this.taskGraphs[e];if(void 0===r)throw new Error(`Could not find task graph for ${e}`);const i={};for(let o in r.tasks){const e=r.tasks[o],a=this.projects.find((t=>t.name===e.target.project));if(void 0===a)throw new Error(`Could not find project ${a.name}`);n.push(new TaskNode(r.tasks[o],a)),t&&(i[a.name]={id:a.name,parentId:null,label:a.name})}for(let t in i)n.push(new ParentNode(i[t]));for(let t in r.dependencies)r.dependencies[t].forEach((e=>n.push(new TaskEdge(t,e))))})),this.cy=i()({headless:!0,elements:n.map((e=>e.getCytoscapeNodeDef(t))),boxSelectionEnabled:!1})}}class GraphService{projectTraversalGraph;taskTraversalGraph;renderGraph;lastPerformanceReport={numEdges:0,numNodes:0,renderTime:0};listeners=new Map;constructor(e,t,n,i="TB",o=void 0){this.renderMode=n,this.getTaskInputs=o,(0,r.use)(a()),(0,r.use)(l()),this.renderGraph=new RenderGraph(e,t,n,i),this.renderGraph.listen((e=>this.broadcast(e))),this.projectTraversalGraph=new ProjectTraversalGraph,this.taskTraversalGraph=new TaskTraversalGraph}set theme(e){this.renderGraph.theme=e}set rankDir(e){this.renderGraph.rankDir=e}listen(e){const t=this.listeners.size+1;return this.listeners.set(t,e),()=>{this.listeners.delete(t)}}broadcast(e){this.listeners.forEach((t=>t(e)))}handleProjectEvent(e){const t=Date.now();let n;switch("notifyGraphUpdateGraph"!==e.type&&this.renderGraph.clearFocussedElement(),e.type){case"notifyGraphInitGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.fileMap,e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges);break;case"notifyGraphUpdateGraph":this.renderGraph.collapseEdges=e.collapseEdges,this.broadcast({type:"GraphRegenerated"}),this.projectTraversalGraph.initGraph(e.fileMap,e.projects,e.groupByFolder,e.workspaceLayout,e.dependencies,e.affectedProjects,e.collapseEdges),n=this.projectTraversalGraph.setShownProjects(e.selectedProjects.length>0?e.selectedProjects:this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphFocusProject":n=this.projectTraversalGraph.focusProject(e.projectName,e.searchDepth);break;case"notifyGraphFilterProjectsByText":n=this.projectTraversalGraph.filterProjectsByText(e.search,e.includeProjectsByPath,e.searchDepth);break;case"notifyGraphShowProjects":n=this.projectTraversalGraph.showProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphHideProjects":n=this.projectTraversalGraph.hideProjects(e.projectNames,this.renderGraph.getCurrentlyShownProjectIds());break;case"notifyGraphShowAllProjects":n=this.projectTraversalGraph.showAllProjects();break;case"notifyGraphHideAllProjects":n=this.projectTraversalGraph.hideAllProjects();break;case"notifyGraphShowAffectedProjects":n=this.projectTraversalGraph.showAffectedProjects();break;case"notifyGraphTracing":e.start&&e.end&&(n="shortest"===e.algorithm?this.projectTraversalGraph.traceProjects(e.start,e.end):this.projectTraversalGraph.traceAllProjects(e.start,e.end))}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph)if(n){this.renderGraph.setElements(n),"notifyGraphFocusProject"===e.type&&this.renderGraph.setFocussedElement(e.projectName);const{numEdges:o,numNodes:a}=this.renderGraph.render();r=(n.nodes('[type!="dir"]')??[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:a,numEdges:o}}else{const{numEdges:e,numNodes:n}=this.renderGraph.render();this.renderGraph.getCurrentlyShownProjectIds();i={renderTime:Date.now()-t,numNodes:n,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}handleTaskEvent(e){const t=Date.now();let n;switch(this.broadcast({type:"GraphRegenerated"}),e.type){case"notifyTaskGraphSetProjects":this.taskTraversalGraph.setProjects(e.projects,e.taskGraphs);break;case"notifyTaskGraphSetTasks":n=this.taskTraversalGraph.setTasks(e.taskIds);break;case"notifyTaskGraphTasksSelected":n=this.taskTraversalGraph.selectTask(e.taskIds);break;case"notifyTaskGraphTasksDeselected":n=this.taskTraversalGraph.deselectTask(e.taskIds);break;case"setGroupByProject":n=this.taskTraversalGraph.setGroupByProject(e.groupByProject)}let r=[],i={numEdges:0,numNodes:0,renderTime:0};if(this.renderGraph&&n){this.renderGraph.setElements(n);const{numEdges:e,numNodes:o}=this.renderGraph.render();r=(n.nodes('[type!="dir"]')??[]).map((e=>e.id()));i={renderTime:Date.now()-t,numNodes:o,numEdges:e}}return this.lastPerformanceReport=i,this.broadcast({type:"GraphRegenerated"}),{selectedProjectNames:r,perfReport:i}}getImage(){return this.renderGraph.getImage()}}},58016:(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>_,afterRead:()=>b,afterWrite:()=>N,applyStyles:()=>O,arrow:()=>Q,auto:()=>s,basePlacements:()=>l,beforeMain:()=>x,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>i,clippingParents:()=>d,computeStyles:()=>ne,createPopper:()=>Fe,createPopperBase:()=>Le,createPopperLite:()=>Be,detectOverflow:()=>ye,end:()=>c,eventListeners:()=>ie,flip:()=>be,hide:()=>_e,left:()=>a,main:()=>w,modifierPhases:()=>S,offset:()=>Ee,placements:()=>m,popper:()=>h,popperGenerator:()=>Ie,popperOffsets:()=>ke,preventOverflow:()=>Ne,read:()=>y,reference:()=>p,right:()=>o,start:()=>u,top:()=>r,variationPlacements:()=>v,viewport:()=>f,write:()=>k});var r="top",i="bottom",o="right",a="left",s="auto",l=[r,i,o,a],u="start",c="end",d="clippingParents",f="viewport",h="popper",p="reference",v=l.reduce((function(e,t){return e.concat([t+"-"+u,t+"-"+c])}),[]),m=[].concat(l,[s]).reduce((function(e,t){return e.concat([t,t+"-"+u,t+"-"+c])}),[]),g="beforeRead",y="read",b="afterRead",x="beforeMain",w="main",_="afterMain",E="beforeWrite",k="write",N="afterWrite",S=[g,y,b,x,w,_,E,k,N];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 T(e){return e instanceof C(e).Element||e instanceof Element}function j(e){return e instanceof C(e).HTMLElement||e instanceof HTMLElement}function D(e){return"undefined"!=typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}const O={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];j(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}),{});j(r)&&P(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function A(e){return e.split("-")[0]}var M=Math.max,R=Math.min,I=Math.round;function L(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function B(){return!/^((?!chrome|android).)*safari/i.test(L())}function F(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&j(e)&&(i=e.offsetWidth>0&&I(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&I(r.height)/e.offsetHeight||1);var a=(T(e)?C(e):window).visualViewport,s=!B()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function z(e){var t=F(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 V(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&D(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function G(e){return C(e).getComputedStyle(e)}function U(e){return["table","td","th"].indexOf(P(e))>=0}function W(e){return((T(e)?e.ownerDocument:e.document)||window.document).documentElement}function q(e){return"html"===P(e)?e:e.assignedSlot||e.parentNode||(D(e)?e.host:null)||W(e)}function H(e){return j(e)&&"fixed"!==G(e).position?e.offsetParent:null}function Y(e){for(var t=C(e),n=H(e);n&&U(n)&&"static"===G(n).position;)n=H(n);return n&&("html"===P(n)||"body"===P(n)&&"static"===G(n).position)?t:n||function(e){var t=/firefox/i.test(L());if(/Trident/i.test(L())&&j(e)&&"fixed"===G(e).position)return null;var n=q(e);for(D(n)&&(n=n.host);j(n)&&["html","body"].indexOf(P(n))<0;){var r=G(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 X(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function $(e,t,n){return M(e,R(t,n))}function K(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(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=A(n.placement),h=X(f),p=[a,o].indexOf(f)>=0?"height":"width";if(c&&d){var v=function(e,t){return K("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,l))}(u.padding,n),m=z(c),g="y"===h?r:a,y="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=Y(c),_=w?"y"===h?w.clientHeight||0:w.clientWidth||0:0,E=b/2-x/2,k=v[g],N=_-m[p]-v[y],S=_/2-m[p]/2+E,P=$(k,S,N),C=h;n.modifiersData[s]=((t={})[C]=P,t.centerOffset=P-S,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)))&&(j(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),V(t.elements.popper,r)?t.elements.arrow=r:console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function J(e){return e.split("-")[1]}var ee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function te(e){var t,n=e.popper,s=e.popperRect,l=e.placement,u=e.variation,d=e.offsets,f=e.position,h=e.gpuAcceleration,p=e.adaptive,v=e.roundOffsets,m=e.isFixed,g=d.x,y=void 0===g?0:g,b=d.y,x=void 0===b?0:b,w="function"==typeof v?v({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var _=d.hasOwnProperty("x"),E=d.hasOwnProperty("y"),k=a,N=r,S=window;if(p){var P=Y(n),T="clientHeight",j="clientWidth";if(P===C(n)&&"static"!==G(P=W(n)).position&&"absolute"===f&&(T="scrollHeight",j="scrollWidth"),l===r||(l===a||l===o)&&u===c)N=i,x-=(m&&P===S&&S.visualViewport?S.visualViewport.height:P[T])-s.height,x*=h?1:-1;if(l===a||(l===r||l===i)&&u===c)k=o,y-=(m&&P===S&&S.visualViewport?S.visualViewport.width:P[j])-s.width,y*=h?1:-1}var D,O=Object.assign({position:f},p&&ee),A=!0===v?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}}({x:y,y:x}):{x:y,y:x};return y=A.x,x=A.y,h?Object.assign({},O,((D={})[N]=E?"0":"",D[k]=_?"0":"",D.transform=(S.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",D)):Object.assign({},O,((t={})[N]=E?x+"px":"",t[k]=_?y+"px":"",t.transform="",t))}const ne={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=G(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some((function(e){return u.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var c={placement:A(t.placement),variation:J(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,te(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,te(Object.assign({},c,{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 re={passive:!0};const ie={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=C(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,re)})),s&&l.addEventListener("resize",n.update,re),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,re)})),s&&l.removeEventListener("resize",n.update,re)}},data:{}};var oe={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(e){return e.replace(/left|right|bottom|top/g,(function(e){return oe[e]}))}var se={start:"end",end:"start"};function le(e){return e.replace(/start|end/g,(function(e){return se[e]}))}function ue(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ce(e){return F(W(e)).left+ue(e).scrollLeft}function de(e){var t=G(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function fe(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:j(e)&&de(e)?e:fe(q(e))}function he(e,t){var n;void 0===t&&(t=[]);var r=fe(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=C(r),a=i?[o].concat(o.visualViewport||[],de(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(he(q(a)))}function pe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t,n){return t===f?pe(function(e,t){var n=C(e),r=W(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=B();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+ce(e),y:l}}(e,n)):T(t)?function(e,t){var n=F(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):pe(function(e){var t,n=W(e),r=ue(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=M(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=M(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ce(e),l=-r.scrollTop;return"rtl"===G(i||n).direction&&(s+=M(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(W(e)))}function me(e,t,n,r){var i="clippingParents"===t?function(e){var t=he(q(e)),n=["absolute","fixed"].indexOf(G(e).position)>=0&&j(e)?Y(e):e;return T(n)?t.filter((function(e){return T(e)&&V(e,n)&&"body"!==P(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=ve(e,n,r);return t.top=M(i.top,t.top),t.right=R(i.right,t.right),t.bottom=R(i.bottom,t.bottom),t.left=M(i.left,t.left),t}),ve(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ge(e){var t,n=e.reference,s=e.element,l=e.placement,d=l?A(l):null,f=l?J(l):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?X(d):null;if(null!=v){var m="y"===v?"height":"width";switch(f){case u:t[v]=t[v]-(n[m]/2-s[m]/2);break;case c:t[v]=t[v]+(n[m]/2-s[m]/2)}}return t}function ye(e,t){void 0===t&&(t={});var n=t,a=n.placement,s=void 0===a?e.placement:a,u=n.strategy,c=void 0===u?e.strategy:u,v=n.boundary,m=void 0===v?d:v,g=n.rootBoundary,y=void 0===g?f:g,b=n.elementContext,x=void 0===b?h:b,w=n.altBoundary,_=void 0!==w&&w,E=n.padding,k=void 0===E?0:E,N=K("number"!=typeof k?k:Z(k,l)),S=x===h?p:h,P=e.rects.popper,C=e.elements[_?S:x],j=me(T(C)?C:C.contextElement||W(e.elements.popper),m,y,c),D=F(e.elements.reference),O=ge({reference:D,element:P,strategy:"absolute",placement:s}),A=pe(Object.assign({},P,O)),M=x===h?A:D,R={top:j.top-M.top+N.top,bottom:M.bottom-j.bottom+N.bottom,left:j.left-M.left+N.left,right:M.right-j.right+N.right},I=e.modifiersData.offset;if(x===h&&I){var L=I[s];Object.keys(R).forEach((function(e){var t=[o,i].indexOf(e)>=0?1:-1,n=[r,i].indexOf(e)>=0?"y":"x";R[e]+=L[n]*t}))}return R}const be={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,g=n.fallbackPlacements,y=n.padding,b=n.boundary,x=n.rootBoundary,w=n.altBoundary,_=n.flipVariations,E=void 0===_||_,k=n.allowedAutoPlacements,N=t.options.placement,S=A(N),P=g||(S===N||!E?[ae(N)]:function(e){if(A(e)===s)return[];var t=ae(e);return[le(e),t,le(t)]}(N)),C=[N].concat(P).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,u=n.allowedAutoPlacements,c=void 0===u?m:u,d=J(r),f=d?s?v:v.filter((function(e){return J(e)===d})):l,h=f.filter((function(e){return c.indexOf(e)>=0}));0===h.length&&(h=f,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=h.reduce((function(t,n){return t[n]=ye(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:y,flipVariations:E,allowedAutoPlacements:k}):n)}),[]),T=t.rects.reference,j=t.rects.popper,D=new Map,O=!0,M=C[0],R=0;R<C.length;R++){var I=C[R],L=A(I),B=J(I)===u,F=[r,i].indexOf(L)>=0,z=F?"width":"height",V=ye(t,{placement:I,boundary:b,rootBoundary:x,altBoundary:w,padding:y}),G=F?B?o:a:B?i:r;T[z]>j[z]&&(G=ae(G));var U=ae(G),W=[];if(f&&W.push(V[L]<=0),p&&W.push(V[G]<=0,V[U]<=0),W.every((function(e){return e}))){M=I,O=!1;break}D.set(I,W)}if(O)for(var q=function(e){var t=C.find((function(t){var n=D.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"===q(H))break}t.placement!==M&&(t.modifiersData[c]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function xe(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 we(e){return[r,o,i,a].some((function(t){return e[t]>=0}))}const _e={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=ye(t,{elementContext:"reference"}),s=ye(t,{altBoundary:!0}),l=xe(a,r),u=xe(s,i,o),c=we(l),d=we(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 Ee={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=m.reduce((function(e,n){return e[n]=function(e,t,n){var i=A(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 ke={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ge({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const Ne={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,h=n.boundary,p=n.rootBoundary,v=n.altBoundary,m=n.padding,g=n.tether,y=void 0===g||g,b=n.tetherOffset,x=void 0===b?0:b,w=ye(t,{boundary:h,rootBoundary:p,padding:m,altBoundary:v}),_=A(t.placement),E=J(t.placement),k=!E,N=X(_),S="x"===N?"y":"x",P=t.modifiersData.popperOffsets,C=t.rects.reference,T=t.rects.popper,j="function"==typeof x?x(Object.assign({},t.rects,{placement:t.placement})):x,D="number"==typeof j?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(P){if(c){var L,B="y"===N?r:a,F="y"===N?i:o,V="y"===N?"height":"width",G=P[N],U=G+w[B],W=G-w[F],q=y?-T[V]/2:0,H=E===u?C[V]:T[V],K=E===u?-T[V]:-C[V],Z=t.elements.arrow,Q=y&&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[B],ne=ee[F],re=$(0,C[V],Q[V]),ie=k?C[V]/2-q-re-te-D.mainAxis:H-re-te-D.mainAxis,oe=k?-C[V]/2+q+re+ne+D.mainAxis:K+re+ne+D.mainAxis,ae=t.elements.arrow&&Y(t.elements.arrow),se=ae?"y"===N?ae.clientTop||0:ae.clientLeft||0:0,le=null!=(L=null==O?void 0:O[N])?L:0,ue=G+oe-le,ce=$(y?R(U,G+ie-le-se):U,G,y?M(W,ue):W);P[N]=ce,I[N]=ce-G}if(f){var de,fe="x"===N?r:a,he="x"===N?i:o,pe=P[S],ve="y"===S?"height":"width",me=pe+w[fe],ge=pe-w[he],be=-1!==[r,a].indexOf(_),xe=null!=(de=null==O?void 0:O[S])?de:0,we=be?me:pe-C[ve]-T[ve]-xe+D.altAxis,_e=be?pe+C[ve]+T[ve]-xe-D.altAxis:ge,Ee=y&&be?function(e,t,n){var r=$(e,t,n);return r>n?n:r}(we,pe,_e):$(y?we:me,pe,y?_e:ge);P[S]=Ee,I[S]=Ee-pe}t.modifiersData[s]=I}},requiresIfExists:["offset"]};function Se(e,t,n){void 0===n&&(n=!1);var r,i,o=j(t),a=j(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=W(t),l=F(e,a,n),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==P(t)||de(s))&&(u=(r=t)!==C(r)&&j(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ue(r)),j(t)?((c=F(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=ce(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}function Ce(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[].concat(n).reduce((function(e,t){return e.replace(/%s/,t)}),e)}var Te='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',je='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',De=["name","enabled","phase","fn","effect","requires","options"];var Oe="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Ae="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",Me={placement:"bottom",modifiers:[],strategy:"absolute"};function Re(){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 Ie(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Me:i;return function(e,t,n){void 0===n&&(n=o);var i,a,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Me,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],c=!1,d={state:l,setOptions:function(n){var i="function"==typeof n?n(l.options):n;f(),l.options=Object.assign({},o,l.options,i),l.scrollParents={reference:T(e)?he(e):e.contextElement?he(e.contextElement):[],popper:he(t)};var a=function(e){var t=Pe(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,l.options.modifiers)));l.orderedModifiers=a.filter((function(e){return e.enabled})),function(e){e.forEach((function(t){[].concat(Object.keys(t),De).filter((function(e,t,n){return n.indexOf(e)===t})).forEach((function(n){switch(n){case"name":"string"!=typeof t.name&&console.error(Ce(Te,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":"boolean"!=typeof t.enabled&&console.error(Ce(Te,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":S.indexOf(t.phase)<0&&console.error(Ce(Te,t.name,'"phase"',"either "+S.join(", "),'"'+String(t.phase)+'"'));break;case"fn":"function"!=typeof t.fn&&console.error(Ce(Te,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":null!=t.effect&&"function"!=typeof t.effect&&console.error(Ce(Te,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":null==t.requires||Array.isArray(t.requires)||console.error(Ce(Te,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Ce(Te,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+De.map((function(e){return'"'+e+'"'})).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach((function(n){null==e.find((function(e){return e.name===n}))&&console.error(Ce(je,String(t.name),n,n))}))}))}))}((c=[].concat(a,l.options.modifiers),h=function(e){return e.name},p=new Set,c.filter((function(e){var t=h(e);if(!p.has(t))return p.add(t),!0})))),A(l.options.placement)===s&&(l.orderedModifiers.find((function(e){return"flip"===e.name}))||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")));var c,h,p,v=G(t);return[v.marginTop,v.marginRight,v.marginBottom,v.marginLeft].some((function(e){return parseFloat(e)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),l.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:l,name:t,instance:d,options:r}),a=function(){};u.push(o||a)}})),d.update()},forceUpdate:function(){if(!c){var e=l.elements,t=e.reference,n=e.popper;if(Re(t,n)){l.rects={reference:Se(t,Y(n),"fixed"===l.options.strategy),popper:z(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0,i=0;i<l.orderedModifiers.length;i++){if((r+=1)>100){console.error(Ae);break}if(!0!==l.reset){var o=l.orderedModifiers[i],a=o.fn,s=o.options,u=void 0===s?{}:s,f=o.name;"function"==typeof a&&(l=a({state:l,options:u,name:f,instance:d})||l)}else l.reset=!1,i=-1}}else console.error(Oe)}},update:(i=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){f(),c=!0}};if(!Re(e,t))return console.error(Oe),d;function f(){u.forEach((function(e){return e()})),u=[]}return d.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),d}}var Le=Ie(),Be=Ie({defaultModifiers:[ie,ke,ne,O]}),Fe=Ie({defaultModifiers:[ie,ke,ne,O,Ee,be,Ne,Q,_e]})},53536:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUpdater=t.assign=void 0;var r=n(92185),i=n(77667);function o(e){return(0,r.assign)((function(t,n,r){return(0,i.produce)(t,(function(t){e(t,n,r)}))}))}t.assign=o,t.createUpdater=function(e,t){return{update:function(t){return{type:e,input:t}},action:o((function(e,n,r){t(e,n,r)})),type:e}}},87608:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var a=i.apply(null,n);a&&e.push(a)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=(function(){return i}).apply(t,[]))||(e.exports=n)}()},46457: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("align",e.align),u("ranker",e.ranker),u("acyclicer",e.acyclicer),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],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 m=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),g=0;g<m.length;g++){var y=m[g];s.setEdge(y.source().id(),y.target().id(),{minlen:i(y,e.minLen),weight:i(y,e.edgeWeight),name:y.id()},y.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,align: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(15439))},68420: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(58016))},50413:(e,t,n)=>{"use strict";var r=n(77837),i=n(97597),o=n(13546),a=n(26226),s=n(59430);function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(r),c=l(i),d=l(o),f=l(a),h=l(s);function p(e){return p="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},p(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(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 g(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w="undefined"==typeof window?null:window,_=w?w.navigator:null;w&&w.document;var E=p(""),k=p({}),N=p((function(){})),S="undefined"==typeof HTMLElement?"undefined":p(HTMLElement),P=function(e){return e&&e.instanceString&&T(e.instanceString)?e.instanceString():null},C=function(e){return null!=e&&p(e)==E},T=function(e){return null!=e&&p(e)===N},j=function(e){return!M(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},D=function(e){return null!=e&&p(e)===k&&!j(e)&&e.constructor===Object},O=function(e){return null!=e&&p(e)===p(1)&&!isNaN(e)},A=function(e){return"undefined"===S?void 0:null!=e&&e instanceof HTMLElement},M=function(e){return R(e)||I(e)},R=function(e){return"collection"===P(e)&&e._private.single},I=function(e){return"collection"===P(e)&&!e._private.single},L=function(e){return"core"===P(e)},B=function(e){return"stylesheet"===P(e)},F=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},z=function(e){return function(e){return null!=e&&p(e)===k}(e)&&T(e.then)},V=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=arguments,o=t.apply(this,i),a=n.cache;return(r=a[o])||(r=a[o]=e.apply(this,i)),r};return n.cache={},n},G=V((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),U=V((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),W=V((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),q=function(e){return F(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},H="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Y="rgb[a]?\\(("+H+"[%]?)\\s*,\\s*("+H+"[%]?)\\s*,\\s*("+H+"[%]?)(?:\\s*,\\s*("+H+"))?\\)",X="rgb[a]?\\((?:"+H+"[%]?)\\s*,\\s*(?:"+H+"[%]?)\\s*,\\s*(?:"+H+"[%]?)(?:\\s*,\\s*(?:"+H+"))?\\)",$="hsl[a]?\\(("+H+")\\s*,\\s*("+H+"[%])\\s*,\\s*("+H+"[%])(?:\\s*,\\s*("+H+"))?\\)",K="hsl[a]?\\((?:"+H+")\\s*,\\s*(?:"+H+"[%])\\s*,\\s*(?:"+H+"[%])(?:\\s*,\\s*(?:"+H+"))?\\)",Z=function(e,t){return e<t?-1:e>t?1:0},Q=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},J=function(e){return(j(e)?e:null)||function(e){return ee[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("^"+Y+"$").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("^"+$+"$").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)},ee={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]},te=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(D(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}},ne=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(D(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},re=w?w.performance:null,ie=re&&re.now?function(){return re.now()}:function(){return Date.now()},oe=function(){if(w){if(w.requestAnimationFrame)return function(e){w.requestAnimationFrame(e)};if(w.mozRequestAnimationFrame)return function(e){w.mozRequestAnimationFrame(e)};if(w.webkitRequestAnimationFrame)return function(e){w.webkitRequestAnimationFrame(e)};if(w.msRequestAnimationFrame)return function(e){w.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(ie())}),1e3/60)}}(),ae=function(e){return oe(e)},se=ie,le=9261,ue=5381,ce=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le;!(t=e.next()).done;)n=65599*n+t.value|0;return n},de=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:le)+e|0},fe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ue;return(t<<5)+t+e|0},he=function(e){return 2097152*e[0]+e[1]},pe=function(e,t){return[de(e[0],t[0]),fe(e[1],t[1])]},ve=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return ce({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},me=function(){return ge(arguments)},ge=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?ve(r):ve(r,t)}return t},ye=!0,be=null!=console.warn,xe=null!=console.trace,we=Number.MAX_SAFE_INTEGER||9007199254740991,_e=function(){return!0},Ee=function(){return!1},ke=function(){return 0},Ne=function(){},Se=function(e){throw new Error(e)},Pe=function(e){if(void 0===e)return ye;ye=!!e},Ce=function(e){Pe()&&(be?console.warn(e):(console.log(e),xe&&console.trace()))},Te=function(e){return null==e?e:j(e)?e.slice():D(e)?function(e){return Q({},e)}(e):e},je=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},De={},Oe=function(){return De},Ae=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}},Me=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Re=function(e){e.splice(0,e.length)},Ie=function(e,t,n){return n&&(t=W(n,t)),e[t]},Le=function(e,t,n,r){n&&(t=W(n,t)),e[t]=r},Be="undefined"!=typeof Map?Map:function(){function e(){v(this,e),this._obj={}}return g(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}(),Fe=function(){function e(t){if(v(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 g(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}(),ze="undefined"!==("undefined"==typeof Set?"undefined":p(Set))?Set:Fe,Ve=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&L(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 ze,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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=[];j(t.classes)?l=t.classes:C(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&&(Ce("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 Se("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Se("An element must have a core reference and parameters set")},Ge=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;D(t)&&!M(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||T(n)?r:n,n=T(n)?n:function(){};for(var o,a=this._private.cy,s=t=C(t)?this.filter(t):t,l=[],u=[],c={},d={},f={},h=0,p=this.byGroup(),v=p.nodes,m=p.edges,g=0;g<s.length;g++){var y=s[g],b=y.id();y.isNode()&&(l.unshift(y),e.bfs&&(f[b]=!0,u.push(y)),d[b]=0)}for(var x=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],p=c[i],g=null!=p?p.source():null,y=null!=p?p.target():null,b=null==p?void 0:t.same(g)?y[0]:g[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))&&m.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],l.push(E),e.bfs&&(f[k]=!0,u.push(E)),c[k]=_,d[k]=d[i]+1)}};0!==l.length;){var w=x();if("continue"!==w&&"break"===w)break}for(var _=a.collection(),E=0;E<u.length;E++){var k=u[E],N=c[k.id()];null!=N&&_.push(N),_.push(k)}return{path:a.collection(_),found:a.collection(o)}}},Ue={breadthFirstSearch:Ge({bfs:!0}),depthFirstSearch:Ge({dfs:!0})};Ue.bfs=Ue.breadthFirstSearch,Ue.dfs=Ue.depthFirstSearch;var We=Ae({root:null,weight:function(e){return 1},directed:!1}),qe={dijkstra:function(e){if(!D(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=We(e),r=n.root,i=n.weight,o=n.directed,a=this,s=i,l=C(r)?this.filter(r)[0]:r[0],u={},d={},f={},h=this.byGroup(),p=h.nodes,v=h.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var m=function(e){return u[e.id()]},g=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new c.default((function(e,t){return m(e)-m(t)})),b=0;b<p.length;b++){var x=p[b];u[x.id()]=x.same(l)?0:1/0,y.push(x)}for(var w=function(e,t){for(var n,r=(o?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,a=0;a<r.length;a++){var l=r[a],u=s(l);(u<i||!n)&&(i=u,n=l)}return{edge:n,dist:i}};y.size()>0;){var _=y.pop(),E=m(_),k=_.id();if(f[k]=E,E!==1/0)for(var N=_.neighborhood().intersect(p),S=0;S<N.length;S++){var P=N[S],T=P.id(),j=w(_,P),O=E+j.dist;O<m(P)&&(g(P,O),d[T]={node:_,edge:j.edge})}}return{distanceTo:function(e){var t=C(e)?p.filter(e)[0]:e[0];return f[t.id()]},pathTo:function(e){var t=C(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 a.spawn(n)}}}},He={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],h=d.target()[0],p=s(f),v=s(h),m=o[p],g=o[v];p!==v&&(a.merge(d),m.merge(g),o.splice(v,1))}return a}},Ye=Ae({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Xe={aStar:function(e){var t=this.cy(),n=Ye(e),r=n.root,i=n.goal,o=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,u,d=r.id(),f=i.id(),h={},p={},v={},m=new c.default((function(e,t){return p[e.id()]-p[t.id()]})),g=new ze,y={},b={},x=function(e,t){m.push(e),g.add(t)};x(r,d),h[d]=0,p[d]=o(r);for(var w,_=0;m.size()>0;){if(l=m.pop(),u=l.id(),g.delete(u),_++,u===f){for(var E=[],k=i,N=f,S=b[N];E.unshift(k),null!=S&&E.unshift(S),null!=(k=y[N]);)S=b[N=k.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:_}}v[u]=!0;for(var P=l._private.edges,C=0;C<P.length;C++){var T=P[C];if(this.hasElementWithId(T.id())&&(!a||T.data("source")===u)){var j=T.source(),D=T.target(),O=j.id()!==u?j:D,A=O.id();if(this.hasElementWithId(A)&&!v[A]){var M=h[u]+s(T);w=A,g.has(w)?M<h[A]&&(h[A]=M,p[A]=M+o(O),y[A]=l,b[A]=T):(h[A]=M,p[A]=M+o(O),x(O,A),y[A]=l,b[A]=T)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},$e=Ae({weight:function(e){return 1},directed:!1}),Ke={floydWarshall:function(e){for(var t=this.cy(),n=$e(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]},h=new Array(c),p=0;p<c;p++){var v=p%u,m=(p-v)/u;h[p]=m===v?0:1/0}for(var g=new Array(c),y=new Array(c),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],_=x.target()[0];if(w!==_){var E=d(w),k=d(_),N=E*u+k,S=o(x);if(h[N]>S&&(h[N]=S,g[N]=k,y[N]=x),!i){var P=k*u+E;!i&&h[P]>S&&(h[P]=S,g[P]=E,y[P]=x)}}}for(var T=0;T<u;T++)for(var j=0;j<u;j++)for(var D=j*u+T,O=0;O<u;O++){var A=j*u+O,M=T*u+O;h[D]+h[M]<h[A]&&(h[A]=h[D]+h[M],g[A]=g[D])}var R=function(e){return d(function(e){return(C(e)?t.filter(e):e)[0]}(e))},I={distance:function(e,t){var n=R(e),r=R(t);return h[n*u+r]},path:function(e,n){var r=R(e),i=R(n),o=f(r);if(r===i)return o.collection();if(null==g[r*u+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=g[r*u+i],a=y[l*u+r],s.merge(a),s.merge(f(r));return s}};return I}},Ze=Ae({weight:function(e){return 1},directed:!1,root:null}),Qe={bellmanFord:function(e){var t=this,n=Ze(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,h=new Be,p=!1,v=[];o=l.collection(o)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var m=c.length,g=function(e){var t=h.get(e.id());return t||(t={},h.set(e.id(),t)),t},y=function(e){return(C(e)?l.$(e):e)[0]},b=0;b<f;b++){var x=d[b],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 N=0;N<m;N++){var S=c[N],P=S.source(),T=S.target(),j=a(S),D=g(P),O=g(T);E(P,0,S,D,O,j),i||E(T,0,S,O,D,j)}if(!_)break}if(_)for(var A=[],M=0;M<m;M++){var R=c[M],I=R.source(),L=R.target(),B=a(R),F=g(I).dist,z=g(L).dist;if(F+B<z||!i&&z+B<F){if(p||(Ce("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var V=[];F+B<z&&V.push(I),!i&&z+B<F&&V.push(L);for(var G=V.length,U=0;U<G;U++){var W=V[U],q=[W];q.push(g(W).edge);for(var H=g(W).pred;-1===q.indexOf(H);)q.push(H),q.push(g(H).edge),H=g(H).pred;for(var Y=(q=q.slice(q.indexOf(H)))[0].id(),X=0,$=2;$<q.length;$+=2)q[$].id()<Y&&(Y=q[$].id(),X=$);(q=q.slice(X).concat(q.slice(0,X))).push(q[0]);var K=q.map((function(e){return e.id()})).join(",");-1===A.indexOf(K)&&(v.push(s.spawn(q)),A.push(K))}}}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=[],i=y(e);;){if(null==i)return t.spawn();var a=g(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},Je=Math.sqrt(2),et=function(e,t,n){0===n.length&&Se("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 h=0;h<l.length;h++){var p=l[h];p[1]===s?(l[h]=p.slice(),l[h][1]=a):p[2]===s&&(l[h]=p.slice(),l[h][2]=a)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=a);return l},tt=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=et(i,e,t),n--}return t},nt={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/Je);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=[],h=new Array(i),p=new Array(i),v=new Array(i),m=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},g=0;g<=a;g++){for(var y=0;y<i;y++)p[y]=y;var b=tt(p,l.slice(),i,s),x=b.slice();m(p,v);var w=tt(p,b,s,2),_=tt(v,x,s,2);w.length<=_.length&&w.length<d?(d=w.length,f=w,m(p,h)):_.length<=w.length&&_.length<d&&(d=_.length,f=_,m(v,h))}for(var E=this.spawn(f.map((function(e){return r[e[0]]}))),k=this.spawn(),N=this.spawn(),S=h[0],P=0;P<h.length;P++){var C=h[P],T=n[P];C===S?k.merge(T):N.merge(T)}var j=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},D=[j(k),j(N)];return{cut:E,components:D,partition1:k,partition2:N}}Se("At least 2 nodes are required for Karger-Stein algorithm")}},rt=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},it=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},ot=function(e){return{x:e[0],y:e[1]}},at=function(e,t){return Math.atan2(t,e)-Math.PI/2},st=Math.log2||function(e){return Math.log(e)/Math.log(2)},lt=function(e){return e>0?1:e<0?-1:0},ut=function(e,t){return Math.sqrt(ct(e,t))},ct=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},dt=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},ft=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},ht=function(e,t,n,r){return{x:ft(e.x,t.x,n.x,r),y:ft(e.y,t.y,n.y,r)}},pt=function(e,t,n){return Math.max(e,Math.min(n,t))},vt=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}}},mt=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},gt=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},yt=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=b(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},bt=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},xt=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)))))))},wt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},_t=function(e,t){return wt(e,t.x1,t.y1)&&wt(e,t.x2,t.y2)},Et=function(e,t,n,r,i,o,a){var s,l=Vt(i,o),u=i/2,c=o/2,d=r-c-a;if((s=Rt(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=Rt(e,t,n,r,f,r-c+l-a,f,r+c-l+a,!1)).length>0)return s;var h=r+c+a;if((s=Rt(e,t,n,r,n-u+l-a,h,n+u-l+a,h,!1)).length>0)return s;var p,v=n-u-a;if((s=Rt(e,t,n,r,v,r-c+l-a,v,r+c-l+a,!1)).length>0)return s;var m=n-u+l,g=r-c+l;if((p=At(e,t,n,r,m,g,l+a)).length>0&&p[0]<=m&&p[1]<=g)return[p[0],p[1]];var y=n+u-l,b=r-c+l;if((p=At(e,t,n,r,y,b,l+a)).length>0&&p[0]>=y&&p[1]<=b)return[p[0],p[1]];var x=n+u-l,w=r+c-l;if((p=At(e,t,n,r,x,w,l+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var _=n-u+l,E=r+c-l;return(p=At(e,t,n,r,_,E,l+a)).length>0&&p[0]<=_&&p[1]>=E?[p[0],p[1]]:[]},kt=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},Nt=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)},St=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,h,p=-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,h=Math.pow(d-e,2)+Math.pow(f-t,2),p>=0?h<p&&(p=h):p=h;return p},Pt=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},Ct=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},Tt=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),h=Math.sin(-u),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(l>0){var v=Dt(c,-l);d=jt(v)}else d=c;return Ct(e,t,d)},jt=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=Rt(t,n,r,i,o,a,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},Dt=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},Ot=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},At=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),h=(-c-Math.sqrt(d))/(2*u),p=Math.min(f,h),v=Math.max(f,h),m=[];if(p>=0&&p<=1&&m.push(p),v>=0&&v<=1&&m.push(v),0===m.length)return[];var g=m[0]*s[0]+e,y=m[0]*s[1]+t;return m.length>1?m[0]==m[1]?[g,y]:[g,y,m[1]*s[0]+e,m[1]*s[1]+t]:[g,y]},Mt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Rt=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,f=t-o,h=r-t,p=s-o,v=d*f-p*u,m=c*f-h*u,g=p*c-d*h;if(0!==g){var y=v/g,b=m/g,x=-.001;return x<=y&&y<=1.001&&x<=b&&b<=1.001||l?[e+y*c,t+y*h]:[]}return 0===v||0===m?Mt(e,n,a)===a?[a,s]:Mt(e,n,i)===i?[i,o]:Mt(i,a,n)===n?[n,r]:[]:[]},It=function(e,t,n,r,i,o,a,s){var l,u,c,d,f,h,p=[],v=new Array(n.length),m=!0;if(null==o&&(m=!1),m){for(var g=0;g<v.length/2;g++)v[2*g]=n[2*g]*o+r,v[2*g+1]=n[2*g+1]*a+i;if(s>0){var y=Dt(v,-s);u=jt(y)}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)],h=u[2*(b+1)+1]):(f=u[0],h=u[1]),0!==(l=Rt(e,t,r,i,c,d,f,h)).length&&p.push(l[0],l[1]);return p},Lt=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]]},Bt=function(e,t){var n=zt(e,t);return n=Ft(n)},Ft=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},zt=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},Vt=function(e,t){return Math.min(e/4,t/4,8)},Gt=function(e,t){return Math.min(e/10,t/10,8)},Ut=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Wt=Ae({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),qt={pageRank:function(e){for(var t=Wt(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,h=new Array(d),p=new Array(c),v=(1-n)/c,m=0;m<c;m++){for(var g=0;g<c;g++){h[m*c+g]=0}p[m]=0}for(var y=0;y<f;y++){var b=u[y],x=b.data("source"),w=b.data("target");if(x!==w){var _=l.indexOfId(x),E=l.indexOfId(w),k=o(b);h[E*c+_]+=k,p[_]+=k}}for(var N=1/c+v,S=0;S<c;S++)if(0===p[S])for(var P=0;P<c;P++){h[P*c+S]=N}else for(var C=0;C<c;C++){var T=C*c+S;h[T]=h[T]/p[S]+v}for(var j,D=new Array(c),O=new Array(c),A=0;A<c;A++)D[A]=1;for(var M=0;M<i;M++){for(var R=0;R<c;R++)O[R]=0;for(var I=0;I<c;I++)for(var L=0;L<c;L++){var B=I*c+L;O[I]+=h[B]*D[L]}dt(O),j=D,D=O,O=j;for(var F=0,z=0;z<c;z++){var V=j[z]-D[z];F+=V*V}if(F<r)break}return{rank:function(e){return e=a.collection(e)[0],D[l.indexOf(e)]}}}},Ht=Ae({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Yt={degreeCentralityNormalized:function(e){e=Ht(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:(C(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(C(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 m=this.degreeCentrality(e);h<m.degree&&(h=m.degree),f[v.id()]=m.degree}return{degree:function(e){return 0===h?0:(C(e)&&(e=t.filter(e)),f[e.id()]/h)}}},degreeCentrality:function(e){e=Ht(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,h=0,p=0,v=0;v<u.length;v++)h+=o(u[v]);for(var m=0;m<c.length;m++)p+=o(c[m]);return{indegree:Math.pow(d,1-s)*Math.pow(h,s),outdegree:Math.pow(f,1-s)*Math.pow(p,s)}}for(var g=i.connectedEdges().intersection(n),y=g.length,b=0,x=0;x<g.length;x++)b+=o(g[x]);return{degree:Math.pow(y,1-s)*Math.pow(b,s)}}};Yt.dc=Yt.degreeCentrality,Yt.dcn=Yt.degreeCentralityNormalised=Yt.degreeCentralityNormalized;var Xt=Ae({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),$t={closenessCentralityNormalized:function(e){for(var t=Xt(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],h=0;h<l.length;h++)if(c!==h){var p=u.distance(f,l[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=C(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Xt(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}};$t.cc=$t.closenessCentrality,$t.ccn=$t.closenessCentralityNormalised=$t.closenessCentralityNormalized;var Kt=Ae({weight:null,directed:!1}),Zt={betweennessCentrality:function(e){for(var t=Kt(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),a=this.nodes(),s={},l={},u=0,d=function(e,t){l[e]=t,t>u&&(u=t)},f=function(e){return l[e]},h=0;h<a.length;h++){var p=a[h],v=p.id();s[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var m=function(e){for(var t=a[e].id(),n=[],l={},u={},h={},p=new c.default((function(e,t){return h[e]-h[t]})),v=0;v<a.length;v++){var m=a[v].id();l[m]=[],u[m]=0,h[m]=1/0}for(u[t]=1,h[t]=0,p.push(t);!p.empty();){var g=p.pop();if(n.push(g),i)for(var y=0;y<s[g].length;y++){var b=s[g][y],x=o.getElementById(g),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[g]+_&&(h[b]=h[g]+_,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[g]+_&&(u[b]=u[b]+u[g],l[b].push(g))}else for(var E=0;E<s[g].length;E++){var k=s[g][E].id();h[k]==1/0&&(p.push(k),h[k]=h[g]+1),h[k]==h[g]+1&&(u[k]=u[k]+u[g],l[k].push(g))}}for(var N={},S=0;S<a.length;S++)N[a[S].id()]=0;for(;n.length>0;){for(var P=n.pop(),C=0;C<l[P].length;C++){var T=l[P][C];N[T]=N[T]+u[T]/u[P]*(1+N[P])}P!=a[e].id()&&d(P,f(P)+N[P])}},g=0;g<a.length;g++)m(g);var y={betweenness:function(e){var t=o.collection(e).id();return f(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=o.collection(e).id();return f(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};Zt.bc=Zt.betweennessCentrality;var Qt=Ae({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Jt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},en=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}},tn=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},nn=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=tn(e,r,t);return e},rn=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 en(r,t),r},on=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},an=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},sn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Qt(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 h=n[f],p=o[h.source().id()],v=o[h.target().id()],m=Jt(h,i.attributes);c[p*l+v]+=m,c[v*l+p]+=m}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,i.multFactor),en(c,l);for(var g=!0,y=0;g&&y<i.maxIterations;)g=!1,s=nn(c,l,i.expandFactor),c=rn(s,l,i.inflateFactor),on(c,s,u,4)||(g=!0),y++;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&&an(e[t],e[n])&&e.splice(n,1);return e}(b),b},ln={markovClustering:sn,mcl:sn},un=function(e){return e},cn=function(e,t){return Math.abs(t-e)},dn=function(e,t,n){return e+cn(t,n)},fn=function(e,t,n){return e+Math.pow(n-t,2)},hn=function(e){return Math.sqrt(e)},pn=function(e,t,n){return Math.max(e,cn(t,n))},vn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:un,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},mn={euclidean:function(e,t,n){return e>=2?vn(e,t,n,0,fn,hn):vn(e,t,n,0,dn)},squaredEuclidean:function(e,t,n){return vn(e,t,n,0,fn)},manhattan:function(e,t,n){return vn(e,t,n,0,dn)},max:function(e,t,n){return vn(e,t,n,-1/0,pn)}};function gn(e,t,n,r,i,o){var a;return a=T(e)?e:mn[e]||mn.euclidean,0===t&&T(e)?a(i,o):a(t,n,r,i,o)}mn["squared-euclidean"]=mn.squaredEuclidean,mn.squaredeuclidean=mn.squaredEuclidean;var yn=Ae({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),bn=function(e){return yn(e)},xn=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 gn(e,r.length,o,(function(e){return r[e](t)}),a,s)},wn=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},_n=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=xn(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},En=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},kn=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},Nn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},Sn=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)];Nn(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},Pn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=xn("manhattan",t[i],e,n,"kMedoids");return r},Cn=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}},Tn=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=xn(i.distance,r[d],n[c],i.attributes,"cmeans"),l=xn(i.distance,r[d],n[f],i.attributes,"cmeans"),a+=Math.pow(s/l,u);e[d][c]=1/a}},jn=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=bn(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,h=0;h<l.k;h++)r[d][h]=Math.random(),f+=r[d][h];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/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 m=0;m<s.length;m++)o[m]=new Array(l.k);for(var g=!0,y=0;g&&y<l.maxIterations;)g=!1,Cn(n,s,r,o,l),Tn(r,i,n,s,l),kn(r,i,l.sensitivityThreshold)||(g=!0),y++;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}},Dn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=bn(e),a=new Array(o.k),s={};o.testMode?"number"==typeof o.testCentroids?(o.testCentroids,t=wn(r,o.k,o.attributes)):t="object"===p(o.testCentroids)?o.testCentroids:wn(r,o.k,o.attributes):t=wn(r,o.k,o.attributes);for(var l,u,c,d=!0,f=0;d&&f<o.maxIterations;){for(var h=0;h<r.length;h++)s[(i=r[h]).id()]=_n(i,t,o.distance,o.attributes,"kMeans");d=!1;for(var v=0;v<o.k;v++){var m=En(v,r,s);if(0!==m.length){for(var g=o.attributes.length,y=t[v],b=new Array(g),x=new Array(g),w=0;w<g;w++){x[w]=0;for(var _=0;_<m.length;_++)i=m[_],x[w]+=o.attributes[w](i);b[w]=x[w]/m.length,l=b[w],u=y[w],c=o.sensitivityThreshold,Math.abs(u-l)<=c||(d=!0)}t[v]=b,a[v]=n.collection(m)}}f++}return a},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,a=bn(e),s=new Array(a.k),l={},u=new Array(a.k);a.testMode?"number"==typeof a.testCentroids||(t="object"===p(a.testCentroids)?a.testCentroids:Sn(i,a.k)):t=Sn(i,a.k);for(var c=!0,d=0;c&&d<a.maxIterations;){for(var f=0;f<i.length;f++)l[(o=i[f]).id()]=_n(o,t,a.distance,a.attributes,"kMedoids");c=!1;for(var h=0;h<t.length;h++){var v=En(h,i,l);if(0!==v.length){u[h]=Pn(t[h],v,a.attributes);for(var m=0;m<v.length;m++)(n=Pn(v[m],v,a.attributes))<u[h]&&(u[h]=n,t[h]=v[m],c=!0);s[h]=r.collection(v)}}d++}return s},fuzzyCMeans:jn,fcm:jn},On=Ae({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),An={single:"min",complete:"max"},Mn=function(e,t,n,r,i){for(var o,a=0,s=1/0,l=i.attributes,u=function(e,t){return gn(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 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 m=0;m<e.length;m++){var g=e[m];p.key===g.key?o=1/0:"min"===i.linkage?(o=n[p.key][g.key],n[p.key][g.key]>n[v.key][g.key]&&(o=n[v.key][g.key])):"max"===i.linkage?(o=n[p.key][g.key],n[p.key][g.key]<n[v.key][g.key]&&(o=n[v.key][g.key])):o="mean"===i.linkage?(n[p.key][g.key]*p.size+n[v.key][g.key]*v.size)/(p.size+v.size):"dendrogram"===i.mode?u(g.value,p.value):u(g.value[0],p.value[0]),n[p.key][g.key]=n[g.key][p.key]=o}for(var y=0;y<e.length;y++){var b=e[y].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[y].index=y}return p.key=v.key=p.index=v.index=null,!0},Rn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},In=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},Ln=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&Rn(t.left,i),t.right&&Rn(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&Rn(t.left,i),t.right&&Rn(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))},Bn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=On(e),n=An[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return gn(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 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][l[f]]&&(l[f]=h)}for(var v,m=Mn(a,u,s,l,r);m;)m=Mn(a,u,s,l,r);return"dendrogram"===r.mode?(v=Ln(a[0],r.dendrogramDepth,t),r.addDendrogram&&In(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},Fn={hierarchicalClustering:Bn,hca:Bn},zn=Ae({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Vn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-gn(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Gn=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},Un=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},Wn=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||Se("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||O(n)||Se("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),zn(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 h=0;h<t;h++)for(var p=0;p<t;p++)h!==p&&(r[h*t+p]=Vn(u.distance,l[h],l[p],u.attributes));i=Gn(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var m=0;m<n;m++)o[m]=0;a=new Array(n);for(var g=0;g<n;g++)a[g]=0;for(var y=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)y[w]=0,b[w]=0,x[w]=0;for(var _,E=new Array(t*u.minIterations),k=0;k<E.length;k++)E[k]=0;for(_=0;_<u.maxIterations;_++){for(var N=0;N<t;N++){for(var S=-1/0,P=-1/0,C=-1,T=0,j=0;j<t;j++)y[j]=o[N*t+j],(T=a[N*t+j]+r[N*t+j])>=S?(P=S,S=T,C=j):T>P&&(P=T);for(var D=0;D<t;D++)o[N*t+D]=(1-u.damping)*(r[N*t+D]-S)+u.damping*y[D];o[N*t+C]=(1-u.damping)*(r[N*t+C]-P)+u.damping*y[C]}for(var A=0;A<t;A++){for(var M=0,R=0;R<t;R++)y[R]=a[R*t+A],b[R]=Math.max(0,o[R*t+A]),M+=b[R];M-=b[A],b[A]=o[A*t+A],M+=b[A];for(var I=0;I<t;I++)a[I*t+A]=(1-u.damping)*Math.min(0,M-b[I])+u.damping*y[I];a[A*t+A]=(1-u.damping)*(M-b[A])+u.damping*y[A]}for(var L=0,B=0;B<t;B++){var F=a[B*t+B]+o[B*t+B]>0?1:0;E[_%u.minIterations*t+B]=F,L+=F}if(L>0&&(_>=u.minIterations-1||_==u.maxIterations-1)){for(var z=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<u.minIterations;G++)x[V]+=E[G*t+V];0!==x[V]&&x[V]!==u.minIterations||z++}if(z===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=Un(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 Un(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 $=new Array(U.length),K=0;K<U.length;K++)$[K]=s.collection(q[U[K]]);return $},qn={affinityPropagation:Wn,ap:Wn},Hn=Ae({root:void 0,directed:!1}),Yn=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,h,p,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(),(h=d===u?f:d)!==c&&(p=n.id(),a[p]||(a[p]=!0,o.push({x:u,y:h,edge:n})),h in t?t[u].low=Math.min(t[u].low,t[h].id):(s(l,h,u),t[u].low=Math.min(t[u].low,t[h].low),t[u].id<=t[h].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,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 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}},Xn=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}},$n={};[Ue,qe,He,Xe,Ke,Qe,nt,qt,Yt,$t,Zt,ln,Dn,Fn,qn,{hierholzer:function(e){if(!D(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=Hn(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=C(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 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(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=h(v.shift()).concat(v);for(var m in p.unshift(l.getElementById(v.shift())),c)if(c[m].length)return f;return f.found=!0,f.trail=this.spawn(p,!0),f}},{hopcroftTarjanBiconnected:Yn,htbc:Yn,htb:Yn,hopcroftTarjanBiconnectedComponents:Yn},{tarjanStronglyConnected:Xn,tsc:Xn,tscc:Xn,tarjanStronglyConnectedComponents:Xn}].forEach((function(e){Q($n,e)}));var Kn=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))};Kn.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 Kn;return n.onFulfilled.push(er(e,r,"fulfill")),n.onRejected.push(er(t,r,"reject")),Qn(n),r.proxy}};var Zn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Qn(e)),e},Qn=function(e){1===e.state?Jn(e,"onFulfilled",e.fulfillValue):2===e.state&&Jn(e,"onRejected",e.rejectReason)},Jn=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)}},er=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)}tr(t,i)}}},tr=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===p(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"))};Kn.all=function(e){return new Kn((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)}))},Kn.resolve=function(e){return new Kn((function(t,n){t(e)}))},Kn.reject=function(e){return new Kn((function(t,n){n(e)}))};var nr="undefined"!=typeof Promise?Promise:Kn,rr=function(e,t,n){var r=L(e),i=!r,o=this._private=Q({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&&T(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},ir=rr.prototype;Q(ir,{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),M(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 nr((function(e,n){t.push((function(){e()}))}))}}),ir.complete=ir.completed,ir.run=ir.play,ir.running=ir.playing;var or={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=Q({},e,t),0===Object.keys(e).length)return new rr(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=it(u,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 m=e.fit,g=o.getFitViewport(m.eles||m.boundingBox,m.padding);null!=g&&(e.pan=g.pan,e.zoom=g.zoom)}if(a&&D(e.zoom)){var y=o.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new rr(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=Q({},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}}},ar={data:function(e){return e=Q({},{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(C(t)){var l,u=-1!==t.indexOf(".")&&h.default(t);if(r.allowGetting&&void 0===n)return s&&(r.beforeGet(s),l=u&&void 0===s._private[r.field][t]?d.default(s._private[r.field],u):s._private[r.field][t]),l;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var c=y({},t,n);r.beforeSet(i,c);for(var p=0,v=a.length;p<v;p++){var m=a[p];r.canSet(m)&&(u&&void 0===s._private[r.field][t]?f.default(m._private[r.field],u,n):m._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&D(t)){var g,b,x=t,w=Object.keys(x);r.beforeSet(i,x);for(var _=0;_<w.length;_++){if(b=x[g=w[_]],!r.immutableKeys[g])for(var E=0;E<a.length;E++){var k=a[E];r.canSet(k)&&(k._private[r.field][g]=b)}}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&T(t)){var N=t;i.on(r.bindingEvent,N)}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=Q({},{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(C(t)){for(var o=t.split(/\s+/),a=o.length,s=0;s<a;s++){var l=o[s];if(!F(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 h=i[d]._private[n.field],p=Object.keys(h),v=0;v<p.length;v++){var m=p[v];!n.immutableKeys[m]&&(h[m]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},sr={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 nr((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}},lr={};[or,ar,sr].forEach((function(e){Q(lr,e)}));var ur={animate:lr.animate(),animation:lr.animation(),animated:lr.animated(),clearQueue:lr.clearQueue(),delay:lr.delay(),delayAnimation:lr.delayAnimation(),stop:lr.stop()},cr={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}j(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new ze(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){j(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),h=!1;t||r&&!f?(l.add(d),h=!0):(!t||r&&f)&&(l.delete(d),h=!0),!u&&h&&(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}};cr.className=cr.classNames=cr.classes;var dr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:H,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};dr.variable="(?:[\\w-.]|(?:\\\\"+dr.metaChar+"))+",dr.className="(?:[\\w-]|(?:\\\\"+dr.metaChar+"))+",dr.value=dr.string+"|"+dr.number,dr.id=dr.variable,function(){var e,t,n;for(e=dr.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],dr.comparatorOp+="|@"+t;for(e=dr.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(dr.comparatorOp+="|\\!"+t)}();var fr=0,hr=1,pr=2,vr=3,mr=4,gr=5,yr=6,br=7,xr=8,wr=9,_r=10,Er=11,kr=12,Nr=13,Sr=14,Pr=15,Cr=16,Tr=17,jr=18,Dr=19,Or=20,Ar=[{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)})),Mr=function(){for(var e,t={},n=0;n<Ar.length;n++)t[(e=Ar[n]).selector]=e.matches;return t}(),Rr="("+Ar.map((function(e){return e.selector})).join("|")+")",Ir=function(e){return e.replace(new RegExp("\\\\("+dr.metaChar+")","g"),(function(e,t){return t}))},Lr=function(e,t,n){e[e.length-1]=n},Br=[{name:"group",query:!0,regex:"("+dr.group+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:fr,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Rr,populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:br,value:r})}},{name:"id",query:!0,regex:"\\#("+dr.id+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:xr,value:Ir(r)})}},{name:"className",query:!0,regex:"\\.("+dr.className+")",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:wr,value:Ir(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+dr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,1)[0];t.checks.push({type:mr,field:Ir(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+dr.variable+")\\s*("+dr.comparatorOp+")\\s*("+dr.value+")\\s*\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+dr.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:vr,field:Ir(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+dr.boolOp+")\\s*("+dr.variable+")\\s*\\]",populate:function(e,t,n){var r=b(n,2),i=r[0],o=r[1];t.checks.push({type:gr,field:Ir(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+dr.meta+")\\s*("+dr.comparatorOp+")\\s*("+dr.number+")\\s*\\]\\]",populate:function(e,t,n){var r=b(n,3),i=r[0],o=r[1],a=r[2];t.checks.push({type:yr,field:Ir(i),operator:o,value:parseFloat(a)})}},{name:"nextQuery",separator:!0,regex:dr.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:dr.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:Er,source:r,target:i}),Lr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:kr,source:a,target:s}),Lr(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:dr.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:_r,nodes:[r,i]}),Lr(e,0,n),e.edgeCount++,i}var o={checks:[]},a=t,s={checks:[]};return o.checks.push({type:Sr,node:a,neighbor:s}),Lr(e,0,o),s}},{name:"child",separator:!0,regex:dr.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:Pr,parent:i,child:r}),Lr(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:Dr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Or}],c.checks.push({type:Or}),s.checks.push({type:Tr,parent:c,child:u}),Lr(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},h=[{type:Tr,parent:d,child:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"descendant",separator:!0,regex:dr.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:Cr,ancestor:i,descendant:r}),Lr(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:Dr,left:a,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:Or}],c.checks.push({type:Or}),s.checks.push({type:jr,ancestor:c,descendant:u}),Lr(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},f={checks:[]},h=[{type:jr,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=h,e.compoundCount++,f}},{name:"subject",modifier:!0,regex:dr.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return Ce("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===Er?n.type=Nr:r===_r&&(n.type=Sr,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Br.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Fr=function(e){for(var t,n,r,i=0;i<Br.length;i++){var o=Br[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}},zr={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=Fr(n);if(null==i.expr)return Ce("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 Ce("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ce("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ce("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 e??""},t=function(t){return C(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,o){var a=r.type,s=r.value;switch(a){case fr:var l=e(s);return l.substring(0,l.length-1);case vr:var u=r.field,c=r.operator;return"["+u+n(e(c))+t(s)+"]";case gr:var d=r.operator,f=r.field;return"["+e(d)+f+"]";case mr:return"["+r.field+"]";case yr:var h=r.operator;return"[["+r.field+n(e(h))+t(s)+"]]";case br:return s;case xr:return"#"+s;case wr:return"."+s;case Tr:case Pr:return i(r.parent,o)+n(">")+i(r.child,o);case jr:case Cr:return i(r.ancestor,o)+" "+i(r.descendant,o);case Dr:var p=i(r.left,o),v=i(r.subject,o),m=i(r.right,o);return p+(p.length>0?" ":"")+v+m;case Or: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}},Vr=function(e,t,n){var r,i,o,a=C(e),s=O(e),l=C(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},Gr=function(e,t){return e.data(t)},Ur=[],Wr=function(e,t){return e.checks.every((function(e){return Ur[e.type](e,t)}))};Ur[fr]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Ur[br]=function(e,t){return function(e,t){return Mr[e](t)}(e.value,t)},Ur[xr]=function(e,t){var n=e.value;return t.id()===n},Ur[wr]=function(e,t){var n=e.value;return t.hasClass(n)},Ur[yr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Vr(function(e,t){return e[t]()}(t,n),r,i)},Ur[vr]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Vr(Gr(t,n),r,i)},Ur[gr]=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}}(Gr(t,n),r)},Ur[mr]=function(e,t){var n=e.field;return e.operator,void 0!==Gr(t,n)},Ur[_r]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return Wr(n,i)&&Wr(r,o)||Wr(r,i)&&Wr(n,o)},Ur[Sr]=function(e,t){return Wr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Wr(e.neighbor,t)}))},Ur[Er]=function(e,t){return Wr(e.source,t.source())&&Wr(e.target,t.target())},Ur[kr]=function(e,t){return Wr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Wr(e.target,t)}))},Ur[Nr]=function(e,t){return Wr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Wr(e.source,t)}))},Ur[Pr]=function(e,t){return Wr(e.child,t)&&Wr(e.parent,t.parent())},Ur[Tr]=function(e,t){return Wr(e.parent,t)&&t.children().some((function(t){return Wr(e.child,t)}))},Ur[Cr]=function(e,t){return Wr(e.descendant,t)&&t.ancestors().some((function(t){return Wr(e.ancestor,t)}))},Ur[jr]=function(e,t){return Wr(e.ancestor,t)&&t.descendants().some((function(t){return Wr(e.descendant,t)}))},Ur[Dr]=function(e,t){return Wr(e.subject,t)&&Wr(e.left,t)&&Wr(e.right,t)},Ur[Or]=function(){return!0},Ur[hr]=function(e,t){return e.value.has(t)},Ur[pr]=function(e,t){return(0,e.value)(t)};var qr={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Wr(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===xr)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(Wr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Hr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||C(e)&&e.match(/^\s*$/)||(M(e)?this.addQuery({checks:[{type:hr,value:e.collection()}]}):T(e)?this.addQuery({checks:[{type:pr,value:e}]}):C(e)?this.parse(e)||(this.invalid=!0):Se("A selector must be created from a string; found "))},Yr=Hr.prototype;[zr,qr].forEach((function(e){return Q(Yr,e)})),Yr.text=function(){return this.inputText},Yr.size=function(){return this.length},Yr.eq=function(e){return this[e]},Yr.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Yr.addQuery=function(e){this[this.length++]=e},Yr.selector=Yr.toString;var Xr={allAre:function(e){var t=new Hr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Hr(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())}))}};Xr.allAreNeighbours=Xr.allAreNeighbors,Xr.has=Xr.contains,Xr.equal=Xr.equals=Xr.same;var $r,Kr,Zr=function(e,t){return function(n,r,i,o){var a,s=n,l=this;if(null==s?a="":M(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=ve(a),h=d[f];return h||(d[f]=e.call(l,n,r,i,o))}return e.call(l,n,r,i,o)}},Qr={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 Jr(e,t,n,r){for(var i=[],o=new ze,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 ei(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 ti(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function ni(e,t,n){ti(e,t,n),ei(e,t,n)}Qr.forEachDown=function(e){return Jr(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ei)},Qr.forEachUp=function(e){return Jr(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ti)},Qr.forEachUpAndDown=function(e){return Jr(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ni)},Qr.ancestors=Qr.parents,($r=Kr={data:lr.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:lr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:lr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:lr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:lr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:lr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=$r.data,$r.removeAttr=$r.removeData;var ri,ii,oi=Kr,ai={};function si(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 li(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}}Q(ai,{degree:si((function(e,t){return t.source().same(t.target())?2:1})),indegree:si((function(e,t){return t.target().same(e)?1:0})),outdegree:si((function(e,t){return t.source().same(e)?1:0}))}),Q(ai,{minDegree:li("degree",(function(e,t){return e<t})),maxDegree:li("degree",(function(e,t){return e>t})),minIndegree:li("indegree",(function(e,t){return e<t})),maxIndegree:li("indegree",(function(e,t){return e>t})),minOutdegree:li("outdegree",(function(e,t){return e<t})),maxOutdegree:li("outdegree",(function(e,t){return e>t}))}),Q(ai,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var ui=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()}}},ci={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){ui(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ri=ii={position:lr.data(ci),silentPosition:lr.data(Q({},ci,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){ui(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(D(e))t?this.silentPosition(e):this.position(e);else if(T(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(D(e)?(r={x:O(e.x)?e.x:0,y:O(e.y)?e.y:0},n=t):C(e)&&O(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];if(!(i.hasCompoundNodes()&&a.isChild()&&a.ancestors().anySame(this))){var 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 D(e)?this.shift(e,!0):C(e)&&O(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=D(e)?e:void 0,s=void 0!==a||void 0!==t&&C(e);if(n&&n.isNode()){if(!s){var l=n.position();return a=rt(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(it(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=D(e)?e:void 0,o=void 0!==i||void 0!==t&&C(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 h=this[f],p=a?h.parent():null,v=p&&p.length>0,m=v;v&&(p=p[0]);var g=m?p.position():{x:0,y:0};void 0!==t?h.position(e,t+g[e]):void 0!==i&&h.position({x:i.x+g.x,y:i.y+g.y})}}else if(!o)return;return this}},ri.modelPosition=ri.point=ri.position,ri.modelPositions=ri.points=ri.positions,ri.renderedPoint=ri.renderedPosition,ri.relativePoint=ri.relativePosition;var di,fi,hi=ii;di=fi={},fi.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}},fi.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},fi.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=g(i.width.val-o.w,s,l),f=d.biasDiff,h=d.biasComplementDiff,p=g(i.height.val-o.h,u,c),v=p.biasDiff,m=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+m)/2}function g(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 pi=function(e){return e===1/0||e===-1/0?0:e},vi=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)},mi=function(e,t){return null==t?e:vi(e,t.x1,t.y1,t.x2,t.y2)},gi=function(e,t,n){return Ie(e,t,n)},yi=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,gt(u,1),vi(e,u.x1,u.y1,u.x2,u.y2)}}},bi=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=gi(o,"labelWidth",n),h=gi(o,"labelHeight",n),p=gi(o,"labelX",n),v=gi(o,"labelY",n),m=t.pstyle(r+"text-margin-x").pfValue,g=t.pstyle(r+"text-margin-y").pfValue,y=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,N=k/2,S=E/2;if(y)a=p-N,s=p+N,l=v-S,u=v+S;else{switch(c.value){case"left":a=p-k,s=p;break;case"center":a=p-N,s=p+N;break;case"right":a=p,s=p+k}switch(d.value){case"top":l=v-E,u=v;break;case"center":l=v-S,u=v+S;break;case"bottom":l=v,u=v+E}}a+=m-Math.max(x,w)-_-2,s+=m+Math.max(x,w)+_+2,l+=g-Math.max(x,w)-_-2,u+=g+Math.max(x,w)+_+2;var P=n||"main",C=i.labelBounds,T=C[P]=C[P]||{};T.x1=a,T.y1=l,T.x2=s,T.y2=u,T.w=s-a,T.h=u-l;var j=y&&"autorotate"===b.strValue,D=null!=b.pfValue&&0!==b.pfValue;if(j||D){var O=j?gi(i.rstyle,"labelAngle",n):b.pfValue,A=Math.cos(O),M=Math.sin(O),R=(a+s)/2,I=(l+u)/2;if(!y){switch(c.value){case"left":R=s;break;case"right":R=a}switch(d.value){case"top":I=u;break;case"bottom":I=l}}var L=function(e,t){return{x:(e-=R)*A-(t-=I)*M+R,y:e*M+t*A+I}},B=L(a,l),F=L(a,u),z=L(s,l),V=L(s,u);a=Math.min(B.x,F.x,z.x,V.x),s=Math.max(B.x,F.x,z.x,V.x),l=Math.min(B.y,F.y,z.y,V.y),u=Math.max(B.y,F.y,z.y,V.y)}var G=P+"Rot",U=C[G]=C[G]||{};U.x1=a,U.y1=l,U.x2=s,U.y2=u,U.w=s-a,U.h=u-l,vi(e,a,l,s,u),vi(i.labelBounds.all,a,l,s,u)}return e}},xi=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)},wi=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 ce({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},_i=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?ki:xi(t))===ki,a=wi(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=vt(),h=e._private,p=e.isNode(),v=e.isEdge(),m=h.rstyle,g=p&&c?e.pstyle("bounds-expansion").pfValue:[0],y=function(e){return"none"!==e.pstyle("display").value},b=!c||y(e)&&(!v||y(e.source())&&y(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;c&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(w=e.pstyle("underlay-padding").value);var _=Math.max(x,w),E=0;if(c&&(E=e.pstyle("width").pfValue/2),p&&t.includeNodes){var k=e.position();a=k.x,s=k.y;var N=e.outerWidth()/2,S=e.outerHeight()/2;vi(f,n=a-N,i=s-S,r=a+N,o=s+S)}else if(v&&t.includeEdges)if(c&&!d){var P=e.pstyle("curve-style").strValue;if(n=Math.min(m.srcX,m.midX,m.tgtX),r=Math.max(m.srcX,m.midX,m.tgtX),i=Math.min(m.srcY,m.midY,m.tgtY),o=Math.max(m.srcY,m.midY,m.tgtY),vi(f,n-=E,i-=E,r+=E,o+=E),"haystack"===P){var C=m.haystackPts;if(C&&2===C.length){if(n=C[0].x,i=C[0].y,n>(r=C[1].x)){var T=n;n=r,r=T}if(i>(o=C[1].y)){var j=i;i=o,o=j}vi(f,n-E,i-E,r+E,o+E)}}else if("bezier"===P||"unbundled-bezier"===P||"segments"===P||"taxi"===P){var D;switch(P){case"bezier":case"unbundled-bezier":D=m.bezierPts;break;case"segments":case"taxi":D=m.linePts}if(null!=D)for(var O=0;O<D.length;O++){var A=D[O];n=A.x-E,r=A.x+E,i=A.y-E,o=A.y+E,vi(f,n,i,r,o)}}}else{var M=e.source().position(),R=e.target().position();if((n=M.x)>(r=R.x)){var I=n;n=r,r=I}if((i=M.y)>(o=R.y)){var L=i;i=o,o=L}vi(f,n-=E,i-=E,r+=E,o+=E)}if(c&&t.includeEdges&&v&&(yi(f,e,"mid-source"),yi(f,e,"mid-target"),yi(f,e,"source"),yi(f,e,"target")),c&&"yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;vi(f,f.x1+B,f.y1+F,f.x2+B,f.y2+F)}var z=h.bodyBounds=h.bodyBounds||{};bt(z,f),yt(z,g),gt(z,1),c&&(n=f.x1,r=f.x2,i=f.y1,o=f.y2,vi(f,n-_,i-_,r+_,o+_));var V=h.overlayBounds=h.overlayBounds||{};bt(V,f),yt(V,g),gt(V,1);var G=h.labelBounds=h.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=vt(),c&&t.includeLabels&&(t.includeMainLabels&&bi(f,e,null),v&&(t.includeSourceLabels&&bi(f,e,"source"),t.includeTargetLabels&&bi(f,e,"target")))}return f.x1=pi(f.x1),f.y1=pi(f.y1),f.x2=pi(f.x2),f.y2=pi(f.y2),f.w=pi(f.x2-f.x1),f.h=pi(f.y2-f.y1),f.w>0&&f.h>0&&b&&(yt(f,g),gt(f,1)),f}(e,Ei),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=vt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?mi(n,r.overlayBounds):mi(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?mi(n,r.labelBounds.all):(t.includeMainLabels&&mi(n,r.labelBounds.mainRot),t.includeSourceLabels&&mi(n,r.labelBounds.sourceRot),t.includeTargetLabels&&mi(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ei={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},ki=xi(Ei),Ni=Ae(Ei);fi.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=vt();var n=Ni(e=e||Ei),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var o=r[i],a=o._private,s=wi(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];mi(t,_i(d,n))}}else e=void 0===e?Ei:Ni(e),t=_i(this[0],e);return t.x1=pi(t.x1),t.y1=pi(t.y1),t.x2=pi(t.x2),t.y2=pi(t.y2),t.w=pi(t.x2-t.x1),t.h=pi(t.y2-t.y1),t},fi.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},fi.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)),D(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},di.boundingbox=di.bb=di.boundingBox,di.renderedBoundingbox=di.renderedBoundingBox;var Si,Pi,Ci=fi;Si=Pi={};var Ti=function(e){e.uppercaseName=q(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=q(e.outerName),Si[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}},Si["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},Si["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},Si["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Ti({name:"width"}),Ti({name:"height"}),Pi.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},Pi.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},Pi.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var ji=Pi,Di={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)}}},Oi=Object.keys(Di).reduce((function(e,t){var n=Di[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 rt(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return rt(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),Ai=Q({},hi,Ci,ji,Oi),Mi=function(e,t){this.recycle(e,t)};function Ri(){return!1}function Ii(){return!0}Mi.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ri,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ii:Ri):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=Ii;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ii;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ii,this.stopPropagation()},isDefaultPrevented:Ri,isPropagationStopped:Ri,isImmediatePropagationStopped:Ri};var Li=/^([^.]+)(\.(?:[^.]+))?$/,Bi={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},Fi=Object.keys(Bi),zi={};function Vi(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zi,t=arguments.length>1?arguments[1]:void 0,n=0;n<Fi.length;n++){var r=Fi[n];this[r]=e[r]||Bi[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Gi=Vi.prototype,Ui=function(e,t,n,r,i,o,a){T(r)&&(i=r,r=null),a&&(o=null==o?a:Q({},o,a));for(var s=j(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!F(u)){var c=u.match(Li);if(c)if(!1===t(e,u,c[1],c[2]?c[2]:null,r,i,o))break}}},Wi=function(e,t){return e.addEventFields(e.context,t),new Mi(t.type,t)},qi=function(e,t,n){if("event"!==P(n))if(D(n))t(e,Wi(e,n));else for(var r=j(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!F(o)){var a=o.match(Li);if(a){var s=a[1],l=a[2]?a[2]:null;t(e,Wi(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Gi.on=Gi.addListener=function(e,t,n,r,i){return Ui(this,(function(e,t,n,r,i,o,a){T(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Gi.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Gi.removeListener=Gi.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];Ui(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},Gi.removeAllListeners=function(){return this.removeListener("*")},Gi.emit=Gi.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,j(t)||(t=[t]),qi(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 Hi={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&&R(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()}},Yi=function(e){return C(e)?new Hr(e):e},Xi={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Vi(Hi,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Yi(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=Yi(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=Yi(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=Yi(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}};lr.eventAliasesOn(Xi);var $i={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(C(e)||M(e))return new Hr(e).filter(this);if(T(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){C(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(C(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;C(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;C(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(C(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&&C(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&&C(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}}},Ki=$i;Ki.u=Ki["|"]=Ki["+"]=Ki.union=Ki.or=Ki.add,Ki["\\"]=Ki["!"]=Ki["-"]=Ki.difference=Ki.relativeComplement=Ki.subtract=Ki.not,Ki.n=Ki["&"]=Ki["."]=Ki.and=Ki.intersection=Ki.intersect,Ki["^"]=Ki["(+)"]=Ki["(-)"]=Ki.symmetricDifference=Ki.symdiff=Ki.xor,Ki.fnFilter=Ki.filterFn=Ki.stdFilter=Ki.filter,Ki.complement=Ki.abscomp=Ki.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?we: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()},Qi={forEach:function(e,t){if(T(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(!T(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:we-1}var r=t.source,i=t.target,o=r.zDepth(),a=i.zDepth();return Math.max(o,a,0)}}};Qi.each=Qi.forEach;var Ji;Ji="undefined",("undefined"==typeof Symbol?"undefined":p(Symbol))!=Ji&&p(Symbol.iterator)!=Ji&&(Qi[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return y({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var eo=Ae({nodeDimensionsIncludeLabels:!1}),to={layoutDimensions:function(e){var t;if(e=eo(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=V(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=vt(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);mt(e,i.x,i.y)}return e}(),c=V((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],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 m=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(m)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),nr.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(Q({},e,{eles:this}))}};function no(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 ro(e,t){return e=ve(e),function(n){return no(e,t,n)}}function io(e,t){e=ve(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return no(e,n,t)}}to.createLayout=to.makeLayout=to.layout;var oo={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(D(e)){var i=e;r.applyBypass(this,i,false),this.emitAndNotify("style")}else if(C(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 ao(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 so(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||ao(i,r);var s=a.source,l=a.target;return n(s)&&(!o||ao(s,n))&&(s===l||n(l)&&(!o||ao(l,n)))}}}var lo=ro("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));oo.takesUpSpace=io("takesUpSpace",so({ok:lo}));var uo=ro("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&lo(e)})),co=ro("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&lo(e)}));oo.interactive=io("interactive",so({ok:uo,parentOk:co,edgeOkViaNode:lo})),oo.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var fo=ro("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&lo(e)})),ho=lo;oo.visible=io("visible",so({ok:fo,edgeOkViaNode:ho})),oo.hidden=function(){var e=this[0];if(e)return!e.visible()},oo.isBundledBezier=io("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),oo.bypass=oo.css=oo.style,oo.renderedCss=oo.renderedStyle,oo.removeBypass=oo.removeCss=oo.removeStyle,oo.pstyle=oo.parsedStyle;var po={};function vo(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&&T(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&j(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 mo(e){po[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]}},po[e.on]=vo({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),po[e.off]=vo({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}mo({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),mo({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),mo({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),mo({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),po.deselect=po.unselect,po.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},mo({field:"active",on:"activate",off:"unactivate"}),mo({field:"pannable",on:"panify",off:"unpanify"}),po.inactive=function(){var e=this[0];if(e)return!e._private.active};var go={},yo=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)}},bo=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)}},xo=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 wo(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 _o(e){return function(t){var n=[],r=this._private.cy,i=e||{};C(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 Eo(e){return e=Q({},{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],h=f._private.data,p=h.target,v=h.source,m=p===u&&v===l,g=l===p&&u===v;(i.codirected&&m||!i.codirected&&(m||g))&&n.push(f)}return this.spawn(n,!0).filter(t)}}go.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},Q(go,{roots:yo({noIncomingEdges:!0}),leaves:yo({noOutgoingEdges:!0}),outgoers:Zr(bo({outgoing:!0}),"outgoers"),successors:xo({outgoing:!0}),incomers:Zr(bo({incoming:!0}),"incomers"),predecessors:xo({incoming:!0})}),Q(go,{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],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)}}),go.neighbourhood=go.neighborhood,go.closedNeighbourhood=go.closedNeighborhood,go.openNeighbourhood=go.openNeighborhood,Q(go,{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:wo({attr:"source"}),targets:wo({attr:"target"})}),Q(go,{edgesWith:Zr(_o(),"edgesWith"),edgesTo:Zr(_o({thisIsSrc:!0}),"edgesTo")}),Q(go,{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(Eo(),"parallelEdges"),codirectedEdges:Zr(Eo({codirected:!0}),"codirectedEdges")}),Q(go,{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]}}),go.componentsOf=go.components;var ko=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Be,o=!1;if(t){if(t.length>0&&D(t[0])&&!R(t[0])){o=!0;for(var a=[],s=new ze,l=0,u=t.length;l<u;l++){var c=t[l];null==c.data&&(c.data={});var d=c.data;if(null==d.id)d.id=je();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var f=new Ve(e,c,!1);a.push(f),s.add(d.id)}t=a}}else t=[];this.length=0;for(var h=0,p=t.length;h<p;h++){var v=t[h][0];if(null!=v){var m=v._private.data.id;n&&i.has(m)||(n&&i.set(m,{index:this.length,ele:v}),this[this.length]=v,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 Be,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=i),o&&!r&&this.restore()}else Se("A collection must have a reference to the core")},No=Ve.prototype=ko.prototype=Object.create(Array.prototype);No.instanceString=function(){return"collection"},No.spawn=function(e,t){return new ko(this.cy(),e,t)},No.spawnSelf=function(){return this.spawn(this)},No.cy=function(){return this._private.cy},No.renderer=function(){return this._private.cy.renderer()},No.element=function(){return this[0]},No.collection=function(){return I(this)?this:new ko(this._private.cy,[this])},No.unique=function(){return new ko(this._private.cy,this,!0)},No.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},No.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new ko(t)},No.$id=No.getElementById,No.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},No.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},No.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},No.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(D(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:Te(r.data),position:Te(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}}},No.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},No.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Ve(e,r,!1);t.push(i)}return new ko(e,t)},No.copy=No.clone,No.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 h=e[t],p=h._private,v=p.data;if(h.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=je();else if(O(v.id))v.id=""+v.id;else{if(F(v.id)||!C(v.id)){Se("Can not create element with invalid string ID `"+v.id+"`"),f();continue}if(o.hasElementWithId(v.id)){Se("Can not create second element with ID `"+v.id+"`"),f();continue}}else;var m=v.id;if(h.isNode()){var g=p.position;null==g.x&&(g.x=0),null==g.y&&(g.y=0)}if(h.isEdge()){for(var y=h,b=["source","target"],x=b.length,w=!1,_=0;_<x;_++){var E=b[_],k=v[E];O(k)&&(k=v[E]=""+v[E]),null==k||""===k?(Se("Can not create edge `"+m+"` with unspecified "+E),w=!0):o.hasElementWithId(k)||(Se("Can not create edge `"+m+"` with nonexistant "+E+" `"+k+"`"),w=!0)}if(w){f();continue}var N=o.getElementById(v.source),S=o.getElementById(v.target);N.same(S)?N._private.edges.push(y):(N._private.edges.push(y),S._private.edges.push(y)),y._private.source=N,y._private.target=S}p.map=new Be,p.map.set(m,{ele:h,index:0}),p.removed=!1,r&&o.addToPool(h)}for(var P=0;P<s.length;P++){var T=s[P],j=T._private.data;O(j.parent)&&(j.parent=""+j.parent);var D=j.parent;if(null!=D||T._private.parent){var A=T._private.parent?o.collection().merge(T._private.parent):o.getElementById(D);if(A.empty())j.parent=void 0;else if(A[0].removed())Ce("Node added with missing parent, reference to parent removed"),j.parent=void 0,T._private.parent=null;else{for(var M=!1,R=A;!R.empty();){if(T.same(R)){M=!0,j.parent=void 0;break}R=R.parent()}M||(A[0]._private.children.push(T),T._private.parent=A[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var I=e.length===i.length?i:new ko(o,e),L=0;L<I.length;L++){var B=I[L];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(I).merge(I.connectedNodes()).merge(I.parent()):I).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?I.emitAndNotify("add"):r&&I.emit("add")}return i},No.removed=function(){var e=this[0];return e&&e._private.removed},No.inside=function(){var e=this[0];return e&&!e._private.removed},No.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){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n<t.length;n++)a(t[n])}(e),function(e){for(var t=e._private.children,n=0;n<t.length;n++)a(t[n])}(e)):r.unshift(e))}for(var s=0,l=n.length;s<l;s++){a(n[s])}function u(e,t){var n=e._private.edges;Me(n,t),e.clearTraversalCache()}function c(e){e.clearTraversalCache()}var d=[];function f(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Me(n,t),t._private.parent=null,d.ids[r]||(d.ids[r]=!0,d.push(e))}d.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var h=0;h<r.length;h++){var p=r[h];if(p.isEdge()){var v=p.source()[0],m=p.target()[0];u(v,p),u(m,p);for(var g=p.parallelEdges(),y=0;y<g.length;y++){var b=g[y];c(b),b.isBundledBezier()&&b.dirtyBoundingBoxCache()}}else{var x=p.parent();0!==x.length&&f(x,p)}t&&(p._private.removed=!0)}var w=o._private.elements;o._private.hasCompoundNodes=!1;for(var _=0;_<w.length;_++){if(w[_].isParent()){o._private.hasCompoundNodes=!0;break}}var E=new ko(this.cy(),r);E.size()>0&&(e?E.emitAndNotify("remove"):t&&E.emit("remove"));for(var k=0;k<d.length;k++){var N=d[k];t&&N.removed()||N.updateStyle()}return E},No.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},[$n,ur,cr,Xr,Qr,oi,ai,Ai,Xi,$i,{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}},Qi,to,oo,po,go].forEach((function(e){Q(No,e)}));var So={add:function(e){var t,n=this;if(M(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 ko(n,i)}}else if(j(e)){t=new ko(n,e)}else if(D(e)&&(j(e.nodes)||j(e.edges))){for(var s=e,l=[],u=["nodes","edges"],c=0,d=u.length;c<d;c++){var f=u[c],h=s[f];if(j(h))for(var p=0,v=h.length;p<v;p++){var m=Q({group:f},h[p]);l.push(m)}}t=new ko(n,l)}else{t=new Ve(n,e).collection()}return t},remove:function(e){if(M(e));else if(C(e)){var t=e;e=this.$(t)}return e.remove()}};function Po(e,t,n,r){var i=4,o=1e-7,a=10,s=11,l=1/(s-1),u="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var c=0;c<4;++c)if("number"!=typeof arguments[c]||isNaN(arguments[c])||!isFinite(arguments[c]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var d=u?new Float32Array(s):new Array(s);function f(e,t){return 1-3*t+3*e}function h(e,t){return 3*t-6*e}function p(e){return 3*e}function v(e,t,n){return((f(t,n)*e+h(t,n))*e+p(t))*e}function m(e,t,n){return 3*f(t,n)*e*e+2*h(t,n)*e+p(t)}function g(t){for(var r=0,u=1,c=s-1;u!==c&&d[u]<=t;++u)r+=l;--u;var f=r+(t-d[u])/(d[u+1]-d[u])*l,h=m(f,e,n);return h>=.001?function(t,r){for(var o=0;o<i;++o){var a=m(r,e,n);if(0===a)return r;r-=(v(r,e,n)-t)/a}return r}(t,f):0===h?f:function(t,r,i){var s,l,u=0;do{(s=v(l=r+(i-r)/2,e,n)-t)>0?i=l:r=l}while(Math.abs(s)>o&&++u<a);return l}(t,r,r+l)}var y=!1;function b(){y=!0,e===t&&n===r||function(){for(var t=0;t<s;++t)d[t]=v(t*l,e,n)}()}var x=function(i){return y||b(),e===t&&n===r?i:0===i?0:1===i?1:v(g(i),t,r)};x.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var w="generateBezier("+[e,t,n,r]+")";return x.toString=function(){return w},x}var Co=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}}(),To=function(e,t,n,r){var i=Po(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},jo={linear:function(e,t,n){return e+(t-e)*n},ease:To(.25,.1,.25,1),"ease-in":To(.42,0,1,1),"ease-out":To(0,0,.58,1),"ease-in-out":To(.42,0,.58,1),"ease-in-sine":To(.47,0,.745,.715),"ease-out-sine":To(.39,.575,.565,1),"ease-in-out-sine":To(.445,.05,.55,.95),"ease-in-quad":To(.55,.085,.68,.53),"ease-out-quad":To(.25,.46,.45,.94),"ease-in-out-quad":To(.455,.03,.515,.955),"ease-in-cubic":To(.55,.055,.675,.19),"ease-out-cubic":To(.215,.61,.355,1),"ease-in-out-cubic":To(.645,.045,.355,1),"ease-in-quart":To(.895,.03,.685,.22),"ease-out-quart":To(.165,.84,.44,1),"ease-in-out-quart":To(.77,0,.175,1),"ease-in-quint":To(.755,.05,.855,.06),"ease-out-quint":To(.23,1,.32,1),"ease-in-out-quint":To(.86,0,.07,1),"ease-in-expo":To(.95,.05,.795,.035),"ease-out-expo":To(.19,1,.22,1),"ease-in-out-expo":To(1,0,0,1),"ease-in-circ":To(.6,.04,.98,.335),"ease-out-circ":To(.075,.82,.165,1),"ease-in-out-circ":To(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return jo.linear;var r=Co(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":To};function Do(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 Oo(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ao(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Oo(e,i),s=Oo(t,i);if(O(a)&&O(s))return Do(o,a,s,n,r);if(j(a)&&j(s)){for(var l=[],u=0;u<s.length;u++){var c=a[u],d=s[u];if(null!=c&&null!=d){var f=Do(o,c,d,n,r);l.push(f)}else l.push(d)}return l}}function Mo(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=jo.linear;else{var c,d,f;if(C(s))c=u.parse("transition-timing-function",s).value;else c=s;C(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=jo[d].apply(null,f)):a.easingImpl=jo[d]}var h,p=a.easingImpl;if(h=0===a.duration?1:(n-l)/a.duration,a.applying&&(h=a.progress),h<0?h=0:h>1&&(h=1),null==a.delay){var v=a.startPosition,m=a.position;if(m&&i&&!e.locked()){var g={};Ro(v.x,m.x)&&(g.x=Ao(v.x,m.x,h,p)),Ro(v.y,m.y)&&(g.y=Ao(v.y,m.y,h,p)),e.position(g)}var y=a.startPan,b=a.pan,x=o.pan,w=null!=b&&r;w&&(Ro(y.x,b.x)&&(x.x=Ao(y.x,b.x,h,p)),Ro(y.y,b.y)&&(x.y=Ao(y.y,b.y,h,p)),e.emit("pan"));var _=a.startZoom,E=a.zoom,k=null!=E&&r;k&&(Ro(_,E)&&(o.zoom=pt(o.minZoom,Ao(_,E,h,p),o.maxZoom)),e.emit("zoom")),(w||k)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var S=0;S<N.length;S++){var P=N[S],T=P.name,j=P,D=a.startStyle[T],O=Ao(D,j,h,p,u.properties[D.name]);u.overrideBypass(e,T,O)}e.emit("style")}}return a.progress=h,h}function Ro(e,t){return null!=e&&null!=t&&(!(!O(e)||!O(t))||!(!e||!t))}function Io(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Lo(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||Io(0,d,e),Mo(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 Bo={animate:lr.animate(),animation:lr.animation(),animated:lr.animated(),clearQueue:lr.clearQueue(),delay:lr.delay(),delayAnimation:lr.delayAnimation(),stop:lr.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){Lo(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&ae((function(n){Lo(n,e),t()}))}()}}},Fo={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&&R(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}},zo=function(e){return C(e)?new Hr(e):e},Vo={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Vi(Fo,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,zo(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,zo(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,zo(t),n),this},once:function(e,t,n){return this.emitter().one(e,zo(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}};lr.eventAliasesOn(Vo);var Go={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)}};Go.jpeg=Go.jpg;var Uo={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=C(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var o=new r(Q({},e,{cy:t,eles:i}));return o}Se("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Se("A `name` must be specified to make a layout");else Se("Layout options must be specified to make a layout")}};Uo.createLayout=Uo.makeLayout=Uo.layout;var Wo={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)}}))}},qo=Ae({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Ho={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&&Ce("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=qo(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else Se("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)}};Ho.invalidateDimensions=Ho.resize;var Yo={collection:function(e,t){return C(e)?this.$(e):M(e)?e.collection():j(e)?(t||(t={}),new ko(this,e,t.unique,t.removed)):new ko(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}};Yo.elements=Yo.filter=Yo.$;var Xo={},$o="t";Xo.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},Xo.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]===$o,d=t[l]===$o,f=c!==d,h=u.mappedProperties.length>0;if(f||d&&h){var p=void 0;f&&h||f?p=u.properties:h&&(p=u.mappedProperties);for(var v=0;v<p.length;v++){for(var m=p[v],g=m.name,y=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===$o&&(y=null!=x.properties[m.name]))break}s[g]||y||(s[g]=!0,a.push(g))}}}return r[i]=a,a},Xo.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)?$o:"f"}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Xo.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]===$o)for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},Xo.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}},Xo.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]=[le,ue]}for(var d,f=function(e,n){return t.styleKeys[n][0]=de(e,t.styleKeys[n][0])},h=function(e,n){return t.styleKeys[n][1]=fe(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)}},m=0;m<r.length;m++){var g=r[m],y=l[g];if(null!=y){var b=this.properties[g],x=b.type,w=b.groupKey,_=void 0;null!=b.hashOverride?_=b.hashOverride(e,y):null!=y.pfValue&&(_=y.pfValue);var E=null==b.enums?y.value:null,k=null!=_,N=k||null!=E,S=y.units;if(x.number&&N&&!x.multiple)p(-128<(d=k?_:E)&&d<128&&Math.floor(d)!==d?2e9-(1024*d|0):d,w),k||null==S||v(S,w);else v(y.strValue,w)}}for(var P,C,T=[le,ue],j=0;j<i.length;j++){var D=i[j],O=t.styleKeys[D];T[0]=de(O[0],T[0]),T[1]=fe(O[1],T[1])}t.styleKey=(P=T[0],C=T[1],2097152*P+C);var A=t.styleKeys;t.labelDimsKey=he(A.labelDimensions);var M=o(e,["label"],A.labelDimensions);if(t.labelKey=he(M),t.labelStyleKey=he(pe(A.commonLabel,M)),!s){var R=o(e,["source-label"],A.labelDimensions);t.sourceLabelKey=he(R),t.sourceLabelStyleKey=he(pe(A.commonLabel,R));var I=o(e,["target-label"],A.labelDimensions);t.targetLabelKey=he(I),t.targetLabelStyleKey=he(pe(A.commonLabel,I))}if(s){var L=t.styleKeys,B=L.nodeBody,F=L.nodeBorder,z=L.backgroundImage,V=L.compound,G=L.pie,U=[B,F,z,V,G].filter((function(e){return null!=e})).reduce(pe,[le,ue]);t.nodeKey=he(U),t.hasPie=null!=G&&G[0]!==le&&G[1]!==ue}return a!==t.styleKey},Xo.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},Xo.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",h=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=h(u),n=h(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&Ce("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,p(),!0;if(i.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return u?!!u.bypass&&(o[i.name]=u.bypassed,p(),!0):(p(),!0);var v=function(){Ce("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 m,g=i.field.split("."),y=d.data,b=0;b<g.length&&y;b++){y=y[g[b]]}if(null==y)return v(),!1;if(!O(y))return Ce("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((m=0===x?0:(y-i.fieldMin)/x)<0?m=0:m>1&&(m=1),s.color){var w=i.valueMin[0],_=i.valueMax[0],E=i.valueMin[1],k=i.valueMax[1],N=i.valueMin[2],S=i.valueMax[2],P=null==i.valueMin[3]?1:i.valueMin[3],C=null==i.valueMax[3]?1:i.valueMax[3],T=[Math.round(w+(_-w)*m),Math.round(E+(k-E)*m),Math.round(N+(S-N)*m),Math.round(P+(C-P)*m)];n={bypass:i.bypass,name:i.name,value:T,strValue:"rgb("+T[0]+", "+T[1]+", "+T[2]+")"}}else{if(!s.number)return!1;var j=i.valueMin+(i.valueMax-i.valueMin)*m;n=this.parse(i.name,j,i.bypass,f)}if(!n)return v(),!1;n.mapping=i,i=n;break;case a.data:for(var D=i.field.split("."),A=d.data,M=0;M<D.length&&A;M++){A=A[D[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 R=i.value,I=null!=i.fnValue?i.fnValue:R(e);if(i.prevFnValue=I,null==I)return Ce("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 Ce("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=Te(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,p(),!0},Xo.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={}}},Xo.update=function(){this._private.cy.mutableElements().updateStyle()},Xo.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 h=f.prev,p=null!=f.next?f.next:d,v=!1,m=void 0,g=1e-6;h&&(O(h.pfValue)&&O(p.pfValue)?(v=p.pfValue-h.pfValue,m=h.pfValue+g*v):O(h.value)&&O(p.value)?(v=p.value-h.value,m=h.value+g*v):j(h.value)&&j(p.value)&&(v=h.value[0]!==p.value[0]||h.value[1]!==p.value[1]||h.value[2]!==p.value[2],m=h.strValue),v&&(s[c]=p.strValue,this.applyBypass(e,c,m),l=!0))}}if(!l)return;r.transitioning=!0,new nr((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)},Xo.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Xo.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)}))},Xo.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||("curve-style"!==t||"bezier"!==n&&"bezier"!==r)&&("display"!==t||"none"!==n&&"none"!==r)||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Xo.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ko={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(C(t)){var l=this.parse(t,n,!0);l&&i.push(l)}else{if(!D(t))return!1;var u=t;r=n;for(var c=Object.keys(u),d=0;d<c.length;d++){var f=c[d],h=u[f];if(void 0===h&&(h=u[U(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,m=0;m<e.length;m++){for(var g=e[m],y={},b=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var _=g.pstyle(w.name);b=y[w.name]={prev:_}}v=this.applyParsedProperty(g,Te(w))||v,r&&(b.next=g.pstyle(w.name))}v&&this.updateStyleHints(g),r&&this.updateTransitions(g,y,true)}return v},overrideBypass:function(e,t,n){t=G(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(w&&t&&w.getComputedStyle)return w.getComputedStyle(t).getPropertyValue(e)}},Qo={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[U(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&&O(a)){var u=e.cy().zoom(),c=function(e){return e*u},d=function(e,t){return c(e)+t},f=j(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 C(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=D(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[G(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]=de(a,u[0]),u[1]=fe(a,u[1]);else for(o=i.strValue,l=0;l<o.length;l++)a=o.charCodeAt(l),u[0]=de(a,u[0]),u[1]=fe(a,u[1]);return u}};Qo.getPropertiesHash=Qo.getNonDefaultPropertiesHash;var Jo={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}},ea={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){Ce("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 Hr(u).invalid){Ce("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 h=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!h){Ce("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()):(Ce("Skipping property: Invalid property definition in: "+r),s());else Ce("Skipping property: Invalid property name in: "+r),s()}if(d){a();break}i.selector(u);for(var m=0;m<f.length;m++){var g=f[m];i.css(g.name,g.val)}a()}return i},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},ta={};!function(){var e=H,t=X,n=K,r=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},i=function(r){var i=e+"|\\w+|"+t+"|"+n+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+r+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+i+")\\s*\\,\\s*("+i+")\\)$"},o=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];ta.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:r("data")},layoutData:{mapping:!0,regex:r("layoutData")},scratch:{mapping:!0,regex:r("scratch")},mapData:{mapping:!0,regex:i("mapData")},mapLayoutData:{mapping:!0,regex:i("mapLayoutData")},mapScratch:{mapping:!0,regex:i("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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 C(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 a={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=F(e),r=F(t);return n&&!r||!n&&r}},s=ta.types,l=[{name:"label",type:s.text,triggersBounds:a.any,triggersZOrder:a.emptyNonEmpty},{name:"text-rotation",type:s.textRotation,triggersBounds:a.any},{name:"text-margin-x",type:s.bidirectionalSize,triggersBounds:a.any},{name:"text-margin-y",type:s.bidirectionalSize,triggersBounds:a.any}],u=[{name:"source-label",type:s.text,triggersBounds:a.any},{name:"source-text-rotation",type:s.textRotation,triggersBounds:a.any},{name:"source-text-margin-x",type:s.bidirectionalSize,triggersBounds:a.any},{name:"source-text-margin-y",type:s.bidirectionalSize,triggersBounds:a.any},{name:"source-text-offset",type:s.size,triggersBounds:a.any}],c=[{name:"target-label",type:s.text,triggersBounds:a.any},{name:"target-text-rotation",type:s.textRotation,triggersBounds:a.any},{name:"target-text-margin-x",type:s.bidirectionalSize,triggersBounds:a.any},{name:"target-text-margin-y",type:s.bidirectionalSize,triggersBounds:a.any},{name:"target-text-offset",type:s.size,triggersBounds:a.any}],d=[{name:"font-family",type:s.fontFamily,triggersBounds:a.any},{name:"font-style",type:s.fontStyle,triggersBounds:a.any},{name:"font-weight",type:s.fontWeight,triggersBounds:a.any},{name:"font-size",type:s.size,triggersBounds:a.any},{name:"text-transform",type:s.textTransform,triggersBounds:a.any},{name:"text-wrap",type:s.textWrap,triggersBounds:a.any},{name:"text-overflow-wrap",type:s.textOverflowWrap,triggersBounds:a.any},{name:"text-max-width",type:s.size,triggersBounds:a.any},{name:"text-outline-width",type:s.size,triggersBounds:a.any},{name:"line-height",type:s.positiveNumber,triggersBounds:a.any}],f=[{name:"text-valign",type:s.valign,triggersBounds:a.any},{name:"text-halign",type:s.halign,triggersBounds:a.any},{name:"color",type:s.color},{name:"text-outline-color",type:s.color},{name:"text-outline-opacity",type:s.zeroOneNumber},{name:"text-background-color",type:s.color},{name:"text-background-opacity",type:s.zeroOneNumber},{name:"text-background-padding",type:s.size,triggersBounds:a.any},{name:"text-border-opacity",type:s.zeroOneNumber},{name:"text-border-color",type:s.color},{name:"text-border-width",type:s.size,triggersBounds:a.any},{name:"text-border-style",type:s.borderStyle,triggersBounds:a.any},{name:"text-background-shape",type:s.textBackgroundShape,triggersBounds:a.any},{name:"text-justification",type:s.justification}],h=[{name:"events",type:s.bool},{name:"text-events",type:s.bool}],p=[{name:"display",type:s.display,triggersZOrder:a.any,triggersBounds:a.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:s.visibility,triggersZOrder:a.any},{name:"opacity",type:s.zeroOneNumber,triggersZOrder:a.zeroNonZero},{name:"text-opacity",type:s.zeroOneNumber},{name:"min-zoomed-font-size",type:s.size},{name:"z-compound-depth",type:s.zCompoundDepth,triggersZOrder:a.any},{name:"z-index-compare",type:s.zIndexCompare,triggersZOrder:a.any},{name:"z-index",type:s.nonNegativeInt,triggersZOrder:a.any}],v=[{name:"overlay-padding",type:s.size,triggersBounds:a.any},{name:"overlay-color",type:s.color},{name:"overlay-opacity",type:s.zeroOneNumber,triggersBounds:a.zeroNonZero},{name:"overlay-shape",type:s.overlayShape,triggersBounds:a.any}],m=[{name:"underlay-padding",type:s.size,triggersBounds:a.any},{name:"underlay-color",type:s.color},{name:"underlay-opacity",type:s.zeroOneNumber,triggersBounds:a.zeroNonZero},{name:"underlay-shape",type:s.overlayShape,triggersBounds:a.any}],g=[{name:"transition-property",type:s.propList},{name:"transition-duration",type:s.time},{name:"transition-delay",type:s.time},{name:"transition-timing-function",type:s.easing}],y=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},b=[{name:"height",type:s.nodeSize,triggersBounds:a.any,hashOverride:y},{name:"width",type:s.nodeSize,triggersBounds:a.any,hashOverride:y},{name:"shape",type:s.nodeShape,triggersBounds:a.any},{name:"shape-polygon-points",type:s.polygonPointList,triggersBounds:a.any},{name:"background-color",type:s.color},{name:"background-fill",type:s.fill},{name:"background-opacity",type:s.zeroOneNumber},{name:"background-blacken",type:s.nOneOneNumber},{name:"background-gradient-stop-colors",type:s.colors},{name:"background-gradient-stop-positions",type:s.percentages},{name:"background-gradient-direction",type:s.gradientDirection},{name:"padding",type:s.sizeMaybePercent,triggersBounds:a.any},{name:"padding-relative-to",type:s.paddingRelativeTo,triggersBounds:a.any},{name:"bounds-expansion",type:s.boundsExpansion,triggersBounds:a.any}],x=[{name:"border-color",type:s.color},{name:"border-opacity",type:s.zeroOneNumber},{name:"border-width",type:s.size,triggersBounds:a.any},{name:"border-style",type:s.borderStyle}],w=[{name:"background-image",type:s.urls},{name:"background-image-crossorigin",type:s.bgCrossOrigin},{name:"background-image-opacity",type:s.zeroOneNumbers},{name:"background-image-containment",type:s.bgContainment},{name:"background-image-smoothing",type:s.bools},{name:"background-position-x",type:s.bgPos},{name:"background-position-y",type:s.bgPos},{name:"background-width-relative-to",type:s.bgRelativeTo},{name:"background-height-relative-to",type:s.bgRelativeTo},{name:"background-repeat",type:s.bgRepeat},{name:"background-fit",type:s.bgFit},{name:"background-clip",type:s.bgClip},{name:"background-width",type:s.bgWH},{name:"background-height",type:s.bgWH},{name:"background-offset-x",type:s.bgPos},{name:"background-offset-y",type:s.bgPos}],_=[{name:"position",type:s.position,triggersBounds:a.any},{name:"compound-sizing-wrt-labels",type:s.compoundIncludeLabels,triggersBounds:a.any},{name:"min-width",type:s.size,triggersBounds:a.any},{name:"min-width-bias-left",type:s.sizeMaybePercent,triggersBounds:a.any},{name:"min-width-bias-right",type:s.sizeMaybePercent,triggersBounds:a.any},{name:"min-height",type:s.size,triggersBounds:a.any},{name:"min-height-bias-top",type:s.sizeMaybePercent,triggersBounds:a.any},{name:"min-height-bias-bottom",type:s.sizeMaybePercent,triggersBounds:a.any}],E=[{name:"line-style",type:s.lineStyle},{name:"line-color",type:s.color},{name:"line-fill",type:s.fill},{name:"line-cap",type:s.lineCap},{name:"line-opacity",type:s.zeroOneNumber},{name:"line-dash-pattern",type:s.numbers},{name:"line-dash-offset",type:s.number},{name:"line-gradient-stop-colors",type:s.colors},{name:"line-gradient-stop-positions",type:s.percentages},{name:"curve-style",type:s.curveStyle,triggersBounds:a.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:s.zeroOneNumber,triggersBounds:a.any},{name:"source-endpoint",type:s.edgeEndpoint,triggersBounds:a.any},{name:"target-endpoint",type:s.edgeEndpoint,triggersBounds:a.any},{name:"control-point-step-size",type:s.size,triggersBounds:a.any},{name:"control-point-distances",type:s.bidirectionalSizes,triggersBounds:a.any},{name:"control-point-weights",type:s.numbers,triggersBounds:a.any},{name:"segment-distances",type:s.bidirectionalSizes,triggersBounds:a.any},{name:"segment-weights",type:s.numbers,triggersBounds:a.any},{name:"taxi-turn",type:s.bidirectionalSizeMaybePercent,triggersBounds:a.any},{name:"taxi-turn-min-distance",type:s.size,triggersBounds:a.any},{name:"taxi-direction",type:s.axisDirection,triggersBounds:a.any},{name:"edge-distances",type:s.edgeDistances,triggersBounds:a.any},{name:"arrow-scale",type:s.positiveNumber,triggersBounds:a.any},{name:"loop-direction",type:s.angle,triggersBounds:a.any},{name:"loop-sweep",type:s.angle,triggersBounds:a.any},{name:"source-distance-from-node",type:s.size,triggersBounds:a.any},{name:"target-distance-from-node",type:s.size,triggersBounds:a.any}],k=[{name:"ghost",type:s.bool,triggersBounds:a.any},{name:"ghost-offset-x",type:s.bidirectionalSize,triggersBounds:a.any},{name:"ghost-offset-y",type:s.bidirectionalSize,triggersBounds:a.any},{name:"ghost-opacity",type:s.zeroOneNumber}],N=[{name:"selection-box-color",type:s.color},{name:"selection-box-opacity",type:s.zeroOneNumber},{name:"selection-box-border-color",type:s.color},{name:"selection-box-border-width",type:s.size},{name:"active-bg-color",type:s.color},{name:"active-bg-opacity",type:s.zeroOneNumber},{name:"active-bg-size",type:s.size},{name:"outside-texture-bg-color",type:s.color},{name:"outside-texture-bg-opacity",type:s.zeroOneNumber}],S=[];ta.pieBackgroundN=16,S.push({name:"pie-size",type:s.sizeMaybePercent});for(var P=1;P<=ta.pieBackgroundN;P++)S.push({name:"pie-"+P+"-background-color",type:s.color}),S.push({name:"pie-"+P+"-background-size",type:s.percent}),S.push({name:"pie-"+P+"-background-opacity",type:s.zeroOneNumber});var T=[],j=ta.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:s.arrowShape,triggersBounds:a.any},{name:"arrow-color",type:s.color},{name:"arrow-fill",type:s.arrowFill}].forEach((function(e){j.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;T.push({name:n,type:r,triggersBounds:i})}))}),{});var D=ta.properties=[].concat(h,g,p,v,m,k,f,d,l,u,c,b,x,w,S,_,E,T,N),O=ta.propertyGroups={behavior:h,transition:g,visibility:p,overlay:v,underlay:m,ghost:k,commonLabel:f,labelDimensions:d,mainLabel:l,sourceLabel:u,targetLabel:c,nodeBody:b,nodeBorder:x,backgroundImage:w,pie:S,compound:_,edgeLine:E,edgeArrow:T,core:N},A=ta.propertyGroupNames={};(ta.propertyGroupKeys=Object.keys(O)).forEach((function(e){A[e]=O[e].map((function(e){return e.name})),O[e].forEach((function(t){return t.groupKey=e}))}));var M=ta.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"}];ta.propertyNames=D.map((function(e){return e.name}));for(var R=0;R<D.length;R++){var I=D[R];D[I.name]=I}for(var L=0;L<M.length;L++){var B=M[L],z=D[B.pointsTo],V={name:B.name,alias:!0,pointsTo:z};D.push(V),D[B.name]=V}}(),ta.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},ta.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=Q({"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<=ta.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 ta.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},ta.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 na={parse:function(e,t,n,r){var i=this;if(T(t))return i.parseImplWarn(e,t,n,r);var o,a=me(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=Te(o))&&(o.value=Te(o.value)),o},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||Ce("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||Ce("The style value of `label` is deprecated for `"+i.name+"`"),i}};na.parseImpl=function(e,t,n,r){var i=this;e=G(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=C(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(T(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 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 Ce("`"+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 m=p.value,g=v.value;if(!(m[0]!==g[0]||m[1]!==g[1]||m[2]!==g[2]||m[3]!==g[3]&&(null!=m[3]&&1!==m[3]||null!=g[3]&&1!==g[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 y;if(y=l?t.split(/\s+/):j(t)?t:[t],d.evenMultiple&&y.length%2!=0)return null;for(var b=[],x=[],w=[],_="",E=!1,k=0;k<y.length;k++){var N=i.parse(e,y[k],n,"multiple");E=E||C(N.value),b.push(N.value),w.push(null!=N.pfValue?N.pfValue:N.value),x.push(N.units),_+=(k>0?" ":"")+N.strValue}return d.validate&&!d.validate(b,x)?null:d.singleEnum&&E?1===b.length&&C(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:_,bypass:n,units:x}}var S,P,D=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 A,M="px";if(d.units&&(A=d.units),d.implicitUnits&&(M=d.implicitUnits),!d.unitless)if(l){var R="px|em"+(d.allowPercent?"|\\%":"");A&&(R=A);var I=t.match("^("+H+")("+R+")?$");I&&(t=I[1],A=I[2]||M)}else A&&!d.implicitUnits||(A=M);if(t=parseFloat(t),isNaN(t)&&void 0===d.enums)return null;if(isNaN(t)&&void 0!==d.enums)return t=a,D();if(d.integer&&(!O(P=t)||Math.floor(P)!==P))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 L={name:e,value:t,strValue:""+t+(A||""),units:A,bypass:n};return d.unitless||"px"!==A&&"em"!==A?L.pfValue=t:L.pfValue="px"!==A&&A?this.getEmSizeInPixels()*t:t,"ms"!==A&&"s"!==A||(L.pfValue="ms"===A?t:1e3*t),"deg"!==A&&"rad"!==A||(L.pfValue="rad"===A?t:(S=t,Math.PI*S/180)),"%"===A&&(L.pfValue=t/100),L}if(d.propList){var B=[],F=""+t;if("none"===F);else{for(var z=F.split(/\s*,\s*|\s+/),V=0;V<z.length;V++){var U=z[V].trim();i.properties[U]?B.push(U):Ce("`"+U+"` is not a valid property name")}if(0===B.length)return null}return{name:e,value:B,strValue:0===B.length?"none":B.join(" "),bypass:n}}if(d.color){var W=J(t);return W?{name:e,value:W,pfValue:W,strValue:"rgb("+W[0]+","+W[1]+","+W[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var q=D();if(q)return q}for(var Y=d.regexes?d.regexes:[d.regex],X=0;X<Y.length;X++){var $=new RegExp(Y[X]).exec(t);if($)return{name:e,value:d.singleRegexMatchValue?$[1]:$,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?D():null};var ra=function e(t){if(!(this instanceof e))return new e(t);L(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Se("A style must have a core reference")},ia=ra.prototype;ia.instanceString=function(){return"style"},ia.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},ia.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ia.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},ia.selector=function(e){var t="core"===e?null:new Hr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},ia.css=function(){var e=arguments;if(1===e.length)for(var t=e[0],n=0;n<this.properties.length;n++){var r=this.properties[n],i=t[r.name];void 0===i&&(i=t[U(r.name)]),void 0!==i&&this.cssRule(r.name,i)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},ia.style=ia.css,ia.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},ia.append=function(e){return B(e)?e.appendToStyle(this):j(e)?this.appendFromJson(e):C(e)&&this.appendFromString(e),this},ra.fromJson=function(e,t){var n=new ra(e);return n.fromJson(t),n},ra.fromString=function(e,t){return new ra(e).fromString(t)},[Xo,Ko,Zo,Qo,Jo,ea,ta,na].forEach((function(e){Q(ia,e)})),ra.types=ia.types,ra.properties=ia.properties,ra.propertyGroups=ia.propertyGroups,ra.propertyGroupNames=ia.propertyGroupNames,ra.propertyGroupKeys=ia.propertyGroupKeys;var oa={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return B(e)?t.style=e.generateStyle(this):j(e)?t.style=ra.fromJson(this,e):C(e)?t.style=ra.fromString(this,e):t.style=ra(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},aa={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(C(o[0]))return a[e=o[0]];if(D(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,O(r)&&(a.x=r),O(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[1],"x"!==(e=o[0])&&"y"!==e||!O(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:D(e)&&(o=(i=s[0]).x,a=i.y,O(o)&&(l.x+=o),O(a)&&(l.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!O(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(O(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(C(e)){var i=e;e=this.$(i)}else if(D(r=e)&&O(r.x1)&&O(r.x2)&&O(r.y1)&&O(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 M(e)||(e=this.mutableElements());if(!M(e)||!e.empty()){n=n||e.boundingBox();var a,s=this.width(),l=this.height();if(t=O(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 O(e)&&O(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):O(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:O(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),O(e)?n=e:D(e)&&(n=e.level,null!=e.position?t=rt(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||!O(n)||n===o||null!=t&&(!O(t.x)||!O(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(O(e.zoom)||(n=!1),D(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;O(l.x)&&(t.pan.x=l.x,a=!1),O(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(C(e)){var n=e;e=this.mutableElements().filter(n)}else M(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=w.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}};aa.centre=aa.center,aa.autolockNodes=aa.autolock,aa.autoungrabifyNodes=aa.autoungrabify;var sa={data:lr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:lr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:lr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:lr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sa.attr=sa.data,sa.removeAttr=sa.removeData;var la=function(e){var t=this,n=(e=Q({},e)).container;n&&!A(n)&&A(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!==w&&void 0!==n&&!e.headless,a=e;a.layout=Q({name:o?"grid":"null"},a.layout),a.renderer=Q({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 ko(this),listeners:[],aniEles:new ko(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:O(a.zoom)?a.zoom:1,pan:{x:D(a.pan)&&O(a.pan.x)?a.pan.x:0,y:D(a.pan)&&O(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=Q({},a,a.renderer);t.initRenderer(u);!function(e,t){if(e.some(z))return nr.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&&(D(e)||j(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=Q({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,T(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)}))},ua=la.prototype;Q(ua,{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!A(e)&&A(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Q({},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 Te(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(D(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 Ce("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(j(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];j(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 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=Te(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=Te(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=Te(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),ua.$id=ua.getElementById,[So,Bo,Vo,Go,Uo,Wo,Ho,Yo,oa,aa,sa].forEach((function(e){Q(ua,e)}));var ca={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,depthSort: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}},da=function(e){return e.scratch("breadthfirst")},fa=function(e,t){return e.scratch("breadthfirst",t)};function ha(e){this.options=Q({},ca,e)}ha.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=vt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(M(n.roots))e=n.roots;else if(j(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(C(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)},m=0;m<p.length;m++)v(m)}var g=[],y={},b=function(e,t){null==g[t]&&(g[t]=[]);var n=g[t].length;g[t].push(e),fa(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();b(o,i),y[a]=!0}});for(var x=[],w=0;w<o.length;w++){var _=o[w];y[_.id()]||x.push(_)}var E=function(e){for(var t=g[e],n=0;n<t.length;n++){var r=t[n];null!=r?fa(r,{depth:e,index:n}):(t.splice(n,1),n--)}},k=function(){for(var e=0;e<g.length;e++)E(e)},N=function(e,t){for(var n=da(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=da(l);o=Math.max(o,u.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=da(e),r=n.depth,i=n.index;g[r][i]=null,b(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&l){var S=[],P={},T=function(e){return S.push(e)};for(o.forEach((function(e){return S.push(e)}));S.length>0;){var D=S.shift(),O=N(D,P);if(O)D.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(T);else if(null===O){Ce("Detected double maximal shift for node `"+D.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}k();var A=0;if(n.avoidOverlap)for(var R=0;R<o.length;R++){var I=o[R].layoutDimensions(n),L=I.w,B=I.h;A=Math.max(A,L,B)}var F={},z=function(e){if(F[e.id()])return F[e.id()];for(var t=da(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=da(s);if(null!=l){var u=l.index,c=l.depth;if(null!=u&&null!=c){var d=g[c].length;c<t&&(r+=u/d,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),F[e.id()]=r,r},V=function(e,t){var n=z(e)-z(t);return 0===n?Z(e.id(),t.id()):n};void 0!==n.depthSort&&(V=n.depthSort);for(var G=0;G<g.length;G++)g[G].sort(V),E(G);for(var U=[],W=0;W<x.length;W++)U.push(x[W]);g.unshift(U),k();for(var q=0,H=0;H<g.length;H++)q=Math.max(g[H].length,q);var Y=u.x1+u.w/2,X=u.x1+u.h/2,$=g.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=da(e),r=t.depth,i=t.index,o=g[r].length,a=Math.max(u.w/((n.grid?$:o)+1),A),s=Math.max(u.h/(g.length+1),A),l=Math.min(u.w/2/g.length,u.h/2/g.length);if(l=Math.max(l,A),n.circle){var c=l*r+l-(g.length>0&&g[0].length<=3?l/2:0),d=2*Math.PI/g[r].length*i;return 0===r&&1===g[0].length&&(c=1),{x:Y+c*Math.cos(d),y:X+c*Math.sin(d)}}return{x:Y+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var pa={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 va(e){this.options=Q({},pa,e)}va.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=vt(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 h=o[f].layoutDimensions(t),p=h.w,v=h.h;d=Math.max(d,p,v)}if(a=O(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 m=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(m*m+g*g));a=Math.max(y,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 ma,ga={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 ya(e){this.options=Q({},ga,e)}ya.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=vt(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,h=o[d];f=t.concentric(h),u.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)}u.sort((function(e,t){return t.value-e.value}));for(var m=t.levelWidth(o),g=[[]],y=g[0],b=0;b<u.length;b++){var x=u[b];if(y.length>0)Math.abs(y[0].value-x.value)>=m&&(y=[],g.push(y));y.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var _=g.length>0&&g[0].length>1,E=(Math.min(a.w,a.h)/2-w)/(g.length+_?1:0);w=Math.min(w,E)}for(var k=0,N=0;N<g.length;N++){var S=g[N],P=void 0===t.sweep?2*Math.PI-2*Math.PI/S.length:t.sweep,C=S.dTheta=P/Math.max(1,S.length-1);if(S.length>1&&t.avoidOverlap){var T=Math.cos(C)-Math.cos(0),j=Math.sin(C)-Math.sin(0),D=Math.sqrt(w*w/(T*T+j*j));k=Math.max(D,k)}S.r=k,k+=w}if(t.equidistant){for(var O=0,A=0,M=0;M<g.length;M++){var R=g[M].r-A;O=Math.max(O,R)}A=0;for(var I=0;I<g.length;I++){var L=g[I];0===I&&(A=L.r),L.r=A,A+=O}}for(var B={},F=0;F<g.length;F++)for(var z=g[F],V=z.dTheta,G=z.r,U=0;U<z.length;U++){var W=z[U],q=t.startAngle+(n?1:-1)*V*U,H={x:s+G*Math.cos(q),y:l+G*Math.sin(q)};B[W.node.id()]=H}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return B[t]})),this};var ba={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 xa(e){this.options=Q({},ba,e),this.options.layout=this}xa.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}),ma=!0===e.debug;var r=wa(t,n,e);ma&&undefined(r),e.randomize&&ka(r);var i=se(),o=function(){Sa(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=Na(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?(se()-i>=e.animationThreshold&&o(),ae(t)):(Fa(r,e),s())}()}else{for(;u;)u=a(l),l++;Fa(r,e),s()}return this},xa.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},xa.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var wa=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:vt(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=(m=i[l]).layoutDimensions(n);(A={}).isLocked=m.locked(),A.id=m.data("id"),A.parentId=m.data("parent"),A.cmptId=s[m.id()],A.children=[],A.positionX=m.position("x"),A.positionY=m.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(m.style("padding")),A.padRight=parseFloat(m.style("padding")),A.padTop=parseFloat(m.style("padding")),A.padBottom=parseFloat(m.style("padding")),A.nodeRepulsion=T(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,o.layoutNodes.push(A),o.idToIndex[A.id]=l}var f=[],h=0,p=-1,v=[];for(l=0;l<o.nodeSize;l++){var m,g=(m=o.layoutNodes[l]).parentId;null!=g?o.layoutNodes[o.idToIndex[g]].children.push(m.id):(f[++p]=m.id,v.push(m.id))}for(o.graphSet.push(v);h<=p;){var y=f[h++],b=o.idToIndex[y],x=o.layoutNodes[b].children;if(x.length>0){o.graphSet.push(x);for(l=0;l<x.length;l++)f[++p]=x[l]}}for(l=0;l<o.graphSet.length;l++){var w=o.graphSet[l];for(c=0;c<w.length;c++){var _=o.idToIndex[w[c]];o.indexToGraph[_]=l}}for(l=0;l<o.edgeSize;l++){var E=r[l],k={};k.id=E.data("id"),k.sourceId=E.data("source"),k.targetId=E.data("target");var N=T(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,S=T(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,P=o.idToIndex[k.sourceId],C=o.idToIndex[k.targetId];if(o.indexToGraph[P]!=o.indexToGraph[C]){for(var j=_a(k.sourceId,k.targetId,o),D=o.graphSet[j],O=0,A=o.layoutNodes[P];-1===D.indexOf(A.id);)A=o.layoutNodes[o.idToIndex[A.parentId]],O++;for(A=o.layoutNodes[C];-1===D.indexOf(A.id);)A=o.layoutNodes[o.idToIndex[A.parentId]],O++;N*=O*n.nestingFactor}k.idealLength=N,k.elasticity=S,o.layoutEdges.push(k)}return o},_a=function(e,t,n){var r=Ea(e,t,0,n);return 2>r.count?0:r.graph},Ea=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}},ka=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)}},Na=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}}},Sa=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=Na(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){Ca(e,t),Aa(e),Ma(e,t),Ra(e),Ia(e)},Ca=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]]];ja(a,l,e,t)}},Ta=function(e){return-e+2*e*Math.random()},ja=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=Ta(1),o=Ta(1));var a=Da(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=Oa(e,i,o),d=Oa(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=(u=(e.nodeRepulsion+t.nodeRepulsion)/p)*f/v,l=u*h/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Da=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},Oa=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},Aa=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=Oa(o,l,u),d=Oa(s,-1*l,-1*u),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 m=v*f/p,g=v*h/p;else m=0,g=0;o.isLocked||(o.offsetX+=m,o.offsetY+=g),s.isLocked||(s.offsetX-=m,s.offsetY-=g)}}},Ma=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,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}}}}},Ra=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}}},Ia=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=La(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,Ba(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)}},La=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},Ba=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}},Fa=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,h=0,p=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,h=Math.max(h,v.h),f>p&&(d+=h+t.componentSpacing,c=0,f=0,h=0)}}},za={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 Va(e){this.options=Q({},za,e)}Va.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=vt(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,h=null!=t.cols?t.cols:t.columns;if(null!=f&&null!=h)l=f,u=h;else if(null!=f&&null==h)l=f,u=Math.ceil(a/l);else if(null==f&&null!=h)u=h,l=Math.ceil(a/u);else if(u*l>a){var p=c(),v=d();(p-1)*v>=a?c(p-1):(v-1)*p>=a&&d(v-1)}else for(;u*l<a;){var m=c(),g=d();(g+1)*m>=a?d(g+1):c(m+1)}var y=o.w/u,b=o.h/l;if(t.condense&&(y=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,N=E.w+k,S=E.h+k;y=Math.max(y,N),b=Math.max(b,S)}for(var P={},C=function(e,t){return!!P["c-"+e+"-"+t]},T=function(e,t){P["c-"+e+"-"+t]=!0},j=0,D=0,O=function(){++D>=u&&(D=0,j++)},A={},M=0;M<i.length;M++){var R=i[M],I=t.position(R);if(I&&(void 0!==I.row||void 0!==I.col)){var L={row:I.row,col:I.col};if(void 0===L.col)for(L.col=0;C(L.row,L.col);)L.col++;else if(void 0===L.row)for(L.row=0;C(L.row,L.col);)L.row++;A[R.id()]=L,T(L.row,L.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*y+y/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;C(j,D);)O();n=D*y+y/2+o.x1,r=j*b+b/2+o.y1,T(j,D),O()}return{x:n,y:r}}))}return this};var Ga={ready:function(){},stop:function(){}};function Ua(e){this.options=Q({},Ga,e)}Ua.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,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},Ua.prototype.stop=function(){return this};var Wa={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 qa(e){this.options=Q({},Wa,e)}qa.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=T(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 r??null}(t);return!t.locked()&&null!=i&&i})),this};var Ha={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 Ya(e){this.options=Q({},Ha,e)}Ya.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=vt(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 Xa=[{name:"breadthfirst",impl:ha},{name:"circle",impl:va},{name:"concentric",impl:ya},{name:"cose",impl:xa},{name:"grid",impl:Va},{name:"null",impl:Ua},{name:"preset",impl:qa},{name:"random",impl:Ya}];function $a(e){this.options=e,this.notifications=0}var Ka=function(){},Za=function(){throw new Error("A headless instance can not render images")};$a.prototype={recalculateRenderedStyle:Ka,notify:function(){this.notifications++},init:Ka,isHeadless:function(){return!0},png:Za,jpg:Za};var Qa={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){C(s)&&(s=e[s]),e[r]=Q({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 Ct(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:Ee,roughCollide:Ee,draw:Ne,spacing:ke,gap:ke}),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 Ct(e,t,u)||Ct(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 Ct(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 Ct(e,t,u)||Ct(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}})}},Ja={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=w.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),f=e.clientHeight,h=i+o,p=a+s,v=l+u,m=t.width/(d+v),g=d-h,y=f-p,b=t.left+i+l,x=t.top+a+c;return this.containerBB=[b,x,g,y,m]},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,h=(r?8:2)/c,p=(r?8:2)/c,v=1/0;function m(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 g(n){var r=n.outerWidth()+2*h,i=n.outerHeight()+2*h,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 m(n,0),!0}function y(n){var r,i=n._private,o=i.rscratch,l=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,h=l/2+f,p=h*h,v=2*h,y=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(kt(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=Pt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return m(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(Nt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=St(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return m(n,r),!0;y=y||i.source,b=b||i.target;var _=a.getArrowWidth(l,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],N=s.arrowShapes[n.pstyle(k.name+"-arrow-shape").value],S=n.pstyle("width").pfValue;if(N.roughCollide(e,t,_,k.angle,{x:k.x,y:k.y},S,f)&&N.collide(e,t,_,k.angle,{x:k.x,y:k.y},S,f))return m(n),!0}d&&u.length>0&&(g(y),g(b))}function b(e,t,n){return Ie(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"],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,h=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-f,g=s.x2+a-f,y=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-=u)*w-(t-=c)*_+u,y:e*_+t*w+c}},k=E(v,y),N=E(v,x),S=E(g,y),P=E(g,x),C=[k.x+f,k.y+h,S.x+f,S.y+h,P.x+f,P.y+h,N.x+f,N.y+h];if(Ct(e,t,C))return m(n),!0}else if(wt(s,e,t))return m(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var _=l[w];_.isNode()?g(_)||x(_):y(_)||x(_)||x(_,"source")||x(_,"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=vt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),h=0;h<a.length;h++){var p=a[h];if(p.isNode()){var v=p,m=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});xt(f,m)&&!_t(m,f)&&s.push(v)}else{var g=p,y=g._private,b=y.rscratch;if(null!=b.startX&&null!=b.startY&&!wt(f,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!wt(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=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,_=0;_<x.length;_++)if(i=f,o=x[_],!wt(i,o.x,o.y)){w=!1;break}w&&s.push(g)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(g)}}return s}},es={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,h="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,m=s.midY,d)t=r-s.segpts[0],n=i-s.segpts[1];else if(c||f||h||u){var p=s.allpts;t=r-ft(p[0],p[2],p[4],.1),n=i-ft(p[1],p[3],p[5],.1)}else t=r-v,n=i-m;s.srcArrowAngle=at(t,n);var v=s.midX,m=s.midY;if(l&&(v=(r+o)/2,m=(i+a)/2),t=o-r,n=a-i,d)if((p=s.allpts).length/2%2==0){var g=(y=p.length/2)-2;t=p[y]-p[g],n=p[y+1]-p[g+1]}else{g=(y=p.length/2-1)-2;var y,b=y+2;t=p[y]-p[g],n=p[y+1]-p[g+1]}else if(c||f||h){var x,w,_,E,p=s.allpts;if(s.ctrlpts.length/2%2==0){var k=(N=(S=p.length/2-1)+2)+2;x=ft(p[S],p[N],p[k],0),w=ft(p[S+1],p[N+1],p[k+1],0),_=ft(p[S],p[N],p[k],1e-4),E=ft(p[S+1],p[N+1],p[k+1],1e-4)}else{var N,S;k=(N=p.length/2-1)+2;x=ft(p[S=N-2],p[N],p[k],.4999),w=ft(p[S+1],p[N+1],p[k+1],.4999),_=ft(p[S],p[N],p[k],.5),E=ft(p[S+1],p[N+1],p[k+1],.5)}t=_-x,n=E-w}(s.midtgtArrowAngle=at(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d)&&((p=s.allpts).length/2%2==0||(t=-(p[b=(y=p.length/2-1)+2]-p[y]),n=-(p[b+1]-p[y+1])));if(s.midsrcArrowAngle=at(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(c||f||h||u){var P=(p=s.allpts).length;t=o-ft(p[P-6],p[P-4],p[P-2],.9),n=a-ft(p[P-5],p[P-3],p[P-1],.9)}else t=o-v,n=a-m;s.tgtArrowAngle=at(t,n)}};es.getArrowWidth=es.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 ts={};function ns(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}}ts.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(),h=s.height(),p=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*p+l.x,i.source.y*f*p+l.y,i.target.x*d*p+u.x,i.target.y*h*p+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)}},ts.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],h=1-d,p=d,v="node-position"===a?r:i,m={x:v.x1*h+v.x2*p,y:v.y1*h+v.y2*p};n.segpts.push(m.x+o.x*f,m.y+o.y*f)}},ts.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,h=d;r&&(f=0,h=l);var p=u-Math.PI/2,v=p-c/2,m=p+c/2,g=String(u+"_"+c);f=void 0===o[g]?o[g]=0:++o[g],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(m)*h*(f/3+1),a.y+1.4*Math.sin(m)*h*(f/3+1)]},ts.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"),h=f?f.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=h);var m={x:o.x-s/2,y:o.y-l/2},g={x:a.x-u/2,y:a.y-c/2},y={x:Math.min(m.x,g.x),y:Math.min(m.y,g.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*u));i.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*b,y.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*x,y.y]},ts.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},ts.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"),h=d&&f?Math.min(d.value.length,f.value.length):1,p=d?d.pfValue[0]:void 0,v=f.value[0],m=r;o.edgeType=m?"multibezier":"bezier",o.ctrlpts=[];for(var g=0;g<h;g++){var y=(.5-t.eles.length/2+n)*c*(i?-1:1),b=void 0,x=lt(y);m&&(p=d?d.pfValue[g]:c,v=f.value[g]);var w=void 0!==(b=r?p:void 0!==p?x*p:void 0)?b:y,_=1-v,E=v,k="node-position"===u?s:l,N={x:k.x1*_+k.x2*E,y:k.y1*_+k.y2*E};o.ctrlpts.push(N.x+a.x*w,N.y+a.y*w)}},ts.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,h=t.tgtH,p="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,m=v,g=e.pstyle("taxi-turn"),y="%"===g.units,b=g.pfValue,x=b<0,w=e.pstyle("taxi-turn-min-distance").pfValue,_=p?(c+f)/2:0,E=p?(d+h)/2:0,k=u.x2-u.x1,N=u.y2-u.y1,S=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},P=S(k,_),C=S(N,E),T=!1;"auto"===m?v=Math.abs(P)>Math.abs(C)?i:r:m===l||m===s?(v=r,T=!0):m!==o&&m!==a||(v=i,T=!0);var j,D=v===r,O=D?C:P,A=D?N:k,M=lt(A),R=!1;(T&&(y||x)||!(m===s&&A<0||m===l&&A>0||m===o&&A>0||m===a&&A<0)||(O=(M*=-1)*Math.abs(O),R=!0),y)?j=(b<0?1+b:b)*O:j=(b<0?O:0)+b*M;var I=function(e){return Math.abs(e)<w||Math.abs(e)>=Math.abs(O)},L=I(j),B=I(Math.abs(O)-Math.abs(j));if((L||B)&&!R)if(D){var F=Math.abs(A)<=d/2,z=Math.abs(k)<=f/2;if(F){var V=(u.x1+u.x2)/2,G=u.y1,U=u.y2;n.segpts=[V,G,V,U]}else if(z){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(A)<=c/2,X=Math.abs(N)<=h/2;if(Y){var $=(u.y1+u.y2)/2,K=u.x1,Z=u.x2;n.segpts=[K,$,Z,$]}else if(X){var Q=(u.x1+u.x2)/2,J=u.y1,ee=u.y2;n.segpts=[Q,J,Q,ee]}else n.segpts=[u.x2,u.y1]}else if(D){var te=u.y1+j+(p?d/2*M:0),ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else{var ie=u.x1+j+(p?c/2*M:0),oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}},ts.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=!O(n.startX)||!O(n.startY),f=!O(n.arrowStartX)||!O(n.arrowStartY),h=!O(n.endX)||!O(n.endY),p=!O(n.arrowEndX)||!O(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),m=ut({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),g=m<v,y=ut({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=y<v,x=!1;if(d||f||g){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),E={x:w.x/_,y:w.y/_},k=Math.max(o,a),N={x:n.ctrlpts[0]+2*E.x*k,y:n.ctrlpts[1]+2*E.y*k},S=u.intersectLine(r.x,r.y,o,a,N.x,N.y,0);g?(n.ctrlpts[0]=n.ctrlpts[0]+E.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+E.y*(v-m)):(n.ctrlpts[0]=S[0]+E.x*v,n.ctrlpts[1]=S[1]+E.y*v)}if(h||p||b){x=!0;var P={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},C=Math.sqrt(P.x*P.x+P.y*P.y),T={x:P.x/C,y:P.y/C},j=Math.max(o,a),D={x:n.ctrlpts[0]+2*T.x*j,y:n.ctrlpts[1]+2*T.y*j},A=c.intersectLine(i.x,i.y,s,l,D.x,D.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(v-y),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(v-y)):(n.ctrlpts[0]=A[0]+T.x*v,n.ctrlpts[1]=A[1]+T.y*v)}x&&this.findEndpoints(e)}},ts.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=ft(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=ft(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]}},ts.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||O(t.startX)&&O(t.startY)&&O(t.endX)&&O(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Ce("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."))},ts.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Be,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 Be,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,h=u.source,p=u.target,v=[h.poolIndex(),p.poolIndex()].sort(),m=i.get(v);null==m&&(m={eles:[]},i.set(v,m),o.push(v)),m.eles.push(l),d&&(m.hasUnbundled=!0),f&&(m.hasBezier=!0)}else a.push(l)}for(var g=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()}));Re(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 h=d;d=f,f=h}var p=s.srcPos=d.position(),v=s.tgtPos=f.position(),m=s.srcW=d.outerWidth(),g=s.srcH=d.outerHeight(),y=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 E=s.eles[_],k=E[0]._private.rscratch,N=E.pstyle("curve-style").value,S="unbundled-bezier"===N||"segments"===N||"taxi"===N,P=!d.same(E.source());if(!s.calculatedIntersection&&d!==f&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var C=x.intersectLine(p.x,p.y,m,g,v.x,v.y,0),T=s.srcIntn=C,j=w.intersectLine(v.x,v.y,y,b,p.x,p.y,0),D=s.tgtIntn=j,A=s.intersectionPts={x1:C[0],x2:j[0],y1:C[1],y2:j[1]},M=s.posPts={x1:p.x,x2:v.x,y1:p.y,y2:v.y},R=j[1]-C[1],I=j[0]-C[0],L=Math.sqrt(I*I+R*R),B=s.vector={x:I,y:R},F=s.vectorNorm={x:B.x/L,y:B.y/L},z={x:-F.y,y:F.x};s.nodesOverlap=!O(L)||w.checkPoint(C[0],C[1],0,y,b,v.x,v.y)||x.checkPoint(j[0],j[1],0,m,g,p.x,p.y),s.vectorNormInverse=z,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:v,tgtPos:p,srcW:y,srcH:b,tgtW:m,tgtH:g,srcIntn:D,tgtIntn:T,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:-B.x,y:-B.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-z.x,y:-z.y}}}var V=P?l:s;k.nodesOverlap=V.nodesOverlap,k.srcIntn=V.srcIntn,k.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(E,V,_,S):d===f?t.findLoopPoints(E,V,_,S):"segments"===N?t.findSegmentsPoints(E,V):"taxi"===N?t.findTaxiPoints(E,V):"straight"===N||!S&&s.eles.length%2==1&&_===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(E):t.findBezierPoints(E,V,_,S,P),t.findEndpoints(E),t.tryToCorrectInvalidPoints(E,V),t.checkForInvalidEdgeWarning(E),t.storeAllpts(E),t.storeEdgeProjections(E),t.calculateArrowAngles(E),t.recalculateEdgeLabelProjections(E),t.calculateLabelAngles(E)}},y=0;y<o.length;y++)g(y);this.findHaystackPoints(a)}},ts.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),ns(t.segpts)},ts.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),ns(t.ctrlpts)},ts.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var rs={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,h=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,m=e._private.rscratch,g=m.edgeType,y="self"===g||"compound"===g,b="bezier"===g||"multibezier"===g||y,x="bezier"!==g,w="straight"===g||"segments"===g,_="segments"===g,E=b||x||w,k=y||"taxi"===v,N=e.pstyle("source-endpoint"),S=k?"outside-to-node":N.value,P=e.pstyle("target-endpoint"),C=k?"outside-to-node":P.value;if(m.srcManEndpt=N,m.tgtManEndpt=P,b){var T=[m.ctrlpts[0],m.ctrlpts[1]];n=x?[m.ctrlpts[m.ctrlpts.length-2],m.ctrlpts[m.ctrlpts.length-1]]:T,r=T}else if(w){var j=_?m.segpts.slice(0,2):[c.x,c.y];n=_?m.segpts.slice(m.segpts.length-2):[u.x,u.y],r=j}if("inside-to-node"===C)t=[c.x,c.y];else if(P.units)t=this.manualEndptToPx(l,P);else if("outside-to-line"===C)t=m.tgtIntn;else if("outside-to-node"===C||"outside-to-node-or-label"===C?i=n:"outside-to-line"!==C&&"outside-to-line-or-label"!==C||(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"===C||"outside-to-line-or-label"===C){var D=l._private.rscratch,A=D.labelWidth,M=D.labelHeight,R=D.labelX,I=D.labelY,L=A/2,B=M/2,F=l.pstyle("text-valign").value;"top"===F?I-=B:"bottom"===F&&(I+=B);var z=l.pstyle("text-halign").value;"left"===z?R-=L:"right"===z&&(R+=L);var V=It(i[0],i[1],[R-L,I-B,R+L,I-B,R+L,I+B,R-L,I+B],c.x,c.y);if(V.length>0){var G=u,U=ct(G,ot(t)),W=ct(G,ot(V)),q=U;if(W<U&&(t=V,q=W),V.length>2)ct(G,{x:V[2],y:V[3]})<q&&(t=[V[2],V[3]])}}var H=Lt(t,n,a.arrowShapes[d].spacing(e)+h),Y=Lt(t,n,a.arrowShapes[d].gap(e)+h);if(m.endX=Y[0],m.endY=Y[1],m.arrowEndX=H[0],m.arrowEndY=H[1],"inside-to-node"===S)t=[u.x,u.y];else if(N.units)t=this.manualEndptToPx(s,N);else if("outside-to-line"===S)t=m.srcIntn;else if("outside-to-node"===S||"outside-to-node-or-label"===S?o=r:"outside-to-line"!==S&&"outside-to-line-or-label"!==S||(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"===S||"outside-to-line-or-label"===S){var X=s._private.rscratch,$=X.labelWidth,K=X.labelHeight,Z=X.labelX,Q=X.labelY,J=$/2,ee=K/2,te=s.pstyle("text-valign").value;"top"===te?Q-=ee:"bottom"===te&&(Q+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?Z-=J:"right"===ne&&(Z+=J);var re=It(o[0],o[1],[Z-J,Q-ee,Z+J,Q-ee,Z+J,Q+ee,Z-J,Q+ee],u.x,u.y);if(re.length>0){var ie=c,oe=ct(ie,ot(t)),ae=ct(ie,ot(re)),se=oe;if(ae<oe&&(t=[re[0],re[1]],se=ae),re.length>2)ct(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var le=Lt(t,r,a.arrowShapes[f].spacing(e)+p),ue=Lt(t,r,a.arrowShapes[f].gap(e)+p);m.startX=ue[0],m.startY=ue[1],m.arrowStartX=le[0],m.arrowStartY=le[1],E&&(O(m.startX)&&O(m.startY)&&O(m.endX)&&O(m.endY)?m.badLine=!1:m.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}}},is={};function os(e,t,n){for(var r=function(e,t,n,r){return ft(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)})}}is.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)os(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},is.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var as={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!F(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)}}},ss=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},ls=function(e,t){var n=t.x-e.x,r=t.y-e.y;return ss(n,r)};as.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){Le(n.rscratch,e,t,r),Le(n.rstyle,e,t,r)};a("labelX",null,t.x),a("labelY",null,t.y);var s=ss(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=ut(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,u[f*c],0,i.bezierProjPcts[0]);for(var v=0;v<c-1;v++)d(h,u[f*c+v],u[f*c+v+1],i.bezierProjPcts[v],i.bezierProjPcts[v+1]);d(h,u[f*c+c-1],h.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,h=0,p=0;p<d.length;p++){for(var v=d[s?p:d.length-1-p],m=0;m<v.segments.length;m++){var g=v.segments[s?m:v.segments.length-1-m],y=p===d.length-1&&m===v.segments.length-1;if(f=h,(h+=g.length)>=u||y){c={cp:v,segment:g};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-f)/x.length,_=x.t1-x.t0,E=s?x.t0+_*w:x.t1-_*w;E=pt(0,E,1),t=ht(b.p0,b.p1,b.p2,E),i=function(e,t,n,r){var i=pt(0,r-.001,1),o=pt(0,r+.001,1),a=ht(e,t,n,i),s=ht(e,t,n,o);return ls(a,s)}(b.p0,b.p1,b.p2,E);break;case"straight":case"segments":case"haystack":for(var k,N,S,P,C=0,T=r.allpts.length,j=0;j+3<T&&(s?(S={x:r.allpts[j],y:r.allpts[j+1]},P={x:r.allpts[j+2],y:r.allpts[j+3]}):(S={x:r.allpts[T-2-j],y:r.allpts[T-1-j]},P={x:r.allpts[T-4-j],y:r.allpts[T-3-j]}),N=C,!((C+=k=ut(S,P))>=u));j+=2);var D=(u-N)/k;D=pt(0,D,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=ut(e,t),s=i/a,l=o/a;return n=n??0,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(S,P,D),i=ls(S,P)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},as.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},as.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=Ie(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;Le(n.rstyle,"labelWidth",t,d),Le(n.rscratch,"labelWidth",t,d),Le(n.rstyle,"labelHeight",t,f),Le(n.rscratch,"labelHeight",t,f),Le(n.rscratch,"labelLineHeight",t,c)},as.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?(Le(n.rscratch,e,t,r),r):Ie(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=[],h=/[\s\u200b]+/,p=d?"":" ",v=0;v<u.length;v++){var m=u[v],g=this.calculateLabelDimensions(e,m).width;if(d){var y=m.split("").join("\u200b");m=y}if(g>c){for(var b=m.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(m)}a("labelWrapCachedLines",f),i=a("labelWrapCachedText",f.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var k=e.pstyle("text-max-width").pfValue,N="",S=!1;if(this.calculateLabelDimensions(e,i).width<k)return i;for(var P=0;P<i.length;P++){if(this.calculateLabelDimensions(e,N+i[P]+"\u2026").width>k)break;N+=i[P],P===i.length-1&&(S=!0)}return S||(N+="\u2026"),N}return i},as.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"}},as.calculateLabelDimensions=function(e,t){var n=ve(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,h=0,p=t.split("\n"),v=0;v<p.length;v++){var m=p[v],g=c.measureText(m),y=Math.ceil(g.width),b=a;f=Math.max(y,f),h+=b}return f+=0,h+=0,r[n]={width:f,height:h}},as.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},as.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 us={},cs=!1;us.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return cs||(Ce("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),cs=!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 ds={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]._private.rstyle;i.clean=!1,i.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 h=0;h<r.length;h++){var p=r[h]._private,v=p.rstyle,m=p.rscratch;v.srcX=m.arrowStartX,v.srcY=m.arrowStartY,v.tgtX=m.arrowEndX,v.tgtY=m.arrowEndY,v.midX=m.midX,v.midY=m.midY,v.labelAngle=m.labelAngle,v.sourceLabelAngle=m.sourceLabelAngle,v.targetLabelAngle=m.targetLabelAngle}}}},fs={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}},hs={};[Ja,es,ts,rs,is,as,us,ds,fs].forEach((function(e){Q(hs,e)}));var ps={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,5).toLowerCase()===a||(o.crossOrigin=t),o.src=e,o}},vs={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)}};vs.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}},vs.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},vs.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},vs.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},i=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},o=function(e){e[0]._private.rscratch.inDragLayer=!0},a=function(e){e[0]._private.rscratch.isGrabTarget=!0},s=function(e,t){var n=t.addToList;n.has(e)||!e.grabbable()||e.locked()||(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(o),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(o)),n.addToList&&t.forEach((function(e){s(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(o),n.connectedEdges().forEach(o)),t.addToList&&s(n,t)}}(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(o),r.forEach(o)),t.addToList&&r.forEach((function(e){s(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 m=u.default((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(m),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",m),v&&(e.resizeObserver=new ResizeObserver(m),e.resizeObserver.observe(e.container));var g=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",g),e.registerBinding(t,"animationend",g),e.registerBinding(t,"scroll",g)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var y,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,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]),s=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(a(d),d.selected()){f=e.dragData.possibleDragElements=r.collection();var m=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(m,{addToList:f}),d.emit(v("grabon")),m.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?(s[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(s[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)}s[0]=s[2]=o[0],s[1]=s[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var o=!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 m,g=e.hoverData.last,y=e.hoverData.down,b=[c[0]-p[2],c[1]-p[3]],x=e.dragData.possibleDragElements;if(h){var _=u[0]-h[0],E=_*_,k=u[1]-h[1],N=E+k*k;e.hoverData.isOverThresholdDrag=m=N>=e.desktopTapThreshold2}var S=r(t);m&&(e.hoverData.tapholdCancelled=!0);o=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var P=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(m){var C={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};y?y.emit(C):a.emit(C),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(o=!0,a.panningEnabled()&&a.userPanningEnabled()){var T;if(e.hoverData.justStartedPan){var j=e.hoverData.mdownPos;T={x:(c[0]-j[0])*s,y:(c[1]-j[1])*s},e.hoverData.justStartedPan=!1}else T={x:b[0]*s,y:b[1]*s};a.panBy(T),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=y&&!y.pannable()){if(y&&y.pannable()&&y.active()&&y.unactivate(),y&&y.grabbed()||v==g||(g&&n(g,["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),y)if(m){if(a.boxSelectionEnabled()&&S)y&&y.grabbed()&&(d(x),y.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(y.emit("dragfreeon"),x.emit("dragfree"))),P();else if(y&&y.grabbed()&&e.nodeIsDraggable(y)){var D=!e.dragData.didDrag;D&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||l(x,{inDragLayer:!0});var A={x:0,y:0};if(O(b[0])&&O(b[1])&&(A.x+=b[0],A.y+=b[1],D)){var M=e.hoverData.dragDelta;M&&O(M[0])&&O(M[1])&&(A.x+=M[0],A.y+=M[1])}e.hoverData.draggingEles=!0,x.silentShift(A).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])}();o=!0}else if(m){if(e.hoverData.dragging||!a.boxSelectionEnabled()||!S&&a.panningEnabled()&&a.userPanningEnabled()){if(!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()){i(y,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=ot(f),e.redrawHint("select",!0),e.redraw())}}else P();y&&y.pannable()&&y.active()&&y.unactivate()}return p[2]=c[0],p[3]=c[1],o?(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 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(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()?(y&&clearTimeout(y),b=!0,x=null,n(c,["dblclick","dbltap","vdblclick"],i,{x:a[0],y:a[1]})):(y=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 m=function(e){return e.selectable()&&!e.selected()};"additive"===o.selectionType()||f||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(m).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 g=c&&c.grabbed();d(u),g&&(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,k,N,S,P,C,T,j,D,A,M,R,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 L,B,F,z,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",L=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 s=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=s[0],i[1]=s[1]}if(t.touches[1]){s=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=s[0],i[3]=s[1]}if(t.touches[2]){s=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=s[0],i[5]=s[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();j=u[0],D=u[1],A=u[2],M=u[3],_=t.touches[0].clientX-j,E=t.touches[0].clientY-D,k=t.touches[1].clientX-j,N=t.touches[1].clientY-D,R=0<=_&&_<=A&&0<=k&&k<=A&&0<=E&&E<=M&&0<=N&&N<=M;var f=r.pan(),p=r.zoom();S=W(_,E,k,N),P=q(_,E,k,N),T=[((C=[(_+k)/2,(E+N)/2])[0]-f.x)/p,(C[1]-f.y)/p];if(P<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),m=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):m&&m.isNode()?(m.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=m):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 g=e.findNearestElements(i[0],i[1],!0,!0),y=g[0];if(null!=y&&(y.activate(),e.touchData.start=y,e.touchData.starts=g,e.nodeIsGrabbable(y))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),y.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):c(y,{addToList:b}),a(y);var O=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};y.emit(O("grabon")),x?x.forEach((function(e){e.emit(O("grab"))})):y.emit(O("grab"))}n(y,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==y&&(e.data.bgActivePosistion={x:s[0],y:s[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=[],L=0;L<i.length;L++)I[L]=o[L]=i[L];var B=t.touches[0];e.touchData.startGPosition=[B.clientX,B.clientY]}}},!1),e.registerBinding(window,"touchmove",B=function(t){var r=e.touchData.capture;if(r||w(t)){var o=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=[],m=0;m<s.length;m++)v[m]=s[m]-u[m];var g=t.touches[0].clientX-p[0],y=g*g,b=t.touches[0].clientY-p[1];h=y+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-j,C=t.touches[0].clientY-D,A=t.touches[1].clientX-j,M=t.touches[1].clientY-D,I=q(x,C,A,M);if(I/P>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var L={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(L),e.touchData.start=null):a.emit(L)}}if(r&&e.touchData.cxt){L={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(L):a.emit(L),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var B=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&B===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=B,B&&B.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,o[4]=1,o&&0!==o.length&&void 0!==o[0]?(o[2]=(s[0]+s[2]+s[4])/3,o[3]=(s[1]+s[3]+s[5])/3):(o[0]=(s[0]+s[2]+s[4])/3,o[1]=(s[1]+s[3]+s[5])/3,o[2]=(s[0]+s[2]+s[4])/3+1,o[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 F=0;F<ee.length;F++){var z=ee[F]._private;z.grabbed=!1,z.rscratch.inDragLayer=!1}}var V=e.touchData.start,G=(x=t.touches[0].clientX-j,C=t.touches[0].clientY-D,A=t.touches[1].clientX-j,M=t.touches[1].clientY-D,W(x,C,A,M)),U=G/S;if(R){var H=(x-_+(A-k))/2,Y=(C-E+(M-N))/2,X=a.zoom(),$=X*U,K=a.pan(),Z=T[0]*X+K.x,Q=T[1]*X+K.y,J={x:-$/X*(Z-K.x-H)+Z,y:-$/X*(Q-K.y-Y)+Q};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:$,pan:J,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),S=G,_=x,E=C,k=A,N=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||(B=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(O(v[0])&&O(v[1]))if(ie.x+=v[0],ie.y+=v[1],re)e.redrawHint("eles",!0),(oe=e.touchData.dragDelta)&&O(oe[0])&&O(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||B,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||B==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),B&&B.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=B,r)for(F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&h&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){i(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=ot(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:g*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(m=0;m<s.length;m++)u[m]=s[m];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",F=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",z=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 h={originalEvent:r,type:"cxttap",position:{x:u[0],y:u[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:u[0],y:u[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 m=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),m&&(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 g=e.findNearestElement(u[0],u[1],!0,!0);n(g,["touchend","tapend","vmouseup","tapdragout"],r,{x:u[0],y:u[1]})}var y=e.touchData.startPosition[0]-u[0],b=y*y,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 _=0;_<u.length;_++)c[_]=u[_];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))},$=function(e){for(var t=0;t<H.length;t++){if(H[t].event.pointerId===e.pointerId)return void H.splice(t,1)}},K=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),K(e),L(e))})),e.registerBinding(e.container,"pointerup",(function(e){Z(e)||($(e),K(e),z(e))})),e.registerBinding(e.container,"pointercancel",(function(e){Z(e)||($(e),K(e),F())})),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=Y(e)}(e),K(e),B(e))}))}};var ms={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 It(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return Tt(e,t,this.points,o,a,r,i,[0,-1],n)}}}};ms.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 Ot(e,t,r,i,o,a,n)}}},ms.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,h=Gt(o,a),p=0;p<n.length/4;p++){var v,m=void 0;m=0===p?n.length-2:4*p-2,v=4*p+2;var g=r+d*n[4*p],y=i+f*n[4*p+1],b=-n[m]*n[v]-n[m+1]*n[v+1],x=h/Math.tan(Math.acos(b)/2),w=g-x*n[m],_=y-x*n[m+1],E=g+x*n[v],k=y+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 N=n[m+1],S=-n[m];N*n[v]+S*n[v+1]<0&&(N*=-1,S*=-1),0!==(l=At(e,t,r,i,w+N*h,_+S*h,h)).length&&u.push(l[0],l[1])}for(var P=0;P<c.length/4;P++)0!==(l=Rt(e,t,r,i,c[4*P],c[4*P+1],c[4*P+2],c[4*P+3],!1)).length&&u.push(l[0],l[1]);if(u.length>2){for(var C=[u[0],u[1]],T=Math.pow(C[0]-e,2)+Math.pow(C[1]-t,2),j=1;j<u.length/2;j++){var D=Math.pow(u[2*j]-e,2)+Math.pow(u[2*j+1]-t,2);D<=T&&(C[0]=u[2*j],C[1]=u[2*j+1],T=D)}return C}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=Gt(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+l*n[4*f],m=i+u*n[4*f+1],g=-n[p]*n[h]-n[p+1]*n[h+1],y=c/Math.tan(Math.acos(g)/2),b=v-y*n[p],x=m-y*n[p+1],w=v+y*n[h],_=m+y*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 N=b+E*c,S=x+k*c;if(Math.pow(N-e,2)+Math.pow(S-t,2)<=d)return!0}return Ct(e,t,s)}(e,t,this.points,o,a,r,i)}}},ms.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Bt(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 Et(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Vt(r,i),l=2*s;return!!Tt(e,t,this.points,o,a,r,i-l,[0,-1],n)||(!!Tt(e,t,this.points,o,a,r-l,i,[0,-1],n)||(!!Ot(e,t,l,l,o-r/2+s,a-i/2+s,n)||(!!Ot(e,t,l,l,o+r/2-s,a-i/2+s,n)||(!!Ot(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Ot(e,t,l,l,o-r/2+s,a+i/2-s,n)))))}}},ms.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Bt(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 It(i,o,l,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(Tt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(Tt(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 Ct(e,t,s.topLeft)||Ct(e,t,s.topRight)||Ct(e,t,s.bottomRight)||Ct(e,t,s.bottomLeft)}}},ms.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Bt(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=ht({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=ht({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=ht({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 It(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=Ut(e,t),d=c.heightOffset,f=c.widthOffset,h=c.ctrlPtOffsetPct*e,p={topLeft:[a,l+d,a+h,l,a+f,l],topRight:[s-f,l,s-h,l,s,l+d],bottomRight:[s,u-d,s-h,u,s-f,u],bottomLeft:[a+f,u,a+h,u,a,u-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=Ut(r,i),l=s.heightOffset,u=s.widthOffset;if(Tt(e,t,this.points,o,a,r,i-2*l,[0,-1],n))return!0;if(Tt(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),h=Math.max(l,u);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 m=p[5],g=p[3],y=p[1],b=ft(m,g,y,v);if(p.isTop&&b<=t)return!0;if(p.isBottom&&t<=b)return!0}}return!1}}},ms.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Bt(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=Rt(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return l.length>0?l:Et(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=Vt(r,i),l=2*s;if(Tt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(Tt(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!!Ct(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||(!!Ot(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!Ot(e,t,l,l,o-r/2+s,a+i/2-s,n))}}},ms.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Bt(3,0)),this.generateRoundPolygon("round-triangle",Bt(3,0)),this.generatePolygon("rectangle",Bt(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",Bt(5,0)),this.generateRoundPolygon("round-pentagon",Bt(5,0)),this.generatePolygon("hexagon",Bt(6,0)),this.generateRoundPolygon("round-hexagon",Bt(6,0)),this.generatePolygon("heptagon",Bt(7,0)),this.generateRoundPolygon("round-heptagon",Bt(7,0)),this.generatePolygon("octagon",Bt(8,0)),this.generateRoundPolygon("round-octagon",Bt(8,0));var r=new Array(20),i=zt(5,0),o=zt(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=Ft(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 gs={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||Oe();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&&Se("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}))}}},ys=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};gs.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;ae((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){ys(e,!0,r);var i=se();e.render(e.renderOptions);var o=e.lastDrawTime=se();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 ys(e,!1,r);e.skipFrame=!1,ae(n)}}))}};var bs=function(e){this.init(e)},xs=bs.prototype;xs.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],xs.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(w){var r=w.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"===w.getComputedStyle(n).getPropertyValue("position")&&Ce("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=O(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()},xs.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())},xs.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){}},xs.isHeadless=function(){return!1},[Qa,hs,ps,vs,ms,gs].forEach((function(e){Q(xs,e)}));var ws=1e3/60,_s=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=u.default((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),i=e.priority||Ne;n.beforeRender((function(i,o){var a=se(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],c=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var f=se(),h=f-a,p=f-o;if(l<ws){var v=ws-(i?s:0);if(p>=e.deqFastCost*v)break}else if(i){if(h>=e.deqCost*l||h>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*ws)break;var m=e.deq(t,d,c);if(!(m.length>0))break;for(var g=0;g<m.length;g++)u.push(m[g])}u.length>0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},Es=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ee;v(this,e),this.idsByKey=new Be,this.keyForId=new Be,this.cachesByLvl=new Be,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return g(e,[{key:"getIdsFor",value:function(e){null==e&&Se("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new ze,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 Be,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}(),ks={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ns=Ae({getKey:null,doesEleInvalidateKey:Ee,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:_e,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ss=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Ns(t);Q(n,r),n.lookup=new Es(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Ps=Ss.prototype;Ps.reasons=ks,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 c.default((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(),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(st(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 h,p=l.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),m=v[v.length-2],g=function(){return o.recycleTexture(h,d)||o.addTexture(h,d)};m||(m=v[v.length-1]),m||(m=g()),m.width-m.usedWidth<d&&(m=g());for(var y,b=function(e){return e&&e.scaledLabelShown===f},x=i&&i===ks.dequeue,w=i&&i===ks.highQuality,_=i&&i===ks.downscale,E=r+1;E<=3;E++){var k=l.get(e,E);if(k){y=k;break}}var N=y&&y.level===r+1?y:null,S=function(){m.context.drawImage(N.texture.canvas,N.x,0,N.width,N.height,m.usedWidth,0,d,c)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,d,h),b(N))S();else if(b(y)){if(!w)return o.queueElement(e,y.level-1),y;for(var P=y.level;P>r;P--)N=o.getElement(e,t,n,P,ks.downscale);S()}else{var C;if(!x&&!w&&!_)for(var T=r-1;T>=-4;T--){var j=l.get(e,T);if(j){C=j;break}}if(b(C))return o.queueElement(e,r),C;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,e,t,f,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return p={x:m.usedWidth,texture:m,level:r,scale:u,width:d,height:c,scaledLabelShown:f},m.usedWidth+=Math.ceil(d+8),m.eleCaches.push(p),l.set(e,r,p),o.checkTextureFullness(m),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],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}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?Me(t,e):e.fullnessChecks++},Ps.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Me(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)}Re(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,Re(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Me(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(),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,ks.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=we,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Ps.onDequeue=function(e){this.onDequeues.push(e)},Ps.offDequeue=function(e){Me(this.onDequeues,e)},Ps.setupDequeueing=_s({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(xt(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Cs=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=se()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=u.default((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 c.default((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},Ts=Cs.prototype,js=0,Ds=Math.pow(2,53)-1;Ts.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:js=++js%Ds,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},Ts.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(st(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&&Me(c,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=vt();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,h=e.length/1,p=!o,v=0;v<e.length;v++){var m=e[v],g=m._private.rscratch,y=g.imgLayerCaches=g.imgLayerCaches||{},b=y[n];if(b)f=b;else{if((!f||f.eles.length>=h||!_t(f.bb,m.boundingBox()))&&!(f=d({insert:!0,after:f})))return null;s||p?r.queueLayer(f,m):r.drawEleInLayer(f,m,n,t),f.eles.push(m),y[n]=f}}return s||(p?null:c)},Ts.getEleLevelForLayerLevel=function(e,t){return e},Ts.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))},Ts.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},Ts.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}}}},Ts.updateElementsInLayers=function(e,t){for(var n=R(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))}},Ts.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},Ts.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=se(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Ts.invalidateLayer=function(e){if(this.lastInvalidationTime=se(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Me(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)}}},Ts.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])}))},Ts.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Ts.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))}},Ts.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},Ts.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()}},Ts.requestRedraw=u.default((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),Ts.setupDequeueing=_s({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:Ne,shouldRedraw:_e,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Os,As={};function Ms(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Rs(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 Is(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 Ls(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 Bs(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}As.arrowShapeImpl=function(e){return(Os||(Os={polygon:Ms,"triangle-backcurve":Rs,"triangle-tee":Is,"circle-triangle":Ls,"triangle-cross":Is,circle:Bs}))[e]};var Fs={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,h,p,v,m,g,y=a(l,t),b=u.x1,x=u.y1,w=u.w,_=u.h;if(0!==y){var E=n.getRotationPoint(t);p=E.x,v=E.y,e.translate(p,v),e.rotate(y),(m=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var k=n.getRotationOffset(t);f=k.x,h=k.y}else f=b,h=x;1!==d&&(g=e.globalAlpha,e.globalAlpha=g*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,f,h,w,_),1!==d&&(e.globalAlpha=g),0!==y&&(e.rotate(-y),e.translate(-p,-v),m||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},zs=function(){return 0},Vs=function(e,t){return e.getTextAngle(t,null)},Gs=function(e,t){return e.getTextAngle(t,"source")},Us=function(e,t){return e.getTextAngle(t,"target")},Ws=function(e,t){return t.effectiveOpacity()},qs=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Fs.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(),h=!0===o?l.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&t.visible()&&(!r||xt(f,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,l,n,i,h,zs,Ws),p&&v||a.drawCachedElementPortion(e,t,u,n,i,h,Vs,qs),p&&!v&&(a.drawCachedElementPortion(e,t,c,n,i,h,Gs,qs),a.drawCachedElementPortion(e,t,d,n,i,h,Us,qs)),a.drawElementOverlay(e,t)}},Fs.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Fs.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];this.drawCachedElement(e,o,n,r)}},Fs.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)}},Fs.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 Hs={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,h=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=u*c,m=u*c,g=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")},y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var b=t.pstyle("ghost-offset-x").pfValue,x=t.pstyle("ghost-offset-y").pfValue,w=t.pstyle("ghost-opacity").value,_=v*w;e.translate(b,x),g(_),y(_),e.translate(-b,-x)}i&&a.drawEdgeUnderlay(e,t),g(),y(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},Ys=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")}}}};Hs.drawEdgeOverlay=Ys("overlay"),Hs.drawEdgeUnderlay=Ys("underlay"),Hs.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 h=2;h+1<n.length;h+=2)t.lineTo(n[h],n[h+1])}t=a,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},Hs.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()}},Hs.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)},Hs.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 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,u,d,l,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,l,r,i,o)}}},Hs.drawArrowShape=function(e,t,n,r,i,o,a,s){var l,u=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),m=u.arrowShapes[i];if(c){var g=u.arrowPathCache=u.arrowPathCache||[],y=ve(i),b=g[y];null!=b?(l=t=b,d=!0):(l=t=new Path2D,g[y]=l)}d||(t.beginPath&&t.beginPath(),c?m.draw(t,1,0,{x:0,y:0},1):m.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(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(m.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 Xs={safeDrawImage:function(e,t,n,r,i,o,a,s,l,u){if(!(i<=0||o<=0||l<=0||u<=0))try{e.drawImage(t,n,r,i,o,a,s,l,u)}catch(c){Ce(c)}},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),h=n.width(),p=n.height(),v=2*n.padding(),m=h+("inner"===c(n,"background-width-relative-to","value",r)?0:v),g=p+("inner"===c(n,"background-height-relative-to","value",r)?0:v),y=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=_,N=E;if("auto"!==c(n,"background-width","value",r)&&(k="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*m:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(N="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*g:c(n,"background-height","pfValue",r)),0!==k&&0!==N){if("contain"===d)k*=S=Math.min(m/k,g/N),N*=S;else if("cover"===d){var S;k*=S=Math.max(m/k,g/N),N*=S}var P=s-m/2,C=c(n,"background-position-x","units",r),T=c(n,"background-position-x","pfValue",r);P+="%"===C?(m-k)*T:T;var j=c(n,"background-offset-x","units",r),D=c(n,"background-offset-x","pfValue",r);P+="%"===j?(m-k)*D:D;var O=l-g/2,A=c(n,"background-position-y","units",r),M=c(n,"background-position-y","pfValue",r);O+="%"===A?(g-N)*M:M;var R=c(n,"background-offset-y","units",r),I=c(n,"background-offset-y","pfValue",r);O+="%"===R?(g-N)*I:I,y.pathCache&&(P-=s,O-=l,s=0,l=0);var L=e.globalAlpha;e.globalAlpha=x;var B=o.getImgSmoothing(e),F=!1;if("no"===w&&B?(o.setImgSmoothing(e,!1),F=!0):"yes"!==w||B||(o.setImgSmoothing(e,!0),F=!0),"no-repeat"===f)b&&(e.save(),y.pathCache?e.clip(y.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,m,g),e.clip())),o.safeDrawImage(e,t,0,0,_,E,P,O,k,N),b&&e.restore();else{var z=e.createPattern(t,f);e.fillStyle=z,o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,m,g),e.translate(P,O),e.fill(),e.translate(-P,-O)}e.globalAlpha=L,F&&o.setImgSmoothing(e,B)}}},$s={};$s.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(st(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},$s.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 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)},$s.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},$s.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)},$s.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Ie(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},$s.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.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Ie(o,"labelX",n),c=Ie(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var f,h=n?n+"-":"",p=Ie(o,"labelWidth",n),v=Ie(o,"labelHeight",n),m=t.pstyle(h+"text-margin-x").pfValue,g=t.pstyle(h+"text-margin-y").pfValue,y=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(y&&(b="center",x="center"),u+=m,c+=g,0!==(f=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(f),u=0,c=0),x){case"top":break;case"center":c+=v/2;break;case"bottom":c+=v}var w=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,E=t.pstyle("text-border-width").pfValue,k=t.pstyle("text-background-padding").pfValue;if(w>0||E>0&&_>0){var N=u-k;switch(b){case"left":N-=p;break;case"center":N-=p/2}var S=c-v-k,P=p+2*k,C=v+2*k;if(w>0){var T=e.fillStyle,j=t.pstyle("text-background-color").value;e.fillStyle="rgba("+j[0]+","+j[1]+","+j[2]+","+w*a+")",0===t.pstyle("text-background-shape").strValue.indexOf("round")?function(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()}(e,N,S,P,C,2):e.fillRect(N,S,P,C),e.fillStyle=T}if(E>0&&_>0){var D=e.strokeStyle,O=e.lineWidth,A=t.pstyle("text-border-color").value,M=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+_*a+")",e.lineWidth=E,e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=E/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(N,S,P,C),"double"===M){var R=E/2;e.strokeRect(N+R,S+R,P-2*R,C-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=O,e.strokeStyle=D}}var I=2*t.pstyle("text-outline-width").pfValue;if(I>0&&(e.lineWidth=I),"wrap"===t.pstyle("text-wrap").value){var L=Ie(o,"labelWrapCachedLines",n),B=Ie(o,"labelLineHeight",n),F=p/2,z=this.getLabelJustification(t);switch("auto"===z||("left"===b?"left"===z?u+=-p:"center"===z&&(u+=-F):"center"===b?"left"===z?u+=-F:"right"===z&&(u+=F):"right"===b&&("center"===z?u+=F:"right"===z&&(u+=p))),x){case"top":case"center":case"bottom":c-=(L.length-1)*B}for(var V=0;V<L.length;V++)I>0&&e.strokeText(L[V],u,c),e.fillText(L[V],u,c),c+=B}else I>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==f&&(e.rotate(-f),e.translate(-s,-l))}}};var Ks={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(O(d.x)&&O(d.y)&&(!s||t.visible())){var f,h,p=s?t.effectiveOpacity():1,v=l.usePaths(),m=!1,g=t.padding();r=t.width()+2*g,i=t.height()+2*g,n&&(h=n,e.translate(-h.x1,-h.y1));for(var y=t.pstyle("background-image").value,b=new Array(y.length),x=new Array(y.length),w=0,_=0;_<y.length;_++){var E=y[_];if(b[_]=null!=E&&"none"!==E){var k=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);w++,x[_]=l.getCachedImage(E,k,(function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var N=t.pstyle("background-blacken").value,S=t.pstyle("border-width").pfValue,P=t.pstyle("background-opacity").value*p,C=t.pstyle("border-color").value,T=t.pstyle("border-style").value,j=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var D=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;l.eleFillStyle(e,t,n)},A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,C[0],C[1],C[2],t)},M=t.pstyle("shape").strValue,R=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var I=l.nodePathCache=l.nodePathCache||[],L=me("polygon"===M?M+","+R.join(","):M,""+i,""+r),B=I[L];null!=B?(f=B,m=!0,c.pathCache=f):(f=new Path2D,I[L]=c.pathCache=f)}var F=function(){if(!m){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()},z=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=u.backgrounding,o=0,a=0;a<x.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:b[a]&&x[a].complete&&!x[a].error&&(o++,l.drawInscribedImage(e,x[a],t,a,n))}u.backgrounding=!(o===w),i!==u.backgrounding&&t.updateStyle(!1)},V=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},G=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:p),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),v?e.fill(f):e.fill())},U=function(){if(S>0){if(e.lineWidth=S,e.lineCap="butt",e.setLineDash)switch(T){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"===T){e.lineWidth=S/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(f):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}};if("yes"===t.pstyle("ghost").value){var W=t.pstyle("ghost-offset-x").pfValue,q=t.pstyle("ghost-offset-y").pfValue,H=t.pstyle("ghost-opacity").value,Y=H*p;e.translate(W,q),D(H*P),F(),z(Y,!0),A(H*j),U(),V(0!==N||0!==S),z(Y,!1),G(Y),e.translate(-W,-q)}v&&e.translate(-d.x,-d.y),a&&l.drawNodeUnderlay(e,t,d,r,i),v&&e.translate(d.x,d.y),D(),F(),z(p,!0),A(),U(),V(0!==N||0!==S),z(p,!1),G(),v&&e.translate(-d.x,-d.y),l.drawElementText(e,t,null,o),a&&l.drawNodeOverlay(e,t,d,r,i),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,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()}}}};Ks.drawNodeOverlay=Zs("overlay"),Ks.drawNodeUnderlay=Zs("underlay"),Ks.hasPie=function(e){return(e=e[0])._private.hasPie},Ks.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 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,m=h/100;m+d>1&&(m=1-d);var g=1.5*Math.PI+2*Math.PI*d,y=g+2*Math.PI*m;0===h||d>=1||d+m>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,g,y),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=m)}};var Qs={};Qs.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},Qs.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},Qs.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=ut(u,d),h=ut(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(),m=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,m))}else if(n.isEdge()){var g=n.sourceEndpoint(),y=n.targetEndpoint();o=e.createLinearGradient(g.x,g.y,y.x,y.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 _=l.length===s.length,E=s.length,k=0;k<E;k++)o.addColorStop(_?l[k]:k/(E-1),"rgba("+s[k][0]+","+s[k][1]+","+s[k][2]+","+i+")");return o},Qs.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},Qs.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},Qs.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)}},Qs.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},Qs.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},Qs.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)}},Qs.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}},Qs.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Qs.render=function(e){var t=(e=e||Oe()).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,h=a.motionBlurPxRatio,p=l.hasCompoundNodes(),v=a.hoverData.draggingEles,m=!(!a.hoverData.selecting&&!a.touchData.selecting),g=f=f&&!t&&a.motionBlurEnabled&&!m;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&&(g=!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 y=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.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 N=a.getCachedZSortedEles();function S(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 P(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=_,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*h,y:w.y*h},l=b*h,c=a.canvasWidth*h,d=a.canvasHeight*h),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(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 C=a.data.bufferContexts[a.TEXTURE_BUFFER];C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:C,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(E=a.textureCache.viewport={zoom:l.zoom(),pan:l.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 T=u.contexts[a.NODE],j=a.textureCache.texture;E=a.textureCache.viewport;T.setTransform(1,0,0,1,0,0),f?S(T,0,0,E.width,E.height):T.clearRect(0,0,E.width,E.height);var D=y.core("outside-texture-bg-color").value,O=y.core("outside-texture-bg-opacity").value;a.colorFillStyle(T,D[0],D[1],D[2],O),T.fillRect(0,0,E.width,E.height);b=l.zoom();P(T,!1),T.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),T.drawImage(j,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=l.extent(),M=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),R=a.hideEdgesOnViewport&&M,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 L=f&&!I[a.NODE]&&1!==h;P(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),f&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,N.nondrag,s,A):a.drawLayeredElements(T,N.nondrag,s,A),a.debug&&a.drawDebugPoints(T,N.nondrag),n||f||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||I[a.DRAG])){L=f&&!I[a.DRAG]&&1!==h;P(T=t||(L?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),f&&!L?"motionBlur":void 0),R?a.drawCachedNodes(T,N.drag,s,A):a.drawCachedElements(T,N.drag,s,A),a.debug&&a.drawDebugPoints(T,N.drag),n||f||(c[a.DRAG]=!1)}if(a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(P(T=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var B=y.core("selection-box-border-width").value/b;T.lineWidth=B,T.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.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]),B>0&&(T.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.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 F=u.bgActivePosistion;T.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",T.beginPath(),T.arc(F.x,F.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),T.fill()}var z=a.lastRedrawTime;if(a.showFps&&z){z=Math.round(z);var V=Math.round(1e3/z);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 = "+z+" 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!==h){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||!g?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):S(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]||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=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||l.emit("render")};for(var Js={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=Gt(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],h=n+s*o[4*u+1],p=-o[d]*o[c]-o[d+1]*o[c+1],v=l/Math.tan(Math.acos(p)/2),m=f-v*o[d],g=h-v*o[d+1],y=f+v*o[c],b=h+v*o[c+1];0===u?e.moveTo(m,g):e.lineTo(m,g),e.arcTo(f,h,y,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=Vt(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=Vt(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=Ut(r,i),f=d.widthOffset,h=d.heightOffset,p=d.ctrlPtOffsetPct*f;e.beginPath&&e.beginPath(),e.moveTo(s,u+h),e.lineTo(s,c-h),e.quadraticCurveTo(s+p,c,s+f,c),e.lineTo(l-f,c),e.quadraticCurveTo(l-p,c,l,c-h),e.lineTo(l,u+h),e.quadraticCurveTo(l-p,u,l-f,u),e.lineTo(s+f,u),e.quadraticCurveTo(s+p,u,s,u+h),e.closePath()}},el=Math.sin(0),tl=Math.cos(0),nl={},rl={},il=Math.PI/40,ol=0*Math.PI;ol<2*Math.PI;ol+=il)nl[ol]=Math.sin(ol),rl[ol]=Math.cos(ol);Js.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+=il)o=t-s*nl[u]*el+s*rl[u]*tl,a=n+l*rl[u]*el+l*nl[u]*tl,0===u?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var al={};function sl(e){var t=e.indexOf(",");return e.substr(t+1)}function ll(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new nr((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})}(sl(r()),n);case"base64":return sl(r());default:return r()}}al.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},al.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=O(e.maxWidth)||O(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;O(e.maxWidth)&&(u=l*e.maxWidth/i),O(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 h=this.getCachedZSortedEles();if(e.full)f.translate(-n.x1*l,-n.y1*l),f.scale(l,l),this.drawElements(f,h),f.scale(1/l,1/l),f.translate(n.x1*l,n.y1*l);else{var p=t.pan(),v={x:p.x*l,y:p.y*l};l*=t.zoom(),f.translate(v.x,v.y),f.scale(l,l),this.drawElements(f,h),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},al.png=function(e){return ll(e,this.bufferCanvasImage(e),"image/png")},al.jpg=function(e){return ll(e,this.bufferCanvasImage(e),"image/jpeg")};var ul={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)}}},cl=fl,dl=fl.prototype;function fl(e){var t=this;t.data={canvases:new Array(dl.CANVAS_LAYERS),contexts:new Array(dl.CANVAS_LAYERS),canvasNeedsRedraw:new Array(dl.CANVAS_LAYERS),bufferCanvases:new Array(dl.BUFFER_COUNT),bufferContexts:new Array(dl.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"};_&&_.userAgent.match(/msie|trident|edge/i)&&(a["-ms-touch-action"]="none",a["touch-action"]="none");for(var s=0;s<dl.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(dl.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[dl.NODE].setAttribute("data-id","layer"+dl.NODE+"-node"),t.data.canvases[dl.SELECT_BOX].setAttribute("data-id","layer"+dl.SELECT_BOX+"-selectbox"),t.data.canvases[dl.DRAG].setAttribute("data-id","layer"+dl.DRAG+"-drag");for(s=0;s<dl.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=vt(),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},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||u},v=function(e,t){return t},m=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}},g=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new Ss(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}),b=t.data.lblTxrCache=new Ss(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 m("",g(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:v}),x=t.data.slbTxrCache=new Ss(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 m("source",g(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return c(h(e))},isVisible:v}),w=t.data.tlbTxrCache=new Ss(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:p,getRotationPoint:function(e){return m("target",g(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return c(p(e))},isVisible:v}),E=t.data.lyrTxrCache=new Cs(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.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)};y.onDequeue(k),b.onDequeue(k),x.onDequeue(k),w.onDequeue(k)}dl.CANVAS_LAYERS=3,dl.SELECT_BOX=0,dl.DRAG=1,dl.NODE=2,dl.BUFFER_COUNT=3,dl.TEXTURE_BUFFER=0,dl.MOTIONBLUR_BUFFER_NODE=1,dl.MOTIONBLUR_BUFFER_DRAG=2,dl.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[dl.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[dl.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[dl.SELECT_BOX]=t}};var hl="undefined"!=typeof Path2D;dl.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},dl.usePaths=function(){return hl&&this.pathsEnabled},dl.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},dl.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},dl.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":p(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[As,Fs,Hs,Xs,$s,Ks,Qs,Js,al,ul].forEach((function(e){Q(dl,e)}));var pl=[{type:"layout",extensions:Xa},{type:"renderer",extensions:[{name:"null",impl:$a},{name:"base",impl:bs},{name:"canvas",impl:cl}]}],vl={},ml={};function gl(e,t,n){var r=n,i=function(n){Ce("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(la.prototype[t])return i(t);la.prototype[t]=n}else if("collection"===e){if(ko.prototype[t])return i(t);ko.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),D(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)}};Q(a,{createEmitter:function(){return this._private.emitter=new Vi(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}}),lr.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var h=yl("renderer","base"),p=h.prototype,v=n,m=n.prototype,g=function(){h.apply(this,arguments),v.apply(this,arguments)},y=g.prototype;for(var b in p){var x=p[b];if(null!=m[b])return i(b);y[b]=x}for(var w in m)y[w]=m[w];p.clientFunctions.forEach((function(e){y[e]=y[e]||function(){Se("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=g}else if("__proto__"===e||"constructor"===e||"prototype"===e)return Se(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return te({map:vl,keys:[e,t],value:r})}function yl(e,t){return ne({map:vl,keys:[e,t]})}function bl(e,t,n,r,i){return te({map:ml,keys:[e,t,n,r],value:i})}function xl(e,t,n,r){return ne({map:ml,keys:[e,t,n,r]})}var wl=function(){return 2===arguments.length?yl.apply(null,arguments):3===arguments.length?gl.apply(null,arguments):4===arguments.length?xl.apply(null,arguments):5===arguments.length?bl.apply(null,arguments):void Se("Invalid extension access syntax")};la.prototype.extension=wl,pl.forEach((function(e){e.extensions.forEach((function(t){gl(e.type,t.name,t.impl)}))}));var _l=function e(){if(!(this instanceof e))return new e;this.length=0},El=_l.prototype;El.instanceString=function(){return"stylesheet"},El.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},El.css=function(e,t){var n=this.length-1;if(C(e))this[n].properties.push({name:e,value:t});else if(D(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=ra.properties[a]||ra.properties[U(a)];if(null!=l){var u=l.name,c=s;this[n].properties.push({name:u,value:c})}}}return this},El.style=El.css,El.generateStyle=function(e){var t=new ra(e);return this.appendToStyle(t)},El.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 kl=function(e){return void 0===e&&(e={}),D(e)?new la(e):C(e)?wl.apply(wl,arguments):void 0};kl.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(kl),e.apply(null,t),this},kl.warnings=function(e){return Pe(e)},kl.version="3.23.0",kl.stylesheet=kl.Stylesheet=_l,e.exports=kl},15439:(e,t,n)=>{e.exports={graphlib:n(21943),layout:n(75499),debug:n(55856),util:{time:n(30345).time,notime:n(30345).notime},version:n(93404)}},55205:(e,t,n)=>{"use strict";var r=n(32692),i=n(50824);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)}}))}}},11555:(e,t,n)=>{var r=n(32692),i=n(30345);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)}}))}},84688:(e,t,n)=>{"use strict";var r=n(32692);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))}}},32278: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(", ")+"]"}},55856:(e,t,n)=>{var r=n(32692),i=n(30345),o=n(21943).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}}},21943:(e,t,n)=>{var r;try{r=n(66960)}catch(i){}r||(r=window.graphlib),e.exports=r},50824:(e,t,n)=>{var r=n(32692),i=n(21943).Graph,o=n(32278);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)}},75499:(e,t,n)=>{"use strict";var r=n(32692),i=n(55205),o=n(44125),a=n(28264),s=n(30345).normalizeRanks,l=n(32555),u=n(30345).removeEmptyRanks,c=n(60838),d=n(11555),f=n(84688),h=n(56571),p=n(89533),v=n(30345),m=n(21943).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 m({multigraph:!0,compound:!0}),n=S(e.graph());return t.setGraph(r.merge({},y,N(n,g),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=S(e.node(n));t.setNode(n,r.defaults(N(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=S(e.edge(n));t.setEdge(n,r.merge({},E,N(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(){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(){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,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 g=["nodesep","edgesep","ranksep","marginx","marginy"],y={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 N(e,t){return r.mapValues(r.pick(e,t),Number)}function S(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},32692:(e,t,n)=>{var r;try{r={cloneDeep:n(77179),constant:n(89203),defaults:n(73821),each:n(20678),filter:n(64663),find:n(26969),flatten:n(62923),forEach:n(77734),forIn:n(87514),has:n(45346),isUndefined:n(86474),last:n(77875),map:n(69107),mapValues:n(61230),max:n(56492),merge:n(88469),min:n(65071),minBy:n(76838),now:n(80231),pick:n(49335),range:n(38569),reduce:n(17682),sortBy:n(71635),uniqueId:n(61422),values:n(31682),zipObject:n(54142)}}catch(i){}r||(r=window._),e.exports=r},60838:(e,t,n)=>{var r=n(32692),i=n(30345);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"),h=e.node(u);e.setParent(d,u),h.borderTop=d,e.setParent(f,u),h.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,h=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=c!==h?1:s-l[u]+1;e.setEdge(d,c,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(h,f,{weight:p,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)}))}}},44125:(e,t,n)=>{"use strict";var r=n(32692),i=n(30345);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)}))}}},4333:(e,t,n)=>{var r=n(32692);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}}))}},15374:(e,t,n)=>{var r=n(32692);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}}))}},3037:(e,t,n)=>{var r=n(32692),i=n(21943).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}},29420:(e,t,n)=>{"use strict";var r=n(32692);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}},56571:(e,t,n)=>{"use strict";var r=n(32692),i=n(61001),o=n(29420),a=n(37407),s=n(3037),l=n(4333),u=n(21943).Graph,c=n(30345);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 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 l,u=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){f(p%2?n:a,p%4>=2),s=c.buildLayerMatrix(e);var m=o(e,s);m<u&&(v=0,l=r.cloneDeep(s),u=m)}h(e,l)}},61001:(e,t,n)=>{"use strict";var r=n(32692);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}},68522:(e,t,n)=>{"use strict";var r=n(32692);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})))}},37407:(e,t,n)=>{var r=n(32692),i=n(15374),o=n(68522),a=n(52711);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,h={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==f})));var p=i(t,u);r.forEach(p,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);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 m=a(v,l);if(d&&(m.vs=r.flatten([d,m.vs,f],!0),t.predecessors(d).length)){var g=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(f)[0]);r.has(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+g.order+y.order)/(m.weight+2),m.weight+=2}return m}},52711:(e,t,n)=>{var r=n(32692),i=n(30345);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 h={vs:r.flatten(l,!0)};c&&(h.barycenter=u/c,h.weight=c);return h}},32555:(e,t,n)=>{var r=n(32692);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]}}))}},17828:(e,t,n)=>{"use strict";var r=n(32692),i=n(21943).Graph,o=n(30345);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 h=l[d];a[e]===e&&t<s[h]&&!u(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={},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 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,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 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)),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 h(l,u),p(l,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:u,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p}},89533:(e,t,n)=>{"use strict";var r=n(32692),i=n(30345),o=n(17828).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}))}},86771:(e,t,n)=>{"use strict";var r=n(32692),i=n(21943).Graph,o=n(23834).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}},28264:(e,t,n)=>{"use strict";var r=n(23834).longestPath,i=n(86771),o=n(53284);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)}},53284:(e,t,n)=>{"use strict";var r=n(32692),i=n(86771),o=n(23834).slack,a=n(23834).longestPath,s=n(21943).alg.preorder,l=n(21943).alg.postorder,u=n(30345).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(h(n),d(n,e);t=v(n);)g(n,e,t,m(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),i=r.parent;e.edge(n,i).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 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 m(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===y(e,e.node(t.v),u)&&c!==y(e,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function g(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 y(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=m,c.exchangeEdges=g},23834:(e,t,n)=>{"use strict";var r=n(32692);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}}},30345:(e,t,n)=>{"use strict";var r=n(32692),i=n(21943).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()}}},93404:e=>{e.exports="0.8.5"},4329: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 h=f[d];l(e[h],h,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 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,l);try{if("function"==typeof e.toJSON)return}catch(g){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(h=0;h<e.length;h++)d(e[h],h,h,a,e,c,f);else{var p={},v=Object.keys(e).sort(u);for(h=0;h<v.length;h++){var m=v[h];d(e[m],m,h,a,e,c,f),p[m]=e[m]}if(void 0===l)return p;r.push([l,i,e]),l[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)}}},66960:(e,t,n)=>{var r=n(3150);e.exports={Graph:r.Graph,json:n(11430),alg:n(89757),version:r.version}},79535:(e,t,n)=>{var r=n(44434);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}},97819:(e,t,n)=>{var r=n(44434);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}},61353:(e,t,n)=>{var r=n(4245),i=n(44434);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},4245:(e,t,n)=>{var r=n(44434),i=n(51011);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)},30937:(e,t,n)=>{var r=n(44434),i=n(59177);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},70086:(e,t,n)=>{var r=n(44434);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)},89757:(e,t,n)=>{e.exports={components:n(79535),dijkstra:n(4245),dijkstraAll:n(61353),findCycles:n(30937),floydWarshall:n(70086),isAcyclic:n(47772),postorder:n(28494),preorder:n(50101),prim:n(53816),tarjan:n(59177),topsort:n(60750)}},47772:(e,t,n)=>{var r=n(60750);e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},28494:(e,t,n)=>{var r=n(97819);e.exports=function(e,t){return r(e,t,"post")}},50101:(e,t,n)=>{var r=n(97819);e.exports=function(e,t){return r(e,t,"pre")}},53816:(e,t,n)=>{var r=n(44434),i=n(69955),o=n(51011);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}},59177:(e,t,n)=>{var r=n(44434);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}},60750:(e,t,n)=>{var r=n(44434);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},51011:(e,t,n)=>{var r=n(44434);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}},69955:(e,t,n)=>{"use strict";var r=n(44434);e.exports=s;var i="\0",o="\0",a="\x01";function s(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[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.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},s.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]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.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},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;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},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.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},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.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},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=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[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(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};r&&(s.name=r);return s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(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],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.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}},s.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}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},3150:(e,t,n)=>{e.exports={Graph:n(69955),version:n(59127)}},11430:(e,t,n)=>{var r=n(44434),i=n(69955);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}}},44434:(e,t,n)=>{var r;try{r={clone:n(17953),constant:n(89203),each:n(20678),filter:n(64663),has:n(45346),isArray:n(55589),isEmpty:n(29787),isFunction:n(45563),isUndefined:n(86474),keys:n(62096),map:n(69107),reduce:n(17682),size:n(91039),transform:n(63604),union:n(27767),values:n(31682)}}catch(i){}r||(r=window._),e.exports=r},59127:e=>{e.exports="2.1.8"},97597:(e,t,n)=>{e.exports=n(79127)},79127:function(e,t){var n,r,i;(function(){var o,a,s,l,u,c,d,f,h,p,v,m,g,y,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),y(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},g=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return y(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()},m=function(e,t,n){var r,i,o,s,c,d,f,v,m;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(l(e,n),m=[],c=0,v=p(t,e.length);0<=v?c<v:c>v;0<=v?++c:--c)m.push(u(e,n));return m},y=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,y(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=g,e.nlargest=v,e.nsmallest=m,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 g(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)},86909:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),i="undefined"!=typeof Map,o="undefined"!=typeof Set,a="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,s=r?Symbol.for("immer-nothing"):((n={})["immer-nothing"]=!0,n),l=r?Symbol.for("immer-draftable"):"__$immer_draftable",u=r?Symbol.for("immer-state"):"__$immer_state",c="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",d={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"};function f(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=d[e],o=i?"function"==typeof i?i.apply(null,n):i:"unknown error nr: "+e;throw new Error("[Immer] "+o)}function h(e){return!!e&&!!e[u]}function p(e){var t;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)===v}(e)||Array.isArray(e)||!!e[l]||!!(null===(t=e.constructor)||void 0===t?void 0:t[l])||k(e)||N(e))}var v=Object.prototype.constructor.toString();var m="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,g=Object.getOwnPropertyDescriptors||function(e){var t={};return m(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t};function y(e,t,n){void 0===n&&(n=!1),0===b(e)?(n?Object.keys:m)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function b(e){var t=e[u];return t?t.type_>3?t.type_-4:t.type_:Array.isArray(e)?1:k(e)?2:N(e)?3:0}function x(e,t){return 2===b(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function w(e,t){return 2===b(e)?e.get(t):e[t]}function _(e,t,n){var r=b(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function E(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function k(e){return i&&e instanceof Map}function N(e){return o&&e instanceof Set}function S(e){return e.copy_||e.base_}function P(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=g(e);delete t[u];for(var n=m(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 C(e,t){return void 0===t&&(t=!1),j(e)||h(e)||!p(e)||(b(e)>1&&(e.set=e.add=e.clear=e.delete=T),Object.freeze(e),t&&y(e,(function(e,t){return C(t,!0)}),!0)),e}function T(){f(2)}function j(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}var D,O={};function A(e){var t=O[e];return t||f(18,e),t}function M(e,t){O[e]||(O[e]=t)}function R(){return D||f(0),D}function I(e,t){t&&(A("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function L(e){B(e),e.drafts_.forEach(z),e.drafts_=null}function B(e){e===D&&(D=e.parent_)}function F(e){return D={drafts_:[],parent_:D,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function z(e){var t=e[u];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function V(e,t){t.unfinalizedDrafts_=t.drafts_.length;var n=t.drafts_[0],r=void 0!==e&&e!==n;return t.immer_.useProxies_||A("ES5").willFinalizeES5_(t,e,r),r?(n[u].modified_&&(L(t),f(4)),p(e)&&(e=G(t,e),t.parent_||W(t,e)),t.patches_&&A("Patches").generateReplacementPatches_(n[u].base_,e,t.patches_,t.inversePatches_)):e=G(t,n,[]),L(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==s?e:void 0}function G(e,t,n){if(j(t))return t;var r=t[u];if(!r)return y(t,(function(i,o){return U(e,r,t,i,o,n)}),!0),t;if(r.scope_!==e)return t;if(!r.modified_)return W(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;var i=4===r.type_||5===r.type_?r.copy_=P(r.draft_):r.copy_;y(3===r.type_?new Set(i):i,(function(t,o){return U(e,r,i,t,o,n)})),W(e,i,!1),n&&e.patches_&&A("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function U(e,t,n,r,i,o){if(i===n&&f(5),h(i)){var a=G(e,i,o&&t&&3!==t.type_&&!x(t.assigned_,r)?o.concat(r):void 0);if(_(n,r,a),!h(a))return;e.canAutoFreeze_=!1}if(p(i)&&!j(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;G(e,i),t&&t.scope_.parent_||W(e,i)}}function W(e,t,n){void 0===n&&(n=!1),e.immer_.autoFreeze_&&e.canAutoFreeze_&&C(t,n)}var q={get:function(e,t){if(t===u)return e;var n=S(e);if(!x(n,t))return function(e,t,n){var r,i=X(t,n);return i?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(e.draft_):void 0}(e,n,t);var r=n[t];return e.finalized_||!p(r)?r:r===Y(e.base_,t)?(K(e),e.copy_[t]=Q(e.scope_.immer_,r,e)):r},has:function(e,t){return t in S(e)},ownKeys:function(e){return Reflect.ownKeys(S(e))},set:function(e,t,n){var r=X(S(e),t);if(null==r?void 0:r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){var i=Y(S(e),t),o=null==i?void 0:i[u];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(E(n,i)&&(void 0!==n||x(e.base_,t)))return!0;K(e),$(e)}return e.copy_[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.copy_)||(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Y(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,K(e),$(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor:function(e,t){var n=S(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){f(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.base_)},setPrototypeOf:function(){f(12)}},H={};function Y(e,t){var n=e[u];return(n?S(n):e)[t]}function X(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 $(e){e.modified_||(e.modified_=!0,e.parent_&&$(e.parent_))}function K(e){e.copy_||(e.copy_=P(e.base_))}y(q,(function(e,t){H[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),H.deleteProperty=function(e,t){return isNaN(parseInt(t))&&f(13),H.set.call(this,e,t,void 0)},H.set=function(e,t,n){return"length"!==t&&isNaN(parseInt(t))&&f(14),q.set.call(this,e[0],t,n,e[0])};var Z=function(){function e(e){var t=this;this.useProxies_=a,this.autoFreeze_=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var o=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return o.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&f(6),void 0!==r&&"function"!=typeof r&&f(7),p(e)){var l=F(t),u=Q(t,e,void 0),c=!0;try{a=n(u),c=!1}finally{c?L(l):B(l)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return I(l,r),V(e,l)}),(function(e){throw L(l),e})):(I(l,r),V(a,l))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===s&&(a=void 0),t.autoFreeze_&&C(a,!0),r){var d=[],h=[];A("Patches").generateReplacementPatches_(e,a,d,h),r(d,h)}return a}f(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,i=new 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))}))};var r,i,o=t.produce(e,n,(function(e,t){r=e,i=t}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(e){return[e,r,i]})):[o,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){p(e)||f(8),h(e)&&(e=J(e));var t=F(this),n=Q(this,e,void 0);return n[u].isManual_=!0,B(t),n},t.finishDraft=function(e,t){var n=e&&e[u];n&&n.isManual_||f(9),n.finalized_&&f(10);var r=n.scope_;return I(r,t),V(void 0,r)},t.setAutoFreeze=function(e){this.autoFreeze_=e},t.setUseProxies=function(e){e&&!a&&f(20),this.useProxies_=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}}n>-1&&(t=t.slice(n+1));var i=A("Patches").applyPatches_;return h(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}();function Q(e,t,n){var r=k(t)?A("MapSet").proxyMap_(t,n):N(t)?A("MapSet").proxySet_(t,n):e.useProxies_?function(e,t){var n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:R(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,o=q;n&&(i=[r],o=H);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.draft_=l,r.revoke_=s,l}(t,n):A("ES5").createES5Proxy_(t,n);return(n?n.scope_:R()).drafts_.push(r),r}function J(e){return h(e)||f(22,e),ee(e)}function ee(e){if(!p(e))return e;var t,n=e[u],r=b(e);if(n){if(!n.modified_&&(n.type_<4||!A("ES5").hasChanges_(n)))return n.base_;n.finalized_=!0,t=te(e,r),n.finalized_=!1}else t=te(e,r);return y(t,(function(e,r){n&&w(n.base_,e)===r||_(t,e,ee(r))})),3===r?new Set(t):t}function te(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return P(e)}function ne(){var e={};function t(t,n){var r=e[t];return r?r.enumerable=n:e[t]=r={configurable:!0,enumerable:n,get:function(){var e=this[u];return a(e),q.get(e,t)},set:function(e){var n=this[u];a(n),q.set(n,t,e)}},r}function n(e){for(var t=e.length-1;t>=0;t--){var n=e[t][u];if(!n.modified_)switch(n.type_){case 5:o(n)&&$(n);break;case 4:i(n)&&$(n)}}}function r(e){if(e&&"object"==typeof e){var t=e[u];if(t){var n=t.base_,i=t.draft_,a=t.assigned_,s=t.type_;if(4===s)y(i,(function(e){e!==u&&(void 0!==n[e]||x(n,e)?a[e]||r(i[e]):(a[e]=!0,$(t)))})),y(n,(function(e){void 0!==i[e]||x(i,e)||(a[e]=!1,$(t))}));else if(5===s){if(o(t)&&($(t),a.length=!0),i.length<n.length)for(var l=i.length;l<n.length;l++)a[l]=!1;else for(var c=n.length;c<i.length;c++)a[c]=!0;for(var d=Math.min(i.length,n.length),f=0;f<d;f++)i.hasOwnProperty(f)||(a[f]=!0),void 0===a[f]&&r(i[f])}}}}function i(e){for(var t=e.base_,n=e.draft_,r=m(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==u){var a=t[o];if(void 0===a&&!x(t,o))return!0;var s=n[o],l=s&&s[u];if(l?l.base_!==a:!E(s,a))return!0}}var c=!!t[u];return r.length!==m(t).length+(c?0:1)}function o(e){var t=e.draft_;if(t.length!==e.base_.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}function a(e){e.revoked_&&f(3,JSON.stringify(S(e)))}M("ES5",{createES5Proxy_:function(e,n){var r=Array.isArray(e),i=function(e,n){if(e){for(var r=new Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,t(i,!0));return r}var o=g(n);delete o[u];for(var a=m(o),s=0;s<a.length;s++){var l=a[s];o[l]=t(l,e||!!o[l].enumerable)}return Object.create(Object.getPrototypeOf(n),o)}(r,e),o={type_:r?5:4,scope_:n?n.scope_:R(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:i,copy_:null,revoked_:!1,isManual_:!1};return Object.defineProperty(i,u,{value:o,writable:!0}),i},willFinalizeES5_:function(e,t,i){i?h(t)&&t[u].scope_===e&&n(e.drafts_):(e.patches_&&r(e.drafts_[0]),n(e.drafts_))},hasChanges_:function(e){return 4===e.type_?i(e):o(e)}})}function re(){var e="replace",t="add",n="remove";function r(e){if(!p(e))return e;if(Array.isArray(e))return e.map(r);if(k(e))return new Map(Array.from(e.entries()).map((function(e){return[e[0],r(e[1])]})));if(N(e))return new Set(Array.from(e).map(r));var t=Object.create(Object.getPrototypeOf(e));for(var n in e)t[n]=r(e[n]);return x(e,l)&&(t[l]=e[l]),t}function i(e){return h(e)?r(e):e}M("Patches",{applyPatches_:function(i,o){return o.forEach((function(o){for(var a=o.path,s=o.op,l=i,u=0;u<a.length-1;u++){var c=b(l),d=""+a[u];0!==c&&1!==c||"__proto__"!==d&&"constructor"!==d||f(24),"function"==typeof l&&"prototype"===d&&f(24),"object"!=typeof(l=w(l,d))&&f(15,a.join("/"))}var h=b(l),p=r(o.value),v=a[a.length-1];switch(s){case e:switch(h){case 2:return l.set(v,p);case 3:f(16);default:return l[v]=p}case t:switch(h){case 1:return"-"===v?l.push(p):l.splice(v,0,p);case 2:return l.set(v,p);case 3:return l.add(p);default:return l[v]=p}case n:switch(h){case 1:return l.splice(v,1);case 2:return l.delete(v);case 3:return l.delete(o.value);default:return delete l[v]}default:f(17,s)}})),i},generatePatches_:function(r,o,a,s){switch(r.type_){case 0:case 4:case 2:return function(r,o,a,s){var l=r.base_,u=r.copy_;y(r.assigned_,(function(r,c){var d=w(l,r),f=w(u,r),h=c?x(l,r)?e:t:n;if(d!==f||h!==e){var p=o.concat(r);a.push(h===n?{op:h,path:p}:{op:h,path:p,value:f}),s.push(h===t?{op:n,path:p}:h===n?{op:t,path:p,value:i(d)}:{op:e,path:p,value:i(d)})}}))}(r,o,a,s);case 5:case 1:return function(n,r,o,a){var s=n.base_,l=n.assigned_,u=n.copy_;if(u.length<s.length){var c=[u,s];s=c[0],u=c[1];var d=[a,o];o=d[0],a=d[1]}for(var f=0;f<s.length;f++)if(l[f]&&u[f]!==s[f]){var h=r.concat([f]);o.push({op:e,path:h,value:i(u[f])}),a.push({op:e,path:h,value:i(s[f])})}for(var p=s.length;p<u.length;p++){var v=r.concat([p]);o.push({op:t,path:v,value:i(u[p])})}s.length<u.length&&a.push({op:e,path:r.concat(["length"]),value:s.length})}(r,o,a,s);case 3:return function(e,r,i,o){var a=e.base_,s=e.copy_,l=0;a.forEach((function(e){if(!s.has(e)){var a=r.concat([l]);i.push({op:n,path:a,value:e}),o.unshift({op:t,path:a,value:e})}l++})),l=0,s.forEach((function(e){if(!a.has(e)){var s=r.concat([l]);i.push({op:t,path:s,value:e}),o.unshift({op:n,path:s,value:e})}l++}))}(r,o,a,s)}},generateReplacementPatches_:function(t,n,r,i){r.push({op:e,path:[],value:n===s?void 0:n}),i.push({op:e,path:[],value:t})}})}function ie(){var e=function(t,n){return e=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,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=(r.prototype=n.prototype,new r)}var n=function(e){function n(e,t){return this[u]={type_:2,parent_:t,scope_:t?t.scope_:R(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1},this}t(n,Map);var i=n.prototype;return Object.defineProperty(i,"size",{get:function(){return S(this[u]).size}}),i.has=function(e){return S(this[u]).has(e)},i.set=function(e,t){var n=this[u];return a(n),S(n).has(e)&&S(n).get(e)===t||(r(n),$(n),n.assigned_.set(e,!0),n.copy_.set(e,t),n.assigned_.set(e,!0)),this},i.delete=function(e){if(!this.has(e))return!1;var t=this[u];return a(t),r(t),$(t),t.base_.has(e)?t.assigned_.set(e,!1):t.assigned_.delete(e),t.copy_.delete(e),!0},i.clear=function(){var e=this[u];a(e),S(e).size&&(r(e),$(e),e.assigned_=new Map,y(e.base_,(function(t){e.assigned_.set(t,!1)})),e.copy_.clear())},i.forEach=function(e,t){var n=this;S(this[u]).forEach((function(r,i,o){e.call(t,n.get(i),i,n)}))},i.get=function(e){var t=this[u];a(t);var n=S(t).get(e);if(t.finalized_||!p(n))return n;if(n!==t.base_.get(e))return n;var i=Q(t.scope_.immer_,n,t);return r(t),t.copy_.set(e,i),i},i.keys=function(){return S(this[u]).keys()},i.values=function(){var e,t=this,n=this.keys();return(e={})[c]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},i.entries=function(){var e,t=this,n=this.keys();return(e={})[c]=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},i[c]=function(){return this.entries()},n}();function r(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}var i=function(e){function n(e,t){return this[u]={type_:3,parent_:t,scope_:t?t.scope_:R(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1},this}t(n,Set);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return S(this[u]).size}}),r.has=function(e){var t=this[u];return a(t),t.copy_?!!t.copy_.has(e)||!(!t.drafts_.has(e)||!t.copy_.has(t.drafts_.get(e))):t.base_.has(e)},r.add=function(e){var t=this[u];return a(t),this.has(e)||(o(t),$(t),t.copy_.add(e)),this},r.delete=function(e){if(!this.has(e))return!1;var t=this[u];return a(t),o(t),$(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))},r.clear=function(){var e=this[u];a(e),S(e).size&&(o(e),$(e),e.copy_.clear())},r.values=function(){var e=this[u];return a(e),o(e),e.copy_.values()},r.entries=function(){var e=this[u];return a(e),o(e),e.copy_.entries()},r.keys=function(){return this.values()},r[c]=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()},n}();function o(e){e.copy_||(e.copy_=new Set,e.base_.forEach((function(t){if(p(t)){var n=Q(e.scope_.immer_,t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)})))}function a(e){e.revoked_&&f(3,JSON.stringify(S(e)))}M("MapSet",{proxyMap_:function(e,t){return new n(e,t)},proxySet_:function(e,t){return new i(e,t)}})}var oe=new Z,ae=oe.produce,se=oe.produceWithPatches.bind(oe),le=oe.setAutoFreeze.bind(oe),ue=oe.setUseProxies.bind(oe),ce=oe.applyPatches.bind(oe),de=oe.createDraft.bind(oe),fe=oe.finishDraft.bind(oe);t.Immer=Z,t.applyPatches=ce,t.castDraft=function(e){return e},t.castImmutable=function(e){return e},t.createDraft=de,t.current=J,t.default=ae,t.enableAllPlugins=function(){ne(),ie(),re()},t.enableES5=ne,t.enableMapSet=ie,t.enablePatches=re,t.finishDraft=fe,t.freeze=C,t.immerable=l,t.isDraft=h,t.isDraftable=p,t.nothing=s,t.original=function(e){return h(e)||f(23,e),e[u].base_},t.produce=ae,t.produceWithPatches=se,t.setAutoFreeze=le,t.setUseProxies=ue},77667:(e,t,n)=>{"use strict";e.exports=n(86909)},94466:(e,t,n)=>{var r=n(65234)(n(83250),"DataView");e.exports=r},85208:(e,t,n)=>{var r=n(34440),i=n(84108),o=n(61085),a=n(77706),s=n(8636);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},81998:(e,t,n)=>{var r=n(90266),i=n(42875),o=n(45828),a=n(24115),s=n(67690);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},72887:(e,t,n)=>{var r=n(65234)(n(83250),"Map");e.exports=r},95678:(e,t,n)=>{var r=n(39016),i=n(62363),o=n(64348),a=n(53062),s=n(30262);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},95747:(e,t,n)=>{var r=n(65234)(n(83250),"Promise");e.exports=r},56616:(e,t,n)=>{var r=n(65234)(n(83250),"Set");e.exports=r},84546:(e,t,n)=>{var r=n(95678),i=n(83937),o=n(15009);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},19549:(e,t,n)=>{var r=n(81998),i=n(93210),o=n(48603),a=n(38947),s=n(70885),l=n(98938);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},70861:(e,t,n)=>{var r=n(83250).Symbol;e.exports=r},3526:(e,t,n)=>{var r=n(83250).Uint8Array;e.exports=r},98001:(e,t,n)=>{var r=n(65234)(n(83250),"WeakMap");e.exports=r},82274: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)}},84004: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}},82493: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}},45436:(e,t,n)=>{var r=n(94365);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},99105: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}},75825:(e,t,n)=>{var r=n(18509),i=n(79312),o=n(55589),a=n(85778),s=n(5023),l=n(50922),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),h=n||c||d||f,p=h?r(e.length,String):[],v=p.length;for(var m in e)!t&&!u.call(e,m)||h&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,v))||p.push(m);return p}},29233: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}},10111: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}},85115: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}},1831: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}},97088:(e,t,n)=>{var r=n(86174)("length");e.exports=r},73532:(e,t,n)=>{var r=n(87500),i=n(58260);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},93192:(e,t,n)=>{var r=n(87500),i=n(58260),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)}},18498:(e,t,n)=>{var r=n(58260);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},44265:(e,t,n)=>{var r=n(78618),i=n(62096);e.exports=function(e,t){return e&&r(t,i(t),e)}},31629:(e,t,n)=>{var r=n(78618),i=n(9882);e.exports=function(e,t){return e&&r(t,i(t),e)}},87500:(e,t,n)=>{var r=n(25595);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},18361:(e,t,n)=>{var r=n(19549),i=n(84004),o=n(93192),a=n(44265),s=n(31629),l=n(46502),u=n(32166),c=n(67272),d=n(52066),f=n(54357),h=n(55713),p=n(87493),v=n(82865),m=n(11908),g=n(84046),y=n(55589),b=n(85778),x=n(37613),w=n(93702),_=n(60693),E=n(62096),k=n(9882),N="[object Arguments]",S="[object Function]",P="[object Object]",C={};C[N]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[P]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[S]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,j,D,O){var A,M=1&n,R=2&n,I=4&n;if(T&&(A=D?T(t,j,D,O):T(t)),void 0!==A)return A;if(!w(t))return t;var L=y(t);if(L){if(A=v(t),!M)return u(t,A)}else{var B=p(t),F=B==S||"[object GeneratorFunction]"==B;if(b(t))return l(t,M);if(B==P||B==N||F&&!D){if(A=R||F?{}:g(t),!M)return R?d(t,s(A,t)):c(t,a(A,t))}else{if(!C[B])return D?t:{};A=m(t,B,M)}}O||(O=new r);var z=O.get(t);if(z)return z;O.set(t,A),_(t)?t.forEach((function(r){A.add(e(r,n,T,r,t,O))})):x(t)&&t.forEach((function(r,i){A.set(i,e(r,n,T,i,t,O))}));var V=L?void 0:(I?R?h:f:R?k:E)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(A,i,e(r,n,T,i,t,O))})),A}},57890:(e,t,n)=>{var r=n(93702),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},61701:(e,t,n)=>{var r=n(44003),i=n(96313)(r);e.exports=i},85117:(e,t,n)=>{var r=n(52624);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}},68146:(e,t,n)=>{var r=n(61701);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},44770: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}},22825:(e,t,n)=>{var r=n(10111),i=n(67123);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}},39943:(e,t,n)=>{var r=n(72545)();e.exports=r},44003:(e,t,n)=>{var r=n(39943),i=n(62096);e.exports=function(e,t){return e&&r(e,t,i)}},40548:(e,t,n)=>{var r=n(24007),i=n(86040);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}},4468:(e,t,n)=>{var r=n(10111),i=n(55589);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},69823:(e,t,n)=>{var r=n(70861),i=n(91339),o=n(25151),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)}},51669:e=>{e.exports=function(e,t){return e>t}},32586:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},62902:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},94365:(e,t,n)=>{var r=n(44770),i=n(56963),o=n(45898);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},33016:(e,t,n)=>{var r=n(69823),i=n(50440);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},34662:(e,t,n)=>{var r=n(88968),i=n(50440);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))}},88968:(e,t,n)=>{var r=n(19549),i=n(14952),o=n(21080),a=n(86524),s=n(87493),l=n(55589),u=n(85778),c=n(50922),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,g){var y=l(e),b=l(t),x=y?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&&u(e)){if(!u(t))return!1;y=!0,_=!1}if(k&&!_)return g||(g=new r),y||c(e)?i(e,t,n,v,m,g):o(e,t,x,n,v,m,g);if(!(1&n)){var N=_&&p.call(e,"__wrapped__"),S=E&&p.call(t,"__wrapped__");if(N||S){var P=N?e.value():e,C=S?t.value():t;return g||(g=new r),m(P,C,n,v,g)}}return!!k&&(g||(g=new r),a(e,t,n,v,m,g))}},52275:(e,t,n)=>{var r=n(87493),i=n(50440);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},2972:(e,t,n)=>{var r=n(19549),i=n(34662);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 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}},56963:e=>{e.exports=function(e){return e!=e}},99817:(e,t,n)=>{var r=n(45563),i=n(28597),o=n(93702),a=n(55784),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))}},7170:(e,t,n)=>{var r=n(87493),i=n(50440);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},42448:(e,t,n)=>{var r=n(69823),i=n(66052),o=n(50440),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)]}},55833:(e,t,n)=>{var r=n(15640),i=n(9906),o=n(80229),a=n(55589),s=n(94437);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)}},41351:(e,t,n)=>{var r=n(32840),i=n(82825),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}},71309:(e,t,n)=>{var r=n(93702),i=n(32840),o=n(84866),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}},46718:e=>{e.exports=function(e,t){return e<t}},78068:(e,t,n)=>{var r=n(61701),i=n(30568);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}},15640:(e,t,n)=>{var r=n(2972),i=n(72198),o=n(94656);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)}}},9906:(e,t,n)=>{var r=n(34662),i=n(13546),o=n(56708),a=n(5130),s=n(18802),l=n(94656),u=n(86040);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)}}},92133:(e,t,n)=>{var r=n(19549),i=n(73532),o=n(39943),a=n(21241),s=n(93702),l=n(9882),u=n(11933);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 h=d?d(u(t,l),o,l+"",t,n,f):void 0;void 0===h&&(h=o),i(t,l,h)}}),l)}},21241:(e,t,n)=>{var r=n(73532),i=n(46502),o=n(21327),a=n(32166),s=n(84046),l=n(79312),u=n(55589),c=n(18268),d=n(85778),f=n(45563),h=n(93702),p=n(54256),v=n(50922),m=n(11933),g=n(36222);e.exports=function(e,t,n,y,b,x,w){var _=m(e,n),E=m(t,n),k=w.get(E);if(k)r(e,n,k);else{var N=x?x(_,E,n+"",e,t,w):void 0,S=void 0===N;if(S){var P=u(E),C=!P&&d(E),T=!P&&!C&&v(E);N=E,P||C||T?u(_)?N=_:c(_)?N=a(_):C?(S=!1,N=i(E,!0)):T?(S=!1,N=o(E,!0)):N=[]:p(E)||l(E)?(N=_,l(_)?N=g(_):h(_)&&!f(_)||(N=s(E))):S=!1}S&&(w.set(E,N),b(N,E,y,x,w),w.delete(E)),r(e,n,N)}}},54466:(e,t,n)=>{var r=n(29233),i=n(40548),o=n(55833),a=n(78068),s=n(53340),l=n(31525),u=n(20315),c=n(80229),d=n(55589);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 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 u(e,t,n)}))}},21785:(e,t,n)=>{var r=n(57121),i=n(56708);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},57121:(e,t,n)=>{var r=n(40548),i=n(32619),o=n(24007);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}},86174:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},3293:(e,t,n)=>{var r=n(40548);e.exports=function(e){return function(t){return r(t,e)}}},24930: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}},34306: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}},29735:(e,t,n)=>{var r=n(80229),i=n(20340),o=n(4173);e.exports=function(e,t){return o(i(e,t,r),e+"")}},32619:(e,t,n)=>{var r=n(93192),i=n(24007),o=n(5023),a=n(93702),s=n(86040);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 h=s(t[u]),p=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=d){var v=f[h];void 0===(p=l?l(v,h,f):void 0)&&(p=a(v)?v:o(t[u+1])?[]:{})}r(f,h,p),f=f[h]}return e}},46739:(e,t,n)=>{var r=n(89203),i=n(25595),o=n(80229),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},53340:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},18509:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},86245:(e,t,n)=>{var r=n(70861),i=n(29233),o=n(55589),a=n(52624),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}},21656:(e,t,n)=>{var r=n(62438),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},31525:e=>{e.exports=function(e){return function(t){return e(t)}}},80135:(e,t,n)=>{var r=n(84546),i=n(45436),o=n(99105),a=n(77026),s=n(86262),l=n(77969);e.exports=function(e,t,n){var u=-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 l(v);f=!1,c=a,p=new r}else p=t?[]:h;e:for(;++u<d;){var m=e[u],g=t?t(m):m;if(m=n||0!==m?m:0,f&&g==g){for(var y=p.length;y--;)if(p[y]===g)continue e;t&&p.push(g),h.push(m)}else c(p,g,n)||(p!==h&&p.push(g),h.push(m))}return h}},20071:(e,t,n)=>{var r=n(29233);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},36302: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}},77026:e=>{e.exports=function(e,t){return e.has(t)}},84781:(e,t,n)=>{var r=n(80229);e.exports=function(e){return"function"==typeof e?e:r}},24007:(e,t,n)=>{var r=n(55589),i=n(5130),o=n(44041),a=n(99835);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},72962:(e,t,n)=>{var r=n(3526);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},46502:(e,t,n)=>{e=n.nmd(e);var r=n(83250),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}},97037:(e,t,n)=>{var r=n(72962);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3429:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},99349:(e,t,n)=>{var r=n(70861),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},21327:(e,t,n)=>{var r=n(72962);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},88899:(e,t,n)=>{var r=n(52624);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}},20315:(e,t,n)=>{var r=n(88899);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}},32166: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}},78618:(e,t,n)=>{var r=n(93192),i=n(87500);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}},67272:(e,t,n)=>{var r=n(78618),i=n(44450);e.exports=function(e,t){return r(e,i(e),t)}},52066:(e,t,n)=>{var r=n(78618),i=n(94969);e.exports=function(e,t){return r(e,i(e),t)}},1622:(e,t,n)=>{var r=n(83250)["__core-js_shared__"];e.exports=r},66948:(e,t,n)=>{var r=n(29735),i=n(98132);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}))}},96313:(e,t,n)=>{var r=n(30568);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}}},72545: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}}},29301:(e,t,n)=>{var r=n(55833),i=n(30568),o=n(62096);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}}},51523:(e,t,n)=>{var r=n(24930),i=n(98132),o=n(99558);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)}}},86262:(e,t,n)=>{var r=n(56616),i=n(71607),o=n(77969),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},25595:(e,t,n)=>{var r=n(65234),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},14952:(e,t,n)=>{var r=n(84546),i=n(1831),o=n(77026);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),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<c;){var g=e[p],y=t[p];if(a)var b=u?a(y,g,p,t,e,l):a(g,y,p,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(m){if(!i(t,(function(e,t){if(!o(m,t)&&(g===e||s(g,e,n,a,l)))return m.push(t)}))){v=!1;break}}else if(g!==y&&!s(g,y,n,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},21080:(e,t,n)=>{var r=n(70861),i=n(3526),o=n(58260),a=n(14952),s=n(81140),l=n(77969),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 h=s;case"[object Set]":var p=1&r;if(h||(h=l),e.size!=t.size&&!p)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var m=a(h(e),h(t),r,u,d,f);return f.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},86524:(e,t,n)=>{var r=n(54357),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 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 m=l;++d<c;){var g=e[f=u[d]],y=t[f];if(o)var b=l?o(y,g,f,t,e,s):o(g,y,f,e,t,s);if(!(void 0===b?g===y||a(g,y,n,o,s):b)){v=!1;break}m||(m="constructor"==f)}if(v&&!m){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}},33273:(e,t,n)=>{var r=n(62923),i=n(20340),o=n(4173);e.exports=function(e){return o(i(e,void 0,r),e+"")}},20302:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},54357:(e,t,n)=>{var r=n(4468),i=n(44450),o=n(62096);e.exports=function(e){return r(e,o,i)}},55713:(e,t,n)=>{var r=n(4468),i=n(94969),o=n(9882);e.exports=function(e){return r(e,o,i)}},77570:(e,t,n)=>{var r=n(58949);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},72198:(e,t,n)=>{var r=n(18802),i=n(62096);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}},65234:(e,t,n)=>{var r=n(99817),i=n(67736);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},18490:(e,t,n)=>{var r=n(33540)(Object.getPrototypeOf,Object);e.exports=r},91339:(e,t,n)=>{var r=n(70861),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}},44450:(e,t,n)=>{var r=n(82493),i=n(84506),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},94969:(e,t,n)=>{var r=n(10111),i=n(18490),o=n(44450),a=n(84506),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},87493:(e,t,n)=>{var r=n(94466),i=n(72887),o=n(95747),a=n(56616),s=n(98001),l=n(69823),u=n(55784),c="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=u(r),m=u(i),g=u(o),y=u(a),b=u(s),x=l;(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=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case v:return p;case m:return c;case g:return d;case y:return f;case b:return h}return t}),e.exports=x},67736:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},13544:(e,t,n)=>{var r=n(24007),i=n(79312),o=n(55589),a=n(5023),s=n(66052),l=n(86040);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))}},63932:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},34440:(e,t,n)=>{var r=n(24545);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},84108:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},61085:(e,t,n)=>{var r=n(24545),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}},77706:(e,t,n)=>{var r=n(24545),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},8636:(e,t,n)=>{var r=n(24545);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}},82865: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}},11908:(e,t,n)=>{var r=n(72962),i=n(97037),o=n(3429),a=n(99349),s=n(21327);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)}}},84046:(e,t,n)=>{var r=n(57890),i=n(18490),o=n(32840);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},67123:(e,t,n)=>{var r=n(70861),i=n(79312),o=n(55589),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},5023:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},98132:(e,t,n)=>{var r=n(58260),i=n(30568),o=n(5023),a=n(93702);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)}},5130:(e,t,n)=>{var r=n(55589),i=n(52624),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))}},58949:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},28597:(e,t,n)=>{var r,i=n(1622),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},32840:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},18802:(e,t,n)=>{var r=n(93702);e.exports=function(e){return e==e&&!r(e)}},90266:e=>{e.exports=function(){this.__data__=[],this.size=0}},42875:(e,t,n)=>{var r=n(18498),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)}},45828:(e,t,n)=>{var r=n(18498);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},24115:(e,t,n)=>{var r=n(18498);e.exports=function(e){return r(this.__data__,e)>-1}},67690:(e,t,n)=>{var r=n(18498);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}},39016:(e,t,n)=>{var r=n(85208),i=n(81998),o=n(72887);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},62363:(e,t,n)=>{var r=n(77570);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},64348:(e,t,n)=>{var r=n(77570);e.exports=function(e){return r(this,e).get(e)}},53062:(e,t,n)=>{var r=n(77570);e.exports=function(e){return r(this,e).has(e)}},30262:(e,t,n)=>{var r=n(77570);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}},81140:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},94656:e=>{e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},32924:(e,t,n)=>{var r=n(67997);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},24545:(e,t,n)=>{var r=n(65234)(Object,"create");e.exports=r},82825:(e,t,n)=>{var r=n(33540)(Object.keys,Object);e.exports=r},84866:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},8690:(e,t,n)=>{e=n.nmd(e);var r=n(20302),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},25151:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},33540:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},20340:(e,t,n)=>{var r=n(82274),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)}}},83250:(e,t,n)=>{var r=n(20302),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},11933:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},83937:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},15009:e=>{e.exports=function(e){return this.__data__.has(e)}},77969:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},4173:(e,t,n)=>{var r=n(46739),i=n(37357)(r);e.exports=i},37357: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)}}},93210:(e,t,n)=>{var r=n(81998);e.exports=function(){this.__data__=new r,this.size=0}},48603:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},38947:e=>{e.exports=function(e){return this.__data__.get(e)}},70885:e=>{e.exports=function(e){return this.__data__.has(e)}},98938:(e,t,n)=>{var r=n(81998),i=n(72887),o=n(95678);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}},45898: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}},11324:(e,t,n)=>{var r=n(97088),i=n(63932),o=n(60445);e.exports=function(e){return i(e)?o(e):r(e)}},44041:(e,t,n)=>{var r=n(32924),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},86040:(e,t,n)=>{var r=n(52624);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},55784: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""}},62438:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},60445:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",u="[\\ufe0e\\ufe0f]?",c=u+l+("(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*"),d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",f=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}},17953:(e,t,n)=>{var r=n(18361);e.exports=function(e){return r(e,4)}},77179:(e,t,n)=>{var r=n(18361);e.exports=function(e){return r(e,5)}},89203:e=>{e.exports=function(e){return function(){return e}}},77837:(e,t,n)=>{var r=n(93702),i=n(80231),o=n(29153),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,f,h,p=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-p>=c}function x(){var e=i();if(b(e))return w(e);f=setTimeout(x,function(e){var n=t-(e-h);return m?s(n,c-(e-p)):n}(e))}function w(e){return f=void 0,g&&l?y(e):(l=u=void 0,d)}function _(){var e=i(),n=b(e);if(l=arguments,u=this,h=e,n){if(void 0===f)return function(e){return p=e,f=setTimeout(x,t),v?y(e):d}(h);if(m)return clearTimeout(f),f=setTimeout(x,t),y(h)}return void 0===f&&(f=setTimeout(x,t)),d}return t=o(t)||0,r(n)&&(v=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},_.flush=function(){return void 0===f?d:w(i())},_}},73821:(e,t,n)=>{var r=n(29735),i=n(58260),o=n(98132),a=n(9882),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,h=d.length;++f<h;){var p=d[f],v=e[p];(void 0===v||i(v,s[p])&&!l.call(e,p))&&(e[p]=c[p])}return e}));e.exports=u},20678:(e,t,n)=>{e.exports=n(77734)},58260:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},64663:(e,t,n)=>{var r=n(82493),i=n(68146),o=n(55833),a=n(55589);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},26969:(e,t,n)=>{var r=n(29301)(n(69312));e.exports=r},69312:(e,t,n)=>{var r=n(44770),i=n(55833),o=n(96843),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)}},62923:(e,t,n)=>{var r=n(22825);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},77734:(e,t,n)=>{var r=n(84004),i=n(61701),o=n(84781),a=n(55589);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},87514:(e,t,n)=>{var r=n(39943),i=n(84781),o=n(9882);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},13546:(e,t,n)=>{var r=n(40548);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},45346:(e,t,n)=>{var r=n(32586),i=n(13544);e.exports=function(e,t){return null!=e&&i(e,t,r)}},56708:(e,t,n)=>{var r=n(62902),i=n(13544);e.exports=function(e,t){return null!=e&&i(e,t,r)}},80229:e=>{e.exports=function(e){return e}},79312:(e,t,n)=>{var r=n(33016),i=n(50440),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},55589:e=>{var t=Array.isArray;e.exports=t},30568:(e,t,n)=>{var r=n(45563),i=n(66052);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},18268:(e,t,n)=>{var r=n(30568),i=n(50440);e.exports=function(e){return i(e)&&r(e)}},85778:(e,t,n)=>{e=n.nmd(e);var r=n(83250),i=n(37999),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},29787:(e,t,n)=>{var r=n(41351),i=n(87493),o=n(79312),a=n(55589),s=n(30568),l=n(85778),u=n(32840),c=n(50922),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}},45563:(e,t,n)=>{var r=n(69823),i=n(93702);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}},66052:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},37613:(e,t,n)=>{var r=n(52275),i=n(31525),o=n(8690),a=o&&o.isMap,s=a?i(a):r;e.exports=s},93702:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},50440:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},54256:(e,t,n)=>{var r=n(69823),i=n(18490),o=n(50440),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}},60693:(e,t,n)=>{var r=n(7170),i=n(31525),o=n(8690),a=o&&o.isSet,s=a?i(a):r;e.exports=s},76705:(e,t,n)=>{var r=n(69823),i=n(55589),o=n(50440);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},52624:(e,t,n)=>{var r=n(69823),i=n(50440);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},50922:(e,t,n)=>{var r=n(42448),i=n(31525),o=n(8690),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},86474:e=>{e.exports=function(e){return void 0===e}},62096:(e,t,n)=>{var r=n(75825),i=n(41351),o=n(30568);e.exports=function(e){return o(e)?r(e):i(e)}},9882:(e,t,n)=>{var r=n(75825),i=n(71309),o=n(30568);e.exports=function(e){return o(e)?r(e,!0):i(e)}},77875:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},69107:(e,t,n)=>{var r=n(29233),i=n(55833),o=n(78068),a=n(55589);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},61230:(e,t,n)=>{var r=n(87500),i=n(44003),o=n(55833);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}},56492:(e,t,n)=>{var r=n(85117),i=n(51669),o=n(80229);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},67997:(e,t,n)=>{var r=n(95678);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},88469:(e,t,n)=>{var r=n(92133),i=n(66948)((function(e,t,n){r(e,t,n)}));e.exports=i},65071:(e,t,n)=>{var r=n(85117),i=n(46718),o=n(80229);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},76838:(e,t,n)=>{var r=n(85117),i=n(55833),o=n(46718);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},71607:e=>{e.exports=function(){}},80231:(e,t,n)=>{var r=n(83250);e.exports=function(){return r.Date.now()}},49335:(e,t,n)=>{var r=n(21785),i=n(33273)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},94437:(e,t,n)=>{var r=n(86174),i=n(3293),o=n(5130),a=n(86040);e.exports=function(e){return o(e)?r(a(e)):i(e)}},38569:(e,t,n)=>{var r=n(51523)();e.exports=r},17682:(e,t,n)=>{var r=n(85115),i=n(61701),o=n(55833),a=n(34306),s=n(55589);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)}},26226:(e,t,n)=>{var r=n(32619);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},91039:(e,t,n)=>{var r=n(41351),i=n(87493),o=n(30568),a=n(76705),s=n(11324);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}},71635:(e,t,n)=>{var r=n(22825),i=n(54466),o=n(29735),a=n(98132),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},84506:e=>{e.exports=function(){return[]}},37999:e=>{e.exports=function(){return!1}},99558:(e,t,n)=>{var r=n(29153),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}},96843:(e,t,n)=>{var r=n(99558);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},29153:(e,t,n)=>{var r=n(21656),i=n(93702),o=n(52624),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}},59430:(e,t,n)=>{var r=n(29233),i=n(32166),o=n(55589),a=n(52624),s=n(44041),l=n(86040),u=n(99835);e.exports=function(e){return o(e)?r(e,l):a(e)?[e]:i(s(u(e)))}},36222:(e,t,n)=>{var r=n(78618),i=n(9882);e.exports=function(e){return r(e,i(e))}},99835:(e,t,n)=>{var r=n(86245);e.exports=function(e){return null==e?"":r(e)}},63604:(e,t,n)=>{var r=n(84004),i=n(57890),o=n(44003),a=n(55833),s=n(18490),l=n(55589),u=n(85778),c=n(45563),d=n(93702),f=n(50922);e.exports=function(e,t,n){var h=l(e),p=h||u(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}},27767:(e,t,n)=>{var r=n(22825),i=n(29735),o=n(80135),a=n(18268),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},61422:(e,t,n)=>{var r=n(99835),i=0;e.exports=function(e){var t=++i;return r(e)+t}},31682:(e,t,n)=>{var r=n(20071),i=n(62096);e.exports=function(e){return null==e?[]:r(e,i(e))}},54142:(e,t,n)=>{var r=n(93192),i=n(36302);e.exports=function(e,t){return i(e||[],t||[],r)}},33286:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>z,Component:()=>a.Component,Fragment:()=>a.Fragment,PureComponent:()=>M,StrictMode:()=>xe,Suspense:()=>U,SuspenseList:()=>H,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>de,cloneElement:()=>ve,createContext:()=>a.createContext,createElement:()=>a.createElement,createFactory:()=>he,createPortal:()=>K,createRef:()=>a.createRef,default:()=>we,findDOMNode:()=>ge,flushSync:()=>be,forwardRef:()=>B,hydrate:()=>ne,isValidElement:()=>pe,lazy:()=>q,memo:()=>R,render:()=>te,unmountComponentAtNode:()=>me,unstable_batchedUpdates:()=>ye,useCallback:()=>_,useContext:()=>E,useDebugValue:()=>k,useEffect:()=>g,useErrorBoundary:()=>N,useImperativeHandle:()=>x,useLayoutEffect:()=>y,useMemo:()=>w,useReducer:()=>m,useRef:()=>b,useState:()=>v,version:()=>fe});var r,i,o,a=n(75644),s=0,l=[],u=a.options.__b,c=a.options.__r,d=a.options.diffed,f=a.options.__c,h=a.options.unmount;function p(e,t){a.options.__h&&a.options.__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,m(D,e)}function m(e,t,n){var o=p(r++,2);return o.t=e,o.__c||(o.__=[n?n(t):D(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 g(e,t){var n=p(r++,3);!a.options.__s&&j(n.__H,t)&&(n.__=e,n.__H=t,i.__H.__h.push(n))}function y(e,t){var n=p(r++,4);!a.options.__s&&j(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,y((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 j(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.options.useDebugValue&&a.options.useDebugValue(t?t(e):e)}function N(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 S(){var e;for(l.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=l.pop();)if(e.__P)try{e.__H.__h.forEach(C),e.__H.__h.forEach(T),e.__H.__h=[]}catch(i){e.__H.__h=[],a.options.__e(i,e.__v)}}a.options.__b=function(e){i=null,u&&u(e)},a.options.__r=function(e){c&&c(e),r=0;var t=(i=e.__c).__H;t&&(t.__h.forEach(C),t.__h.forEach(T),t.__h=[])},a.options.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&o===a.options.requestAnimationFrame||((o=a.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),P&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);P&&(t=requestAnimationFrame(n))})(S)),i=null},a.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.options.__e(o,e.__v)}})),f&&f(e,t)},a.options.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),t&&a.options.__e(t,n.__v))};var P="function"==typeof requestAnimationFrame;function C(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function T(e){var t=i;e.__c=e.__(),i=t}function j(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function D(e,t){return"function"==typeof t?t(e):t}function O(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 R(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.createElement)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(M.prototype=new a.Component).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(e,t){return A(this.props,e)||A(this.state,t)};var I=a.options.__b;a.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),I&&I(e)};var L="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t,n){var r=O({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=L,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var F=function(e,t){return null==e?null:(0,a.toChildArray)((0,a.toChildArray)(e).map(t))},z={map:F,forEach:F,count:function(e){return e?(0,a.toChildArray)(e).length:0},only:function(e){var t=(0,a.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:a.toChildArray},V=a.options.__e;a.options.__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.options.unmount;function U(){this.__u=0,this.t=null,this.__b=null}function W(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function q(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.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function H(){this.u=null,this.o=null}a.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),G&&G(e)},(U.prototype=new a.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=W(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()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},U.prototype.componentWillUnmount=function(){this.t=[]},U.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=O({},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.createElement)(a.Fragment,null,e.fallback);return i&&(i.__h=null),[(0,a.createElement)(a.Fragment,null,t.__e?null:e.children),i]};var Y=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 $(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,a.render)(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.render)((0,a.createElement)(X,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function K(e,t){return(0,a.createElement)($,{__v:e,i:t})}(H.prototype=new a.Component).__e=function(e){var t=this,n=W(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Y(t,e,r)):i()};n?n(o):o()}},H.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,a.toChildArray)(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){Y(e,n,t)}))};var Z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Q=/^(?: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]/,J="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.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function ne(e,t,n){return(0,a.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}a.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(a.Component.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.options.event;function ie(){}function oe(){return this.cancelBubble}function ae(){return this.defaultPrevented}a.options.event=function(e){return re&&(e=re(e)),e.persist=ie,e.isPropagationStopped=oe,e.isDefaultPrevented=ae,e.nativeEvent=e};var se,le={configurable:!0,get:function(){return this.class}},ue=a.options.vnode;a.options.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];J&&"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&&Q.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.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,a.toChildArray)(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&&(le.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",le))}e.$$typeof=Z,ue&&ue(e)};var ce=a.options.__r;a.options.__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.createElement.bind(null,e)}function pe(e){return!!e&&e.$$typeof===Z}function ve(e){return pe(e)?a.cloneElement.apply(null,arguments):e}function me(e){return!!e.__k&&((0,a.render)(null,e),!0)}function ge(e){return e&&(e.base||1===e.nodeType&&e)||null}var ye=function(e,t){return e(t)},be=function(e,t){return e(t)},xe=a.Fragment;const we={useState:v,useReducer:m,useEffect:g,useLayoutEffect:y,useRef:b,useImperativeHandle:x,useMemo:w,useCallback:_,useContext:E,useDebugValue:k,version:"17.0.2",Children:z,render:te,hydrate:ne,unmountComponentAtNode:me,createPortal:K,createElement:a.createElement,createContext:a.createContext,createFactory:he,cloneElement:ve,createRef:a.createRef,Fragment:a.Fragment,isValidElement:pe,findDOMNode:ge,Component:a.Component,PureComponent:M,memo:R,forwardRef:B,flushSync:be,unstable_batchedUpdates:ye,StrictMode:a.Fragment,Suspense:U,SuspenseList:H,lazy:q,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:de}},75644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Component:()=>x,Fragment:()=>b,cloneElement:()=>V,createContext:()=>G,createElement:()=>m,createRef:()=>y,h:()=>m,hydrate:()=>z,isValidElement:()=>a,options:()=>i,render:()=>F,toChildArray:()=>P});var r,i,o,a,s,l,u,c,d={},f=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var n in t)e[n]=t[n];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function m(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:a??++o};return null==a&&null!=i.vnode&&i.vnode(s),s}function y(){return{current:null}}function b(e){return e.children}function x(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(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?w(e):null}function _(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 _(e)}}function E(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!k.__r++||u!==i.debounceRendering)&&((u=i.debounceRendering)||l)(k)}function k(){for(var e;k.__r=s.length;)e=s.sort((function(e,t){return e.__v.__b-t.__v.__b})),s=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=p({},i)).__v=i.__v+1,A(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,o??w(i),i.__h),M(n,i),i.__e!=o&&_(i)))}))}function N(e,t,n,r,i,o,a,s,l,u){var c,h,p,v,m,y,x,_=r&&r.__k||f,E=_.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(v=n.__k[c]=null==(v=t[c])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?g(null,v,null,null,v):Array.isArray(v)?g(b,{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=_[c])||p&&v.key==p.key&&v.type===p.type)_[c]=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}A(e,v,p=p||d,i,o,a,s,l,u),m=v.__e,(h=v.ref)&&p.ref!=h&&(x||(x=[]),p.ref&&x.push(p.ref,null,v),x.push(h,v.__c||m,v)),null!=m?(null==y&&(y=m),"function"==typeof v.type&&v.__k===p.__k?v.__d=l=S(v,l,e):l=C(e,v,p,_,m,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=w(p))}for(n.__e=y,c=E;c--;)null!=_[c]&&("function"==typeof n.type&&null!=_[c].__e&&_[c].__e==n.__d&&(n.__d=w(r,c+1)),L(_[c],_[c]));if(x)for(c=0;c<x.length;c++)I(x[c],x[++c],x[++c])}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,l;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,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function T(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function j(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||T(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||T(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?O:D,o):e.removeEventListener(t,o?O:D,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]=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 D(e){this.l[e.type+!1](i.event?i.event(e):e)}function O(e){this.l[e.type+!0](i.event?i.event(e):e)}function A(e,t,n,r,o,a,s,l,u){var c,d,f,h,v,m,g,y,w,_,E,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,l=t.__e=n.__e,t.__h=null,a=[l]),(c=i.__b)&&c(t);try{e:if("function"==typeof k){if(y=t.props,w=(c=k.contextType)&&r[c.__c],_=c?w?w.props.value:c.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(y,_):(t.__c=d=new x(y,_),d.constructor=k,d.render=B),w&&w.sub(d),d.props=y,d.state||(d.state={}),d.context=_,d.__n=r,f=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=p({},d.__s)),p(d.__s,k.getDerivedStateFromProps(y,d.__s))),h=d.props,v=d.state,f)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,_),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,_)||t.__v===n.__v){d.props=y,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(y,d.__s,_),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,v,m)}))}d.context=_,d.props=y,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=p(p({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(h,v)),E=null!=c&&c.type===b&&null==c.key?c.props.children:c,N(e,Array.isArray(E)?E:[E],t,n,r,o,a,s,l,u),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),g&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=R(n.__e,t,n,r,o,a,s,u);(c=i.diffed)&&c(t)}catch(e){t.__v=null,(u||null!=a)&&(t.__e=l,t.__h=!!u,a[a.indexOf(l)]=null),i.__e(e,t,n)}}function M(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 R(e,t,n,i,o,a,s,l){var u,c,f,h=n.props,p=t.props,m=t.type,g=0;if("svg"===m&&(o=!0),null!=a)for(;g<a.length;g++)if((u=a[g])&&"setAttribute"in u==!!m&&(m?u.localName===m:3===u.nodeType)){e=u,a[g]=null;break}if(null==e){if(null===m)return document.createTextNode(p);e=o?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,p.is&&p),a=null,l=!1}if(null===m)h===p||l&&e.data===p||(e.data=p);else{if(a=a&&r.call(e.childNodes),c=(h=n.props||d).dangerouslySetInnerHTML,f=p.dangerouslySetInnerHTML,!l){if(null!=a)for(h={},g=0;g<e.attributes.length;g++)h[e.attributes[g].name]=e.attributes[g].value;(f||c)&&(f&&(c&&f.__html==c.__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||j(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]||j(e,o,t[o],n[o],r)}(e,p,h,o,l),f)t.__k=[];else if(g=t.props.children,N(e,Array.isArray(g)?g:[g],t,n,i,o&&"foreignObject"!==m,a,s,a?a[0]:n.__k&&w(n,0),l),null!=a)for(g=a.length;g--;)null!=a[g]&&v(a[g]);l||("value"in p&&void 0!==(g=p.value)&&(g!==h.value||g!==e.value||"progress"===m&&!g)&&j(e,"value",g,h.value,!1),"checked"in p&&void 0!==(g=p.checked)&&g!==e.checked&&j(e,"checked",g,h.checked,!1))}return e}function I(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||I(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||v(e.__e),e.__e=e.__d=void 0}function B(e,t,n){return this.constructor(e,n)}function F(e,t,n){var o,a,s;i.__&&i.__(e,t),a=(o="function"==typeof n)?null:n&&n.__k||t.__k,s=[],A(t,e=(!o&&n||t).__k=m(b,null,[e]),a||d,d,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),M(s,e)}function z(e,t){F(e,t,z)}function V(e,t,n){var i,o,a,s=p({},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 G(e,t){var n={__c:t="__cC"+c++,__: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(E)},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=f.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,a=function(e){return null!=e&&void 0===e.constructor},x.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},n),this.props)),e&&p(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),E(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},x.prototype.render=b,s=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,k.__r=0,c=0},24232:(e,t,n)=>{"use strict";(function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=n(33286),r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function i(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];!function(e,t,n){var i=r.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var o=n.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,c=!1,d=!1;function f(e){var t=e.getSnapshot,n=e.value;try{var r=t();return!o(n,r)}catch(i){return!0}}var h=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,n){return t()}:function(t,n,r){c||void 0!==e.startTransition&&(c=!0,i("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=n();if(!d){var p=n();o(h,p)||(i("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var v=a({inst:{value:h,getSnapshot:n}}),m=v[0].inst,g=v[1];return l((function(){m.value=h,m.getSnapshot=n,f(m)&&g({inst:m})}),[t,h,n]),s((function(){f(m)&&g({inst:m});return t((function(){f(m)&&g({inst:m})}))}),[t]),u(h),h},p=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:h;t.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()},40043:(e,t,n)=>{"use strict";(function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=n(33286),r=n(83576);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,a=e.useRef,s=e.useEffect,l=e.useMemo,u=e.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,c){var d,f=a(null);null===f.current?(d={hasValue:!1,value:null},f.current=d):d=f.current;var h=l((function(){var e,o,a=!1,s=function(t){if(!a){a=!0,e=t;var n=r(t);if(void 0!==c&&d.hasValue){var s=d.value;if(c(s,n))return o=s,s}return o=n,n}var l=o;if(i(e,t))return l;var u=r(t);return void 0!==c&&c(l,u)?l:(e=t,o=u,u)},l=void 0===n?null:n;return[function(){return s(t())},null===l?void 0:function(){return s(l())}]}),[t,n,r,c]),p=h[0],v=h[1],m=o(e,p,v);return s((function(){d.hasValue=!0,d.value=m}),[m]),u(m),m},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()},83576:(e,t,n)=>{"use strict";e.exports=n(24232)},52014:(e,t,n)=>{"use strict";e.exports=n(40043)},71125:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createDeferredActor:()=>l,createInvocableActor:()=>s,createNullActor:()=>a,isActor:()=>u,isSpawnedActor:()=>c,toActorRef:()=>d});var r=n(86859),i=n(14487),o=n(21427);function a(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[i.symbolObservable]=function(){return this},t}function s(e,t,n,r){var o,s=(0,i.toInvokeSource)(e.src),u=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[s.type],c=e.data?(0,i.mapContext)(e.data,n,r):void 0,d=u?l(u,e.id,c):a(e.id);return d.meta=e,d}function l(e,t,n){var r=a(t);if(r.deferred=!0,(0,i.isMachine)(e)){var s=r.state=(0,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}}function c(e){return u(e)&&"id"in e}function d(e){var t;return(0,r.__assign)(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.symbolObservable]=function(){return this},t),e)}},93884:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Machine:()=>a,createMachine:()=>s});var r=n(90084),i=n(11293),o=!1;function a(e,t,n){return void 0===n&&(n=e.context),new r.StateNode(e,t,n)}function s(e,t){return i.IS_PRODUCTION||e.predictableActionArguments||o||(o=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new r.StateNode(e,t)}},64e3:(e,t,n)=>{"use strict";n.r(t),n.d(t,{State:()=>h,bindActionToState:()=>f,isState:()=>d,isStateConfig:()=>c,stateValuesEqual:()=>u});var r=n(86859),i=n(79308),o=n(14487),a=n(73340),s=n(19913),l=n(11293);function u(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if((0,o.isString)(e)||(0,o.isString)(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return u(e[n],t[n])}))}function c(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}var d=c;function f(e,t){var n=e.exec;return(0,r.__assign)((0,r.__assign)({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}var h=function(){function e(e){var t,n=this;this.actions=[],this.activities=i.EMPTY_ACTIVITY_MAP,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||i.EMPTY_ACTIVITY_MAP,this.meta=(0,a.getMeta)(e.configuration),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(0,a.nextEvents)(n.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:s.initEvent,_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=s.initEvent;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="."),(0,o.isString)(e))return[e];var i=Object.keys(e);return i.concat.apply(i,(0,r.__spreadArray)([],(0,r.__read)(i.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=(0,r.__rest)(e,["configuration","transitions","tags","machine"]);return(0,r.__assign)((0,r.__assign)({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return(0,o.matchesState)(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.IS_PRODUCTION&&(0,o.warn)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}()},90084:(e,t,n)=>{"use strict";n.r(t),n.d(t,{StateNode:()=>b});var r=n(86859),i=n(14487),o=n(71073),a=n(64e3),s=n(26426),l=n(19913),u=n(11293),c=n(79308),d=n(73340),f=n(71125);function h(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function p(e){return(0,r.__assign)((0,r.__assign)({type:s.invoke},e),{toJSON:function(){e.onDone,e.onError;var t=(0,r.__rest)(e,["onDone","onError"]);return(0,r.__assign)((0,r.__assign)({},t),{type:s.invoke,src:h(e.src)})}})}var v="",m="*",g={},y=function(e){return"#"===e[0]},b=function(){function e(t,n,o,a){void 0===o&&(o="context"in t?t.context:void 0);var s,f=this;this.config=t,this._context=o,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=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.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:c.STATE_DELIMITER),this.id=this.config.id||(0,r.__spreadArray)([this.machine.key],(0,r.__read)(this.path),!1).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&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(s=this.config.schema)&&void 0!==s?s:{},this.description=this.config.description,u.IS_PRODUCTION||(0,i.warn)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.mapValues)(this.config.states,(function(t,n){var i,o=new e(t,{},void 0,{parent:f,key:n});return Object.assign(f.idMap,(0,r.__assign)(((i={})[o.id]=o,i),o.idMap)),o})):g;var h=0;!function e(t){var n,i;t.order=h++;try{for(var o=(0,r.__values)((0,d.getAllChildren)(t)),a=o.next();!a.done;a=o.next()){e(a.value)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}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===v})):v in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.toArray)(this.config.entry||this.config.onEntry).map((function(e){return(0,l.toActionObject)(e)})),this.onExit=(0,i.toArray)(this.config.exit||this.config.onExit).map((function(e){return(0,l.toActionObject)(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.toArray)(this.config.invoke).map((function(e,t){var n,o;if((0,i.isMachine)(e)){var a=(0,i.createInvokeId)(f.id,t);return f.machine.options.services=(0,r.__assign)(((n={})[a]=e,n),f.machine.options.services),p({src:a,id:a})}if((0,i.isString)(e.src)){a=e.id||(0,i.createInvokeId)(f.id,t);return p((0,r.__assign)((0,r.__assign)({},e),{id:a,src:e.src}))}if((0,i.isMachine)(e.src)||(0,i.isFunction)(e.src)){a=e.id||(0,i.createInvokeId)(f.id,t);return f.machine.options.services=(0,r.__assign)(((o={})[a]=e.src,o),f.machine.options.services),p((0,r.__assign)((0,r.__assign)({id:a},e),{src:a}))}var s=e.src;return p((0,r.__assign)((0,r.__assign)({id:(0,i.createInvokeId)(f.id,t)},e),{src:s}))})),this.activities=(0,i.toArray)(this.config.activities).concat(this.invoke).map((function(e){return(0,l.toActivityDefinition)(e)})),this.transition=this.transition.bind(this),this.tags=(0,i.toArray)(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||(0,d.getAllStateNodes)(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:(0,r.__assign)((0,r.__assign)({},o),t.actions),activities:(0,r.__assign)((0,r.__assign)({},a),t.activities),guards:(0,r.__assign)((0,r.__assign)({},s),t.guards),services:(0,r.__assign)((0,r.__assign)({},l),t.services),delays:(0,r.__assign)((0,r.__assign)({},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(0,i.isFunction)(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:(0,i.mapValues)(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===v,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===m}));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=(0,i.isFunction)(t)?"".concat(e.id,":delay[").concat(n,"]"):t,o=(0,l.after)(r,e.id);return e.onEntry.push((0,l.send)(o,{delay:t})),e.onExit.push((0,l.cancel)(o)),o};return((0,i.isArray)(t)?t.map((function(e,t){var i=n(e.delay,t);return(0,r.__assign)((0,r.__assign)({},e),{event:i})})):(0,i.flatten)(Object.keys(t).map((function(e,o){var a=t[e],s=(0,i.isString)(a)?{target:a}:a,l=isNaN(+e)?e:+e,u=n(l,o);return(0,i.toArray)(s).map((function(e){return(0,r.__assign)((0,r.__assign)({},e),{event:u,delay:l})}))})))).map((function(t){var n=t.delay;return(0,r.__assign)((0,r.__assign)({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var o=e instanceof a.State?e.value:(0,i.toStateValue)(e,this.delimiter);if((0,i.isString)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((t={})[o]=s,t)):[this,this.states[o]]}var l=Object.keys(o),u=[this];return u.push.apply(u,(0,r.__spreadArray)([],(0,r.__read)((0,i.flatten)(l.map((function(e){return n.getStateNode(e).getStateNodes(o[e])})))),!1)),u},e.prototype.handles=function(e){var t=(0,i.getEventType)(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.State?e:a.State.create(e),n=Array.from((0,d.getConfiguration)([],this.getStateNodes(t.value)));return new a.State((0,r.__assign)((0,r.__assign)({},t),{value:this.resolve(t.value),configuration:n,done:(0,d.isInFinalState)(n,this),tags:(0,d.getTagsFromConfiguration)(n),machine:this.machine}))},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=Object.keys(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 o,a,s={};try{for(var l=(0,r.__values)(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e[c];if(d){var f=this.getStateNode(c)._transition(d,t,n);f&&(s[c]=f)}}}catch(g){o={error:g}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}var h=Object.keys(s).map((function(e){return s[e]})),p=(0,i.flatten)(h.map((function(e){return e.transitions})));if(!h.some((function(e){return e.transitions.length>0})))return this.next(t,n);var v=(0,i.flatten)(h.map((function(e){return e.entrySet}))),m=(0,i.flatten)(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:p,entrySet:v,exitSet:(0,i.flatten)(h.map((function(e){return e.exitSet}))),configuration:m,source:t,actions:(0,i.flatten)(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,n){return(0,i.isString)(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,(0,i.toSCXMLEvent)(t))},e.prototype.next=function(e,t){var n,o,a,s=this,l=t.name,u=[],c=[];try{for(var d=(0,r.__values)(this.getCandidates(l)),f=d.next();!f.done;f=d.next()){var h=f.value,p=h.cond,v=h.in,m=e.context,g=!v||((0,i.isString)(v)&&y(v)?e.matches((0,i.toStateValue)(this.getStateNodeById(v).path,this.delimiter)):(0,i.matchesState)((0,i.toStateValue)(v,this.delimiter),(0,i.path)(this.path.slice(0,-2))(e.value))),b=!1;try{b=!p||(0,i.evaluateGuard)(this.machine,p,m,t,e)}catch(E){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(E.message))}if(b&&g){void 0!==h.target&&(c=h.target),u.push.apply(u,(0,r.__spreadArray)([],(0,r.__read)(h.actions),!1)),a=h;break}}}catch(k){n={error:k}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}if(a){if(!c.length)return{transitions:[a],entrySet:[],exitSet:[],configuration:e.value?[this]:[],source:e,actions:u};var x=(0,i.flatten)(c.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)}))),w=!!a.internal,_=[];return w||c.forEach((function(e){_.push.apply(_,(0,r.__spreadArray)([],(0,r.__read)(s.getExternalReentryNodes(e)),!1))})),{transitions:[a],entrySet:_,exitSet:w?[]:[this],configuration:x,source:e,actions:u}}},e.prototype.getExternalReentryNodes=function(e){for(var t=[],n=(0,r.__read)(e.order>this.order?[e,this]:[this,e],2),i=n[0],o=n[1];i&&i!==o;)t.push(i),i=i.parent;return i!==o?[]:(t.push(o),t)},e.prototype.getActions=function(e,t,n,a,u,c,f){var h,p,v,m,g=this,y=(0,d.getConfiguration)([],c?this.getStateNodes(c.value):[this]);try{for(var b=(0,r.__values)(e),x=b.next();!x.done;x=b.next()){var w=x.value;(!(0,d.has)(y,w)||(0,d.has)(n.entrySet,w.parent)&&!(0,d.has)(n.entrySet,w))&&n.entrySet.push(w)}}catch(j){h={error:j}}finally{try{x&&!x.done&&(p=b.return)&&p.call(b)}finally{if(h)throw h.error}}try{for(var _=(0,r.__values)(y),E=_.next();!E.done;E=_.next()){w=E.value;(0,d.has)(e,w)&&!(0,d.has)(n.exitSet,w.parent)||n.exitSet.push(w)}}catch(D){v={error:D}}finally{try{E&&!E.done&&(m=_.return)&&m.call(_)}finally{if(v)throw v.error}}var k=(0,i.flatten)(n.entrySet.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push((0,l.done)(e.id,e.doneData),(0,l.done)(r.id,e.doneData?(0,i.mapContext)(e.doneData,a,u):void 0));var o=r.parent;return"parallel"===o.type&&(0,d.getChildren)(o).every((function(e){return(0,d.isInFinalState)(n.configuration,e)}))&&t.push((0,l.done)(o.id)),t})));n.exitSet.sort((function(e,t){return t.order-e.order})),n.entrySet.sort((function(e,t){return e.order-t.order}));var N=new Set(n.entrySet),S=new Set(n.exitSet),P=Array.from(N).map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return(0,l.start)(e)}));return(0,l.toActionObjects)(f?(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(t),!1),(0,r.__read)(n),!1):(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(n),!1),(0,r.__read)(t),!1),g.machine.options.actions)})).concat([k.map(l.raise)]),C=Array.from(S).map((function(e){return(0,l.toActionObjects)((0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(e.onExit),!1),(0,r.__read)(e.activities.map((function(e){return(0,l.stop)(e)}))),!1),g.machine.options.actions)})).concat([(0,l.toActionObjects)(n.actions,this.machine.options.actions)]).concat(P);if(t){var T=(0,l.toActionObjects)((0,i.flatten)((0,r.__spreadArray)([],(0,r.__read)(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return e.type!==s.raise&&(e.type!==s.send||!!e.to&&e.to!==o.SpecialTargets.Internal)}));return C.concat([T])}return C},e.prototype.transition=function(e,t,n,o){void 0===e&&(e=this.initialState);var s,l=(0,i.toSCXMLEvent)(t);if(e instanceof a.State)s=void 0===n?e:this.resolveState(a.State.from(e,n));else{var c=(0,i.isString)(e)?this.resolve((0,i.pathToStateValue)(this.getResolvedPath(e))):this.resolve(e),f=null!=n?n:this.machine.context;s=this.resolveState(a.State.from(c,f))}if(!u.IS_PRODUCTION&&l.name===m)throw new Error("An event cannot have the wildcard type ('".concat(m,"')"));if(this.strict&&!this.events.includes(l.name)&&!(0,i.isBuiltInEvent)(l.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(l.name,"'"));var h=this._transition(s.value,s,l)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:s,actions:[]},p=(0,d.getConfiguration)([],this.getStateNodes(s.value)),v=h.configuration.length?(0,d.getConfiguration)(p,h.configuration):p;return h.configuration=(0,r.__spreadArray)([],(0,r.__read)(v),!1),this.resolveTransition(h,s,s.context,o,l)},e.prototype.resolveRaisedTransition=function(e,t,n,i){var o,a=e.actions;return(e=this.transition(e,t,void 0,i))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,(0,r.__spreadArray)([],(0,r.__read)(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,u,c){var h,p,m,g,y=this;void 0===c&&(c=l.initEvent);var b=e.configuration,x=!t||e.transitions.length>0,w=x?e.configuration:t?t.configuration:[],_=(0,d.isInFinalState)(w,this),E=x?(0,d.getValue)(this.machine,b):void 0,k=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,N=this.getActions(new Set(w),_,e,n,c,t,u),S=t?(0,r.__assign)({},t.activities):{};try{for(var P=(0,r.__values)(N),C=P.next();!C.done;C=P.next()){var T=C.value;try{for(var j=(m=void 0,(0,r.__values)(T)),D=j.next();!D.done;D=j.next()){var O=D.value;O.type===s.start?S[O.activity.id||O.activity.type]=O:O.type===s.stop&&(S[O.activity.id||O.activity.type]=!1)}}catch(X){m={error:X}}finally{try{D&&!D.done&&(g=j.return)&&g.call(j)}finally{if(m)throw m.error}}}}catch($){h={error:$}}finally{try{C&&!C.done&&(p=P.return)&&p.call(P)}finally{if(h)throw h.error}}var A=(0,r.__read)((0,l.resolveActions)(this,t,n,c,N,u,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=A[0],R=A[1],I=(0,r.__read)((0,i.partition)(M,(function(e){return e.type===s.raise||e.type===s.send&&e.to===o.SpecialTargets.Internal})),2),L=I[0],B=I[1],F=M.filter((function(e){var t;return e.type===s.start&&(null===(t=e.activity)||void 0===t?void 0:t.type)===s.invoke})),z=F.reduce((function(e,t){return e[t.activity.id]=(0,f.createInvocableActor)(t.activity,y.machine,R,c),e}),t?(0,r.__assign)({},t.children):{}),V=new a.State({value:E||t.value,context:R,_event:c,_sessionid:t?t._sessionid:null,historyValue:E?k?(0,i.updateHistoryValue)(k,E):void 0:t?t.historyValue:void 0,history:!E||e.source?t:void 0,actions:E?B:[],activities:E?S:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:z,done:_,tags:(0,d.getTagsFromConfiguration)(w),machine:this}),G=n!==R;V.changed=c.name===s.update||G;var U=V.history;U&&delete U.history;var W=!_&&(this._transient||b.some((function(e){return e._transient})));if(!(x||W&&c.name!==v))return V;var q=V;if(!_)for(W&&(q=this.resolveRaisedTransition(q,{type:s.nullEvent},c,u));L.length;){var H=L.shift();q=this.resolveRaisedTransition(q,H._event,c,u)}var Y=q.changed||(U?!!q.actions.length||G||typeof U.value!=typeof q.value||!(0,a.stateValuesEqual)(q.value,U.value):void 0);return q.changed=Y,q.history=U,q},e.prototype.getStateNode=function(e){if(y(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=y(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&y(e))try{return this.getStateNodeById(e.slice(1))}catch(o){}for(var t=(0,i.toStatePath)(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||g;switch(this.type){case"parallel":return(0,i.mapValues)(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):g}));case"compound":if((0,i.isString)(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?(0,i.mapValues)(e,(function(e,t){return e?n.getStateNode(t).resolve(e):g})):this.initialStateValue||{};default:return e||g}},e.prototype.getResolvedPath=function(e){if(y(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return(0,i.toStatePath)(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=(0,i.mapFilterValues)(this.states,(function(e){return e.initialStateValue||g}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=(0,d.isLeafNode)(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){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(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=(0,i.isString)(t.target)&&y(t.target)?(0,i.pathToStateValue)(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;if((0,d.isLeafNode)(this))return[this];if("compound"===this.type&&!this.initial)return u.IS_PRODUCTION||(0,i.warn)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=(0,i.toStatePaths)(this.initialStateValue);return(0,i.flatten)(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=(0,r.__read)(e),n=t[0],i=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:(0,i.mapFilterValues)(this.states,(function(t,n){if(!e)return t.historyValue();var r=(0,i.isString)(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?(0,i.flatten)((0,i.toStatePaths)(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o=(0,i.nestedPath)(n.path,"states")(e).current;return(0,i.isString)(o)?[n.getStateNode(o)]:(0,i.flatten)((0,i.toStatePaths)(o).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=(0,i.flatten)(Object.keys(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,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=(0,r.__values)(Object.keys(o)),l=s.next();!l.done;l=s.next()){var u=o[l.value];if(u.states)try{for(var c=(n=void 0,(0,r.__values)(u.events)),d=c.next();!d.done;d=c.next()){var f=d.value;a.add("".concat(f))}}catch(h){n={error:h}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(p){e={error:p}}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(!(0,i.isString)(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(o){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(o.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=(0,i.normalizeTarget)(e.target),o="internal"in e?e.internal:!n||n.some((function(e){return(0,i.isString)(e)&&e[0]===t.delimiter})),a=this.machine.options.guards,s=this.resolveTarget(n),u=(0,r.__assign)((0,r.__assign)({},e),{actions:(0,l.toActionObjects)((0,i.toArray)(e.actions)),cond:(0,i.toGuard)(e.cond,a),target:s,source:this,internal:o,eventType:e.event,toJSON:function(){return(0,r.__assign)((0,r.__assign)({},u),{target:u.target?u.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return u},e.prototype.formatTransitions=function(){var e,t,n,o=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,s=m,c=a[s],d=void 0===c?[]:c,f=(0,r.__rest)(a,["*"]);n=(0,i.flatten)(Object.keys(f).map((function(e){u.IS_PRODUCTION||e!==v||(0,i.warn)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(o.id,'".'));var t=(0,i.toTransitionConfigArray)(e,f[e]);return u.IS_PRODUCTION||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&((0,i.isString)(e.target)||(0,i.isMachine)(e.target))})),o=t===v?"the transient event":"event '".concat(t,"'");(0,i.warn)(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(o,e,t),t})).concat((0,i.toTransitionConfigArray)(m,d)))}else n=[];var h=this.config.always?(0,i.toTransitionConfigArray)("",this.config.always):[],p=this.config.onDone?(0,i.toTransitionConfigArray)(String((0,l.done)(this.id)),this.config.onDone):[];u.IS_PRODUCTION||(0,i.warn)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var g=(0,i.flatten)(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,(0,r.__spreadArray)([],(0,r.__read)((0,i.toTransitionConfigArray)(String((0,l.doneInvoke)(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,(0,r.__spreadArray)([],(0,r.__read)((0,i.toTransitionConfigArray)(String((0,l.error)(e.id)),e.onError)),!1)),t}))),y=this.after,b=(0,i.flatten)((0,r.__spreadArray)((0,r.__spreadArray)((0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(p),!1),(0,r.__read)(g),!1),(0,r.__read)(n),!1),(0,r.__read)(h),!1).map((function(e){return(0,i.toArray)(e).map((function(e){return o.formatTransition(e)}))})));try{for(var x=(0,r.__values)(y),w=x.next();!w.done;w=x.next()){var _=w.value;b.push(_)}}catch(E){e={error:E}}finally{try{w&&!w.done&&(t=x.return)&&t.call(x)}finally{if(e)throw e.error}}return b},e}()},86859:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>r,__read:()=>a,__rest:()=>i,__spreadArray:()=>s,__values:()=>o});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(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}},26426:(e,t,n)=>{"use strict";n.r(t),n.d(t,{after:()=>d,assign:()=>c,cancel:()=>l,choose:()=>x,doneState:()=>f,error:()=>y,errorExecution:()=>m,errorPlatform:()=>g,init:()=>p,invoke:()=>v,log:()=>h,nullEvent:()=>u,pure:()=>w,raise:()=>a,send:()=>s,start:()=>i,stop:()=>o,update:()=>b});var r=n(71073),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,h=r.ActionTypes.Log,p=r.ActionTypes.Init,v=r.ActionTypes.Invoke,m=r.ActionTypes.ErrorExecution,g=r.ActionTypes.ErrorPlatform,y=r.ActionTypes.ErrorCustom,b=r.ActionTypes.Update,x=r.ActionTypes.Choose,w=r.ActionTypes.Pure},19913:(e,t,n)=>{"use strict";n.r(t),n.d(t,{actionTypes:()=>o,after:()=>j,assign:()=>C,cancel:()=>k,choose:()=>L,done:()=>D,doneInvoke:()=>O,error:()=>A,escalate:()=>I,forwardTo:()=>R,getActionFunction:()=>u,initEvent:()=>l,isActionObject:()=>T,log:()=>_,pure:()=>M,raise:()=>h,resolveActions:()=>F,resolveLog:()=>E,resolveRaise:()=>p,resolveSend:()=>m,resolveStop:()=>P,respond:()=>x,send:()=>v,sendParent:()=>g,sendTo:()=>y,sendUpdate:()=>b,start:()=>N,stop:()=>S,toActionObject:()=>c,toActionObjects:()=>d,toActivityDefinition:()=>f});var r=n(86859),i=n(71073),o=n(26426),a=n(14487),s=n(11293),l=(0,a.toSCXMLEvent)({type:o.init});function u(e,t){return t&&t[e]||void 0}function c(e,t){var n;if((0,a.isString)(e)||"number"==typeof e){var i=u(e,t);n=(0,a.isFunction)(i)?{type:e,exec:i}:i||{type:e,exec:void 0}}else if((0,a.isFunction)(e))n={type:e.name||e.toString(),exec:e};else{i=u(e.type,t);if((0,a.isFunction)(i))n=(0,r.__assign)((0,r.__assign)({},e),{exec:i});else if(i){var o=i.type||e.type;n=(0,r.__assign)((0,r.__assign)((0,r.__assign)({},i),e),{type:o})}else n=e}return n}var d=function(e,t){return e?((0,a.isArray)(e)?e:[e]).map((function(e){return c(e,t)})):[]};function f(e){var t=c(e);return(0,r.__assign)((0,r.__assign)({id:(0,a.isString)(e)?e:t.id},t),{type:t.type})}function h(e){return(0,a.isString)(e)?{type:o.raise,event:e}:v(e,{to:i.SpecialTargets.Internal})}function p(e){return{type:o.raise,_event:(0,a.toSCXMLEvent)(e.event)}}function v(e,t){return{to:t?t.to:void 0,type:o.send,event:(0,a.isFunction)(e)?e:(0,a.toEventObject)(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:(0,a.isFunction)(e)?e.name:(0,a.getEventType)(e)}}function m(e,t,n,i){var o,s={_event:n},l=(0,a.toSCXMLEvent)((0,a.isFunction)(e.event)?e.event(t,n.data,s):e.event);if((0,a.isString)(e.delay)){var u=i&&i[e.delay];o=(0,a.isFunction)(u)?u(t,n.data,s):u}else o=(0,a.isFunction)(e.delay)?e.delay(t,n.data,s):e.delay;var c=(0,a.isFunction)(e.to)?e.to(t,n.data,s):e.to;return(0,r.__assign)((0,r.__assign)({},e),{to:c,_event:l,event:l.data,delay:o})}function g(e,t){return v(e,(0,r.__assign)((0,r.__assign)({},t),{to:i.SpecialTargets.Parent}))}function y(e,t,n){return v(t,(0,r.__assign)((0,r.__assign)({},n),{to:e}))}function b(){return g(o.update)}function x(e,t){return v(e,(0,r.__assign)((0,r.__assign)({},t),{to:function(e,t,n){return n._event.origin}}))}var w=function(e,t){return{context:e,event:t}};function _(e,t){return void 0===e&&(e=w),{type:o.log,label:t,expr:e}}var E=function(e,t,n){return(0,r.__assign)((0,r.__assign)({},e),{value:(0,a.isString)(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},k=function(e){return{type:o.cancel,sendId:e}};function N(e){var t=f(e);return{type:i.ActionTypes.Start,activity:t,exec:void 0}}function S(e){var t=(0,a.isFunction)(e)?e:f(e);return{type:i.ActionTypes.Stop,activity:t,exec:void 0}}function P(e,t,n){var r=(0,a.isFunction)(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:i.ActionTypes.Stop,activity:o}}var C=function(e){return{type:o.assign,assignment:e}};function T(e){return"object"==typeof e&&"type"in e}function j(e,t){var n=t?"#".concat(t):"";return"".concat(i.ActionTypes.After,"(").concat(e,")").concat(n)}function D(e,t){var n="".concat(i.ActionTypes.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function O(e,t){var n="".concat(i.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function A(e,t){var n="".concat(i.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function M(e){return{type:i.ActionTypes.Pure,get:e}}function R(e,t){if(!(s.IS_PRODUCTION||e&&"function"!=typeof e)){var n=e;e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i="function"==typeof n?n.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(e),!1)):n;if(!i)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return i}}return v((function(e,t){return t}),(0,r.__assign)((0,r.__assign)({},t),{to:e}))}function I(e,t){return g((function(t,n,r){return{type:o.error,data:(0,a.isFunction)(e)?e(t,n,r):e}}),(0,r.__assign)((0,r.__assign)({},t),{to:i.SpecialTargets.Parent}))}function L(e){return{type:i.ActionTypes.Choose,conds:e}}var B=function(e){var t,n,i=[];try{for(var a=(0,r.__values)(e),s=a.next();!s.done;s=a.next())for(var l=s.value,u=0;u<l.length;)l[u].type!==o.assign?u++:(i.push(l[u]),l.splice(u,1))}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i};function F(e,t,n,l,u,f,h){void 0===h&&(h=!1);var v=h?[]:B(u),g=v.length?(0,a.updateContext)(n,l,v,t):n,y=h?[n]:void 0,b=[];function x(u){var v;switch(u.type){case o.raise:return p(u);case o.send:var x=m(u,g,l,e.options.delays);return s.IS_PRODUCTION||(0,a.warn)(!(0,a.isString)(u.delay)||"number"==typeof x.delay,"No delay reference for delay expression '".concat(u.delay,"' was found on machine '").concat(e.id,"'")),f&&x.to!==i.SpecialTargets.Internal&&b.push(x),x;case o.log:var w=E(u,g,l);return null==f||f(w,g,l),w;case o.choose:if(!(S=null===(v=u.conds.find((function(n){var r=(0,a.toGuard)(n.cond,e.options.guards);return!r||(0,a.evaluateGuard)(e,r,g,l,f?void 0:t)})))||void 0===v?void 0:v.actions))return[];var _=(0,r.__read)(F(e,t,g,l,[d((0,a.toArray)(S),e.options.actions)],f,h),2),k=_[0],N=_[1];return g=N,null==y||y.push(g),k;case o.pure:var S;if(!(S=u.get(g,l.data)))return[];var C=(0,r.__read)(F(e,t,g,l,[d((0,a.toArray)(S),e.options.actions)],f,h),2),T=C[0],j=C[1];return g=j,null==y||y.push(g),T;case o.stop:w=P(u,g,l);return null==f||f(w,n,l),w;case o.assign:g=(0,a.updateContext)(g,l,[u],f?void 0:t),null==y||y.push(g);break;default:var D=c(u,e.options.actions),O=D.exec;if(f)f(D,g,l);else if(O&&y){var A=y.length-1;D=(0,r.__assign)((0,r.__assign)({},D),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];O.apply(void 0,(0,r.__spreadArray)([y[A]],(0,r.__read)(t),!1))}})}return D}}return[(0,a.flatten)(u.map((function(e){var t,n,i=[];try{for(var o=(0,r.__values)(e),a=o.next();!a.done;a=o.next()){var s=x(a.value);s&&(i=i.concat(s))}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return b.forEach((function(e){f(e,g,l)})),b.length=0,i}))),g]}},62539:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromPromise:()=>s,fromReducer:()=>a,spawnBehavior:()=>l});var r=n(19913),i=n(71125),o=n(14487);function a(e,t){return{transition:e,initialState:t}}function s(e){var t={error:void 0,data:void 0,status:"pending"};return{transition:function(e,t,n){var i=n.parent,o=n.id,a=n.observers;switch(t.type){case"fulfill":return null==i||i.send((0,r.doneInvoke)(o,t.data)),{error:void 0,data:t.data,status:"fulfilled"};case"reject":return null==i||i.send((0,r.error)(o,t.error)),a.forEach((function(e){e.error(t.error)})),{error:t.error,data:void 0,status:"rejected"};default:return e}},initialState:t,start:function(n){var r=n.self;return e().then((function(e){r.send({type:"fulfill",data:e})}),(function(e){r.send({type:"reject",error:e})})),t}}}function l(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,a=[],s=!1,l=(0,i.toActorRef)({id:t.id,send:function(t){a.push(t),function(){if(!s){for(s=!0;a.length>0;){var t=a.shift();n=e.transition(n,t,u),r.forEach((function(e){return e.next(n)}))}s=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,i){var a=(0,o.toObserver)(e,t,i);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),u={parent:t.parent,self:l,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,l}},79308:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_GUARD_TYPE:()=>o,EMPTY_ACTIVITY_MAP:()=>i,STATE_DELIMITER:()=>r,TARGETLESS_KEY:()=>a});var r=".",i={},o="xstate.guard",a=""},11293:(e,t,n)=>{"use strict";n.r(t),n.d(t,{IS_PRODUCTION:()=>r});var r=!1},92185:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionTypes:()=>m.ActionTypes,Interpreter:()=>o.Interpreter,InterpreterStatus:()=>o.InterpreterStatus,Machine:()=>a.Machine,SpecialTargets:()=>m.SpecialTargets,State:()=>c.State,StateNode:()=>p.StateNode,actions:()=>r,assign:()=>g,createMachine:()=>a.createMachine,createSchema:()=>f,doneInvoke:()=>E,forwardTo:()=>_,interpret:()=>o.interpret,mapState:()=>u,matchState:()=>d,matchesState:()=>l.matchesState,raise:()=>k,send:()=>y,sendParent:()=>x,sendTo:()=>b,sendUpdate:()=>w,spawn:()=>o.spawn,spawnBehavior:()=>v.spawnBehavior,t:()=>h,toActorRef:()=>i.toActorRef,toEventObject:()=>l.toEventObject,toObserver:()=>l.toObserver,toSCXMLEvent:()=>l.toSCXMLEvent});var r=n(19913),i=n(71125),o=n(26916),a=n(93884),s=n(86859),l=n(14487);function u(e,t){var n,r,i;try{for(var o=(0,s.__values)(Object.keys(e)),a=o.next();!a.done;a=o.next()){var u=a.value;(0,l.matchesState)(u,t)&&(!i||t.length>i.length)&&(i=u)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e[i]}var c=n(64e3);function d(e,t,n){var r,i,o=c.State.from(e,e instanceof c.State?e.context:void 0);try{for(var a=(0,s.__values)(t),l=a.next();!l.done;l=a.next()){var u=(0,s.__read)(l.value,2),d=u[0],f=u[1];if(o.matches(d))return f(o)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n(o)}function f(e){return e}var h=f,p=n(90084),v=n(62539),m=n(71073),g=r.assign,y=r.send,b=r.sendTo,x=r.sendParent,w=r.sendUpdate,_=r.forwardTo,E=r.doneInvoke,k=r.raise},26916:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Interpreter:()=>N,InterpreterStatus:()=>w,interpret:()=>C,spawn:()=>P});var r=n(86859),i=n(71073),o=n(64e3),a=n(26426),s=n(19913),l=n(11293),u=n(14487),c={deferEvents:!1},d=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,r.__assign)((0,r.__assign)({},c),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}(),f=n(71125),h=new Map,p=0,v=function(){return"x:".concat(p++)},m=function(e,t){return h.set(e,t),e},g=function(e){return h.get(e)},y=function(e){h.delete(e)};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(l.IS_PRODUCTION||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function x(e){if(b()){var t=function(){var e=b();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}var w,_=n(21427),E=n(62539),k={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(w||(w={}));var N=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var o=this;this.machine=t,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=w.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if((0,u.isArray)(e))return o.batch(e),o.state;var n=(0,u.toSCXMLEvent)((0,u.toEventObject)(e,t));if(o.status===w.Stopped)return l.IS_PRODUCTION||(0,u.warn)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(o.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),o.state;if(o.status!==w.Running&&!o.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(o.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return o.scheduler.schedule((function(){o.forward(n);var e=o._nextState(n);o.update(e,n)})),o._state},this.sendTo=function(e,t,n){var c=o.parent&&(t===i.SpecialTargets.Parent||o.parent.id===t),d=c?o.parent:(0,u.isString)(t)?o.children.get(t)||g(t):(0,u.isActor)(t)?t:void 0;if(d)if("machine"in d){if(o.status!==w.Stopped||o.parent!==d||o.state.done){var f=(0,r.__assign)((0,r.__assign)({},e),{name:e.name===a.error?"".concat((0,s.error)(o.id)):e.name,origin:o.sessionId});!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,f]):d.send(f)}}else!n&&o.machine.config.predictableActionArguments?o._outgoingQueue.push([d,e.data]):d.send(e.data);else{if(!c)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(o.id,"'."));l.IS_PRODUCTION||(0,u.warn)(!1,"Service '".concat(o.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,r){void 0===r&&(r=o.machine.options.actions);var c=e.exec||(0,s.getActionFunction)(e.type,r),d=(0,u.isFunction)(c)?c:c?c.exec:e.exec;if(d)try{return d(t,n.data,o.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:o.state,_event:n})}catch(N){throw o.parent&&o.parent.send({type:"xstate.error",data:N}),N}switch(e.type){case a.send:var f=e;if("number"==typeof f.delay)return void o.defer(f);f.to?o.sendTo(f._event,f.to,n===s.initEvent):o.send(f._event);break;case a.cancel:o.cancel(e.sendId);break;case a.start:if(o.status!==w.Running)return;var h=e.activity;if(!o.machine.config.predictableActionArguments&&!o.state.activities[h.id||h.type])break;if(h.type===i.ActionTypes.Invoke){var p=(0,u.toInvokeSource)(h.src),v=o.machine.options.services?o.machine.options.services[p.type]:void 0,m=h.id,g=h.data;l.IS_PRODUCTION||(0,u.warn)(!("forward"in h),"`forward` property is deprecated (found in invocation of '".concat(h.src,"' in in machine '").concat(o.machine.id,"'). ")+"Please use `autoForward` instead.");var y="autoForward"in h?h.autoForward:!!h.forward;if(!v)return void(l.IS_PRODUCTION||(0,u.warn)(!1,"No service found for invocation '".concat(h.src,"' in machine '").concat(o.machine.id,"'.")));var b=g?(0,u.mapContext)(g,t,n):void 0;if("string"==typeof v)return;var x=(0,u.isFunction)(v)?v(t,n.data,{data:b,src:p,meta:h.meta}):v;if(!x)return;var _=void 0;(0,u.isMachine)(x)&&(x=b?x.withContext(b):x,_={autoForward:y}),o.spawn(x,m,_)}else o.spawnActivity(h);break;case a.stop:o.stopChild(e.activity.id);break;case a.log:var E=e.label,k=e.value;E?o.logger(E,k):o.logger(k);break;default:l.IS_PRODUCTION||(0,u.warn)(!1,"No implementation found for action type '".concat(e.type,"'"))}};var c=(0,r.__assign)((0,r.__assign)({},e.defaultOptions),n),f=c.clock,h=c.logger,p=c.parent,m=c.id,y=void 0!==m?m:t.id;this.id=y,this.logger=h,this.clock=f,this.parent=p,this.options=c,this.scheduler=new d({deferEvents:this.options.deferEvents}),this.sessionId=v()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:(0,_.provide)(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return l.IS_PRODUCTION||(0,u.warn)(this.status!==w.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,i;try{for(var o=(0,r.__values)(e.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,e,t)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,i,o,a,l,c,d,f,h=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==s.initEvent||!this.options.execute)for(var p=void 0;p=this._outgoingQueue.shift();)p[0].send(p[1]);else this.execute(this.state);if(this.children.forEach((function(e){h.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var v=(0,r.__values)(this.eventListeners),m=v.next();!m.done;m=v.next()){(0,m.value)(e.event)}}catch(N){n={error:N}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var g=(0,r.__values)(this.listeners),y=g.next();!y.done;y=g.next()){(0,y.value)(e,e.event)}}catch(S){o={error:S}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var b=(0,r.__values)(this.contextListeners),x=b.next();!x.done;x=b.next()){(0,x.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(P){l={error:P}}finally{try{x&&!x.done&&(c=b.return)&&c.call(b)}finally{if(l)throw l.error}}if(this.state.done){var w=e.configuration.find((function(e){return"final"===e.type&&e.parent===h.machine})),_=w&&w.doneData?(0,u.mapContext)(w.doneData,e.context,t):void 0;try{for(var E=(0,r.__values)(this.doneListeners),k=E.next();!k.done;k=E.next()){(0,k.value)((0,s.doneInvoke)(this.id,_))}}catch(C){d={error:C}}finally{try{k&&!k.done&&(f=E.return)&&f.call(E)}finally{if(d)throw d.error}}this._stop(),this._stopChildren()}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===w.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=(0,u.toObserver)(e,t,n);this.listeners.add(i.next),this.status!==w.NotStarted&&i.next(this.state);var o=function(){r.doneListeners.delete(o),r.stopListeners.delete(o),i.complete()};return this.status===w.Stopped?i.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(o),r.stopListeners.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===w.Running)return this;this.machine._init(),m(this.sessionId,this),this.initialized=!0,this.status=w.Running;var n=void 0===e?this.initialState:(0,_.provide)(this,(function(){return(0,o.isStateConfig)(e)?t.machine.resolveState(e):t.machine.resolveState(o.State.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,s.initEvent)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){(0,u.isFunction)(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,i,o,a,s,l,u,c;try{for(var f=(0,r.__values)(this.listeners),h=f.next();!h.done;h=f.next()){var p=h.value;this.listeners.delete(p)}}catch(N){e={error:N}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var v=(0,r.__values)(this.stopListeners),m=v.next();!m.done;m=v.next()){(p=m.value)(),this.stopListeners.delete(p)}}catch(S){n={error:S}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var g=(0,r.__values)(this.contextListeners),y=g.next();!y.done;y=g.next()){p=y.value;this.contextListeners.delete(p)}}catch(P){o={error:P}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var b=(0,r.__values)(this.doneListeners),x=b.next();!x.done;x=b.next()){p=x.value;this.doneListeners.delete(p)}}catch(C){s={error:C}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=w.Stopped,this._initialState=void 0;try{for(var _=(0,r.__values)(Object.keys(this.delayedEventsMap)),E=_.next();!E.done;E=_.next()){var k=E.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(T){u={error:T}}finally{try{E&&!E.done&&(c=_.return)&&c.call(_)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new d({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t=(0,u.toSCXMLEvent)({type:"xstate.stop"}),n=(0,_.provide)(e,(function(){var n=(0,u.flatten)((0,r.__spreadArray)([],(0,r.__read)(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return(0,s.toActionObjects)(t.onExit,e.machine.options.actions)}))),l=(0,r.__read)((0,s.resolveActions)(e.machine,e.state,e.state.context,t,[n],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),c=l[0],d=l[1],f=new o.State({value:e.state.value,context:d,_event:t,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:c.filter((function(e){return e.type!==a.raise&&(e.type!==a.send||!!e.to&&e.to!==i.SpecialTargets.Internal)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return f.changed=!0,f}));e.update(n,t),e._stopChildren(),y(e.sessionId)})),this},e.prototype.batch=function(e){var t=this;if(this.status===w.NotStarted&&this.options.deferEvents)l.IS_PRODUCTION||(0,u.warn)(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==w.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,a,s=t.state,l=!1,c=[],d=function(e){var i=(0,u.toSCXMLEvent)(e);t.forward(i),s=(0,_.provide)(t,(function(){return t.machine.transition(s,i,void 0,n||void 0)})),c.push.apply(c,(0,r.__spreadArray)([],(0,r.__read)(t.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return(0,o.bindActionToState)(e,s)}))),!1)),l=l||!!s.changed};try{for(var f=(0,r.__values)(e),h=f.next();!h.done;h=f.next()){d(h.value)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}s.changed=l,s.actions=c,t.update(s,(0,u.toSCXMLEvent)(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=(0,u.toSCXMLEvent)(e);if(0===r.name.indexOf(a.errorPlatform)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(a.errorPlatform)})))throw r.data.data;return(0,_.provide)(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var i=(0,r.__values)(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(e)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}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,!0):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),this._exec(e,t.context,t._event,n)},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),(0,u.isFunction)(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==w.Running)return(0,f.createDeferredActor)(e,t);if((0,u.isPromiseLike)(e))return this.spawnPromise(Promise.resolve(e),t);if((0,u.isFunction)(e))return this.spawnCallback(e,t);if((0,f.isSpawnedActor)(e))return this.spawnActor(e,t);if((0,u.isObservable)(e))return this.spawnObservable(e,t);if((0,u.isMachine)(e))return this.spawnMachine(e,(0,r.__assign)((0,r.__assign)({},n),{id:t}));if((0,u.isBehavior)(e))return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,n){var i=this;void 0===n&&(n={});var o=new e(t,(0,r.__assign)((0,r.__assign)({},this.options),{parent:this,id:n.id||t.id})),s=(0,r.__assign)((0,r.__assign)({},k),n);s.sync&&o.onTransition((function(e){i.send(a.update,{state:e,id:o.id})}));var l=o;return this.children.set(o.id,l),s.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){i.removeChild(o.id),i.send((0,u.toSCXMLEvent)(e,{origin:o.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var n=(0,E.spawnBehavior)(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,o=!1;e.then((function(e){o||(r=e,i.removeChild(t),i.send((0,u.toSCXMLEvent)((0,s.doneInvoke)(t,e),{origin:t})))}),(function(e){if(!o){i.removeChild(t);var n=(0,s.error)(t,e);try{i.send((0,u.toSCXMLEvent)(n,{origin:t}))}catch(r){(0,u.reportUnhandledExceptionOnInvocation)(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var a=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=(0,u.toObserver)(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(){o=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[u.symbolObservable]=function(){return this},n);return this.children.set(t,a),a},e.prototype.spawnCallback=function(e,t){var n,r,i,o=this,a=!1,l=new Set,c=new Set;try{i=e((function(e){r=e,c.forEach((function(t){return t(e)})),a||o.send((0,u.toSCXMLEvent)(e,{origin:t}))}),(function(e){l.add(e)}))}catch(f){this.send((0,s.error)(t,f))}if((0,u.isPromiseLike)(i))return this.spawnPromise(i,t);var d=((n={id:t,send:function(e){return l.forEach((function(t){return t(e)}))},subscribe:function(e){var t=(0,u.toObserver)(e);return c.add(t.next),{unsubscribe:function(){c.delete(t.next)}}},stop:function(){a=!0,(0,u.isFunction)(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[u.symbolObservable]=function(){return this},n);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var n,r,i=this,o=e.subscribe((function(e){r=e,i.send((0,u.toSCXMLEvent)(e,{origin:t}))}),(function(e){i.removeChild(t),i.send((0,u.toSCXMLEvent)((0,s.error)(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send((0,u.toSCXMLEvent)((0,s.doneInvoke)(t),{origin:t}))})),a=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[u.symbolObservable]=function(){return this},n);return this.children.set(t,a),a},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)}else l.IS_PRODUCTION||(0,u.warn)(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[u.symbolObservable]=function(){return this},n))},e.prototype.attachDev=function(){var e=b();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((0,r.__assign)((0,r.__assign)({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:(0,r.__assign)({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}x(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[u.symbolObservable]=function(){return this},e.prototype.getSnapshot=function(){return this.status===w.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=C,e}(),S=function(e){return(0,u.isString)(e)?(0,r.__assign)((0,r.__assign)({},k),{name:e}):(0,r.__assign)((0,r.__assign)((0,r.__assign)({},k),{name:(0,u.uniqueId)()}),e)};function P(e,t){var n=S(t);return(0,_.consume)((function(t){if(!l.IS_PRODUCTION){var r=(0,u.isMachine)(e)||(0,u.isFunction)(e);(0,u.warn)(!!t||r,'Attempted to spawn an Actor (ID: "'.concat((0,u.isMachine)(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return t?t.spawn(e,n.name,n):(0,f.createDeferredActor)(e,n.name)}))}function C(e,t){return new N(e,t)}},21427:(e,t,n)=>{"use strict";n.r(t),n.d(t,{consume:()=>o,provide:()=>i});var r=[],i=function(e,t){r.push(e);var n=t(e);return r.pop(),n},o=function(e){return e(r[r.length-1])}},73340:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAdjList:()=>d,getAllChildren:()=>a,getAllStateNodes:()=>l,getChildren:()=>s,getConfiguration:()=>u,getMeta:()=>m,getTagsFromConfiguration:()=>g,getValue:()=>f,has:()=>h,isInFinalState:()=>v,isLeafNode:()=>o,nextEvents:()=>p});var r=n(86859),i=n(14487),o=function(e){return"atomic"===e.type||"final"===e.type};function a(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return a(e).filter((function(e){return"history"!==e.type}))}function l(e){var t=[e];return o(e)?t:t.concat((0,i.flatten)(s(e).map(l)))}function u(e,t){var n,i,o,a,l,u,c,f,h=d(new Set(e)),p=new Set(t);try{for(var v=(0,r.__values)(p),m=v.next();!m.done;m=v.next())for(var g=(S=m.value).parent;g&&!p.has(g);)p.add(g),g=g.parent}catch(P){n={error:P}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}var y=d(p);try{for(var b=(0,r.__values)(p),x=b.next();!x.done;x=b.next()){if("compound"!==(S=x.value).type||y.get(S)&&y.get(S).length){if("parallel"===S.type)try{for(var w=(l=void 0,(0,r.__values)(s(S))),_=w.next();!_.done;_=w.next()){var E=_.value;p.has(E)||(p.add(E),h.get(E)?h.get(E).forEach((function(e){return p.add(e)})):E.initialStateNodes.forEach((function(e){return p.add(e)})))}}catch(C){l={error:C}}finally{try{_&&!_.done&&(u=w.return)&&u.call(w)}finally{if(l)throw l.error}}}else h.get(S)?h.get(S).forEach((function(e){return p.add(e)})):S.initialStateNodes.forEach((function(e){return p.add(e)}))}}catch(T){o={error:T}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}try{for(var k=(0,r.__values)(p),N=k.next();!N.done;N=k.next()){var S;for(g=(S=N.value).parent;g&&!p.has(g);)p.add(g),g=g.parent}}catch(j){c={error:j}}finally{try{N&&!N.done&&(f=k.return)&&f.call(k)}finally{if(c)throw c.error}}return p}function c(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(o(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=c(e,t)})),i}function d(e){var t,n,i=new Map;try{for(var o=(0,r.__values)(e),a=o.next();!a.done;a=o.next()){var s=a.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}function f(e,t){return c(e,d(u([e],t)))}function h(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function p(e){return(0,r.__spreadArray)([],(0,r.__read)(new Set((0,i.flatten)((0,r.__spreadArray)([],(0,r.__read)(e.map((function(e){return e.ownEvents}))),!1)))),!1)}function v(e,t){return"compound"===t.type?s(t).some((function(t){return"final"===t.type&&h(e,t)})):"parallel"===t.type&&s(t).every((function(t){return v(e,t)}))}function m(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})}function g(e){return new Set((0,i.flatten)(e.map((function(e){return e.tags}))))}},71073:(e,t,n)=>{"use strict";var r,i;n.r(t),n.d(t,{ActionTypes:()=>r,SpecialTargets:()=>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"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}))},14487:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createInvokeId:()=>Z,evaluateGuard:()=>X,flatten:()=>w,getActionType:()=>c,getEventType:()=>u,interopSymbols:()=>F,isActor:()=>V,isArray:()=>A,isBehavior:()=>P,isBuiltInEvent:()=>N,isFunction:()=>M,isMachine:()=>z,isObservable:()=>L,isPromiseLike:()=>S,isStateLike:()=>f,isString:()=>R,keys:()=>s,mapContext:()=>k,mapFilterValues:()=>m,mapValues:()=>v,matchesState:()=>l,nestedPath:()=>y,normalizeTarget:()=>H,partition:()=>C,path:()=>g,pathToStateValue:()=>p,pathsToStateValue:()=>x,reportUnhandledExceptionOnInvocation:()=>Y,symbolObservable:()=>B,toArray:()=>E,toArrayStrict:()=>_,toEventObject:()=>U,toGuard:()=>I,toInvokeSource:()=>$,toObserver:()=>K,toSCXMLEvent:()=>W,toStatePath:()=>d,toStatePaths:()=>b,toStateValue:()=>h,toTransitionConfigArray:()=>q,uniqueId:()=>G,updateContext:()=>D,updateHistoryStates:()=>T,updateHistoryValue:()=>j,warn:()=>O});var r,i=n(86859),o=n(79308),a=n(11293);function s(e){return Object.keys(e)}function l(e,t,n){void 0===n&&(n=o.STATE_DELIMITER);var r=h(e,n),i=h(t,n);return R(i)?!!R(r)&&i===r:R(r)?r in i:Object.keys(r).every((function(e){return e in i&&l(r[e],i[e])}))}function u(e){try{return R(e)||"number"==typeof e?"".concat(e):e.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function c(e){try{return R(e)||"number"==typeof e?"".concat(e):M(e)?e.name:e.type}catch(t){throw new Error("Actions must be strings or objects with a string action.type property.")}}function d(e,t){try{return A(e)?e:e.toString().split(t)}catch(n){throw new Error("'".concat(e,"' is not a valid state path."))}}function f(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function h(e,t){return f(e)?e.value:A(e)?p(e):"string"!=typeof e?e:p(d(e,t))}function p(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 v(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function m(e,t,n){var r,o,a={};try{for(var s=(0,i.__values)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];n(c)&&(a[u]=t(c,u,e))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var g=function(e){return function(t){var n,r,o=t;try{for(var a=(0,i.__values)(e),s=a.next();!s.done;s=a.next()){o=o[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 o}};function y(e,t){return function(n){var r,o,a=n;try{for(var s=(0,i.__values)(e),l=s.next();!l.done;l=s.next()){var u=l.value;a=a[t][u]}}catch(c){r={error:c}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}}function b(e){return e?R(e)?[[e]]:w(Object.keys(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,n,r={};if(e&&1===e.length&&1===e[0].length)return e[0][0];try{for(var o=(0,i.__values)(e),a=o.next();!a.done;a=o.next())for(var s=a.value,l=r,u=0;u<s.length;u++){var c=s[u];if(u===s.length-2){l[c]=s[u+1];break}l[c]=l[c]||{},l=l[c]}}catch(d){t={error:d}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function w(e){var t;return(t=[]).concat.apply(t,(0,i.__spreadArray)([],(0,i.__read)(e),!1))}function _(e){return A(e)?e:[e]}function E(e){return void 0===e?[]:_(e)}function k(e,t,n){var r,o;if(M(e))return e(t,n.data);var a={};try{for(var s=(0,i.__values)(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value,c=e[u];M(c)?a[u]=c(t,n.data):a[u]=c}}catch(d){r={error:d}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}function N(e){return/^(done|error)\./.test(e)}function S(e){return e instanceof Promise||!(null===e||!M(e)&&"object"!=typeof e||!M(e.then))}function P(e){return null!==e&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition}function C(e,t){var n,r,o=(0,i.__read)([[],[]],2),a=o[0],s=o[1];try{for(var l=(0,i.__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&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[a,s]}function T(e,t){return v(e.states,(function(e,n){if(e){var r=(R(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:T(e,r)}}}))}function j(e,t){return{current:t,states:T(e,t)}}function D(e,t,n,r){a.IS_PRODUCTION||O(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,a,s=n.assignment,l={state:r,action:n,_event:t},u={};if(M(s))u=s(e,t.data,l);else try{for(var c=(0,i.__values)(Object.keys(s)),d=c.next();!d.done;d=c.next()){var f=d.value,h=s[f];u[f]=M(h)?h(e,t.data,l):h}}catch(p){o={error:p}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return Object.assign({},e,u)}),e):e;return o}var O=function(){};function A(e){return Array.isArray(e)}function M(e){return"function"==typeof e}function R(e){return"string"==typeof e}function I(e,t){if(e)return R(e)?{type:o.DEFAULT_GUARD_TYPE,name:e,predicate:t?t[e]:void 0}:M(e)?{type:o.DEFAULT_GUARD_TYPE,name:e.name,predicate:e}:e}function L(e){try{return"subscribe"in e&&M(e.subscribe)}catch(t){return!1}}a.IS_PRODUCTION||(O=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var B=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}(),F=((r={})[B]=function(){return this},r[Symbol.observable]=function(){return this},r);function z(e){return!!e&&"__xstatenode"in e}function V(e){return!!e&&"function"==typeof e.send}var G=function(){var e=0;return function(){return(++e).toString(16)}}();function U(e,t){return R(e)||"number"==typeof e?(0,i.__assign)({type:e},t):e}function W(e,t){if(!R(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=U(e);return(0,i.__assign)({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function q(e,t){return _(t).map((function(t){return void 0===t||"string"==typeof t||z(t)?{target:t,event:e}:(0,i.__assign)((0,i.__assign)({},t),{event:e})}))}function H(e){if(void 0!==e&&e!==o.TARGETLESS_KEY)return E(e)}function Y(e,t,n){if(!a.IS_PRODUCTION){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function X(e,t,n,r,i){var a=e.options.guards,s={state:i,cond:t,_event:r};if(t.type===o.DEFAULT_GUARD_TYPE)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,s);var l=null==a?void 0:a[t.type];if(!l)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return l(n,r.data,s)}function $(e){return"string"==typeof e?{type:e}:e}function K(e,t,n){var r=function(){},i="object"==typeof e,o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function Z(e,t){return"".concat(e,":invocation[").concat(t,"]")}}},e=>{var t;t=7645,e(e.s=t)}]);