3 lines
18 KiB
JavaScript
Raw Permalink Normal View History

2026-05-31 13:21:13 +02:00
import{a as Ct}from"./chunk-KNLZD3CH.mjs";import{G as j,I as D,L as gt,a as ot,k as xt}from"./chunk-67TQ5CYL.mjs";import{$ as Ft,G as lt,J as dt,K as ht,L as bt,M as wt,N as At,O as Ot,P as St,Q as Bt,R as Pt,S as Mt,T as Wt,U as Et,V as Dt,W as Lt,X as It,Y as Tt,Z as Rt,_ as $t,b as P,h as yt}from"./chunk-7W6UQGC5.mjs";import{a as f,d as Qt}from"./chunk-AQ6EADP3.mjs";var Jt=Qt(Ct(),1);function Nt(t){return Number.isSafeInteger(t)&&t>=0}f(Nt,"isLength");function U(t){return t!=null&&typeof t!="function"&&Nt(t.length)}f(U,"isArrayLike");function kt(t){return t==="__proto__"}f(kt,"isUnsafeProperty");function d(t){return t==null||typeof t!="object"&&typeof t!="function"}f(d,"isPrimitive");function H(t){return Object.getOwnPropertySymbols(t).filter(r=>Object.prototype.propertyIsEnumerable.call(t,r))}f(H,"getSymbols");function l(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}f(l,"getTag");var L="[object RegExp]",h="[object String]",w="[object Number]",A="[object Boolean]",O="[object Arguments]",I="[object Symbol]",T="[object Date]",R="[object Map]",$="[object Set]",q="[object Array]";var F="[object ArrayBuffer]",M="[object Object]";var N="[object DataView]",K="[object Uint8Array]",V="[object Uint8ClampedArray]",X="[object Uint16Array]",Y="[object Uint32Array]";var J="[object Int8Array]",Z="[object Int16Array]",v="[object Int32Array]";var G="[object Float32Array]",Q="[object Float64Array]";function W(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}f(W,"isTypedArray");function zt(t,r){return E(t,void 0,t,new Map,r)}f(zt,"cloneDeepWith");function E(t,r,o,e=new Map,i=void 0){let s=i?.(t,r,o,e);if(s!==void 0)return s;if(d(t))return t;if(e.has(t))return e.get(t);if(Array.isArray(t)){let n=new Array(t.length);e.set(t,n);for(let a=0;a<t.length;a++)n[a]=E(t[a],a,o,e,i);return Object.hasOwn(t,"index")&&(n.index=t.index),Object.hasOwn(t,"input")&&(n.input=t.input),n}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t instanceof Map){let n=new Map;e.set(t,n);for(let[a,p]of t)n.set(a,E(p,a,o,e,i));return n}if(t instanceof Set){let n=new Set;e.set(t,n);for(let a of t)n.add(E(a,void 0,o,e,i));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(W(t)){let n=new(Object.getPrototypeOf(t)).constructor(t.length);e.set(t,n);for(let a=0;a<t.length;a++)n[a]=E(t[a],a,o,e,i);return n}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let n=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return e.set(t,n),u(n,t,o,e,i),n}if(typeof File<"u"&&t instanceof File){let n=new File([t],t.name,{type:t.type});return e.set(t,n),u(n,t,o,e,i),n}if(typeof Blob<"u"&&t instanceof Blob){let n=new Blob([t],{type:t.type});return e.set(t,n),u(n,t,o,e,i),n}if(t instanceof Error){let n=structuredClone(t);return e.set(t,n),n.message=t.message,n.name=t.name,n.stack=t.stack,n.cause=t.cause,n.constructor=t.constructor,u(n,t,o,e,i),n}if(t instanceof Boolean){let n=new Boolean(t.valueOf());return e.set(t,n),u(n,t,o,e,i),n}if(t instanceof Number){let n=new Number(t.valueOf());return e.set(t,n),u(n,t,o,e,i),n}if(t instanceof String){let n=new String(t.valueOf());return e.set(t,n),u(n,t,o,e,i),n}if(typeof t=="object"&&tr(t)){let n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),u(n,t,o,e,i),n}return t}f(E,"cloneDeepWithImpl");function u(t,r,o=t,e,i){let s=[...Object.keys(r),...H(r)];for(let n=0;n<s.length;n++){let a=s[n],p=Object.getOwnPropertyDescriptor(t,a);(p==null||p.writable)&&(t[a]=E(r[a],a,o,e,i))}}f(u,"copyProperties");function tr(t){switch(l(t)){case O:case q:case F:case N:case A:case T:case G:case Q:case J:case Z:case v:case R:case w:case M:case L:case $:case h:case I:case K:case V:case X:case Y:return!0;default:return!1}}f(tr,"isCloneableObject");function _t(t,r){return zt(t,(o,e,i,s)=>{let n=r?.(o,e,i,s);if(n!==void 0)return n;if(typeof t=="object"){if(l(t)===M&&typeof t.constructor!="function
`,"ig");t=t.trim().replace(o,"").replace(/'/gm,'"'),P.debug(`Detecting diagram directive${r!==null?" type:"+r:""} based on the text:${t}`);let e,i=[];for(;(e=D.exec(t))!==null;)if(e.index===D.lastIndex&&D.lastIndex++,e&&!r||r&&e[1]?.match(r)||r&&e[2]?.match(r)){let s=e[1]?e[1]:e[2],n=e[3]?e[3].trim():e[4]?JSON.parse(e[4].trim()):null;i.push({type:s,args:n})}return i.length===0?{type:t,args:null}:i.length===1?i[0]:i}catch(o){return P.error(`ERROR: ${o.message} - Unable to parse directive type: '${r}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),Bo=f(function(t){return t.replace(D,"")},"removeDirectives"),mr=f(function(t,r){for(let[o,e]of r.entries())if(e.match(t))return o;return-1},"isSubstringInArray");function ur(t,r){if(!t)return r;let o=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return ar[o]??r}f(ur,"interpolateToCurve");function xr(t,r){let o=t.trim();if(o)return r.securityLevel!=="loose"?(0,Jt.sanitizeUrl)(o):o}f(xr,"formatUrl");var gr=f((t,...r)=>{let o=t.split("."),e=o.length-1,i=o[e],s=window;for(let n=0;n<e;n++)if(s=s[o[n]],!s){P.error(`Function name: ${t} not found in window`);return}s[i](...r)},"runFunc");function vt(t,r){return!t||!r?0:Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))}f(vt,"distance");function yr(t){let r,o=0;t.forEach(i=>{o+=vt(i,r),r=i});let e=o/2;return at(t,e)}f(yr,"traverseEdge");function lr(t){return t.length===1?t[0]:yr(t)}f(lr,"calcLabelPosition");var Xt=f((t,r=2)=>{let o=Math.pow(10,r);return Math.round(t*o)/o},"roundNumber"),at=f((t,r)=>{let o,e=r;for(let i of t){if(o){let s=vt(i,o);if(s===0)return o;if(s<e)e-=s;else{let n=e/s;if(n<=0)return o;if(n>=1)return{x:i.x,y:i.y};if(n>0&&n<1)return{x:Xt((1-n)*o.x+n*i.x,5),y:Xt((1-n)*o.y+n*i.y,5)}}}o=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),dr=f((t,r,o)=>{P.info(`our points ${JSON.stringify(r)}`),r[0]!==o&&(r=r.reverse());let i=at(r,25),s=t?10:5,n=Math.atan2(r[0].y-i.y,r[0].x-i.x),a={x:0,y:0};return a.x=Math.sin(n)*s+(r[0].x+i.x)/2,a.y=-Math.cos(n)*s+(r[0].y+i.y)/2,a},"calcCardinalityPosition");function hr(t,r,o){let e=structuredClone(o);P.info("our points",e),r!=="start_left"&&r!=="start_right"&&e.reverse();let i=25+t,s=at(e,i),n=10+t*.5,a=Math.atan2(e[0].y-s.y,e[0].x-s.x),p={x:0,y:0};return r==="start_left"?(p.x=Math.sin(a+Math.PI)*n+(e[0].x+s.x)/2,p.y=-Math.cos(a+Math.PI)*n+(e[0].y+s.y)/2):r==="end_right"?(p.x=Math.sin(a-Math.PI)*n+(e[0].x+s.x)/2-5,p.y=-Math.cos(a-Math.PI)*n+(e[0].y+s.y)/2-5):r==="end_left"?(p.x=Math.sin(a)*n+(e[0].x+s.x)/2-5,p.y=-Math.cos(a)*n+(e[0].y+s.y)/2-5):(p.x=Math.sin(a)*n+(e[0].x+s.x)/2,p.y=-Math.cos(a)*n+(e[0].y+s.y)/2),p}f(hr,"calcTerminalLabelPosition");function br(t){let r="",o="";for(let e of t)e!==void 0&&(e.startsWith("color:")||e.startsWith("text-align:")?o=o+e+";":r=r+e+";");return{style:r,labelStyle:o}}f(br,"getStylesFromArray");var Yt=0,wr=f(()=>(Yt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Yt),"generateId");function Ar(t){let r="",o="0123456789abcdef",e=o.length;for(let i=0;i<t;i++)r+=o.charAt(Math.floor(Math.random()*e));return r}f(Ar,"makeRandomHex");var Or=f(t=>Ar(t.length),"random"),Sr=f(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Br=f(function(t,r){let o=r.text.replace(j.lineBreakRegex," "),[,e]=ct(r.fontSize),i=t.append("text");i.attr("x",r.x),i.attr("y",r.y),i.style("text-anchor",r.anchor),i.style("font-family",r.fontFamily),i.style("font-size",e),i.style("font-weight",r.fontWeight),i.attr("fill",r.fill),r.class!==void 0&&i.attr("class",r.class);let s=i.append("tspan");return s.attr("x",r.x+r.textMargin*2),s.attr("fill",r.fill),s.text(o),i},"drawSimpleText"),Pr=S((t,r,o)=>{if(!t||(o=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},o),j.lineBreakRegex.test(t)))return t;let e=t.split(" ").filter(Boolean),i=[],s="";return e.forEach((n,a)=>{let p=et(`${n} `,o),c=et(s,o);if(p>r){let{hyphenatedStrings:y,remainingWord:g}=Mr(n,r,"-",o);i.push(s,...y),s=g}else c+p>=r?(i.push(s