diff --git a/internal/ui/dist/assets/cytoscape-cose-bilkent-nxdGmLq9.js b/internal/ui/dist/assets/cytoscape-cose-bilkent-CEIBo6Gj.js similarity index 99% rename from internal/ui/dist/assets/cytoscape-cose-bilkent-nxdGmLq9.js rename to internal/ui/dist/assets/cytoscape-cose-bilkent-CEIBo6Gj.js index f545ac7..654a4ef 100644 --- a/internal/ui/dist/assets/cytoscape-cose-bilkent-nxdGmLq9.js +++ b/internal/ui/dist/assets/cytoscape-cose-bilkent-CEIBo6Gj.js @@ -1 +1 @@ -import{t as e}from"./index-Bi057qLa.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){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=26)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(4);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,n!=null&&t!=null?this.rect=new a(t.x,t.y,n.width,n.height):this.rect=new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(!(r.source==n||r.target==n))throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&(this.labelPos==`center`?this.rect.y-=(this.labelHeight-n)/2:this.labelPos==`top`&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}else{var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(!(t.owner==n.owner&&t.owner==this))throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null}},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(!(t.owner!=null&&t.owner==this))throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}else{i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(!(a!=null&&a.getGraphManager()==this))throw`Source not in this graph mgr!`;if(!(o!=null&&o.getGraphManager()==this))throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),!(n.source!=null&&n.target!=null))throw`Edge source and/or target is null!`;if(!(n.source.edges.indexOf(n)==-1&&n.target.edges.indexOf(n)==-1))throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n}},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j;break}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N;break}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(r,i){typeof e==`object`&&typeof n==`object`?n.exports=i(t()):typeof define==`function`&&define.amd?define([`layout-base`],i):typeof e==`object`?e.coseBase=i(t()):r.coseBase=i(r.layoutBase)})(e,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(t,n){t.exports=e}),(function(e,t,n){var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i}),(function(e,t,n){var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child==null||this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(u.WORLD_CENTER_X-o.x/2,u.WORLD_CENTER_Y-o.y/2))},v.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(t,null,0,359,0,r);var i=g.calculateBounds(e),a=new _;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var _=g[0];g.splice(0,1);var y=u.indexOf(_);y>=0&&u.splice(y,1),p--,d--}m=t==null?0:(u.indexOf(g[0])+1)%p;for(var b=Math.abs(r-n)/d,x=m;f!=d;x=++x%p){var S=u[x].getOtherEnd(e);if(S!=t){var C=(n+f*b)%360,w=(C+b)%360;v.branchRadialLayout(S,e,C,w,i+a,a),f++}}},v.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;nt&&(t=r)}return t},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;l=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},v.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},v.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},v.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=u.rect.height)}n+=c+e.verticalPadding}},v.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},v.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:c.TILING_PADDING_VERTICAL,horizontalPadding:c.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},v.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},v.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a=0;e.rowHeight[r]0&&(a=n+e.verticalPadding-e.rowHeight[r]);var o=e.width-i>=t+e.horizontalPadding?(e.height+a)/(i+t+e.horizontalPadding):(e.height+a)/e.width;a=n+e.verticalPadding;var s=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var u=i;u<=a;u++)c[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a0)for(var u=o;u<=s;u++)c[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var d=m.MAX_VALUE,f,p,h=0;h{(function(r,i){typeof e==`object`&&typeof t==`object`?t.exports=i(n()):typeof define==`function`&&define.amd?define([`cose-base`],i):typeof e==`object`?e.cytoscapeCoseBilkent=i(n()):r.cytoscapeCoseBilkent=i(r.coseBase)})(e,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=1)})([(function(t,n){t.exports=e}),(function(e,t,n){var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,c=n(0).layoutBase.PointD,l=n(0).layoutBase.DimensionD,u={ready:function(){},stop:function(){},quality:`default`,nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:`end`,animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function d(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function f(e){this.options=d(u,e),p(this.options)}var p=function(e){e.nodeRepulsion!=null&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),e.idealEdgeLength!=null&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),e.edgeElasticity!=null&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),e.nestingFactor!=null&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.quality==`draft`?r.QUALITY=0:e.quality==`proof`?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};f.prototype.run=function(){var e,t,n=this.options;this.idToLNode={};var r=this.layout=new o,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:`layoutstart`,layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),c=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var l=0;l0){var h=n.getGraphManager().add(n.newGraph(),u);this.processChildrenList(h,o,n)}}},f.prototype.stop=function(){return this.stopped=!0,this};var m=function(e){e(`layout`,`cose-bilkent`,f)};typeof cytoscape<`u`&&m(cytoscape),e.exports=m})])})}));export default r(); \ No newline at end of file +import{t as e}from"./index-B9ZFj2IV.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){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=26)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(4);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,n!=null&&t!=null?this.rect=new a(t.x,t.y,n.width,n.height):this.rect=new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(!(r.source==n||r.target==n))throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&(this.labelPos==`center`?this.rect.y-=(this.labelHeight-n)/2:this.labelPos==`top`&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}else{var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(!(t.owner==n.owner&&t.owner==this))throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null}},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(!(t.owner!=null&&t.owner==this))throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}else{i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(!(a!=null&&a.getGraphManager()==this))throw`Source not in this graph mgr!`;if(!(o!=null&&o.getGraphManager()==this))throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),!(n.source!=null&&n.target!=null))throw`Edge source and/or target is null!`;if(!(n.source.edges.indexOf(n)==-1&&n.target.edges.indexOf(n)==-1))throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n}},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j;break}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N;break}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(r,i){typeof e==`object`&&typeof n==`object`?n.exports=i(t()):typeof define==`function`&&define.amd?define([`layout-base`],i):typeof e==`object`?e.coseBase=i(t()):r.coseBase=i(r.layoutBase)})(e,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(t,n){t.exports=e}),(function(e,t,n){var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i}),(function(e,t,n){var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child==null||this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(u.WORLD_CENTER_X-o.x/2,u.WORLD_CENTER_Y-o.y/2))},v.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(t,null,0,359,0,r);var i=g.calculateBounds(e),a=new _;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var _=g[0];g.splice(0,1);var y=u.indexOf(_);y>=0&&u.splice(y,1),p--,d--}m=t==null?0:(u.indexOf(g[0])+1)%p;for(var b=Math.abs(r-n)/d,x=m;f!=d;x=++x%p){var S=u[x].getOtherEnd(e);if(S!=t){var C=(n+f*b)%360,w=(C+b)%360;v.branchRadialLayout(S,e,C,w,i+a,a),f++}}},v.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;nt&&(t=r)}return t},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;l=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},v.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},v.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},v.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=u.rect.height)}n+=c+e.verticalPadding}},v.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},v.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:c.TILING_PADDING_VERTICAL,horizontalPadding:c.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},v.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},v.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a=0;e.rowHeight[r]0&&(a=n+e.verticalPadding-e.rowHeight[r]);var o=e.width-i>=t+e.horizontalPadding?(e.height+a)/(i+t+e.horizontalPadding):(e.height+a)/e.width;a=n+e.verticalPadding;var s=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var u=i;u<=a;u++)c[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a0)for(var u=o;u<=s;u++)c[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var d=m.MAX_VALUE,f,p,h=0;h{(function(r,i){typeof e==`object`&&typeof t==`object`?t.exports=i(n()):typeof define==`function`&&define.amd?define([`cose-base`],i):typeof e==`object`?e.cytoscapeCoseBilkent=i(n()):r.cytoscapeCoseBilkent=i(r.coseBase)})(e,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=1)})([(function(t,n){t.exports=e}),(function(e,t,n){var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,c=n(0).layoutBase.PointD,l=n(0).layoutBase.DimensionD,u={ready:function(){},stop:function(){},quality:`default`,nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:`end`,animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function d(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function f(e){this.options=d(u,e),p(this.options)}var p=function(e){e.nodeRepulsion!=null&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),e.idealEdgeLength!=null&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),e.edgeElasticity!=null&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),e.nestingFactor!=null&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.quality==`draft`?r.QUALITY=0:e.quality==`proof`?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};f.prototype.run=function(){var e,t,n=this.options;this.idToLNode={};var r=this.layout=new o,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:`layoutstart`,layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),c=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var l=0;l0){var h=n.getGraphManager().add(n.newGraph(),u);this.processChildrenList(h,o,n)}}},f.prototype.stop=function(){return this.stopped=!0,this};var m=function(e){e(`layout`,`cose-bilkent`,f)};typeof cytoscape<`u`&&m(cytoscape),e.exports=m})])})}));export default r(); \ No newline at end of file diff --git a/internal/ui/dist/assets/index-B9ZFj2IV.js b/internal/ui/dist/assets/index-B9ZFj2IV.js new file mode 100644 index 0000000..5da8e1a --- /dev/null +++ b/internal/ui/dist/assets/index-B9ZFj2IV.js @@ -0,0 +1,9 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-eet&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1fe||(e.current=de[fe],de[fe]=null,fe--)}function k(e,t){fe++,de[fe]=e.current,e.current=t}var me=pe(null),he=pe(null),ge=pe(null),_e=pe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}O(me),k(me,e)}function ye(){O(me),O(he),O(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Hd(t,e.type);t!==n&&(k(he,e),k(me,n))}function xe(e){he.current===e&&(O(me),O(he)),_e.current===e&&(O(_e),Qf._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function A(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var j=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,`passive`,{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Sn(),xn=bn=yn=null,sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=gn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ut(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=Ed(Rr,`onSelect`),0>=o,i-=o,Ni=1<<32-j(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&Fi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&Fi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&Fi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&Fi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=bi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=yi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ci(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Na(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,ca(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=xi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=fi(e),di(e,null,n),t}return ci(e,r,t,n),fi(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};E.T=s,Ls(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,xa(c,r),pu(e)):Is(e,t,r,pu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,ue,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},pu())}function As(){return sa(Qf)}function js(){return B().memoizedState}function Ms(){return B().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ja(n);var r=Ya(t,e,n);r!==null&&(hu(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=li(e,t,n,r),n!==null&&(hu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,pu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return ci(e,t,i,0),K===null&&si(),!1}catch{}if(n=li(e,t,i,r),n!==null)return hu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=li(e,n,r,2),t!==null&&hu(t,e,2)}function Rs(e){var t=e.alternate;return e===I||t!==null&&t===I}function zs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Vs={readContext:sa,use:Io,useCallback:z,useContext:z,useEffect:z,useImperativeHandle:z,useLayoutEffect:z,useInsertionEffect:z,useMemo:z,useReducer:z,useRef:z,useState:z,useDebugValue:z,useDeferredValue:z,useTransition:z,useSyncExternalStore:z,useId:z,useHostTransitionStatus:z,useFormState:z,useActionState:z,useOptimistic:z,useMemoCache:z,useCacheRefresh:z};Vs.useEffectEvent=z;var Hs={readContext:sa,use:Io,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(bo){A(!0);try{e()}finally{A(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(bo){A(!0);try{n(t)}finally{A(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ps.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(No(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,I,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=No();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=K.identifierPrefix;if(N){var n=Pi,r=Ni;n=(r&~(1<<32-j(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return H(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Bi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Wi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),H(t),null);case 4:return ye(),e===null&&Sd(t.stateNode.containerInfo),H(t),null;case 10:return ta(t.type),H(t),null;case 19:if(O(F),r=t.memoizedState,r===null)return H(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=go(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vi(n,e),n=n.sibling;return k(F,F.current&1|2),N&&Fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>tu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return H(t),null}else 2*Pe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(H(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=F.current,k(F,a?n&1|2:n&1),N&&Fi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&O(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(P),H(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Ri(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(P),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(F),null;case 4:return ye(),null;case 10:return ta(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&O(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(P),null;case 25:return null;default:return null}}function Hc(e,t){switch(Ri(t),t.tag){case 3:ta(P),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:O(F);break;case 10:ta(t.type);break;case 22:case 23:ho(t),so(),e!==null&&O(Ca);break;case 24:ta(P)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){Z(e,e.return,t)}}}function Kc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[mt]=t}catch(t){Z(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Z(e,e.return,t)}}var nl=!1,U=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,E.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{D.p=a,E.T=r,Vu(e,t)}}function Wu(e,t,n){t=Ti(n,t),t=tc(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(rt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Ti(n,e),n=nc(2),r=Ya(t,n,2),r!==null&&(rc(n,r,t,e),rt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Pe()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=tt()),e=ui(e,t),e!==null&&(rt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ae(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-j(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Qe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Pe(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Et(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ge.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Gt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Et(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Gt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Et(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),v=o(((e,t)=>{t.exports=_()}));function y(...e){let t=``;for(let n of e)n&&(t+=t?` `+n:n);return t}var b=0;function x(e=`rcs`){return b+=1,`${e}-${b}`}var S=v(),C=c(u(),1),w=C.forwardRef(function(e,t){let{variant:n=`secondary`,size:r=`md`,shape:i=`rect`,loading:a=!1,disabled:o=!1,block:s=!1,iconLeft:c,iconRight:l,type:u=`button`,children:d,onClick:f,className:p,style:m,id:h,"data-testid":g,"aria-label":_,"aria-labelledby":v,"aria-describedby":b}=e;return(0,S.jsxs)(`button`,{ref:t,id:h,"data-testid":g,type:u,className:y(`rcs-button`,`rcs-button--${n}`,`rcs-button--${r}`,i!==`rect`&&`rcs-button--${i}`,s&&`rcs-button--block`,p),style:m,disabled:o||a,"aria-disabled":o||a||void 0,"aria-busy":a||void 0,"aria-label":_,"aria-labelledby":v,"aria-describedby":b,onClick:f,children:[a?(0,S.jsx)(`span`,{className:`rcs-button-spinner`,"aria-hidden":!0}):c,d,l]})}),ee=C.forwardRef(function(e,t){let{icon:n,round:r=!1,"aria-label":i,...a}=e;return(0,S.jsx)(w,{ref:t,...a,shape:r?`circle`:`square`,"aria-label":i,children:n})}),te=C.forwardRef(function(e,t){let{value:n,defaultValue:r,placeholder:i,size:a=`md`,status:o=`default`,disabled:s=!1,readOnly:c=!1,invalid:l=!1,prefix:u,suffix:d,clearable:f=!1,type:p=`text`,autoFocus:m=!1,onChange:h,onFocus:g,onBlur:_,onKeyDown:v,className:b,style:x,id:w,"data-testid":ee,"aria-label":te,"aria-labelledby":ne,"aria-describedby":re}=e,ie=n!==void 0,[ae,oe]=C.useState(r??``),se=ie?n:ae,ce=C.useRef(null);C.useImperativeHandle(t,()=>ce.current);let T=l?`error`:o;return(0,S.jsxs)(`span`,{className:y(`rcs-input-wrap`,`rcs-input-wrap--${a}`,b),style:x,"data-status":T,"data-disabled":s||void 0,children:[u&&(0,S.jsx)(`span`,{className:`rcs-input-affix rcs-input-affix--left`,children:u}),(0,S.jsx)(`input`,{ref:ce,id:w,"data-testid":ee,className:`rcs-input`,type:p,value:se,placeholder:i,disabled:s,readOnly:c,autoFocus:m,"aria-invalid":T===`error`||void 0,"aria-label":te,"aria-labelledby":ne,"aria-describedby":re,onChange:e=>{ie||oe(e.target.value),h?.(e.target.value,e)},onFocus:g,onBlur:_,onKeyDown:v}),f&&se&&!s&&!c&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-input-clear`,"aria-label":`Clear`,onClick:e=>{let t=ce.current;ie||oe(``),t&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(t,``),t.dispatchEvent(new Event(`input`,{bubbles:!0}))),h?.(``,e)},children:`×`}),d&&(0,S.jsx)(`span`,{className:`rcs-input-affix rcs-input-affix--right`,children:d})]})});C.forwardRef(function(e,t){let{value:n,defaultValue:r,placeholder:i,rows:a=4,autoResize:o=!1,maxLength:s,showCount:c=!1,size:l=`md`,status:u=`default`,disabled:d=!1,readOnly:f=!1,invalid:p=!1,onChange:m,onFocus:h,onBlur:g,onKeyDown:_,autoFocus:v,className:b,style:x,id:w,"data-testid":ee,"aria-label":te,"aria-labelledby":ne,"aria-describedby":re}=e,ie=n!==void 0,[ae,oe]=C.useState(r??``),se=ie?n:ae,ce=C.useRef(null);C.useImperativeHandle(t,()=>ce.current),C.useLayoutEffect(()=>{if(!o)return;let e=ce.current;e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)},[se,o]);let T=p?`error`:u;return(0,S.jsxs)(`span`,{style:{display:`block`,width:`100%`,...x},children:[(0,S.jsx)(`textarea`,{ref:ce,id:w,"data-testid":ee,className:y(`rcs-textarea`,`rcs-textarea--${l}`,b),rows:a,value:se,placeholder:i,maxLength:s,disabled:d,readOnly:f,autoFocus:v,"aria-invalid":T===`error`||void 0,"aria-label":te,"aria-labelledby":ne,"aria-describedby":re,"data-status":T,onChange:e=>{ie||oe(e.target.value),m?.(e.target.value,e)},onFocus:h,onBlur:g,onKeyDown:_}),c&&(0,S.jsxs)(`span`,{className:`rcs-textarea-count`,children:[se.length,s?` / ${s}`:``]})]})});function ne(e){let{tone:t=`neutral`,size:n=`md`,icon:r,closable:i=!1,onClose:a,children:o,className:s,style:c,id:l}=e;return(0,S.jsxs)(`span`,{id:l,className:y(`rcs-badge`,`rcs-badge--${t}`,n!==`md`&&`rcs-badge--${n}`,s),style:c,children:[r&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:r}),o,i&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-badge-x`,"aria-label":`Remove`,onClick:a,children:`×`})]})}var re={xs:4,sm:8,md:12,lg:16,xl:24};function ie(e){return e===void 0?12:typeof e==`number`?e:re[e]}var ae={none:`0`,sm:`4px`,md:`6px`,lg:`8px`,pill:`9999px`,circle:`50%`};function oe(e){return e===void 0?`var(--radius-md)`:typeof e==`number`?`${e}px`:ae[e]}var se={none:`none`,sm:`var(--shadow-sm)`,md:`var(--shadow-md)`,lg:`var(--shadow-lg)`,overlay:`var(--shadow-lg)`};function ce(e){let{title:t,subtitle:n,extra:r,footer:i,bordered:a=!0,hoverable:o=!1,padding:s,radius:c,shadow:l=`none`,children:u,className:d,style:f,id:p}=e,m={borderRadius:oe(c),boxShadow:se[l],border:a?void 0:`0`,...f};return(0,S.jsxs)(`div`,{id:p,className:y(`rcs-card`,d),style:m,"data-hoverable":o||void 0,children:[(t||r)&&(0,S.jsxs)(`div`,{className:`rcs-card-header`,children:[(0,S.jsxs)(`div`,{children:[t&&(0,S.jsx)(`div`,{className:`rcs-card-title`,children:t}),n&&(0,S.jsx)(`div`,{className:`rcs-card-subtitle`,children:n})]}),r&&(0,S.jsx)(`div`,{className:`rcs-card-extra`,children:r})]}),(0,S.jsx)(`div`,{className:`rcs-card-body`,style:s===void 0?void 0:{padding:ie(s)},children:u}),i&&(0,S.jsx)(`div`,{className:`rcs-card-footer`,children:i})]})}function T(e){let{direction:t=`horizontal`,size:n=`sm`,align:r,justify:i,wrap:a=!1,split:o,children:s,className:c,style:l,id:u}=e,d=ie(n),f=C.Children.toArray(s);return(0,S.jsx)(`div`,{id:u,className:y(`rcs-space`,t===`vertical`&&`rcs-space--vertical`,a&&`rcs-space--wrap`,c),style:{gap:d,alignItems:r,justifyContent:i,flexDirection:t===`vertical`?`column`:`row`,...l},children:f.map((e,t)=>(0,S.jsxs)(C.Fragment,{children:[e,o&&te.key===m),g=(e,t)=>{t||(d||p(e),o?.(e))};return(0,S.jsxs)(`div`,{id:u,"data-scrollable":s||void 0,className:y(`rcs-tabs`,`rcs-tabs--${i}`,`rcs-tabs--${a}`,c),style:l,children:[(0,S.jsx)(`div`,{className:`rcs-tabs-nav`,"data-scrollable":s||void 0,role:`tablist`,children:t.map(e=>(0,S.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.key===m,disabled:e.disabled,"data-active":e.key===m||void 0,className:`rcs-tabs-tab`,onClick:()=>g(e.key,e.disabled),children:[e.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.icon}),(0,S.jsx)(`span`,{children:e.label}),e.badge&&(0,S.jsx)(`span`,{style:{marginLeft:4},children:e.badge})]},e.key))}),h?.content&&(0,S.jsx)(`div`,{className:`rcs-tabs-content`,role:`tabpanel`,children:h.content})]})}function fe(e){let{items:t,separator:n=`/`,maxItems:r,className:i,style:a,id:o}=e,s=t;return r&&t.length>r&&(s=[t[0],{label:`…`},...t.slice(t.length-(r-2))]),(0,S.jsx)(`nav`,{id:o,"aria-label":`Breadcrumb`,className:y(`rcs-breadcrumb`,i),style:a,children:s.map((e,t)=>{let r=t===s.length-1,i=e.href?(0,S.jsxs)(`a`,{href:e.href,onClick:e.onClick,children:[e.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,style:{marginRight:4},children:e.icon}),e.label]}):e.onClick?(0,S.jsx)(`button`,{type:`button`,onClick:e.onClick,style:{background:`none`,border:0,padding:0,color:`inherit`,cursor:`pointer`,font:`inherit`},children:e.label}):(0,S.jsx)(`span`,{children:e.label});return(0,S.jsxs)(C.Fragment,{children:[(0,S.jsx)(`span`,{className:r?`rcs-breadcrumb-item--last`:void 0,children:i}),!r&&(0,S.jsx)(`span`,{className:`rcs-breadcrumb-sep`,"aria-hidden":!0,children:n})]},t)})})}var pe={info:`ⓘ`,success:`✓`,warning:`⚠`,danger:`✕`};function O(e){let{severity:t,title:n,children:r,closable:i=!1,icon:a,action:o,onClose:s,className:c,style:l,id:u}=e;return(0,S.jsxs)(`div`,{id:u,role:`alert`,className:y(`rcs-alert`,`rcs-alert--${t}`,c),style:l,children:[a!==!1&&(0,S.jsx)(`span`,{className:`rcs-alert-icon`,"aria-hidden":!0,children:a??pe[t]}),(0,S.jsxs)(`div`,{className:`rcs-alert-body`,children:[n&&(0,S.jsx)(`div`,{className:`rcs-alert-title`,children:n}),r&&(0,S.jsx)(`div`,{className:`rcs-alert-content`,children:r}),o&&(0,S.jsx)(`div`,{className:`rcs-alert-action`,children:o})]}),i&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-alert-close`,"aria-label":`Dismiss`,onClick:s,children:`×`})]})}function k(e,t){C.useEffect(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}function me(e){let{open:t,title:n,description:r,placement:i=`right`,width:a=360,closeOnEsc:o=!0,closeOnBackdrop:s=!0,footer:c,children:l,onClose:u,className:d,style:f,id:p}=e;if(k(t&&o,u),!t)return null;let m=typeof a==`number`?`${a}px`:a,h={...f};return i===`left`||i===`right`?h.width=m:h.height=m,(0,S.jsx)(`div`,{className:`rcs-modal-backdrop`,role:`dialog`,"aria-modal":`true`,style:{alignItems:i===`top`?`flex-start`:i===`bottom`?`flex-end`:`stretch`,justifyItems:i===`left`?`flex-start`:i===`right`?`flex-end`:`stretch`,padding:0},onClick:e=>{s&&e.target===e.currentTarget&&u()},children:(0,S.jsxs)(`div`,{id:p,className:y(`rcs-drawer`,`rcs-drawer--${i}`,d),style:h,children:[(n||r)&&(0,S.jsxs)(`div`,{className:`rcs-modal-header`,children:[n&&(0,S.jsx)(`h2`,{className:`rcs-modal-title`,children:n}),r&&(0,S.jsx)(`div`,{className:`rcs-modal-desc`,children:r})]}),(0,S.jsx)(`div`,{className:`rcs-modal-body`,style:{flex:1,overflow:`auto`},children:l}),c&&(0,S.jsx)(`div`,{className:`rcs-modal-footer`,children:c})]})})}function he(e){let{value:t,indeterminate:n=!1,variant:r=`linear`,size:i=`md`,tone:a=`neutral`,showValue:o=!1,className:s,style:c,id:l}=e,u=Math.max(0,Math.min(100,t));if(r===`circular`){let e=i===`lg`?24:i===`sm`?14:18,t=i===`lg`?3:2,n=2*Math.PI*e,r=u/100*n;return(0,S.jsx)(`span`,{id:l,className:y(`rcs-progress`,s),style:c,role:`progressbar`,"aria-valuenow":u,children:(0,S.jsxs)(`svg`,{width:e*2+t*2,height:e*2+t*2,children:[(0,S.jsx)(`circle`,{cx:e+t,cy:e+t,r:e,stroke:`var(--bg-3)`,strokeWidth:t,fill:`none`}),(0,S.jsx)(`circle`,{cx:e+t,cy:e+t,r:e,stroke:a===`danger`?`var(--danger)`:a===`warning`?`var(--warning)`:`var(--bg-inverse)`,strokeWidth:t,fill:`none`,strokeDasharray:`${r} ${n}`,strokeLinecap:`round`,transform:`rotate(-90 ${e+t} ${e+t})`,style:{transition:`stroke-dasharray 0.3s var(--ease-out-quart)`}})]})})}return(0,S.jsxs)(`div`,{id:l,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n?void 0:u,className:y(`rcs-progress`,`rcs-progress--${i}`,s),style:c,"data-tone":a,"data-indeterminate":n||void 0,children:[(0,S.jsx)(`div`,{className:`rcs-progress-track`,children:(0,S.jsx)(`div`,{className:`rcs-progress-fill`,style:{width:`${u}%`}})}),o&&(0,S.jsxs)(`div`,{className:`rcs-progress-value`,children:[Math.round(u),`%`]})]})}function ge(e){let{size:t=`md`,tone:n=`neutral`,label:r,className:i,style:a,id:o}=e;return(0,S.jsxs)(`span`,{id:o,className:y(`rcs-spin`,`rcs-spin--${t}`,i),style:a,"data-tone":n,role:`status`,children:[(0,S.jsx)(`span`,{className:`rcs-spin-glyph`,"aria-hidden":!0}),r&&(0,S.jsx)(`span`,{children:r})]})}var _e=[],ve=new Set;function ye(){for(let e of ve)e([..._e])}var be={show(e){let t=e.id??x(`toast`),n={...e,id:t};_e.push(n),ye();let r=e.duration??4e3;return r>0&&window.setTimeout(()=>be.dismiss(t),r),t},dismiss(e){let t=_e.findIndex(t=>t.id===e);t>=0&&(_e.splice(t,1)[0].onDismiss?.(),ye())},async promise(e,t){let n=be.show({severity:`info`,title:t.loading,duration:0});try{let r=await e;return be.dismiss(n),be.show({severity:`success`,title:t.success}),r}catch(e){throw be.dismiss(n),be.show({severity:`danger`,title:t.error}),e}}};function xe(){let[e,t]=C.useState([]);return C.useEffect(()=>(ve.add(t),()=>{ve.delete(t)}),[]),(0,S.jsx)(`div`,{className:`rcs-toast-region`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,S.jsxs)(`div`,{className:y(`rcs-toast`,`rcs-toast--${e.severity??`info`}`),role:`status`,children:[(0,S.jsx)(`span`,{className:`rcs-toast-icon`,"aria-hidden":!0,children:pe[e.severity??`info`]}),(0,S.jsxs)(`div`,{style:{flex:1},children:[(0,S.jsx)(`div`,{className:`rcs-toast-title`,children:e.title}),e.description&&(0,S.jsx)(`div`,{className:`rcs-toast-desc`,children:e.description})]}),e.action&&(0,S.jsx)(`button`,{className:`rcs-toast-action`,onClick:()=>{e.action.onClick(),be.dismiss(e.id)},children:e.action.label}),(0,S.jsx)(`button`,{className:`rcs-input-clear`,"aria-label":`Dismiss`,onClick:()=>be.dismiss(e.id),children:`×`})]},e.id))})}function Se(e){let{label:t,value:n,unit:r,delta:i,sparkline:a,className:o,style:s,id:c}=e;return(0,S.jsxs)(`div`,{id:c,className:y(`rcs-stat`,o),style:s,children:[(0,S.jsx)(`div`,{className:`rcs-stat-label`,children:t}),(0,S.jsxs)(`div`,{className:`rcs-stat-value`,children:[(0,S.jsx)(`span`,{children:n}),r&&(0,S.jsx)(`span`,{className:`rcs-stat-unit`,children:r})]}),i&&(0,S.jsxs)(`span`,{className:`rcs-stat-delta`,"data-tone":i.tone??`neutral`,children:[i.direction===`up`?`↑`:`↓`,i.value,`%`]}),a&&a.length>1&&(0,S.jsx)(Ce,{data:a})]})}function Ce({data:e}){let t=Math.min(...e),n=Math.max(...e)-t||1;return(0,S.jsx)(`svg`,{viewBox:`0 0 80 24`,className:`rcs-stat-spark`,preserveAspectRatio:`none`,children:(0,S.jsx)(`polyline`,{points:e.map((r,i)=>`${i/(e.length-1)*80},${24-(r-t)/n*24}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`})})}function we(e){let{title:t,subtitle:n,breadcrumbs:r,tabs:i,actions:a,badge:o,avatar:s,back:c,size:l=`md`,inlineSubtitle:u,backInline:d,className:f,style:p,id:m}=e,h=c&&!d,g=c&&d;return(0,S.jsxs)(`div`,{id:m,className:y(`rcs-page-header`,`rcs-page-header--${l}`,f),"data-inline-subtitle":u||void 0,"data-back-inline":d||void 0,style:p,children:[h&&(0,S.jsxs)(`button`,{type:`button`,className:`rcs-page-header-back`,onClick:c.onClick,children:[`← `,c.label??`Back`]}),r&&r.length>0&&(0,S.jsx)(`div`,{style:{marginBottom:8},children:(0,S.jsx)(fe,{items:r})}),(0,S.jsxs)(`div`,{className:`rcs-page-header-row`,children:[(0,S.jsxs)(`div`,{className:`rcs-page-header-title`,children:[g&&(0,S.jsx)(`button`,{type:`button`,"aria-label":c.label??`Back`,className:`rcs-page-header-back-inline`,onClick:c.onClick,children:`←`}),s,(0,S.jsxs)(`div`,{className:`rcs-page-header-title-text`,children:[(0,S.jsxs)(`h1`,{children:[t,o&&(0,S.jsx)(`span`,{style:{marginLeft:8},children:o})]}),n&&(0,S.jsx)(`div`,{className:`rcs-page-header-subtitle`,children:n})]})]}),a&&(0,S.jsx)(`div`,{className:`rcs-page-header-actions`,children:a})]}),i&&i.length>0&&(0,S.jsx)(`div`,{className:`rcs-page-header-tabs`,children:(0,S.jsx)(de,{items:i,variant:`line`})})]})}function Te(e){let{header:t,sidebar:n,footer:r,sidebarWidth:i=240,sidebarCollapsible:a,children:o,className:s,style:c,id:l}=e;return(0,S.jsxs)(`div`,{id:l,className:y(`rcs-app-shell`,s),style:{"--rcs-sidebar-w":`${i}px`,...c},children:[t&&(0,S.jsx)(`header`,{className:`rcs-app-shell-header`,children:t}),(0,S.jsxs)(`div`,{className:`rcs-app-shell-body`,"data-has-sidebar":!!n||void 0,children:[n&&(0,S.jsx)(`aside`,{className:`rcs-app-shell-sidebar`,children:n}),(0,S.jsx)(`main`,{className:`rcs-app-shell-main`,children:o})]}),r&&(0,S.jsx)(`footer`,{className:`rcs-app-shell-footer`,children:r})]})}var Ee=C.createContext(null),De={"signal-red":`#E60000`,"signal-red-700":`#9E0000`,"signal-red-900":`#520000`,"cod-gray":`#1C1C1C`,"cod-gray-700":`#2B2B2B`,"cod-gray-500":`#5A5A5A`,"cod-gray-300":`#A6A6A6`,"cod-gray-100":`#F5F5F5`,"cod-gray-050":`#FAFAFA`,white:`#FFFFFF`};function Oe(e){let{mode:t,accent:n,fontFamily:r,children:i}=e,[a,o]=C.useState(t??`light`),s=t??a;C.useEffect(()=>{typeof document>`u`||document.documentElement.setAttribute(`data-theme`,s)},[s]),C.useEffect(()=>{typeof document>`u`||!n||document.documentElement.style.setProperty(`--accent`,De[n])},[n]),C.useEffect(()=>{typeof document>`u`||!r||(r.sans&&document.documentElement.style.setProperty(`--font-sans`,r.sans),r.mono&&document.documentElement.style.setProperty(`--font-mono`,r.mono))},[r]);let c=C.useMemo(()=>({mode:s,setMode:e=>o(e),toggle:()=>o(e=>e===`light`?`dark`:`light`)}),[s]);return(0,S.jsx)(Ee.Provider,{value:c,children:i})}var ke=g(),Ae=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),je=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Me={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ne=(0,C.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,C.createElement)(`svg`,{ref:c,...Me,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:je(`lucide`,i),...s},[...o.map(([e,t])=>(0,C.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Pe=(e,t)=>{let n=(0,C.forwardRef)(({className:n,...r},i)=>(0,C.createElement)(Ne,{ref:i,iconNode:t,className:je(`lucide-${Ae(e)}`,n),...r}));return n.displayName=`${e}`,n},Fe=Pe(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ie=Pe(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Le=Pe(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),Re=Pe(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),ze=Pe(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Be=Pe(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ve=`oc-theme`;function He(){let[e,t]=(0,C.useState)(()=>localStorage.getItem(Ve)??`dark`);return(0,C.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e),localStorage.setItem(Ve,e)},[e]),{theme:e,toggle:()=>t(e=>e===`dark`?`light`:`dark`)}}function Ue(e){let[t,n]=(0,C.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches);return(0,C.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function We({wsConnected:e}){let{theme:t,toggle:n}=He(),r=Ue(`(max-width: 760px)`),[i,a]=(0,C.useState)(!1),o=typeof window<`u`?`${window.location.origin}/mcp`:`/mcp`,s=async()=>{typeof navigator>`u`||!navigator.clipboard||(await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500))},c=(0,S.jsx)(ee,{icon:t===`dark`?(0,S.jsx)(ze,{size:15}):(0,S.jsx)(Le,{size:15}),"aria-label":`Toggle theme`,variant:`ghost`,size:`sm`,shape:`circle`,onClick:n}),l=(0,S.jsx)(ne,{tone:e?`info`:`danger`,size:`sm`,children:e?`live`:`offline`}),u=(0,S.jsx)(w,{variant:`primary`,size:`sm`,iconLeft:i?(0,S.jsx)(Fe,{size:12}):(0,S.jsx)(Ie,{size:12}),onClick:s,children:i?`Copied`:`Copy MCP URL`});return r?(0,S.jsxs)(T,{justify:`between`,align:`center`,style:{display:`flex`,width:`100%`,padding:`0.5rem 0.75rem`},children:[(0,S.jsx)(`strong`,{children:`OtelContext`}),(0,S.jsxs)(T,{size:`xs`,align:`center`,children:[u,l,c]})]}):(0,S.jsxs)(T,{justify:`between`,align:`center`,style:{display:`flex`,width:`100%`,padding:`0.5rem 1rem`,gap:`0.75rem`},children:[(0,S.jsx)(T,{size:`md`,align:`center`,children:(0,S.jsx)(`strong`,{children:`OtelContext`})}),(0,S.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:640},children:(0,S.jsx)(te,{value:o,readOnly:!0,type:`url`,size:`sm`,"aria-label":`MCP endpoint URL`})}),(0,S.jsxs)(T,{size:`sm`,align:`center`,children:[u,l,c]})]})}var A={fg1:`#1C1C1C`,fg2:`#3D3D3D`,fg3:`#5A5A5A`,fg4:`#A6A6A6`,bg1:`#FFFFFF`,bg2:`#FAFAFA`,bg3:`#F5F5F5`,border1:`#E5E5E5`,border2:`#D4D4D4`,accent:`#E60000`,accentSoft:`rgba(230,0,0,0.08)`,success:`#1F9E5C`,warning:`#D98E2B`,danger:`#E60000`,info:`#2D73D9`,series:[`#E60000`,`#1C1C1C`,`#5A5A5A`,`#2D73D9`,`#1F9E5C`,`#D98E2B`,`#9E0000`,`#A6A6A6`],fontSans:`Inter, system-ui, sans-serif`,fontMono:`'JetBrains Mono', monospace`,mode:`light`};function j(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Ge(){if(typeof window>`u`)return A;let e=document.documentElement.getAttribute(`data-theme`)??`light`,t=j(`--fg-1`,A.fg1),n=j(`--fg-2`,A.fg2),r=j(`--fg-3`,A.fg3),i=j(`--fg-4`,A.fg4),a=j(`--bg-1`,A.bg1),o=j(`--bg-2`,A.bg2),s=j(`--bg-3`,A.bg3),c=j(`--border-1`,A.border1),l=j(`--border-2`,A.border2),u=j(`--accent`,A.accent);return{fg1:t,fg2:n,fg3:r,fg4:i,bg1:a,bg2:o,bg3:s,border1:c,border2:l,accent:u,accentSoft:j(`--accent-soft`,A.accentSoft),success:j(`--success`,A.success),warning:j(`--warning`,A.warning),danger:j(`--danger`,A.danger),info:j(`--info`,A.info),series:e===`dark`?[u,`#F5F5F5`,`#A6A6A6`,`#5BA0F2`,`#3FBE83`,`#E5A65A`,`#FF6464`,`#7A7A7A`]:[u,`#1C1C1C`,`#5A5A5A`,`#2D73D9`,`#1F9E5C`,`#D98E2B`,`#9E0000`,`#A6A6A6`],fontSans:j(`--font-sans`,A.fontSans),fontMono:j(`--font-mono`,A.fontMono),mode:e}}function Ke(e){if(typeof window>`u`)return()=>{};let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()}var qe=`modulepreload`,Je=function(e){return`/`+e},Ye={},Xe=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Je(t,n),t in Ye)return;Ye[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:qe,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ze=null;function Qe(){if(typeof window>`u`)return{webgl2:!1,webgpu:!1,devicePixelRatio:1,maxTextureSize:0};if(Ze)return{...Ze,devicePixelRatio:window.devicePixelRatio||1,maxTextureSize:0};let e=!1,t=0;try{let n=document.createElement(`canvas`).getContext(`webgl2`);n&&(e=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE))}catch{}let n=`gpu`in navigator&&typeof navigator.gpu==`object`;return Ze={webgl2:e,webgpu:n},{webgl2:e,webgpu:n,devicePixelRatio:window.devicePixelRatio||1,maxTextureSize:t}}function $e(e,t,n=5e4){let r=Qe();return e===`canvas`?`canvas`:e===`webgl`?r.webgl2?`webgl`:`canvas`:e===`webgpu`?r.webgpu?`webgpu`:r.webgl2?`webgl`:`canvas`:r.webgpu&&t>n?`webgpu`:r.webgl2&&t>n?`webgl`:`canvas`}var et=null;async function tt(){if(et)return et;try{let e=await Xe(()=>import(`./design-system-IOKLDoaG.js`),[]),t=await Xe(()=>import(`./design-system-DFjB0sSn.js`),[]);return et={Deck:e.Deck,SolidPolygonLayer:t.SolidPolygonLayer,ScatterplotLayer:t.ScatterplotLayer,LineLayer:t.LineLayer,ArcLayer:t.ArcLayer,PolygonLayer:t.PolygonLayer},et}catch(e){return console.warn(`[@ossrandom/design-system] WebGL renderer requested but @deck.gl/core not installed. Falling back to canvas. Run: pnpm add @deck.gl/core @deck.gl/layers`,e),null}}function nt(e,t=255){if(!e)return[0,0,0,t];if(e.startsWith(`rgb`)){let n=/rgba?\(([^)]+)\)/.exec(e);if(!n)return[0,0,0,t];let[r=0,i=0,a=0,o=1]=n[1].split(`,`).map(e=>parseFloat(e.trim()));return[r,i,a,Math.round(o*255)]}let n=e.replace(`#`,``);return n.length===3?[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),t]:n.length>=6?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),n.length===8?parseInt(n.slice(6,8),16):t]:[0,0,0,t]}var rt=null;async function it(){if(rt)return rt.ctor;try{let e=await Xe(()=>import(`./cytoscape.esm-Dm6iss-N.js`),[]),t=e.default??e;try{let e=await Xe(()=>import(`./cytoscape-cose-bilkent-CEIBo6Gj.js`).then(e=>c(e.default,1)),[]);t.use(e.default??e)}catch{}return rt={ctor:t},t}catch(e){return console.warn(`[@ossrandom/design-system] cytoscape not installed:`,e),null}}function at(e,t){return t<=0?3:3+Math.sqrt(e)/Math.sqrt(t)*11}function ot(e,t){let n=new Map;for(let t of e)n.set(t.id,0);for(let e of t)n.set(e.source,(n.get(e.source)??0)+1),n.set(e.target,(n.get(e.target)??0)+1);let r=0;for(let e of n.values())e>r&&(r=e);return{degrees:n,max:r}}async function st(e,t,n,r){let{degrees:i}=ot(e,t);if(e.every(e=>e.x!==void 0&&e.y!==void 0))return e.map(e=>({...e,x:e.x,y:e.y,degree:i.get(e.id)??0}));try{let a=await Xe(()=>import(`./design-system-BNhP-Tae.js`),[]),o=e.map(e=>({...e,x:n/2+(Math.random()-.5)*100,y:r/2+(Math.random()-.5)*100,degree:i.get(e.id)??0})),s=a.forceSimulation(o).force(`link`,a.forceLink(t.map(e=>({source:e.source,target:e.target}))).id(e=>e.id).distance(60)).force(`charge`,a.forceManyBody().strength(-300)).force(`center`,a.forceCenter(n/2,r/2)).force(`collide`,a.forceCollide(14)).stop();for(let e=0;e<200;e++)s.tick();return o}catch{let t=Math.ceil(Math.sqrt(e.length)),a=n/t,o=r/Math.ceil(e.length/t);return e.map((e,n)=>({...e,x:n%t*a+a/2,y:Math.floor(n/t)*o+o/2,degree:i.get(e.id)??0}))}}function ct(e){let{nodes:t,edges:n,height:r=480,layout:i=`cose-bilkent`,engine:a=`auto`,onNodeClick:o,onEdgeClick:s,className:c,style:l,id:u}=e,d=C.useRef(null),f=C.useRef(null),p=C.useRef(null),[m,h]=C.useState(0),[g,_]=C.useState(`canvas`);return C.useEffect(()=>{_($e(a,t.length+n.length,500))},[a,t.length,n.length]),C.useEffect(()=>{if(!d.current)return;let e=new ResizeObserver(e=>{let t=Math.floor(e[0].contentRect.width);t>0&&t!==m&&h(t)});return e.observe(d.current),()=>e.disconnect()},[m]),C.useEffect(()=>{if(g!==`canvas`||!d.current)return;let e=!1,r=d.current;return it().then(a=>{if(!a||e){a||(r.innerHTML=`
Service map (canvas) requires cytoscape. Run: pnpm add cytoscape cytoscape-cose-bilkent
`);return}let c=Ge(),{degrees:l,max:u}=ot(t,n),d=a({container:r,elements:[...t.map(e=>{let t=l.get(e.id)??0,n=at(t,u);return{data:{id:e.id,label:e.label,status:e.status,kind:e.kind,degree:t,diameter:Math.round(n*2)}}}),...n.map(e=>({data:{id:`${e.source}->${e.target}`,source:e.source,target:e.target,label:e.label,status:e.status}}))],style:lt(c),layout:{name:i,animate:!1,fit:!0,padding:24,nodeRepulsion:6e3,idealEdgeLength:80},wheelSensitivity:.2,minZoom:.2,maxZoom:3});o&&d.on(`tap`,`node`,e=>o(e.target.data())),s&&d.on(`tap`,`edge`,e=>s(e.target.data()));let p=e=>{let t=e.isNode?.()??!0;if(d.elements().addClass(`rcs-dim`),t){let t=e.connectedEdges?.(),n=e.connectedNodes?.();n?.removeClass(`rcs-dim`),t?.removeClass(`rcs-dim`),d.$(`#${ut(e.id())}`).removeClass(`rcs-dim`),d.$(`#${ut(e.id())}`).addClass(`rcs-focus`),t?.addClass(`rcs-focus-edge`),n?.addClass(`rcs-neighbor`)}else{let t=e.connectedNodes?.();t?.removeClass(`rcs-dim`),t?.addClass(`rcs-neighbor`)}},m=()=>{d.elements().removeClass(`rcs-dim rcs-focus rcs-focus-edge rcs-neighbor`)};d.on(`mouseover`,`node`,e=>p(e.target)),d.on(`mouseover`,`edge`,e=>p(e.target)),d.on(`mouseout`,`node`,()=>m()),d.on(`mouseout`,`edge`,()=>m()),d.on(`tap`,`node`,e=>p(e.target)),d.on(`tap`,`edge`,e=>p(e.target));let h=d.container();h&&h.addEventListener(`pointerleave`,m),f.current=d}),()=>{e=!0,f.current?.destroy(),f.current=null,r.innerHTML=``}},[g,t,n,i,o,s]),C.useEffect(()=>{if(g===`canvas`||m===0||!d.current)return;let e=!1,i=d.current;return(async()=>{let a=await tt();if(!a||e){_(`canvas`);return}let c=await st(t,n,m,r);if(e)return;let l=new Map(c.map((e,t)=>[e.id,t])),u=Ge(),d=c.reduce((e,t)=>Math.max(e,t.degree),0),f=g===`webgpu`?`webgpu`:`webgl`,h=a.ScatterplotLayer,v=a.ArcLayer,y=new Map,b=new Map;for(let e of c)y.set(e.id,new Set),b.set(e.id,new Set);for(let e of n){let t=`${e.source}->${e.target}`;y.get(e.source)?.add(e.target),y.get(e.target)?.add(e.source),b.get(e.source)?.add(t),b.get(e.target)?.add(t)}let x=null,S=e=>!x||e===x?!0:y.get(x)?.has(e)??!1,C=e=>x?e.source===x||e.target===x:!0,w=(e,t)=>[e[0],e[1],e[2],t],ee=()=>[new v({id:`service-edges`,data:n.map(e=>({...e,sourcePos:c[l.get(e.source)??0],targetPos:c[l.get(e.target)??0]})),getSourcePosition:e=>[e.sourcePos.x,e.sourcePos.y,0],getTargetPosition:e=>[e.targetPos.x,e.targetPos.y,0],getSourceColor:e=>{let t=C(e);return w(nt(t&&x?u.accent:e.status===`failing`?u.danger:u.border2),t?255:60)},getTargetColor:e=>{let t=C(e);return w(nt(t&&x?u.accent:e.status===`failing`?u.danger:u.fg4),t?255:60)},getWidth:e=>C(e)&&x||e.status===`failing`?2:1,getHeight:.3,pickable:!!s,updateTriggers:{getSourceColor:[x],getTargetColor:[x],getWidth:[x]}}),new h({id:`service-nodes`,data:c,getPosition:e=>[e.x,e.y,0],getFillColor:e=>{let t=S(e.id);return w(nt(e.status===`failing`?u.danger:e.status===`degraded`?u.warning:e.status===`healthy`?u.success:u.fg3),t?230:60)},getLineColor:e=>x===e.id?nt(u.accent):nt(u.bg1),getRadius:e=>at(e.degree,d),radiusUnits:`pixels`,stroked:!0,getLineWidth:e=>x===e.id?2:1,lineWidthUnits:`pixels`,pickable:!0,updateTriggers:{getFillColor:[x],getLineColor:[x],getLineWidth:[x]}})],te=new a.Deck({parent:i,width:m,height:r,controller:!0,deviceProps:{type:f},views:[{"@@type":`OrthographicView`,id:`v`,flipY:!0}],viewState:{target:[m/2,r/2,0],zoom:0},layers:ee(),onHover:({object:e,layer:t})=>{let n=null;e&&t?.id===`service-nodes`?n=e.id:e&&t?.id===`service-edges`&&(n=e.source),n!==x&&(x=n,te.setProps({layers:ee()}))},onClick:({object:e,layer:t})=>{!e||!t||(t.id===`service-nodes`&&o?o(e):t.id===`service-edges`&&s&&s(e))}});p.current=te})().catch(e=>{console.warn(`[@ossrandom/design-system] ServiceMap WebGL init failed; falling back to canvas:`,e),_(`canvas`)}),()=>{e=!0,p.current?.destroy(),p.current=null,i.innerHTML=``}},[g,m,r,t,n,o,s]),C.useEffect(()=>Ke(()=>{_(e=>e)}),[]),(0,S.jsx)(`div`,{ref:d,id:u,className:y(`rcs-service-map`,`rcs-service-map--${g}`,c),style:{position:`relative`,width:`100%`,height:r,...l},"data-engine":g,role:`img`,"aria-label":e[`aria-label`]??`Service map with ${t.length} services`,children:(0,S.jsx)(`div`,{className:`rcs-service-map-engine-badge`,"aria-hidden":`true`,children:g})})}function lt(e){return[{selector:`node`,style:{shape:`ellipse`,width:`data(diameter)`,height:`data(diameter)`,"background-color":e.fg3,"border-color":e.bg1,"border-width":1,label:`data(label)`,color:e.fg3,"font-family":e.fontSans,"font-size":11,"font-weight":400,"text-valign":`bottom`,"text-halign":`center`,"text-margin-y":4,"text-events":`no`,"min-zoomed-font-size":9,"z-index":10,"transition-property":`background-color, border-color, border-width, color, opacity`,"transition-duration":`120ms`}},{selector:`node[status = 'healthy']`,style:{"background-color":e.success}},{selector:`node[status = 'degraded']`,style:{"background-color":e.warning}},{selector:`node[status = 'failing']`,style:{"background-color":e.danger}},{selector:`edge`,style:{width:1,"line-color":e.border2,"target-arrow-color":e.border2,"target-arrow-shape":`triangle`,"arrow-scale":.9,"curve-style":`bezier`,label:`data(label)`,color:e.fg4,"font-family":e.fontMono,"font-size":9,"text-rotation":`autorotate`,"text-margin-y":-4,"text-opacity":0,"text-events":`no`,"z-index":1,"transition-property":`line-color, width, target-arrow-color, opacity, text-opacity`,"transition-duration":`120ms`}},{selector:`edge[status = 'failing']`,style:{"line-color":e.danger,"target-arrow-color":e.danger,width:1.5}},{selector:`.rcs-dim`,style:{opacity:.18}},{selector:`node.rcs-focus`,style:{opacity:1,"border-color":e.accent,"border-width":2,color:e.fg1,"font-weight":500,"z-index":30}},{selector:`node.rcs-neighbor`,style:{opacity:1,color:e.fg1,"z-index":20}},{selector:`edge.rcs-focus-edge`,style:{opacity:1,"line-color":e.accent,"target-arrow-color":e.accent,width:2,"text-opacity":1,color:e.fg1,"z-index":25}},{selector:`node:selected`,style:{"border-color":e.accent,"border-width":2}}]}function ut(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function dt(e){return e===`healthy`?`info`:e===`degraded`?`warning`:e===`critical`||e===`failing`?`danger`:`neutral`}var ft=C.memo(({node:e,edges:t,onClose:n,onSelectService:r})=>{let i=t.filter(t=>t.target===e.id),a=t.filter(t=>t.source===e.id),o=e.metrics.error_rate*100;return(0,S.jsxs)(T,{direction:`vertical`,size:`md`,children:[(0,S.jsx)(ce,{bordered:!0,padding:`md`,radius:`md`,title:(0,S.jsxs)(T,{size:`xs`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.id}),(0,S.jsx)(ne,{tone:dt(e.status),size:`sm`,children:e.status})]}),extra:(0,S.jsx)(ee,{icon:(0,S.jsx)(Be,{size:13}),"aria-label":`Close`,variant:`ghost`,size:`sm`,onClick:n}),children:(0,S.jsxs)(ue,{columns:2,gap:`sm`,children:[(0,S.jsx)(ue.Col,{span:1,children:(0,S.jsx)(Se,{label:`RPS`,value:Math.round(e.metrics.request_rate_rps)})}),(0,S.jsx)(ue.Col,{span:1,children:(0,S.jsx)(Se,{label:`Error Rate`,value:o.toFixed(2),unit:`%`})}),(0,S.jsx)(ue.Col,{span:1,children:(0,S.jsx)(Se,{label:`Avg Latency`,value:e.metrics.avg_latency_ms,unit:`ms`})}),(0,S.jsx)(ue.Col,{span:1,children:(0,S.jsx)(Se,{label:`P99`,value:e.metrics.p99_latency_ms,unit:`ms`})})]})}),(0,S.jsx)(ce,{bordered:!0,padding:`md`,radius:`md`,title:`Health Score`,extra:(0,S.jsx)(ne,{tone:`subtle`,size:`sm`,children:e.health_score.toFixed(2)}),children:(0,S.jsx)(he,{value:e.health_score*100,tone:e.health_score<.4?`danger`:e.health_score<.7?`warning`:`neutral`})}),i.length>0&&(0,S.jsx)(ce,{bordered:!0,padding:`md`,radius:`md`,title:`Upstream`,children:(0,S.jsx)(T,{direction:`vertical`,size:`xs`,children:i.map(e=>(0,S.jsx)(w,{variant:`ghost`,size:`sm`,block:!0,onClick:()=>r(e.source),children:(0,S.jsxs)(T,{justify:`between`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.source}),(0,S.jsxs)(ne,{tone:`subtle`,size:`sm`,children:[e.call_count,` calls`]})]})},e.source))})}),a.length>0&&(0,S.jsx)(ce,{bordered:!0,padding:`md`,radius:`md`,title:`Downstream`,children:(0,S.jsx)(T,{direction:`vertical`,size:`xs`,children:a.map(e=>(0,S.jsx)(w,{variant:`ghost`,size:`sm`,block:!0,onClick:()=>r(e.target),children:(0,S.jsxs)(T,{justify:`between`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.target}),(0,S.jsxs)(ne,{tone:`subtle`,size:`sm`,children:[e.call_count,` calls`]})]})},e.target))})}),e.alerts.length>0&&(0,S.jsx)(T,{direction:`vertical`,size:`xs`,children:e.alerts.map((e,t)=>(0,S.jsx)(O,{severity:`danger`,children:e},t))})]})}),pt=C.memo(({items:e})=>(0,S.jsx)(ce,{bordered:!0,padding:`md`,radius:`md`,children:(0,S.jsx)(T,{size:`lg`,wrap:!0,children:e.map((e,t)=>(0,S.jsxs)(C.Fragment,{children:[t>0&&(0,S.jsx)(le,{direction:`vertical`}),(0,S.jsx)(Se,{...e})]},`${t}-${String(e.label)}`))})}));function mt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e*10)/10)}function ht(e=800){let[t,n]=(0,C.useState)(()=>typeof window>`u`?e:window.innerHeight);return(0,C.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>n(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function gt(e){return e===`healthy`||e===`degraded`?e:e===`critical`||e===`failing`?`failing`:`unknown`}function _t(e){return e===`critical`||e===`failing`?`failing`:`healthy`}var vt=C.memo(({graph:e,loading:t,error:n,dashboard:r,stats:i})=>{let[a,o]=(0,C.useState)(null),[s,c]=(0,C.useState)(``),l=Ue(`(max-width: 760px)`),u=ht(),d=l?460:Math.max(460,u-320),f=e?.nodes??[],p=e?.edges??[],m=(0,C.useMemo)(()=>{let e=s.trim().toLowerCase();return f.filter(t=>!e||t.id.toLowerCase().includes(e)).map(e=>({id:e.id,label:e.id,status:gt(e.status)}))},[f,s]),h=(0,C.useMemo)(()=>{if(m.length===0)return[];let e=new Set(m.map(e=>e.id));return p.filter(t=>e.has(t.source)&&e.has(t.target)).slice(0,500).map(e=>({source:e.source,target:e.target,status:_t(e.status)}))},[p,m]),g=r?.active_services??f.length,_=r?.error_rate??0,v=i,y=e=>{if(typeof e==`number`)return e;if(typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)))return Number(e)},b=y(v?.TraceCount)??y(v?.traceCount)??r?.total_traces??0,x=y(v?.LogCount)??y(v?.logCount)??r?.total_logs??0,w=y(v?.DBSizeMB)??y(v?.db_size_mb),ee=e=>{o(f.find(t=>t.id===e.id)??null)},ne=e=>{let t=f.find(t=>t.id===e);t&&o(t)};return(0,S.jsxs)(T,{direction:`vertical`,size:`md`,style:{display:`flex`,width:`100%`},children:[(0,S.jsx)(we,{size:`sm`,title:`Service Topology`,subtitle:`Live dependency map · click a node for details`,inlineSubtitle:!0}),(0,S.jsx)(pt,{items:[{label:`Services`,value:g},{label:`Error rate`,value:_.toFixed(2),unit:`%`},{label:`Traces`,value:mt(b)},{label:`Logs`,value:mt(x)},...w!=null&&Number.isFinite(w)?[{label:`DB`,value:w.toFixed(0),unit:`MB`}]:[]]}),(0,S.jsxs)(ce,{bordered:!0,padding:`sm`,radius:`md`,extra:(0,S.jsx)(te,{value:s,onChange:e=>c(e),placeholder:`Filter services`,size:`sm`,prefix:(0,S.jsx)(Re,{size:12})}),children:[t&&(0,S.jsx)(ge,{label:`Loading service map`}),n&&(0,S.jsx)(O,{severity:`danger`,title:`Service map failed to load`,children:n}),!t&&!n&&f.length===0&&(0,S.jsx)(O,{severity:`info`,children:`No services discovered yet.`}),!t&&!n&&m.length===0&&f.length>0&&(0,S.jsx)(O,{severity:`info`,children:`No services match the filter.`}),!t&&!n&&m.length>0&&(0,S.jsx)(ct,{nodes:m,edges:h,layout:`cose-bilkent`,height:d,onNodeClick:ee})]}),(0,S.jsx)(me,{open:a!==null,onClose:()=>o(null),placement:`right`,width:l?`92vw`:420,title:a?(0,S.jsx)(`code`,{children:a.id}):void 0,description:`Service detail · upstream, downstream, alerts`,children:a&&(0,S.jsx)(ft,{node:a,edges:p,onClose:()=>o(null),onSelectService:ne})})]})});function yt(e=6e4){let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(!0),[s,c]=(0,C.useState)(null),l=(0,C.useRef)(void 0),u=(0,C.useCallback)(async()=>{try{let e=await fetch(`/api/system/graph`);if(!e.ok)throw Error(`HTTP ${e.status}`);i(e.headers.get(`X-Cache`)??``),n(await e.json()),c(null)}catch(e){c(e instanceof Error?e.message:`fetch failed`)}finally{o(!1)}},[]);return(0,C.useEffect)(()=>(u(),l.current=setInterval(u,e),()=>clearInterval(l.current)),[u,e]),{graph:t,cache:r,loading:a,error:s,reload:u}}function bt(e=3e4){let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(!0),[s,c]=(0,C.useState)(null),l=(0,C.useRef)(void 0),u=(0,C.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/api/metrics/dashboard`),fetch(`/api/stats`)]);if(!e.ok||!t.ok)throw Error(`fetch failed`);n(await e.json()),i(await t.json()),c(null)}catch(e){c(e instanceof Error?e.message:`fetch failed`)}finally{o(!1)}},[]);return(0,C.useEffect)(()=>(u(),l.current=setInterval(u,e),()=>clearInterval(l.current)),[u,e]),{dashboard:t,stats:r,loading:a,error:s,reload:u}}var xt=100,St=1e4,Ct=3e4,wt=35e3;function Tt(e){let t=(0,C.useRef)(null),n=(0,C.useRef)(e),[r,i]=(0,C.useState)(`connecting`);t.status=r;let a=(0,C.useRef)(0),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)(null),l=(0,C.useRef)(!1),u=(0,C.useRef)(()=>{});(0,C.useEffect)(()=>{n.current=e},[e]);let d=(0,C.useCallback)(()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},[]),f=(0,C.useCallback)(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null),c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),p=(0,C.useCallback)(()=>{if(l.current)return;d();let e=a.current,t=Math.min(xt*2**e,St);a.current=e+1,i(`reconnecting`),o.current=window.setTimeout(()=>{o.current=null,u.current()},t)},[d]),m=(0,C.useCallback)(()=>{f(),s.current=window.setInterval(()=>{let e=t.current;if(!(!e||e.readyState!==WebSocket.OPEN)){try{e.send(JSON.stringify({type:`ping`}))}catch{return}c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null;let e=t.current;if(e)try{e.close()}catch{}},wt)}},Ct)},[f]),h=(0,C.useCallback)(()=>{if(l.current)return;d(),f();let e=t.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}t.current=null}i(a.current===0?`connecting`:`reconnecting`);let r=window.location.protocol===`https:`?`wss:`:`ws:`,o;try{o=new WebSocket(`${r}//${window.location.host}/ws`)}catch{p();return}t.current=o,o.onopen=()=>{l.current||(a.current=0,i(`connected`),m())},o.onmessage=e=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null);try{let t=JSON.parse(e.data);t.type===`logs`&&Array.isArray(t.data)&&n.current(t.data)}catch{}},o.onerror=()=>{},o.onclose=()=>{l.current||(t.current===o&&(t.current=null),f(),i(`disconnected`),p())}},[f,d,p,m]);return(0,C.useEffect)(()=>{u.current=h},[h]),(0,C.useEffect)(()=>{l.current=!1,u.current=h,h();let e=()=>{if(document.visibilityState!==`visible`)return;let e=t.current;(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&(a.current=0,d(),u.current())},n=()=>{a.current=0,d(),u.current()};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`online`,n),()=>{l.current=!0,document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`online`,n),d(),f();let r=t.current;if(r){r.onopen=null,r.onmessage=null,r.onerror=null,r.onclose=null;try{r.close()}catch{}t.current=null}}},[]),t}function Et(){let[e,t]=(0,C.useState)(`services`),n=yt(),r=bt();return(0,S.jsx)(Te,{header:(0,S.jsx)(We,{view:e,onNavigate:t,wsConnected:!!Tt(()=>void 0).current}),children:(0,S.jsx)(vt,{graph:n.graph,loading:n.loading,error:n.error,dashboard:r.dashboard,stats:r.stats})})}(0,ke.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(C.StrictMode,{children:(0,S.jsxs)(Oe,{mode:`dark`,children:[(0,S.jsx)(Et,{}),(0,S.jsx)(xe,{})]})}));export{o as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-Bi057qLa.js b/internal/ui/dist/assets/index-Bi057qLa.js deleted file mode 100644 index 429316a..0000000 --- a/internal/ui/dist/assets/index-Bi057qLa.js +++ /dev/null @@ -1,9 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function T(e,t){return te(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function D(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=T(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-eet&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=T,E=function(){re.postMessage(null)}}else E=function(){_(T,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1le||(e.current=ce[le],ce[le]=null,le--)}function j(e,t){le++,ce[le]=e.current,e.current=t}var fe=ue(null),pe=ue(null),me=ue(null),he=ue(null);function ge(e,t){switch(j(me,t),j(pe,e),j(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(fe),j(fe,e)}function _e(){de(fe),de(pe),de(me)}function ve(e){e.memoizedState!==null&&j(he,e);var t=fe.current,n=Hd(t,e.type);t!==n&&(j(pe,e),j(fe,n))}function ye(e){pe.current===e&&(de(fe),de(pe)),he.current===e&&(de(he),Qf._currentValue=se)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function M(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,`passive`,{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=xn(),bn=yn=vn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Fr=hn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Ht(r)||(r=Ir,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rr&&kr(Rr,r)||(Rr=r,r=Ed(Lr,`onSelect`),0>=o,i-=o,Mi=1<<32-We(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),P&&Pi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),P&&Pi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return P&&Pi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),P&&Pi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=yi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=vi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Si(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Na(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,sa(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=di(e),ui(e,null,n),t}return si(e,r,t,n),di(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};k.T=s,Ls(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,xa(c,r),pu(e)):Is(e,t,r,pu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,se,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},pu())}function As(){return oa(Qf)}function js(){return B().memoizedState}function Ms(){return B().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ja(n);var r=Ya(t,e,n);r!==null&&(hu(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ci(e,t,n,r),n!==null&&(hu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,pu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o))return si(e,t,i,0),K===null&&oi(),!1}catch{}if(n=ci(e,t,i,r),n!==null)return hu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ci(e,n,r,2),t!==null&&hu(t,e,2)}function Rs(e){var t=e.alternate;return e===I||t!==null&&t===I}function zs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var Vs={readContext:oa,use:Io,useCallback:z,useContext:z,useEffect:z,useImperativeHandle:z,useLayoutEffect:z,useInsertionEffect:z,useMemo:z,useReducer:z,useRef:z,useState:z,useDebugValue:z,useDeferredValue:z,useTransition:z,useSyncExternalStore:z,useId:z,useHostTransitionStatus:z,useFormState:z,useActionState:z,useOptimistic:z,useMemoCache:z,useCacheRefresh:z};Vs.useEffectEvent=z;var Hs={readContext:oa,use:Io,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:oa,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(bo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(bo){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ps.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(No(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,I,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=No();if(P){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=K.identifierPrefix;if(P){var n=Ni,r=Mi;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ft]=t,o[pt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return H(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ui(t,!0)}else e=Bd(e).createTextNode(r),e[ft]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ki(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ft]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ft]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),a=!1}else a=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),H(t),null);case 4:return _e(),e===null&&Sd(t.stateNode.containerInfo),H(t),null;case 10:return ea(t.type),H(t),null;case 19:if(de(F),r=t.memoizedState,r===null)return H(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=go(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_i(n,e),n=n.sibling;return j(F,F.current&1|2),P&&Pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>tu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!P)return H(t),null}else 2*Me()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(H(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=F.current,j(F,a?n&1|2:n&1),P&&Pi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(fa),H(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Li(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(fa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(F),null;case 4:return _e(),null;case 10:return ea(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&de(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(fa),null;case 25:return null;default:return null}}function Hc(e,t){switch(Li(t),t.tag){case 3:ea(fa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:de(F);break;case 10:ea(t.type);break;case 22:case 23:ho(t),so(),e!==null&&de(Ca);break;case 24:ea(fa)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){Z(e,e.return,t)}}}function Kc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[pt]=t}catch(t){Z(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ft]=e,t[pt]=n}catch(t){Z(e,e.return,t)}}var nl=!1,U=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[ft]=e,Tt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=a,k.T=r,Vu(e,t)}}function Wu(e,t,n){t=wi(n,t),t=tc(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(nt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=wi(n,e),n=nc(2),r=Ya(t,n,2),r!==null&&(rc(n,r,t,e),nt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Me()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=et()),e=li(e,t),e!==null&&(nt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Oe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Qe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||M(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Me(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=wt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Tt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=wt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Tt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=me.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=wt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=wt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Wt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Wt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Tt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()}));function y(...e){let t=``;for(let n of e)n&&(t+=t?` `+n:n);return t}var b=0;function x(e=`rcs`){return b+=1,`${e}-${b}`}var S=v(),C=c(u(),1),w=C.forwardRef(function(e,t){let{variant:n=`secondary`,size:r=`md`,shape:i=`rect`,loading:a=!1,disabled:o=!1,block:s=!1,iconLeft:c,iconRight:l,type:u=`button`,children:d,onClick:f,className:p,style:m,id:h,"data-testid":g,"aria-label":_,"aria-labelledby":v,"aria-describedby":b}=e;return(0,S.jsxs)(`button`,{ref:t,id:h,"data-testid":g,type:u,className:y(`rcs-button`,`rcs-button--${n}`,`rcs-button--${r}`,i!==`rect`&&`rcs-button--${i}`,s&&`rcs-button--block`,p),style:m,disabled:o||a,"aria-disabled":o||a||void 0,"aria-busy":a||void 0,"aria-label":_,"aria-labelledby":v,"aria-describedby":b,onClick:f,children:[a?(0,S.jsx)(`span`,{className:`rcs-button-spinner`,"aria-hidden":!0}):c,d,l]})}),ee=C.forwardRef(function(e,t){let{icon:n,round:r=!1,"aria-label":i,...a}=e;return(0,S.jsx)(w,{ref:t,...a,shape:r?`circle`:`square`,"aria-label":i,children:n})}),te=C.forwardRef(function(e,t){let{value:n,defaultValue:r,placeholder:i,size:a=`md`,status:o=`default`,disabled:s=!1,readOnly:c=!1,invalid:l=!1,prefix:u,suffix:d,clearable:f=!1,type:p=`text`,autoFocus:m=!1,onChange:h,onFocus:g,onBlur:_,onKeyDown:v,className:b,style:x,id:w,"data-testid":ee,"aria-label":te,"aria-labelledby":T,"aria-describedby":E}=e,ne=n!==void 0,[re,ie]=C.useState(r??``),ae=ne?n:re,D=C.useRef(null);C.useImperativeHandle(t,()=>D.current);let O=l?`error`:o;return(0,S.jsxs)(`span`,{className:y(`rcs-input-wrap`,`rcs-input-wrap--${a}`,b),style:x,"data-status":O,"data-disabled":s||void 0,children:[u&&(0,S.jsx)(`span`,{className:`rcs-input-affix rcs-input-affix--left`,children:u}),(0,S.jsx)(`input`,{ref:D,id:w,"data-testid":ee,className:`rcs-input`,type:p,value:ae,placeholder:i,disabled:s,readOnly:c,autoFocus:m,"aria-invalid":O===`error`||void 0,"aria-label":te,"aria-labelledby":T,"aria-describedby":E,onChange:e=>{ne||ie(e.target.value),h?.(e.target.value,e)},onFocus:g,onBlur:_,onKeyDown:v}),f&&ae&&!s&&!c&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-input-clear`,"aria-label":`Clear`,onClick:e=>{let t=D.current;ne||ie(``),t&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(t,``),t.dispatchEvent(new Event(`input`,{bubbles:!0}))),h?.(``,e)},children:`×`}),d&&(0,S.jsx)(`span`,{className:`rcs-input-affix rcs-input-affix--right`,children:d})]})});C.forwardRef(function(e,t){let{value:n,defaultValue:r,placeholder:i,rows:a=4,autoResize:o=!1,maxLength:s,showCount:c=!1,size:l=`md`,status:u=`default`,disabled:d=!1,readOnly:f=!1,invalid:p=!1,onChange:m,onFocus:h,onBlur:g,onKeyDown:_,autoFocus:v,className:b,style:x,id:w,"data-testid":ee,"aria-label":te,"aria-labelledby":T,"aria-describedby":E}=e,ne=n!==void 0,[re,ie]=C.useState(r??``),ae=ne?n:re,D=C.useRef(null);C.useImperativeHandle(t,()=>D.current),C.useLayoutEffect(()=>{if(!o)return;let e=D.current;e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)},[ae,o]);let O=p?`error`:u;return(0,S.jsxs)(`span`,{style:{display:`block`,width:`100%`,...x},children:[(0,S.jsx)(`textarea`,{ref:D,id:w,"data-testid":ee,className:y(`rcs-textarea`,`rcs-textarea--${l}`,b),rows:a,value:ae,placeholder:i,maxLength:s,disabled:d,readOnly:f,autoFocus:v,"aria-invalid":O===`error`||void 0,"aria-label":te,"aria-labelledby":T,"aria-describedby":E,"data-status":O,onChange:e=>{ne||ie(e.target.value),m?.(e.target.value,e)},onFocus:h,onBlur:g,onKeyDown:_}),c&&(0,S.jsxs)(`span`,{className:`rcs-textarea-count`,children:[ae.length,s?` / ${s}`:``]})]})});function T(e){let{tone:t=`neutral`,size:n=`md`,icon:r,closable:i=!1,onClose:a,children:o,className:s,style:c,id:l}=e;return(0,S.jsxs)(`span`,{id:l,className:y(`rcs-badge`,`rcs-badge--${t}`,n!==`md`&&`rcs-badge--${n}`,s),style:c,children:[r&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:r}),o,i&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-badge-x`,"aria-label":`Remove`,onClick:a,children:`×`})]})}var E={xs:4,sm:8,md:12,lg:16,xl:24};function ne(e){return e===void 0?12:typeof e==`number`?e:E[e]}var re={none:`0`,sm:`4px`,md:`6px`,lg:`8px`,pill:`9999px`,circle:`50%`};function ie(e){return e===void 0?`var(--radius-md)`:typeof e==`number`?`${e}px`:re[e]}var ae={none:`none`,sm:`var(--shadow-sm)`,md:`var(--shadow-md)`,lg:`var(--shadow-lg)`,overlay:`var(--shadow-lg)`};function D(e){let{title:t,subtitle:n,extra:r,footer:i,bordered:a=!0,hoverable:o=!1,padding:s,radius:c,shadow:l=`none`,children:u,className:d,style:f,id:p}=e,m={borderRadius:ie(c),boxShadow:ae[l],border:a?void 0:`0`,...f};return(0,S.jsxs)(`div`,{id:p,className:y(`rcs-card`,d),style:m,"data-hoverable":o||void 0,children:[(t||r)&&(0,S.jsxs)(`div`,{className:`rcs-card-header`,children:[(0,S.jsxs)(`div`,{children:[t&&(0,S.jsx)(`div`,{className:`rcs-card-title`,children:t}),n&&(0,S.jsx)(`div`,{className:`rcs-card-subtitle`,children:n})]}),r&&(0,S.jsx)(`div`,{className:`rcs-card-extra`,children:r})]}),(0,S.jsx)(`div`,{className:`rcs-card-body`,style:s===void 0?void 0:{padding:ne(s)},children:u}),i&&(0,S.jsx)(`div`,{className:`rcs-card-footer`,children:i})]})}function O(e){let{direction:t=`horizontal`,size:n=`sm`,align:r,justify:i,wrap:a=!1,split:o,children:s,className:c,style:l,id:u}=e,d=ne(n),f=C.Children.toArray(s);return(0,S.jsx)(`div`,{id:u,className:y(`rcs-space`,t===`vertical`&&`rcs-space--vertical`,a&&`rcs-space--wrap`,c),style:{gap:d,alignItems:r,justifyContent:i,flexDirection:t===`vertical`?`column`:`row`,...l},children:f.map((e,t)=>(0,S.jsxs)(C.Fragment,{children:[e,o&&te.key===m),g=(e,t)=>{t||(d||p(e),o?.(e))};return(0,S.jsxs)(`div`,{id:u,"data-scrollable":s||void 0,className:y(`rcs-tabs`,`rcs-tabs--${i}`,`rcs-tabs--${a}`,c),style:l,children:[(0,S.jsx)(`div`,{className:`rcs-tabs-nav`,"data-scrollable":s||void 0,role:`tablist`,children:t.map(e=>(0,S.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.key===m,disabled:e.disabled,"data-active":e.key===m||void 0,className:`rcs-tabs-tab`,onClick:()=>g(e.key,e.disabled),children:[e.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.icon}),(0,S.jsx)(`span`,{children:e.label}),e.badge&&(0,S.jsx)(`span`,{style:{marginLeft:4},children:e.badge})]},e.key))}),h?.content&&(0,S.jsx)(`div`,{className:`rcs-tabs-content`,role:`tabpanel`,children:h.content})]})}function le(e){let{items:t,selectedKeys:n,defaultSelectedKeys:r,mode:i=`vertical`,onSelect:a,className:o,style:s,id:c}=e,l=n!==void 0,[u,d]=C.useState(r??[]),f=l?n:u;return(0,S.jsx)(`div`,{id:c,role:`menu`,className:y(`rcs-menu`,i===`horizontal`&&`rcs-menu--horizontal`,o),style:s,children:t.map((e,t)=>{if(`type`in e&&e.type===`separator`)return(0,S.jsx)(`div`,{className:`rcs-menu-separator`,role:`separator`},`sep-${t}`);if(`type`in e&&e.type===`label`)return(0,S.jsx)(`div`,{className:`rcs-menu-label`,children:e.label},`lbl-${t}`);let n=e;return(0,S.jsxs)(`div`,{role:`menuitem`,className:`rcs-menu-item`,"data-selected":f.includes(n.key)||void 0,"data-destructive":n.destructive||void 0,"data-disabled":n.disabled||void 0,"aria-disabled":n.disabled||void 0,onClick:()=>{n.disabled||(l||d([n.key]),a?.(n.key))},children:[n.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:n.icon}),(0,S.jsx)(`span`,{children:n.label}),n.badge&&(0,S.jsx)(`span`,{style:{marginLeft:`auto`},children:n.badge}),n.shortcut&&(0,S.jsx)(`span`,{className:`rcs-menu-item-shortcut`,children:n.shortcut})]},n.key)})})}function ue(e){let{items:t,separator:n=`/`,maxItems:r,className:i,style:a,id:o}=e,s=t;return r&&t.length>r&&(s=[t[0],{label:`…`},...t.slice(t.length-(r-2))]),(0,S.jsx)(`nav`,{id:o,"aria-label":`Breadcrumb`,className:y(`rcs-breadcrumb`,i),style:a,children:s.map((e,t)=>{let r=t===s.length-1,i=e.href?(0,S.jsxs)(`a`,{href:e.href,onClick:e.onClick,children:[e.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,style:{marginRight:4},children:e.icon}),e.label]}):e.onClick?(0,S.jsx)(`button`,{type:`button`,onClick:e.onClick,style:{background:`none`,border:0,padding:0,color:`inherit`,cursor:`pointer`,font:`inherit`},children:e.label}):(0,S.jsx)(`span`,{children:e.label});return(0,S.jsxs)(C.Fragment,{children:[(0,S.jsx)(`span`,{className:r?`rcs-breadcrumb-item--last`:void 0,children:i}),!r&&(0,S.jsx)(`span`,{className:`rcs-breadcrumb-sep`,"aria-hidden":!0,children:n})]},t)})})}var de={info:`ⓘ`,success:`✓`,warning:`⚠`,danger:`✕`};function j(e){let{severity:t,title:n,children:r,closable:i=!1,icon:a,action:o,onClose:s,className:c,style:l,id:u}=e;return(0,S.jsxs)(`div`,{id:u,role:`alert`,className:y(`rcs-alert`,`rcs-alert--${t}`,c),style:l,children:[a!==!1&&(0,S.jsx)(`span`,{className:`rcs-alert-icon`,"aria-hidden":!0,children:a??de[t]}),(0,S.jsxs)(`div`,{className:`rcs-alert-body`,children:[n&&(0,S.jsx)(`div`,{className:`rcs-alert-title`,children:n}),r&&(0,S.jsx)(`div`,{className:`rcs-alert-content`,children:r}),o&&(0,S.jsx)(`div`,{className:`rcs-alert-action`,children:o})]}),i&&(0,S.jsx)(`button`,{type:`button`,className:`rcs-alert-close`,"aria-label":`Dismiss`,onClick:s,children:`×`})]})}function fe(e,t){C.useEffect(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}function pe(e){let{open:t,title:n,description:r,placement:i=`right`,width:a=360,closeOnEsc:o=!0,closeOnBackdrop:s=!0,footer:c,children:l,onClose:u,className:d,style:f,id:p}=e;if(fe(t&&o,u),!t)return null;let m=typeof a==`number`?`${a}px`:a,h={...f};return i===`left`||i===`right`?h.width=m:h.height=m,(0,S.jsx)(`div`,{className:`rcs-modal-backdrop`,role:`dialog`,"aria-modal":`true`,style:{alignItems:i===`top`?`flex-start`:i===`bottom`?`flex-end`:`stretch`,justifyItems:i===`left`?`flex-start`:i===`right`?`flex-end`:`stretch`,padding:0},onClick:e=>{s&&e.target===e.currentTarget&&u()},children:(0,S.jsxs)(`div`,{id:p,className:y(`rcs-drawer`,`rcs-drawer--${i}`,d),style:h,children:[(n||r)&&(0,S.jsxs)(`div`,{className:`rcs-modal-header`,children:[n&&(0,S.jsx)(`h2`,{className:`rcs-modal-title`,children:n}),r&&(0,S.jsx)(`div`,{className:`rcs-modal-desc`,children:r})]}),(0,S.jsx)(`div`,{className:`rcs-modal-body`,style:{flex:1,overflow:`auto`},children:l}),c&&(0,S.jsx)(`div`,{className:`rcs-modal-footer`,children:c})]})})}function me(e){let{value:t,indeterminate:n=!1,variant:r=`linear`,size:i=`md`,tone:a=`neutral`,showValue:o=!1,className:s,style:c,id:l}=e,u=Math.max(0,Math.min(100,t));if(r===`circular`){let e=i===`lg`?24:i===`sm`?14:18,t=i===`lg`?3:2,n=2*Math.PI*e,r=u/100*n;return(0,S.jsx)(`span`,{id:l,className:y(`rcs-progress`,s),style:c,role:`progressbar`,"aria-valuenow":u,children:(0,S.jsxs)(`svg`,{width:e*2+t*2,height:e*2+t*2,children:[(0,S.jsx)(`circle`,{cx:e+t,cy:e+t,r:e,stroke:`var(--bg-3)`,strokeWidth:t,fill:`none`}),(0,S.jsx)(`circle`,{cx:e+t,cy:e+t,r:e,stroke:a===`danger`?`var(--danger)`:a===`warning`?`var(--warning)`:`var(--bg-inverse)`,strokeWidth:t,fill:`none`,strokeDasharray:`${r} ${n}`,strokeLinecap:`round`,transform:`rotate(-90 ${e+t} ${e+t})`,style:{transition:`stroke-dasharray 0.3s var(--ease-out-quart)`}})]})})}return(0,S.jsxs)(`div`,{id:l,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n?void 0:u,className:y(`rcs-progress`,`rcs-progress--${i}`,s),style:c,"data-tone":a,"data-indeterminate":n||void 0,children:[(0,S.jsx)(`div`,{className:`rcs-progress-track`,children:(0,S.jsx)(`div`,{className:`rcs-progress-fill`,style:{width:`${u}%`}})}),o&&(0,S.jsxs)(`div`,{className:`rcs-progress-value`,children:[Math.round(u),`%`]})]})}function he(e){let{size:t=`md`,tone:n=`neutral`,label:r,className:i,style:a,id:o}=e;return(0,S.jsxs)(`span`,{id:o,className:y(`rcs-spin`,`rcs-spin--${t}`,i),style:a,"data-tone":n,role:`status`,children:[(0,S.jsx)(`span`,{className:`rcs-spin-glyph`,"aria-hidden":!0}),r&&(0,S.jsx)(`span`,{children:r})]})}var ge=[],_e=new Set;function ve(){for(let e of _e)e([...ge])}var ye={show(e){let t=e.id??x(`toast`),n={...e,id:t};ge.push(n),ve();let r=e.duration??4e3;return r>0&&window.setTimeout(()=>ye.dismiss(t),r),t},dismiss(e){let t=ge.findIndex(t=>t.id===e);t>=0&&(ge.splice(t,1)[0].onDismiss?.(),ve())},async promise(e,t){let n=ye.show({severity:`info`,title:t.loading,duration:0});try{let r=await e;return ye.dismiss(n),ye.show({severity:`success`,title:t.success}),r}catch(e){throw ye.dismiss(n),ye.show({severity:`danger`,title:t.error}),e}}};function be(){let[e,t]=C.useState([]);return C.useEffect(()=>(_e.add(t),()=>{_e.delete(t)}),[]),(0,S.jsx)(`div`,{className:`rcs-toast-region`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,S.jsxs)(`div`,{className:y(`rcs-toast`,`rcs-toast--${e.severity??`info`}`),role:`status`,children:[(0,S.jsx)(`span`,{className:`rcs-toast-icon`,"aria-hidden":!0,children:de[e.severity??`info`]}),(0,S.jsxs)(`div`,{style:{flex:1},children:[(0,S.jsx)(`div`,{className:`rcs-toast-title`,children:e.title}),e.description&&(0,S.jsx)(`div`,{className:`rcs-toast-desc`,children:e.description})]}),e.action&&(0,S.jsx)(`button`,{className:`rcs-toast-action`,onClick:()=>{e.action.onClick(),ye.dismiss(e.id)},children:e.action.label}),(0,S.jsx)(`button`,{className:`rcs-input-clear`,"aria-label":`Dismiss`,onClick:()=>ye.dismiss(e.id),children:`×`})]},e.id))})}function xe(e){let{columns:t,data:n,rowKey:r,density:i=`default`,bordered:a=!1,striped:o=!1,stickyHeader:s=!1,loading:c=!1,empty:l=`No data`,selection:u=`none`,selectedKeys:d,onSelectionChange:f,onSort:p,onRowClick:m,className:h,style:g,id:_,"data-testid":v}=e,[b,x]=C.useState(null),[w,ee]=C.useState(`asc`),te=e=>typeof r==`function`?r(e):e[r],T=e=>{if(!e.sortable)return;let t=`asc`;b===e.key&&(t=w===`asc`?`desc`:`asc`),x(e.key),ee(t),p?.(e.key,t)},E=e=>{if(!(!f||u===`none`))if(u===`single`)f([e]);else{let t=new Set(d??[]);t.has(e)?t.delete(e):t.add(e),f(Array.from(t))}};return(0,S.jsx)(`div`,{id:_,"data-testid":v,className:y(`rcs-table-wrap`,h),style:g,children:(0,S.jsxs)(`table`,{className:`rcs-table`,"data-density":i,"data-bordered":a||void 0,"data-striped":o||void 0,"data-sticky-header":s||void 0,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{children:[u!==`none`&&(0,S.jsx)(`th`,{style:{width:36},children:u===`multi`&&(0,S.jsx)(`input`,{type:`checkbox`,checked:!!d?.length&&d.length===n.length,onChange:e=>f?.(e.target.checked?n.map(te):[])})}),t.map(e=>(0,S.jsx)(`th`,{className:y(e.sortable&&`rcs-table-sortable`,e.align===`right`&&`rcs-table-align-right`,e.align===`center`&&`rcs-table-align-center`),style:{width:e.width},"data-sort":b===e.key?w:void 0,onClick:()=>T(e),children:e.title},e.key))]})}),(0,S.jsx)(`tbody`,{children:c?(0,S.jsx)(`tr`,{children:(0,S.jsx)(`td`,{colSpan:t.length+(u===`none`?0:1),className:`rcs-table-empty`,children:`Loading…`})}):n.length===0?(0,S.jsx)(`tr`,{children:(0,S.jsx)(`td`,{colSpan:t.length+(u===`none`?0:1),className:`rcs-table-empty`,children:l})}):n.map((e,n)=>{let r=te(e),i=d?.includes(r);return(0,S.jsxs)(`tr`,{"data-selected":i||void 0,onClick:()=>m?.(e,n),children:[u!==`none`&&(0,S.jsx)(`td`,{onClick:e=>e.stopPropagation(),children:(0,S.jsx)(`input`,{type:u===`multi`?`checkbox`:`radio`,checked:!!i,onChange:()=>E(r)})}),t.map(t=>{let r=t.dataKey?e[t.dataKey]:void 0,i=t.render?t.render(r,e,n):r;return(0,S.jsx)(`td`,{className:y(t.align===`right`&&`rcs-table-align-right`,t.align===`center`&&`rcs-table-align-center`),children:i},t.key)})]},r)})})]})})}function Se(e){let{label:t,value:n,unit:r,delta:i,sparkline:a,className:o,style:s,id:c}=e;return(0,S.jsxs)(`div`,{id:c,className:y(`rcs-stat`,o),style:s,children:[(0,S.jsx)(`div`,{className:`rcs-stat-label`,children:t}),(0,S.jsxs)(`div`,{className:`rcs-stat-value`,children:[(0,S.jsx)(`span`,{children:n}),r&&(0,S.jsx)(`span`,{className:`rcs-stat-unit`,children:r})]}),i&&(0,S.jsxs)(`span`,{className:`rcs-stat-delta`,"data-tone":i.tone??`neutral`,children:[i.direction===`up`?`↑`:`↓`,i.value,`%`]}),a&&a.length>1&&(0,S.jsx)(Ce,{data:a})]})}function Ce({data:e}){let t=Math.min(...e),n=Math.max(...e)-t||1;return(0,S.jsx)(`svg`,{viewBox:`0 0 80 24`,className:`rcs-stat-spark`,preserveAspectRatio:`none`,children:(0,S.jsx)(`polyline`,{points:e.map((r,i)=>`${i/(e.length-1)*80},${24-(r-t)/n*24}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`})})}function we(e){let{title:t,subtitle:n,breadcrumbs:r,tabs:i,actions:a,badge:o,avatar:s,back:c,size:l=`md`,inlineSubtitle:u,backInline:d,className:f,style:p,id:m}=e,h=c&&!d,g=c&&d;return(0,S.jsxs)(`div`,{id:m,className:y(`rcs-page-header`,`rcs-page-header--${l}`,f),"data-inline-subtitle":u||void 0,"data-back-inline":d||void 0,style:p,children:[h&&(0,S.jsxs)(`button`,{type:`button`,className:`rcs-page-header-back`,onClick:c.onClick,children:[`← `,c.label??`Back`]}),r&&r.length>0&&(0,S.jsx)(`div`,{style:{marginBottom:8},children:(0,S.jsx)(ue,{items:r})}),(0,S.jsxs)(`div`,{className:`rcs-page-header-row`,children:[(0,S.jsxs)(`div`,{className:`rcs-page-header-title`,children:[g&&(0,S.jsx)(`button`,{type:`button`,"aria-label":c.label??`Back`,className:`rcs-page-header-back-inline`,onClick:c.onClick,children:`←`}),s,(0,S.jsxs)(`div`,{className:`rcs-page-header-title-text`,children:[(0,S.jsxs)(`h1`,{children:[t,o&&(0,S.jsx)(`span`,{style:{marginLeft:8},children:o})]}),n&&(0,S.jsx)(`div`,{className:`rcs-page-header-subtitle`,children:n})]})]}),a&&(0,S.jsx)(`div`,{className:`rcs-page-header-actions`,children:a})]}),i&&i.length>0&&(0,S.jsx)(`div`,{className:`rcs-page-header-tabs`,children:(0,S.jsx)(ce,{items:i,variant:`line`})})]})}function Te(e){let{header:t,sidebar:n,footer:r,sidebarWidth:i=240,sidebarCollapsible:a,children:o,className:s,style:c,id:l}=e;return(0,S.jsxs)(`div`,{id:l,className:y(`rcs-app-shell`,s),style:{"--rcs-sidebar-w":`${i}px`,...c},children:[t&&(0,S.jsx)(`header`,{className:`rcs-app-shell-header`,children:t}),(0,S.jsxs)(`div`,{className:`rcs-app-shell-body`,"data-has-sidebar":!!n||void 0,children:[n&&(0,S.jsx)(`aside`,{className:`rcs-app-shell-sidebar`,children:n}),(0,S.jsx)(`main`,{className:`rcs-app-shell-main`,children:o})]}),r&&(0,S.jsx)(`footer`,{className:`rcs-app-shell-footer`,children:r})]})}var Ee=C.createContext(null),De={"signal-red":`#E60000`,"signal-red-700":`#9E0000`,"signal-red-900":`#520000`,"cod-gray":`#1C1C1C`,"cod-gray-700":`#2B2B2B`,"cod-gray-500":`#5A5A5A`,"cod-gray-300":`#A6A6A6`,"cod-gray-100":`#F5F5F5`,"cod-gray-050":`#FAFAFA`,white:`#FFFFFF`};function Oe(e){let{mode:t,accent:n,fontFamily:r,children:i}=e,[a,o]=C.useState(t??`light`),s=t??a;C.useEffect(()=>{typeof document>`u`||document.documentElement.setAttribute(`data-theme`,s)},[s]),C.useEffect(()=>{typeof document>`u`||!n||document.documentElement.style.setProperty(`--accent`,De[n])},[n]),C.useEffect(()=>{typeof document>`u`||!r||(r.sans&&document.documentElement.style.setProperty(`--font-sans`,r.sans),r.mono&&document.documentElement.style.setProperty(`--font-mono`,r.mono))},[r]);let c=C.useMemo(()=>({mode:s,setMode:e=>o(e),toggle:()=>o(e=>e===`light`?`dark`:`light`)}),[s]);return(0,S.jsx)(Ee.Provider,{value:c,children:i})}var ke=g(),Ae=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),je=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Me={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ne=(0,C.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,C.createElement)(`svg`,{ref:c,...Me,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:je(`lucide`,i),...s},[...o.map(([e,t])=>(0,C.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Pe=(e,t)=>{let n=(0,C.forwardRef)(({className:n,...r},i)=>(0,C.createElement)(Ne,{ref:i,iconNode:t,className:je(`lucide-${Ae(e)}`,n),...r}));return n.displayName=`${e}`,n},Fe=Pe(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ie=Pe(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Le=Pe(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Re=Pe(`Menu`,[[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}],[`line`,{x1:`4`,x2:`20`,y1:`6`,y2:`6`,key:`1owob3`}],[`line`,{x1:`4`,x2:`20`,y1:`18`,y2:`18`,key:`yk5zj1`}]]),ze=Pe(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),Be=Pe(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ve=Pe(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),He=Pe(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Ue=Pe(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),We=Pe(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ge=Pe(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Ke=Pe(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),qe=`oc-theme`;function Je(){let[e,t]=(0,C.useState)(()=>localStorage.getItem(qe)??`dark`);return(0,C.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e),localStorage.setItem(qe,e)},[e]),{theme:e,toggle:()=>t(e=>e===`dark`?`light`:`dark`)}}function Ye(e){let[t,n]=(0,C.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches);return(0,C.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Xe=[{key:`services`,label:`Service Map`},{key:`traces`,label:`Traces`},{key:`logs`,label:`Logs`},{key:`mcp`,label:`MCP`}],Ze=[{key:`services`,label:`Service Map`,icon:(0,S.jsx)(Be,{size:14})},{key:`traces`,label:`Traces`,icon:(0,S.jsx)(He,{size:14})},{key:`logs`,label:`Logs`,icon:(0,S.jsx)(Ve,{size:14})},{key:`mcp`,label:`MCP Endpoint`,icon:(0,S.jsx)(Ge,{size:14})}];function Qe({view:e,onNavigate:t,wsConnected:n}){let{theme:r,toggle:i}=Je(),a=Ye(`(max-width: 760px)`),[o,s]=(0,C.useState)(!1),c=(0,S.jsx)(ee,{icon:r===`dark`?(0,S.jsx)(We,{size:15}):(0,S.jsx)(ze,{size:15}),"aria-label":`Toggle theme`,variant:`ghost`,size:`sm`,shape:`circle`,onClick:i}),l=(0,S.jsx)(T,{tone:n?`info`:`danger`,size:`sm`,children:n?`live`:`offline`});return a?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O,{justify:`between`,align:`center`,style:{padding:`0.5rem 0.75rem`},children:[(0,S.jsxs)(O,{size:`sm`,align:`center`,children:[(0,S.jsx)(ee,{icon:(0,S.jsx)(Re,{size:16}),"aria-label":`Open navigation`,variant:`ghost`,size:`sm`,onClick:()=>s(!0)}),(0,S.jsx)(`strong`,{children:`OtelContext`})]}),(0,S.jsxs)(O,{size:`xs`,align:`center`,children:[l,c]})]}),(0,S.jsx)(pe,{open:o,onClose:()=>s(!1),placement:`left`,width:`min(280px, 86vw)`,title:`OtelContext`,children:(0,S.jsx)(le,{mode:`vertical`,items:Ze,selectedKeys:[e],onSelect:e=>{t(e),s(!1)}})})]}):(0,S.jsxs)(O,{justify:`between`,align:`center`,style:{padding:`0.4rem 1rem`},children:[(0,S.jsxs)(O,{size:`md`,align:`center`,children:[(0,S.jsx)(`strong`,{children:`OtelContext`}),(0,S.jsx)(ce,{items:Xe,value:e,variant:`line`,onChange:e=>t(e)})]}),(0,S.jsxs)(O,{size:`sm`,align:`center`,children:[l,c]})]})}var M={fg1:`#1C1C1C`,fg2:`#3D3D3D`,fg3:`#5A5A5A`,fg4:`#A6A6A6`,bg1:`#FFFFFF`,bg2:`#FAFAFA`,bg3:`#F5F5F5`,border1:`#E5E5E5`,border2:`#D4D4D4`,accent:`#E60000`,accentSoft:`rgba(230,0,0,0.08)`,success:`#1F9E5C`,warning:`#D98E2B`,danger:`#E60000`,info:`#2D73D9`,series:[`#E60000`,`#1C1C1C`,`#5A5A5A`,`#2D73D9`,`#1F9E5C`,`#D98E2B`,`#9E0000`,`#A6A6A6`],fontSans:`Inter, system-ui, sans-serif`,fontMono:`'JetBrains Mono', monospace`,mode:`light`};function $e(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function et(){if(typeof window>`u`)return M;let e=document.documentElement.getAttribute(`data-theme`)??`light`,t=$e(`--fg-1`,M.fg1),n=$e(`--fg-2`,M.fg2),r=$e(`--fg-3`,M.fg3),i=$e(`--fg-4`,M.fg4),a=$e(`--bg-1`,M.bg1),o=$e(`--bg-2`,M.bg2),s=$e(`--bg-3`,M.bg3),c=$e(`--border-1`,M.border1),l=$e(`--border-2`,M.border2),u=$e(`--accent`,M.accent);return{fg1:t,fg2:n,fg3:r,fg4:i,bg1:a,bg2:o,bg3:s,border1:c,border2:l,accent:u,accentSoft:$e(`--accent-soft`,M.accentSoft),success:$e(`--success`,M.success),warning:$e(`--warning`,M.warning),danger:$e(`--danger`,M.danger),info:$e(`--info`,M.info),series:e===`dark`?[u,`#F5F5F5`,`#A6A6A6`,`#5BA0F2`,`#3FBE83`,`#E5A65A`,`#FF6464`,`#7A7A7A`]:[u,`#1C1C1C`,`#5A5A5A`,`#2D73D9`,`#1F9E5C`,`#D98E2B`,`#9E0000`,`#A6A6A6`],fontSans:$e(`--font-sans`,M.fontSans),fontMono:$e(`--font-mono`,M.fontMono),mode:e}}function tt(e){if(typeof window>`u`)return()=>{};let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()}var nt=`modulepreload`,rt=function(e){return`/`+e},it={},at=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=rt(t,n),t in it)return;it[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:nt,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ot=null;function st(){if(typeof window>`u`)return{webgl2:!1,webgpu:!1,devicePixelRatio:1,maxTextureSize:0};if(ot)return{...ot,devicePixelRatio:window.devicePixelRatio||1,maxTextureSize:0};let e=!1,t=0;try{let n=document.createElement(`canvas`).getContext(`webgl2`);n&&(e=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE))}catch{}let n=`gpu`in navigator&&typeof navigator.gpu==`object`;return ot={webgl2:e,webgpu:n},{webgl2:e,webgpu:n,devicePixelRatio:window.devicePixelRatio||1,maxTextureSize:t}}function ct(e,t,n=5e4){let r=st();return e===`canvas`?`canvas`:e===`webgl`?r.webgl2?`webgl`:`canvas`:e===`webgpu`?r.webgpu?`webgpu`:r.webgl2?`webgl`:`canvas`:r.webgpu&&t>n?`webgpu`:r.webgl2&&t>n?`webgl`:`canvas`}var lt=null;async function ut(){if(lt)return lt;try{let e=await at(()=>import(`./design-system-IOKLDoaG.js`),[]),t=await at(()=>import(`./design-system-DFjB0sSn.js`),[]);return lt={Deck:e.Deck,SolidPolygonLayer:t.SolidPolygonLayer,ScatterplotLayer:t.ScatterplotLayer,LineLayer:t.LineLayer,ArcLayer:t.ArcLayer,PolygonLayer:t.PolygonLayer},lt}catch(e){return console.warn(`[@ossrandom/design-system] WebGL renderer requested but @deck.gl/core not installed. Falling back to canvas. Run: pnpm add @deck.gl/core @deck.gl/layers`,e),null}}function dt(e,t=255){if(!e)return[0,0,0,t];if(e.startsWith(`rgb`)){let n=/rgba?\(([^)]+)\)/.exec(e);if(!n)return[0,0,0,t];let[r=0,i=0,a=0,o=1]=n[1].split(`,`).map(e=>parseFloat(e.trim()));return[r,i,a,Math.round(o*255)]}let n=e.replace(`#`,``);return n.length===3?[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),t]:n.length>=6?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),n.length===8?parseInt(n.slice(6,8),16):t]:[0,0,0,t]}var ft=null;async function pt(){if(ft)return ft.ctor;try{let e=await at(()=>import(`./cytoscape.esm-Dm6iss-N.js`),[]),t=e.default??e;try{let e=await at(()=>import(`./cytoscape-cose-bilkent-nxdGmLq9.js`).then(e=>c(e.default,1)),[]);t.use(e.default??e)}catch{}return ft={ctor:t},t}catch(e){return console.warn(`[@ossrandom/design-system] cytoscape not installed:`,e),null}}function mt(e,t){return t<=0?3:3+Math.sqrt(e)/Math.sqrt(t)*11}function ht(e,t){let n=new Map;for(let t of e)n.set(t.id,0);for(let e of t)n.set(e.source,(n.get(e.source)??0)+1),n.set(e.target,(n.get(e.target)??0)+1);let r=0;for(let e of n.values())e>r&&(r=e);return{degrees:n,max:r}}async function gt(e,t,n,r){let{degrees:i}=ht(e,t);if(e.every(e=>e.x!==void 0&&e.y!==void 0))return e.map(e=>({...e,x:e.x,y:e.y,degree:i.get(e.id)??0}));try{let a=await at(()=>import(`./design-system-BNhP-Tae.js`),[]),o=e.map(e=>({...e,x:n/2+(Math.random()-.5)*100,y:r/2+(Math.random()-.5)*100,degree:i.get(e.id)??0})),s=a.forceSimulation(o).force(`link`,a.forceLink(t.map(e=>({source:e.source,target:e.target}))).id(e=>e.id).distance(60)).force(`charge`,a.forceManyBody().strength(-300)).force(`center`,a.forceCenter(n/2,r/2)).force(`collide`,a.forceCollide(14)).stop();for(let e=0;e<200;e++)s.tick();return o}catch{let t=Math.ceil(Math.sqrt(e.length)),a=n/t,o=r/Math.ceil(e.length/t);return e.map((e,n)=>({...e,x:n%t*a+a/2,y:Math.floor(n/t)*o+o/2,degree:i.get(e.id)??0}))}}function _t(e){let{nodes:t,edges:n,height:r=480,layout:i=`cose-bilkent`,engine:a=`auto`,onNodeClick:o,onEdgeClick:s,className:c,style:l,id:u}=e,d=C.useRef(null),f=C.useRef(null),p=C.useRef(null),[m,h]=C.useState(0),[g,_]=C.useState(`canvas`);return C.useEffect(()=>{_(ct(a,t.length+n.length,500))},[a,t.length,n.length]),C.useEffect(()=>{if(!d.current)return;let e=new ResizeObserver(e=>{let t=Math.floor(e[0].contentRect.width);t>0&&t!==m&&h(t)});return e.observe(d.current),()=>e.disconnect()},[m]),C.useEffect(()=>{if(g!==`canvas`||!d.current)return;let e=!1,r=d.current;return pt().then(a=>{if(!a||e){a||(r.innerHTML=`
Service map (canvas) requires cytoscape. Run: pnpm add cytoscape cytoscape-cose-bilkent
`);return}let c=et(),{degrees:l,max:u}=ht(t,n),d=a({container:r,elements:[...t.map(e=>{let t=l.get(e.id)??0,n=mt(t,u);return{data:{id:e.id,label:e.label,status:e.status,kind:e.kind,degree:t,diameter:Math.round(n*2)}}}),...n.map(e=>({data:{id:`${e.source}->${e.target}`,source:e.source,target:e.target,label:e.label,status:e.status}}))],style:vt(c),layout:{name:i,animate:!1,fit:!0,padding:24,nodeRepulsion:6e3,idealEdgeLength:80},wheelSensitivity:.2,minZoom:.2,maxZoom:3});o&&d.on(`tap`,`node`,e=>o(e.target.data())),s&&d.on(`tap`,`edge`,e=>s(e.target.data()));let p=e=>{let t=e.isNode?.()??!0;if(d.elements().addClass(`rcs-dim`),t){let t=e.connectedEdges?.(),n=e.connectedNodes?.();n?.removeClass(`rcs-dim`),t?.removeClass(`rcs-dim`),d.$(`#${yt(e.id())}`).removeClass(`rcs-dim`),d.$(`#${yt(e.id())}`).addClass(`rcs-focus`),t?.addClass(`rcs-focus-edge`),n?.addClass(`rcs-neighbor`)}else{let t=e.connectedNodes?.();t?.removeClass(`rcs-dim`),t?.addClass(`rcs-neighbor`)}},m=()=>{d.elements().removeClass(`rcs-dim rcs-focus rcs-focus-edge rcs-neighbor`)};d.on(`mouseover`,`node`,e=>p(e.target)),d.on(`mouseover`,`edge`,e=>p(e.target)),d.on(`mouseout`,`node`,()=>m()),d.on(`mouseout`,`edge`,()=>m()),d.on(`tap`,`node`,e=>p(e.target)),d.on(`tap`,`edge`,e=>p(e.target));let h=d.container();h&&h.addEventListener(`pointerleave`,m),f.current=d}),()=>{e=!0,f.current?.destroy(),f.current=null,r.innerHTML=``}},[g,t,n,i,o,s]),C.useEffect(()=>{if(g===`canvas`||m===0||!d.current)return;let e=!1,i=d.current;return(async()=>{let a=await ut();if(!a||e){_(`canvas`);return}let c=await gt(t,n,m,r);if(e)return;let l=new Map(c.map((e,t)=>[e.id,t])),u=et(),d=c.reduce((e,t)=>Math.max(e,t.degree),0),f=g===`webgpu`?`webgpu`:`webgl`,h=a.ScatterplotLayer,v=a.ArcLayer,y=new Map,b=new Map;for(let e of c)y.set(e.id,new Set),b.set(e.id,new Set);for(let e of n){let t=`${e.source}->${e.target}`;y.get(e.source)?.add(e.target),y.get(e.target)?.add(e.source),b.get(e.source)?.add(t),b.get(e.target)?.add(t)}let x=null,S=e=>!x||e===x?!0:y.get(x)?.has(e)??!1,C=e=>x?e.source===x||e.target===x:!0,w=(e,t)=>[e[0],e[1],e[2],t],ee=()=>[new v({id:`service-edges`,data:n.map(e=>({...e,sourcePos:c[l.get(e.source)??0],targetPos:c[l.get(e.target)??0]})),getSourcePosition:e=>[e.sourcePos.x,e.sourcePos.y,0],getTargetPosition:e=>[e.targetPos.x,e.targetPos.y,0],getSourceColor:e=>{let t=C(e);return w(dt(t&&x?u.accent:e.status===`failing`?u.danger:u.border2),t?255:60)},getTargetColor:e=>{let t=C(e);return w(dt(t&&x?u.accent:e.status===`failing`?u.danger:u.fg4),t?255:60)},getWidth:e=>C(e)&&x||e.status===`failing`?2:1,getHeight:.3,pickable:!!s,updateTriggers:{getSourceColor:[x],getTargetColor:[x],getWidth:[x]}}),new h({id:`service-nodes`,data:c,getPosition:e=>[e.x,e.y,0],getFillColor:e=>{let t=S(e.id);return w(dt(e.status===`failing`?u.danger:e.status===`degraded`?u.warning:e.status===`healthy`?u.success:u.fg3),t?230:60)},getLineColor:e=>x===e.id?dt(u.accent):dt(u.bg1),getRadius:e=>mt(e.degree,d),radiusUnits:`pixels`,stroked:!0,getLineWidth:e=>x===e.id?2:1,lineWidthUnits:`pixels`,pickable:!0,updateTriggers:{getFillColor:[x],getLineColor:[x],getLineWidth:[x]}})],te=new a.Deck({parent:i,width:m,height:r,controller:!0,deviceProps:{type:f},views:[{"@@type":`OrthographicView`,id:`v`,flipY:!0}],viewState:{target:[m/2,r/2,0],zoom:0},layers:ee(),onHover:({object:e,layer:t})=>{let n=null;e&&t?.id===`service-nodes`?n=e.id:e&&t?.id===`service-edges`&&(n=e.source),n!==x&&(x=n,te.setProps({layers:ee()}))},onClick:({object:e,layer:t})=>{!e||!t||(t.id===`service-nodes`&&o?o(e):t.id===`service-edges`&&s&&s(e))}});p.current=te})().catch(e=>{console.warn(`[@ossrandom/design-system] ServiceMap WebGL init failed; falling back to canvas:`,e),_(`canvas`)}),()=>{e=!0,p.current?.destroy(),p.current=null,i.innerHTML=``}},[g,m,r,t,n,o,s]),C.useEffect(()=>tt(()=>{_(e=>e)}),[]),(0,S.jsx)(`div`,{ref:d,id:u,className:y(`rcs-service-map`,`rcs-service-map--${g}`,c),style:{position:`relative`,width:`100%`,height:r,...l},"data-engine":g,role:`img`,"aria-label":e[`aria-label`]??`Service map with ${t.length} services`,children:(0,S.jsx)(`div`,{className:`rcs-service-map-engine-badge`,"aria-hidden":`true`,children:g})})}function vt(e){return[{selector:`node`,style:{shape:`ellipse`,width:`data(diameter)`,height:`data(diameter)`,"background-color":e.fg3,"border-color":e.bg1,"border-width":1,label:`data(label)`,color:e.fg3,"font-family":e.fontSans,"font-size":11,"font-weight":400,"text-valign":`bottom`,"text-halign":`center`,"text-margin-y":4,"text-events":`no`,"min-zoomed-font-size":9,"z-index":10,"transition-property":`background-color, border-color, border-width, color, opacity`,"transition-duration":`120ms`}},{selector:`node[status = 'healthy']`,style:{"background-color":e.success}},{selector:`node[status = 'degraded']`,style:{"background-color":e.warning}},{selector:`node[status = 'failing']`,style:{"background-color":e.danger}},{selector:`edge`,style:{width:1,"line-color":e.border2,"target-arrow-color":e.border2,"target-arrow-shape":`triangle`,"arrow-scale":.9,"curve-style":`bezier`,label:`data(label)`,color:e.fg4,"font-family":e.fontMono,"font-size":9,"text-rotation":`autorotate`,"text-margin-y":-4,"text-opacity":0,"text-events":`no`,"z-index":1,"transition-property":`line-color, width, target-arrow-color, opacity, text-opacity`,"transition-duration":`120ms`}},{selector:`edge[status = 'failing']`,style:{"line-color":e.danger,"target-arrow-color":e.danger,width:1.5}},{selector:`.rcs-dim`,style:{opacity:.18}},{selector:`node.rcs-focus`,style:{opacity:1,"border-color":e.accent,"border-width":2,color:e.fg1,"font-weight":500,"z-index":30}},{selector:`node.rcs-neighbor`,style:{opacity:1,color:e.fg1,"z-index":20}},{selector:`edge.rcs-focus-edge`,style:{opacity:1,"line-color":e.accent,"target-arrow-color":e.accent,width:2,"text-opacity":1,color:e.fg1,"z-index":25}},{selector:`node:selected`,style:{"border-color":e.accent,"border-width":2}}]}function yt(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function bt(e){return e===`healthy`?`info`:e===`degraded`?`warning`:e===`critical`||e===`failing`?`danger`:`neutral`}var xt=C.memo(({node:e,edges:t,onClose:n,onSelectService:r,onViewTraces:i,onViewLogs:a})=>{let o=t.filter(t=>t.target===e.id),s=t.filter(t=>t.source===e.id),c=e.metrics.error_rate*100;return(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsx)(D,{bordered:!0,padding:`md`,radius:`md`,title:(0,S.jsxs)(O,{size:`xs`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.id}),(0,S.jsx)(T,{tone:bt(e.status),size:`sm`,children:e.status})]}),extra:(0,S.jsx)(ee,{icon:(0,S.jsx)(Ke,{size:13}),"aria-label":`Close`,variant:`ghost`,size:`sm`,onClick:n}),children:(0,S.jsxs)(se,{columns:2,gap:`sm`,children:[(0,S.jsx)(se.Col,{span:1,children:(0,S.jsx)(Se,{label:`RPS`,value:Math.round(e.metrics.request_rate_rps)})}),(0,S.jsx)(se.Col,{span:1,children:(0,S.jsx)(Se,{label:`Error Rate`,value:c.toFixed(2),unit:`%`})}),(0,S.jsx)(se.Col,{span:1,children:(0,S.jsx)(Se,{label:`Avg Latency`,value:e.metrics.avg_latency_ms,unit:`ms`})}),(0,S.jsx)(se.Col,{span:1,children:(0,S.jsx)(Se,{label:`P99`,value:e.metrics.p99_latency_ms,unit:`ms`})})]})}),(0,S.jsx)(D,{bordered:!0,padding:`md`,radius:`md`,title:`Health Score`,extra:(0,S.jsx)(T,{tone:`subtle`,size:`sm`,children:e.health_score.toFixed(2)}),children:(0,S.jsx)(me,{value:e.health_score*100,tone:e.health_score<.4?`danger`:e.health_score<.7?`warning`:`neutral`})}),o.length>0&&(0,S.jsx)(D,{bordered:!0,padding:`md`,radius:`md`,title:`Upstream`,children:(0,S.jsx)(O,{direction:`vertical`,size:`xs`,children:o.map(e=>(0,S.jsx)(w,{variant:`ghost`,size:`sm`,block:!0,onClick:()=>r(e.source),children:(0,S.jsxs)(O,{justify:`between`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.source}),(0,S.jsxs)(T,{tone:`subtle`,size:`sm`,children:[e.call_count,` calls`]})]})},e.source))})}),s.length>0&&(0,S.jsx)(D,{bordered:!0,padding:`md`,radius:`md`,title:`Downstream`,children:(0,S.jsx)(O,{direction:`vertical`,size:`xs`,children:s.map(e=>(0,S.jsx)(w,{variant:`ghost`,size:`sm`,block:!0,onClick:()=>r(e.target),children:(0,S.jsxs)(O,{justify:`between`,align:`center`,children:[(0,S.jsx)(`code`,{children:e.target}),(0,S.jsxs)(T,{tone:`subtle`,size:`sm`,children:[e.call_count,` calls`]})]})},e.target))})}),e.alerts.length>0&&(0,S.jsx)(O,{direction:`vertical`,size:`xs`,children:e.alerts.map((e,t)=>(0,S.jsx)(j,{severity:`danger`,children:e},t))}),(0,S.jsxs)(O,{size:`xs`,children:[(0,S.jsx)(w,{variant:`secondary`,size:`sm`,block:!0,iconRight:(0,S.jsx)(Fe,{size:11}),onClick:()=>i(e.id),children:`Traces`}),(0,S.jsx)(w,{variant:`secondary`,size:`sm`,block:!0,iconRight:(0,S.jsx)(Fe,{size:11}),onClick:()=>a(e.id),children:`Logs`})]})]})}),St=C.memo(({items:e})=>(0,S.jsx)(D,{bordered:!0,padding:`md`,radius:`md`,children:(0,S.jsx)(O,{size:`lg`,wrap:!0,children:e.map((e,t)=>(0,S.jsxs)(C.Fragment,{children:[t>0&&(0,S.jsx)(oe,{direction:`vertical`}),(0,S.jsx)(Se,{...e})]},`${t}-${String(e.label)}`))})}));function Ct(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e*10)/10)}function wt(e){return e===`healthy`||e===`degraded`?e:e===`critical`||e===`failing`?`failing`:`unknown`}function Tt(e){return e===`critical`||e===`failing`?`failing`:`healthy`}var Et=C.memo(({graph:e,loading:t,error:n,dashboard:r,stats:i,onNavigateToTraces:a,onNavigateToLogs:o})=>{let[s,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(``),d=Ye(`(max-width: 760px)`),f=e?.nodes??[],p=e?.edges??[],m=(0,C.useMemo)(()=>{let e=l.trim().toLowerCase();return f.filter(t=>!e||t.id.toLowerCase().includes(e)).map(e=>({id:e.id,label:e.id,status:wt(e.status)}))},[f,l]),h=(0,C.useMemo)(()=>{if(m.length===0)return[];let e=new Set(m.map(e=>e.id));return p.filter(t=>e.has(t.source)&&e.has(t.target)).slice(0,500).map(e=>({source:e.source,target:e.target,status:Tt(e.status)}))},[p,m]),g=r?.active_services??f.length,_=r?.error_rate??0,v=i,y=e=>{if(typeof e==`number`)return e;if(typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)))return Number(e)},b=y(v?.TraceCount)??y(v?.traceCount)??r?.total_traces??0,x=y(v?.LogCount)??y(v?.logCount)??r?.total_logs??0,w=y(v?.DBSizeMB)??y(v?.db_size_mb),ee=e=>{c(f.find(t=>t.id===e.id)??null)},T=e=>{let t=f.find(t=>t.id===e);t&&c(t)};return(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsx)(we,{size:`sm`,title:`Service Topology`,subtitle:`Live dependency map · click a node for details`,inlineSubtitle:!0}),(0,S.jsx)(St,{items:[{label:`Services`,value:g},{label:`Error rate`,value:_.toFixed(2),unit:`%`},{label:`Traces`,value:Ct(b)},{label:`Logs`,value:Ct(x)},...w!=null&&Number.isFinite(w)?[{label:`DB`,value:w.toFixed(0),unit:`MB`}]:[]]}),(0,S.jsxs)(D,{bordered:!0,padding:`sm`,radius:`md`,extra:(0,S.jsx)(te,{value:l,onChange:e=>u(e),placeholder:`Filter services`,size:`sm`,prefix:(0,S.jsx)(He,{size:12})}),children:[t&&(0,S.jsx)(he,{label:`Loading service map`}),n&&(0,S.jsx)(j,{severity:`danger`,title:`Service map failed to load`,children:n}),!t&&!n&&f.length===0&&(0,S.jsx)(j,{severity:`info`,children:`No services discovered yet.`}),!t&&!n&&m.length===0&&f.length>0&&(0,S.jsx)(j,{severity:`info`,children:`No services match the filter.`}),!t&&!n&&m.length>0&&(0,S.jsx)(_t,{nodes:m,edges:h,layout:`cose-bilkent`,height:d?460:660,onNodeClick:ee})]}),(0,S.jsx)(pe,{open:s!==null,onClose:()=>c(null),placement:`right`,width:d?`92vw`:420,title:s?(0,S.jsx)(`code`,{children:s.id}):void 0,description:`Service detail · upstream, downstream, alerts`,children:s&&(0,S.jsx)(xt,{node:s,edges:p,onClose:()=>c(null),onSelectService:T,onViewTraces:a,onViewLogs:o})})]})});function Dt(e){return e.includes(`ERROR`)?`danger`:`info`}var Ot=C.memo(({traces:e,selected:t,loading:n,error:r,onSelect:i,serviceFilter:a,onClearFilter:o,dashboard:s})=>{let c=Ye(`(max-width: 760px)`),l=(0,C.useMemo)(()=>a?e.filter(e=>e.service_name===a):e,[e,a]),u=(0,C.useMemo)(()=>l.filter(e=>e.status?.includes(`ERROR`)).length,[l]),d=(0,C.useMemo)(()=>l.length===0?0:l.reduce((e,t)=>e+(t.duration_ms??0),0)/l.length,[l]),f=(0,C.useMemo)(()=>{if(l.length===0)return 0;let e=[...l].map(e=>e.duration_ms??0).sort((e,t)=>e-t),t=Math.floor(e.length*.95);return e[Math.min(t,e.length-1)]??0},[l]),p=Math.max(t?.duration??1,1);return(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsx)(we,{size:`sm`,title:`Distributed Traces`,subtitle:`${l.length} recent · click a row for span waterfall`,inlineSubtitle:!0,actions:a?(0,S.jsxs)(O,{size:`xs`,align:`center`,children:[(0,S.jsxs)(T,{tone:`info`,size:`sm`,children:[`Filtered: `,a]}),(0,S.jsx)(ee,{icon:(0,S.jsx)(Ke,{size:11}),"aria-label":`Clear filter`,variant:`ghost`,size:`xs`,onClick:o})]}):void 0}),(0,S.jsx)(St,{items:[{label:`In view`,value:Ct(l.length)},{label:`Errors`,value:u},{label:`Avg`,value:d.toFixed(1),unit:`ms`},(()=>{let e=s?.avg_latency_ms,t=e&&e>0,n=t?(f-e)/e*100:0;return{label:`p95`,value:f.toFixed(1),unit:`ms`,delta:t?{value:Number(n.toFixed(1)),direction:n>=0?`up`:`down`,tone:e&&f>e*2?`bad`:`neutral`}:void 0}})()]}),(0,S.jsxs)(D,{bordered:!0,padding:`sm`,radius:`md`,children:[r&&(0,S.jsx)(j,{severity:`danger`,children:r}),n&&l.length===0&&(0,S.jsx)(he,{label:`Loading traces`}),!n&&l.length===0&&(0,S.jsx)(j,{severity:`info`,children:`No traces yet.`}),l.length>0&&(0,S.jsx)(xe,{columns:[{key:`status`,title:`Status`,width:90,render:(e,t)=>(0,S.jsx)(T,{tone:Dt(t.status),size:`sm`,children:t.status||`OK`})},{key:`service_name`,title:`Service`,dataKey:`service_name`,sortable:!0},{key:`operation`,title:`Operation`,render:(e,t)=>(0,S.jsx)(`code`,{children:t.operation||t.trace_id})},{key:`span_count`,title:`Spans`,dataKey:`span_count`,align:`right`,width:90},{key:`duration_ms`,title:`Duration`,align:`right`,width:120,render:(e,t)=>`${(t.duration_ms??0).toFixed(1)} ms`}],data:l,rowKey:`trace_id`,density:`compact`,stickyHeader:!0,striped:!0,onRowClick:e=>i(e.trace_id)})]}),(0,S.jsx)(pe,{open:t!==null,onClose:()=>i(``),placement:`right`,width:c?`92vw`:540,title:t?(0,S.jsx)(`code`,{children:t.trace_id}):void 0,description:t?.service_name,children:t&&(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsxs)(O,{size:`sm`,align:`center`,wrap:!0,children:[(0,S.jsx)(T,{tone:Dt(t.status),size:`sm`,children:t.status}),(0,S.jsxs)(T,{tone:`subtle`,size:`sm`,children:[t.span_count,` spans`]}),(0,S.jsxs)(T,{tone:`subtle`,size:`sm`,children:[t.duration_ms?.toFixed(1),` ms`]})]}),(0,S.jsx)(D,{bordered:!0,padding:`sm`,radius:`md`,title:`Span Waterfall`,children:(0,S.jsxs)(O,{direction:`vertical`,size:`sm`,children:[(t.spans??[]).map(e=>{let t=Math.min(100,Math.max(6,e.duration/p*100));return(0,S.jsx)(D,{bordered:!0,padding:`sm`,radius:`sm`,children:(0,S.jsxs)(O,{direction:`vertical`,size:`xs`,children:[(0,S.jsxs)(O,{justify:`between`,align:`center`,children:[(0,S.jsx)(`strong`,{children:e.operation_name}),(0,S.jsxs)(T,{tone:`subtle`,size:`sm`,children:[(e.duration/1e3).toFixed(1),` ms`]})]}),(0,S.jsx)(me,{value:t,tone:`neutral`}),(0,S.jsx)(`code`,{children:e.service_name})]})},e.id)}),(t.spans??[]).length===0&&(0,S.jsx)(j,{severity:`info`,children:`No spans recorded for this trace.`})]})})]})})]})});function kt(e){return e===`ERROR`?`danger`:e===`WARN`?`warning`:`info`}var At=[{value:``,label:`all`},{value:`INFO`,label:`info`},{value:`WARN`,label:`warn`},{value:`ERROR`,label:`error`}],jt=C.memo(({logs:e,similar:t,loading:n,error:r,onSimilar:i,serviceFilter:a,onClearFilter:o,dashboard:s})=>{let[c,l]=(0,C.useState)(``),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(!1),m=Ye(`(max-width: 760px)`),h=(0,C.useMemo)(()=>{let t=e;return a&&(t=t.filter(e=>e.service_name===a)),u&&(t=t.filter(e=>e.severity===u)),t},[e,u,a]),g=(0,C.useMemo)(()=>{let e=0,t=0,n=0;for(let r of h)r.severity===`ERROR`?n++:r.severity===`WARN`?t++:e++;return{info:e,warn:t,err:n}},[h]),_=()=>{c.trim()&&(i(c),p(!0))};return(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsx)(we,{size:`sm`,title:`Logs`,subtitle:`Live tail · filter by severity · find similar incidents`,inlineSubtitle:!0,actions:a?(0,S.jsxs)(O,{size:`xs`,align:`center`,children:[(0,S.jsxs)(T,{tone:`info`,size:`sm`,children:[`Filtered: `,a]}),(0,S.jsx)(ee,{icon:(0,S.jsx)(Ke,{size:11}),"aria-label":`Clear filter`,variant:`ghost`,size:`xs`,onClick:o})]}):void 0}),(0,S.jsx)(St,{items:[{label:`In view`,value:Ct(h.length)},{label:`Errors`,value:g.err},{label:`Warnings`,value:g.warn},{label:`Info`,value:g.info}]}),(0,S.jsx)(D,{bordered:!0,padding:`sm`,radius:`md`,children:(0,S.jsxs)(O,{direction:`vertical`,size:`sm`,children:[(0,S.jsxs)(O,{size:`sm`,align:`center`,wrap:!0,children:[(0,S.jsx)(O,{size:`xs`,wrap:!0,children:At.map(e=>(0,S.jsx)(w,{variant:u===e.value?`secondary`:`ghost`,size:`sm`,onClick:()=>d(e.value),children:e.label},e.value||`all`))}),(0,S.jsx)(te,{value:c,onChange:e=>l(e),placeholder:`Search similar`,size:`sm`,prefix:(0,S.jsx)(He,{size:12}),onKeyDown:e=>{e.key===`Enter`&&_()}}),(0,S.jsx)(w,{variant:`primary`,size:`sm`,iconLeft:(0,S.jsx)(Ue,{size:12}),disabled:!c.trim(),onClick:_,children:`Find similar`})]}),r&&(0,S.jsx)(j,{severity:`danger`,children:r}),h.length===0&&(0,S.jsx)(j,{severity:`info`,children:`No logs in view.`}),h.length>0&&(0,S.jsx)(xe,{columns:[{key:`severity`,title:`Level`,width:84,render:(e,t)=>(0,S.jsx)(T,{tone:kt(t.severity),size:`sm`,children:t.severity})},{key:`timestamp`,title:`Time`,width:100,render:(e,t)=>(0,S.jsx)(`code`,{children:new Date(t.timestamp).toLocaleTimeString()})},{key:`service_name`,title:`Service`,dataKey:`service_name`,width:160,sortable:!0},{key:`body`,title:`Message`,render:(e,t)=>(0,S.jsx)(`code`,{children:t.body})}],data:h,rowKey:`id`,density:`compact`,stickyHeader:!0,striped:!0})]})}),(0,S.jsx)(pe,{open:f,onClose:()=>p(!1),placement:`right`,width:m?`92vw`:460,title:`Similar logs`,description:c.trim()?`Matches for "${c.trim()}"`:void 0,children:(0,S.jsxs)(O,{direction:`vertical`,size:`sm`,children:[t.length===0&&(0,S.jsx)(j,{severity:`info`,children:`No similar logs found.`}),t.map(e=>(0,S.jsx)(D,{bordered:!0,padding:`sm`,radius:`md`,children:(0,S.jsxs)(O,{direction:`vertical`,size:`xs`,children:[(0,S.jsxs)(O,{justify:`between`,align:`center`,children:[(0,S.jsx)(`strong`,{children:e.service_name}),(0,S.jsx)(T,{tone:kt(e.severity),size:`sm`,children:e.severity})]}),(0,S.jsx)(`code`,{children:e.body})]})},`similar-${e.id}`))]})})]})});function Mt(){let e=`${window.location.origin}/mcp`,[t,n]=(0,C.useState)(!1);return(0,S.jsx)(O,{direction:`vertical`,size:`md`,children:(0,S.jsx)(D,{bordered:!0,padding:`lg`,radius:`md`,title:(0,S.jsxs)(O,{size:`xs`,align:`center`,children:[(0,S.jsx)(Ge,{size:14}),(0,S.jsx)(`span`,{children:`MCP Endpoint`})]}),subtitle:`Plug any MCP-compatible client (Claude Desktop, Cursor, custom agents) into the URL below.`,extra:(0,S.jsx)(T,{tone:`info`,size:`sm`,children:`live`}),children:(0,S.jsxs)(O,{direction:`vertical`,size:`md`,children:[(0,S.jsxs)(O,{size:`sm`,wrap:!0,children:[(0,S.jsx)(te,{value:e,readOnly:!0,type:`url`}),(0,S.jsx)(w,{variant:`primary`,size:`sm`,iconLeft:t?(0,S.jsx)(Ie,{size:12}):(0,S.jsx)(Le,{size:12}),onClick:async()=>{await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1500)},children:t?`Copied`:`Copy`})]}),(0,S.jsxs)(`p`,{children:[`HTTP Streamable MCP · JSON-RPC 2.0 over POST + Server-Sent Events. If `,(0,S.jsx)(`code`,{children:`API_KEY`}),` is set on the server, send`,` `,(0,S.jsx)(`code`,{children:`Authorization: Bearer `}),` on every request.`]})]})})})}function Nt(e=6e4){let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(!0),[s,c]=(0,C.useState)(null),l=(0,C.useRef)(void 0),u=(0,C.useCallback)(async()=>{try{let e=await fetch(`/api/system/graph`);if(!e.ok)throw Error(`HTTP ${e.status}`);i(e.headers.get(`X-Cache`)??``),n(await e.json()),c(null)}catch(e){c(e instanceof Error?e.message:`fetch failed`)}finally{o(!1)}},[]);return(0,C.useEffect)(()=>(u(),l.current=setInterval(u,e),()=>clearInterval(l.current)),[u,e]),{graph:t,cache:r,loading:a,error:s,reload:u}}function Pt(e=3e4){let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(!0),[s,c]=(0,C.useState)(null),l=(0,C.useRef)(void 0),u=(0,C.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/api/metrics/dashboard`),fetch(`/api/stats`)]);if(!e.ok||!t.ok)throw Error(`fetch failed`);n(await e.json()),i(await t.json()),c(null)}catch(e){c(e instanceof Error?e.message:`fetch failed`)}finally{o(!1)}},[]);return(0,C.useEffect)(()=>(u(),l.current=setInterval(u,e),()=>clearInterval(l.current)),[u,e]),{dashboard:t,stats:r,loading:a,error:s,reload:u}}function Ft(){let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!0),[o,s]=(0,C.useState)(null),c=(0,C.useCallback)(async()=>{a(!0),s(null);try{let e=await(await fetch(`/api/traces?limit=25&offset=0`)).json();t(e.traces??[]),e.traces?.[0]&&r(await(await fetch(`/api/traces/${e.traces[0].trace_id}`)).json())}catch(e){s(String(e))}finally{a(!1)}},[]);return(0,C.useEffect)(()=>{c()},[c]),{traces:e,selected:n,loading:i,error:o,selectTrace:async e=>{r(await(await fetch(`/api/traces/${e}`)).json())},reload:c}}function It(e){return Array.isArray(e)?e:Array.isArray(e.logs)?e.logs:Array.isArray(e.items)?e.items:[]}function Lt(){let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(!0),[o,s]=(0,C.useState)(null),c=(0,C.useCallback)(async()=>{a(!0),s(null);try{t(It(await(await fetch(`/api/logs?limit=100&offset=0`)).json()))}catch(e){s(String(e))}finally{a(!1)}},[]);return(0,C.useEffect)(()=>{c()},[c]),{logs:e,similar:n,loading:i,error:o,runSimilar:async e=>{e.trim()&&r(It(await(await fetch(`/api/logs/similar?q=${encodeURIComponent(e)}&limit=8`)).json()))},setLogs:t,reload:c}}var Rt=100,zt=1e4,Bt=3e4,Vt=35e3;function Ht(e){let t=(0,C.useRef)(null),n=(0,C.useRef)(e),[r,i]=(0,C.useState)(`connecting`);t.status=r;let a=(0,C.useRef)(0),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)(null),l=(0,C.useRef)(!1),u=(0,C.useRef)(()=>{});(0,C.useEffect)(()=>{n.current=e},[e]);let d=(0,C.useCallback)(()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},[]),f=(0,C.useCallback)(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null),c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),p=(0,C.useCallback)(()=>{if(l.current)return;d();let e=a.current,t=Math.min(Rt*2**e,zt);a.current=e+1,i(`reconnecting`),o.current=window.setTimeout(()=>{o.current=null,u.current()},t)},[d]),m=(0,C.useCallback)(()=>{f(),s.current=window.setInterval(()=>{let e=t.current;if(!(!e||e.readyState!==WebSocket.OPEN)){try{e.send(JSON.stringify({type:`ping`}))}catch{return}c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null;let e=t.current;if(e)try{e.close()}catch{}},Vt)}},Bt)},[f]),h=(0,C.useCallback)(()=>{if(l.current)return;d(),f();let e=t.current;if(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}t.current=null}i(a.current===0?`connecting`:`reconnecting`);let r=window.location.protocol===`https:`?`wss:`:`ws:`,o;try{o=new WebSocket(`${r}//${window.location.host}/ws`)}catch{p();return}t.current=o,o.onopen=()=>{l.current||(a.current=0,i(`connected`),m())},o.onmessage=e=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null);try{let t=JSON.parse(e.data);t.type===`logs`&&Array.isArray(t.data)&&n.current(t.data)}catch{}},o.onerror=()=>{},o.onclose=()=>{l.current||(t.current===o&&(t.current=null),f(),i(`disconnected`),p())}},[f,d,p,m]);return(0,C.useEffect)(()=>{u.current=h},[h]),(0,C.useEffect)(()=>{l.current=!1,u.current=h,h();let e=()=>{if(document.visibilityState!==`visible`)return;let e=t.current;(!e||e.readyState===WebSocket.CLOSED||e.readyState===WebSocket.CLOSING)&&(a.current=0,d(),u.current())},n=()=>{a.current=0,d(),u.current()};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`online`,n),()=>{l.current=!0,document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`online`,n),d(),f();let r=t.current;if(r){r.onopen=null,r.onmessage=null,r.onerror=null,r.onclose=null;try{r.close()}catch{}t.current=null}}},[]),t}function Ut(){let[e,t]=(0,C.useState)(`services`),[n,r]=(0,C.useState)(null),i=Nt(),a=Pt(),o=Ft(),s=Lt(),c=(0,C.useRef)(s.setLogs);c.current=s.setLogs;let l=!!Ht((0,C.useCallback)(e=>{c.current(t=>[...e,...t].slice(0,200))},[])).current,u=(0,C.useCallback)(e=>{r(e),t(`traces`)},[]),d=(0,C.useCallback)(e=>{r(e),t(`logs`)},[]),f=(0,C.useCallback)(()=>{r(null)},[]);return(0,S.jsxs)(Te,{header:(0,S.jsx)(Qe,{view:e,onNavigate:t,wsConnected:l}),children:[e===`services`&&(0,S.jsx)(Et,{graph:i.graph,loading:i.loading,error:i.error,dashboard:a.dashboard,stats:a.stats,onNavigateToTraces:u,onNavigateToLogs:d}),e===`traces`&&(0,S.jsx)(Ot,{traces:o.traces,selected:o.selected,loading:o.loading,error:o.error,onSelect:e=>void o.selectTrace(e),serviceFilter:n,onClearFilter:f,dashboard:a.dashboard}),e===`logs`&&(0,S.jsx)(jt,{logs:s.logs,similar:s.similar,loading:s.loading,error:s.error,onSimilar:e=>void s.runSimilar(e),serviceFilter:n,onClearFilter:f,dashboard:a.dashboard}),e===`mcp`&&(0,S.jsx)(Mt,{})]})}(0,ke.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(C.StrictMode,{children:(0,S.jsxs)(Oe,{mode:`dark`,children:[(0,S.jsx)(Ut,{}),(0,S.jsx)(be,{})]})}));export{o as t}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index fd56f90..68d8839 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -4,7 +4,7 @@ OtelContext - + diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 547a46a..fdcae01 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -1,91 +1,35 @@ -import { useCallback, useRef, useState } from 'react' +import { useState } from 'react' import { AppShell } from '@ossrandom/design-system' import TopNav, { type OtelView } from './components/nav/TopNav' import ServicesView from './components/observability/ServicesView' -import TracesView from './components/observability/TracesView' -import LogsView from './components/observability/LogsView' -import MCPConsole from './components/mcp/MCPConsole' import { useSystemGraph } from './hooks/useSystemGraph' import { useDashboard } from './hooks/useDashboard' -import { useTraces } from './hooks/useTraces' -import { useLogs } from './hooks/useLogs' import { useWebSocket } from './hooks/useWebSocket' -import type { LogEntry } from './types/api' export default function App() { const [view, setView] = useState('services') - const [serviceFilter, setServiceFilter] = useState(null) const graph = useSystemGraph() const dash = useDashboard() - const traces = useTraces() - const logs = useLogs() - const setLogsRef = useRef(logs.setLogs) - setLogsRef.current = logs.setLogs - const appendLogs = useCallback((incoming: LogEntry[]) => { - setLogsRef.current((current) => [...incoming, ...current].slice(0, 200)) - }, []) - - const ws = useWebSocket(appendLogs) + // WebSocket retained as the live/offline source for the header indicator; + // log batches it pushes are intentionally discarded. + const ws = useWebSocket(() => undefined) const wsConnected = !!ws.current - const navigateToTraces = useCallback((service: string) => { - setServiceFilter(service) - setView('traces') - }, []) - - const navigateToLogs = useCallback((service: string) => { - setServiceFilter(service) - setView('logs') - }, []) - - const clearFilter = useCallback(() => { - setServiceFilter(null) - }, []) - return ( } > - {view === 'services' && ( - - )} - {view === 'traces' && ( - void traces.selectTrace(traceId)} - serviceFilter={serviceFilter} - onClearFilter={clearFilter} - dashboard={dash.dashboard} - /> - )} - {view === 'logs' && ( - void logs.runSimilar(query)} - serviceFilter={serviceFilter} - onClearFilter={clearFilter} - dashboard={dash.dashboard} - /> - )} - {view === 'mcp' && } + ) } diff --git a/ui/src/components/mcp/MCPConsole.tsx b/ui/src/components/mcp/MCPConsole.tsx index 9c1666f..c510523 100644 --- a/ui/src/components/mcp/MCPConsole.tsx +++ b/ui/src/components/mcp/MCPConsole.tsx @@ -1,3 +1,7 @@ +// Note: MCPConsole is no longer mounted in App.tsx — the MCP endpoint URL +// + Copy button now live in the TopNav header. This file is kept temporarily +// as orphaned source pending a follow-up cleanup pass; it is tree-shaken out +// of the production bundle. import { useState } from 'react' import { Badge, Button, Card, Input, Space } from '@ossrandom/design-system' import { Check, Copy, Terminal } from 'lucide-react' @@ -13,23 +17,18 @@ export default function MCPConsole() { } return ( - - + + - MCP Endpoint + MCP Endpoint + live - } - subtitle="Plug any MCP-compatible client (Claude Desktop, Cursor, custom agents) into the URL below." - extra={live} - > - - - + +
+ +
+ ) + if (isCompact) { + // Compact: brand + copy-only button + indicators. Skip the URL field + // because it eats horizontal real estate that we don't have on phones. return ( - <> - - - } - aria-label="Open navigation" - variant="ghost" - size="sm" - onClick={() => setDrawerOpen(true)} - /> - OtelContext - - - {liveBadge} - {themeBtn} - + + OtelContext + + {copyBtn} + {liveBadge} + {themeBtn} - - setDrawerOpen(false)} - placement="left" - width="min(280px, 86vw)" - title="OtelContext" - > - - mode="vertical" - items={menuItems} - selectedKeys={[view]} - onSelect={(key) => { - onNavigate(key) - setDrawerOpen(false) - }} - /> - - + ) } + // Desktop: brand on the left, MCP URL field grows to fill, copy button + + // status indicators sit on the right. Single-row, no tabs (only one view). return ( - + OtelContext - - items={tabs} - value={view} - variant="line" - onChange={(key) => onNavigate(key)} - /> +
+ +
+ {copyBtn} {liveBadge} {themeBtn} diff --git a/ui/src/components/observability/ServiceSidePanel.tsx b/ui/src/components/observability/ServiceSidePanel.tsx index 216f890..c643e0d 100644 --- a/ui/src/components/observability/ServiceSidePanel.tsx +++ b/ui/src/components/observability/ServiceSidePanel.tsx @@ -1,6 +1,6 @@ import React from 'react' import { Alert, Badge, Button, Card, Grid, IconButton, Progress, Space, Stat } from '@ossrandom/design-system' -import { ArrowRight, X } from 'lucide-react' +import { X } from 'lucide-react' import type { SystemNode, SystemEdge } from '../../types/api' interface ServiceSidePanelProps { @@ -8,8 +8,6 @@ interface ServiceSidePanelProps { edges: SystemEdge[] onClose: () => void onSelectService: (id: string) => void - onViewTraces: (service: string) => void - onViewLogs: (service: string) => void } function statusTone(status: string): 'info' | 'warning' | 'danger' | 'neutral' { @@ -24,8 +22,6 @@ const ServiceSidePanel: React.FC = ({ edges, onClose, onSelectService, - onViewTraces, - onViewLogs, }) => { const upstream = edges.filter((e) => e.target === node.id) const downstream = edges.filter((e) => e.source === node.id) @@ -126,26 +122,6 @@ const ServiceSidePanel: React.FC = ({
)} - - - -
) } diff --git a/ui/src/components/observability/ServicesView.tsx b/ui/src/components/observability/ServicesView.tsx index eb13517..cdd22c0 100644 --- a/ui/src/components/observability/ServicesView.tsx +++ b/ui/src/components/observability/ServicesView.tsx @@ -16,6 +16,7 @@ import StatRow from './StatRow' import type { DashboardStats, RepoStats, SystemGraphResponse, SystemNode } from '../../types/api' import { fmt } from '../../lib/utils' import { useMediaQuery } from '../../hooks/useMediaQuery' +import { useWindowHeight } from '../../hooks/useWindowHeight' interface ServicesViewProps { graph: SystemGraphResponse | null @@ -23,8 +24,6 @@ interface ServicesViewProps { error: string | null dashboard: DashboardStats | null stats: RepoStats | null - onNavigateToTraces: (service: string) => void - onNavigateToLogs: (service: string) => void } function toNodeStatus(status: string | undefined): DSNode['status'] { @@ -43,12 +42,15 @@ const ServicesView: React.FC = ({ error, dashboard, stats, - onNavigateToTraces, - onNavigateToLogs, }) => { const [selectedNode, setSelectedNode] = useState(null) const [search, setSearch] = useState('') const isCompact = useMediaQuery('(max-width: 760px)') + const windowH = useWindowHeight() + // Subtract chrome above the canvas (TopNav + PageHeader + StatRow + Card + // padding + Space gaps + breathing margin). 460px floor so a very short + // window still shows a usable canvas. + const mapHeight = isCompact ? 460 : Math.max(460, windowH - 320) const nodes = graph?.nodes ?? [] const edges = graph?.edges ?? [] @@ -92,7 +94,7 @@ const ServicesView: React.FC = ({ } return ( - + = ({ nodes={dsNodes} edges={dsEdges} layout="cose-bilkent" - height={isCompact ? 460 : 660} + height={mapHeight} onNodeClick={handleNodeClick} /> )} @@ -161,8 +163,6 @@ const ServicesView: React.FC = ({ edges={edges} onClose={() => setSelectedNode(null)} onSelectService={handleSelectService} - onViewTraces={onNavigateToTraces} - onViewLogs={onNavigateToLogs} /> )} diff --git a/ui/src/components/observability/__tests__/ServiceSidePanel.test.tsx b/ui/src/components/observability/__tests__/ServiceSidePanel.test.tsx index 8ee87c1..227517a 100644 --- a/ui/src/components/observability/__tests__/ServiceSidePanel.test.tsx +++ b/ui/src/components/observability/__tests__/ServiceSidePanel.test.tsx @@ -24,8 +24,6 @@ function renderPanel(overrides = {}) { edges: mockEdges, onClose: vi.fn(), onSelectService: vi.fn(), - onViewTraces: vi.fn(), - onViewLogs: vi.fn(), }; const props = { ...defaults, ...overrides }; return { ...render(), ...props }; @@ -57,13 +55,6 @@ describe('ServiceSidePanel', () => { expect(screen.getByText('avg latency above 500ms')).toBeInTheDocument(); }); - it('calls onViewTraces when "View Traces" clicked', async () => { - const { onViewTraces } = renderPanel(); - const user = userEvent.setup(); - await user.click(screen.getByText(/View Traces/)); - expect(onViewTraces).toHaveBeenCalledWith('inventory'); - }); - it('calls onSelectService when upstream service clicked', async () => { const { onSelectService } = renderPanel(); const user = userEvent.setup(); diff --git a/ui/src/hooks/useWindowHeight.ts b/ui/src/hooks/useWindowHeight.ts new file mode 100644 index 0000000..b3986f1 --- /dev/null +++ b/ui/src/hooks/useWindowHeight.ts @@ -0,0 +1,24 @@ +import { useEffect, useState } from 'react' + +/** + * Tracks `window.innerHeight` with a `resize` listener. SSR-safe — returns + * `fallback` on the first render when `window` is unavailable. + * + * Used by views that render a fixed-height canvas/chart and want it to fill + * the visible viewport instead of being capped at an arbitrary px value. + */ +export function useWindowHeight(fallback = 800): number { + const [h, setH] = useState(() => { + if (typeof window === 'undefined') return fallback + return window.innerHeight + }) + + useEffect(() => { + if (typeof window === 'undefined') return + const update = () => setH(window.innerHeight) + window.addEventListener('resize', update) + return () => window.removeEventListener('resize', update) + }, []) + + return h +}