livebook/static/assets/mindmap-definition-7f612c4b-FAHUFNYL.js

118 lines
461 KiB
JavaScript
Raw Normal View History

2023-10-06 00:34:57 +08:00
import{a as Qu}from"./chunk-SF6FGZXC.js";import{$a as Da,Fa as Rr,Ha as Ju,I as Mp,L as Wu,M as Ku,N as Zu,b as Op,c as Np,cb as ju,h as sn}from"./chunk-AZTSVESG.js";import"./chunk-BZUL2CAN.js";import{f as ni,h as nn}from"./chunk-EP6THQJ3.js";var el=ni((Qi,Ji)=>{(function(q,W){typeof Qi=="object"&&typeof Ji!="undefined"?Ji.exports=W():typeof define=="function"&&define.amd?define(W):(q=typeof globalThis!="undefined"?globalThis:q||self,q.cytoscape=W())})(Qi,function(){"use strict";function q(t){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(t)}function W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function L(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return A(t)||V(t,e)||U(t,e)||J()}function A(t){if(Array.isArray(t))return t}function V(t,e){var r=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,s,o;try{for(r=r.call(t);!(n=(s=r.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw o}}return a}}function U(t,e){if(t){if(typeof t=="string")return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}}function R(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function J(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2023-06-20 23:34:33 +08:00
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=typeof window=="undefined"?null:window,$=D?D.navigator:null;D&&D.document;var Y=q(""),j=q({}),te=q(function(){}),le=typeof HTMLElement=="undefined"?"undefined":q(HTMLElement),Q=function(e){return e&&e.instanceString&&ne(e.instanceString)?e.instanceString():null},ee=function(e){return e!=null&&q(e)==Y},ne=function(e){return e!=null&&q(e)===te},me=function(e){return!se(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},C=function(e){return e!=null&&q(e)===j&&!me(e)&&e.constructor===Object},B=function(e){return e!=null&&q(e)===j},N=function(e){return e!=null&&q(e)===q(1)&&!isNaN(e)},Z=function(e){return N(e)&&Math.floor(e)===e},ue=function(e){if(le!=="undefined")return e!=null&&e instanceof HTMLElement},se=function(e){return Le(e)||be(e)},Le=function(e){return Q(e)==="collection"&&e._private.single},be=function(e){return Q(e)==="collection"&&!e._private.single},Ge=function(e){return Q(e)==="core"},et=function(e){return Q(e)==="stylesheet"},ct=function(e){return Q(e)==="event"},Ye=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Fe=function(e){return typeof HTMLElement=="undefined"?!1:e instanceof HTMLElement},ze=function(e){return C(e)&&N(e.x1)&&N(e.x2)&&N(e.y1)&&N(e.y2)},Je=function(e){return B(e)&&ne(e.then)},at=function(){return $&&$.userAgent.match(/msie|trident|edge/i)},ut=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function n(){var i=this,s=arguments,o,l=r.apply(i,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return a.cache={},a},tt=ut(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Tt=ut(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),mt=ut(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),xt=function(e){return Ye(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ke="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",mr="rgb[a]?\\(("+Ke+"[%]?)\\s*,\\s*("+Ke+"[%]?)\\s*,\\s*("+Ke+"[%]?)(?:\\s*,\\s*("+Ke+"))?\\)",Zt="rgb[a]?\\((?:"+Ke+"[%]?)\\s*,\\s*(?:"+Ke+"[%]?)\\s*,\\s*(?:"+Ke+"[%]?)(?:\\s*,\\s*(?:"+Ke+"))?\\)",br="hsl[a]?\\(("+Ke+")\\s*,\\s*("+Ke+"[%])\\s*,\\s*("+Ke+"[%])(?:\\s*,\\s*("+Ke+"))?\\)",Qt="hsl[a]?\\((?:"+Ke+")\\s*,\\s*(?:"+Ke+"[%])\\s*,\\s*(?:"+Ke+"[%])(?:\\s*,\\s*(?:"+Ke+"))?\\)",hn="\\#[0-9a-fA-F]{3}",Kr="\\#[0-9a-fA-F]{6}",Zr=function(e,r){return e<r?-1:e>r?1:0},Jt=function(e,r){return-1*Zr(e,r)},$e=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},fl=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,s=16;return r?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},hl=function(e){var r,a,n,i,s,o,l,u;function f(d,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?d+(g-d)*6*y:y<1/2?g:y<2/3?d+(g-d)*(2/3-y)*6:d}var h=new RegExp("^"+br+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,s=h[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,v=2*i-c;o=Math.round(255*f(v,c,a+1/3)),l=Math.round(255*f(v,c,a)),u=Math.round(255*f(v,c,a-1/3))}r=[o,l,u,s]}return r},cl=function(e){var r,a=new RegExp("^"+mr+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},vl=function(e){return gl[e.toLowerCase()]},dl=function(e){return(m
2023-05-27 15:05:48 +08:00
`),h=t.pstyle("text-max-width").pfValue,c=t.pstyle("text-overflow-wrap").value,v=c==="anywhere",d=[],g=/[\s\u200b]+/,y=v?"":" ",p=0;p<f.length;p++){var m=f[p],b=this.calculateLabelDimensions(t,m),x=b.width;if(v){var I=m.split("").join(u);m=I}if(x>h){for(var O=m.split(g),T="",k=0;k<O.length;k++){var S=O[k],F=T.length===0?S:T+y+S,z=this.calculateLabelDimensions(t,F),P=z.width;P<=h?T+=S+y:(T&&d.push(T),T=S+y)}T.match(/^[\s\u200b]+$/)||d.push(T)}else d.push(m)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var H=t.pstyle("text-max-width").pfValue,G="",re="\u2026",X=!1;if(this.calculateLabelDimensions(t,n).width<H)return n;for(var K=0;K<n.length;K++){var ie=this.calculateLabelDimensions(t,G+n[K]+re).width;if(ie>H)break;G+=n[K],K===n.length-1&&(X=!0)}return X||(G+=re),G}return n},lr.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},lr.calculateLabelDimensions=function(t,e){var r=this,a=Pr(e,t._private.labelDimsKey),n=r.labelDimCache||(r.labelDimCache=[]),i=n[a];if(i!=null)return i;var s=0,o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,u=t.pstyle("font-family").strValue,f=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=h.getContext("2d");var v=h.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}c.font="".concat(o," ").concat(f," ").concat(l,"px ").concat(u);for(var d=0,g=0,y=e.split(`
2023-06-20 23:34:33 +08:00
`),p=0;p<y.length;p++){var m=y[p],b=c.measureText(m),x=Math.ceil(b.width),I=l;d=Math.max(x,d),g+=I}return d+=s,g+=s,n[a]={width:d,height:g}},lr.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:n&&o==="autorotate"?a.labelAutoAngle:o==="autorotate"?0:s.pfValue},lr.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var gu={},pu=28,yu=!1;gu.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<pu||t.height()<pu))return yu||(lt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),yu=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var Zn={};Zn.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],f=u._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],f=u._private.rstyle;u.isNode()&&!f.cleanConnected&&(a(u.connectedEdges()),f.cleanConnected=!0)}if(o)for(var h=0;h<o.length;h++){var c=o[h];c(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)},Zn.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Zn.recalculateRenderedStyle=function(t,e){var r=function(x){return x._private.rstyle.cleanConnected},a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?n.push(s):a.push(s),l.clean=!0)}for(var u=0;u<n.length;u++){var f=n[u],h=f._private,c=h.rstyle,v=f.position();this.recalculateNodeLabelProjection(f),c.nodeX=v.x,c.nodeY=v.y,c.nodeW=f.pstyle("width").pfValue,c.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var g=a[d],y=g._private,p=y.rstyle,m=y.rscratch;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}}};var Qn={};Qn.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}},Qn.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Qn.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Vo),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var mu={};[_r,Kn,Gt,Qa,$i,lr,gu,Zn,Qn].forEach(function(t){$e(mu,t)});var bu={};bu.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(s.crossOrigin=e),s.src=t,s};var ma={};ma
2023-05-27 15:05:48 +08:00
`+ze.showPosition()+`
2023-06-20 23:34:33 +08:00
Expecting `+Kr.join(", ")+", got '"+(this.terminals_[mt]||mt)+"'":Zr="Parse error on line "+(Ge+1)+": Unexpected "+(mt==Ye?"end of input":"'"+(this.terminals_[mt]||mt)+"'"),this.parseError(Zr,{text:ze.match,token:this.terminals_[mt]||mt,line:ze.yylineno,loc:ut,expected:Kr})}if(Ke[0]instanceof Array&&Ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+mt);switch(Ke[0]){case 1:N.push(mt),ue.push(ze.yytext),se.push(ze.yylloc),N.push(Ke[1]),mt=null,et=ze.yyleng,be=ze.yytext,Ge=ze.yylineno,ut=ze.yylloc;break;case 2:if(Qt=this.productions_[Ke[1]][1],Zt.$=ue[ue.length-Qt],Zt._$={first_line:se[se.length-(Qt||1)].first_line,last_line:se[se.length-1].last_line,first_column:se[se.length-(Qt||1)].first_column,last_column:se[se.length-1].last_column},tt&&(Zt._$.range=[se[se.length-(Qt||1)].range[0],se[se.length-1].range[1]]),mr=this.performAction.apply(Zt,[be,et,Ge,Je.yy,Ke[1],ue,se].concat(Fe)),typeof mr!="undefined")return mr;Qt&&(N=N.slice(0,-1*Qt*2),ue=ue.slice(0,-1*Qt),se=se.slice(0,-1*Qt)),N.push(this.productions_[Ke[1]][0]),ue.push(Zt.$),se.push(Zt._$),hn=Le[N[N.length-2]][N[N.length-1]],N.push(hn);break;case 3:return!0}}return!0}},ee=function(){var me={EOF:1,parseError:function(B,N){if(this.yy.parser)this.yy.parser.parseError(B,N);else throw new Error(B)},setInput:function(C,B){return this.yy=B||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var B=C.match(/(?:\r\n?|\n).*/g);return B?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},unput:function(C){var B=C.length,N=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-B),this.offset-=B;var Z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===Z.length?this.yylloc.first_column:0)+Z[Z.length-N.length].length-N[0].length:this.yylloc.first_column-B},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-B]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
2023-05-27 15:05:48 +08:00
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(C){this.unput(this.match.slice(C))},pastInput:function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var C=this.pastInput(),B=new Array(C.length+1).join("-");return C+this.upcomingInput()+`
`+B+"^"},test_match:function(C,B){var N,Z,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),Z=C[0].match(/(?:\r\n?|\n).*/g),Z&&(this.yylineno+=Z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Z?Z[Z.length-1].length-Z[Z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],N=this.performAction.call(this,this.yy,this,B,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var se in ue)this[se]=ue[se];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,B,N,Z;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),se=0;se<ue.length;se++)if(N=this._input.match(this.rules[ue[se]]),N&&(!B||N[0].length>B[0].length)){if(B=N,Z=se,this.options.backtrack_lexer){if(C=this.test_match(N,ue[se]),C!==!1)return C;if(this._backtrack){B=!1;continue}else return!1}else if(!this.options.flex)break}return B?(C=this.test_match(B,ue[Z]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
2023-10-06 00:34:57 +08:00
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var B=this.next();return B||this.lex()},begin:function(B){this.conditionStack.push(B)},popState:function(){var B=this.conditionStack.length-1;return B>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(B){return B=this.conditionStack.length-1-Math.abs(B||0),B>=0?this.conditionStack[B]:"INITIAL"},pushState:function(B){this.begin(B)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(B,N,Z,ue){switch(Z){case 0:return B.getLogger().trace("Found comment",N.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:B.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return B.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:B.getLogger().trace("end icon"),this.popState();break;case 10:return B.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return B.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return B.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return B.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:B.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return B.getLogger().trace("description:",N.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),B.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),B.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),B.getLogger().trace("node end ...",N.yytext),"NODE_DEND";case 30:return this.popState(),B.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),B.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),B.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),B.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),B.getLogger().trace("node end (("),"NODE_DEND";case 35:return B.getLogger().trace("Long description:",N.yytext),20;case 36:return B.getLogger().trace("Long description:",N.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return me}();Q.lexer=ee;function ne(){this.yy={}}return ne.prototype=Q,Q.Parser=ne,new ne}();ns.parser=ns;var Ip=ns,fn=q=>Ju(q,Da()),Kt=[],al=0,ss={},Rp=()=>{Kt=[],al=0,ss={}},kp=function(q){for(let W=Kt.length-1;W>=0;W--)if(Kt[W].level<q)return Kt[W];return null},Pp=()=>Kt.length>0?Kt[0]:null,Bp=(q,W,_,L)=>{Rr.info("addNode",q,W,_,L);let E=Da(),w={id:al++,nodeId:fn(W),level:q,descr:fn(_),type:L,children:[],width:Da().mindmap.maxNodeWidth};switch(w.type){case dt.ROUNDED_RECT:w.padding=2*E.mindmap.padding;break;case dt.RECT:w.padding=2*E.mindmap.padding;break;case dt.HEXAGON:w.padding=2*E.min
2023-05-27 15:05:48 +08:00
a${A},${A} 1 0,1 ${_*.4},${-1*_*.1}
a${w},${w} 1 0,1 ${_*.35},${1*_*.2}
a${E},${E} 1 0,1 ${_*.15},${1*L*.35}
a${V},${V} 1 0,1 ${-1*_*.15},${1*L*.65}
a${w},${E} 1 0,1 ${-1*_*.25},${_*.15}
a${A},${A} 1 0,1 ${-1*_*.5},0
a${E},${E} 1 0,1 ${-1*_*.25},${-1*_*.15}
a${E},${E} 1 0,1 ${-1*_*.1},${-1*L*.35}
a${V},${V} 1 0,1 ${_*.1},${-1*L*.65}
2023-06-20 23:34:33 +08:00
H0 V0 Z`)},Xp=function(q,W){let _=W.width,L=W.height,E=.15*_;q.append("path").attr("id","node-"+W.id).attr("class","node-bkg node-"+Wr(W.type)).attr("d",`M0 0 a${E},${E} 1 0,0 ${_*.25},${-1*L*.1}
2023-05-27 15:05:48 +08:00
a${E},${E} 1 0,0 ${_*.25},0
a${E},${E} 1 0,0 ${_*.25},0
a${E},${E} 1 0,0 ${_*.25},${1*L*.1}
a${E},${E} 1 0,0 ${_*.15},${1*L*.33}
a${E*.8},${E*.8} 1 0,0 0,${1*L*.34}
a${E},${E} 1 0,0 ${-1*_*.15},${1*L*.33}
a${E},${E} 1 0,0 ${-1*_*.25},${L*.15}
a${E},${E} 1 0,0 ${-1*_*.25},0
a${E},${E} 1 0,0 ${-1*_*.25},0
a${E},${E} 1 0,0 ${-1*_*.25},${-1*L*.15}
a${E},${E} 1 0,0 ${-1*_*.1},${-1*L*.33}
a${E*.8},${E*.8} 1 0,0 0,${-1*L*.34}
a${E},${E} 1 0,0 ${_*.1},${-1*L*.33}
2023-06-20 23:34:33 +08:00
H0 V0 Z`)},qp=function(q,W){q.append("circle").attr("id","node-"+W.id).attr("class","node-bkg node-"+Wr(W.type)).attr("r",W.width/2)};function Wp(q,W,_,L,E){return q.insert("polygon",":first-child").attr("points",L.map(function(w){return w.x+","+w.y}).join(" ")).attr("transform","translate("+(E.width-W)/2+", "+_+")")}var Kp=function(q,W){let _=W.height,E=_/4,w=W.width-W.padding+2*E,A=[{x:E,y:0},{x:w-E,y:0},{x:w,y:-_/2},{x:w-E,y:-_},{x:E,y:-_},{x:0,y:-_/2}];Wp(q,w,_,A,W)},Zp=function(q,W){q.append("rect").attr("id","node-"+W.id).attr("class","node-bkg node-"+Wr(W.type)).attr("height",W.height).attr("rx",W.padding).attr("ry",W.padding).attr("width",W.width)},Qp=function(q,W,_,L){let E=L.htmlLabels,w=_%(sl-1),A=q.append("g");W.section=w;let V="section-"+w;w<0&&(V+=" section-root"),A.attr("class",(W.class?W.class+" ":"")+"mindmap-node "+V);let U=A.append("g"),R=A.append("g"),J=W.descr.replace(/(<br\/*>)/g,`
2023-10-06 00:34:57 +08:00
`);Qu(R,J,{useHtmlLabels:E,width:W.width,classes:"mindmap-node-label"}),E||R.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");let D=R.node().getBBox(),$=L.fontSize.replace?L.fontSize.replace("px",""):L.fontSize;if(W.height=D.height+$*1.1*.5+W.padding,W.width=D.width+2*W.padding,W.icon)if(W.type===dt.CIRCLE)W.height+=50,W.width+=50,A.append("foreignObject").attr("height","50px").attr("width",W.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+w+" "+W.icon),R.attr("transform","translate("+W.width/2+", "+(W.height/2-1.5*W.padding)+")");else{W.width+=50;let Y=W.height;W.height=Math.max(Y,60);let j=Math.abs(W.height-Y);A.append("foreignObject").attr("width","60px").attr("height",W.height).attr("style","text-align: center;margin-top:"+j/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+w+" "+W.icon),R.attr("transform","translate("+(25+W.width/2)+", "+(j/2+W.padding/2)+")")}else if(E){let Y=(W.width-D.width)/2,j=(W.height-D.height)/2;R.attr("transform","translate("+Y+", "+j+")")}else{let Y=W.width/2,j=W.padding/2;R.attr("transform","translate("+Y+", "+j+")")}switch(W.type){case dt.DEFAULT:Up(U,W,w);break;case dt.ROUNDED_RECT:Zp(U,W);break;case dt.RECT:Yp(U,W);break;case dt.CIRCLE:U.attr("transform","translate("+W.width/2+", "+ +W.height/2+")"),qp(U,W);break;case dt.CLOUD:Hp(U,W);break;case dt.BANG:Xp(U,W);break;case dt.HEXAGON:Kp(U,W);break}return nl(W.id,A),W.height},Jp=function(W,_,L,E,w){let A=w%(sl-1),V=L.x+L.width/2,U=L.y+L.height/2,R=_.x+_.width/2,J=_.y+_.height/2,D=R>V?V+Math.abs(V-R)/2:V-Math.abs(V-R)/2,$=J>U?U+Math.abs(U-J)/2:U-Math.abs(U-J)/2,Y=R>V?Math.abs(V-D)/2+V:-Math.abs(V-D)/2+V,j=J>U?Math.abs(U-$)/2+U:-Math.abs(U-$)/2+U;W.append("path").attr("d",L.direction==="TB"||L.direction==="BT"?`M${V},${U} Q${V},${j} ${D},${$} T${R},${J}`:`M${V},${U} Q${Y},${U} ${D},${$} T${R},${J}`).attr("class","edge section-edge-"+A+" edge-depth-"+E)},jp=function(q){let W=os(q.id),_=q.x||0,L=q.y||0;W.attr("transform","translate("+_+","+L+")")},ol={drawNode:Qp,positionNode:jp,drawEdge:Jp};is.default.use(rl.default);function ul(q,W,_,L){ol.drawNode(q,W,_,L),W.children&&W.children.forEach((E,w)=>{ul(q,E,_<0?w:_,L)})}function ey(q,W){W.edges().map((_,L)=>{let E=_.data();if(_[0]._private.bodyBounds){let w=_[0]._private.rscratch;Rr.trace("Edge: ",L,E),q.insert("path").attr("d",`M ${w.startX},${w.startY} L ${w.midX},${w.midY} L${w.endX},${w.endY} `).attr("class","edge section-edge-"+E.section+" edge-depth-"+E.depth)}})}function ll(q,W,_,L){W.add({group:"nodes",data:{id:q.id,labelText:q.descr,height:q.height,width:q.width,level:L,nodeId:q.id,padding:q.padding,type:q.type},position:{x:q.x,y:q.y}}),q.children&&q.children.forEach(E=>{ll(E,W,_,L+1),W.add({group:"edges",data:{id:`${q.id}_${E.id}`,source:q.id,target:E.id,depth:L,section:E.section}})})}function ty(q,W){return new Promise(_=>{let L=sn("body").append("div").attr("id","cy").attr("style","display:none"),E=(0,is.default)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});L.remove(),ll(q,E,W,0),E.nodes().forEach(function(w){w.layoutDimensions=()=>{let A=w.data();return{w:A.width,h:A.height}}}),E.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),E.ready(w=>{Rr.info("Ready",w),_(E)})})}function ry(q){q.nodes().map((W,_)=>{let L=W.data();L.x=W.position().x,L.y=W.position().y,ol.positionNode(L);let E=os(L.nodeId);Rr.info("Id:",_,"Position: (",W.position().x,", ",W.position().y,")",L),E.attr("transform",`translate(${W.position().x-L.width/2}, ${W.position().y-L.height/2})`),E.attr("attr",`apa-${_})`)})}var ay=async(q,W,_,L)=>{let E=Da();E.htmlLabels=!1,Rr.debug(`Rendering mindmap diagram
2023-06-20 23:34:33 +08:00
`+q,L.parser);let w=Da().securityLevel,A;w==="sandbox"&&(A=sn("#i"+W));let U=(w==="sandbox"?sn(A.nodes()[0].contentDocument.body):sn("body")).select("#"+W);U.append("g");let R=L.db.getMindmap(),J=U.append("g");J.attr("class","mindmap-edges");let D=U.append("g");D.attr("class","mindmap-nodes"),ul(D,R,-1,E);let $=await ty(R,E);ey(J,$),ry($),ju(void 0,U,E.mindmap.padding,E.mindmap.useMaxWidth)},ny={draw:ay},iy=q=>{let W="";for(let _=0;_<q.THEME_COLOR_LIMIT;_++)q["lineColor"+_]=q["lineColor"+_]||q["cScaleInv"+_],Wu(q["lineColor"+_])?q["lineColor"+_]=Ku(q["lineColor"+_],20):q["lineColor"+_]=Zu(q["lineColor"+_],20);for(let _=0;_<q.THEME_COLOR_LIMIT;_++){let L=""+(17-3*_);W+=`
2023-05-27 15:05:48 +08:00
.section-${_-1} rect, .section-${_-1} path, .section-${_-1} circle, .section-${_-1} polygon, .section-${_-1} path {
fill: ${q["cScale"+_]};
}
.section-${_-1} text {
fill: ${q["cScaleLabel"+_]};
}
.node-icon-${_-1} {
font-size: 40px;
color: ${q["cScaleLabel"+_]};
}
.section-edge-${_-1}{
stroke: ${q["cScale"+_]};
}
.edge-depth-${_-1}{
stroke-width: ${L};
}
.section-${_-1} line {
stroke: ${q["cScaleInv"+_]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
2023-06-20 23:34:33 +08:00
`}return W},sy=q=>`
2023-05-27 15:05:48 +08:00
.edge {
stroke-width: 3;
}
2023-06-20 23:34:33 +08:00
${iy(q)}
2023-05-27 15:05:48 +08:00
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${q.git0};
}
.section-root text {
fill: ${q.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.mindmap-node-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
2023-06-20 23:34:33 +08:00
`,oy=sy,py={db:_p,renderer:ny,parser:Ip,styles:oy};export{py as diagram};
2023-05-27 15:05:48 +08:00
/*! Bundled license information:
cytoscape/dist/cytoscape.umd.js:
(*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*)
(*!
Event object based on jQuery events, MIT license
https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*)
(*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
(*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
*/