Closes #329: Draw rectangles around Sites/Locations/Racks (#462)

This commit is contained in:
Mario authored and GitHub committed 2024-03-03 17:52:44 +01:00
1 parent 74c295837c
commit b92b012309
8 files changed
+314 -16

No files matched your search

+1 -1
View File
@@ -50,4 +50,4 @@ class PowerFeedCoordinateSerializer(NetBoxModelSerializer):
class IndividualOptionsSerializer(NetBoxModelSerializer):
class Meta:
model = IndividualOptions
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "draw_default_layout")
fields = ("ignore_cable_type", "save_coords", "show_unconnected", "show_cables", "show_logical_connections", "show_single_cable_logical_conns", "show_neighbors", "show_circuit", "show_power", "show_wireless", "group_sites", "group_locations", "group_racks", "draw_default_layout")
+39 -2
View File
@@ -35,7 +35,8 @@ class DeviceFilterForm(
(None, ('q', 'filter_id', 'tag')),
(_('Options'), (
'group', 'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections',
'show_single_cable_logical_conns', 'show_neighbors', 'show_circuit', 'show_power', 'show_wireless',
'show_single_cable_logical_conns', 'show_neighbors', 'show_circuit', 'show_power', 'show_wireless',
'group_sites', 'group_locations', 'group_racks'
)),
(_('Device'), ('id',)),
(_('Location'), ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id')),
@@ -258,6 +259,15 @@ class DeviceFilterForm(
show_wireless = forms.BooleanField(
label =_('Show Wireless Links'), required=False, initial=False
)
group_sites = forms.BooleanField(
label =_('Group Sites'), required=False, initial=False
)
group_locations = forms.BooleanField(
label =_('Group Locations'), required=False, initial=False
)
group_racks = forms.BooleanField(
label =_('Group Racks'), required=False, initial=False
)
class CoordinateGroupsForm(NetBoxModelForm):
fieldsets = (
@@ -447,6 +457,9 @@ class IndividualOptionsForm(NetBoxModelForm):
'show_circuit',
'show_power',
'show_wireless',
'group_sites',
'group_locations',
'group_racks',
'draw_default_layout',
),
),
@@ -548,6 +561,27 @@ class IndividualOptionsForm(NetBoxModelForm):
help_text=_('Displays wireless connections. These connections are '
'displayed as blue dotted lines.')
)
group_sites = forms.BooleanField(
label =_('Group Sites'),
required=False,
initial=False,
help_text=_('Draws a rectangle around Devices that belong to the '
'same site.')
)
group_locations = forms.BooleanField(
label =_('Group Locations'),
required=False,
initial=False,
help_text=_('Draws a rectangle around Devices that belong to the '
'same location.')
)
group_racks = forms.BooleanField(
label =_('Group Racks'),
required=False,
initial=False,
help_text=_('Draws a rectangle around Devices that belong to the '
'same rack.')
)
draw_default_layout = forms.BooleanField(
label = ('Draw Default Layout'),
required=False,
@@ -559,5 +593,8 @@ class IndividualOptionsForm(NetBoxModelForm):
class Meta:
model = IndividualOptions
fields = [
'user_id', 'ignore_cable_type', 'preselected_device_roles', 'preselected_tags', 'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections', 'show_single_cable_logical_conns', 'show_neighbors', 'show_circuit', 'show_power', 'show_wireless', 'draw_default_layout'
'user_id', 'ignore_cable_type', 'preselected_device_roles', 'preselected_tags',
'save_coords', 'show_unconnected', 'show_cables', 'show_logical_connections',
'show_single_cable_logical_conns', 'show_neighbors', 'show_circuit', 'show_power',
'show_wireless', 'group_sites', 'group_locations', 'group_racks', 'draw_default_layout'
]
@@ -0,0 +1,28 @@
# Generated by Django 4.2.10 on 2024-03-02 16:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('netbox_topology_views', '0006_powerpanelcoordinate_powerfeedcoordinate_and_more'),
]
operations = [
migrations.AddField(
model_name='individualoptions',
name='group_locations',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='individualoptions',
name='group_racks',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='individualoptions',
name='group_sites',
field=models.BooleanField(default=False),
),
]
+9
View File
@@ -374,6 +374,15 @@ class IndividualOptions(NetBoxModel):
show_wireless = models.BooleanField(
default=False
)
group_sites = models.BooleanField(
default=False
)
group_locations = models.BooleanField(
default=False
)
group_racks = models.BooleanField(
default=False
)
draw_default_layout = models.BooleanField(
default=False
)
@@ -1,8 +1,8 @@
(()=>{var bn=Object.create;var Tt=Object.defineProperty,vn=Object.defineProperties,wn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertyNames,ji=Object.getOwnPropertySymbols,xn=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Zt=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,de=(n,e)=>{for(var t in e||(e={}))Wi.call(e,t)&&Zt(n,t,e[t]);if(ji)for(var t of ji(e))Cn.call(e,t)&&Zt(n,t,e[t]);return n},Me=(n,e)=>vn(n,_n(e)),Tn=n=>Tt(n,"__esModule",{value:!0});var kn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var On=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of En(e))!Wi.call(n,i)&&i!=="default"&&Tt(n,i,{get:()=>e[i],enumerable:!(t=wn(e,i))||t.enumerable});return n},Vi=n=>On(Tn(Tt(n!=null?bn(xn(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var Y=(n,e,t)=>(Zt(n,typeof e!="symbol"?e+"":e,t),t);var qi=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var Jt=kn((za,Qt)=>{typeof Qt!="undefined"&&(Qt.exports=te);function te(n){if(n)return Sn(n)}function Sn(n){for(var e in te.prototype)n[e]=te.prototype[e];return n}te.prototype.on=te.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};te.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};te.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};te.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};te.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var Os=Vi(Jt());function he(){return he=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},he.apply(this,arguments)}function oe(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var ei;typeof Object.assign!="function"?ei=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}:ei=Object.assign;var Fe=ei,Ui=["","webkit","Moz","MS","ms","o"],In=typeof document=="undefined"?{style:{}}:document.createElement("div"),Pn="function",Ke=Math.round,Ne=Math.abs,ti=Date.now;function Ot(n,e){for(var t,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<Ui.length;){if(t=Ui[o],i=t?t+s:e,i in n)return i;o++}}var pe;typeof window=="undefined"?pe={}:pe=window;var Yi=Ot(In.style,"touchAction"),Xi=Yi!==void 0;function Dn(){if(!Xi)return!1;var n={},e=pe.CSS&&pe.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?pe.CSS.supports("touch-action",t):!0}),n}var Gi="compute",Ki="auto",ii="manipulation",Be="none",ot="pan-x",nt="pan-y",St=Dn(),Mn=/mobile|tablet|ip(ad|hone|od)|android/i,$i="ontouchstart"in pe,Fn=Ot(pe,"PointerEvent")!==void 0,Nn=$i&&Mn.test(navigator.userAgent),rt="touch",Bn="pen",si="mouse",An="kinect",zn=25,$=1,Ae=2,j=4,J=8,It=1,at=2,dt=4,ht=8,$e=16,ce=at|dt,ze=ht|$e,Zi=ce|ze,Qi=["x","y"],Pt=["clientX","clientY"];function ge(n,e,t){var i;if(!!n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Dt(n,e){return typeof n===Pn?n.apply(e&&e[0]||void 0,e):n}function Re(n,e){return n.indexOf(e)>-1}function Rn(n){if(Re(n,Be))return Be;var e=Re(n,ot),t=Re(n,nt);return e&&t?Be:e||t?e?ot:nt:Re(n,ii)?ii:Ki}var Ji=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Gi&&(i=this.compute()),Xi&&this.manager.element.style&&St[i]&&(this.manager.element.style[Yi]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.coLine truncated
(()=>{var En=Object.create;var Tt=Object.defineProperty,xn=Object.defineProperties,Cn=Object.getOwnPropertyDescriptor,Tn=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertyNames,Wi=Object.getOwnPropertySymbols,On=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable;var Zt=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,he=(n,e)=>{for(var t in e||(e={}))Vi.call(e,t)&&Zt(n,t,e[t]);if(Wi)for(var t of Wi(e))Sn.call(e,t)&&Zt(n,t,e[t]);return n},Fe=(n,e)=>xn(n,Tn(e)),In=n=>Tt(n,"__esModule",{value:!0});var Pn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Mn=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kn(e))!Vi.call(n,i)&&i!=="default"&&Tt(n,i,{get:()=>e[i],enumerable:!(t=Cn(e,i))||t.enumerable});return n},qi=n=>Mn(In(Tt(n!=null?En(On(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var X=(n,e,t)=>(Zt(n,typeof e!="symbol"?e+"":e,t),t);var Ui=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var Jt=Pn((ja,Qt)=>{typeof Qt!="undefined"&&(Qt.exports=te);function te(n){if(n)return Dn(n)}function Dn(n){for(var e in te.prototype)n[e]=te.prototype[e];return n}te.prototype.on=te.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};te.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};te.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};te.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};te.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var Ss=qi(Jt());function le(){return le=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},le.apply(this,arguments)}function oe(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var ei;typeof Object.assign!="function"?ei=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}:ei=Object.assign;var Ne=ei,Yi=["","webkit","Moz","MS","ms","o"],Fn=typeof document=="undefined"?{style:{}}:document.createElement("div"),Nn="function",Ke=Math.round,Be=Math.abs,ti=Date.now;function Ot(n,e){for(var t,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<Yi.length;){if(t=Yi[o],i=t?t+s:e,i in n)return i;o++}}var ge;typeof window=="undefined"?ge={}:ge=window;var Xi=Ot(Fn.style,"touchAction"),Gi=Xi!==void 0;function Bn(){if(!Gi)return!1;var n={},e=ge.CSS&&ge.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?ge.CSS.supports("touch-action",t):!0}),n}var Ki="compute",$i="auto",ii="manipulation",Ae="none",ot="pan-x",nt="pan-y",St=Bn(),An=/mobile|tablet|ip(ad|hone|od)|android/i,Zi="ontouchstart"in ge,zn=Ot(ge,"PointerEvent")!==void 0,Rn=Zi&&An.test(navigator.userAgent),rt="touch",Ln="pen",si="mouse",Hn="kinect",jn=25,$=1,ze=2,W=4,J=8,It=1,at=2,dt=4,ht=8,$e=16,ue=at|dt,Re=ht|$e,Qi=ue|Re,Ji=["x","y"],Pt=["clientX","clientY"];function me(n,e,t){var i;if(!!n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Mt(n,e){return typeof n===Nn?n.apply(e&&e[0]||void 0,e):n}function Le(n,e){return n.indexOf(e)>-1}function Wn(n){if(Le(n,Ae))return Ae;var e=Le(n,ot),t=Le(n,nt);return e&&t?Ae:e||t?e?ot:nt:Le(n,ii)?ii:$i}var es=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Ki&&(i=this.compute()),Gi&&this.manager.element.style&&St[i]&&(this.manager.element.style[Xi]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.coLine truncated
`+t+` AT
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var xs=Es(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),ur=Es(function(n,e){return xs(n,e,!0)},"merge","Use `assign`.");function fr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Fe(s,t)}function Cs(n,e){return function(){return n.apply(e,arguments)}}var Ts=function(){var n=function(t,i){return i===void 0&&(i={}),new _s(t,he({recognizers:bs.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=Zi,n.DIRECTION_DOWN=$e,n.DIRECTION_LEFT=at,n.DIRECTION_RIGHT=dt,n.DIRECTION_UP=ht,n.DIRECTION_HORIZONTAL=ce,n.DIRECTION_VERTICAL=ze,n.DIRECTION_NONE=It,n.DIRECTION_DOWN=$e,n.INPUT_START=$,n.INPUT_MOVE=Ae,n.INPUT_END=j,n.INPUT_CANCEL=J,n.STATE_POSSIBLE=Ft,n.STATE_BEGAN=ne,n.STATE_CHANGED=Je,n.STATE_ENDED=Te,n.STATE_RECOGNIZED=me,n.STATE_CANCELLED=pt,n.STATE_FAILED=ue,n.Manager=_s,n.Input=Ze,n.TouchAction=Ji,n.TouchInput=ai,n.MouseInput=di,n.PointerEventInput=as,n.TouchMouseInput=ls,n.SingleTouchInput=lr,n.Recognizer=gt,n.AttrRecognizer=et,n.Tap=hi,n.Pan=li,n.Swipe=fs,n.Pinch=ps,n.Rotate=gs,n.Press=ms,n.on=ct,n.off=ut,n.each=ge,n.merge=ur,n.extend=xs,n.bindFn=Cs,n.assign=Fe,n.inherit=fr,n.bindFn=Cs,n.prefixed=Ot,n.toArray=ft,n.inArray=Le,n.uniqueArray=ri,n.splitStr=lt,n.boolOrFn=Dt,n.hasParent=oi,n.addEventListeners=ct,n.removeEventListeners=ut,n.defaults=Fe({},ys,{preset:bs}),n}(),Ra=Ts.defaults,ks=Ts;var ci=Symbol("DELETE");function Ss(n,...e){return Is({},n,...e)}function Is(...n){let e=Bt(...n);return Ds(e),e}function Bt(...n){if(n.length<2)return n[0];if(n.length>2)return Bt(Is(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===ci?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=Bt(e[i],t[i]):e[i]=Ps(t[i]));return e}function Ps(n){return Array.isArray(n)?n.map(e=>Ps(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Bt({},n):n}function Ds(n){for(let e of Object.keys(n))n[e]===ci?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ds(n[e])}function mt(...n){return pr(n.length?n:[Date.now()])}function pr(n){let[e,t,i]=gr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function gr(...n){let e=mr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function mr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function yr(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var ui=typeof window!="undefined"?window.Hammer||ks:function(){return yr()};function fe(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=ui(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{br(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Os.default)(fe.prototype);fe.current=null;fe.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};fe.prototype.activate=function(){fe.current&&fe.current.deactivate(),fe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};fe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};fe.prototy Line truncated
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var Cs=xs(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),mr=xs(function(n,e){return Cs(n,e,!0)},"merge","Use `assign`.");function yr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Ne(s,t)}function Ts(n,e){return function(){return n.apply(e,arguments)}}var ks=function(){var n=function(t,i){return i===void 0&&(i={}),new Es(t,le({recognizers:vs.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=Qi,n.DIRECTION_DOWN=$e,n.DIRECTION_LEFT=at,n.DIRECTION_RIGHT=dt,n.DIRECTION_UP=ht,n.DIRECTION_HORIZONTAL=ue,n.DIRECTION_VERTICAL=Re,n.DIRECTION_NONE=It,n.DIRECTION_DOWN=$e,n.INPUT_START=$,n.INPUT_MOVE=ze,n.INPUT_END=W,n.INPUT_CANCEL=J,n.STATE_POSSIBLE=Ft,n.STATE_BEGAN=ne,n.STATE_CHANGED=Je,n.STATE_ENDED=ke,n.STATE_RECOGNIZED=ye,n.STATE_CANCELLED=pt,n.STATE_FAILED=fe,n.Manager=Es,n.Input=Ze,n.TouchAction=es,n.TouchInput=ai,n.MouseInput=di,n.PointerEventInput=ds,n.TouchMouseInput=cs,n.SingleTouchInput=pr,n.Recognizer=gt,n.AttrRecognizer=et,n.Tap=hi,n.Pan=li,n.Swipe=ps,n.Pinch=gs,n.Rotate=ms,n.Press=ys,n.on=ct,n.off=ut,n.each=me,n.merge=mr,n.extend=Cs,n.bindFn=Ts,n.assign=Ne,n.inherit=yr,n.bindFn=Ts,n.prefixed=Ot,n.toArray=ft,n.inArray=He,n.uniqueArray=ri,n.splitStr=lt,n.boolOrFn=Mt,n.hasParent=oi,n.addEventListeners=ct,n.removeEventListeners=ut,n.defaults=Ne({},bs,{preset:vs}),n}(),Wa=ks.defaults,Os=ks;var ci=Symbol("DELETE");function Is(n,...e){return Ps({},n,...e)}function Ps(...n){let e=Bt(...n);return Ds(e),e}function Bt(...n){if(n.length<2)return n[0];if(n.length>2)return Bt(Ps(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===ci?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=Bt(e[i],t[i]):e[i]=Ms(t[i]));return e}function Ms(n){return Array.isArray(n)?n.map(e=>Ms(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Bt({},n):n}function Ds(n){for(let e of Object.keys(n))n[e]===ci?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ds(n[e])}function mt(...n){return br(n.length?n:[Date.now()])}function br(n){let[e,t,i]=vr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function vr(...n){let e=wr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function wr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function _r(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var ui=typeof window!="undefined"?window.Hammer||Os:function(){return _r()};function pe(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=ui(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{Er(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Ss.default)(pe.prototype);pe.current=null;pe.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};pe.prototype.activate=function(){pe.current&&pe.current.deactivate(),pe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};pe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};pe.prototy Line truncated
`:o.distance<=a&&s.distance>o.distance?d=" in "+R.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+R.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+R.printLocation(s.path,e):d=". Did you mean one of these: "+R.print(Object.keys(t))+R.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,mi),vt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=R.findInOptions(e,t[l],At(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=R.levenshteinDistance(e,l),o>c&&(r=l,a=xr(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
`:o.distance<=a&&s.distance>o.distance?d=" in "+L.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+L.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+L.printLocation(s.path,e):d=". Did you mean one of these: "+L.print(Object.keys(t))+L.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,mi),vt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=L.findInOptions(e,t[l],At(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=L.levenshteinDistance(e,l),o>c&&(r=l,a=Or(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
`){let s=`
`+i+`options = {
@@ -11,16 +11,16 @@
`;for(let o=0;o<e.length+1;o++){for(let r=0;r<e.length-o;r++)s+=" ";s+=`}
`}return s+`
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},Hs=fe;var js=Sr,We=ui,Ws=Ir,yi=mi,Vs=Pr;var Ht,Dr=new Uint8Array(16);function bi(){if(!Ht&&(Ht=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Dr)}var qs=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Mr(n){return typeof n=="string"&&qs.test(n)}var Us=Mr;var q=[];for(jt=0;jt<256;++jt)q.push((jt+256).toString(16).substr(1));var jt;function Fr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(q[n[e+0]]+q[n[e+1]]+q[n[e+2]]+q[n[e+3]]+"-"+q[n[e+4]]+q[n[e+5]]+"-"+q[n[e+6]]+q[n[e+7]]+"-"+q[n[e+8]]+q[n[e+9]]+"-"+q[n[e+10]]+q[n[e+11]]+q[n[e+12]]+q[n[e+13]]+q[n[e+14]]+q[n[e+15]]).toLowerCase();if(!Us(t))throw TypeError("Stringified UUID is invalid");return t}var Ys=Fr;function Nr(n,e,t){n=n||{};var i=n.random||(n.rng||bi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return Ys(i)}var _e=Nr;function Xs(n){return typeof n=="string"||typeof n=="number"}var Wt=class{constructor(e){Y(this,"delay");Y(this,"max");Y(this,"_queue",[]);Y(this,"_timeout",null);Y(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Wt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},wt=class{constructor(){Y(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});Y(this,"subscribe",wt.prototype.on);Y(this,"unsubscribe",wt.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},ke=class{constructor(e){Y(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new ke([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new ke({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new ke({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of Line truncated
`||P==="\r";)V();do{var n=!1;if(P==="#"){for(var e=tt-1;Oe.charAt(e)===" "||Oe.charAt(e)===" ";)e--;if(Oe.charAt(e)===`
`||Oe.charAt(e)===""){for(;P!=""&&P!=`
`;)V();n=!0}}if(P==="/"&&it()==="/"){for(;P!=""&&P!=`
`;)V();n=!0}if(P==="/"&&it()==="*"){for(;P!="";)if(P==="*"&&it()==="/"){V(),V();break}else V();n=!0}for(;P===" "||P===" "||P===`
`||P==="\r";)V()}while(n);if(P===""){ee=Z.DELIMITER;return}var t=P+it();if(eo[t]){ee=Z.DELIMITER,k=t,V(),V();return}if(eo[P]){ee=Z.DELIMITER,k=P,V();return}if(to(P)||P==="-"){for(k+=P,V();to(P);)k+=P,V();k==="false"?k=!1:k==="true"?k=!0:isNaN(Number(k))||(k=Number(k)),ee=Z.IDENTIFIER;return}if(P==='"'){for(V();P!=""&&(P!='"'||P==='"'&&it()==='"');)P==='"'?(k+=P,V()):P==="\\"&&it()==="n"?(k+=`
`,V()):k+=P,V();if(P!='"')throw Q('End of string " expected');V(),ee=Z.IDENTIFIER;return}for(ee=Z.UNKNOWN;P!="";)k+=P,V();throw new SyntaxError('Syntax error in part "'+ao(k,30)+'"')}function Gr(){var n={};if(Ur(),N(),k==="strict"&&(n.strict=!0,N()),(k==="graph"||k==="digraph")&&(n.type=k,N()),ee===Z.IDENTIFIER&&(n.id=k,N()),k!="{")throw Q("Angle bracket { expected");if(N(),oo(n),k!="}")throw Q("Angle bracket } expected");if(N(),k!=="")throw Q("End of file expected");return N(),delete n.node,delete n.edge,delete n.graph,n}function oo(n){for(;k!==""&&k!="}";)Kr(n),k===";"&&N()}function Kr(n){var e=no(n);if(e){ro(n,e);return}var t=$r(n);if(!t){if(ee!=Z.IDENTIFIER)throw Q("Identifier expected");var i=k;if(N(),k==="="){if(N(),ee!=Z.IDENTIFIER)throw Q("Identifier expected");n[i]=k,N()}else Zr(n,i)}}function no(n){var e=null;if(k==="subgraph"&&(e={},e.type="subgraph",N(),ee===Z.IDENTIFIER&&(e.id=k,N())),k==="{"){if(N(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,oo(e),k!="}")throw Q("Angle bracket } expected");N(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function $r(n){return k==="node"?(N(),n.node=_t(),"node"):k==="edge"?(N(),n.edge=_t(),"edge"):k==="graph"?(N(),n.graph=_t(),"graph"):null}function Zr(n,e){var t={id:e},i=_t();i&&(t.attr=i),io(n,t),ro(n,e)}function ro(n,e){for(;k==="->"||k==="--";){var t,i=k;N();var s=no(n);if(s)t=s;else{if(ee!=Z.IDENTIFIER)throw Q("Identifier or subgraph expected");t=k,io(n,{id:t}),N()}var o=_t(),r=so(n,e,t,i,o);Xr(n,r),e=t}}function _t(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;k==="[";){for(N(),e={};k!==""&&k!="]";){if(ee!=Z.IDENTIFIER)throw Q("Attribute name expected");var r=k;if(N(),k!="=")throw Q("Equal sign = expected");if(N(),ee!=Z.IDENTIFIER)throw Q("Attribute value expected");var a=k;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),N(),k==","&&N()}if(k!="]")throw Q("Bracket ] expected");N()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw Q("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw Q('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,s[f]={attr:s[f].attr,name:s[f].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.a Line truncated
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},js=pe;var Ws=Dr,Ve=ui,Vs=Fr,yi=mi,qs=Nr;var Ht,Br=new Uint8Array(16);function bi(){if(!Ht&&(Ht=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Br)}var Us=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ar(n){return typeof n=="string"&&Us.test(n)}var Ys=Ar;var U=[];for(jt=0;jt<256;++jt)U.push((jt+256).toString(16).substr(1));var jt;function zr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(U[n[e+0]]+U[n[e+1]]+U[n[e+2]]+U[n[e+3]]+"-"+U[n[e+4]]+U[n[e+5]]+"-"+U[n[e+6]]+U[n[e+7]]+"-"+U[n[e+8]]+U[n[e+9]]+"-"+U[n[e+10]]+U[n[e+11]]+U[n[e+12]]+U[n[e+13]]+U[n[e+14]]+U[n[e+15]]).toLowerCase();if(!Ys(t))throw TypeError("Stringified UUID is invalid");return t}var Xs=zr;function Rr(n,e,t){n=n||{};var i=n.random||(n.rng||bi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return Xs(i)}var Ee=Rr;function Gs(n){return typeof n=="string"||typeof n=="number"}var Wt=class{constructor(e){X(this,"delay");X(this,"max");X(this,"_queue",[]);X(this,"_timeout",null);X(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Wt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},wt=class{constructor(){X(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});X(this,"subscribe",wt.prototype.on);X(this,"unsubscribe",wt.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},Oe=class{constructor(e){X(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new Oe([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new Oe({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new Oe({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of Line truncated
`||P==="\r";)q();do{var n=!1;if(P==="#"){for(var e=tt-1;Se.charAt(e)===" "||Se.charAt(e)===" ";)e--;if(Se.charAt(e)===`
`||Se.charAt(e)===""){for(;P!=""&&P!=`
`;)q();n=!0}}if(P==="/"&&it()==="/"){for(;P!=""&&P!=`
`;)q();n=!0}if(P==="/"&&it()==="*"){for(;P!="";)if(P==="*"&&it()==="/"){q(),q();break}else q();n=!0}for(;P===" "||P===" "||P===`
`||P==="\r";)q()}while(n);if(P===""){ee=Z.DELIMITER;return}var t=P+it();if(to[t]){ee=Z.DELIMITER,k=t,q(),q();return}if(to[P]){ee=Z.DELIMITER,k=P,q();return}if(io(P)||P==="-"){for(k+=P,q();io(P);)k+=P,q();k==="false"?k=!1:k==="true"?k=!0:isNaN(Number(k))||(k=Number(k)),ee=Z.IDENTIFIER;return}if(P==='"'){for(q();P!=""&&(P!='"'||P==='"'&&it()==='"');)P==='"'?(k+=P,q()):P==="\\"&&it()==="n"?(k+=`
`,q()):k+=P,q();if(P!='"')throw Q('End of string " expected');q(),ee=Z.IDENTIFIER;return}for(ee=Z.UNKNOWN;P!="";)k+=P,q();throw new SyntaxError('Syntax error in part "'+ho(k,30)+'"')}function Qr(){var n={};if(Kr(),B(),k==="strict"&&(n.strict=!0,B()),(k==="graph"||k==="digraph")&&(n.type=k,B()),ee===Z.IDENTIFIER&&(n.id=k,B()),k!="{")throw Q("Angle bracket { expected");if(B(),no(n),k!="}")throw Q("Angle bracket } expected");if(B(),k!=="")throw Q("End of file expected");return B(),delete n.node,delete n.edge,delete n.graph,n}function no(n){for(;k!==""&&k!="}";)Jr(n),k===";"&&B()}function Jr(n){var e=ro(n);if(e){ao(n,e);return}var t=ea(n);if(!t){if(ee!=Z.IDENTIFIER)throw Q("Identifier expected");var i=k;if(B(),k==="="){if(B(),ee!=Z.IDENTIFIER)throw Q("Identifier expected");n[i]=k,B()}else ta(n,i)}}function ro(n){var e=null;if(k==="subgraph"&&(e={},e.type="subgraph",B(),ee===Z.IDENTIFIER&&(e.id=k,B())),k==="{"){if(B(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,no(e),k!="}")throw Q("Angle bracket } expected");B(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function ea(n){return k==="node"?(B(),n.node=_t(),"node"):k==="edge"?(B(),n.edge=_t(),"edge"):k==="graph"?(B(),n.graph=_t(),"graph"):null}function ta(n,e){var t={id:e},i=_t();i&&(t.attr=i),so(n,t),ao(n,e)}function ao(n,e){for(;k==="->"||k==="--";){var t,i=k;B();var s=ro(n);if(s)t=s;else{if(ee!=Z.IDENTIFIER)throw Q("Identifier or subgraph expected");t=k,so(n,{id:t}),B()}var o=_t(),r=oo(n,e,t,i,o);Zr(n,r),e=t}}function _t(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;k==="[";){for(B(),e={};k!==""&&k!="]";){if(ee!=Z.IDENTIFIER)throw Q("Attribute name expected");var r=k;if(B(),k!="=")throw Q("Equal sign = expected");if(B(),ee!=Z.IDENTIFIER)throw Q("Attribute value expected");var a=k;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),B(),k==","&&B()}if(k!="]")throw Q("Bracket ] expected");B()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw Q("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw Q('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,s[f]={attr:s[f].attr,name:s[f].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.a Line truncated
`),e=e.replace(/\r/g,`
`);let i=String(e).split(`
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new ki(e),i=s=>/&/.test(s)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new ki(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Ut=["bold","ital","boldital","mono"],Ve=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),qt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(I(Ut,t=>{this.fontOptions[t]={}}),Ve.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}I(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=we(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=we(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=we(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=we(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=we(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=we(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),D(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ci("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};Ve.parseFontString(o,s)&&(s=o),I(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ut.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0; Line truncated
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new ki(e),i=s=>/&/.test(s)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new ki(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Ut=["bold","ital","boldital","mono"],qe=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),qt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(I(Ut,t=>{this.fontOptions[t]={}}),qe.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}I(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=_e(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=_e(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=_e(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=_e(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=_e(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=_e(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),D(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ci("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};qe.parseFontString(o,s)&&(s=o),I(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ut.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0; Line truncated
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
+188
View File
@@ -42,6 +42,11 @@ const csrftoken = getCookie('csrftoken')
// Render vis graph
let graph = null // vis graph instance
let searchParams = new URLSearchParams(window.location.search)
let group_sites = searchParams.get('group_sites')
let group_locations = searchParams.get('group_locations')
let group_racks = searchParams.get('group_racks')
const container = document.querySelector('#visgraph')
const coordSaveCheckbox = document.querySelector('#id_save_coords')
;(function handleLoadData() {
@@ -133,6 +138,189 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
})
}
})
graph.on('afterDrawing', (canvascontext) => {
allRectangles = [];
if(group_sites != null && group_sites == 'on') { drawGroupRectangles(canvascontext, groupedNodeSites, siteRectParams); }
if(group_locations != null && group_locations == 'on') { drawGroupRectangles(canvascontext, groupedNodeLocations, locationRectParams); }
if(group_racks != null && group_racks == 'on') { drawGroupRectangles(canvascontext, groupedNodeRacks, rackRectParams); }
})
graph.on('click', (canvascontext) => {
allRectangles.forEach(key => {
// Is the mouse pointer inside of the current rectangle?
if(canvascontext.pointer.canvas.x > (key.x1 - key.border / 2 - 1) && canvascontext.pointer.canvas.x < (key.x2 + key.border / 2 + 1)
&& canvascontext.pointer.canvas.y > (key.y1 - key.border / 2 - 1) && canvascontext.pointer.canvas.y < (key.y2 + key.border / 2 + 1)) {
// We just want to react when the border has been clicked, not the whole rectangle
if (canvascontext.pointer.canvas.x < (key.x1 + key.border / 2 + 1) || canvascontext.pointer.canvas.x > (key.x2 - key.border / 2 - 1)
|| canvascontext.pointer.canvas.y < (key.y1 + key.border / 2 + 1) || canvascontext.pointer.canvas.y > (key.y2 - key.border / 2 - 1)) {
// Generate an array of affected nodes in order to pass it to the select.Nodes() function
let arr = [];
if(key.category == "Site") {
groupedNodeSites.forEach(subArray => {
subArray.forEach(element => {
if (element[1] == key.id) {
arr.push(element[0]);
}
});
});
}
if(key.category == "Location") {
groupedNodeLocations.forEach(subArray => {
subArray.forEach(element => {
if (element[1] === key.id) {
arr.push(element[0]);
}
});
});
}
if(key.category == "Rack") {
groupedNodeRacks.forEach(subArray => {
subArray.forEach(element => {
if (element[1] === key.id) {
arr.push(element[0]);
}
});
});
}
graph.selectNodes(arr);
}
}
});
})
// Add information on which node belongs to which group (site/location/rack).
// Create an array for each group in order to loop through that arrays later
function combineNodeInfo(typeId, type) {
let nodesArray = [];
// Extract node ids and node type ids from all nodes
for (let [key, value] of nodes._data) {
if (value[typeId] != undefined) {
nodesArray.push([value.id, value[typeId], value[type]]);
}
}
// Split single array above into arrays grouped by node id
let groupedNodeArray = nodesArray.reduce((acc, value) => {
let key = value[1]; // node id
acc[key] = acc[key] || [];
acc[key].push(value);
return acc;
}, {});
return Object.values(groupedNodeArray);
}
var allRectangles = [];
/* Draw a single rectangle with given parameters
rectangle expects an object that consists of the following keys:
ctx: canvas context on which the rectangle should be drawn
x: x-coordinate of top left point of the rectangle
y: y-coordinate of top left point of the rectangle
width: width of rectangle
height: height of rectangle
lineWidth: border width
color: border color
text: a string to be placed where you want it to be
textPaddingX: x-position of the text
textPaddingY: y-position of the text
font: text font */
function drawGroupRectangle(rectangle) {
// Draw rectangle
rectangle.ctx.beginPath();
rectangle.ctx.lineWidth = rectangle.lineWidth;
rectangle.ctx.strokeStyle = rectangle.color;
rectangle.ctx.rect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
rectangle.ctx.stroke();
// Draw text
rectangle.ctx.font = rectangle.font;
rectangle.ctx.fillStyle = rectangle.color;
rectangle.ctx.fillText(rectangle.text, rectangle.x + rectangle.textPaddingX, rectangle.y + rectangle.textPaddingY);
allRectangles.push({category: rectangle.category, id: rectangle.id, x1: rectangle.x, y1: rectangle.y, x2: rectangle.x + rectangle.width, y2: rectangle.y + rectangle.height, border: rectangle.lineWidth})
}
/* Draw all rectangles of a given group (site/location/rack)
rectParams expects an object that consists of the following keys:
lineWidth: border width (string)
color: border color (string)
paddingX: rectangle x-padding, calculated from the center of a node (int)
paddingY: rectangle y-padding, calculated from the center of a node (int)
textPaddingX: text x-padding, calculated from the lower left point of the text (int)
textPaddingY: text y-padding, calculated from the lower left point of the text (int)
font: css-like font size and font (string) */
function drawGroupRectangles(canvascontext, groupedNodes, rectParams) {
for(let value of Object.entries(groupedNodes)) {
const rectangles = [];
const xValues = [];
const yValues = [];
for(let val of value[1]) {
xValues.push(graph.getPosition(val[0]).x);
yValues.push(graph.getPosition(val[0]).y);
}
const rectX = Math.min(...xValues) - rectParams.paddingX;
const rectY = Math.min(...yValues) - rectParams.paddingY;
const rectSizeX = Math.max(...xValues) - Math.min(...xValues) + 2*rectParams.paddingX;
const rectSizeY = Math.max(...yValues) - Math.min(...yValues) + 2*rectParams.paddingY;
rectangles.push({
ctx: canvascontext,
x: rectX,
y: rectY,
width: rectSizeX,
height: rectSizeY,
lineWidth: rectParams.lineWidth,
color: rectParams.color,
text: value[1][0][2],
textPaddingX: rectParams.textPaddingX,
textPaddingY: rectParams.textPaddingY,
font: rectParams.font,
id: value[1][0][1],
category: rectParams.category
});
rectangles.forEach(function(rectangle) {
drawGroupRectangle(rectangle);
});
}
}
let groupedNodeSites = combineNodeInfo('site_id', 'site');
let siteRectParams = {
lineWidth: "5",
color: "red",
paddingX: 84,
paddingY: 84,
textPaddingX: 8,
textPaddingY: -8,
font: "14px helvetica",
category: "Site"
}
let groupedNodeLocations = combineNodeInfo('location_id', 'location');
let locationRectParams = {
lineWidth: "5",
color: "yellow",
paddingX: 77,
paddingY: 77,
textPaddingX: 12,
textPaddingY: 22,
font: "14px helvetica",
category: "Location"
}
let groupedNodeRacks = combineNodeInfo('rack_id', 'rack');
let rackRectParams = {
lineWidth: "5",
color: "green",
paddingX: 70,
paddingY: 70,
textPaddingX: 8,
textPaddingY: 30,
font: "14px helvetica",
category: "Rack"
}
})()
// Download Graph
+16 -1
View File
@@ -154,12 +154,27 @@ def get_query_settings(request):
if request.GET["show_wireless"] == "on" :
show_wireless = True
group_sites = False
if "group_sites" in request.GET:
if request.GET["group_sites"] == "on" :
group_sites = True
group_locations = False
if "group_locations" in request.GET:
if request.GET["group_locations"] == "on" :
group_locations = True
group_racks = False
if "group_racks" in request.GET:
if request.GET["group_racks"] == "on" :
group_racks = True
show_neighbors = False
if "show_neighbors" in request.GET:
if request.GET["show_neighbors"] == "on" :
show_neighbors = True
return save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, show_neighbors
return save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors
class LinePattern():
wireless = [2, 10, 2, 10]
+22 -1
View File
@@ -220,6 +220,15 @@ def create_node(
node["shape"] = "image"
node["href"] = device.get_absolute_url()
node["image"] = get_image_for_entity(device)
if device.site is not None:
node["site"] = device.site.name
node["site_id"] = device.site_id
if device.location is not None:
node["location"] = device.location.name
node["location_id"] = device.location_id
if device.rack is not None:
node["rack"] = device.rack.name
node["rack_id"] = device.rack_id
return node
@@ -325,6 +334,9 @@ def get_topology_data(
show_neighbors: bool,
show_power: bool,
show_wireless: bool,
group_sites: bool,
group_locations: bool,
group_racks: bool,
group_id,
):
@@ -688,7 +700,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if request.GET:
save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, show_neighbors = get_query_settings(request)
save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors = get_query_settings(request)
if "group" not in request.GET:
group_id = "default"
@@ -708,6 +720,9 @@ class TopologyHomeView(PermissionRequiredMixin, View):
show_circuit=show_circuit,
show_power=show_power,
show_wireless=show_wireless,
group_sites=group_sites,
group_locations=group_locations,
group_racks=group_racks,
group_id=group_id,
)
@@ -729,6 +744,9 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if individualOptions.show_circuit: q['show_circuit'] = "on"
if individualOptions.show_power: q['show_power'] = "on"
if individualOptions.show_wireless: q['show_wireless'] = "on"
if individualOptions.group_sites: q['group_sites'] = "on"
if individualOptions.group_locations: q['group_locations'] = "on"
if individualOptions.group_racks: q['group_racks'] = "on"
if individualOptions.draw_default_layout:
q['draw_init'] = "true"
else:
@@ -1083,6 +1101,9 @@ class TopologyIndividualOptionsView(PermissionRequiredMixin, View):
'show_circuit': queryset.show_circuit,
'show_power': queryset.show_power,
'show_wireless': queryset.show_wireless,
'group_sites': queryset.group_sites,
'group_locations': queryset.group_locations,
'group_racks': queryset.group_racks,
'draw_default_layout': queryset.draw_default_layout,
},
)