stratagate-dsh 0.3.50 → 0.3.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -318,11 +318,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
318
318
  `).concat(renderTarget.picking?`if(outColor.a == 0.0) discard;
319
319
  else outColor = vIndex;`:"",`
320
320
  }
321
- `),program=createProgram(gl,vertexShaderSource,fragmentShaderSource);program.aPosition=gl.getAttribLocation(program,"aPosition"),program.aIndex=gl.getAttribLocation(program,"aIndex"),program.aVertType=gl.getAttribLocation(program,"aVertType"),program.aTransform=gl.getAttribLocation(program,"aTransform"),program.aAtlasId=gl.getAttribLocation(program,"aAtlasId"),program.aTex=gl.getAttribLocation(program,"aTex"),program.aPointAPointB=gl.getAttribLocation(program,"aPointAPointB"),program.aPointCPointD=gl.getAttribLocation(program,"aPointCPointD"),program.aLineWidth=gl.getAttribLocation(program,"aLineWidth"),program.aColor=gl.getAttribLocation(program,"aColor"),program.aCornerRadius=gl.getAttribLocation(program,"aCornerRadius"),program.aBorderColor=gl.getAttribLocation(program,"aBorderColor"),program.uPanZoomMatrix=gl.getUniformLocation(program,"uPanZoomMatrix"),program.uAtlasSize=gl.getUniformLocation(program,"uAtlasSize"),program.uBGColor=gl.getUniformLocation(program,"uBGColor"),program.uZoom=gl.getUniformLocation(program,"uZoom"),program.uTextures=[];for(var i2=0;i2<this.batchManager.getMaxAtlasesPerBatch();i2++)program.uTextures.push(gl.getUniformLocation(program,"uTexture".concat(i2)));return program}},{key:"_createVAO",value:function(){var unitSquare=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=unitSquare.length/2;var n=this.maxInstances,gl=this.gl,program=this.program,vao=gl.createVertexArray();return gl.bindVertexArray(vao),createBufferStaticDraw(gl,"vec2",program.aPosition,unitSquare),this.transformBuffer=create3x3MatrixBufferDynamicDraw(gl,n,program.aTransform),this.indexBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aIndex),this.vertTypeBuffer=createBufferDynamicDraw(gl,n,"int",program.aVertType),this.atlasIdBuffer=createBufferDynamicDraw(gl,n,"int",program.aAtlasId),this.texBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aTex),this.pointAPointBBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aPointAPointB),this.pointCPointDBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aPointCPointD),this.lineWidthBuffer=createBufferDynamicDraw(gl,n,"vec2",program.aLineWidth),this.colorBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aColor),this.cornerRadiusBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aCornerRadius),this.borderColorBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aBorderColor),gl.bindVertexArray(null),vao}},{key:"buffers",get:function(){var _this=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(k){return endsWith(k,"Buffer")}).map(function(k){return _this[k]})),this._buffers}},{key:"startFrame",value:function(panZoomMatrix){var renderTarget=arguments.length>1&&arguments[1]!==void 0?arguments[1]:RENDER_TARGET.SCREEN;this.panZoomMatrix=panZoomMatrix,this.renderTarget=renderTarget,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(ele,opts){return ele.visible()?opts&&opts.isVisible?opts.isVisible(ele):!0:!1}},{key:"drawTexture",value:function(ele,eleIndex,type){var atlasManager=this.atlasManager,batchManager=this.batchManager,opts=atlasManager.getRenderTypeOpts(type);if(this._isVisible(ele,opts)&&!(ele.isEdge()&&!this._isValidEdge(ele))){if(this.renderTarget.picking&&opts.getTexPickingMode){var mode=opts.getTexPickingMode(ele);if(mode===TEX_PICKING_MODE.IGNORE)return;if(mode==TEX_PICKING_MODE.USE_BB){this.drawPickingRectangle(ele,eleIndex,type);return}}var atlasInfoArray=atlasManager.getAtlasInfo(ele,type),_iterator=_createForOfIteratorHelper(atlasInfoArray),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var atlasInfo=_step.value,atlas=atlasInfo.atlas,tex1=atlasInfo.tex1,tex2=atlasInfo.tex2;batchManager.canAddToCurrentBatch(atlas)||this.endBatch();for(var atlasIndex=batchManager.getAtlasIndexForBatch(atlas),_i=0,_arr=[[tex1,!0],[tex2,!1]];_i<_arr.length;_i++){var _arr$_i=_slicedToArray(_arr[_i],2),tex=_arr$_i[0],first2=_arr$_i[1];if(tex.w!=0){var instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=TEXTURE;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var atlasIdView=this.atlasIdBuffer.getView(instance2);atlasIdView[0]=atlasIndex;var texView=this.texBuffer.getView(instance2);texView[0]=tex.x,texView[1]=tex.y,texView[2]=tex.w,texView[3]=tex.h;var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(ele,matrixView,opts,atlasInfo,first2),this.instanceCount++,first2||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}},{key:"setTransformMatrix",value:function(ele,matrix,opts,atlasInfo){var first2=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,padding=0;if(opts.shapeProps&&opts.shapeProps.padding&&(padding=ele.pstyle(opts.shapeProps.padding).pfValue),atlasInfo){var bb=atlasInfo.bb,tex1=atlasInfo.tex1,tex2=atlasInfo.tex2,ratio=tex1.w/(tex1.w+tex2.w);first2||(ratio=1-ratio);var adjBB=this._getAdjustedBB(bb,padding,first2,ratio);this._applyTransformMatrix(matrix,adjBB,opts,ele)}else{var _bb=opts.getBoundingBox(ele),_adjBB=this._getAdjustedBB(_bb,padding,!0,1);this._applyTransformMatrix(matrix,_adjBB,opts,ele)}}},{key:"_applyTransformMatrix",value:function(matrix,adjBB,opts,ele){var x2,y2;identity2(matrix);var theta=opts.getRotation?opts.getRotation(ele):0;if(theta!==0){var _opts$getRotationPoin=opts.getRotationPoint(ele),sx=_opts$getRotationPoin.x,sy=_opts$getRotationPoin.y;translate(matrix,matrix,[sx,sy]),rotate(matrix,matrix,theta);var offset=opts.getRotationOffset(ele);x2=offset.x+(adjBB.xOffset||0),y2=offset.y+(adjBB.yOffset||0)}else x2=adjBB.x1,y2=adjBB.y1;translate(matrix,matrix,[x2,y2]),scale(matrix,matrix,[adjBB.w,adjBB.h])}},{key:"_getAdjustedBB",value:function(bb,padding,first2,ratio){var x1=bb.x1,y1=bb.y1,w=bb.w,h=bb.h,yOffset=bb.yOffset;padding&&(x1-=padding,y1-=padding,w+=2*padding,h+=2*padding);var xOffset=0,adjW=w*ratio;return first2&&ratio<1?w=adjW:!first2&&ratio<1&&(xOffset=w-adjW,x1+=xOffset,w=adjW),{x1,y1,w,h,xOffset,yOffset}}},{key:"drawPickingRectangle",value:function(ele,eleIndex,type){var opts=this.atlasManager.getRenderTypeOpts(type),instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=RECTANGLE;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor([0,0,0],1,colorView);var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(ele,matrixView,opts),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(node,eleIndex,type){var opts=this.simpleShapeOptions.get(type);if(this._isVisible(node,opts)){var props=opts.shapeProps,vertType=this._getVertTypeForShape(node,props.shape);if(vertType===void 0||opts.isSimple&&!opts.isSimple(node,this.renderTarget)){this.drawTexture(node,eleIndex,type);return}var instance2=this.instanceCount;if(this.vertTypeBuffer.getView(instance2)[0]=vertType,vertType===ROUND_RECTANGLE||vertType===BOTTOM_ROUND_RECTANGLE){var bb=opts.getBoundingBox(node),radius2=this._getCornerRadius(node,props.radius,bb),radiusView=this.cornerRadiusBuffer.getView(instance2);radiusView[0]=radius2,radiusView[1]=radius2,radiusView[2]=radius2,radiusView[3]=radius2,vertType===BOTTOM_ROUND_RECTANGLE&&(radiusView[0]=0,radiusView[2]=0)}var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var opacity=this.renderTarget.picking?1:type==="node-body"?node.effectiveOpacity():1,bgOpacity=this.renderTarget.picking?1:node.pstyle(props.opacity).value*opacity,color=node.pstyle(props.color).value,colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,bgOpacity,colorView);var lineWidthView=this.lineWidthBuffer.getView(instance2);if(lineWidthView[0]=0,lineWidthView[1]=0,props.border){var borderWidth=node.pstyle("border-width").value;if(borderWidth>0){var borderColor=node.pstyle("border-color").value,borderOpacity=opacity*node.pstyle("border-opacity").value,borderColorView=this.borderColorBuffer.getView(instance2);toWebGLColor(borderColor,borderOpacity,borderColorView);var borderPos=node.pstyle("border-position").value;if(borderPos==="inside")lineWidthView[0]=0,lineWidthView[1]=-borderWidth;else if(borderPos==="outside")lineWidthView[0]=borderWidth,lineWidthView[1]=0;else{var halfWidth=borderWidth/2;lineWidthView[0]=halfWidth,lineWidthView[1]=-halfWidth}}}var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(node,matrixView,opts),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(node,shapeProp){var shape=node.pstyle(shapeProp).value;switch(shape){case"rectangle":return RECTANGLE;case"ellipse":return ELLIPSE;case"roundrectangle":case"round-rectangle":return ROUND_RECTANGLE;case"bottom-round-rectangle":return BOTTOM_ROUND_RECTANGLE;default:return}}},{key:"_getCornerRadius",value:function(node,radiusProp,_ref2){var w=_ref2.w,h=_ref2.h;if(node.pstyle(radiusProp).value==="auto")return getRoundRectangleRadius(w,h);var radius2=node.pstyle(radiusProp).pfValue,halfWidth=w/2,halfHeight=h/2;return Math.min(radius2,halfHeight,halfWidth)}},{key:"drawEdgeArrow",value:function(edge,eleIndex,prefix){if(edge.visible()){var rs=edge._private.rscratch,x2,y2,angle2;if(prefix==="source"?(x2=rs.arrowStartX,y2=rs.arrowStartY,angle2=rs.srcArrowAngle):(x2=rs.arrowEndX,y2=rs.arrowEndY,angle2=rs.tgtArrowAngle),!(isNaN(x2)||x2==null||isNaN(y2)||y2==null||isNaN(angle2)||angle2==null)){var arrowShape=edge.pstyle(prefix+"-arrow-shape").value;if(arrowShape!=="none"){var color=edge.pstyle(prefix+"-arrow-color").value,baseOpacity=edge.pstyle("opacity").value,lineOpacity=edge.pstyle("line-opacity").value,opacity=baseOpacity*lineOpacity,lineWidth=edge.pstyle("width").pfValue,scale$1=edge.pstyle("arrow-scale").value,size3=this.r.getArrowWidth(lineWidth,scale$1),instance2=this.instanceCount,transform7=this.transformBuffer.getMatrixView(instance2);identity2(transform7),translate(transform7,transform7,[x2,y2]),scale(transform7,transform7,[size3,size3]),rotate(transform7,transform7,angle2),this.vertTypeBuffer.getView(instance2)[0]=EDGE_ARROW;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,opacity,colorView),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(edge,eleIndex){if(edge.visible()){var points=this._getEdgePoints(edge);if(points){var baseOpacity=edge.pstyle("opacity").value,lineOpacity=edge.pstyle("line-opacity").value,width2=edge.pstyle("width").pfValue,color=edge.pstyle("line-color").value,opacity=baseOpacity*lineOpacity;if(points.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),points.length==4){var instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=EDGE_STRAIGHT;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,opacity,colorView);var lineWidthBuffer=this.lineWidthBuffer.getView(instance2);lineWidthBuffer[0]=width2;var sourceTargetView=this.pointAPointBBuffer.getView(instance2);sourceTargetView[0]=points[0],sourceTargetView[1]=points[1],sourceTargetView[2]=points[2],sourceTargetView[3]=points[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var i2=0;i2<points.length-2;i2+=2){var _instance=this.instanceCount;this.vertTypeBuffer.getView(_instance)[0]=EDGE_CURVE_SEGMENT;var _indexView=this.indexBuffer.getView(_instance);indexToVec4(eleIndex,_indexView);var _colorView=this.colorBuffer.getView(_instance);toWebGLColor(color,opacity,_colorView);var _lineWidthBuffer=this.lineWidthBuffer.getView(_instance);_lineWidthBuffer[0]=width2;var pAx=points[i2-2],pAy=points[i2-1],pBx=points[i2],pBy=points[i2+1],pCx=points[i2+2],pCy=points[i2+3],pDx=points[i2+4],pDy=points[i2+5];i2==0&&(pAx=2*pBx-pCx+.001,pAy=2*pBy-pCy+.001),i2==points.length-4&&(pDx=2*pCx-pBx+.001,pDy=2*pCy-pBy+.001);var pointABView=this.pointAPointBBuffer.getView(_instance);pointABView[0]=pAx,pointABView[1]=pAy,pointABView[2]=pBx,pointABView[3]=pBy;var pointCDView=this.pointCPointDBuffer.getView(_instance);pointCDView[0]=pCx,pointCDView[1]=pCy,pointCDView[2]=pDx,pointCDView[3]=pDy,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(edge){var rs=edge._private.rscratch;return!(rs.badLine||rs.allpts==null||isNaN(rs.allpts[0]))}},{key:"_getEdgePoints",value:function(edge){var rs=edge._private.rscratch;if(this._isValidEdge(edge)){var controlPoints3=rs.allpts;if(controlPoints3.length==4)return controlPoints3;var numSegments=this._getNumSegments(edge);return this._getCurveSegmentPoints(controlPoints3,numSegments)}}},{key:"_getNumSegments",value:function(edge){var numSegments=15;return Math.min(Math.max(numSegments,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(controlPoints3,segments){if(controlPoints3.length==4)return controlPoints3;for(var curvePoints=Array((segments+1)*2),i2=0;i2<=segments;i2++)if(i2==0)curvePoints[0]=controlPoints3[0],curvePoints[1]=controlPoints3[1];else if(i2==segments)curvePoints[i2*2]=controlPoints3[controlPoints3.length-2],curvePoints[i2*2+1]=controlPoints3[controlPoints3.length-1];else{var t=i2/segments;this._setCurvePoint(controlPoints3,t,curvePoints,i2*2)}return curvePoints}},{key:"_setCurvePoint",value:function(points,t,curvePoints,cpi){if(points.length<=2)curvePoints[cpi]=points[0],curvePoints[cpi+1]=points[1];else{for(var newpoints=Array(points.length-2),i2=0;i2<newpoints.length;i2+=2){var x2=(1-t)*points[i2]+t*points[i2+2],y2=(1-t)*points[i2+1]+t*points[i2+3];newpoints[i2]=x2,newpoints[i2+1]=y2}return this._setCurvePoint(newpoints,t,curvePoints,cpi)}}},{key:"endBatch",value:function(){var gl=this.gl,vao=this.vao,vertexCount=this.vertexCount,count=this.instanceCount;if(count!==0){var program=this.renderTarget.picking?this.pickingProgram:this.program;gl.useProgram(program),gl.bindVertexArray(vao);var _iterator2=_createForOfIteratorHelper(this.buffers),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var buffer=_step2.value;buffer.bufferSubData(count)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}for(var atlases=this.batchManager.getAtlases(),i2=0;i2<atlases.length;i2++)atlases[i2].bufferIfNeeded(gl);for(var _i2=0;_i2<atlases.length;_i2++)gl.activeTexture(gl.TEXTURE0+_i2),gl.bindTexture(gl.TEXTURE_2D,atlases[_i2].texture),gl.uniform1i(program.uTextures[_i2],_i2);gl.uniform1f(program.uZoom,getEffectiveZoom(this.r)),gl.uniformMatrix3fv(program.uPanZoomMatrix,!1,this.panZoomMatrix),gl.uniform1i(program.uAtlasSize,this.batchManager.getAtlasSize());var webglBgColor=toWebGLColor(this.bgColor,1);gl.uniform4fv(program.uBGColor,webglBgColor),gl.drawArraysInstanced(gl.TRIANGLES,0,vertexCount,count),gl.bindVertexArray(null),gl.bindTexture(gl.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count,atlasCount:atlases.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var atlasInfo=this.atlasManager.getDebugInfo(),totalAtlases=atlasInfo.reduce(function(count,info){return count+info.atlasCount},0),batchInfo=this.batchDebugInfo,totalInstances=batchInfo.reduce(function(count,info){return count+info.count},0);return{atlasInfo,totalAtlases,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:batchInfo.length,batchInfo,totalInstances}}}])})(),CRp$4={};CRp$4.initWebgl=function(opts,fns){var r=this,gl=r.data.contexts[r.WEBGL];opts.bgColor=getBGColor(r),opts.webglTexSize=Math.min(opts.webglTexSize,gl.getParameter(gl.MAX_TEXTURE_SIZE)),opts.webglTexRows=Math.min(opts.webglTexRows,54),opts.webglTexRowsNodes=Math.min(opts.webglTexRowsNodes,54),opts.webglBatchSize=Math.min(opts.webglBatchSize,16384),opts.webglTexPerBatch=Math.min(opts.webglTexPerBatch,gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=opts.webglDebug,r.webglDebugShowAtlases=opts.webglDebugShowAtlases,r.pickingFrameBuffer=createPickingFrameBuffer(gl),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new ElementDrawingWebGL(r,gl,opts);var getLabelRotation3=function(prop){return function(ele){return r.getTextAngle(ele,prop)}},isLabelVisible=function(prop){return function(ele){var label=ele.pstyle(prop);return label&&label.value}},isLayerVisible=function(prefix){return function(node){return node.pstyle("".concat(prefix,"-opacity")).value>0}},getTexPickingMode=function(ele){var enabled=ele.pstyle("text-events").strValue==="yes";return enabled?TEX_PICKING_MODE.USE_BB:TEX_PICKING_MODE.IGNORE},getBBForSimpleShape=function(node){var _node$position=node.position(),x2=_node$position.x,y2=_node$position.y,w=node.outerWidth(),h=node.outerHeight();return{w,h,x1:x2-w/2,y1:y2-h/2}};r.drawing.addAtlasCollection("node",{texRows:opts.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:opts.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:fns.getStyleKey,getBoundingBox:fns.getElementBox,drawElement:fns.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:getBBForSimpleShape,isSimple:isSimpleShape,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:getBBForSimpleShape,isVisible:isLayerVisible("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:getBBForSimpleShape,isVisible:isLayerVisible("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getLabelKey,null),getBoundingBox:getBoundingBoxForLabel(fns.getLabelBox,null),drawClipped:!0,drawElement:fns.drawLabel,getRotation:getLabelRotation3(null),getRotationPoint:fns.getLabelRotationPoint,getRotationOffset:fns.getLabelRotationOffset,isVisible:isLabelVisible("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getSourceLabelKey,"source"),getBoundingBox:getBoundingBoxForLabel(fns.getSourceLabelBox,"source"),drawClipped:!0,drawElement:fns.drawSourceLabel,getRotation:getLabelRotation3("source"),getRotationPoint:fns.getSourceLabelRotationPoint,getRotationOffset:fns.getSourceLabelRotationOffset,isVisible:isLabelVisible("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getTargetLabelKey,"target"),getBoundingBox:getBoundingBoxForLabel(fns.getTargetLabelBox,"target"),drawClipped:!0,drawElement:fns.drawTargetLabel,getRotation:getLabelRotation3("target"),getRotationPoint:fns.getTargetLabelRotationPoint,getRotationOffset:fns.getTargetLabelRotationOffset,isVisible:isLabelVisible("target-label")});var setGCFlag=debounce(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(willDraw,eles){var gcNeeded=!1;eles&&eles.length>0&&(gcNeeded|=r.drawing.invalidate(eles)),gcNeeded&&setGCFlag()}),overrideCanvasRendererFunctions(r)};function getBGColor(r){var container2=r.cy.container(),cssColor=container2&&container2.style&&container2.style.backgroundColor||"white";return color2tuple(cssColor)}function getLabelLines(ele,prefix){var rs=ele._private.rscratch;return getPrefixedProperty(rs,"labelWrapCachedLines",prefix)||[]}var getStyleKeysForLabel=function(getKey3,prefix){return function(ele){var key=getKey3(ele),lines=getLabelLines(ele,prefix);return lines.length>1?lines.map(function(line,index){return"".concat(key,"_").concat(index)}):key}},getBoundingBoxForLabel=function(getBoundingBox,prefix){return function(ele,styleKey){var bb=getBoundingBox(ele);if(typeof styleKey=="string"){var ui=styleKey.indexOf("_");if(ui>0){var lineIndex=Number(styleKey.substring(ui+1)),lines=getLabelLines(ele,prefix),h=bb.h/lines.length,yOffset=h*lineIndex,y1=bb.y1+yOffset;return{x1:bb.x1,w:bb.w,y1,h,yOffset}}}return bb}};function overrideCanvasRendererFunctions(r){{var renderCanvas=r.render;r.render=function(options2){options2=options2||{};var cy=r.cy;r.webgl&&(cy.zoom()>maxZoom$1?(clearWebgl(r),renderCanvas.call(r,options2)):(clearCanvas(r),renderWebgl(r,options2,RENDER_TARGET.SCREEN)))}}{var baseFunc=r.matchCanvasSize;r.matchCanvasSize=function(container2){baseFunc.call(r,container2),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(x2,y2,interactiveElementsOnly,isTouch){return findNearestElementsWebgl(r,x2,y2)};{var _baseFunc=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){_baseFunc.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var _baseFunc2=r.notify;r.notify=function(eventName,eles){_baseFunc2.call(r,eventName,eles),eventName==="viewport"||eventName==="bounds"?r.pickingFrameBuffer.needsDraw=!0:eventName==="background"&&r.drawing.invalidate(eles,{type:"node-body"})}}}function clearWebgl(r){var gl=r.data.contexts[r.WEBGL];gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT)}function clearCanvas(r){var clear=function(context){context.save(),context.setTransform(1,0,0,1,0,0),context.clearRect(0,0,r.canvasWidth,r.canvasHeight),context.restore()};clear(r.data.contexts[r.NODE]),clear(r.data.contexts[r.DRAG])}function createPanZoomMatrix(r){var width2=r.canvasWidth,height2=r.canvasHeight,_util$getEffectivePan=getEffectivePanZoom(r),pan2=_util$getEffectivePan.pan,zoom2=_util$getEffectivePan.zoom,transform7=create();translate(transform7,transform7,[pan2.x,pan2.y]),scale(transform7,transform7,[zoom2,zoom2]);var projection$1=create();projection(projection$1,width2,height2);var product=create();return multiply(product,projection$1,transform7),product}function setContextTransform(r,context){var width2=r.canvasWidth,height2=r.canvasHeight,_util$getEffectivePan2=getEffectivePanZoom(r),pan2=_util$getEffectivePan2.pan,zoom2=_util$getEffectivePan2.zoom;context.setTransform(1,0,0,1,0,0),context.clearRect(0,0,width2,height2),context.translate(pan2.x,pan2.y),context.scale(zoom2,zoom2)}function drawSelectionRectangle(r,options2){r.drawSelectionRectangle(options2,function(context){return setContextTransform(r,context)})}function drawAxes(r){var context=r.data.contexts[r.NODE];context.save(),setContextTransform(r,context),context.strokeStyle="rgba(0, 0, 0, 0.3)",context.beginPath(),context.moveTo(-1e3,0),context.lineTo(1e3,0),context.stroke(),context.beginPath(),context.moveTo(0,-1e3),context.lineTo(0,1e3),context.stroke(),context.restore()}function drawAtlases(r){var draw=function(drawing,name,row){for(var collection4=drawing.atlasManager.getAtlasCollection(name),context=r.data.contexts[r.NODE],atlases=collection4.atlases,_i=0;_i<atlases.length;_i++){var atlas=atlases[_i],canvas=atlas.canvas;if(canvas){var w=canvas.width,h=canvas.height,x2=w*_i,y2=canvas.height*row,scale2=.4;context.save(),context.scale(scale2,scale2),context.drawImage(canvas,x2,y2),context.strokeStyle="black",context.rect(x2,y2,w,h),context.stroke(),context.restore()}}},i2=0;draw(r.drawing,"node",i2++),draw(r.drawing,"label",i2++)}function getPickingIndexes(r,mX1,mY1,mX2,mY2){var x2,y2,w,h,_util$getEffectivePan3=getEffectivePanZoom(r),pan2=_util$getEffectivePan3.pan,zoom2=_util$getEffectivePan3.zoom;{var _util$modelToRendered=modelToRenderedPosition2(r,pan2,zoom2,mX1,mY1),_util$modelToRendered2=_slicedToArray(_util$modelToRendered,2),cX1=_util$modelToRendered2[0],cY1=_util$modelToRendered2[1],t=6;x2=cX1-t/2,y2=cY1-t/2,w=t,h=t}if(w===0||h===0)return[];var gl=r.data.contexts[r.WEBGL];gl.bindFramebuffer(gl.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(gl.viewport(0,0,gl.canvas.width,gl.canvas.height),renderWebgl(r,null,RENDER_TARGET.PICKING),r.pickingFrameBuffer.needsDraw=!1);var n=w*h,data4=new Uint8Array(n*4);gl.readPixels(x2,y2,w,h,gl.RGBA,gl.UNSIGNED_BYTE,data4),gl.bindFramebuffer(gl.FRAMEBUFFER,null);for(var indexes=new Set,i2=0;i2<n;i2++){var pixel=data4.slice(i2*4,i2*4+4),index=vec4ToIndex(pixel)-1;index>=0&&indexes.add(index)}return indexes}function findNearestElementsWebgl(r,x2,y2){var indexes=getPickingIndexes(r,x2,y2),eles=r.getCachedZSortedEles(),node,edge,_iterator=_createForOfIteratorHelper(indexes),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var index=_step.value,ele=eles[index];if(!node&&ele.isNode()&&(node=ele),!edge&&ele.isEdge()&&(edge=ele),node&&edge)break}}catch(err){_iterator.e(err)}finally{_iterator.f()}return[node,edge].filter(Boolean)}function drawEle(r,index,ele){var drawing=r.drawing;index+=1,ele.isNode()?(drawing.drawNode(ele,index,"node-underlay"),drawing.drawNode(ele,index,"node-body"),drawing.drawTexture(ele,index,"label"),drawing.drawNode(ele,index,"node-overlay")):(drawing.drawEdgeLine(ele,index),drawing.drawEdgeArrow(ele,index,"source"),drawing.drawEdgeArrow(ele,index,"target"),drawing.drawTexture(ele,index,"label"),drawing.drawTexture(ele,index,"edge-source-label"),drawing.drawTexture(ele,index,"edge-target-label"))}function renderWebgl(r,options2,renderTarget){var start;r.webglDebug&&(start=performance.now());var drawing=r.drawing,eleCount=0;if(renderTarget.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&drawSelectionRectangle(r,options2),r.data.canvasNeedsRedraw[r.NODE]||renderTarget.picking){var gl=r.data.contexts[r.WEBGL];renderTarget.screen?(gl.clearColor(0,0,0,0),gl.enable(gl.BLEND),gl.blendFunc(gl.ONE,gl.ONE_MINUS_SRC_ALPHA)):gl.disable(gl.BLEND),gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT),gl.viewport(0,0,gl.canvas.width,gl.canvas.height);var panZoomMatrix=createPanZoomMatrix(r),eles=r.getCachedZSortedEles();if(eleCount=eles.length,drawing.startFrame(panZoomMatrix,renderTarget),renderTarget.screen){for(var i2=0;i2<eles.nondrag.length;i2++)drawEle(r,i2,eles.nondrag[i2]);for(var _i2=0;_i2<eles.drag.length;_i2++)drawEle(r,_i2,eles.drag[_i2])}else if(renderTarget.picking)for(var _i3=0;_i3<eles.length;_i3++)drawEle(r,_i3,eles[_i3]);drawing.endFrame(),renderTarget.screen&&r.webglDebugShowAtlases&&(drawAxes(r),drawAtlases(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var end=performance.now(),compact=!1,time2=Math.ceil(end-start),debugInfo=drawing.getDebugInfo(),report=["".concat(eleCount," elements"),"".concat(debugInfo.totalInstances," instances"),"".concat(debugInfo.batchCount," batches"),"".concat(debugInfo.totalAtlases," atlases"),"".concat(debugInfo.wrappedCount," wrapped textures"),"".concat(debugInfo.simpleCount," simple shapes")].join(", ");if(compact)console.log("WebGL (".concat(renderTarget.name,") - time ").concat(time2,"ms, ").concat(report));else{console.log("WebGL (".concat(renderTarget.name,") - frame time ").concat(time2,"ms")),console.log("Totals:"),console.log(" ".concat(report)),console.log("Texture Atlases Used:");var atlasInfo=debugInfo.atlasInfo,_iterator2=_createForOfIteratorHelper(atlasInfo),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var info=_step2.value;console.log(" ".concat(info.type,": ").concat(info.keyCount," keys, ").concat(info.atlasCount," atlases"))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,drawing.gc())}var CRp$3={};CRp$3.drawPolygonPath=function(context,x2,y2,width2,height2,points){var halfW=width2/2,halfH=height2/2;context.beginPath&&context.beginPath(),context.moveTo(x2+halfW*points[0],y2+halfH*points[1]);for(var i2=1;i2<points.length/2;i2++)context.lineTo(x2+halfW*points[i2*2],y2+halfH*points[i2*2+1]);context.closePath()};CRp$3.drawRoundPolygonPath=function(context,x2,y2,width2,height2,points,corners){corners.forEach(function(corner){return drawPreparedRoundCorner(context,corner)}),context.closePath()};CRp$3.drawRoundRectanglePath=function(context,x2,y2,width2,height2,radius2){var halfWidth=width2/2,halfHeight=height2/2,cornerRadius=radius2==="auto"?getRoundRectangleRadius(width2,height2):Math.min(radius2,halfHeight,halfWidth);context.beginPath&&context.beginPath(),context.moveTo(x2,y2-halfHeight),context.arcTo(x2+halfWidth,y2-halfHeight,x2+halfWidth,y2,cornerRadius),context.arcTo(x2+halfWidth,y2+halfHeight,x2,y2+halfHeight,cornerRadius),context.arcTo(x2-halfWidth,y2+halfHeight,x2-halfWidth,y2,cornerRadius),context.arcTo(x2-halfWidth,y2-halfHeight,x2,y2-halfHeight,cornerRadius),context.lineTo(x2,y2-halfHeight),context.closePath()};CRp$3.drawBottomRoundRectanglePath=function(context,x2,y2,width2,height2,radius2){var halfWidth=width2/2,halfHeight=height2/2,cornerRadius=radius2==="auto"?getRoundRectangleRadius(width2,height2):radius2;context.beginPath&&context.beginPath(),context.moveTo(x2,y2-halfHeight),context.lineTo(x2+halfWidth,y2-halfHeight),context.lineTo(x2+halfWidth,y2),context.arcTo(x2+halfWidth,y2+halfHeight,x2,y2+halfHeight,cornerRadius),context.arcTo(x2-halfWidth,y2+halfHeight,x2-halfWidth,y2,cornerRadius),context.lineTo(x2-halfWidth,y2-halfHeight),context.lineTo(x2,y2-halfHeight),context.closePath()};CRp$3.drawCutRectanglePath=function(context,x2,y2,width2,height2,points,corners){var halfWidth=width2/2,halfHeight=height2/2,cornerLength=corners==="auto"?getCutRectangleCornerLength():corners;context.beginPath&&context.beginPath(),context.moveTo(x2-halfWidth+cornerLength,y2-halfHeight),context.lineTo(x2+halfWidth-cornerLength,y2-halfHeight),context.lineTo(x2+halfWidth,y2-halfHeight+cornerLength),context.lineTo(x2+halfWidth,y2+halfHeight-cornerLength),context.lineTo(x2+halfWidth-cornerLength,y2+halfHeight),context.lineTo(x2-halfWidth+cornerLength,y2+halfHeight),context.lineTo(x2-halfWidth,y2+halfHeight-cornerLength),context.lineTo(x2-halfWidth,y2-halfHeight+cornerLength),context.closePath()};CRp$3.drawBarrelPath=function(context,x2,y2,width2,height2){var halfWidth=width2/2,halfHeight=height2/2,xBegin=x2-halfWidth,xEnd=x2+halfWidth,yBegin=y2-halfHeight,yEnd=y2+halfHeight,barrelCurveConstants=getBarrelCurveConstants(width2,height2),wOffset=barrelCurveConstants.widthOffset,hOffset=barrelCurveConstants.heightOffset,ctrlPtXOffset=barrelCurveConstants.ctrlPtOffsetPct*wOffset;context.beginPath&&context.beginPath(),context.moveTo(xBegin,yBegin+hOffset),context.lineTo(xBegin,yEnd-hOffset),context.quadraticCurveTo(xBegin+ctrlPtXOffset,yEnd,xBegin+wOffset,yEnd),context.lineTo(xEnd-wOffset,yEnd),context.quadraticCurveTo(xEnd-ctrlPtXOffset,yEnd,xEnd,yEnd-hOffset),context.lineTo(xEnd,yBegin+hOffset),context.quadraticCurveTo(xEnd-ctrlPtXOffset,yBegin,xEnd-wOffset,yBegin),context.lineTo(xBegin+wOffset,yBegin),context.quadraticCurveTo(xBegin+ctrlPtXOffset,yBegin,xBegin,yBegin+hOffset),context.closePath()};var sin0=Math.sin(0),cos0=Math.cos(0),sin={},cos={},ellipseStepSize=Math.PI/40;for(i=0*Math.PI;i<2*Math.PI;i+=ellipseStepSize)sin[i]=Math.sin(i),cos[i]=Math.cos(i);var i;CRp$3.drawEllipsePath=function(context,centerX,centerY,width2,height2){if(context.beginPath&&context.beginPath(),context.ellipse)context.ellipse(centerX,centerY,width2/2,height2/2,0,0,2*Math.PI);else for(var xPos,yPos,rw=width2/2,rh=height2/2,i2=0*Math.PI;i2<2*Math.PI;i2+=ellipseStepSize)xPos=centerX-rw*sin[i2]*sin0+rw*cos[i2]*cos0,yPos=centerY+rh*cos[i2]*sin0+rh*sin[i2]*cos0,i2===0?context.moveTo(xPos,yPos):context.lineTo(xPos,yPos);context.closePath()};var CRp$2={};CRp$2.createBuffer=function(w,h){var buffer=document.createElement("canvas");return buffer.width=w,buffer.height=h,[buffer,buffer.getContext("2d")]};CRp$2.bufferCanvasImage=function(options2){var cy=this.cy,eles=cy.mutableElements(),bb=eles.boundingBox(),ctrRect=this.findContainerClientCoords(),width2=options2.full?Math.ceil(bb.w):ctrRect[2],height2=options2.full?Math.ceil(bb.h):ctrRect[3],specdMaxDims=number$1(options2.maxWidth)||number$1(options2.maxHeight),pxRatio=this.getPixelRatio(),scale2=1;if(options2.scale!==void 0)width2*=options2.scale,height2*=options2.scale,scale2=options2.scale;else if(specdMaxDims){var maxScaleW=1/0,maxScaleH=1/0;number$1(options2.maxWidth)&&(maxScaleW=scale2*options2.maxWidth/width2),number$1(options2.maxHeight)&&(maxScaleH=scale2*options2.maxHeight/height2),scale2=Math.min(maxScaleW,maxScaleH),width2*=scale2,height2*=scale2}specdMaxDims||(width2*=pxRatio,height2*=pxRatio,scale2*=pxRatio);var buffCanvas=document.createElement("canvas");buffCanvas.width=width2,buffCanvas.height=height2,buffCanvas.style.width=width2+"px",buffCanvas.style.height=height2+"px";var buffCxt=buffCanvas.getContext("2d");if(width2>0&&height2>0){buffCxt.clearRect(0,0,width2,height2),buffCxt.globalCompositeOperation="source-over";var zsortedEles=this.getCachedZSortedEles();if(options2.full)buffCxt.translate(-bb.x1*scale2,-bb.y1*scale2),buffCxt.scale(scale2,scale2),this.drawElements(buffCxt,zsortedEles),buffCxt.scale(1/scale2,1/scale2),buffCxt.translate(bb.x1*scale2,bb.y1*scale2);else{var pan2=cy.pan(),translation={x:pan2.x*scale2,y:pan2.y*scale2};scale2*=cy.zoom(),buffCxt.translate(translation.x,translation.y),buffCxt.scale(scale2,scale2),this.drawElements(buffCxt,zsortedEles),buffCxt.scale(1/scale2,1/scale2),buffCxt.translate(-translation.x,-translation.y)}options2.bg&&(buffCxt.globalCompositeOperation="destination-over",buffCxt.fillStyle=options2.bg,buffCxt.rect(0,0,width2,height2),buffCxt.fill())}return buffCanvas};function b64ToBlob(b64,mimeType){for(var bytes=atob(b64),buff=new ArrayBuffer(bytes.length),buffUint8=new Uint8Array(buff),i2=0;i2<bytes.length;i2++)buffUint8[i2]=bytes.charCodeAt(i2);return new Blob([buff],{type:mimeType})}function b64UriToB64(b64uri){var i2=b64uri.indexOf(",");return b64uri.substr(i2+1)}function output(options2,canvas,mimeType){var getB64Uri=function(){return canvas.toDataURL(mimeType,options2.quality)};switch(options2.output){case"blob-promise":return new Promise$1(function(resolve2,reject2){try{canvas.toBlob(function(blob){blob!=null?resolve2(blob):reject2(new Error("`canvas.toBlob()` sent a null value in its callback"))},mimeType,options2.quality)}catch(err){reject2(err)}});case"blob":return b64ToBlob(b64UriToB64(getB64Uri()),mimeType);case"base64":return b64UriToB64(getB64Uri());default:return getB64Uri()}}CRp$2.png=function(options2){return output(options2,this.bufferCanvasImage(options2),"image/png")};CRp$2.jpg=function(options2){return output(options2,this.bufferCanvasImage(options2),"image/jpeg")};var CRp$1={};CRp$1.nodeShapeImpl=function(name,context,centerX,centerY,width2,height2,points,corners){switch(name){case"ellipse":return this.drawEllipsePath(context,centerX,centerY,width2,height2);case"polygon":return this.drawPolygonPath(context,centerX,centerY,width2,height2,points);case"round-polygon":return this.drawRoundPolygonPath(context,centerX,centerY,width2,height2,points,corners);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(context,centerX,centerY,width2,height2,corners);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(context,centerX,centerY,width2,height2,points,corners);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(context,centerX,centerY,width2,height2,corners);case"barrel":return this.drawBarrelPath(context,centerX,centerY,width2,height2)}};var CR=CanvasRenderer,CRp=CanvasRenderer.prototype;CRp.CANVAS_LAYERS=3;CRp.SELECT_BOX=0;CRp.DRAG=1;CRp.NODE=2;CRp.WEBGL=3;CRp.CANVAS_TYPES=["2d","2d","2d","webgl2"];CRp.BUFFER_COUNT=3;CRp.TEXTURE_BUFFER=0;CRp.MOTIONBLUR_BUFFER_NODE=1;CRp.MOTIONBLUR_BUFFER_DRAG=2;function CanvasRenderer(options2){var r=this,containerWindow=r.cy.window(),document2=containerWindow.document;options2.webgl&&(CRp.CANVAS_LAYERS=r.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),r.data={canvases:new Array(CRp.CANVAS_LAYERS),contexts:new Array(CRp.CANVAS_LAYERS),canvasNeedsRedraw:new Array(CRp.CANVAS_LAYERS),bufferCanvases:new Array(CRp.BUFFER_COUNT),bufferContexts:new Array(CRp.CANVAS_LAYERS)};var tapHlOffAttr="-webkit-tap-highlight-color",tapHlOffStyle="rgba(0,0,0,0)";r.data.canvasContainer=document2.createElement("div");var containerStyle=r.data.canvasContainer.style;r.data.canvasContainer.style[tapHlOffAttr]=tapHlOffStyle,containerStyle.position="relative",containerStyle.zIndex="0",containerStyle.overflow="hidden";var container2=options2.cy.container();container2.appendChild(r.data.canvasContainer),container2.style[tapHlOffAttr]=tapHlOffStyle;var styleMap={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};ms()&&(styleMap["-ms-touch-action"]="none",styleMap["touch-action"]="none");for(var i2=0;i2<CRp.CANVAS_LAYERS;i2++){var canvas=r.data.canvases[i2]=document2.createElement("canvas"),type=CRp.CANVAS_TYPES[i2];r.data.contexts[i2]=canvas.getContext(type),r.data.contexts[i2]||error("Could not create canvas of type "+type),Object.keys(styleMap).forEach(function(k){canvas.style[k]=styleMap[k]}),canvas.style.position="absolute",canvas.setAttribute("data-id","layer"+i2),canvas.style.zIndex=String(CRp.CANVAS_LAYERS-i2),r.data.canvasContainer.appendChild(canvas),r.data.canvasNeedsRedraw[i2]=!1}r.data.topCanvas=r.data.canvases[0],r.data.canvases[CRp.NODE].setAttribute("data-id","layer"+CRp.NODE+"-node"),r.data.canvases[CRp.SELECT_BOX].setAttribute("data-id","layer"+CRp.SELECT_BOX+"-selectbox"),r.data.canvases[CRp.DRAG].setAttribute("data-id","layer"+CRp.DRAG+"-drag"),r.data.canvases[CRp.WEBGL]&&r.data.canvases[CRp.WEBGL].setAttribute("data-id","layer"+CRp.WEBGL+"-webgl");for(var i2=0;i2<CRp.BUFFER_COUNT;i2++)r.data.bufferCanvases[i2]=document2.createElement("canvas"),r.data.bufferContexts[i2]=r.data.bufferCanvases[i2].getContext("2d"),r.data.bufferCanvases[i2].style.position="absolute",r.data.bufferCanvases[i2].setAttribute("data-id","buffer"+i2),r.data.bufferCanvases[i2].style.zIndex=String(-i2-1),r.data.bufferCanvases[i2].style.visibility="hidden";r.pathsEnabled=!0;var emptyBb=makeBoundingBox(),getBoxCenter=function(bb){return{x:(bb.x1+bb.x2)/2,y:(bb.y1+bb.y2)/2}},getCenterOffset=function(bb){return{x:-bb.w/2,y:-bb.h/2}},backgroundTimestampHasChanged=function(ele){var _p=ele[0]._private,same2=_p.oldBackgroundTimestamp===_p.backgroundTimestamp;return!same2},getStyleKey=function(ele){return ele[0]._private.nodeKey},getLabelKey=function(ele){return ele[0]._private.labelStyleKey},getSourceLabelKey=function(ele){return ele[0]._private.sourceLabelStyleKey},getTargetLabelKey=function(ele){return ele[0]._private.targetLabelStyleKey},drawElement=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElement(context,ele,bb,!1,!1,useEleOpacity)},drawLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"main",useEleOpacity)},drawSourceLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"source",useEleOpacity)},drawTargetLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"target",useEleOpacity)},getElementBox=function(ele){return ele.boundingBox(),ele[0]._private.bodyBounds},getLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.main||emptyBb},getSourceLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.source||emptyBb},getTargetLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.target||emptyBb},isLabelVisibleAtScale=function(ele,scaledLabelShown){return scaledLabelShown},getElementRotationPoint=function(ele){return getBoxCenter(getElementBox(ele))},addTextMargin=function(prefix,pt,ele){var pre=prefix?prefix+"-":"";return{x:pt.x+ele.pstyle(pre+"text-margin-x").pfValue,y:pt.y+ele.pstyle(pre+"text-margin-y").pfValue}},getRsPt=function(ele,x2,y2){var rs=ele[0]._private.rscratch;return{x:rs[x2],y:rs[y2]}},getLabelRotationPoint=function(ele){return addTextMargin("",getRsPt(ele,"labelX","labelY"),ele)},getSourceLabelRotationPoint=function(ele){return addTextMargin("source",getRsPt(ele,"sourceLabelX","sourceLabelY"),ele)},getTargetLabelRotationPoint=function(ele){return addTextMargin("target",getRsPt(ele,"targetLabelX","targetLabelY"),ele)},getElementRotationOffset=function(ele){return getCenterOffset(getElementBox(ele))},getSourceLabelRotationOffset=function(ele){return getCenterOffset(getSourceLabelBox(ele))},getTargetLabelRotationOffset=function(ele){return getCenterOffset(getTargetLabelBox(ele))},getLabelRotationOffset=function(ele){var bb=getLabelBox(ele),p2=getCenterOffset(getLabelBox(ele));if(ele.isNode()){switch(labelHalign(ele.pstyle("text-halign").value)){case"left":p2.x=-bb.w-(bb.leftPad||0);break;case"right":p2.x=-(bb.rightPad||0);break}switch(labelValign(ele.pstyle("text-valign").value)){case"top":p2.y=-bb.h-(bb.topPad||0);break;case"bottom":p2.y=-(bb.botPad||0);break}}return p2},eleTxrCache=r.data.eleTxrCache=new ElementTextureCache(r,{getKey:getStyleKey,doesEleInvalidateKey:backgroundTimestampHasChanged,drawElement,getBoundingBox:getElementBox,getRotationPoint:getElementRotationPoint,getRotationOffset:getElementRotationOffset,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),lblTxrCache=r.data.lblTxrCache=new ElementTextureCache(r,{getKey:getLabelKey,drawElement:drawLabel,getBoundingBox:getLabelBox,getRotationPoint:getLabelRotationPoint,getRotationOffset:getLabelRotationOffset,isVisible:isLabelVisibleAtScale}),slbTxrCache=r.data.slbTxrCache=new ElementTextureCache(r,{getKey:getSourceLabelKey,drawElement:drawSourceLabel,getBoundingBox:getSourceLabelBox,getRotationPoint:getSourceLabelRotationPoint,getRotationOffset:getSourceLabelRotationOffset,isVisible:isLabelVisibleAtScale}),tlbTxrCache=r.data.tlbTxrCache=new ElementTextureCache(r,{getKey:getTargetLabelKey,drawElement:drawTargetLabel,getBoundingBox:getTargetLabelBox,getRotationPoint:getTargetLabelRotationPoint,getRotationOffset:getTargetLabelRotationOffset,isVisible:isLabelVisibleAtScale}),lyrTxrCache=r.data.lyrTxrCache=new LayeredTextureCache(r);r.onUpdateEleCalcs(function(willDraw,eles){eleTxrCache.invalidateElements(eles),lblTxrCache.invalidateElements(eles),slbTxrCache.invalidateElements(eles),tlbTxrCache.invalidateElements(eles),lyrTxrCache.invalidateElements(eles);for(var _i=0;_i<eles.length;_i++){var _p=eles[_i]._private;_p.oldBackgroundTimestamp=_p.backgroundTimestamp}});var refineInLayers=function(reqs){for(var i3=0;i3<reqs.length;i3++)lyrTxrCache.enqueueElementRefinement(reqs[i3].ele)};eleTxrCache.onDequeue(refineInLayers),lblTxrCache.onDequeue(refineInLayers),slbTxrCache.onDequeue(refineInLayers),tlbTxrCache.onDequeue(refineInLayers),options2.webgl&&r.initWebgl(options2,{getStyleKey,getLabelKey,getSourceLabelKey,getTargetLabelKey,drawElement,drawLabel,drawSourceLabel,drawTargetLabel,getElementBox,getLabelBox,getSourceLabelBox,getTargetLabelBox,getElementRotationPoint,getElementRotationOffset,getLabelRotationPoint,getSourceLabelRotationPoint,getTargetLabelRotationPoint,getLabelRotationOffset,getSourceLabelRotationOffset,getTargetLabelRotationOffset})}CRp.redrawHint=function(group2,bool){var r=this;switch(group2){case"eles":r.data.canvasNeedsRedraw[CRp.NODE]=bool;break;case"drag":r.data.canvasNeedsRedraw[CRp.DRAG]=bool;break;case"select":r.data.canvasNeedsRedraw[CRp.SELECT_BOX]=bool;break;case"gc":r.data.gc=!0;break}};var pathsImpld=typeof Path2D<"u";CRp.path2dEnabled=function(on3){if(on3===void 0)return this.pathsEnabled;this.pathsEnabled=!!on3};CRp.usePaths=function(){return pathsImpld&&this.pathsEnabled};CRp.setImgSmoothing=function(context,bool){context.imageSmoothingEnabled!=null?context.imageSmoothingEnabled=bool:(context.webkitImageSmoothingEnabled=bool,context.mozImageSmoothingEnabled=bool,context.msImageSmoothingEnabled=bool)};CRp.getImgSmoothing=function(context){return context.imageSmoothingEnabled!=null?context.imageSmoothingEnabled:context.webkitImageSmoothingEnabled||context.mozImageSmoothingEnabled||context.msImageSmoothingEnabled};CRp.makeOffscreenCanvas=function(width2,height2){var canvas;if((typeof OffscreenCanvas>"u"?"undefined":_typeof(OffscreenCanvas))!=="undefined")canvas=new OffscreenCanvas(width2,height2);else{var containerWindow=this.cy.window(),document2=containerWindow.document;canvas=document2.createElement("canvas"),canvas.width=width2,canvas.height=height2}return canvas};[CRp$b,CRp$a,CRp$9,CRp$8,CRp$7,CRp$6,CRp$5,CRp$4,CRp$3,CRp$2,CRp$1].forEach(function(props){extend(CRp,props)});var renderer2=[{name:"null",impl:NullRenderer},{name:"base",impl:BR},{name:"canvas",impl:CR}],incExts=[{type:"layout",extensions:layout3},{type:"renderer",extensions:renderer2}],extensions={},modules={};function setExtension(type,name,registrant){var ext=registrant,overrideErr=function(field){warn("Can not register `"+name+"` for `"+type+"` since `"+field+"` already exists in the prototype and can not be overridden")};if(type==="core"){if(Core.prototype[name])return overrideErr(name);Core.prototype[name]=registrant}else if(type==="collection"){if(Collection.prototype[name])return overrideErr(name);Collection.prototype[name]=registrant}else if(type==="layout"){for(var Layout2=function(options2){this.options=options2,registrant.call(this,options2),plainObject(this._private)||(this._private={}),this._private.cy=options2.cy,this._private.listeners=[],this.createEmitter()},layoutProto=Layout2.prototype=Object.create(registrant.prototype),optLayoutFns=[],i2=0;i2<optLayoutFns.length;i2++){var fnName=optLayoutFns[i2];layoutProto[fnName]=layoutProto[fnName]||function(){return this}}layoutProto.start&&!layoutProto.run?layoutProto.run=function(){return this.start(),this}:!layoutProto.start&&layoutProto.run&&(layoutProto.start=function(){return this.run(),this});var regStop=registrant.prototype.stop;layoutProto.stop=function(){var opts=this.options;if(opts&&opts.animate){var anis=this.animations;if(anis)for(var _i=0;_i<anis.length;_i++)anis[_i].stop()}return regStop?regStop.call(this):this.emit("layoutstop"),this},layoutProto.destroy||(layoutProto.destroy=function(){return this}),layoutProto.cy=function(){return this._private.cy};var getCy=function(layout4){return layout4._private.cy},emitterOpts={addEventFields:function(layout4,evt){evt.layout=layout4,evt.cy=getCy(layout4),evt.target=layout4},bubble:function(){return!0},parent:function(layout4){return getCy(layout4)}};extend(layoutProto,{createEmitter:function(){return this._private.emitter=new Emitter(emitterOpts,this),this},emitter:function(){return this._private.emitter},on:function(evt,cb){return this.emitter().on(evt,cb),this},one:function(evt,cb){return this.emitter().one(evt,cb),this},once:function(evt,cb){return this.emitter().one(evt,cb),this},removeListener:function(evt,cb){return this.emitter().removeListener(evt,cb),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(evt,params){return this.emitter().emit(evt,params),this}}),define2.eventAliasesOn(layoutProto),ext=Layout2}else if(type==="renderer"&&name!=="null"&&name!=="base"){var BaseRenderer3=getExtension("renderer","base"),bProto=BaseRenderer3.prototype,RegistrantRenderer=registrant,rProto=registrant.prototype,Renderer=function(){BaseRenderer3.apply(this,arguments),RegistrantRenderer.apply(this,arguments)},proto=Renderer.prototype;for(var pName in bProto){var pVal=bProto[pName],existsInR=rProto[pName]!=null;if(existsInR)return overrideErr(pName);proto[pName]=pVal}for(var _pName in rProto)proto[_pName]=rProto[_pName];bProto.clientFunctions.forEach(function(name2){proto[name2]=proto[name2]||function(){error("Renderer does not implement `renderer."+name2+"()` on its prototype")}}),ext=Renderer}else if(type==="__proto__"||type==="constructor"||type==="prototype")return error(type+" is an illegal type to be registered, possibly lead to prototype pollutions");return setMap({map:extensions,keys:[type,name],value:ext})}function getExtension(type,name){return getMap({map:extensions,keys:[type,name]})}function setModule(type,name,moduleType,moduleName,registrant){return setMap({map:modules,keys:[type,name,moduleType,moduleName],value:registrant})}function getModule(type,name,moduleType,moduleName){return getMap({map:modules,keys:[type,name,moduleType,moduleName]})}var extension=function(){if(arguments.length===2)return getExtension.apply(null,arguments);if(arguments.length===3)return setExtension.apply(null,arguments);if(arguments.length===4)return getModule.apply(null,arguments);if(arguments.length===5)return setModule.apply(null,arguments);error("Invalid extension access syntax")};Core.prototype.extension=extension;incExts.forEach(function(group2){group2.extensions.forEach(function(ext){setExtension(group2.type,ext.name,ext.impl)})});var _Stylesheet=function(){if(!(this instanceof _Stylesheet))return new _Stylesheet;this.length=0},sheetfn=_Stylesheet.prototype;sheetfn.instanceString=function(){return"stylesheet"};sheetfn.selector=function(selector){var i2=this.length++;return this[i2]={selector,properties:[]},this};sheetfn.css=function(name,value){var i2=this.length-1;if(string(name))this[i2].properties.push({name,value});else if(plainObject(name))for(var map2=name,propNames=Object.keys(map2),j=0;j<propNames.length;j++){var key=propNames[j],mapVal=map2[key];if(mapVal!=null){var prop=_Style.properties[key]||_Style.properties[dash2camel(key)];if(prop!=null){var _name=prop.name,_value=mapVal;this[i2].properties.push({name:_name,value:_value})}}}return this};sheetfn.style=sheetfn.css;sheetfn.generateStyle=function(cy){var style3=new _Style(cy);return this.appendToStyle(style3)};sheetfn.appendToStyle=function(style3){for(var i2=0;i2<this.length;i2++){var context=this[i2],selector=context.selector,props=context.properties;style3.selector(selector);for(var j=0;j<props.length;j++){var prop=props[j];style3.css(prop.name,prop.value)}}return style3};var version="3.34.1",cytoscape2=function(options2){if(options2===void 0&&(options2={}),plainObject(options2))return new Core(options2);if(string(options2))return extension.apply(extension,arguments)};cytoscape2.use=function(ext){var args=Array.prototype.slice.call(arguments,1);return args.unshift(cytoscape2),ext.apply(null,args),this};cytoscape2.warnings=function(bool){return warnings(bool)};cytoscape2.version=version;cytoscape2.stylesheet=cytoscape2.Stylesheet=_Stylesheet;var import_cytoscape_fcose=__toESM(require_cytoscape_fcose());cytoscape2.use(import_cytoscape_fcose.default);globalThis.__StrataGateGraphLibraries={cytoscape:cytoscape2};globalThis.__STRATAGATE_GITHUB_STARS__=116;window.__ModuleLoader__.load({id:"stratagate-dsh",factory:require2=>{let module={exports:{}},exports=module.exports;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let React=require2("react"),h=React.createElement,cytoscape4=globalThis.__StrataGateGraphLibraries?.cytoscape,AGENT_FEEDBACK_ENABLED=!0,GITHUB_FEEDBACK_ENABLED=!0,FEEDBACK_EMAIL="jiahongcheng61@gmail.com",EMAIL_BODY_HINT=`\u8BF7\u5728\u4E0B\u65B9\u7C98\u8D34 StrataGate \u53CD\u9988\u62A5\u544A\uFF0C\u68C0\u67E5\u540E\u53D1\u9001\u3002\u4E5F\u53EF\u4EE5\u624B\u52A8\u9644\u52A0\u5DF2\u4E0B\u8F7D\u7684\u8BCA\u65AD\u6587\u4EF6\u3002\r
321
+ `),program=createProgram(gl,vertexShaderSource,fragmentShaderSource);program.aPosition=gl.getAttribLocation(program,"aPosition"),program.aIndex=gl.getAttribLocation(program,"aIndex"),program.aVertType=gl.getAttribLocation(program,"aVertType"),program.aTransform=gl.getAttribLocation(program,"aTransform"),program.aAtlasId=gl.getAttribLocation(program,"aAtlasId"),program.aTex=gl.getAttribLocation(program,"aTex"),program.aPointAPointB=gl.getAttribLocation(program,"aPointAPointB"),program.aPointCPointD=gl.getAttribLocation(program,"aPointCPointD"),program.aLineWidth=gl.getAttribLocation(program,"aLineWidth"),program.aColor=gl.getAttribLocation(program,"aColor"),program.aCornerRadius=gl.getAttribLocation(program,"aCornerRadius"),program.aBorderColor=gl.getAttribLocation(program,"aBorderColor"),program.uPanZoomMatrix=gl.getUniformLocation(program,"uPanZoomMatrix"),program.uAtlasSize=gl.getUniformLocation(program,"uAtlasSize"),program.uBGColor=gl.getUniformLocation(program,"uBGColor"),program.uZoom=gl.getUniformLocation(program,"uZoom"),program.uTextures=[];for(var i2=0;i2<this.batchManager.getMaxAtlasesPerBatch();i2++)program.uTextures.push(gl.getUniformLocation(program,"uTexture".concat(i2)));return program}},{key:"_createVAO",value:function(){var unitSquare=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=unitSquare.length/2;var n=this.maxInstances,gl=this.gl,program=this.program,vao=gl.createVertexArray();return gl.bindVertexArray(vao),createBufferStaticDraw(gl,"vec2",program.aPosition,unitSquare),this.transformBuffer=create3x3MatrixBufferDynamicDraw(gl,n,program.aTransform),this.indexBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aIndex),this.vertTypeBuffer=createBufferDynamicDraw(gl,n,"int",program.aVertType),this.atlasIdBuffer=createBufferDynamicDraw(gl,n,"int",program.aAtlasId),this.texBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aTex),this.pointAPointBBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aPointAPointB),this.pointCPointDBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aPointCPointD),this.lineWidthBuffer=createBufferDynamicDraw(gl,n,"vec2",program.aLineWidth),this.colorBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aColor),this.cornerRadiusBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aCornerRadius),this.borderColorBuffer=createBufferDynamicDraw(gl,n,"vec4",program.aBorderColor),gl.bindVertexArray(null),vao}},{key:"buffers",get:function(){var _this=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(k){return endsWith(k,"Buffer")}).map(function(k){return _this[k]})),this._buffers}},{key:"startFrame",value:function(panZoomMatrix){var renderTarget=arguments.length>1&&arguments[1]!==void 0?arguments[1]:RENDER_TARGET.SCREEN;this.panZoomMatrix=panZoomMatrix,this.renderTarget=renderTarget,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(ele,opts){return ele.visible()?opts&&opts.isVisible?opts.isVisible(ele):!0:!1}},{key:"drawTexture",value:function(ele,eleIndex,type){var atlasManager=this.atlasManager,batchManager=this.batchManager,opts=atlasManager.getRenderTypeOpts(type);if(this._isVisible(ele,opts)&&!(ele.isEdge()&&!this._isValidEdge(ele))){if(this.renderTarget.picking&&opts.getTexPickingMode){var mode=opts.getTexPickingMode(ele);if(mode===TEX_PICKING_MODE.IGNORE)return;if(mode==TEX_PICKING_MODE.USE_BB){this.drawPickingRectangle(ele,eleIndex,type);return}}var atlasInfoArray=atlasManager.getAtlasInfo(ele,type),_iterator=_createForOfIteratorHelper(atlasInfoArray),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var atlasInfo=_step.value,atlas=atlasInfo.atlas,tex1=atlasInfo.tex1,tex2=atlasInfo.tex2;batchManager.canAddToCurrentBatch(atlas)||this.endBatch();for(var atlasIndex=batchManager.getAtlasIndexForBatch(atlas),_i=0,_arr=[[tex1,!0],[tex2,!1]];_i<_arr.length;_i++){var _arr$_i=_slicedToArray(_arr[_i],2),tex=_arr$_i[0],first2=_arr$_i[1];if(tex.w!=0){var instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=TEXTURE;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var atlasIdView=this.atlasIdBuffer.getView(instance2);atlasIdView[0]=atlasIndex;var texView=this.texBuffer.getView(instance2);texView[0]=tex.x,texView[1]=tex.y,texView[2]=tex.w,texView[3]=tex.h;var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(ele,matrixView,opts,atlasInfo,first2),this.instanceCount++,first2||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}},{key:"setTransformMatrix",value:function(ele,matrix,opts,atlasInfo){var first2=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,padding=0;if(opts.shapeProps&&opts.shapeProps.padding&&(padding=ele.pstyle(opts.shapeProps.padding).pfValue),atlasInfo){var bb=atlasInfo.bb,tex1=atlasInfo.tex1,tex2=atlasInfo.tex2,ratio=tex1.w/(tex1.w+tex2.w);first2||(ratio=1-ratio);var adjBB=this._getAdjustedBB(bb,padding,first2,ratio);this._applyTransformMatrix(matrix,adjBB,opts,ele)}else{var _bb=opts.getBoundingBox(ele),_adjBB=this._getAdjustedBB(_bb,padding,!0,1);this._applyTransformMatrix(matrix,_adjBB,opts,ele)}}},{key:"_applyTransformMatrix",value:function(matrix,adjBB,opts,ele){var x2,y2;identity2(matrix);var theta=opts.getRotation?opts.getRotation(ele):0;if(theta!==0){var _opts$getRotationPoin=opts.getRotationPoint(ele),sx=_opts$getRotationPoin.x,sy=_opts$getRotationPoin.y;translate(matrix,matrix,[sx,sy]),rotate(matrix,matrix,theta);var offset=opts.getRotationOffset(ele);x2=offset.x+(adjBB.xOffset||0),y2=offset.y+(adjBB.yOffset||0)}else x2=adjBB.x1,y2=adjBB.y1;translate(matrix,matrix,[x2,y2]),scale(matrix,matrix,[adjBB.w,adjBB.h])}},{key:"_getAdjustedBB",value:function(bb,padding,first2,ratio){var x1=bb.x1,y1=bb.y1,w=bb.w,h=bb.h,yOffset=bb.yOffset;padding&&(x1-=padding,y1-=padding,w+=2*padding,h+=2*padding);var xOffset=0,adjW=w*ratio;return first2&&ratio<1?w=adjW:!first2&&ratio<1&&(xOffset=w-adjW,x1+=xOffset,w=adjW),{x1,y1,w,h,xOffset,yOffset}}},{key:"drawPickingRectangle",value:function(ele,eleIndex,type){var opts=this.atlasManager.getRenderTypeOpts(type),instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=RECTANGLE;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor([0,0,0],1,colorView);var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(ele,matrixView,opts),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(node,eleIndex,type){var opts=this.simpleShapeOptions.get(type);if(this._isVisible(node,opts)){var props=opts.shapeProps,vertType=this._getVertTypeForShape(node,props.shape);if(vertType===void 0||opts.isSimple&&!opts.isSimple(node,this.renderTarget)){this.drawTexture(node,eleIndex,type);return}var instance2=this.instanceCount;if(this.vertTypeBuffer.getView(instance2)[0]=vertType,vertType===ROUND_RECTANGLE||vertType===BOTTOM_ROUND_RECTANGLE){var bb=opts.getBoundingBox(node),radius2=this._getCornerRadius(node,props.radius,bb),radiusView=this.cornerRadiusBuffer.getView(instance2);radiusView[0]=radius2,radiusView[1]=radius2,radiusView[2]=radius2,radiusView[3]=radius2,vertType===BOTTOM_ROUND_RECTANGLE&&(radiusView[0]=0,radiusView[2]=0)}var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var opacity=this.renderTarget.picking?1:type==="node-body"?node.effectiveOpacity():1,bgOpacity=this.renderTarget.picking?1:node.pstyle(props.opacity).value*opacity,color=node.pstyle(props.color).value,colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,bgOpacity,colorView);var lineWidthView=this.lineWidthBuffer.getView(instance2);if(lineWidthView[0]=0,lineWidthView[1]=0,props.border){var borderWidth=node.pstyle("border-width").value;if(borderWidth>0){var borderColor=node.pstyle("border-color").value,borderOpacity=opacity*node.pstyle("border-opacity").value,borderColorView=this.borderColorBuffer.getView(instance2);toWebGLColor(borderColor,borderOpacity,borderColorView);var borderPos=node.pstyle("border-position").value;if(borderPos==="inside")lineWidthView[0]=0,lineWidthView[1]=-borderWidth;else if(borderPos==="outside")lineWidthView[0]=borderWidth,lineWidthView[1]=0;else{var halfWidth=borderWidth/2;lineWidthView[0]=halfWidth,lineWidthView[1]=-halfWidth}}}var matrixView=this.transformBuffer.getMatrixView(instance2);this.setTransformMatrix(node,matrixView,opts),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(node,shapeProp){var shape=node.pstyle(shapeProp).value;switch(shape){case"rectangle":return RECTANGLE;case"ellipse":return ELLIPSE;case"roundrectangle":case"round-rectangle":return ROUND_RECTANGLE;case"bottom-round-rectangle":return BOTTOM_ROUND_RECTANGLE;default:return}}},{key:"_getCornerRadius",value:function(node,radiusProp,_ref2){var w=_ref2.w,h=_ref2.h;if(node.pstyle(radiusProp).value==="auto")return getRoundRectangleRadius(w,h);var radius2=node.pstyle(radiusProp).pfValue,halfWidth=w/2,halfHeight=h/2;return Math.min(radius2,halfHeight,halfWidth)}},{key:"drawEdgeArrow",value:function(edge,eleIndex,prefix){if(edge.visible()){var rs=edge._private.rscratch,x2,y2,angle2;if(prefix==="source"?(x2=rs.arrowStartX,y2=rs.arrowStartY,angle2=rs.srcArrowAngle):(x2=rs.arrowEndX,y2=rs.arrowEndY,angle2=rs.tgtArrowAngle),!(isNaN(x2)||x2==null||isNaN(y2)||y2==null||isNaN(angle2)||angle2==null)){var arrowShape=edge.pstyle(prefix+"-arrow-shape").value;if(arrowShape!=="none"){var color=edge.pstyle(prefix+"-arrow-color").value,baseOpacity=edge.pstyle("opacity").value,lineOpacity=edge.pstyle("line-opacity").value,opacity=baseOpacity*lineOpacity,lineWidth=edge.pstyle("width").pfValue,scale$1=edge.pstyle("arrow-scale").value,size3=this.r.getArrowWidth(lineWidth,scale$1),instance2=this.instanceCount,transform7=this.transformBuffer.getMatrixView(instance2);identity2(transform7),translate(transform7,transform7,[x2,y2]),scale(transform7,transform7,[size3,size3]),rotate(transform7,transform7,angle2),this.vertTypeBuffer.getView(instance2)[0]=EDGE_ARROW;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,opacity,colorView),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(edge,eleIndex){if(edge.visible()){var points=this._getEdgePoints(edge);if(points){var baseOpacity=edge.pstyle("opacity").value,lineOpacity=edge.pstyle("line-opacity").value,width2=edge.pstyle("width").pfValue,color=edge.pstyle("line-color").value,opacity=baseOpacity*lineOpacity;if(points.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),points.length==4){var instance2=this.instanceCount;this.vertTypeBuffer.getView(instance2)[0]=EDGE_STRAIGHT;var indexView=this.indexBuffer.getView(instance2);indexToVec4(eleIndex,indexView);var colorView=this.colorBuffer.getView(instance2);toWebGLColor(color,opacity,colorView);var lineWidthBuffer=this.lineWidthBuffer.getView(instance2);lineWidthBuffer[0]=width2;var sourceTargetView=this.pointAPointBBuffer.getView(instance2);sourceTargetView[0]=points[0],sourceTargetView[1]=points[1],sourceTargetView[2]=points[2],sourceTargetView[3]=points[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var i2=0;i2<points.length-2;i2+=2){var _instance=this.instanceCount;this.vertTypeBuffer.getView(_instance)[0]=EDGE_CURVE_SEGMENT;var _indexView=this.indexBuffer.getView(_instance);indexToVec4(eleIndex,_indexView);var _colorView=this.colorBuffer.getView(_instance);toWebGLColor(color,opacity,_colorView);var _lineWidthBuffer=this.lineWidthBuffer.getView(_instance);_lineWidthBuffer[0]=width2;var pAx=points[i2-2],pAy=points[i2-1],pBx=points[i2],pBy=points[i2+1],pCx=points[i2+2],pCy=points[i2+3],pDx=points[i2+4],pDy=points[i2+5];i2==0&&(pAx=2*pBx-pCx+.001,pAy=2*pBy-pCy+.001),i2==points.length-4&&(pDx=2*pCx-pBx+.001,pDy=2*pCy-pBy+.001);var pointABView=this.pointAPointBBuffer.getView(_instance);pointABView[0]=pAx,pointABView[1]=pAy,pointABView[2]=pBx,pointABView[3]=pBy;var pointCDView=this.pointCPointDBuffer.getView(_instance);pointCDView[0]=pCx,pointCDView[1]=pCy,pointCDView[2]=pDx,pointCDView[3]=pDy,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(edge){var rs=edge._private.rscratch;return!(rs.badLine||rs.allpts==null||isNaN(rs.allpts[0]))}},{key:"_getEdgePoints",value:function(edge){var rs=edge._private.rscratch;if(this._isValidEdge(edge)){var controlPoints3=rs.allpts;if(controlPoints3.length==4)return controlPoints3;var numSegments=this._getNumSegments(edge);return this._getCurveSegmentPoints(controlPoints3,numSegments)}}},{key:"_getNumSegments",value:function(edge){var numSegments=15;return Math.min(Math.max(numSegments,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(controlPoints3,segments){if(controlPoints3.length==4)return controlPoints3;for(var curvePoints=Array((segments+1)*2),i2=0;i2<=segments;i2++)if(i2==0)curvePoints[0]=controlPoints3[0],curvePoints[1]=controlPoints3[1];else if(i2==segments)curvePoints[i2*2]=controlPoints3[controlPoints3.length-2],curvePoints[i2*2+1]=controlPoints3[controlPoints3.length-1];else{var t=i2/segments;this._setCurvePoint(controlPoints3,t,curvePoints,i2*2)}return curvePoints}},{key:"_setCurvePoint",value:function(points,t,curvePoints,cpi){if(points.length<=2)curvePoints[cpi]=points[0],curvePoints[cpi+1]=points[1];else{for(var newpoints=Array(points.length-2),i2=0;i2<newpoints.length;i2+=2){var x2=(1-t)*points[i2]+t*points[i2+2],y2=(1-t)*points[i2+1]+t*points[i2+3];newpoints[i2]=x2,newpoints[i2+1]=y2}return this._setCurvePoint(newpoints,t,curvePoints,cpi)}}},{key:"endBatch",value:function(){var gl=this.gl,vao=this.vao,vertexCount=this.vertexCount,count=this.instanceCount;if(count!==0){var program=this.renderTarget.picking?this.pickingProgram:this.program;gl.useProgram(program),gl.bindVertexArray(vao);var _iterator2=_createForOfIteratorHelper(this.buffers),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var buffer=_step2.value;buffer.bufferSubData(count)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}for(var atlases=this.batchManager.getAtlases(),i2=0;i2<atlases.length;i2++)atlases[i2].bufferIfNeeded(gl);for(var _i2=0;_i2<atlases.length;_i2++)gl.activeTexture(gl.TEXTURE0+_i2),gl.bindTexture(gl.TEXTURE_2D,atlases[_i2].texture),gl.uniform1i(program.uTextures[_i2],_i2);gl.uniform1f(program.uZoom,getEffectiveZoom(this.r)),gl.uniformMatrix3fv(program.uPanZoomMatrix,!1,this.panZoomMatrix),gl.uniform1i(program.uAtlasSize,this.batchManager.getAtlasSize());var webglBgColor=toWebGLColor(this.bgColor,1);gl.uniform4fv(program.uBGColor,webglBgColor),gl.drawArraysInstanced(gl.TRIANGLES,0,vertexCount,count),gl.bindVertexArray(null),gl.bindTexture(gl.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count,atlasCount:atlases.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var atlasInfo=this.atlasManager.getDebugInfo(),totalAtlases=atlasInfo.reduce(function(count,info){return count+info.atlasCount},0),batchInfo=this.batchDebugInfo,totalInstances=batchInfo.reduce(function(count,info){return count+info.count},0);return{atlasInfo,totalAtlases,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:batchInfo.length,batchInfo,totalInstances}}}])})(),CRp$4={};CRp$4.initWebgl=function(opts,fns){var r=this,gl=r.data.contexts[r.WEBGL];opts.bgColor=getBGColor(r),opts.webglTexSize=Math.min(opts.webglTexSize,gl.getParameter(gl.MAX_TEXTURE_SIZE)),opts.webglTexRows=Math.min(opts.webglTexRows,54),opts.webglTexRowsNodes=Math.min(opts.webglTexRowsNodes,54),opts.webglBatchSize=Math.min(opts.webglBatchSize,16384),opts.webglTexPerBatch=Math.min(opts.webglTexPerBatch,gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=opts.webglDebug,r.webglDebugShowAtlases=opts.webglDebugShowAtlases,r.pickingFrameBuffer=createPickingFrameBuffer(gl),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new ElementDrawingWebGL(r,gl,opts);var getLabelRotation3=function(prop){return function(ele){return r.getTextAngle(ele,prop)}},isLabelVisible=function(prop){return function(ele){var label=ele.pstyle(prop);return label&&label.value}},isLayerVisible=function(prefix){return function(node){return node.pstyle("".concat(prefix,"-opacity")).value>0}},getTexPickingMode=function(ele){var enabled=ele.pstyle("text-events").strValue==="yes";return enabled?TEX_PICKING_MODE.USE_BB:TEX_PICKING_MODE.IGNORE},getBBForSimpleShape=function(node){var _node$position=node.position(),x2=_node$position.x,y2=_node$position.y,w=node.outerWidth(),h=node.outerHeight();return{w,h,x1:x2-w/2,y1:y2-h/2}};r.drawing.addAtlasCollection("node",{texRows:opts.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:opts.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:fns.getStyleKey,getBoundingBox:fns.getElementBox,drawElement:fns.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:getBBForSimpleShape,isSimple:isSimpleShape,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:getBBForSimpleShape,isVisible:isLayerVisible("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:getBBForSimpleShape,isVisible:isLayerVisible("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getLabelKey,null),getBoundingBox:getBoundingBoxForLabel(fns.getLabelBox,null),drawClipped:!0,drawElement:fns.drawLabel,getRotation:getLabelRotation3(null),getRotationPoint:fns.getLabelRotationPoint,getRotationOffset:fns.getLabelRotationOffset,isVisible:isLabelVisible("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getSourceLabelKey,"source"),getBoundingBox:getBoundingBoxForLabel(fns.getSourceLabelBox,"source"),drawClipped:!0,drawElement:fns.drawSourceLabel,getRotation:getLabelRotation3("source"),getRotationPoint:fns.getSourceLabelRotationPoint,getRotationOffset:fns.getSourceLabelRotationOffset,isVisible:isLabelVisible("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode,getKey:getStyleKeysForLabel(fns.getTargetLabelKey,"target"),getBoundingBox:getBoundingBoxForLabel(fns.getTargetLabelBox,"target"),drawClipped:!0,drawElement:fns.drawTargetLabel,getRotation:getLabelRotation3("target"),getRotationPoint:fns.getTargetLabelRotationPoint,getRotationOffset:fns.getTargetLabelRotationOffset,isVisible:isLabelVisible("target-label")});var setGCFlag=debounce(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(willDraw,eles){var gcNeeded=!1;eles&&eles.length>0&&(gcNeeded|=r.drawing.invalidate(eles)),gcNeeded&&setGCFlag()}),overrideCanvasRendererFunctions(r)};function getBGColor(r){var container2=r.cy.container(),cssColor=container2&&container2.style&&container2.style.backgroundColor||"white";return color2tuple(cssColor)}function getLabelLines(ele,prefix){var rs=ele._private.rscratch;return getPrefixedProperty(rs,"labelWrapCachedLines",prefix)||[]}var getStyleKeysForLabel=function(getKey3,prefix){return function(ele){var key=getKey3(ele),lines=getLabelLines(ele,prefix);return lines.length>1?lines.map(function(line,index){return"".concat(key,"_").concat(index)}):key}},getBoundingBoxForLabel=function(getBoundingBox,prefix){return function(ele,styleKey){var bb=getBoundingBox(ele);if(typeof styleKey=="string"){var ui=styleKey.indexOf("_");if(ui>0){var lineIndex=Number(styleKey.substring(ui+1)),lines=getLabelLines(ele,prefix),h=bb.h/lines.length,yOffset=h*lineIndex,y1=bb.y1+yOffset;return{x1:bb.x1,w:bb.w,y1,h,yOffset}}}return bb}};function overrideCanvasRendererFunctions(r){{var renderCanvas=r.render;r.render=function(options2){options2=options2||{};var cy=r.cy;r.webgl&&(cy.zoom()>maxZoom$1?(clearWebgl(r),renderCanvas.call(r,options2)):(clearCanvas(r),renderWebgl(r,options2,RENDER_TARGET.SCREEN)))}}{var baseFunc=r.matchCanvasSize;r.matchCanvasSize=function(container2){baseFunc.call(r,container2),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(x2,y2,interactiveElementsOnly,isTouch){return findNearestElementsWebgl(r,x2,y2)};{var _baseFunc=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){_baseFunc.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var _baseFunc2=r.notify;r.notify=function(eventName,eles){_baseFunc2.call(r,eventName,eles),eventName==="viewport"||eventName==="bounds"?r.pickingFrameBuffer.needsDraw=!0:eventName==="background"&&r.drawing.invalidate(eles,{type:"node-body"})}}}function clearWebgl(r){var gl=r.data.contexts[r.WEBGL];gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT)}function clearCanvas(r){var clear=function(context){context.save(),context.setTransform(1,0,0,1,0,0),context.clearRect(0,0,r.canvasWidth,r.canvasHeight),context.restore()};clear(r.data.contexts[r.NODE]),clear(r.data.contexts[r.DRAG])}function createPanZoomMatrix(r){var width2=r.canvasWidth,height2=r.canvasHeight,_util$getEffectivePan=getEffectivePanZoom(r),pan2=_util$getEffectivePan.pan,zoom2=_util$getEffectivePan.zoom,transform7=create();translate(transform7,transform7,[pan2.x,pan2.y]),scale(transform7,transform7,[zoom2,zoom2]);var projection$1=create();projection(projection$1,width2,height2);var product=create();return multiply(product,projection$1,transform7),product}function setContextTransform(r,context){var width2=r.canvasWidth,height2=r.canvasHeight,_util$getEffectivePan2=getEffectivePanZoom(r),pan2=_util$getEffectivePan2.pan,zoom2=_util$getEffectivePan2.zoom;context.setTransform(1,0,0,1,0,0),context.clearRect(0,0,width2,height2),context.translate(pan2.x,pan2.y),context.scale(zoom2,zoom2)}function drawSelectionRectangle(r,options2){r.drawSelectionRectangle(options2,function(context){return setContextTransform(r,context)})}function drawAxes(r){var context=r.data.contexts[r.NODE];context.save(),setContextTransform(r,context),context.strokeStyle="rgba(0, 0, 0, 0.3)",context.beginPath(),context.moveTo(-1e3,0),context.lineTo(1e3,0),context.stroke(),context.beginPath(),context.moveTo(0,-1e3),context.lineTo(0,1e3),context.stroke(),context.restore()}function drawAtlases(r){var draw=function(drawing,name,row){for(var collection4=drawing.atlasManager.getAtlasCollection(name),context=r.data.contexts[r.NODE],atlases=collection4.atlases,_i=0;_i<atlases.length;_i++){var atlas=atlases[_i],canvas=atlas.canvas;if(canvas){var w=canvas.width,h=canvas.height,x2=w*_i,y2=canvas.height*row,scale2=.4;context.save(),context.scale(scale2,scale2),context.drawImage(canvas,x2,y2),context.strokeStyle="black",context.rect(x2,y2,w,h),context.stroke(),context.restore()}}},i2=0;draw(r.drawing,"node",i2++),draw(r.drawing,"label",i2++)}function getPickingIndexes(r,mX1,mY1,mX2,mY2){var x2,y2,w,h,_util$getEffectivePan3=getEffectivePanZoom(r),pan2=_util$getEffectivePan3.pan,zoom2=_util$getEffectivePan3.zoom;{var _util$modelToRendered=modelToRenderedPosition2(r,pan2,zoom2,mX1,mY1),_util$modelToRendered2=_slicedToArray(_util$modelToRendered,2),cX1=_util$modelToRendered2[0],cY1=_util$modelToRendered2[1],t=6;x2=cX1-t/2,y2=cY1-t/2,w=t,h=t}if(w===0||h===0)return[];var gl=r.data.contexts[r.WEBGL];gl.bindFramebuffer(gl.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(gl.viewport(0,0,gl.canvas.width,gl.canvas.height),renderWebgl(r,null,RENDER_TARGET.PICKING),r.pickingFrameBuffer.needsDraw=!1);var n=w*h,data4=new Uint8Array(n*4);gl.readPixels(x2,y2,w,h,gl.RGBA,gl.UNSIGNED_BYTE,data4),gl.bindFramebuffer(gl.FRAMEBUFFER,null);for(var indexes=new Set,i2=0;i2<n;i2++){var pixel=data4.slice(i2*4,i2*4+4),index=vec4ToIndex(pixel)-1;index>=0&&indexes.add(index)}return indexes}function findNearestElementsWebgl(r,x2,y2){var indexes=getPickingIndexes(r,x2,y2),eles=r.getCachedZSortedEles(),node,edge,_iterator=_createForOfIteratorHelper(indexes),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var index=_step.value,ele=eles[index];if(!node&&ele.isNode()&&(node=ele),!edge&&ele.isEdge()&&(edge=ele),node&&edge)break}}catch(err){_iterator.e(err)}finally{_iterator.f()}return[node,edge].filter(Boolean)}function drawEle(r,index,ele){var drawing=r.drawing;index+=1,ele.isNode()?(drawing.drawNode(ele,index,"node-underlay"),drawing.drawNode(ele,index,"node-body"),drawing.drawTexture(ele,index,"label"),drawing.drawNode(ele,index,"node-overlay")):(drawing.drawEdgeLine(ele,index),drawing.drawEdgeArrow(ele,index,"source"),drawing.drawEdgeArrow(ele,index,"target"),drawing.drawTexture(ele,index,"label"),drawing.drawTexture(ele,index,"edge-source-label"),drawing.drawTexture(ele,index,"edge-target-label"))}function renderWebgl(r,options2,renderTarget){var start;r.webglDebug&&(start=performance.now());var drawing=r.drawing,eleCount=0;if(renderTarget.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&drawSelectionRectangle(r,options2),r.data.canvasNeedsRedraw[r.NODE]||renderTarget.picking){var gl=r.data.contexts[r.WEBGL];renderTarget.screen?(gl.clearColor(0,0,0,0),gl.enable(gl.BLEND),gl.blendFunc(gl.ONE,gl.ONE_MINUS_SRC_ALPHA)):gl.disable(gl.BLEND),gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT),gl.viewport(0,0,gl.canvas.width,gl.canvas.height);var panZoomMatrix=createPanZoomMatrix(r),eles=r.getCachedZSortedEles();if(eleCount=eles.length,drawing.startFrame(panZoomMatrix,renderTarget),renderTarget.screen){for(var i2=0;i2<eles.nondrag.length;i2++)drawEle(r,i2,eles.nondrag[i2]);for(var _i2=0;_i2<eles.drag.length;_i2++)drawEle(r,_i2,eles.drag[_i2])}else if(renderTarget.picking)for(var _i3=0;_i3<eles.length;_i3++)drawEle(r,_i3,eles[_i3]);drawing.endFrame(),renderTarget.screen&&r.webglDebugShowAtlases&&(drawAxes(r),drawAtlases(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var end=performance.now(),compact=!1,time2=Math.ceil(end-start),debugInfo=drawing.getDebugInfo(),report=["".concat(eleCount," elements"),"".concat(debugInfo.totalInstances," instances"),"".concat(debugInfo.batchCount," batches"),"".concat(debugInfo.totalAtlases," atlases"),"".concat(debugInfo.wrappedCount," wrapped textures"),"".concat(debugInfo.simpleCount," simple shapes")].join(", ");if(compact)console.log("WebGL (".concat(renderTarget.name,") - time ").concat(time2,"ms, ").concat(report));else{console.log("WebGL (".concat(renderTarget.name,") - frame time ").concat(time2,"ms")),console.log("Totals:"),console.log(" ".concat(report)),console.log("Texture Atlases Used:");var atlasInfo=debugInfo.atlasInfo,_iterator2=_createForOfIteratorHelper(atlasInfo),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var info=_step2.value;console.log(" ".concat(info.type,": ").concat(info.keyCount," keys, ").concat(info.atlasCount," atlases"))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,drawing.gc())}var CRp$3={};CRp$3.drawPolygonPath=function(context,x2,y2,width2,height2,points){var halfW=width2/2,halfH=height2/2;context.beginPath&&context.beginPath(),context.moveTo(x2+halfW*points[0],y2+halfH*points[1]);for(var i2=1;i2<points.length/2;i2++)context.lineTo(x2+halfW*points[i2*2],y2+halfH*points[i2*2+1]);context.closePath()};CRp$3.drawRoundPolygonPath=function(context,x2,y2,width2,height2,points,corners){corners.forEach(function(corner){return drawPreparedRoundCorner(context,corner)}),context.closePath()};CRp$3.drawRoundRectanglePath=function(context,x2,y2,width2,height2,radius2){var halfWidth=width2/2,halfHeight=height2/2,cornerRadius=radius2==="auto"?getRoundRectangleRadius(width2,height2):Math.min(radius2,halfHeight,halfWidth);context.beginPath&&context.beginPath(),context.moveTo(x2,y2-halfHeight),context.arcTo(x2+halfWidth,y2-halfHeight,x2+halfWidth,y2,cornerRadius),context.arcTo(x2+halfWidth,y2+halfHeight,x2,y2+halfHeight,cornerRadius),context.arcTo(x2-halfWidth,y2+halfHeight,x2-halfWidth,y2,cornerRadius),context.arcTo(x2-halfWidth,y2-halfHeight,x2,y2-halfHeight,cornerRadius),context.lineTo(x2,y2-halfHeight),context.closePath()};CRp$3.drawBottomRoundRectanglePath=function(context,x2,y2,width2,height2,radius2){var halfWidth=width2/2,halfHeight=height2/2,cornerRadius=radius2==="auto"?getRoundRectangleRadius(width2,height2):radius2;context.beginPath&&context.beginPath(),context.moveTo(x2,y2-halfHeight),context.lineTo(x2+halfWidth,y2-halfHeight),context.lineTo(x2+halfWidth,y2),context.arcTo(x2+halfWidth,y2+halfHeight,x2,y2+halfHeight,cornerRadius),context.arcTo(x2-halfWidth,y2+halfHeight,x2-halfWidth,y2,cornerRadius),context.lineTo(x2-halfWidth,y2-halfHeight),context.lineTo(x2,y2-halfHeight),context.closePath()};CRp$3.drawCutRectanglePath=function(context,x2,y2,width2,height2,points,corners){var halfWidth=width2/2,halfHeight=height2/2,cornerLength=corners==="auto"?getCutRectangleCornerLength():corners;context.beginPath&&context.beginPath(),context.moveTo(x2-halfWidth+cornerLength,y2-halfHeight),context.lineTo(x2+halfWidth-cornerLength,y2-halfHeight),context.lineTo(x2+halfWidth,y2-halfHeight+cornerLength),context.lineTo(x2+halfWidth,y2+halfHeight-cornerLength),context.lineTo(x2+halfWidth-cornerLength,y2+halfHeight),context.lineTo(x2-halfWidth+cornerLength,y2+halfHeight),context.lineTo(x2-halfWidth,y2+halfHeight-cornerLength),context.lineTo(x2-halfWidth,y2-halfHeight+cornerLength),context.closePath()};CRp$3.drawBarrelPath=function(context,x2,y2,width2,height2){var halfWidth=width2/2,halfHeight=height2/2,xBegin=x2-halfWidth,xEnd=x2+halfWidth,yBegin=y2-halfHeight,yEnd=y2+halfHeight,barrelCurveConstants=getBarrelCurveConstants(width2,height2),wOffset=barrelCurveConstants.widthOffset,hOffset=barrelCurveConstants.heightOffset,ctrlPtXOffset=barrelCurveConstants.ctrlPtOffsetPct*wOffset;context.beginPath&&context.beginPath(),context.moveTo(xBegin,yBegin+hOffset),context.lineTo(xBegin,yEnd-hOffset),context.quadraticCurveTo(xBegin+ctrlPtXOffset,yEnd,xBegin+wOffset,yEnd),context.lineTo(xEnd-wOffset,yEnd),context.quadraticCurveTo(xEnd-ctrlPtXOffset,yEnd,xEnd,yEnd-hOffset),context.lineTo(xEnd,yBegin+hOffset),context.quadraticCurveTo(xEnd-ctrlPtXOffset,yBegin,xEnd-wOffset,yBegin),context.lineTo(xBegin+wOffset,yBegin),context.quadraticCurveTo(xBegin+ctrlPtXOffset,yBegin,xBegin,yBegin+hOffset),context.closePath()};var sin0=Math.sin(0),cos0=Math.cos(0),sin={},cos={},ellipseStepSize=Math.PI/40;for(i=0*Math.PI;i<2*Math.PI;i+=ellipseStepSize)sin[i]=Math.sin(i),cos[i]=Math.cos(i);var i;CRp$3.drawEllipsePath=function(context,centerX,centerY,width2,height2){if(context.beginPath&&context.beginPath(),context.ellipse)context.ellipse(centerX,centerY,width2/2,height2/2,0,0,2*Math.PI);else for(var xPos,yPos,rw=width2/2,rh=height2/2,i2=0*Math.PI;i2<2*Math.PI;i2+=ellipseStepSize)xPos=centerX-rw*sin[i2]*sin0+rw*cos[i2]*cos0,yPos=centerY+rh*cos[i2]*sin0+rh*sin[i2]*cos0,i2===0?context.moveTo(xPos,yPos):context.lineTo(xPos,yPos);context.closePath()};var CRp$2={};CRp$2.createBuffer=function(w,h){var buffer=document.createElement("canvas");return buffer.width=w,buffer.height=h,[buffer,buffer.getContext("2d")]};CRp$2.bufferCanvasImage=function(options2){var cy=this.cy,eles=cy.mutableElements(),bb=eles.boundingBox(),ctrRect=this.findContainerClientCoords(),width2=options2.full?Math.ceil(bb.w):ctrRect[2],height2=options2.full?Math.ceil(bb.h):ctrRect[3],specdMaxDims=number$1(options2.maxWidth)||number$1(options2.maxHeight),pxRatio=this.getPixelRatio(),scale2=1;if(options2.scale!==void 0)width2*=options2.scale,height2*=options2.scale,scale2=options2.scale;else if(specdMaxDims){var maxScaleW=1/0,maxScaleH=1/0;number$1(options2.maxWidth)&&(maxScaleW=scale2*options2.maxWidth/width2),number$1(options2.maxHeight)&&(maxScaleH=scale2*options2.maxHeight/height2),scale2=Math.min(maxScaleW,maxScaleH),width2*=scale2,height2*=scale2}specdMaxDims||(width2*=pxRatio,height2*=pxRatio,scale2*=pxRatio);var buffCanvas=document.createElement("canvas");buffCanvas.width=width2,buffCanvas.height=height2,buffCanvas.style.width=width2+"px",buffCanvas.style.height=height2+"px";var buffCxt=buffCanvas.getContext("2d");if(width2>0&&height2>0){buffCxt.clearRect(0,0,width2,height2),buffCxt.globalCompositeOperation="source-over";var zsortedEles=this.getCachedZSortedEles();if(options2.full)buffCxt.translate(-bb.x1*scale2,-bb.y1*scale2),buffCxt.scale(scale2,scale2),this.drawElements(buffCxt,zsortedEles),buffCxt.scale(1/scale2,1/scale2),buffCxt.translate(bb.x1*scale2,bb.y1*scale2);else{var pan2=cy.pan(),translation={x:pan2.x*scale2,y:pan2.y*scale2};scale2*=cy.zoom(),buffCxt.translate(translation.x,translation.y),buffCxt.scale(scale2,scale2),this.drawElements(buffCxt,zsortedEles),buffCxt.scale(1/scale2,1/scale2),buffCxt.translate(-translation.x,-translation.y)}options2.bg&&(buffCxt.globalCompositeOperation="destination-over",buffCxt.fillStyle=options2.bg,buffCxt.rect(0,0,width2,height2),buffCxt.fill())}return buffCanvas};function b64ToBlob(b64,mimeType){for(var bytes=atob(b64),buff=new ArrayBuffer(bytes.length),buffUint8=new Uint8Array(buff),i2=0;i2<bytes.length;i2++)buffUint8[i2]=bytes.charCodeAt(i2);return new Blob([buff],{type:mimeType})}function b64UriToB64(b64uri){var i2=b64uri.indexOf(",");return b64uri.substr(i2+1)}function output(options2,canvas,mimeType){var getB64Uri=function(){return canvas.toDataURL(mimeType,options2.quality)};switch(options2.output){case"blob-promise":return new Promise$1(function(resolve2,reject2){try{canvas.toBlob(function(blob){blob!=null?resolve2(blob):reject2(new Error("`canvas.toBlob()` sent a null value in its callback"))},mimeType,options2.quality)}catch(err){reject2(err)}});case"blob":return b64ToBlob(b64UriToB64(getB64Uri()),mimeType);case"base64":return b64UriToB64(getB64Uri());default:return getB64Uri()}}CRp$2.png=function(options2){return output(options2,this.bufferCanvasImage(options2),"image/png")};CRp$2.jpg=function(options2){return output(options2,this.bufferCanvasImage(options2),"image/jpeg")};var CRp$1={};CRp$1.nodeShapeImpl=function(name,context,centerX,centerY,width2,height2,points,corners){switch(name){case"ellipse":return this.drawEllipsePath(context,centerX,centerY,width2,height2);case"polygon":return this.drawPolygonPath(context,centerX,centerY,width2,height2,points);case"round-polygon":return this.drawRoundPolygonPath(context,centerX,centerY,width2,height2,points,corners);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(context,centerX,centerY,width2,height2,corners);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(context,centerX,centerY,width2,height2,points,corners);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(context,centerX,centerY,width2,height2,corners);case"barrel":return this.drawBarrelPath(context,centerX,centerY,width2,height2)}};var CR=CanvasRenderer,CRp=CanvasRenderer.prototype;CRp.CANVAS_LAYERS=3;CRp.SELECT_BOX=0;CRp.DRAG=1;CRp.NODE=2;CRp.WEBGL=3;CRp.CANVAS_TYPES=["2d","2d","2d","webgl2"];CRp.BUFFER_COUNT=3;CRp.TEXTURE_BUFFER=0;CRp.MOTIONBLUR_BUFFER_NODE=1;CRp.MOTIONBLUR_BUFFER_DRAG=2;function CanvasRenderer(options2){var r=this,containerWindow=r.cy.window(),document2=containerWindow.document;options2.webgl&&(CRp.CANVAS_LAYERS=r.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),r.data={canvases:new Array(CRp.CANVAS_LAYERS),contexts:new Array(CRp.CANVAS_LAYERS),canvasNeedsRedraw:new Array(CRp.CANVAS_LAYERS),bufferCanvases:new Array(CRp.BUFFER_COUNT),bufferContexts:new Array(CRp.CANVAS_LAYERS)};var tapHlOffAttr="-webkit-tap-highlight-color",tapHlOffStyle="rgba(0,0,0,0)";r.data.canvasContainer=document2.createElement("div");var containerStyle=r.data.canvasContainer.style;r.data.canvasContainer.style[tapHlOffAttr]=tapHlOffStyle,containerStyle.position="relative",containerStyle.zIndex="0",containerStyle.overflow="hidden";var container2=options2.cy.container();container2.appendChild(r.data.canvasContainer),container2.style[tapHlOffAttr]=tapHlOffStyle;var styleMap={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};ms()&&(styleMap["-ms-touch-action"]="none",styleMap["touch-action"]="none");for(var i2=0;i2<CRp.CANVAS_LAYERS;i2++){var canvas=r.data.canvases[i2]=document2.createElement("canvas"),type=CRp.CANVAS_TYPES[i2];r.data.contexts[i2]=canvas.getContext(type),r.data.contexts[i2]||error("Could not create canvas of type "+type),Object.keys(styleMap).forEach(function(k){canvas.style[k]=styleMap[k]}),canvas.style.position="absolute",canvas.setAttribute("data-id","layer"+i2),canvas.style.zIndex=String(CRp.CANVAS_LAYERS-i2),r.data.canvasContainer.appendChild(canvas),r.data.canvasNeedsRedraw[i2]=!1}r.data.topCanvas=r.data.canvases[0],r.data.canvases[CRp.NODE].setAttribute("data-id","layer"+CRp.NODE+"-node"),r.data.canvases[CRp.SELECT_BOX].setAttribute("data-id","layer"+CRp.SELECT_BOX+"-selectbox"),r.data.canvases[CRp.DRAG].setAttribute("data-id","layer"+CRp.DRAG+"-drag"),r.data.canvases[CRp.WEBGL]&&r.data.canvases[CRp.WEBGL].setAttribute("data-id","layer"+CRp.WEBGL+"-webgl");for(var i2=0;i2<CRp.BUFFER_COUNT;i2++)r.data.bufferCanvases[i2]=document2.createElement("canvas"),r.data.bufferContexts[i2]=r.data.bufferCanvases[i2].getContext("2d"),r.data.bufferCanvases[i2].style.position="absolute",r.data.bufferCanvases[i2].setAttribute("data-id","buffer"+i2),r.data.bufferCanvases[i2].style.zIndex=String(-i2-1),r.data.bufferCanvases[i2].style.visibility="hidden";r.pathsEnabled=!0;var emptyBb=makeBoundingBox(),getBoxCenter=function(bb){return{x:(bb.x1+bb.x2)/2,y:(bb.y1+bb.y2)/2}},getCenterOffset=function(bb){return{x:-bb.w/2,y:-bb.h/2}},backgroundTimestampHasChanged=function(ele){var _p=ele[0]._private,same2=_p.oldBackgroundTimestamp===_p.backgroundTimestamp;return!same2},getStyleKey=function(ele){return ele[0]._private.nodeKey},getLabelKey=function(ele){return ele[0]._private.labelStyleKey},getSourceLabelKey=function(ele){return ele[0]._private.sourceLabelStyleKey},getTargetLabelKey=function(ele){return ele[0]._private.targetLabelStyleKey},drawElement=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElement(context,ele,bb,!1,!1,useEleOpacity)},drawLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"main",useEleOpacity)},drawSourceLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"source",useEleOpacity)},drawTargetLabel=function(context,ele,bb,scaledLabelShown,useEleOpacity){return r.drawElementText(context,ele,bb,scaledLabelShown,"target",useEleOpacity)},getElementBox=function(ele){return ele.boundingBox(),ele[0]._private.bodyBounds},getLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.main||emptyBb},getSourceLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.source||emptyBb},getTargetLabelBox=function(ele){return ele.boundingBox(),ele[0]._private.labelBounds.target||emptyBb},isLabelVisibleAtScale=function(ele,scaledLabelShown){return scaledLabelShown},getElementRotationPoint=function(ele){return getBoxCenter(getElementBox(ele))},addTextMargin=function(prefix,pt,ele){var pre=prefix?prefix+"-":"";return{x:pt.x+ele.pstyle(pre+"text-margin-x").pfValue,y:pt.y+ele.pstyle(pre+"text-margin-y").pfValue}},getRsPt=function(ele,x2,y2){var rs=ele[0]._private.rscratch;return{x:rs[x2],y:rs[y2]}},getLabelRotationPoint=function(ele){return addTextMargin("",getRsPt(ele,"labelX","labelY"),ele)},getSourceLabelRotationPoint=function(ele){return addTextMargin("source",getRsPt(ele,"sourceLabelX","sourceLabelY"),ele)},getTargetLabelRotationPoint=function(ele){return addTextMargin("target",getRsPt(ele,"targetLabelX","targetLabelY"),ele)},getElementRotationOffset=function(ele){return getCenterOffset(getElementBox(ele))},getSourceLabelRotationOffset=function(ele){return getCenterOffset(getSourceLabelBox(ele))},getTargetLabelRotationOffset=function(ele){return getCenterOffset(getTargetLabelBox(ele))},getLabelRotationOffset=function(ele){var bb=getLabelBox(ele),p2=getCenterOffset(getLabelBox(ele));if(ele.isNode()){switch(labelHalign(ele.pstyle("text-halign").value)){case"left":p2.x=-bb.w-(bb.leftPad||0);break;case"right":p2.x=-(bb.rightPad||0);break}switch(labelValign(ele.pstyle("text-valign").value)){case"top":p2.y=-bb.h-(bb.topPad||0);break;case"bottom":p2.y=-(bb.botPad||0);break}}return p2},eleTxrCache=r.data.eleTxrCache=new ElementTextureCache(r,{getKey:getStyleKey,doesEleInvalidateKey:backgroundTimestampHasChanged,drawElement,getBoundingBox:getElementBox,getRotationPoint:getElementRotationPoint,getRotationOffset:getElementRotationOffset,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),lblTxrCache=r.data.lblTxrCache=new ElementTextureCache(r,{getKey:getLabelKey,drawElement:drawLabel,getBoundingBox:getLabelBox,getRotationPoint:getLabelRotationPoint,getRotationOffset:getLabelRotationOffset,isVisible:isLabelVisibleAtScale}),slbTxrCache=r.data.slbTxrCache=new ElementTextureCache(r,{getKey:getSourceLabelKey,drawElement:drawSourceLabel,getBoundingBox:getSourceLabelBox,getRotationPoint:getSourceLabelRotationPoint,getRotationOffset:getSourceLabelRotationOffset,isVisible:isLabelVisibleAtScale}),tlbTxrCache=r.data.tlbTxrCache=new ElementTextureCache(r,{getKey:getTargetLabelKey,drawElement:drawTargetLabel,getBoundingBox:getTargetLabelBox,getRotationPoint:getTargetLabelRotationPoint,getRotationOffset:getTargetLabelRotationOffset,isVisible:isLabelVisibleAtScale}),lyrTxrCache=r.data.lyrTxrCache=new LayeredTextureCache(r);r.onUpdateEleCalcs(function(willDraw,eles){eleTxrCache.invalidateElements(eles),lblTxrCache.invalidateElements(eles),slbTxrCache.invalidateElements(eles),tlbTxrCache.invalidateElements(eles),lyrTxrCache.invalidateElements(eles);for(var _i=0;_i<eles.length;_i++){var _p=eles[_i]._private;_p.oldBackgroundTimestamp=_p.backgroundTimestamp}});var refineInLayers=function(reqs){for(var i3=0;i3<reqs.length;i3++)lyrTxrCache.enqueueElementRefinement(reqs[i3].ele)};eleTxrCache.onDequeue(refineInLayers),lblTxrCache.onDequeue(refineInLayers),slbTxrCache.onDequeue(refineInLayers),tlbTxrCache.onDequeue(refineInLayers),options2.webgl&&r.initWebgl(options2,{getStyleKey,getLabelKey,getSourceLabelKey,getTargetLabelKey,drawElement,drawLabel,drawSourceLabel,drawTargetLabel,getElementBox,getLabelBox,getSourceLabelBox,getTargetLabelBox,getElementRotationPoint,getElementRotationOffset,getLabelRotationPoint,getSourceLabelRotationPoint,getTargetLabelRotationPoint,getLabelRotationOffset,getSourceLabelRotationOffset,getTargetLabelRotationOffset})}CRp.redrawHint=function(group2,bool){var r=this;switch(group2){case"eles":r.data.canvasNeedsRedraw[CRp.NODE]=bool;break;case"drag":r.data.canvasNeedsRedraw[CRp.DRAG]=bool;break;case"select":r.data.canvasNeedsRedraw[CRp.SELECT_BOX]=bool;break;case"gc":r.data.gc=!0;break}};var pathsImpld=typeof Path2D<"u";CRp.path2dEnabled=function(on3){if(on3===void 0)return this.pathsEnabled;this.pathsEnabled=!!on3};CRp.usePaths=function(){return pathsImpld&&this.pathsEnabled};CRp.setImgSmoothing=function(context,bool){context.imageSmoothingEnabled!=null?context.imageSmoothingEnabled=bool:(context.webkitImageSmoothingEnabled=bool,context.mozImageSmoothingEnabled=bool,context.msImageSmoothingEnabled=bool)};CRp.getImgSmoothing=function(context){return context.imageSmoothingEnabled!=null?context.imageSmoothingEnabled:context.webkitImageSmoothingEnabled||context.mozImageSmoothingEnabled||context.msImageSmoothingEnabled};CRp.makeOffscreenCanvas=function(width2,height2){var canvas;if((typeof OffscreenCanvas>"u"?"undefined":_typeof(OffscreenCanvas))!=="undefined")canvas=new OffscreenCanvas(width2,height2);else{var containerWindow=this.cy.window(),document2=containerWindow.document;canvas=document2.createElement("canvas"),canvas.width=width2,canvas.height=height2}return canvas};[CRp$b,CRp$a,CRp$9,CRp$8,CRp$7,CRp$6,CRp$5,CRp$4,CRp$3,CRp$2,CRp$1].forEach(function(props){extend(CRp,props)});var renderer2=[{name:"null",impl:NullRenderer},{name:"base",impl:BR},{name:"canvas",impl:CR}],incExts=[{type:"layout",extensions:layout3},{type:"renderer",extensions:renderer2}],extensions={},modules={};function setExtension(type,name,registrant){var ext=registrant,overrideErr=function(field){warn("Can not register `"+name+"` for `"+type+"` since `"+field+"` already exists in the prototype and can not be overridden")};if(type==="core"){if(Core.prototype[name])return overrideErr(name);Core.prototype[name]=registrant}else if(type==="collection"){if(Collection.prototype[name])return overrideErr(name);Collection.prototype[name]=registrant}else if(type==="layout"){for(var Layout2=function(options2){this.options=options2,registrant.call(this,options2),plainObject(this._private)||(this._private={}),this._private.cy=options2.cy,this._private.listeners=[],this.createEmitter()},layoutProto=Layout2.prototype=Object.create(registrant.prototype),optLayoutFns=[],i2=0;i2<optLayoutFns.length;i2++){var fnName=optLayoutFns[i2];layoutProto[fnName]=layoutProto[fnName]||function(){return this}}layoutProto.start&&!layoutProto.run?layoutProto.run=function(){return this.start(),this}:!layoutProto.start&&layoutProto.run&&(layoutProto.start=function(){return this.run(),this});var regStop=registrant.prototype.stop;layoutProto.stop=function(){var opts=this.options;if(opts&&opts.animate){var anis=this.animations;if(anis)for(var _i=0;_i<anis.length;_i++)anis[_i].stop()}return regStop?regStop.call(this):this.emit("layoutstop"),this},layoutProto.destroy||(layoutProto.destroy=function(){return this}),layoutProto.cy=function(){return this._private.cy};var getCy=function(layout4){return layout4._private.cy},emitterOpts={addEventFields:function(layout4,evt){evt.layout=layout4,evt.cy=getCy(layout4),evt.target=layout4},bubble:function(){return!0},parent:function(layout4){return getCy(layout4)}};extend(layoutProto,{createEmitter:function(){return this._private.emitter=new Emitter(emitterOpts,this),this},emitter:function(){return this._private.emitter},on:function(evt,cb){return this.emitter().on(evt,cb),this},one:function(evt,cb){return this.emitter().one(evt,cb),this},once:function(evt,cb){return this.emitter().one(evt,cb),this},removeListener:function(evt,cb){return this.emitter().removeListener(evt,cb),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(evt,params){return this.emitter().emit(evt,params),this}}),define2.eventAliasesOn(layoutProto),ext=Layout2}else if(type==="renderer"&&name!=="null"&&name!=="base"){var BaseRenderer3=getExtension("renderer","base"),bProto=BaseRenderer3.prototype,RegistrantRenderer=registrant,rProto=registrant.prototype,Renderer=function(){BaseRenderer3.apply(this,arguments),RegistrantRenderer.apply(this,arguments)},proto=Renderer.prototype;for(var pName in bProto){var pVal=bProto[pName],existsInR=rProto[pName]!=null;if(existsInR)return overrideErr(pName);proto[pName]=pVal}for(var _pName in rProto)proto[_pName]=rProto[_pName];bProto.clientFunctions.forEach(function(name2){proto[name2]=proto[name2]||function(){error("Renderer does not implement `renderer."+name2+"()` on its prototype")}}),ext=Renderer}else if(type==="__proto__"||type==="constructor"||type==="prototype")return error(type+" is an illegal type to be registered, possibly lead to prototype pollutions");return setMap({map:extensions,keys:[type,name],value:ext})}function getExtension(type,name){return getMap({map:extensions,keys:[type,name]})}function setModule(type,name,moduleType,moduleName,registrant){return setMap({map:modules,keys:[type,name,moduleType,moduleName],value:registrant})}function getModule(type,name,moduleType,moduleName){return getMap({map:modules,keys:[type,name,moduleType,moduleName]})}var extension=function(){if(arguments.length===2)return getExtension.apply(null,arguments);if(arguments.length===3)return setExtension.apply(null,arguments);if(arguments.length===4)return getModule.apply(null,arguments);if(arguments.length===5)return setModule.apply(null,arguments);error("Invalid extension access syntax")};Core.prototype.extension=extension;incExts.forEach(function(group2){group2.extensions.forEach(function(ext){setExtension(group2.type,ext.name,ext.impl)})});var _Stylesheet=function(){if(!(this instanceof _Stylesheet))return new _Stylesheet;this.length=0},sheetfn=_Stylesheet.prototype;sheetfn.instanceString=function(){return"stylesheet"};sheetfn.selector=function(selector){var i2=this.length++;return this[i2]={selector,properties:[]},this};sheetfn.css=function(name,value){var i2=this.length-1;if(string(name))this[i2].properties.push({name,value});else if(plainObject(name))for(var map2=name,propNames=Object.keys(map2),j=0;j<propNames.length;j++){var key=propNames[j],mapVal=map2[key];if(mapVal!=null){var prop=_Style.properties[key]||_Style.properties[dash2camel(key)];if(prop!=null){var _name=prop.name,_value=mapVal;this[i2].properties.push({name:_name,value:_value})}}}return this};sheetfn.style=sheetfn.css;sheetfn.generateStyle=function(cy){var style3=new _Style(cy);return this.appendToStyle(style3)};sheetfn.appendToStyle=function(style3){for(var i2=0;i2<this.length;i2++){var context=this[i2],selector=context.selector,props=context.properties;style3.selector(selector);for(var j=0;j<props.length;j++){var prop=props[j];style3.css(prop.name,prop.value)}}return style3};var version="3.34.1",cytoscape2=function(options2){if(options2===void 0&&(options2={}),plainObject(options2))return new Core(options2);if(string(options2))return extension.apply(extension,arguments)};cytoscape2.use=function(ext){var args=Array.prototype.slice.call(arguments,1);return args.unshift(cytoscape2),ext.apply(null,args),this};cytoscape2.warnings=function(bool){return warnings(bool)};cytoscape2.version=version;cytoscape2.stylesheet=cytoscape2.Stylesheet=_Stylesheet;var import_cytoscape_fcose=__toESM(require_cytoscape_fcose());cytoscape2.use(import_cytoscape_fcose.default);globalThis.__StrataGateGraphLibraries={cytoscape:cytoscape2};globalThis.__STRATAGATE_GITHUB_STARS__=119;window.__ModuleLoader__.load({id:"stratagate-dsh",factory:require2=>{let module={exports:{}},exports=module.exports;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let React=require2("react"),h=React.createElement,cytoscape4=globalThis.__StrataGateGraphLibraries?.cytoscape,AGENT_FEEDBACK_ENABLED=!0,GITHUB_FEEDBACK_ENABLED=!0,FEEDBACK_EMAIL="jiahongcheng61@gmail.com",EMAIL_BODY_HINT=`\u8BF7\u5728\u4E0B\u65B9\u7C98\u8D34 StrataGate \u53CD\u9988\u62A5\u544A\uFF0C\u68C0\u67E5\u540E\u53D1\u9001\u3002\u4E5F\u53EF\u4EE5\u624B\u52A8\u9644\u52A0\u5DF2\u4E0B\u8F7D\u7684\u8BCA\u65AD\u6587\u4EF6\u3002\r
322
322
  \r
323
323
  `,STAR_REPOSITORY_URL="https://github.com/diqierjia/StrataGate-AgentMemory",ISSUE_URL=STAR_REPOSITORY_URL+"/issues/new",DISCUSSION_URL=STAR_REPOSITORY_URL+"/discussions/categories/q-a",FEEDBACK_AI_PROMPT="\u8BF7\u6839\u636E\u5F53\u524D\u4F1A\u8BDD\u4E2D StrataGate \u63D2\u4EF6\u7684\u6545\u969C\u3001\u4F7F\u7528\u7591\u95EE\u6216\u6539\u8FDB\u5EFA\u8BAE\u6574\u7406\u53CD\u9988\u3002\u53EA\u7528\u5DF2\u77E5\u4E8B\u5B9E\uFF0C\u4E0D\u8981\u731C\u6D4B\uFF0C\u672A\u77E5\u7559\u7A7A\uFF0C\u53BB\u9664\u51ED\u636E\u3002\u8C03\u7528 feedback_prepare \u4FDD\u5B58\u672C\u5730\u8349\u7A3F\uFF1B\u65B0\u95EE\u9898\u4F20 new_draft=true\u3002\u8BCA\u65AD\u7531\u7A0B\u5E8F\u81EA\u52A8\u8865\u5145\u3002\u7ED9\u6211\u201C\u6253\u5F00\u53CD\u9988\u8349\u7A3F\u201D\u7684\u94FE\u63A5\uFF0C\u6211\u4F1A\u68C0\u67E5\u540E\u624B\u52A8\u53D1\u90AE\u4EF6\u3002",FEEDBACK_SETTINGS_ID="stratagate-memory",FEEDBACK_VIEW_ID="feedback",MEMORY_PANEL_ID="stratagate-memory",SIDEBAR_PROMPT_STORAGE_KEY="stratagate-dsh.sidebar-prompt.v1",SIDEBAR_PROMPT_STYLES=".sg-sidebar-panel-icon{display:block;flex-shrink:0}.sg-sidebar-placement-prompt{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:100%;font-size:11px;line-height:1.5;color:var(--sg-muted)}.sg-sidebar-placement-text{min-width:0}.sg-memory .sg-sidebar-placement-action{padding:0;border:0;background:transparent;color:var(--sg-accent);font-size:11px;line-height:1.5;cursor:pointer;white-space:nowrap}.sg-sidebar-placement-action:hover{text-decoration:underline}.sg-memory .sg-sidebar-placement-close{display:inline-grid;place-items:center;width:20px;height:20px;flex:none;padding:0;border:0;border-radius:4px;background:transparent;color:var(--sg-muted);font-size:15px;line-height:1;cursor:pointer}.sg-sidebar-placement-close:hover{background:var(--sg-soft);color:var(--sg-text)}",pendingFeedbackNavigation=null,feedbackNavigationListeners=new Set;function setFeedbackNavigation(state){pendingFeedbackNavigation=state;for(let listener of feedbackNavigationListeners)listener(state);feedbackNavigationListeners.size&&(pendingFeedbackNavigation=null)}function FeedbackSettingsPage(props){let[navigationState,setNavigationState]=React.useState(()=>pendingFeedbackNavigation);return React.useEffect(()=>(feedbackNavigationListeners.add(setNavigationState),pendingFeedbackNavigation&&setNavigationState(pendingFeedbackNavigation),pendingFeedbackNavigation=null,()=>feedbackNavigationListeners.delete(setNavigationState)),[]),h(MemoryPage,{...props,navigationState:navigationState||props.navigationState})}let ISSUE_BODY_HINT=`> \u8BF7\u5728\u4E0B\u65B9\u7C98\u8D34 StrataGate \u53CD\u9988\u62A5\u544A\uFF08Ctrl+V / \u2318V\uFF09\uFF0C\u68C0\u67E5\u540E\u63D0\u4EA4\u3002\u82E5\u65E0\u6CD5\u7C98\u8D34\uFF0C\u8BF7\u8FD4\u56DE StrataGate \u624B\u52A8\u590D\u5236\u62A5\u544A\u3002
324
324
 
325
- `,STRATAGATE_CLIENT_VERSION="0.3.50",MEMORY_CITATIONS_KIND="stratagate-memory-citations",MEMORY_RETRIEVAL_TOOLS=new Set(["memory_search_events","memory_search_graph","memory_expand_graph_node","memory_search_elements","memory_search_raw","memory_get_blocks","memory_expand_block","memory_expand_event","memory_expand_element"]);function readFeedbackDeepLink(locationRef=window.location){let params=new URLSearchParams(String(locationRef?.search||""));if(params.get("settings")!==FEEDBACK_SETTINGS_ID||params.get("stratagateView")!==FEEDBACK_VIEW_ID)return null;let namespace=String(params.get("namespace")||"").trim();return namespace?{namespace}:null}function readFeedbackNavigationState(state){if(!state||state.view!==FEEDBACK_VIEW_ID)return null;let namespace=String(state.namespace||"").trim();return namespace?{namespace}:null}function readNewFeedbackNavigationState(previousState,state){return state===previousState?null:readFeedbackNavigationState(state)}function readGraphNodeNavigationState(state){if(!state||state.view!=="graph-node")return null;let namespace=String(state.namespace||"").trim(),nodeId=String(state.nodeId||"").trim();return namespace&&nodeId?{namespace,nodeId}:null}function readGraphNodeDeepLink(locationRef=window.location){let params=new URLSearchParams(String(locationRef?.search||""));if(params.get("settings")!==FEEDBACK_SETTINGS_ID||params.get("stratagateView")!=="graph-node")return null;let namespace=String(params.get("namespace")||"").trim(),nodeId=String(params.get("nodeId")||"").trim();return namespace&&nodeId?{namespace,nodeId}:null}function consumeFeedbackDeepLink(locationRef=window.location,historyRef=window.history){let params=new URLSearchParams(String(locationRef?.search||""));params.delete("settings"),params.delete("stratagateView"),params.delete("namespace");let search=params.toString(),next2=String(locationRef?.pathname||"/")+(search?"?"+search:"")+String(locationRef?.hash||"");return historyRef?.replaceState?.(historyRef.state,"",next2),next2}function consumeGraphNodeDeepLink(locationRef=window.location,historyRef=window.history){let params=new URLSearchParams(String(locationRef?.search||""));params.delete("settings"),params.delete("stratagateView"),params.delete("namespace"),params.delete("nodeId");let search=params.toString(),next2=String(locationRef?.pathname||"/")+(search?"?"+search:"")+String(locationRef?.hash||"");return historyRef?.replaceState?.(historyRef.state,"",next2),next2}function isDesktopFeedbackSurface(locationRef){try{let url=new URL(String(locationRef?.href||""));return url.protocol==="dsh-app:"&&url.hostname==="app"}catch{return!1}}function desktopFeedbackOrigin(value){try{let url=new URL(String(value||""));return url.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(url.hostname)&&!url.username&&!url.password&&url.pathname==="/"&&!url.search&&!url.hash?url.origin:""}catch{return""}}function feedbackAnchorTarget(target,locationRef){let anchor=target?.closest?.("a[href]")||target?.parentElement?.closest?.("a[href]");if(!anchor)return null;let url;try{url=new URL(String(anchor.getAttribute?.("href")||""),String(locationRef?.href||""))}catch{return null}return!readFeedbackDeepLink(url)||url.pathname!=="/"||url.username||url.password?null:{anchor,url}}function feedbackLinkTarget(target,locationRef=window.location,desktopHostOrigin=""){let match2=feedbackAnchorTarget(target,locationRef);return match2&&(match2.url.origin===String(locationRef?.origin||"")||isDesktopFeedbackSurface(locationRef)&&desktopFeedbackOrigin(desktopHostOrigin)===match2.url.origin)?match2:null}function navigateToFeedback(ctx,targetUrl,locationRef=window.location,allowHttpFallback=!0){let feedback=readFeedbackDeepLink(targetUrl);if(!feedback)return"ignored";let navigation=ctx?.get?.("settingsNavigation");if(typeof navigation?.openSection=="function")return navigation.openSection(FEEDBACK_SETTINGS_ID,{view:FEEDBACK_VIEW_ID,namespace:feedback.namespace}),"host";let shell=ctx?.get?.("slots")?.entries?.("sidebar.settings")?.find(entry=>typeof entry.store?.create=="function")?.store.create();return typeof shell?.actions?.openSection=="function"?(setFeedbackNavigation({view:FEEDBACK_VIEW_ID,namespace:feedback.namespace}),shell.actions.openSection(FEEDBACK_SETTINGS_ID),"host"):(allowHttpFallback&&locationRef.assign(targetUrl.href),"http")}function navigateToGraphNode(ctx,namespace,nodeId,locationRef=window.location,allowHttpFallback=!0){let targetNamespace=String(namespace||"").trim(),targetNodeId=String(nodeId||"").trim();if(!targetNamespace||!targetNodeId)return Promise.resolve(!1);let navigation=ctx?.get?.("settingsNavigation");if(typeof navigation?.openSection!="function"){if(!allowHttpFallback||typeof locationRef?.assign!="function")return Promise.resolve(!1);try{let targetUrl=new URL(String(locationRef.href||""));return targetUrl.searchParams.set("settings",FEEDBACK_SETTINGS_ID),targetUrl.searchParams.set("stratagateView","graph-node"),targetUrl.searchParams.set("namespace",targetNamespace),targetUrl.searchParams.set("nodeId",targetNodeId),locationRef.assign(targetUrl.href),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}try{return Promise.resolve(navigation.openSection(FEEDBACK_SETTINGS_ID,{view:"graph-node",namespace:targetNamespace,nodeId:targetNodeId})).then(result=>result!==!1,()=>!1)}catch{return Promise.resolve(!1)}}function installFeedbackLinkNavigation(ctx,documentRef=document,locationRef=window.location){let desktop=isDesktopFeedbackSurface(locationRef),active=!0,desktopHostOrigin="",bootPending=desktop&&typeof window.dshDesktopBoot?.ready=="function",replayingAnchor=null,bootReady=bootPending?Promise.resolve().then(()=>window.dshDesktopBoot.ready()).then(boot=>{active&&(desktopHostOrigin=desktopFeedbackOrigin(boot?.streamBaseUrl))}).catch(()=>{}).finally(()=>{bootPending=!1}):Promise.resolve(),takeClick=event3=>{event3.preventDefault(),event3.stopPropagation()},onClick=event3=>{if(event3.defaultPrevented||typeof event3.button=="number"&&event3.button!==0||event3.metaKey||event3.ctrlKey||event3.shiftKey||event3.altKey)return;let candidate=feedbackAnchorTarget(event3.target,locationRef);if(!candidate||candidate.anchor===replayingAnchor)return;let match2=feedbackLinkTarget(event3.target,locationRef,desktopHostOrigin);match2?(takeClick(event3),navigateToFeedback(ctx,match2.url,locationRef,!desktop)):bootPending&&desktopFeedbackOrigin(candidate.url.origin)&&(takeClick(event3),bootReady.then(()=>{if(active)if(candidate.url.origin===desktopHostOrigin)navigateToFeedback(ctx,candidate.url,locationRef,!1);else{replayingAnchor=candidate.anchor;try{candidate.anchor.click()}finally{replayingAnchor=null}}}))};return documentRef.addEventListener("click",onClick,!0),()=>{active=!1,documentRef.removeEventListener("click",onClick,!0)}}function exactInteractiveControl(labels,documentRef){let selector='button,[role="button"],[role="tab"],a',matches33=element3=>{let values=[element3.getAttribute?.("aria-label"),element3.getAttribute?.("title"),element3.textContent].map(value=>String(value||"").trim());return labels.some(label=>values.includes(label))},visible=element3=>!element3.hidden&&element3.getAttribute?.("aria-hidden")!=="true"&&(typeof element3.getClientRects!="function"||element3.getClientRects().length>0),direct=Array.from(documentRef.querySelectorAll(selector)).find(element3=>visible(element3)&&matches33(element3));if(direct)return direct;for(let element3 of Array.from(documentRef.querySelectorAll("*"))){if(String(element3.textContent||"").trim()!==labels[0])continue;let control=element3.closest?.(selector)||element3;if(visible(control)&&typeof control.click=="function")return control}return null}function openLegacyFeedbackDeepLink(documentRef=document){let observer=null,timer=null,settingsClicked=!1,sectionClicked=!1,cleanup=()=>{observer?.disconnect?.(),timer!==null&&window.clearTimeout(timer)},attempt=()=>{if(documentRef.querySelector('[data-testid="stratagate-memory-ui"]')){cleanup();return}if(!sectionClicked){let section=exactInteractiveControl(["StrataGate-AgentMemory"],documentRef);if(section){sectionClicked=!0,section.click();return}}if(!settingsClicked){let settings=exactInteractiveControl(["\u8BBE\u7F6E","Settings"],documentRef);settings&&(settingsClicked=!0,settings.click())}},Observer=window.MutationObserver||globalThis.MutationObserver;return typeof Observer=="function"&&(observer=new Observer(attempt),observer.observe(documentRef.documentElement||documentRef.body,{childList:!0,subtree:!0})),timer=window.setTimeout(cleanup,12e3),attempt(),cleanup}function openFeedbackDeepLink(ctx,documentRef=document,locationRef=window.location,historyRef=window.history){if(!readFeedbackDeepLink(locationRef))return()=>{};if(navigateToFeedback(ctx,locationRef,locationRef,!1)==="host")return consumeFeedbackDeepLink(locationRef,historyRef),()=>{};let legacyCleanup=()=>{},timer=window.setTimeout(()=>{legacyCleanup=openLegacyFeedbackDeepLink(documentRef)},250);return ctx?.inject?.(["settingsNavigation"],scope=>{navigateToFeedback(scope,locationRef,locationRef,!1)==="host"&&(window.clearTimeout(timer),legacyCleanup(),consumeFeedbackDeepLink(locationRef,historyRef))}),()=>{window.clearTimeout(timer),legacyCleanup()}}function openGraphNodeDeepLink(ctx,documentRef=document,locationRef=window.location,historyRef=window.history){let graphLink=readGraphNodeDeepLink(locationRef);if(!graphLink)return()=>{};if(typeof ctx?.get?.("settingsNavigation")?.openSection=="function")return navigateToGraphNode(ctx,graphLink.namespace,graphLink.nodeId,locationRef,!1).then(opened=>{opened&&consumeGraphNodeDeepLink(locationRef,historyRef)}),()=>{};let legacyCleanup=()=>{},timer=window.setTimeout(()=>{legacyCleanup=openLegacyFeedbackDeepLink(documentRef)},250);return ctx?.inject?.(["settingsNavigation"],scope=>{navigateToGraphNode(scope,graphLink.namespace,graphLink.nodeId,locationRef,!1).then(opened=>{opened&&(window.clearTimeout(timer),legacyCleanup(),consumeGraphNodeDeepLink(locationRef,historyRef))})}),()=>{window.clearTimeout(timer),legacyCleanup()}}let eventDetailCss=`
325
+ `,STRATAGATE_CLIENT_VERSION="0.3.52",MEMORY_CITATIONS_KIND="stratagate-memory-citations",MEMORY_RETRIEVAL_TOOLS=new Set(["memory_search_events","memory_search_graph","memory_expand_graph_node","memory_search_elements","memory_search_raw","memory_get_blocks","memory_expand_block","memory_expand_event","memory_expand_element"]);function readFeedbackDeepLink(locationRef=window.location){let params=new URLSearchParams(String(locationRef?.search||""));if(params.get("settings")!==FEEDBACK_SETTINGS_ID||params.get("stratagateView")!==FEEDBACK_VIEW_ID)return null;let namespace=String(params.get("namespace")||"").trim();return namespace?{namespace}:null}function readFeedbackNavigationState(state){if(!state||state.view!==FEEDBACK_VIEW_ID)return null;let namespace=String(state.namespace||"").trim();return namespace?{namespace}:null}function readNewFeedbackNavigationState(previousState,state){return state===previousState?null:readFeedbackNavigationState(state)}function readGraphNodeNavigationState(state){if(!state||state.view!=="graph-node")return null;let namespace=String(state.namespace||"").trim(),nodeId=String(state.nodeId||"").trim();return namespace&&nodeId?{namespace,nodeId}:null}function readGraphNodeDeepLink(locationRef=window.location){let params=new URLSearchParams(String(locationRef?.search||""));if(params.get("settings")!==FEEDBACK_SETTINGS_ID||params.get("stratagateView")!=="graph-node")return null;let namespace=String(params.get("namespace")||"").trim(),nodeId=String(params.get("nodeId")||"").trim();return namespace&&nodeId?{namespace,nodeId}:null}function consumeFeedbackDeepLink(locationRef=window.location,historyRef=window.history){let params=new URLSearchParams(String(locationRef?.search||""));params.delete("settings"),params.delete("stratagateView"),params.delete("namespace");let search=params.toString(),next2=String(locationRef?.pathname||"/")+(search?"?"+search:"")+String(locationRef?.hash||"");return historyRef?.replaceState?.(historyRef.state,"",next2),next2}function consumeGraphNodeDeepLink(locationRef=window.location,historyRef=window.history){let params=new URLSearchParams(String(locationRef?.search||""));params.delete("settings"),params.delete("stratagateView"),params.delete("namespace"),params.delete("nodeId");let search=params.toString(),next2=String(locationRef?.pathname||"/")+(search?"?"+search:"")+String(locationRef?.hash||"");return historyRef?.replaceState?.(historyRef.state,"",next2),next2}function isDesktopFeedbackSurface(locationRef){try{let url=new URL(String(locationRef?.href||""));return url.protocol==="dsh-app:"&&url.hostname==="app"}catch{return!1}}function desktopFeedbackOrigin(value){try{let url=new URL(String(value||""));return url.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(url.hostname)&&!url.username&&!url.password&&url.pathname==="/"&&!url.search&&!url.hash?url.origin:""}catch{return""}}function feedbackAnchorTarget(target,locationRef){let anchor=target?.closest?.("a[href]")||target?.parentElement?.closest?.("a[href]");if(!anchor)return null;let url;try{url=new URL(String(anchor.getAttribute?.("href")||""),String(locationRef?.href||""))}catch{return null}return!readFeedbackDeepLink(url)||url.pathname!=="/"||url.username||url.password?null:{anchor,url}}function feedbackLinkTarget(target,locationRef=window.location,desktopHostOrigin=""){let match2=feedbackAnchorTarget(target,locationRef);return match2&&(match2.url.origin===String(locationRef?.origin||"")||isDesktopFeedbackSurface(locationRef)&&desktopFeedbackOrigin(desktopHostOrigin)===match2.url.origin)?match2:null}function navigateToFeedback(ctx,targetUrl,locationRef=window.location,allowHttpFallback=!0){let feedback=readFeedbackDeepLink(targetUrl);if(!feedback)return"ignored";let navigation=ctx?.get?.("settingsNavigation");if(typeof navigation?.openSection=="function")return navigation.openSection(FEEDBACK_SETTINGS_ID,{view:FEEDBACK_VIEW_ID,namespace:feedback.namespace}),"host";let shell=ctx?.get?.("slots")?.entries?.("sidebar.settings")?.find(entry=>typeof entry.store?.create=="function")?.store.create();return typeof shell?.actions?.openSection=="function"?(setFeedbackNavigation({view:FEEDBACK_VIEW_ID,namespace:feedback.namespace}),shell.actions.openSection(FEEDBACK_SETTINGS_ID),"host"):(allowHttpFallback&&locationRef.assign(targetUrl.href),"http")}function navigateToGraphNode(ctx,namespace,nodeId,locationRef=window.location,allowHttpFallback=!0){let targetNamespace=String(namespace||"").trim(),targetNodeId=String(nodeId||"").trim();if(!targetNamespace||!targetNodeId)return Promise.resolve(!1);let navigation=ctx?.get?.("settingsNavigation");if(typeof navigation?.openSection!="function"){if(!allowHttpFallback||typeof locationRef?.assign!="function")return Promise.resolve(!1);try{let targetUrl=new URL(String(locationRef.href||""));return targetUrl.searchParams.set("settings",FEEDBACK_SETTINGS_ID),targetUrl.searchParams.set("stratagateView","graph-node"),targetUrl.searchParams.set("namespace",targetNamespace),targetUrl.searchParams.set("nodeId",targetNodeId),locationRef.assign(targetUrl.href),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}try{return Promise.resolve(navigation.openSection(FEEDBACK_SETTINGS_ID,{view:"graph-node",namespace:targetNamespace,nodeId:targetNodeId})).then(result=>result!==!1,()=>!1)}catch{return Promise.resolve(!1)}}function installFeedbackLinkNavigation(ctx,documentRef=document,locationRef=window.location){let desktop=isDesktopFeedbackSurface(locationRef),active=!0,desktopHostOrigin="",bootPending=desktop&&typeof window.dshDesktopBoot?.ready=="function",replayingAnchor=null,bootReady=bootPending?Promise.resolve().then(()=>window.dshDesktopBoot.ready()).then(boot=>{active&&(desktopHostOrigin=desktopFeedbackOrigin(boot?.streamBaseUrl))}).catch(()=>{}).finally(()=>{bootPending=!1}):Promise.resolve(),takeClick=event3=>{event3.preventDefault(),event3.stopPropagation()},onClick=event3=>{if(event3.defaultPrevented||typeof event3.button=="number"&&event3.button!==0||event3.metaKey||event3.ctrlKey||event3.shiftKey||event3.altKey)return;let candidate=feedbackAnchorTarget(event3.target,locationRef);if(!candidate||candidate.anchor===replayingAnchor)return;let match2=feedbackLinkTarget(event3.target,locationRef,desktopHostOrigin);match2?(takeClick(event3),navigateToFeedback(ctx,match2.url,locationRef,!desktop)):bootPending&&desktopFeedbackOrigin(candidate.url.origin)&&(takeClick(event3),bootReady.then(()=>{if(active)if(candidate.url.origin===desktopHostOrigin)navigateToFeedback(ctx,candidate.url,locationRef,!1);else{replayingAnchor=candidate.anchor;try{candidate.anchor.click()}finally{replayingAnchor=null}}}))};return documentRef.addEventListener("click",onClick,!0),()=>{active=!1,documentRef.removeEventListener("click",onClick,!0)}}function exactInteractiveControl(labels,documentRef){let selector='button,[role="button"],[role="tab"],a',matches33=element3=>{let values=[element3.getAttribute?.("aria-label"),element3.getAttribute?.("title"),element3.textContent].map(value=>String(value||"").trim());return labels.some(label=>values.includes(label))},visible=element3=>!element3.hidden&&element3.getAttribute?.("aria-hidden")!=="true"&&(typeof element3.getClientRects!="function"||element3.getClientRects().length>0),direct=Array.from(documentRef.querySelectorAll(selector)).find(element3=>visible(element3)&&matches33(element3));if(direct)return direct;for(let element3 of Array.from(documentRef.querySelectorAll("*"))){if(String(element3.textContent||"").trim()!==labels[0])continue;let control=element3.closest?.(selector)||element3;if(visible(control)&&typeof control.click=="function")return control}return null}function openLegacyFeedbackDeepLink(documentRef=document){let observer=null,timer=null,settingsClicked=!1,sectionClicked=!1,cleanup=()=>{observer?.disconnect?.(),timer!==null&&window.clearTimeout(timer)},attempt=()=>{if(documentRef.querySelector('[data-testid="stratagate-memory-ui"]')){cleanup();return}if(!sectionClicked){let section=exactInteractiveControl(["StrataGate-AgentMemory"],documentRef);if(section){sectionClicked=!0,section.click();return}}if(!settingsClicked){let settings=exactInteractiveControl(["\u8BBE\u7F6E","Settings"],documentRef);settings&&(settingsClicked=!0,settings.click())}},Observer=window.MutationObserver||globalThis.MutationObserver;return typeof Observer=="function"&&(observer=new Observer(attempt),observer.observe(documentRef.documentElement||documentRef.body,{childList:!0,subtree:!0})),timer=window.setTimeout(cleanup,12e3),attempt(),cleanup}function openFeedbackDeepLink(ctx,documentRef=document,locationRef=window.location,historyRef=window.history){if(!readFeedbackDeepLink(locationRef))return()=>{};if(navigateToFeedback(ctx,locationRef,locationRef,!1)==="host")return consumeFeedbackDeepLink(locationRef,historyRef),()=>{};let legacyCleanup=()=>{},timer=window.setTimeout(()=>{legacyCleanup=openLegacyFeedbackDeepLink(documentRef)},250);return ctx?.inject?.(["settingsNavigation"],scope=>{navigateToFeedback(scope,locationRef,locationRef,!1)==="host"&&(window.clearTimeout(timer),legacyCleanup(),consumeFeedbackDeepLink(locationRef,historyRef))}),()=>{window.clearTimeout(timer),legacyCleanup()}}function openGraphNodeDeepLink(ctx,documentRef=document,locationRef=window.location,historyRef=window.history){let graphLink=readGraphNodeDeepLink(locationRef);if(!graphLink)return()=>{};if(typeof ctx?.get?.("settingsNavigation")?.openSection=="function")return navigateToGraphNode(ctx,graphLink.namespace,graphLink.nodeId,locationRef,!1).then(opened=>{opened&&consumeGraphNodeDeepLink(locationRef,historyRef)}),()=>{};let legacyCleanup=()=>{},timer=window.setTimeout(()=>{legacyCleanup=openLegacyFeedbackDeepLink(documentRef)},250);return ctx?.inject?.(["settingsNavigation"],scope=>{navigateToGraphNode(scope,graphLink.namespace,graphLink.nodeId,locationRef,!1).then(opened=>{opened&&(window.clearTimeout(timer),legacyCleanup(),consumeGraphNodeDeepLink(locationRef,historyRef))})}),()=>{window.clearTimeout(timer),legacyCleanup()}}let eventDetailCss=`
326
326
  .sg-event-metadata{display:flex;align-items:center;gap:7px 16px;flex-wrap:wrap;margin-top:8px;color:var(--sg-muted);font-size:12px;line-height:1.45}.sg-event-metadata-item{display:inline-flex;align-items:center;gap:5px;min-width:0}.sg-event-metadata b{color:var(--sg-muted);font-weight:620}.sg-event-participants{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}.sg-event-metadata .sg-entity-pill{padding:2px 7px}.sg-entity-pill-static{cursor:default;opacity:.82}.sg-entity-pill-static:hover{transform:none!important;background:transparent!important}.sg-event-section{display:grid;gap:9px;padding:17px 0;border-bottom:1px solid var(--sg-border)}.sg-event-section-title{margin:0;color:var(--sg-text);font-size:14px;font-weight:730}.sg-event-memory-copy{max-width:65ch;margin:0;color:var(--sg-text);font-size:14px;line-height:1.72;white-space:pre-wrap;overflow-wrap:anywhere;text-wrap:pretty}.sg-event-weight-section{gap:0}
327
327
  .sg-weight-header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:9px}.sg-weight-header .sg-section-title,.sg-long-detail .sg-weight-header h3{margin:0}.sg-weight-metrics{display:grid!important;grid-template-columns:1fr!important;gap:0!important;margin:0 0 13px!important}.sg-weight-metric{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;min-width:0;padding:7px 2px!important;border-bottom:1px solid color-mix(in srgb,var(--sg-border) 72%,transparent);border-radius:0!important;background:transparent!important}.sg-weight-metric:last-child{border-bottom:0}.sg-weight-metric>span:first-child{color:var(--sg-muted);font-size:12px}.sg-weight-metric strong{margin:0!important;color:var(--sg-text);font-size:15px!important;font-weight:740;font-variant-numeric:tabular-nums;white-space:nowrap}.sg-weight-value{display:inline-flex!important;align-items:center;justify-content:flex-end;gap:6px;color:var(--sg-text)!important}
328
328
  .sg-info-disclosure{position:relative;display:inline-flex}.sg-info-trigger{display:grid;place-items:center;width:19px;height:19px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sg-muted);font-size:13px;line-height:1;cursor:pointer}.sg-info-trigger:hover,.sg-info-trigger[aria-expanded="true"]{background:var(--sg-soft);color:var(--sg-text)}.sg-info-popover{position:absolute;right:0;top:calc(100% + 7px);z-index:20;width:min(320px,calc(100vw - 40px));padding:13px 14px;border:1px solid color-mix(in srgb,var(--sg-accent) 20%,var(--sg-border));border-radius:9px;background:var(--sg-page);color:var(--sg-text);box-shadow:0 14px 36px color-mix(in srgb,var(--sg-text) 18%,transparent);font-size:12px;line-height:1.58;text-align:left}.sg-info-title{display:block;margin-bottom:7px;font-size:13px}.sg-info-popover p{margin:0;color:var(--sg-muted)}.sg-info-popover p+p{margin-top:7px}.sg-adoption-history{display:grid;gap:10px;margin:0;padding:0;list-style:none;counter-reset:history}.sg-adoption-history li{display:grid;gap:1px;padding-bottom:9px;border-bottom:1px solid var(--sg-border)}.sg-adoption-history li:last-child{padding-bottom:0;border-bottom:0}.sg-adoption-history time,.sg-adoption-history span{color:var(--sg-muted)}.sg-floor-table{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 14px;margin:10px 0 0;padding-top:9px;border-top:1px solid var(--sg-border)}.sg-floor-table dt,.sg-floor-table dd{margin:0;color:var(--sg-muted)}.sg-floor-table .current{color:var(--sg-accent);font-weight:720}