import{m as e}from"./vendor-neo4j-ndl.llONqzcp.js";import{r as t}from"./src.C2QtqZAY.js";import{i as n}from"./chunk-S3R3BYOJ.3nT_0yWZ.js";import{n as r,r as i}from"./src.9BtR1lKk.js";import{I as a,N as o,O as s,s as c,y as l}from"./chunk-ABZYJK2D.uCd1vXgI.js";var u=Object.freeze({left:0,top:0,width:16,height:16}),d=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),f=Object.freeze({...u,...d}),p=Object.freeze({...f,body:``,hidden:!1}),m=Object.freeze({width:null,height:null}),h=Object.freeze({...m,...d}),g=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!_(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!_(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!_(e,n)?null:e}return null},_=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function v(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function y(e,t){let n=v(e,t);for(let r in p)r in d?r in e&&!(r in n)&&(n[r]=d[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ee(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function b(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=y(r[e]||i[e],a)}return o(t),n.forEach(o),y(e,a)}function te(e,t){if(e.icons[t])return b(e,t,[]);let n=ee(e,[t])[t];return n?b(e,t,n):null}var x=/(-?[0-9.]*[0-9]+[0-9.]*)/g,S=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function C(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(x);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=S.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ne(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function w(e,t){return e?`<defs>`+e+`</defs>`+t:t}function T(e,t,n){let r=ne(e);return w(r.defs,t+r.content+n)}var E=e=>e===`unset`||e===`undefined`||e===`none`;function D(e,t){let n={...f,...e},r={...h,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=T(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=C(d,c/l)):(u=o===`auto`?c:o,d=s===null?C(u,l/c):s===`auto`?l:s);let p={},m=(e,t)=>{E(t)||(p[e]=t.toString())};m(`width`,u),m(`height`,d);let g=[i.left,i.top,c,l];return p.viewBox=g.join(` `),{attributes:p,viewBox:g,body:a}}var O=/\sid="(\S+)"/g,k=new Map;function re(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=k.get(e)||0;return k.set(e,t+1),t?`${e}${t}`:e}function ie(e){let t=[],n;for(;n=O.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=re(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function ae(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function A(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
[	 ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
`)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
`)&&(o=String(e).split(`
`).map(function(e,t){return t===0?e:``+i+e}).join(`
`)),a+=o+n[t+1]}),a}var j={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},M=new Map,N=new Map,P=r(e=>{for(let t of e){if(!t.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(i.debug(`Registering icon pack:`,t.name),`loader`in t)N.set(t.name,t.loader);else if(`icons`in t)M.set(t.name,t.icons);else throw i.error(`Invalid icon loader:`,t),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),F=r(async(e,t)=>{let n=g(e,!0,t!==void 0);if(!n)throw Error(`Invalid icon name: ${e}`);let r=n.prefix||t;if(!r)throw Error(`Icon name must contain a prefix: ${e}`);let a=M.get(r);if(!a){let e=N.get(r);if(!e)throw Error(`Icon set not found: ${n.prefix}`);try{a={...await e(),prefix:r},M.set(r,a)}catch(e){throw i.error(e),Error(`Failed to load icon set: ${n.prefix}`)}}let o=te(a,n.name);if(!o)throw Error(`Icon not found: ${e}`);return o},`getRegisteredIconData`),I=r(async e=>{try{return await F(e),!0}catch{return!1}},`isIconAvailable`),L=r(async(e,t,n)=>{let r;try{r=await F(e,t?.fallbackPrefix)}catch(e){i.error(e),r=j}let o=D(r,t);return a(ae(ie(o.body),{...o.attributes,...n}),l())},`getIconSVG`);function R(e,{markdownAutoWrap:t}){let n=A(e.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`));return t===!1?n.replace(/ /g,`&nbsp;`):n}r(R,`preprocessMarkdown`);function z(t,n={}){let i=R(t,n),a=e.lexer(i),o=[[]],s=0;function c(e,t=`normal`){e.type===`text`?e.text.split(`
`).forEach((e,n)=>{n!==0&&(s++,o.push([])),e.split(` `).forEach(e=>{e=e.replace(/&#39;/g,`'`),e&&o[s].push({content:e,type:t})})}):e.type===`strong`||e.type===`em`?e.tokens.forEach(t=>{c(t,e.type)}):e.type===`html`&&o[s].push({content:e.text,type:`normal`})}return r(c,`processNode`),a.forEach(e=>{e.type===`paragraph`?e.tokens?.forEach(e=>{c(e)}):e.type===`html`?o[s].push({content:e.text,type:`normal`}):o[s].push({content:e.raw,type:`normal`})}),o}r(z,`markdownToLines`);function B(t,{markdownAutoWrap:n}={}){let a=e.lexer(t);function o(e){return e.type===`text`?n===!1?e.text.replace(/\n */g,`<br/>`).replace(/ /g,`&nbsp;`):e.text.replace(/\n */g,`<br/>`):e.type===`strong`?`<strong>${e.tokens?.map(o).join(``)}</strong>`:e.type===`em`?`<em>${e.tokens?.map(o).join(``)}</em>`:e.type===`paragraph`?`<p>${e.tokens?.map(o).join(``)}</p>`:e.type===`space`?``:e.type===`html`?`${e.text}`:e.type===`escape`?e.text:(i.warn(`Unsupported markdown: ${e.type}`),e.raw)}return r(o,`output`),a.map(o).join(``)}r(B,`markdownToHTML`);function V(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(e=>e.segment):[...e]}r(V,`splitTextToChars`);function H(e,t){return U(e,[],V(t.content),t.type)}r(H,`splitWordToFitWidth`);function U(e,t,n,r){if(n.length===0)return[{content:t.join(``),type:r},{content:``,type:r}];let[i,...a]=n,o=[...t,i];return e([{content:o.join(``),type:r}])?U(e,o,a,r):(t.length===0&&i&&(t.push(i),n.shift()),[{content:t.join(``),type:r},{content:n.join(``),type:r}])}r(U,`splitWordToFitWidthRecursion`);function W(e,t){if(e.some(({content:e})=>e.includes(`
`)))throw Error(`splitLineToFitWidth does not support newlines in the line`);return G(e,t)}r(W,`splitLineToFitWidth`);function G(e,t,n=[],r=[]){if(e.length===0)return r.length>0&&n.push(r),n.length>0?n:[];let i=``;e[0].content===` `&&(i=` `,e.shift());let a=e.shift()??{content:` `,type:`normal`},o=[...r];if(i!==``&&o.push({content:i,type:`normal`}),o.push(a),t(o))return G(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){let[r,i]=H(t,a);n.push([r]),i.content&&e.unshift(i)}return G(e,t,n)}r(G,`splitLineToFitWidthRecursion`);function K(e,t){t&&e.attr(`style`,t)}r(K,`applyStyle`);async function q(e,t,n,r,i=!1,u=l()){let d=e.append(`foreignObject`);d.attr(`width`,`${10*n}px`),d.attr(`height`,`${10*n}px`);let f=d.append(`xhtml:div`),p=s(t.label)?await o(t.label.replace(c.lineBreakRegex,`
`),u):a(t.label,u),m=t.isNode?`nodeLabel`:`edgeLabel`,h=f.append(`span`);h.html(p),K(h,t.labelStyle),h.attr(`class`,`${m} ${r}`),K(f,t.labelStyle),f.style(`display`,`table-cell`),f.style(`white-space`,`nowrap`),f.style(`line-height`,`1.5`),f.style(`max-width`,n+`px`),f.style(`text-align`,`center`),f.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),i&&f.attr(`class`,`labelBkg`);let g=f.node().getBoundingClientRect();return g.width===n&&(f.style(`display`,`table`),f.style(`white-space`,`break-spaces`),f.style(`width`,n+`px`),g=f.node().getBoundingClientRect()),d.node()}r(q,`addHtmlSpan`);function J(e,t,n){return e.append(`tspan`).attr(`class`,`text-outer-tspan`).attr(`x`,0).attr(`y`,t*n-.1+`em`).attr(`dy`,n+`em`)}r(J,`createTspan`);function Y(e,t,n){let r=e.append(`text`),i=J(r,1,t);Q(i,n);let a=i.node().getComputedTextLength();return r.remove(),a}r(Y,`computeWidthOfText`);function X(e,t,n){let r=e.append(`text`),i=J(r,1,t);Q(i,[{content:n,type:`normal`}]);let a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}r(X,`computeDimensionOfText`);function Z(e,t,n,i=!1){let a=1.1,o=t.append(`g`),s=o.insert(`rect`).attr(`class`,`background`).attr(`style`,`stroke: none`),c=o.append(`text`).attr(`y`,`-10.1`),l=0;for(let t of n){let n=r(t=>Y(o,a,t)<=e,`checkWidth`),i=n(t)?[t]:W(t,n);for(let e of i)Q(J(c,l,a),e),l++}if(i){let e=c.node().getBBox();return s.attr(`x`,e.x-2).attr(`y`,e.y-2).attr(`width`,e.width+4).attr(`height`,e.height+4),o.node()}else return c.node()}r(Z,`createFormattedText`);function Q(e,t){e.text(``),t.forEach((t,n)=>{let r=e.append(`tspan`).attr(`font-style`,t.type===`em`?`italic`:`normal`).attr(`class`,`text-inner-tspan`).attr(`font-weight`,t.type===`strong`?`bold`:`normal`);n===0?r.text(t.content):r.text(` `+t.content)})}r(Q,`updateTextContentAndStyles`);async function $(e,t={}){let n=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(e,r,i)=>(n.push((async()=>{let n=`${r}:${i}`;return await I(n)?await L(n,void 0,{class:`label-icon`}):`<i class='${a(e,t).replace(`:`,` `)}'></i>`})()),e));let r=await Promise.all(n);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??``)}r($,`replaceIconSubstring`);var oe=r(async(e,r=``,{style:a=``,isTitle:o=!1,classes:c=``,useHtmlLabels:l=!0,isNode:u=!0,width:d=200,addSvgBackground:f=!1}={},p)=>{if(i.debug(`XYZ createText`,r,a,o,c,l,u,`addSvgBackground: `,f),l){let t=await $(n(B(r,p)),p),i=r.replace(/\\\\/g,`\\`);return await q(e,{isNode:u,label:s(r)?i:t,labelStyle:a.replace(`fill:`,`color:`)},d,c,f,p)}else{let n=Z(d,e,z(r.replace(/<br\s*\/?>/g,`<br/>`).replace(`<br>`,`<br/>`),p),r?f:!1);if(u){/stroke:/.exec(a)&&(a=a.replace(`stroke:`,`lineColor:`));let e=a.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);t(n).attr(`style`,e)}else{let e=a.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/background:/g,`fill:`);t(n).select(`rect`).attr(`style`,e.replace(/background:/g,`fill:`));let r=a.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);t(n).select(`text`).attr(`style`,r)}return n}},`createText`);export{$ as a,P as i,oe as n,j as o,L as r,A as s,X as t};