@skill-map/cli 0.40.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/tutorial/sm-tutorial/SKILL.md +10 -1
- package/dist/cli.js +429 -95
- package/dist/cli.js.map +1 -1
- package/dist/index.js +39 -29
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +101 -0
- package/dist/kernel/index.js +39 -29
- package/dist/kernel/index.js.map +1 -1
- package/dist/migrations/001_initial.sql +8 -0
- package/dist/ui/chunk-5GD2GBPS.js +2190 -0
- package/dist/ui/{chunk-4HTOYDCM.js → chunk-5WJRN3LD.js} +1 -1
- package/dist/ui/{chunk-3SI3TVER.js → chunk-C2YUQODZ.js} +2 -2
- package/dist/ui/{chunk-NGIFGXW7.js → chunk-CFJBTDAA.js} +1 -1
- package/dist/ui/{chunk-YWWD62BR.js → chunk-HEJCH7BA.js} +1 -1
- package/dist/ui/chunk-HFPA56IM.js +1 -0
- package/dist/ui/chunk-HHPSCDLM.js +315 -0
- package/dist/ui/chunk-HP375T2O.js +2 -0
- package/dist/ui/chunk-HWP3HM55.js +123 -0
- package/dist/ui/{chunk-ZAEGBMF7.js → chunk-IUDL3NDH.js} +1 -1
- package/dist/ui/{chunk-Z3C2OSRL.js → chunk-JPYAASHN.js} +1 -1
- package/dist/ui/chunk-PZ6Q5AOT.js +1 -0
- package/dist/ui/chunk-XJL4DZ4M.js +1 -0
- package/dist/ui/{chunk-W2JMLJCF.js → chunk-XOHD5XWA.js} +1 -1
- package/dist/ui/chunk-YL6SWAFJ.js +1024 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/main-7VYTTJP7.js +3 -0
- package/dist/ui/{styles-6H4GSOHY.css → styles-HI4A6IWA.css} +1 -1
- package/migrations/001_initial.sql +8 -0
- package/package.json +2 -2
- package/dist/ui/chunk-4X4GYACU.js +0 -123
- package/dist/ui/chunk-7Q3IO77R.js +0 -317
- package/dist/ui/chunk-FL6RV2IG.js +0 -2
- package/dist/ui/chunk-HGNE4UVQ.js +0 -1
- package/dist/ui/chunk-IS5ULQSF.js +0 -1
- package/dist/ui/chunk-KVWYVO6I.js +0 -1
- package/dist/ui/chunk-N4XX4WPE.js +0 -2190
- package/dist/ui/chunk-P7TXZKUX.js +0 -2
- package/dist/ui/chunk-UVVXMEZT.js +0 -1025
- package/dist/ui/main-F7N5RV4Y.js +0 -3
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import{A as l0,B as u0,C as p0,b as bg,e as Jr,f as xg,j as Ug,k as ua,l as Wg,m as $g,n as Kg,o as Yg,p as Xg,q as Zg,r as Qg,s as Jg,t as e0,w as vn,y as c0,z as d0}from"./chunk-XJL4DZ4M.js";import{a as pa,b as Yn,c as i0,d as fa,e as ha,f as ma,g as o0,h as r0,i as a0,j as s0}from"./chunk-JPYAASHN.js";import{a as Bg,b as da,c as la,d as zg,e as qg,f as Vg,g as Hg,h as Gg,i as Uf,j as Co,l as jg,m as pn,n as ki,p as t0}from"./chunk-HFPA56IM.js";import{c as aa,d as sa,e as n0}from"./chunk-HEJCH7BA.js";import"./chunk-HP375T2O.js";import{c as Rg,d as Ag,f as _n,g as gn}from"./chunk-XOHD5XWA.js";import{$ as lt,$b as J,$c as Mg,Ab as V,Ad as Oe,Ba as mg,Bd as Ne,Ca as yo,Cb as m,Cd as ca,Db as Kt,Dd as Fg,Ea as Gr,Eb as De,Ed as un,Fa as d,Fb as Yr,Fd as jf,Hb as gt,I as y,Ib as vt,Id as Lg,J as Ci,Ja as jr,Jb as qf,Jd as Lt,Ka as _g,Kb as ut,L as ue,Lb as tt,Lc as yg,M as bi,Ma as gg,Mb as Yt,Mc as Cg,N as l,Na as Lf,Nb as Tt,Nc as Qr,Nd as fn,Oa as Ur,Ob as se,Oc as Ti,Od as hn,Pb as Xr,Pd as mn,Qb as Ae,R as hg,Ra as K,Rb as v,S as an,Sa as wi,Sb as C,Sc as sn,T as L,Ta as Te,Tb as Le,U as B,Ua as Wr,Ub as Vf,V as et,Va as he,Vb as vg,W as qr,Wa as be,Wc as Ei,X as Xe,Y as Vr,Z as at,Zb as nt,_b as We,_c as kg,aa as Un,ac as ge,ad as Dg,bc as Nt,bd as Pi,cc as yt,cd as cn,db as q,ea as H,ed as ta,g as x,ga as ie,gb as I,ha as xi,hb as T,hd as na,ia as ee,ib as Bf,id as ia,jb as Ee,jc as Rt,ka as Re,kb as Y,lb as X,lc as At,mb as E,mc as S,md as Ng,n as pg,nb as f,oa as Hr,ob as h,od as Ft,pb as R,pc as Be,pd as oa,qb as W,qc as O,rb as $,rc as Pe,sb as Si,sc as Zr,t as fg,tb as Wn,tc as Hf,ub as $n,uc as Kn,vb as Ii,vd as dn,wb as $r,wd as ln,xb as Kr,yb as re,yc as me,zb as zf,zc as Ke,zd as ra}from"./chunk-YL6SWAFJ.js";import{B as Gf,Ca as Og,H as Tg,J as Eg,V as Pg,b as wg,k as Sg,p as ea,u as Ig}from"./chunk-C2YUQODZ.js";import{a as de,b as jn,c as yi,e as g,g as tM}from"./chunk-VB56BUGO.js";var Wv=g((Bee,Uv)=>{"use strict";function uF(){this.__data__=[],this.size=0}Uv.exports=uF});var li=g((zee,$v)=>{"use strict";function pF(t,i){return t===i||t!==t&&i!==i}$v.exports=pF});var lr=g((qee,Kv)=>{"use strict";var fF=li();function hF(t,i){for(var e=t.length;e--;)if(fF(t[e][0],i))return e;return-1}Kv.exports=hF});var Xv=g((Vee,Yv)=>{"use strict";var mF=lr(),_F=Array.prototype,gF=_F.splice;function vF(t){var i=this.__data__,e=mF(i,t);if(e<0)return!1;var n=i.length-1;return e==n?i.pop():gF.call(i,e,1),--this.size,!0}Yv.exports=vF});var Qv=g((Hee,Zv)=>{"use strict";var yF=lr();function CF(t){var i=this.__data__,e=yF(i,t);return e<0?void 0:i[e][1]}Zv.exports=CF});var ey=g((Gee,Jv)=>{"use strict";var bF=lr();function xF(t){return bF(this.__data__,t)>-1}Jv.exports=xF});var ny=g((jee,ty)=>{"use strict";var wF=lr();function SF(t,i){var e=this.__data__,n=wF(e,t);return n<0?(++this.size,e.push([t,i])):e[n][1]=i,this}ty.exports=SF});var ur=g((Uee,iy)=>{"use strict";var IF=Wv(),TF=Xv(),EF=Qv(),PF=ey(),kF=ny();function Qi(t){var i=-1,e=t==null?0:t.length;for(this.clear();++i<e;){var n=t[i];this.set(n[0],n[1])}}Qi.prototype.clear=IF;Qi.prototype.delete=TF;Qi.prototype.get=EF;Qi.prototype.has=PF;Qi.prototype.set=kF;iy.exports=Qi});var ry=g((Wee,oy)=>{"use strict";var MF=ur();function DF(){this.__data__=new MF,this.size=0}oy.exports=DF});var sy=g(($ee,ay)=>{"use strict";function OF(t){var i=this.__data__,e=i.delete(t);return this.size=i.size,e}ay.exports=OF});var dy=g((Kee,cy)=>{"use strict";function NF(t){return this.__data__.get(t)}cy.exports=NF});var uy=g((Yee,ly)=>{"use strict";function RF(t){return this.__data__.has(t)}ly.exports=RF});var wm=g((Xee,py)=>{"use strict";var AF=typeof global=="object"&&global&&global.Object===Object&&global;py.exports=AF});var xt=g((Zee,fy)=>{"use strict";var FF=wm(),LF=typeof self=="object"&&self&&self.Object===Object&&self,BF=FF||LF||Function("return this")();fy.exports=BF});var ui=g((Qee,hy)=>{"use strict";var zF=xt(),qF=zF.Symbol;hy.exports=qF});var vy=g((Jee,gy)=>{"use strict";var my=ui(),_y=Object.prototype,VF=_y.hasOwnProperty,HF=_y.toString,pr=my?my.toStringTag:void 0;function GF(t){var i=VF.call(t,pr),e=t[pr];try{t[pr]=void 0;var n=!0}catch{}var o=HF.call(t);return n&&(i?t[pr]=e:delete t[pr]),o}gy.exports=GF});var Cy=g((ete,yy)=>{"use strict";var jF=Object.prototype,UF=jF.toString;function WF(t){return UF.call(t)}yy.exports=WF});var On=g((tte,wy)=>{"use strict";var by=ui(),$F=vy(),KF=Cy(),YF="[object Null]",XF="[object Undefined]",xy=by?by.toStringTag:void 0;function ZF(t){return t==null?t===void 0?XF:YF:xy&&xy in Object(t)?$F(t):KF(t)}wy.exports=ZF});var ft=g((nte,Sy)=>{"use strict";function QF(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}Sy.exports=QF});var Ji=g((ite,Iy)=>{"use strict";var JF=On(),eL=ft(),tL="[object AsyncFunction]",nL="[object Function]",iL="[object GeneratorFunction]",oL="[object Proxy]";function rL(t){if(!eL(t))return!1;var i=JF(t);return i==nL||i==iL||i==tL||i==oL}Iy.exports=rL});var Ey=g((ote,Ty)=>{"use strict";var aL=xt(),sL=aL["__core-js_shared__"];Ty.exports=sL});var My=g((rte,ky)=>{"use strict";var Sm=Ey(),Py=(function(){var t=/[^.]+$/.exec(Sm&&Sm.keys&&Sm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function cL(t){return!!Py&&Py in t}ky.exports=cL});var Im=g((ate,Dy)=>{"use strict";var dL=Function.prototype,lL=dL.toString;function uL(t){if(t!=null){try{return lL.call(t)}catch{}try{return t+""}catch{}}return""}Dy.exports=uL});var Ny=g((ste,Oy)=>{"use strict";var pL=Ji(),fL=My(),hL=ft(),mL=Im(),_L=/[\\^$.*+?()[\]{}|]/g,gL=/^\[object .+?Constructor\]$/,vL=Function.prototype,yL=Object.prototype,CL=vL.toString,bL=yL.hasOwnProperty,xL=RegExp("^"+CL.call(bL).replace(_L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wL(t){if(!hL(t)||fL(t))return!1;var i=pL(t)?xL:gL;return i.test(mL(t))}Oy.exports=wL});var Ay=g((cte,Ry)=>{"use strict";function SL(t,i){return t?.[i]}Ry.exports=SL});var Nn=g((dte,Fy)=>{"use strict";var IL=Ny(),TL=Ay();function EL(t,i){var e=TL(t,i);return IL(e)?e:void 0}Fy.exports=EL});var Tp=g((lte,Ly)=>{"use strict";var PL=Nn(),kL=xt(),ML=PL(kL,"Map");Ly.exports=ML});var fr=g((ute,By)=>{"use strict";var DL=Nn(),OL=DL(Object,"create");By.exports=OL});var Vy=g((pte,qy)=>{"use strict";var zy=fr();function NL(){this.__data__=zy?zy(null):{},this.size=0}qy.exports=NL});var Gy=g((fte,Hy)=>{"use strict";function RL(t){var i=this.has(t)&&delete this.__data__[t];return this.size-=i?1:0,i}Hy.exports=RL});var Uy=g((hte,jy)=>{"use strict";var AL=fr(),FL="__lodash_hash_undefined__",LL=Object.prototype,BL=LL.hasOwnProperty;function zL(t){var i=this.__data__;if(AL){var e=i[t];return e===FL?void 0:e}return BL.call(i,t)?i[t]:void 0}jy.exports=zL});var $y=g((mte,Wy)=>{"use strict";var qL=fr(),VL=Object.prototype,HL=VL.hasOwnProperty;function GL(t){var i=this.__data__;return qL?i[t]!==void 0:HL.call(i,t)}Wy.exports=GL});var Yy=g((_te,Ky)=>{"use strict";var jL=fr(),UL="__lodash_hash_undefined__";function WL(t,i){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=jL&&i===void 0?UL:i,this}Ky.exports=WL});var Zy=g((gte,Xy)=>{"use strict";var $L=Vy(),KL=Gy(),YL=Uy(),XL=$y(),ZL=Yy();function eo(t){var i=-1,e=t==null?0:t.length;for(this.clear();++i<e;){var n=t[i];this.set(n[0],n[1])}}eo.prototype.clear=$L;eo.prototype.delete=KL;eo.prototype.get=YL;eo.prototype.has=XL;eo.prototype.set=ZL;Xy.exports=eo});var eC=g((vte,Jy)=>{"use strict";var Qy=Zy(),QL=ur(),JL=Tp();function e3(){this.size=0,this.__data__={hash:new Qy,map:new(JL||QL),string:new Qy}}Jy.exports=e3});var nC=g((yte,tC)=>{"use strict";function t3(t){var i=typeof t;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?t!=="__proto__":t===null}tC.exports=t3});var hr=g((Cte,iC)=>{"use strict";var n3=nC();function i3(t,i){var e=t.__data__;return n3(i)?e[typeof i=="string"?"string":"hash"]:e.map}iC.exports=i3});var rC=g((bte,oC)=>{"use strict";var o3=hr();function r3(t){var i=o3(this,t).delete(t);return this.size-=i?1:0,i}oC.exports=r3});var sC=g((xte,aC)=>{"use strict";var a3=hr();function s3(t){return a3(this,t).get(t)}aC.exports=s3});var dC=g((wte,cC)=>{"use strict";var c3=hr();function d3(t){return c3(this,t).has(t)}cC.exports=d3});var uC=g((Ste,lC)=>{"use strict";var l3=hr();function u3(t,i){var e=l3(this,t),n=e.size;return e.set(t,i),this.size+=e.size==n?0:1,this}lC.exports=u3});var Ep=g((Ite,pC)=>{"use strict";var p3=eC(),f3=rC(),h3=sC(),m3=dC(),_3=uC();function to(t){var i=-1,e=t==null?0:t.length;for(this.clear();++i<e;){var n=t[i];this.set(n[0],n[1])}}to.prototype.clear=p3;to.prototype.delete=f3;to.prototype.get=h3;to.prototype.has=m3;to.prototype.set=_3;pC.exports=to});var hC=g((Tte,fC)=>{"use strict";var g3=ur(),v3=Tp(),y3=Ep(),C3=200;function b3(t,i){var e=this.__data__;if(e instanceof g3){var n=e.__data__;if(!v3||n.length<C3-1)return n.push([t,i]),this.size=++e.size,this;e=this.__data__=new y3(n)}return e.set(t,i),this.size=e.size,this}fC.exports=b3});var mr=g((Ete,mC)=>{"use strict";var x3=ur(),w3=ry(),S3=sy(),I3=dy(),T3=uy(),E3=hC();function no(t){var i=this.__data__=new x3(t);this.size=i.size}no.prototype.clear=w3;no.prototype.delete=S3;no.prototype.get=I3;no.prototype.has=T3;no.prototype.set=E3;mC.exports=no});var Pp=g((Pte,_C)=>{"use strict";function P3(t,i){for(var e=-1,n=t==null?0:t.length;++e<n&&i(t[e],e,t)!==!1;);return t}_C.exports=P3});var Tm=g((kte,gC)=>{"use strict";var k3=Nn(),M3=(function(){try{var t=k3(Object,"defineProperty");return t({},"",{}),t}catch{}})();gC.exports=M3});var _r=g((Mte,yC)=>{"use strict";var vC=Tm();function D3(t,i,e){i=="__proto__"&&vC?vC(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}yC.exports=D3});var gr=g((Dte,CC)=>{"use strict";var O3=_r(),N3=li(),R3=Object.prototype,A3=R3.hasOwnProperty;function F3(t,i,e){var n=t[i];(!(A3.call(t,i)&&N3(n,e))||e===void 0&&!(i in t))&&O3(t,i,e)}CC.exports=F3});var io=g((Ote,bC)=>{"use strict";var L3=gr(),B3=_r();function z3(t,i,e,n){var o=!e;e||(e={});for(var r=-1,a=i.length;++r<a;){var s=i[r],c=n?n(e[s],t[s],s,e,t):void 0;c===void 0&&(c=t[s]),o?B3(e,s,c):L3(e,s,c)}return e}bC.exports=z3});var wC=g((Nte,xC)=>{"use strict";function q3(t,i){for(var e=-1,n=Array(t);++e<t;)n[e]=i(e);return n}xC.exports=q3});var Mt=g((Rte,SC)=>{"use strict";function V3(t){return t!=null&&typeof t=="object"}SC.exports=V3});var TC=g((Ate,IC)=>{"use strict";var H3=On(),G3=Mt(),j3="[object Arguments]";function U3(t){return G3(t)&&H3(t)==j3}IC.exports=U3});var oo=g((Fte,kC)=>{"use strict";var EC=TC(),W3=Mt(),PC=Object.prototype,$3=PC.hasOwnProperty,K3=PC.propertyIsEnumerable,Y3=EC((function(){return arguments})())?EC:function(t){return W3(t)&&$3.call(t,"callee")&&!K3.call(t,"callee")};kC.exports=Y3});var He=g((Lte,MC)=>{"use strict";var X3=Array.isArray;MC.exports=X3});var OC=g((Bte,DC)=>{"use strict";function Z3(){return!1}DC.exports=Z3});var pi=g((vr,ro)=>{"use strict";var Q3=xt(),J3=OC(),AC=typeof vr=="object"&&vr&&!vr.nodeType&&vr,NC=AC&&typeof ro=="object"&&ro&&!ro.nodeType&&ro,eB=NC&&NC.exports===AC,RC=eB?Q3.Buffer:void 0,tB=RC?RC.isBuffer:void 0,nB=tB||J3;ro.exports=nB});var yr=g((zte,FC)=>{"use strict";var iB=9007199254740991,oB=/^(?:0|[1-9]\d*)$/;function rB(t,i){var e=typeof t;return i=i??iB,!!i&&(e=="number"||e!="symbol"&&oB.test(t))&&t>-1&&t%1==0&&t<i}FC.exports=rB});var kp=g((qte,LC)=>{"use strict";var aB=9007199254740991;function sB(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=aB}LC.exports=sB});var zC=g((Vte,BC)=>{"use strict";var cB=On(),dB=kp(),lB=Mt(),uB="[object Arguments]",pB="[object Array]",fB="[object Boolean]",hB="[object Date]",mB="[object Error]",_B="[object Function]",gB="[object Map]",vB="[object Number]",yB="[object Object]",CB="[object RegExp]",bB="[object Set]",xB="[object String]",wB="[object WeakMap]",SB="[object ArrayBuffer]",IB="[object DataView]",TB="[object Float32Array]",EB="[object Float64Array]",PB="[object Int8Array]",kB="[object Int16Array]",MB="[object Int32Array]",DB="[object Uint8Array]",OB="[object Uint8ClampedArray]",NB="[object Uint16Array]",RB="[object Uint32Array]",ke={};ke[TB]=ke[EB]=ke[PB]=ke[kB]=ke[MB]=ke[DB]=ke[OB]=ke[NB]=ke[RB]=!0;ke[uB]=ke[pB]=ke[SB]=ke[fB]=ke[IB]=ke[hB]=ke[mB]=ke[_B]=ke[gB]=ke[vB]=ke[yB]=ke[CB]=ke[bB]=ke[xB]=ke[wB]=!1;function AB(t){return lB(t)&&dB(t.length)&&!!ke[cB(t)]}BC.exports=AB});var Cr=g((Hte,qC)=>{"use strict";function FB(t){return function(i){return t(i)}}qC.exports=FB});var Mp=g((br,ao)=>{"use strict";var LB=wm(),VC=typeof br=="object"&&br&&!br.nodeType&&br,xr=VC&&typeof ao=="object"&&ao&&!ao.nodeType&&ao,BB=xr&&xr.exports===VC,Em=BB&&LB.process,zB=(function(){try{var t=xr&&xr.require&&xr.require("util").types;return t||Em&&Em.binding&&Em.binding("util")}catch{}})();ao.exports=zB});var so=g((Gte,jC)=>{"use strict";var qB=zC(),VB=Cr(),HC=Mp(),GC=HC&&HC.isTypedArray,HB=GC?VB(GC):qB;jC.exports=HB});var Pm=g((jte,UC)=>{"use strict";var GB=wC(),jB=oo(),UB=He(),WB=pi(),$B=yr(),KB=so(),YB=Object.prototype,XB=YB.hasOwnProperty;function ZB(t,i){var e=UB(t),n=!e&&jB(t),o=!e&&!n&&WB(t),r=!e&&!n&&!o&&KB(t),a=e||n||o||r,s=a?GB(t.length,String):[],c=s.length;for(var u in t)(i||XB.call(t,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$B(u,c)))&&s.push(u);return s}UC.exports=ZB});var wr=g((Ute,WC)=>{"use strict";var QB=Object.prototype;function JB(t){var i=t&&t.constructor,e=typeof i=="function"&&i.prototype||QB;return t===e}WC.exports=JB});var km=g((Wte,$C)=>{"use strict";function ez(t,i){return function(e){return t(i(e))}}$C.exports=ez});var YC=g(($te,KC)=>{"use strict";var tz=km(),nz=tz(Object.keys,Object);KC.exports=nz});var Dp=g((Kte,XC)=>{"use strict";var iz=wr(),oz=YC(),rz=Object.prototype,az=rz.hasOwnProperty;function sz(t){if(!iz(t))return oz(t);var i=[];for(var e in Object(t))az.call(t,e)&&e!="constructor"&&i.push(e);return i}XC.exports=sz});var Ht=g((Yte,ZC)=>{"use strict";var cz=Ji(),dz=kp();function lz(t){return t!=null&&dz(t.length)&&!cz(t)}ZC.exports=lz});var Qt=g((Xte,QC)=>{"use strict";var uz=Pm(),pz=Dp(),fz=Ht();function hz(t){return fz(t)?uz(t):pz(t)}QC.exports=hz});var eb=g((Zte,JC)=>{"use strict";var mz=io(),_z=Qt();function gz(t,i){return t&&mz(i,_z(i),t)}JC.exports=gz});var nb=g((Qte,tb)=>{"use strict";function vz(t){var i=[];if(t!=null)for(var e in Object(t))i.push(e);return i}tb.exports=vz});var ob=g((Jte,ib)=>{"use strict";var yz=ft(),Cz=wr(),bz=nb(),xz=Object.prototype,wz=xz.hasOwnProperty;function Sz(t){if(!yz(t))return bz(t);var i=Cz(t),e=[];for(var n in t)n=="constructor"&&(i||!wz.call(t,n))||e.push(n);return e}ib.exports=Sz});var Rn=g((ene,rb)=>{"use strict";var Iz=Pm(),Tz=ob(),Ez=Ht();function Pz(t){return Ez(t)?Iz(t,!0):Tz(t)}rb.exports=Pz});var sb=g((tne,ab)=>{"use strict";var kz=io(),Mz=Rn();function Dz(t,i){return t&&kz(i,Mz(i),t)}ab.exports=Dz});var Mm=g((Sr,co)=>{"use strict";var Oz=xt(),ub=typeof Sr=="object"&&Sr&&!Sr.nodeType&&Sr,cb=ub&&typeof co=="object"&&co&&!co.nodeType&&co,Nz=cb&&cb.exports===ub,db=Nz?Oz.Buffer:void 0,lb=db?db.allocUnsafe:void 0;function Rz(t,i){if(i)return t.slice();var e=t.length,n=lb?lb(e):new t.constructor(e);return t.copy(n),n}co.exports=Rz});var Dm=g((nne,pb)=>{"use strict";function Az(t,i){var e=-1,n=t.length;for(i||(i=Array(n));++e<n;)i[e]=t[e];return i}pb.exports=Az});var Om=g((ine,fb)=>{"use strict";function Fz(t,i){for(var e=-1,n=t==null?0:t.length,o=0,r=[];++e<n;){var a=t[e];i(a,e,t)&&(r[o++]=a)}return r}fb.exports=Fz});var Nm=g((one,hb)=>{"use strict";function Lz(){return[]}hb.exports=Lz});var Op=g((rne,_b)=>{"use strict";var Bz=Om(),zz=Nm(),qz=Object.prototype,Vz=qz.propertyIsEnumerable,mb=Object.getOwnPropertySymbols,Hz=mb?function(t){return t==null?[]:(t=Object(t),Bz(mb(t),function(i){return Vz.call(t,i)}))}:zz;_b.exports=Hz});var vb=g((ane,gb)=>{"use strict";var Gz=io(),jz=Op();function Uz(t,i){return Gz(t,jz(t),i)}gb.exports=Uz});var Np=g((sne,yb)=>{"use strict";function Wz(t,i){for(var e=-1,n=i.length,o=t.length;++e<n;)t[o+e]=i[e];return t}yb.exports=Wz});var Ir=g((cne,Cb)=>{"use strict";var $z=km(),Kz=$z(Object.getPrototypeOf,Object);Cb.exports=Kz});var Rm=g((dne,bb)=>{"use strict";var Yz=Np(),Xz=Ir(),Zz=Op(),Qz=Nm(),Jz=Object.getOwnPropertySymbols,eq=Jz?function(t){for(var i=[];t;)Yz(i,Zz(t)),t=Xz(t);return i}:Qz;bb.exports=eq});var wb=g((lne,xb)=>{"use strict";var tq=io(),nq=Rm();function iq(t,i){return tq(t,nq(t),i)}xb.exports=iq});var Am=g((une,Sb)=>{"use strict";var oq=Np(),rq=He();function aq(t,i,e){var n=i(t);return rq(t)?n:oq(n,e(t))}Sb.exports=aq});var Fm=g((pne,Ib)=>{"use strict";var sq=Am(),cq=Op(),dq=Qt();function lq(t){return sq(t,dq,cq)}Ib.exports=lq});var Eb=g((fne,Tb)=>{"use strict";var uq=Am(),pq=Rm(),fq=Rn();function hq(t){return uq(t,fq,pq)}Tb.exports=hq});var kb=g((hne,Pb)=>{"use strict";var mq=Nn(),_q=xt(),gq=mq(_q,"DataView");Pb.exports=gq});var Db=g((mne,Mb)=>{"use strict";var vq=Nn(),yq=xt(),Cq=vq(yq,"Promise");Mb.exports=Cq});var Lm=g((_ne,Ob)=>{"use strict";var bq=Nn(),xq=xt(),wq=bq(xq,"Set");Ob.exports=wq});var Rb=g((gne,Nb)=>{"use strict";var Sq=Nn(),Iq=xt(),Tq=Sq(Iq,"WeakMap");Nb.exports=Tq});var hi=g((vne,Vb)=>{"use strict";var Bm=kb(),zm=Tp(),qm=Db(),Vm=Lm(),Hm=Rb(),qb=On(),lo=Im(),Ab="[object Map]",Eq="[object Object]",Fb="[object Promise]",Lb="[object Set]",Bb="[object WeakMap]",zb="[object DataView]",Pq=lo(Bm),kq=lo(zm),Mq=lo(qm),Dq=lo(Vm),Oq=lo(Hm),fi=qb;(Bm&&fi(new Bm(new ArrayBuffer(1)))!=zb||zm&&fi(new zm)!=Ab||qm&&fi(qm.resolve())!=Fb||Vm&&fi(new Vm)!=Lb||Hm&&fi(new Hm)!=Bb)&&(fi=function(t){var i=qb(t),e=i==Eq?t.constructor:void 0,n=e?lo(e):"";if(n)switch(n){case Pq:return zb;case kq:return Ab;case Mq:return Fb;case Dq:return Lb;case Oq:return Bb}return i});Vb.exports=fi});var Gb=g((yne,Hb)=>{"use strict";var Nq=Object.prototype,Rq=Nq.hasOwnProperty;function Aq(t){var i=t.length,e=new t.constructor(i);return i&&typeof t[0]=="string"&&Rq.call(t,"index")&&(e.index=t.index,e.input=t.input),e}Hb.exports=Aq});var Gm=g((Cne,jb)=>{"use strict";var Fq=xt(),Lq=Fq.Uint8Array;jb.exports=Lq});var Rp=g((bne,Wb)=>{"use strict";var Ub=Gm();function Bq(t){var i=new t.constructor(t.byteLength);return new Ub(i).set(new Ub(t)),i}Wb.exports=Bq});var Kb=g((xne,$b)=>{"use strict";var zq=Rp();function qq(t,i){var e=i?zq(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}$b.exports=qq});var Xb=g((wne,Yb)=>{"use strict";var Vq=/\w*$/;function Hq(t){var i=new t.constructor(t.source,Vq.exec(t));return i.lastIndex=t.lastIndex,i}Yb.exports=Hq});var tx=g((Sne,ex)=>{"use strict";var Zb=ui(),Qb=Zb?Zb.prototype:void 0,Jb=Qb?Qb.valueOf:void 0;function Gq(t){return Jb?Object(Jb.call(t)):{}}ex.exports=Gq});var jm=g((Ine,nx)=>{"use strict";var jq=Rp();function Uq(t,i){var e=i?jq(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}nx.exports=Uq});var ox=g((Tne,ix)=>{"use strict";var Wq=Rp(),$q=Kb(),Kq=Xb(),Yq=tx(),Xq=jm(),Zq="[object Boolean]",Qq="[object Date]",Jq="[object Map]",eV="[object Number]",tV="[object RegExp]",nV="[object Set]",iV="[object String]",oV="[object Symbol]",rV="[object ArrayBuffer]",aV="[object DataView]",sV="[object Float32Array]",cV="[object Float64Array]",dV="[object Int8Array]",lV="[object Int16Array]",uV="[object Int32Array]",pV="[object Uint8Array]",fV="[object Uint8ClampedArray]",hV="[object Uint16Array]",mV="[object Uint32Array]";function _V(t,i,e){var n=t.constructor;switch(i){case rV:return Wq(t);case Zq:case Qq:return new n(+t);case aV:return $q(t,e);case sV:case cV:case dV:case lV:case uV:case pV:case fV:case hV:case mV:return Xq(t,e);case Jq:return new n;case eV:case iV:return new n(t);case tV:return Kq(t);case nV:return new n;case oV:return Yq(t)}}ix.exports=_V});var Um=g((Ene,ax)=>{"use strict";var gV=ft(),rx=Object.create,vV=(function(){function t(){}return function(i){if(!gV(i))return{};if(rx)return rx(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}})();ax.exports=vV});var Wm=g((Pne,sx)=>{"use strict";var yV=Um(),CV=Ir(),bV=wr();function xV(t){return typeof t.constructor=="function"&&!bV(t)?yV(CV(t)):{}}sx.exports=xV});var dx=g((kne,cx)=>{"use strict";var wV=hi(),SV=Mt(),IV="[object Map]";function TV(t){return SV(t)&&wV(t)==IV}cx.exports=TV});var fx=g((Mne,px)=>{"use strict";var EV=dx(),PV=Cr(),lx=Mp(),ux=lx&&lx.isMap,kV=ux?PV(ux):EV;px.exports=kV});var mx=g((Dne,hx)=>{"use strict";var MV=hi(),DV=Mt(),OV="[object Set]";function NV(t){return DV(t)&&MV(t)==OV}hx.exports=NV});var yx=g((One,vx)=>{"use strict";var RV=mx(),AV=Cr(),_x=Mp(),gx=_x&&_x.isSet,FV=gx?AV(gx):RV;vx.exports=FV});var $m=g((Nne,wx)=>{"use strict";var LV=mr(),BV=Pp(),zV=gr(),qV=eb(),VV=sb(),HV=Mm(),GV=Dm(),jV=vb(),UV=wb(),WV=Fm(),$V=Eb(),KV=hi(),YV=Gb(),XV=ox(),ZV=Wm(),QV=He(),JV=pi(),eH=fx(),tH=ft(),nH=yx(),iH=Qt(),oH=Rn(),rH=1,aH=2,sH=4,Cx="[object Arguments]",cH="[object Array]",dH="[object Boolean]",lH="[object Date]",uH="[object Error]",bx="[object Function]",pH="[object GeneratorFunction]",fH="[object Map]",hH="[object Number]",xx="[object Object]",mH="[object RegExp]",_H="[object Set]",gH="[object String]",vH="[object Symbol]",yH="[object WeakMap]",CH="[object ArrayBuffer]",bH="[object DataView]",xH="[object Float32Array]",wH="[object Float64Array]",SH="[object Int8Array]",IH="[object Int16Array]",TH="[object Int32Array]",EH="[object Uint8Array]",PH="[object Uint8ClampedArray]",kH="[object Uint16Array]",MH="[object Uint32Array]",Ie={};Ie[Cx]=Ie[cH]=Ie[CH]=Ie[bH]=Ie[dH]=Ie[lH]=Ie[xH]=Ie[wH]=Ie[SH]=Ie[IH]=Ie[TH]=Ie[fH]=Ie[hH]=Ie[xx]=Ie[mH]=Ie[_H]=Ie[gH]=Ie[vH]=Ie[EH]=Ie[PH]=Ie[kH]=Ie[MH]=!0;Ie[uH]=Ie[bx]=Ie[yH]=!1;function Ap(t,i,e,n,o,r){var a,s=i&rH,c=i&aH,u=i&sH;if(e&&(a=o?e(t,n,o,r):e(t)),a!==void 0)return a;if(!tH(t))return t;var p=QV(t);if(p){if(a=YV(t),!s)return GV(t,a)}else{var _=KV(t),b=_==bx||_==pH;if(JV(t))return HV(t,s);if(_==xx||_==Cx||b&&!o){if(a=c||b?{}:ZV(t),!s)return c?UV(t,VV(a,t)):jV(t,qV(a,t))}else{if(!Ie[_])return o?t:{};a=XV(t,_,s)}}r||(r=new LV);var k=r.get(t);if(k)return k;r.set(t,a),nH(t)?t.forEach(function(j){a.add(Ap(j,i,e,j,t,r))}):eH(t)&&t.forEach(function(j,z){a.set(z,Ap(j,i,e,z,t,r))});var P=u?c?$V:WV:c?oH:iH,N=p?void 0:P(t);return BV(N||t,function(j,z){N&&(z=j,j=t[z]),zV(a,z,Ap(j,i,e,z,t,r))}),a}wx.exports=Ap});var Ix=g((Rne,Sx)=>{"use strict";var DH=$m(),OH=4;function NH(t){return DH(t,OH)}Sx.exports=NH});var Fp=g((Ane,Tx)=>{"use strict";function RH(t){return function(){return t}}Tx.exports=RH});var Px=g((Fne,Ex)=>{"use strict";function AH(t){return function(i,e,n){for(var o=-1,r=Object(i),a=n(i),s=a.length;s--;){var c=a[t?s:++o];if(e(r[c],c,r)===!1)break}return i}}Ex.exports=AH});var Lp=g((Lne,kx)=>{"use strict";var FH=Px(),LH=FH();kx.exports=LH});var Bp=g((Bne,Mx)=>{"use strict";var BH=Lp(),zH=Qt();function qH(t,i){return t&&BH(t,i,zH)}Mx.exports=qH});var Ox=g((zne,Dx)=>{"use strict";var VH=Ht();function HH(t,i){return function(e,n){if(e==null)return e;if(!VH(e))return t(e,n);for(var o=e.length,r=i?o:-1,a=Object(e);(i?r--:++r<o)&&n(a[r],r,a)!==!1;);return e}}Dx.exports=HH});var Tr=g((qne,Nx)=>{"use strict";var GH=Bp(),jH=Ox(),UH=jH(GH);Nx.exports=UH});var An=g((Vne,Rx)=>{"use strict";function WH(t){return t}Rx.exports=WH});var Km=g((Hne,Ax)=>{"use strict";var $H=An();function KH(t){return typeof t=="function"?t:$H}Ax.exports=KH});var Ym=g((Gne,Fx)=>{"use strict";var YH=Pp(),XH=Tr(),ZH=Km(),QH=He();function JH(t,i){var e=QH(t)?YH:XH;return e(t,ZH(i))}Fx.exports=JH});var Xm=g((jne,Lx)=>{"use strict";Lx.exports=Ym()});var zx=g((Une,Bx)=>{"use strict";var eG=Tr();function tG(t,i){var e=[];return eG(t,function(n,o,r){i(n,o,r)&&e.push(n)}),e}Bx.exports=tG});var Vx=g((Wne,qx)=>{"use strict";var nG="__lodash_hash_undefined__";function iG(t){return this.__data__.set(t,nG),this}qx.exports=iG});var Gx=g(($ne,Hx)=>{"use strict";function oG(t){return this.__data__.has(t)}Hx.exports=oG});var Zm=g((Kne,jx)=>{"use strict";var rG=Ep(),aG=Vx(),sG=Gx();function zp(t){var i=-1,e=t==null?0:t.length;for(this.__data__=new rG;++i<e;)this.add(t[i])}zp.prototype.add=zp.prototype.push=aG;zp.prototype.has=sG;jx.exports=zp});var Wx=g((Yne,Ux)=>{"use strict";function cG(t,i){for(var e=-1,n=t==null?0:t.length;++e<n;)if(i(t[e],e,t))return!0;return!1}Ux.exports=cG});var Qm=g((Xne,$x)=>{"use strict";function dG(t,i){return t.has(i)}$x.exports=dG});var Jm=g((Zne,Kx)=>{"use strict";var lG=Zm(),uG=Wx(),pG=Qm(),fG=1,hG=2;function mG(t,i,e,n,o,r){var a=e&fG,s=t.length,c=i.length;if(s!=c&&!(a&&c>s))return!1;var u=r.get(t),p=r.get(i);if(u&&p)return u==i&&p==t;var _=-1,b=!0,k=e&hG?new lG:void 0;for(r.set(t,i),r.set(i,t);++_<s;){var P=t[_],N=i[_];if(n)var j=a?n(N,P,_,i,t,r):n(P,N,_,t,i,r);if(j!==void 0){if(j)continue;b=!1;break}if(k){if(!uG(i,function(z,U){if(!pG(k,U)&&(P===z||o(P,z,e,n,r)))return k.push(U)})){b=!1;break}}else if(!(P===N||o(P,N,e,n,r))){b=!1;break}}return r.delete(t),r.delete(i),b}Kx.exports=mG});var Xx=g((Qne,Yx)=>{"use strict";function _G(t){var i=-1,e=Array(t.size);return t.forEach(function(n,o){e[++i]=[o,n]}),e}Yx.exports=_G});var qp=g((Jne,Zx)=>{"use strict";function gG(t){var i=-1,e=Array(t.size);return t.forEach(function(n){e[++i]=n}),e}Zx.exports=gG});var nw=g((eie,tw)=>{"use strict";var Qx=ui(),Jx=Gm(),vG=li(),yG=Jm(),CG=Xx(),bG=qp(),xG=1,wG=2,SG="[object Boolean]",IG="[object Date]",TG="[object Error]",EG="[object Map]",PG="[object Number]",kG="[object RegExp]",MG="[object Set]",DG="[object String]",OG="[object Symbol]",NG="[object ArrayBuffer]",RG="[object DataView]",ew=Qx?Qx.prototype:void 0,e_=ew?ew.valueOf:void 0;function AG(t,i,e,n,o,r,a){switch(e){case RG:if(t.byteLength!=i.byteLength||t.byteOffset!=i.byteOffset)return!1;t=t.buffer,i=i.buffer;case NG:return!(t.byteLength!=i.byteLength||!r(new Jx(t),new Jx(i)));case SG:case IG:case PG:return vG(+t,+i);case TG:return t.name==i.name&&t.message==i.message;case kG:case DG:return t==i+"";case EG:var s=CG;case MG:var c=n&xG;if(s||(s=bG),t.size!=i.size&&!c)return!1;var u=a.get(t);if(u)return u==i;n|=wG,a.set(t,i);var p=yG(s(t),s(i),n,o,r,a);return a.delete(t),p;case OG:if(e_)return e_.call(t)==e_.call(i)}return!1}tw.exports=AG});var rw=g((tie,ow)=>{"use strict";var iw=Fm(),FG=1,LG=Object.prototype,BG=LG.hasOwnProperty;function zG(t,i,e,n,o,r){var a=e&FG,s=iw(t),c=s.length,u=iw(i),p=u.length;if(c!=p&&!a)return!1;for(var _=c;_--;){var b=s[_];if(!(a?b in i:BG.call(i,b)))return!1}var k=r.get(t),P=r.get(i);if(k&&P)return k==i&&P==t;var N=!0;r.set(t,i),r.set(i,t);for(var j=a;++_<c;){b=s[_];var z=t[b],U=i[b];if(n)var oe=a?n(U,z,b,i,t,r):n(z,U,b,t,i,r);if(!(oe===void 0?z===U||o(z,U,e,n,r):oe)){N=!1;break}j||(j=b=="constructor")}if(N&&!j){var Ce=t.constructor,le=i.constructor;Ce!=le&&"constructor"in t&&"constructor"in i&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof le=="function"&&le instanceof le)&&(N=!1)}return r.delete(t),r.delete(i),N}ow.exports=zG});var fw=g((nie,pw)=>{"use strict";var t_=mr(),qG=Jm(),VG=nw(),HG=rw(),aw=hi(),sw=He(),cw=pi(),GG=so(),jG=1,dw="[object Arguments]",lw="[object Array]",Vp="[object Object]",UG=Object.prototype,uw=UG.hasOwnProperty;function WG(t,i,e,n,o,r){var a=sw(t),s=sw(i),c=a?lw:aw(t),u=s?lw:aw(i);c=c==dw?Vp:c,u=u==dw?Vp:u;var p=c==Vp,_=u==Vp,b=c==u;if(b&&cw(t)){if(!cw(i))return!1;a=!0,p=!1}if(b&&!p)return r||(r=new t_),a||GG(t)?qG(t,i,e,n,o,r):VG(t,i,c,e,n,o,r);if(!(e&jG)){var k=p&&uw.call(t,"__wrapped__"),P=_&&uw.call(i,"__wrapped__");if(k||P){var N=k?t.value():t,j=P?i.value():i;return r||(r=new t_),o(N,j,e,n,r)}}return b?(r||(r=new t_),HG(t,i,e,n,o,r)):!1}pw.exports=WG});var n_=g((iie,_w)=>{"use strict";var $G=fw(),hw=Mt();function mw(t,i,e,n,o){return t===i?!0:t==null||i==null||!hw(t)&&!hw(i)?t!==t&&i!==i:$G(t,i,e,n,mw,o)}_w.exports=mw});var vw=g((oie,gw)=>{"use strict";var KG=mr(),YG=n_(),XG=1,ZG=2;function QG(t,i,e,n){var o=e.length,r=o,a=!n;if(t==null)return!r;for(t=Object(t);o--;){var s=e[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<r;){s=e[o];var c=s[0],u=t[c],p=s[1];if(a&&s[2]){if(u===void 0&&!(c in t))return!1}else{var _=new KG;if(n)var b=n(u,p,c,t,i,_);if(!(b===void 0?YG(p,u,XG|ZG,n,_):b))return!1}}return!0}gw.exports=QG});var i_=g((rie,yw)=>{"use strict";var JG=ft();function e4(t){return t===t&&!JG(t)}yw.exports=e4});var bw=g((aie,Cw)=>{"use strict";var t4=i_(),n4=Qt();function i4(t){for(var i=n4(t),e=i.length;e--;){var n=i[e],o=t[n];i[e]=[n,o,t4(o)]}return i}Cw.exports=i4});var o_=g((sie,xw)=>{"use strict";function o4(t,i){return function(e){return e==null?!1:e[t]===i&&(i!==void 0||t in Object(e))}}xw.exports=o4});var Sw=g((cie,ww)=>{"use strict";var r4=vw(),a4=bw(),s4=o_();function c4(t){var i=a4(t);return i.length==1&&i[0][2]?s4(i[0][0],i[0][1]):function(e){return e===t||r4(e,t,i)}}ww.exports=c4});var mi=g((die,Iw)=>{"use strict";var d4=On(),l4=Mt(),u4="[object Symbol]";function p4(t){return typeof t=="symbol"||l4(t)&&d4(t)==u4}Iw.exports=p4});var Hp=g((lie,Tw)=>{"use strict";var f4=He(),h4=mi(),m4=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_4=/^\w*$/;function g4(t,i){if(f4(t))return!1;var e=typeof t;return e=="number"||e=="symbol"||e=="boolean"||t==null||h4(t)?!0:_4.test(t)||!m4.test(t)||i!=null&&t in Object(i)}Tw.exports=g4});var kw=g((uie,Pw)=>{"use strict";var Ew=Ep(),v4="Expected a function";function r_(t,i){if(typeof t!="function"||i!=null&&typeof i!="function")throw new TypeError(v4);var e=function(){var n=arguments,o=i?i.apply(this,n):n[0],r=e.cache;if(r.has(o))return r.get(o);var a=t.apply(this,n);return e.cache=r.set(o,a)||r,a};return e.cache=new(r_.Cache||Ew),e}r_.Cache=Ew;Pw.exports=r_});var Dw=g((pie,Mw)=>{"use strict";var y4=kw(),C4=500;function b4(t){var i=y4(t,function(n){return e.size===C4&&e.clear(),n}),e=i.cache;return i}Mw.exports=b4});var Nw=g((fie,Ow)=>{"use strict";var x4=Dw(),w4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S4=/\\(\\)?/g,I4=x4(function(t){var i=[];return t.charCodeAt(0)===46&&i.push(""),t.replace(w4,function(e,n,o,r){i.push(o?r.replace(S4,"$1"):n||e)}),i});Ow.exports=I4});var Er=g((hie,Rw)=>{"use strict";function T4(t,i){for(var e=-1,n=t==null?0:t.length,o=Array(n);++e<n;)o[e]=i(t[e],e,t);return o}Rw.exports=T4});var qw=g((mie,zw)=>{"use strict";var Aw=ui(),E4=Er(),P4=He(),k4=mi(),M4=1/0,Fw=Aw?Aw.prototype:void 0,Lw=Fw?Fw.toString:void 0;function Bw(t){if(typeof t=="string")return t;if(P4(t))return E4(t,Bw)+"";if(k4(t))return Lw?Lw.call(t):"";var i=t+"";return i=="0"&&1/t==-M4?"-0":i}zw.exports=Bw});var a_=g((_ie,Vw)=>{"use strict";var D4=qw();function O4(t){return t==null?"":D4(t)}Vw.exports=O4});var Pr=g((gie,Hw)=>{"use strict";var N4=He(),R4=Hp(),A4=Nw(),F4=a_();function L4(t,i){return N4(t)?t:R4(t,i)?[t]:A4(F4(t))}Hw.exports=L4});var uo=g((vie,Gw)=>{"use strict";var B4=mi(),z4=1/0;function q4(t){if(typeof t=="string"||B4(t))return t;var i=t+"";return i=="0"&&1/t==-z4?"-0":i}Gw.exports=q4});var kr=g((yie,jw)=>{"use strict";var V4=Pr(),H4=uo();function G4(t,i){i=V4(i,t);for(var e=0,n=i.length;t!=null&&e<n;)t=t[H4(i[e++])];return e&&e==n?t:void 0}jw.exports=G4});var Ww=g((Cie,Uw)=>{"use strict";var j4=kr();function U4(t,i,e){var n=t==null?void 0:j4(t,i);return n===void 0?e:n}Uw.exports=U4});var Kw=g((bie,$w)=>{"use strict";function W4(t,i){return t!=null&&i in Object(t)}$w.exports=W4});var s_=g((xie,Yw)=>{"use strict";var $4=Pr(),K4=oo(),Y4=He(),X4=yr(),Z4=kp(),Q4=uo();function J4(t,i,e){i=$4(i,t);for(var n=-1,o=i.length,r=!1;++n<o;){var a=Q4(i[n]);if(!(r=t!=null&&e(t,a)))break;t=t[a]}return r||++n!=o?r:(o=t==null?0:t.length,!!o&&Z4(o)&&X4(a,o)&&(Y4(t)||K4(t)))}Yw.exports=J4});var c_=g((wie,Xw)=>{"use strict";var e5=Kw(),t5=s_();function n5(t,i){return t!=null&&t5(t,i,e5)}Xw.exports=n5});var Qw=g((Sie,Zw)=>{"use strict";var i5=n_(),o5=Ww(),r5=c_(),a5=Hp(),s5=i_(),c5=o_(),d5=uo(),l5=1,u5=2;function p5(t,i){return a5(t)&&s5(i)?c5(d5(t),i):function(e){var n=o5(e,t);return n===void 0&&n===i?r5(e,t):i5(i,n,l5|u5)}}Zw.exports=p5});var d_=g((Iie,Jw)=>{"use strict";function f5(t){return function(i){return i?.[t]}}Jw.exports=f5});var tS=g((Tie,eS)=>{"use strict";var h5=kr();function m5(t){return function(i){return h5(i,t)}}eS.exports=m5});var iS=g((Eie,nS)=>{"use strict";var _5=d_(),g5=tS(),v5=Hp(),y5=uo();function C5(t){return v5(t)?_5(y5(t)):g5(t)}nS.exports=C5});var Gt=g((Pie,oS)=>{"use strict";var b5=Sw(),x5=Qw(),w5=An(),S5=He(),I5=iS();function T5(t){return typeof t=="function"?t:t==null?w5:typeof t=="object"?S5(t)?x5(t[0],t[1]):b5(t):I5(t)}oS.exports=T5});var l_=g((kie,rS)=>{"use strict";var E5=Om(),P5=zx(),k5=Gt(),M5=He();function D5(t,i){var e=M5(t)?E5:P5;return e(t,k5(i,3))}rS.exports=D5});var sS=g((Mie,aS)=>{"use strict";var O5=Object.prototype,N5=O5.hasOwnProperty;function R5(t,i){return t!=null&&N5.call(t,i)}aS.exports=R5});var u_=g((Die,cS)=>{"use strict";var A5=sS(),F5=s_();function L5(t,i){return t!=null&&F5(t,i,A5)}cS.exports=L5});var lS=g((Oie,dS)=>{"use strict";var B5=Dp(),z5=hi(),q5=oo(),V5=He(),H5=Ht(),G5=pi(),j5=wr(),U5=so(),W5="[object Map]",$5="[object Set]",K5=Object.prototype,Y5=K5.hasOwnProperty;function X5(t){if(t==null)return!0;if(H5(t)&&(V5(t)||typeof t=="string"||typeof t.splice=="function"||G5(t)||U5(t)||q5(t)))return!t.length;var i=z5(t);if(i==W5||i==$5)return!t.size;if(j5(t))return!B5(t).length;for(var e in t)if(Y5.call(t,e))return!1;return!0}dS.exports=X5});var p_=g((Nie,uS)=>{"use strict";function Z5(t){return t===void 0}uS.exports=Z5});var f_=g((Rie,pS)=>{"use strict";var Q5=Tr(),J5=Ht();function ej(t,i){var e=-1,n=J5(t)?Array(t.length):[];return Q5(t,function(o,r,a){n[++e]=i(o,r,a)}),n}pS.exports=ej});var h_=g((Aie,fS)=>{"use strict";var tj=Er(),nj=Gt(),ij=f_(),oj=He();function rj(t,i){var e=oj(t)?tj:ij;return e(t,nj(i,3))}fS.exports=rj});var mS=g((Fie,hS)=>{"use strict";function aj(t,i,e,n){var o=-1,r=t==null?0:t.length;for(n&&r&&(e=t[++o]);++o<r;)e=i(e,t[o],o,t);return e}hS.exports=aj});var gS=g((Lie,_S)=>{"use strict";function sj(t,i,e,n,o){return o(t,function(r,a,s){e=n?(n=!1,r):i(e,r,a,s)}),e}_S.exports=sj});var m_=g((Bie,vS)=>{"use strict";var cj=mS(),dj=Tr(),lj=Gt(),uj=gS(),pj=He();function fj(t,i,e){var n=pj(t)?cj:uj,o=arguments.length<3;return n(t,lj(i,4),e,o,dj)}vS.exports=fj});var CS=g((zie,yS)=>{"use strict";var hj=On(),mj=He(),_j=Mt(),gj="[object String]";function vj(t){return typeof t=="string"||!mj(t)&&_j(t)&&hj(t)==gj}yS.exports=vj});var xS=g((qie,bS)=>{"use strict";var yj=d_(),Cj=yj("length");bS.exports=Cj});var SS=g((Vie,wS)=>{"use strict";var bj="\\ud800-\\udfff",xj="\\u0300-\\u036f",wj="\\ufe20-\\ufe2f",Sj="\\u20d0-\\u20ff",Ij=xj+wj+Sj,Tj="\\ufe0e\\ufe0f",Ej="\\u200d",Pj=RegExp("["+Ej+bj+Ij+Tj+"]");function kj(t){return Pj.test(t)}wS.exports=kj});var NS=g((Hie,OS)=>{"use strict";var TS="\\ud800-\\udfff",Mj="\\u0300-\\u036f",Dj="\\ufe20-\\ufe2f",Oj="\\u20d0-\\u20ff",Nj=Mj+Dj+Oj,Rj="\\ufe0e\\ufe0f",Aj="["+TS+"]",__="["+Nj+"]",g_="\\ud83c[\\udffb-\\udfff]",Fj="(?:"+__+"|"+g_+")",ES="[^"+TS+"]",PS="(?:\\ud83c[\\udde6-\\uddff]){2}",kS="[\\ud800-\\udbff][\\udc00-\\udfff]",Lj="\\u200d",MS=Fj+"?",DS="["+Rj+"]?",Bj="(?:"+Lj+"(?:"+[ES,PS,kS].join("|")+")"+DS+MS+")*",zj=DS+MS+Bj,qj="(?:"+[ES+__+"?",__,PS,kS,Aj].join("|")+")",IS=RegExp(g_+"(?="+g_+")|"+qj+zj,"g");function Vj(t){for(var i=IS.lastIndex=0;IS.test(t);)++i;return i}OS.exports=Vj});var AS=g((Gie,RS)=>{"use strict";var Hj=xS(),Gj=SS(),jj=NS();function Uj(t){return Gj(t)?jj(t):Hj(t)}RS.exports=Uj});var LS=g((jie,FS)=>{"use strict";var Wj=Dp(),$j=hi(),Kj=Ht(),Yj=CS(),Xj=AS(),Zj="[object Map]",Qj="[object Set]";function Jj(t){if(t==null)return 0;if(Kj(t))return Yj(t)?Xj(t):t.length;var i=$j(t);return i==Zj||i==Qj?t.size:Wj(t).length}FS.exports=Jj});var zS=g((Uie,BS)=>{"use strict";var eU=Pp(),tU=Um(),nU=Bp(),iU=Gt(),oU=Ir(),rU=He(),aU=pi(),sU=Ji(),cU=ft(),dU=so();function lU(t,i,e){var n=rU(t),o=n||aU(t)||dU(t);if(i=iU(i,4),e==null){var r=t&&t.constructor;o?e=n?new r:[]:cU(t)?e=sU(r)?tU(oU(t)):{}:e={}}return(o?eU:nU)(t,function(a,s,c){return i(e,a,s,c)}),e}BS.exports=lU});var GS=g((Wie,HS)=>{"use strict";var qS=ui(),uU=oo(),pU=He(),VS=qS?qS.isConcatSpreadable:void 0;function fU(t){return pU(t)||uU(t)||!!(VS&&t&&t[VS])}HS.exports=fU});var Gp=g(($ie,US)=>{"use strict";var hU=Np(),mU=GS();function jS(t,i,e,n,o){var r=-1,a=t.length;for(e||(e=mU),o||(o=[]);++r<a;){var s=t[r];i>0&&e(s)?i>1?jS(s,i-1,e,n,o):hU(o,s):n||(o[o.length]=s)}return o}US.exports=jS});var $S=g((Kie,WS)=>{"use strict";function _U(t,i,e){switch(e.length){case 0:return t.call(i);case 1:return t.call(i,e[0]);case 2:return t.call(i,e[0],e[1]);case 3:return t.call(i,e[0],e[1],e[2])}return t.apply(i,e)}WS.exports=_U});var v_=g((Yie,YS)=>{"use strict";var gU=$S(),KS=Math.max;function vU(t,i,e){return i=KS(i===void 0?t.length-1:i,0),function(){for(var n=arguments,o=-1,r=KS(n.length-i,0),a=Array(r);++o<r;)a[o]=n[i+o];o=-1;for(var s=Array(i+1);++o<i;)s[o]=n[o];return s[i]=e(a),gU(t,this,s)}}YS.exports=vU});var QS=g((Xie,ZS)=>{"use strict";var yU=Fp(),XS=Tm(),CU=An(),bU=XS?function(t,i){return XS(t,"toString",{configurable:!0,enumerable:!1,value:yU(i),writable:!0})}:CU;ZS.exports=bU});var eI=g((Zie,JS)=>{"use strict";var xU=800,wU=16,SU=Date.now;function IU(t){var i=0,e=0;return function(){var n=SU(),o=wU-(n-e);if(e=n,o>0){if(++i>=xU)return arguments[0]}else i=0;return t.apply(void 0,arguments)}}JS.exports=IU});var y_=g((Qie,tI)=>{"use strict";var TU=QS(),EU=eI(),PU=EU(TU);tI.exports=PU});var Mr=g((Jie,nI)=>{"use strict";var kU=An(),MU=v_(),DU=y_();function OU(t,i){return DU(MU(t,i,kU),t+"")}nI.exports=OU});var C_=g((eoe,iI)=>{"use strict";function NU(t,i,e,n){for(var o=t.length,r=e+(n?1:-1);n?r--:++r<o;)if(i(t[r],r,t))return r;return-1}iI.exports=NU});var rI=g((toe,oI)=>{"use strict";function RU(t){return t!==t}oI.exports=RU});var sI=g((noe,aI)=>{"use strict";function AU(t,i,e){for(var n=e-1,o=t.length;++n<o;)if(t[n]===i)return n;return-1}aI.exports=AU});var dI=g((ioe,cI)=>{"use strict";var FU=C_(),LU=rI(),BU=sI();function zU(t,i,e){return i===i?BU(t,i,e):FU(t,LU,e)}cI.exports=zU});var uI=g((ooe,lI)=>{"use strict";var qU=dI();function VU(t,i){var e=t==null?0:t.length;return!!e&&qU(t,i,0)>-1}lI.exports=VU});var fI=g((roe,pI)=>{"use strict";function HU(t,i,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(i,t[n]))return!0;return!1}pI.exports=HU});var mI=g((aoe,hI)=>{"use strict";function GU(){}hI.exports=GU});var gI=g((soe,_I)=>{"use strict";var b_=Lm(),jU=mI(),UU=qp(),WU=1/0,$U=b_&&1/UU(new b_([,-0]))[1]==WU?function(t){return new b_(t)}:jU;_I.exports=$U});var yI=g((coe,vI)=>{"use strict";var KU=Zm(),YU=uI(),XU=fI(),ZU=Qm(),QU=gI(),JU=qp(),eW=200;function tW(t,i,e){var n=-1,o=YU,r=t.length,a=!0,s=[],c=s;if(e)a=!1,o=XU;else if(r>=eW){var u=i?null:QU(t);if(u)return JU(u);a=!1,o=ZU,c=new KU}else c=i?[]:s;e:for(;++n<r;){var p=t[n],_=i?i(p):p;if(p=e||p!==0?p:0,a&&_===_){for(var b=c.length;b--;)if(c[b]===_)continue e;i&&c.push(_),s.push(p)}else o(c,_,e)||(c!==s&&c.push(_),s.push(p))}return s}vI.exports=tW});var x_=g((doe,CI)=>{"use strict";var nW=Ht(),iW=Mt();function oW(t){return iW(t)&&nW(t)}CI.exports=oW});var xI=g((loe,bI)=>{"use strict";var rW=Gp(),aW=Mr(),sW=yI(),cW=x_(),dW=aW(function(t){return sW(rW(t,1,cW,!0))});bI.exports=dW});var SI=g((uoe,wI)=>{"use strict";var lW=Er();function uW(t,i){return lW(i,function(e){return t[e]})}wI.exports=uW});var w_=g((poe,II)=>{"use strict";var pW=SI(),fW=Qt();function hW(t){return t==null?[]:pW(t,fW(t))}II.exports=hW});var ht=g((foe,TI)=>{"use strict";var jp;if(typeof yi=="function")try{jp={clone:Ix(),constant:Fp(),each:Xm(),filter:l_(),has:u_(),isArray:He(),isEmpty:lS(),isFunction:Ji(),isUndefined:p_(),keys:Qt(),map:h_(),reduce:m_(),size:LS(),transform:zS(),union:xI(),values:w_()}}catch{}jp||(jp=window._);TI.exports=jp});var Up=g((moe,MI)=>{"use strict";var te=ht();MI.exports=ce;var mW="\0",_i="\0",EI="";function ce(t){this._isDirected=te.has(t,"directed")?t.directed:!0,this._isMultigraph=te.has(t,"multigraph")?t.multigraph:!1,this._isCompound=te.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=te.constant(void 0),this._defaultEdgeLabelFn=te.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[_i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}ce.prototype._nodeCount=0;ce.prototype._edgeCount=0;ce.prototype.isDirected=function(){return this._isDirected};ce.prototype.isMultigraph=function(){return this._isMultigraph};ce.prototype.isCompound=function(){return this._isCompound};ce.prototype.setGraph=function(t){return this._label=t,this};ce.prototype.graph=function(){return this._label};ce.prototype.setDefaultNodeLabel=function(t){return te.isFunction(t)||(t=te.constant(t)),this._defaultNodeLabelFn=t,this};ce.prototype.nodeCount=function(){return this._nodeCount};ce.prototype.nodes=function(){return te.keys(this._nodes)};ce.prototype.sources=function(){var t=this;return te.filter(this.nodes(),function(i){return te.isEmpty(t._in[i])})};ce.prototype.sinks=function(){var t=this;return te.filter(this.nodes(),function(i){return te.isEmpty(t._out[i])})};ce.prototype.setNodes=function(t,i){var e=arguments,n=this;return te.each(t,function(o){e.length>1?n.setNode(o,i):n.setNode(o)}),this};ce.prototype.setNode=function(t,i){return te.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=i),this):(this._nodes[t]=arguments.length>1?i:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=_i,this._children[t]={},this._children[_i][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};ce.prototype.node=function(t){return this._nodes[t]};ce.prototype.hasNode=function(t){return te.has(this._nodes,t)};ce.prototype.removeNode=function(t){var i=this;if(te.has(this._nodes,t)){var e=function(n){i.removeEdge(i._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],te.each(this.children(t),function(n){i.setParent(n)}),delete this._children[t]),te.each(te.keys(this._in[t]),e),delete this._in[t],delete this._preds[t],te.each(te.keys(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};ce.prototype.setParent=function(t,i){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(te.isUndefined(i))i=_i;else{i+="";for(var e=i;!te.isUndefined(e);e=this.parent(e))if(e===t)throw new Error("Setting "+i+" as parent of "+t+" would create a cycle");this.setNode(i)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=i,this._children[i][t]=!0,this};ce.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};ce.prototype.parent=function(t){if(this._isCompound){var i=this._parent[t];if(i!==_i)return i}};ce.prototype.children=function(t){if(te.isUndefined(t)&&(t=_i),this._isCompound){var i=this._children[t];if(i)return te.keys(i)}else{if(t===_i)return this.nodes();if(this.hasNode(t))return[]}};ce.prototype.predecessors=function(t){var i=this._preds[t];if(i)return te.keys(i)};ce.prototype.successors=function(t){var i=this._sucs[t];if(i)return te.keys(i)};ce.prototype.neighbors=function(t){var i=this.predecessors(t);if(i)return te.union(i,this.successors(t))};ce.prototype.isLeaf=function(t){var i;return this.isDirected()?i=this.successors(t):i=this.neighbors(t),i.length===0};ce.prototype.filterNodes=function(t){var i=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});i.setGraph(this.graph());var e=this;te.each(this._nodes,function(r,a){t(a)&&i.setNode(a,r)}),te.each(this._edgeObjs,function(r){i.hasNode(r.v)&&i.hasNode(r.w)&&i.setEdge(r,e.edge(r))});var n={};function o(r){var a=e.parent(r);return a===void 0||i.hasNode(a)?(n[r]=a,a):a in n?n[a]:o(a)}return this._isCompound&&te.each(i.nodes(),function(r){i.setParent(r,o(r))}),i};ce.prototype.setDefaultEdgeLabel=function(t){return te.isFunction(t)||(t=te.constant(t)),this._defaultEdgeLabelFn=t,this};ce.prototype.edgeCount=function(){return this._edgeCount};ce.prototype.edges=function(){return te.values(this._edgeObjs)};ce.prototype.setPath=function(t,i){var e=this,n=arguments;return te.reduce(t,function(o,r){return n.length>1?e.setEdge(o,r,i):e.setEdge(o,r),r}),this};ce.prototype.setEdge=function(){var t,i,e,n,o=!1,r=arguments[0];typeof r=="object"&&r!==null&&"v"in r?(t=r.v,i=r.w,e=r.name,arguments.length===2&&(n=arguments[1],o=!0)):(t=r,i=arguments[1],e=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),t=""+t,i=""+i,te.isUndefined(e)||(e=""+e);var a=Dr(this._isDirected,t,i,e);if(te.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=n),this;if(!te.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(i),this._edgeLabels[a]=o?n:this._defaultEdgeLabelFn(t,i,e);var s=_W(this._isDirected,t,i,e);return t=s.v,i=s.w,Object.freeze(s),this._edgeObjs[a]=s,PI(this._preds[i],t),PI(this._sucs[t],i),this._in[i][a]=s,this._out[t][a]=s,this._edgeCount++,this};ce.prototype.edge=function(t,i,e){var n=arguments.length===1?S_(this._isDirected,arguments[0]):Dr(this._isDirected,t,i,e);return this._edgeLabels[n]};ce.prototype.hasEdge=function(t,i,e){var n=arguments.length===1?S_(this._isDirected,arguments[0]):Dr(this._isDirected,t,i,e);return te.has(this._edgeLabels,n)};ce.prototype.removeEdge=function(t,i,e){var n=arguments.length===1?S_(this._isDirected,arguments[0]):Dr(this._isDirected,t,i,e),o=this._edgeObjs[n];return o&&(t=o.v,i=o.w,delete this._edgeLabels[n],delete this._edgeObjs[n],kI(this._preds[i],t),kI(this._sucs[t],i),delete this._in[i][n],delete this._out[t][n],this._edgeCount--),this};ce.prototype.inEdges=function(t,i){var e=this._in[t];if(e){var n=te.values(e);return i?te.filter(n,function(o){return o.v===i}):n}};ce.prototype.outEdges=function(t,i){var e=this._out[t];if(e){var n=te.values(e);return i?te.filter(n,function(o){return o.w===i}):n}};ce.prototype.nodeEdges=function(t,i){var e=this.inEdges(t,i);if(e)return e.concat(this.outEdges(t,i))};function PI(t,i){t[i]?t[i]++:t[i]=1}function kI(t,i){--t[i]||delete t[i]}function Dr(t,i,e,n){var o=""+i,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}return o+EI+r+EI+(te.isUndefined(n)?mW:n)}function _W(t,i,e,n){var o=""+i,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}var s={v:o,w:r};return n&&(s.name=n),s}function S_(t,i){return Dr(t,i.v,i.w,i.name)}});var OI=g((_oe,DI)=>{"use strict";DI.exports="2.1.8"});var RI=g((goe,NI)=>{"use strict";NI.exports={Graph:Up(),version:OI()}});var FI=g((voe,AI)=>{"use strict";var jt=ht(),gW=Up();AI.exports={write:vW,read:bW};function vW(t){var i={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yW(t),edges:CW(t)};return jt.isUndefined(t.graph())||(i.value=jt.clone(t.graph())),i}function yW(t){return jt.map(t.nodes(),function(i){var e=t.node(i),n=t.parent(i),o={v:i};return jt.isUndefined(e)||(o.value=e),jt.isUndefined(n)||(o.parent=n),o})}function CW(t){return jt.map(t.edges(),function(i){var e=t.edge(i),n={v:i.v,w:i.w};return jt.isUndefined(i.name)||(n.name=i.name),jt.isUndefined(e)||(n.value=e),n})}function bW(t){var i=new gW(t.options).setGraph(t.value);return jt.each(t.nodes,function(e){i.setNode(e.v,e.value),e.parent&&i.setParent(e.v,e.parent)}),jt.each(t.edges,function(e){i.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),i}});var BI=g((yoe,LI)=>{"use strict";var Wp=ht();LI.exports=xW;function xW(t){var i={},e=[],n;function o(r){Wp.has(i,r)||(i[r]=!0,n.push(r),Wp.each(t.successors(r),o),Wp.each(t.predecessors(r),o))}return Wp.each(t.nodes(),function(r){n=[],o(r),n.length&&e.push(n)}),e}});var I_=g((Coe,qI)=>{"use strict";var zI=ht();qI.exports=wt;function wt(){this._arr=[],this._keyIndices={}}wt.prototype.size=function(){return this._arr.length};wt.prototype.keys=function(){return this._arr.map(function(t){return t.key})};wt.prototype.has=function(t){return zI.has(this._keyIndices,t)};wt.prototype.priority=function(t){var i=this._keyIndices[t];if(i!==void 0)return this._arr[i].priority};wt.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};wt.prototype.add=function(t,i){var e=this._keyIndices;if(t=String(t),!zI.has(e,t)){var n=this._arr,o=n.length;return e[t]=o,n.push({key:t,priority:i}),this._decrease(o),!0}return!1};wt.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};wt.prototype.decrease=function(t,i){var e=this._keyIndices[t];if(i>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+i);this._arr[e].priority=i,this._decrease(e)};wt.prototype._heapify=function(t){var i=this._arr,e=2*t,n=e+1,o=t;e<i.length&&(o=i[e].priority<i[o].priority?e:o,n<i.length&&(o=i[n].priority<i[o].priority?n:o),o!==t&&(this._swap(t,o),this._heapify(o)))};wt.prototype._decrease=function(t){for(var i=this._arr,e=i[t].priority,n;t!==0&&(n=t>>1,!(i[n].priority<e));)this._swap(t,n),t=n};wt.prototype._swap=function(t,i){var e=this._arr,n=this._keyIndices,o=e[t],r=e[i];e[t]=r,e[i]=o,n[r.key]=t,n[o.key]=i}});var T_=g((boe,VI)=>{"use strict";var wW=ht(),SW=I_();VI.exports=TW;var IW=wW.constant(1);function TW(t,i,e,n){return EW(t,String(i),e||IW,n||function(o){return t.outEdges(o)})}function EW(t,i,e,n){var o={},r=new SW,a,s,c=function(u){var p=u.v!==a?u.v:u.w,_=o[p],b=e(u),k=s.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+b);k<_.distance&&(_.distance=k,_.predecessor=a,r.decrease(p,k))};for(t.nodes().forEach(function(u){var p=u===i?0:Number.POSITIVE_INFINITY;o[u]={distance:p},r.add(u,p)});r.size()>0&&(a=r.removeMin(),s=o[a],s.distance!==Number.POSITIVE_INFINITY);)n(a).forEach(c);return o}});var GI=g((xoe,HI)=>{"use strict";var PW=T_(),kW=ht();HI.exports=MW;function MW(t,i,e){return kW.transform(t.nodes(),function(n,o){n[o]=PW(t,o,i,e)},{})}});var E_=g((woe,UI)=>{"use strict";var jI=ht();UI.exports=DW;function DW(t){var i=0,e=[],n={},o=[];function r(a){var s=n[a]={onStack:!0,lowlink:i,index:i++};if(e.push(a),t.successors(a).forEach(function(p){jI.has(n,p)?n[p].onStack&&(s.lowlink=Math.min(s.lowlink,n[p].index)):(r(p),s.lowlink=Math.min(s.lowlink,n[p].lowlink))}),s.lowlink===s.index){var c=[],u;do u=e.pop(),n[u].onStack=!1,c.push(u);while(a!==u);o.push(c)}}return t.nodes().forEach(function(a){jI.has(n,a)||r(a)}),o}});var $I=g((Soe,WI)=>{"use strict";var OW=ht(),NW=E_();WI.exports=RW;function RW(t){return OW.filter(NW(t),function(i){return i.length>1||i.length===1&&t.hasEdge(i[0],i[0])})}});var YI=g((Ioe,KI)=>{"use strict";var AW=ht();KI.exports=LW;var FW=AW.constant(1);function LW(t,i,e){return BW(t,i||FW,e||function(n){return t.outEdges(n)})}function BW(t,i,e){var n={},o=t.nodes();return o.forEach(function(r){n[r]={},n[r][r]={distance:0},o.forEach(function(a){r!==a&&(n[r][a]={distance:Number.POSITIVE_INFINITY})}),e(r).forEach(function(a){var s=a.v===r?a.w:a.v,c=i(a);n[r][s]={distance:c,predecessor:r}})}),o.forEach(function(r){var a=n[r];o.forEach(function(s){var c=n[s];o.forEach(function(u){var p=c[r],_=a[u],b=c[u],k=p.distance+_.distance;k<b.distance&&(b.distance=k,b.predecessor=_.predecessor)})})}),n}});var P_=g((Toe,ZI)=>{"use strict";var Or=ht();ZI.exports=XI;XI.CycleException=$p;function XI(t){var i={},e={},n=[];function o(r){if(Or.has(e,r))throw new $p;Or.has(i,r)||(e[r]=!0,i[r]=!0,Or.each(t.predecessors(r),o),delete e[r],n.push(r))}if(Or.each(t.sinks(),o),Or.size(i)!==t.nodeCount())throw new $p;return n}function $p(){}$p.prototype=new Error});var eT=g((Eoe,JI)=>{"use strict";var QI=P_();JI.exports=zW;function zW(t){try{QI(t)}catch(i){if(i instanceof QI.CycleException)return!1;throw i}return!0}});var k_=g((Poe,nT)=>{"use strict";var Kp=ht();nT.exports=qW;function qW(t,i,e){Kp.isArray(i)||(i=[i]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],r={};return Kp.each(i,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);tT(t,a,e==="post",r,n,o)}),o}function tT(t,i,e,n,o,r){Kp.has(n,i)||(n[i]=!0,e||r.push(i),Kp.each(o(i),function(a){tT(t,a,e,n,o,r)}),e&&r.push(i))}});var oT=g((koe,iT)=>{"use strict";var VW=k_();iT.exports=HW;function HW(t,i){return VW(t,i,"post")}});var aT=g((Moe,rT)=>{"use strict";var GW=k_();rT.exports=jW;function jW(t,i){return GW(t,i,"pre")}});var dT=g((Doe,cT)=>{"use strict";var sT=ht(),UW=Up(),WW=I_();cT.exports=$W;function $W(t,i){var e=new UW,n={},o=new WW,r;function a(c){var u=c.v===r?c.w:c.v,p=o.priority(u);if(p!==void 0){var _=i(c);_<p&&(n[u]=r,o.decrease(u,_))}}if(t.nodeCount()===0)return e;sT.each(t.nodes(),function(c){o.add(c,Number.POSITIVE_INFINITY),e.setNode(c)}),o.decrease(t.nodes()[0],0);for(var s=!1;o.size()>0;){if(r=o.removeMin(),sT.has(n,r))e.setEdge(r,n[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return e}});var uT=g((Ooe,lT)=>{"use strict";lT.exports={components:BI(),dijkstra:T_(),dijkstraAll:GI(),findCycles:$I(),floydWarshall:YI(),isAcyclic:eT(),postorder:oT(),preorder:aT(),prim:dT(),tarjan:E_(),topsort:P_()}});var hT=g((Noe,fT)=>{"use strict";var pT=RI();fT.exports={Graph:pT.Graph,json:FI(),alg:uT(),version:pT.version}});var St=g((Roe,mT)=>{"use strict";var Yp;if(typeof yi=="function")try{Yp=hT()}catch{}Yp||(Yp=window.graphlib);mT.exports=Yp});var gT=g((Foe,_T)=>{"use strict";var KW=$m(),YW=1,XW=4;function ZW(t){return KW(t,YW|XW)}_T.exports=ZW});var Nr=g((Loe,vT)=>{"use strict";var QW=li(),JW=Ht(),e$=yr(),t$=ft();function n$(t,i,e){if(!t$(e))return!1;var n=typeof i;return(n=="number"?JW(e)&&e$(i,e.length):n=="string"&&i in e)?QW(e[i],t):!1}vT.exports=n$});var bT=g((Boe,CT)=>{"use strict";var i$=Mr(),o$=li(),r$=Nr(),a$=Rn(),yT=Object.prototype,s$=yT.hasOwnProperty,c$=i$(function(t,i){t=Object(t);var e=-1,n=i.length,o=n>2?i[2]:void 0;for(o&&r$(i[0],i[1],o)&&(n=1);++e<n;)for(var r=i[e],a=a$(r),s=-1,c=a.length;++s<c;){var u=a[s],p=t[u];(p===void 0||o$(p,yT[u])&&!s$.call(t,u))&&(t[u]=r[u])}return t});CT.exports=c$});var wT=g((zoe,xT)=>{"use strict";var d$=Gt(),l$=Ht(),u$=Qt();function p$(t){return function(i,e,n){var o=Object(i);if(!l$(i)){var r=d$(e,3);i=u$(i),e=function(s){return r(o[s],s,o)}}var a=t(i,e,n);return a>-1?o[r?i[a]:a]:void 0}}xT.exports=p$});var IT=g((qoe,ST)=>{"use strict";var f$=/\s/;function h$(t){for(var i=t.length;i--&&f$.test(t.charAt(i)););return i}ST.exports=h$});var ET=g((Voe,TT)=>{"use strict";var m$=IT(),_$=/^\s+/;function g$(t){return t&&t.slice(0,m$(t)+1).replace(_$,"")}TT.exports=g$});var DT=g((Hoe,MT)=>{"use strict";var v$=ET(),PT=ft(),y$=mi(),kT=NaN,C$=/^[-+]0x[0-9a-f]+$/i,b$=/^0b[01]+$/i,x$=/^0o[0-7]+$/i,w$=parseInt;function S$(t){if(typeof t=="number")return t;if(y$(t))return kT;if(PT(t)){var i=typeof t.valueOf=="function"?t.valueOf():t;t=PT(i)?i+"":i}if(typeof t!="string")return t===0?t:+t;t=v$(t);var e=b$.test(t);return e||x$.test(t)?w$(t.slice(2),e?2:8):C$.test(t)?kT:+t}MT.exports=S$});var M_=g((Goe,NT)=>{"use strict";var I$=DT(),OT=1/0,T$=17976931348623157e292;function E$(t){if(!t)return t===0?t:0;if(t=I$(t),t===OT||t===-OT){var i=t<0?-1:1;return i*T$}return t===t?t:0}NT.exports=E$});var AT=g((joe,RT)=>{"use strict";var P$=M_();function k$(t){var i=P$(t),e=i%1;return i===i?e?i-e:i:0}RT.exports=k$});var LT=g((Uoe,FT)=>{"use strict";var M$=C_(),D$=Gt(),O$=AT(),N$=Math.max;function R$(t,i,e){var n=t==null?0:t.length;if(!n)return-1;var o=e==null?0:O$(e);return o<0&&(o=N$(n+o,0)),M$(t,D$(i,3),o)}FT.exports=R$});var zT=g((Woe,BT)=>{"use strict";var A$=wT(),F$=LT(),L$=A$(F$);BT.exports=L$});var D_=g(($oe,qT)=>{"use strict";var B$=Gp();function z$(t){var i=t==null?0:t.length;return i?B$(t,1):[]}qT.exports=z$});var HT=g((Koe,VT)=>{"use strict";var q$=Lp(),V$=Km(),H$=Rn();function G$(t,i){return t==null?t:q$(t,V$(i),H$)}VT.exports=G$});var jT=g((Yoe,GT)=>{"use strict";function j$(t){var i=t==null?0:t.length;return i?t[i-1]:void 0}GT.exports=j$});var WT=g((Xoe,UT)=>{"use strict";var U$=_r(),W$=Bp(),$$=Gt();function K$(t,i){var e={};return i=$$(i,3),W$(t,function(n,o,r){U$(e,o,i(n,o,r))}),e}UT.exports=K$});var Xp=g((Zoe,$T)=>{"use strict";var Y$=mi();function X$(t,i,e){for(var n=-1,o=t.length;++n<o;){var r=t[n],a=i(r);if(a!=null&&(s===void 0?a===a&&!Y$(a):e(a,s)))var s=a,c=r}return c}$T.exports=X$});var YT=g((Qoe,KT)=>{"use strict";function Z$(t,i){return t>i}KT.exports=Z$});var ZT=g((Joe,XT)=>{"use strict";var Q$=Xp(),J$=YT(),e6=An();function t6(t){return t&&t.length?Q$(t,e6,J$):void 0}XT.exports=t6});var O_=g((ere,QT)=>{"use strict";var n6=_r(),i6=li();function o6(t,i,e){(e!==void 0&&!i6(t[i],e)||e===void 0&&!(i in t))&&n6(t,i,e)}QT.exports=o6});var t1=g((tre,e1)=>{"use strict";var r6=On(),a6=Ir(),s6=Mt(),c6="[object Object]",d6=Function.prototype,l6=Object.prototype,JT=d6.toString,u6=l6.hasOwnProperty,p6=JT.call(Object);function f6(t){if(!s6(t)||r6(t)!=c6)return!1;var i=a6(t);if(i===null)return!0;var e=u6.call(i,"constructor")&&i.constructor;return typeof e=="function"&&e instanceof e&&JT.call(e)==p6}e1.exports=f6});var N_=g((nre,n1)=>{"use strict";function h6(t,i){if(!(i==="constructor"&&typeof t[i]=="function")&&i!="__proto__")return t[i]}n1.exports=h6});var o1=g((ire,i1)=>{"use strict";var m6=io(),_6=Rn();function g6(t){return m6(t,_6(t))}i1.exports=g6});var l1=g((ore,d1)=>{"use strict";var r1=O_(),v6=Mm(),y6=jm(),C6=Dm(),b6=Wm(),a1=oo(),s1=He(),x6=x_(),w6=pi(),S6=Ji(),I6=ft(),T6=t1(),E6=so(),c1=N_(),P6=o1();function k6(t,i,e,n,o,r,a){var s=c1(t,e),c=c1(i,e),u=a.get(c);if(u){r1(t,e,u);return}var p=r?r(s,c,e+"",t,i,a):void 0,_=p===void 0;if(_){var b=s1(c),k=!b&&w6(c),P=!b&&!k&&E6(c);p=c,b||k||P?s1(s)?p=s:x6(s)?p=C6(s):k?(_=!1,p=v6(c,!0)):P?(_=!1,p=y6(c,!0)):p=[]:T6(c)||a1(c)?(p=s,a1(s)?p=P6(s):(!I6(s)||S6(s))&&(p=b6(c))):_=!1}_&&(a.set(c,p),o(p,c,n,r,a),a.delete(c)),r1(t,e,p)}d1.exports=k6});var f1=g((rre,p1)=>{"use strict";var M6=mr(),D6=O_(),O6=Lp(),N6=l1(),R6=ft(),A6=Rn(),F6=N_();function u1(t,i,e,n,o){t!==i&&O6(i,function(r,a){if(o||(o=new M6),R6(r))N6(t,i,a,e,u1,n,o);else{var s=n?n(F6(t,a),r,a+"",t,i,o):void 0;s===void 0&&(s=r),D6(t,a,s)}},A6)}p1.exports=u1});var m1=g((are,h1)=>{"use strict";var L6=Mr(),B6=Nr();function z6(t){return L6(function(i,e){var n=-1,o=e.length,r=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(r=t.length>3&&typeof r=="function"?(o--,r):void 0,a&&B6(e[0],e[1],a)&&(r=o<3?void 0:r,o=1),i=Object(i);++n<o;){var s=e[n];s&&t(i,s,n,r)}return i})}h1.exports=z6});var g1=g((sre,_1)=>{"use strict";var q6=f1(),V6=m1(),H6=V6(function(t,i,e){q6(t,i,e)});_1.exports=H6});var R_=g((cre,v1)=>{"use strict";function G6(t,i){return t<i}v1.exports=G6});var C1=g((dre,y1)=>{"use strict";var j6=Xp(),U6=R_(),W6=An();function $6(t){return t&&t.length?j6(t,W6,U6):void 0}y1.exports=$6});var x1=g((lre,b1)=>{"use strict";var K6=Xp(),Y6=Gt(),X6=R_();function Z6(t,i){return t&&t.length?K6(t,Y6(i,2),X6):void 0}b1.exports=Z6});var S1=g((ure,w1)=>{"use strict";var Q6=xt(),J6=function(){return Q6.Date.now()};w1.exports=J6});var E1=g((pre,T1)=>{"use strict";var e8=gr(),t8=Pr(),n8=yr(),I1=ft(),i8=uo();function o8(t,i,e,n){if(!I1(t))return t;i=t8(i,t);for(var o=-1,r=i.length,a=r-1,s=t;s!=null&&++o<r;){var c=i8(i[o]),u=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=a){var p=s[c];u=n?n(p,c,s):void 0,u===void 0&&(u=I1(p)?p:n8(i[o+1])?[]:{})}e8(s,c,u),s=s[c]}return t}T1.exports=o8});var k1=g((fre,P1)=>{"use strict";var r8=kr(),a8=E1(),s8=Pr();function c8(t,i,e){for(var n=-1,o=i.length,r={};++n<o;){var a=i[n],s=r8(t,a);e(s,a)&&a8(r,s8(a,t),s)}return r}P1.exports=c8});var D1=g((hre,M1)=>{"use strict";var d8=k1(),l8=c_();function u8(t,i){return d8(t,i,function(e,n){return l8(t,n)})}M1.exports=u8});var N1=g((mre,O1)=>{"use strict";var p8=D_(),f8=v_(),h8=y_();function m8(t){return h8(f8(t,void 0,p8),t+"")}O1.exports=m8});var A1=g((_re,R1)=>{"use strict";var _8=D1(),g8=N1(),v8=g8(function(t,i){return t==null?{}:_8(t,i)});R1.exports=v8});var L1=g((gre,F1)=>{"use strict";var y8=Math.ceil,C8=Math.max;function b8(t,i,e,n){for(var o=-1,r=C8(y8((i-t)/(e||1)),0),a=Array(r);r--;)a[n?r:++o]=t,t+=e;return a}F1.exports=b8});var z1=g((vre,B1)=>{"use strict";var x8=L1(),w8=Nr(),A_=M_();function S8(t){return function(i,e,n){return n&&typeof n!="number"&&w8(i,e,n)&&(e=n=void 0),i=A_(i),e===void 0?(e=i,i=0):e=A_(e),n=n===void 0?i<e?1:-1:A_(n),x8(i,e,n,t)}}B1.exports=S8});var V1=g((yre,q1)=>{"use strict";var I8=z1(),T8=I8();q1.exports=T8});var G1=g((Cre,H1)=>{"use strict";function E8(t,i){var e=t.length;for(t.sort(i);e--;)t[e]=t[e].value;return t}H1.exports=E8});var W1=g((bre,U1)=>{"use strict";var j1=mi();function P8(t,i){if(t!==i){var e=t!==void 0,n=t===null,o=t===t,r=j1(t),a=i!==void 0,s=i===null,c=i===i,u=j1(i);if(!s&&!u&&!r&&t>i||r&&a&&c&&!s&&!u||n&&a&&c||!e&&c||!o)return 1;if(!n&&!r&&!u&&t<i||u&&e&&o&&!n&&!r||s&&e&&o||!a&&o||!c)return-1}return 0}U1.exports=P8});var K1=g((xre,$1)=>{"use strict";var k8=W1();function M8(t,i,e){for(var n=-1,o=t.criteria,r=i.criteria,a=o.length,s=e.length;++n<a;){var c=k8(o[n],r[n]);if(c){if(n>=s)return c;var u=e[n];return c*(u=="desc"?-1:1)}}return t.index-i.index}$1.exports=M8});var X1=g((wre,Y1)=>{"use strict";var F_=Er(),D8=kr(),O8=Gt(),N8=f_(),R8=G1(),A8=Cr(),F8=K1(),L8=An(),B8=He();function z8(t,i,e){i.length?i=F_(i,function(r){return B8(r)?function(a){return D8(a,r.length===1?r[0]:r)}:r}):i=[L8];var n=-1;i=F_(i,A8(O8));var o=N8(t,function(r,a,s){var c=F_(i,function(u){return u(r)});return{criteria:c,index:++n,value:r}});return R8(o,function(r,a){return F8(r,a,e)})}Y1.exports=z8});var J1=g((Sre,Q1)=>{"use strict";var q8=Gp(),V8=X1(),H8=Mr(),Z1=Nr(),G8=H8(function(t,i){if(t==null)return[];var e=i.length;return e>1&&Z1(t,i[0],i[1])?i=[]:e>2&&Z1(i[0],i[1],i[2])&&(i=[i[0]]),V8(t,q8(i,1),[])});Q1.exports=G8});var tE=g((Ire,eE)=>{"use strict";var j8=a_(),U8=0;function W8(t){var i=++U8;return j8(t)+i}eE.exports=W8});var iE=g((Tre,nE)=>{"use strict";function $8(t,i,e){for(var n=-1,o=t.length,r=i.length,a={};++n<o;){var s=n<r?i[n]:void 0;e(a,t[n],s)}return a}nE.exports=$8});var rE=g((Ere,oE)=>{"use strict";var K8=gr(),Y8=iE();function X8(t,i){return Y8(t||[],i||[],K8)}oE.exports=X8});var Me=g((Pre,aE)=>{"use strict";var Zp;if(typeof yi=="function")try{Zp={cloneDeep:gT(),constant:Fp(),defaults:bT(),each:Xm(),filter:l_(),find:zT(),flatten:D_(),forEach:Ym(),forIn:HT(),has:u_(),isUndefined:p_(),last:jT(),map:h_(),mapValues:WT(),max:ZT(),merge:g1(),min:C1(),minBy:x1(),now:S1(),pick:A1(),range:V1(),reduce:m_(),sortBy:J1(),uniqueId:tE(),values:w_(),zipObject:rE()}}catch{}Zp||(Zp=window._);aE.exports=Zp});var dE=g((Mre,cE)=>{"use strict";cE.exports=Qp;function Qp(){var t={};t._next=t._prev=t,this._sentinel=t}Qp.prototype.dequeue=function(){var t=this._sentinel,i=t._prev;if(i!==t)return sE(i),i};Qp.prototype.enqueue=function(t){var i=this._sentinel;t._prev&&t._next&&sE(t),t._next=i._next,i._next._prev=t,i._next=t,t._prev=i};Qp.prototype.toString=function(){for(var t=[],i=this._sentinel,e=i._prev;e!==i;)t.push(JSON.stringify(e,Z8)),e=e._prev;return"["+t.join(", ")+"]"};function sE(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Z8(t,i){if(t!=="_next"&&t!=="_prev")return i}});var uE=g((Dre,lE)=>{"use strict";var Jt=Me(),Q8=St().Graph,J8=dE();lE.exports=t7;var e7=Jt.constant(1);function t7(t,i){if(t.nodeCount()<=1)return[];var e=i7(t,i||e7),n=n7(e.graph,e.buckets,e.zeroIdx);return Jt.flatten(Jt.map(n,function(o){return t.outEdges(o.v,o.w)}),!0)}function n7(t,i,e){for(var n=[],o=i[i.length-1],r=i[0],a;t.nodeCount();){for(;a=r.dequeue();)L_(t,i,e,a);for(;a=o.dequeue();)L_(t,i,e,a);if(t.nodeCount()){for(var s=i.length-2;s>0;--s)if(a=i[s].dequeue(),a){n=n.concat(L_(t,i,e,a,!0));break}}}return n}function L_(t,i,e,n,o){var r=o?[]:void 0;return Jt.forEach(t.inEdges(n.v),function(a){var s=t.edge(a),c=t.node(a.v);o&&r.push({v:a.v,w:a.w}),c.out-=s,B_(i,e,c)}),Jt.forEach(t.outEdges(n.v),function(a){var s=t.edge(a),c=a.w,u=t.node(c);u.in-=s,B_(i,e,u)}),t.removeNode(n.v),r}function i7(t,i){var e=new Q8,n=0,o=0;Jt.forEach(t.nodes(),function(s){e.setNode(s,{v:s,in:0,out:0})}),Jt.forEach(t.edges(),function(s){var c=e.edge(s.v,s.w)||0,u=i(s),p=c+u;e.setEdge(s.v,s.w,p),o=Math.max(o,e.node(s.v).out+=u),n=Math.max(n,e.node(s.w).in+=u)});var r=Jt.range(o+n+3).map(function(){return new J8}),a=n+1;return Jt.forEach(e.nodes(),function(s){B_(r,a,e.node(s))}),{graph:e,buckets:r,zeroIdx:a}}function B_(t,i,e){e.out?e.in?t[e.out-e.in+i].enqueue(e):t[t.length-1].enqueue(e):t[0].enqueue(e)}});var fE=g((Ore,pE)=>{"use strict";var gi=Me(),o7=uE();pE.exports={run:r7,undo:s7};function r7(t){var i=t.graph().acyclicer==="greedy"?o7(t,e(t)):a7(t);gi.forEach(i,function(n){var o=t.edge(n);t.removeEdge(n),o.forwardName=n.name,o.reversed=!0,t.setEdge(n.w,n.v,o,gi.uniqueId("rev"))});function e(n){return function(o){return n.edge(o).weight}}}function a7(t){var i=[],e={},n={};function o(r){gi.has(n,r)||(n[r]=!0,e[r]=!0,gi.forEach(t.outEdges(r),function(a){gi.has(e,a.w)?i.push(a):o(a.w)}),delete e[r])}return gi.forEach(t.nodes(),o),i}function s7(t){gi.forEach(t.edges(),function(i){var e=t.edge(i);if(e.reversed){t.removeEdge(i);var n=e.forwardName;delete e.reversed,delete e.forwardName,t.setEdge(i.w,i.v,e,n)}})}});var rt=g((Nre,gE)=>{"use strict";var fe=Me(),hE=St().Graph;gE.exports={addDummyNode:mE,simplify:c7,asNonCompoundGraph:d7,successorWeights:l7,predecessorWeights:u7,intersectRect:p7,buildLayerMatrix:f7,normalizeRanks:h7,removeEmptyRanks:m7,addBorderNode:_7,maxRank:_E,partition:g7,time:v7,notime:y7};function mE(t,i,e,n){var o;do o=fe.uniqueId(n);while(t.hasNode(o));return e.dummy=i,t.setNode(o,e),o}function c7(t){var i=new hE().setGraph(t.graph());return fe.forEach(t.nodes(),function(e){i.setNode(e,t.node(e))}),fe.forEach(t.edges(),function(e){var n=i.edge(e.v,e.w)||{weight:0,minlen:1},o=t.edge(e);i.setEdge(e.v,e.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),i}function d7(t){var i=new hE({multigraph:t.isMultigraph()}).setGraph(t.graph());return fe.forEach(t.nodes(),function(e){t.children(e).length||i.setNode(e,t.node(e))}),fe.forEach(t.edges(),function(e){i.setEdge(e,t.edge(e))}),i}function l7(t){var i=fe.map(t.nodes(),function(e){var n={};return fe.forEach(t.outEdges(e),function(o){n[o.w]=(n[o.w]||0)+t.edge(o).weight}),n});return fe.zipObject(t.nodes(),i)}function u7(t){var i=fe.map(t.nodes(),function(e){var n={};return fe.forEach(t.inEdges(e),function(o){n[o.v]=(n[o.v]||0)+t.edge(o).weight}),n});return fe.zipObject(t.nodes(),i)}function p7(t,i){var e=t.x,n=t.y,o=i.x-e,r=i.y-n,a=t.width/2,s=t.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");var c,u;return Math.abs(r)*a>Math.abs(o)*s?(r<0&&(s=-s),c=s*o/r,u=s):(o<0&&(a=-a),c=a,u=a*r/o),{x:e+c,y:n+u}}function f7(t){var i=fe.map(fe.range(_E(t)+1),function(){return[]});return fe.forEach(t.nodes(),function(e){var n=t.node(e),o=n.rank;fe.isUndefined(o)||(i[o][n.order]=e)}),i}function h7(t){var i=fe.min(fe.map(t.nodes(),function(e){return t.node(e).rank}));fe.forEach(t.nodes(),function(e){var n=t.node(e);fe.has(n,"rank")&&(n.rank-=i)})}function m7(t){var i=fe.min(fe.map(t.nodes(),function(r){return t.node(r).rank})),e=[];fe.forEach(t.nodes(),function(r){var a=t.node(r).rank-i;e[a]||(e[a]=[]),e[a].push(r)});var n=0,o=t.graph().nodeRankFactor;fe.forEach(e,function(r,a){fe.isUndefined(r)&&a%o!==0?--n:n&&fe.forEach(r,function(s){t.node(s).rank+=n})})}function _7(t,i,e,n){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=n),mE(t,"border",o,i)}function _E(t){return fe.max(fe.map(t.nodes(),function(i){var e=t.node(i).rank;if(!fe.isUndefined(e))return e}))}function g7(t,i){var e={lhs:[],rhs:[]};return fe.forEach(t,function(n){i(n)?e.lhs.push(n):e.rhs.push(n)}),e}function v7(t,i){var e=fe.now();try{return i()}finally{console.log(t+" time: "+(fe.now()-e)+"ms")}}function y7(t,i){return i()}});var CE=g((Rre,yE)=>{"use strict";var vE=Me(),C7=rt();yE.exports={run:b7,undo:w7};function b7(t){t.graph().dummyChains=[],vE.forEach(t.edges(),function(i){x7(t,i)})}function x7(t,i){var e=i.v,n=t.node(e).rank,o=i.w,r=t.node(o).rank,a=i.name,s=t.edge(i),c=s.labelRank;if(r!==n+1){t.removeEdge(i);var u,p,_;for(_=0,++n;n<r;++_,++n)s.points=[],p={width:0,height:0,edgeLabel:s,edgeObj:i,rank:n},u=C7.addDummyNode(t,"edge",p,"_d"),n===c&&(p.width=s.width,p.height=s.height,p.dummy="edge-label",p.labelpos=s.labelpos),t.setEdge(e,u,{weight:s.weight},a),_===0&&t.graph().dummyChains.push(u),e=u;t.setEdge(e,o,{weight:s.weight},a)}}function w7(t){vE.forEach(t.graph().dummyChains,function(i){var e=t.node(i),n=e.edgeLabel,o;for(t.setEdge(e.edgeObj,n);e.dummy;)o=t.successors(i)[0],t.removeNode(i),n.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(n.x=e.x,n.y=e.y,n.width=e.width,n.height=e.height),i=o,e=t.node(i)})}});var Rr=g((Are,bE)=>{"use strict";var Jp=Me();bE.exports={longestPath:S7,slack:I7};function S7(t){var i={};function e(n){var o=t.node(n);if(Jp.has(i,n))return o.rank;i[n]=!0;var r=Jp.min(Jp.map(t.outEdges(n),function(a){return e(a.w)-t.edge(a).minlen}));return(r===Number.POSITIVE_INFINITY||r===void 0||r===null)&&(r=0),o.rank=r}Jp.forEach(t.sources(),e)}function I7(t,i){return t.node(i.w).rank-t.node(i.v).rank-t.edge(i).minlen}});var z_=g((Fre,xE)=>{"use strict";var ef=Me(),T7=St().Graph,tf=Rr().slack;xE.exports=E7;function E7(t){var i=new T7({directed:!1}),e=t.nodes()[0],n=t.nodeCount();i.setNode(e,{});for(var o,r;P7(i,t)<n;)o=k7(i,t),r=i.hasNode(o.v)?tf(t,o):-tf(t,o),M7(i,t,r);return i}function P7(t,i){function e(n){ef.forEach(i.nodeEdges(n),function(o){var r=o.v,a=n===r?o.w:r;!t.hasNode(a)&&!tf(i,o)&&(t.setNode(a,{}),t.setEdge(n,a,{}),e(a))})}return ef.forEach(t.nodes(),e),t.nodeCount()}function k7(t,i){return ef.minBy(i.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return tf(i,e)})}function M7(t,i,e){ef.forEach(t.nodes(),function(n){i.node(n).rank+=e})}});var ME=g((Lre,kE)=>{"use strict";var en=Me(),D7=z_(),O7=Rr().slack,N7=Rr().longestPath,R7=St().alg.preorder,A7=St().alg.postorder,F7=rt().simplify;kE.exports=vi;vi.initLowLimValues=V_;vi.initCutValues=q_;vi.calcCutValue=SE;vi.leaveEdge=TE;vi.enterEdge=EE;vi.exchangeEdges=PE;function vi(t){t=F7(t),N7(t);var i=D7(t);V_(i),q_(i,t);for(var e,n;e=TE(i);)n=EE(i,t,e),PE(i,t,e,n)}function q_(t,i){var e=A7(t,t.nodes());e=e.slice(0,e.length-1),en.forEach(e,function(n){L7(t,i,n)})}function L7(t,i,e){var n=t.node(e),o=n.parent;t.edge(e,o).cutvalue=SE(t,i,e)}function SE(t,i,e){var n=t.node(e),o=n.parent,r=!0,a=i.edge(e,o),s=0;return a||(r=!1,a=i.edge(o,e)),s=a.weight,en.forEach(i.nodeEdges(e),function(c){var u=c.v===e,p=u?c.w:c.v;if(p!==o){var _=u===r,b=i.edge(c).weight;if(s+=_?b:-b,z7(t,e,p)){var k=t.edge(e,p).cutvalue;s+=_?-k:k}}}),s}function V_(t,i){arguments.length<2&&(i=t.nodes()[0]),IE(t,{},1,i)}function IE(t,i,e,n,o){var r=e,a=t.node(n);return i[n]=!0,en.forEach(t.neighbors(n),function(s){en.has(i,s)||(e=IE(t,i,e,s,n))}),a.low=r,a.lim=e++,o?a.parent=o:delete a.parent,e}function TE(t){return en.find(t.edges(),function(i){return t.edge(i).cutvalue<0})}function EE(t,i,e){var n=e.v,o=e.w;i.hasEdge(n,o)||(n=e.w,o=e.v);var r=t.node(n),a=t.node(o),s=r,c=!1;r.lim>a.lim&&(s=a,c=!0);var u=en.filter(i.edges(),function(p){return c===wE(t,t.node(p.v),s)&&c!==wE(t,t.node(p.w),s)});return en.minBy(u,function(p){return O7(i,p)})}function PE(t,i,e,n){var o=e.v,r=e.w;t.removeEdge(o,r),t.setEdge(n.v,n.w,{}),V_(t),q_(t,i),B7(t,i)}function B7(t,i){var e=en.find(t.nodes(),function(o){return!i.node(o).parent}),n=R7(t,e);n=n.slice(1),en.forEach(n,function(o){var r=t.node(o).parent,a=i.edge(o,r),s=!1;a||(a=i.edge(r,o),s=!0),i.node(o).rank=i.node(r).rank+(s?a.minlen:-a.minlen)})}function z7(t,i,e){return t.hasEdge(i,e)}function wE(t,i,e){return e.low<=i.lim&&i.lim<=e.lim}});var RE=g((Bre,NE)=>{"use strict";var q7=Rr(),OE=q7.longestPath,V7=z_(),H7=ME();NE.exports=G7;function G7(t){switch(t.graph().ranker){case"network-simplex":DE(t);break;case"tight-tree":U7(t);break;case"longest-path":j7(t);break;default:DE(t)}}var j7=OE;function U7(t){OE(t),V7(t)}function DE(t){H7(t)}});var FE=g((zre,AE)=>{"use strict";var H_=Me();AE.exports=W7;function W7(t){var i=K7(t);H_.forEach(t.graph().dummyChains,function(e){for(var n=t.node(e),o=n.edgeObj,r=$7(t,i,o.v,o.w),a=r.path,s=r.lca,c=0,u=a[c],p=!0;e!==o.w;){if(n=t.node(e),p){for(;(u=a[c])!==s&&t.node(u).maxRank<n.rank;)c++;u===s&&(p=!1)}if(!p){for(;c<a.length-1&&t.node(u=a[c+1]).minRank<=n.rank;)c++;u=a[c]}t.setParent(e,u),e=t.successors(e)[0]}})}function $7(t,i,e,n){var o=[],r=[],a=Math.min(i[e].low,i[n].low),s=Math.max(i[e].lim,i[n].lim),c,u;c=e;do c=t.parent(c),o.push(c);while(c&&(i[c].low>a||s>i[c].lim));for(u=c,c=n;(c=t.parent(c))!==u;)r.push(c);return{path:o.concat(r.reverse()),lca:u}}function K7(t){var i={},e=0;function n(o){var r=e;H_.forEach(t.children(o),n),i[o]={low:r,lim:e++}}return H_.forEach(t.children(),n),i}});var zE=g((qre,BE)=>{"use strict";var tn=Me(),G_=rt();BE.exports={run:Y7,cleanup:Q7};function Y7(t){var i=G_.addDummyNode(t,"root",{},"_root"),e=X7(t),n=tn.max(tn.values(e))-1,o=2*n+1;t.graph().nestingRoot=i,tn.forEach(t.edges(),function(a){t.edge(a).minlen*=o});var r=Z7(t)+1;tn.forEach(t.children(),function(a){LE(t,i,o,r,n,e,a)}),t.graph().nodeRankFactor=o}function LE(t,i,e,n,o,r,a){var s=t.children(a);if(!s.length){a!==i&&t.setEdge(i,a,{weight:0,minlen:e});return}var c=G_.addBorderNode(t,"_bt"),u=G_.addBorderNode(t,"_bb"),p=t.node(a);t.setParent(c,a),p.borderTop=c,t.setParent(u,a),p.borderBottom=u,tn.forEach(s,function(_){LE(t,i,e,n,o,r,_);var b=t.node(_),k=b.borderTop?b.borderTop:_,P=b.borderBottom?b.borderBottom:_,N=b.borderTop?n:2*n,j=k!==P?1:o-r[a]+1;t.setEdge(c,k,{weight:N,minlen:j,nestingEdge:!0}),t.setEdge(P,u,{weight:N,minlen:j,nestingEdge:!0})}),t.parent(a)||t.setEdge(i,c,{weight:0,minlen:o+r[a]})}function X7(t){var i={};function e(n,o){var r=t.children(n);r&&r.length&&tn.forEach(r,function(a){e(a,o+1)}),i[n]=o}return tn.forEach(t.children(),function(n){e(n,1)}),i}function Z7(t){return tn.reduce(t.edges(),function(i,e){return i+t.edge(e).weight},0)}function Q7(t){var i=t.graph();t.removeNode(i.nestingRoot),delete i.nestingRoot,tn.forEach(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}});var HE=g((Vre,VE)=>{"use strict";var j_=Me(),J7=rt();VE.exports=eK;function eK(t){function i(e){var n=t.children(e),o=t.node(e);if(n.length&&j_.forEach(n,i),j_.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var r=o.minRank,a=o.maxRank+1;r<a;++r)qE(t,"borderLeft","_bl",e,o,r),qE(t,"borderRight","_br",e,o,r)}}j_.forEach(t.children(),i)}function qE(t,i,e,n,o,r){var a={width:0,height:0,rank:r,borderType:i},s=o[i][r-1],c=J7.addDummyNode(t,"border",a,e);o[i][r]=c,t.setParent(c,n),s&&t.setEdge(s,c,{weight:1})}});var WE=g((Hre,UE)=>{"use strict";var Ut=Me();UE.exports={adjust:tK,undo:nK};function tK(t){var i=t.graph().rankdir.toLowerCase();(i==="lr"||i==="rl")&&jE(t)}function nK(t){var i=t.graph().rankdir.toLowerCase();(i==="bt"||i==="rl")&&iK(t),(i==="lr"||i==="rl")&&(oK(t),jE(t))}function jE(t){Ut.forEach(t.nodes(),function(i){GE(t.node(i))}),Ut.forEach(t.edges(),function(i){GE(t.edge(i))})}function GE(t){var i=t.width;t.width=t.height,t.height=i}function iK(t){Ut.forEach(t.nodes(),function(i){U_(t.node(i))}),Ut.forEach(t.edges(),function(i){var e=t.edge(i);Ut.forEach(e.points,U_),Ut.has(e,"y")&&U_(e)})}function U_(t){t.y=-t.y}function oK(t){Ut.forEach(t.nodes(),function(i){W_(t.node(i))}),Ut.forEach(t.edges(),function(i){var e=t.edge(i);Ut.forEach(e.points,W_),Ut.has(e,"x")&&W_(e)})}function W_(t){var i=t.x;t.x=t.y,t.y=i}});var KE=g((Gre,$E)=>{"use strict";var nn=Me();$E.exports=rK;function rK(t){var i={},e=nn.filter(t.nodes(),function(s){return!t.children(s).length}),n=nn.max(nn.map(e,function(s){return t.node(s).rank})),o=nn.map(nn.range(n+1),function(){return[]});function r(s){if(!nn.has(i,s)){i[s]=!0;var c=t.node(s);o[c.rank].push(s),nn.forEach(t.successors(s),r)}}var a=nn.sortBy(e,function(s){return t.node(s).rank});return nn.forEach(a,r),o}});var XE=g((jre,YE)=>{"use strict";var Fn=Me();YE.exports=aK;function aK(t,i){for(var e=0,n=1;n<i.length;++n)e+=sK(t,i[n-1],i[n]);return e}function sK(t,i,e){for(var n=Fn.zipObject(e,Fn.map(e,function(u,p){return p})),o=Fn.flatten(Fn.map(i,function(u){return Fn.sortBy(Fn.map(t.outEdges(u),function(p){return{pos:n[p.w],weight:t.edge(p).weight}}),"pos")}),!0),r=1;r<e.length;)r<<=1;var a=2*r-1;r-=1;var s=Fn.map(new Array(a),function(){return 0}),c=0;return Fn.forEach(o.forEach(function(u){var p=u.pos+r;s[p]+=u.weight;for(var _=0;p>0;)p%2&&(_+=s[p+1]),p=p-1>>1,s[p]+=u.weight;c+=u.weight*_})),c}});var JE=g((Ure,QE)=>{"use strict";var ZE=Me();QE.exports=cK;function cK(t,i){return ZE.map(i,function(e){var n=t.inEdges(e);if(n.length){var o=ZE.reduce(n,function(r,a){var s=t.edge(a),c=t.node(a.v);return{sum:r.sum+s.weight*c.order,weight:r.weight+s.weight}},{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:e}})}});var tP=g((Wre,eP)=>{"use strict";var mt=Me();eP.exports=dK;function dK(t,i){var e={};mt.forEach(t,function(o,r){var a=e[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};mt.isUndefined(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),mt.forEach(i.edges(),function(o){var r=e[o.v],a=e[o.w];!mt.isUndefined(r)&&!mt.isUndefined(a)&&(a.indegree++,r.out.push(e[o.w]))});var n=mt.filter(e,function(o){return!o.indegree});return lK(n)}function lK(t){var i=[];function e(r){return function(a){a.merged||(mt.isUndefined(a.barycenter)||mt.isUndefined(r.barycenter)||a.barycenter>=r.barycenter)&&uK(r,a)}}function n(r){return function(a){a.in.push(r),--a.indegree===0&&t.push(a)}}for(;t.length;){var o=t.pop();i.push(o),mt.forEach(o.in.reverse(),e(o)),mt.forEach(o.out,n(o))}return mt.map(mt.filter(i,function(r){return!r.merged}),function(r){return mt.pick(r,["vs","i","barycenter","weight"])})}function uK(t,i){var e=0,n=0;t.weight&&(e+=t.barycenter*t.weight,n+=t.weight),i.weight&&(e+=i.barycenter*i.weight,n+=i.weight),t.vs=i.vs.concat(t.vs),t.barycenter=e/n,t.weight=n,t.i=Math.min(i.i,t.i),i.merged=!0}});var oP=g(($re,iP)=>{"use strict";var Ar=Me(),pK=rt();iP.exports=fK;function fK(t,i){var e=pK.partition(t,function(p){return Ar.has(p,"barycenter")}),n=e.lhs,o=Ar.sortBy(e.rhs,function(p){return-p.i}),r=[],a=0,s=0,c=0;n.sort(hK(!!i)),c=nP(r,o,c),Ar.forEach(n,function(p){c+=p.vs.length,r.push(p.vs),a+=p.barycenter*p.weight,s+=p.weight,c=nP(r,o,c)});var u={vs:Ar.flatten(r,!0)};return s&&(u.barycenter=a/s,u.weight=s),u}function nP(t,i,e){for(var n;i.length&&(n=Ar.last(i)).i<=e;)i.pop(),t.push(n.vs),e++;return e}function hK(t){return function(i,e){return i.barycenter<e.barycenter?-1:i.barycenter>e.barycenter?1:t?e.i-i.i:i.i-e.i}}});var sP=g((Kre,aP)=>{"use strict";var Ln=Me(),mK=JE(),_K=tP(),gK=oP();aP.exports=rP;function rP(t,i,e,n){var o=t.children(i),r=t.node(i),a=r?r.borderLeft:void 0,s=r?r.borderRight:void 0,c={};a&&(o=Ln.filter(o,function(P){return P!==a&&P!==s}));var u=mK(t,o);Ln.forEach(u,function(P){if(t.children(P.v).length){var N=rP(t,P.v,e,n);c[P.v]=N,Ln.has(N,"barycenter")&&yK(P,N)}});var p=_K(u,e);vK(p,c);var _=gK(p,n);if(a&&(_.vs=Ln.flatten([a,_.vs,s],!0),t.predecessors(a).length)){var b=t.node(t.predecessors(a)[0]),k=t.node(t.predecessors(s)[0]);Ln.has(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+b.order+k.order)/(_.weight+2),_.weight+=2}return _}function vK(t,i){Ln.forEach(t,function(e){e.vs=Ln.flatten(e.vs.map(function(n){return i[n]?i[n].vs:n}),!0)})}function yK(t,i){Ln.isUndefined(t.barycenter)?(t.barycenter=i.barycenter,t.weight=i.weight):(t.barycenter=(t.barycenter*t.weight+i.barycenter*i.weight)/(t.weight+i.weight),t.weight+=i.weight)}});var dP=g((Yre,cP)=>{"use strict";var Fr=Me(),CK=St().Graph;cP.exports=bK;function bK(t,i,e){var n=xK(t),o=new CK({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(r){return t.node(r)});return Fr.forEach(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===i||a.minRank<=i&&i<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||n),Fr.forEach(t[e](r),function(c){var u=c.v===r?c.w:c.v,p=o.edge(u,r),_=Fr.isUndefined(p)?0:p.weight;o.setEdge(u,r,{weight:t.edge(c).weight+_})}),Fr.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[i],borderRight:a.borderRight[i]}))}),o}function xK(t){for(var i;t.hasNode(i=Fr.uniqueId("_root")););return i}});var uP=g((Xre,lP)=>{"use strict";var wK=Me();lP.exports=SK;function SK(t,i,e){var n={},o;wK.forEach(e,function(r){for(var a=t.parent(r),s,c;a;){if(s=t.parent(a),s?(c=n[s],n[s]=a):(c=o,o=a),c&&c!==a){i.setEdge(c,a);return}a=s}})}});var _P=g((Zre,mP)=>{"use strict";var Bn=Me(),IK=KE(),TK=XE(),EK=sP(),PK=dP(),kK=uP(),MK=St().Graph,pP=rt();mP.exports=DK;function DK(t){var i=pP.maxRank(t),e=fP(t,Bn.range(1,i+1),"inEdges"),n=fP(t,Bn.range(i-1,-1,-1),"outEdges"),o=IK(t);hP(t,o);for(var r=Number.POSITIVE_INFINITY,a,s=0,c=0;c<4;++s,++c){OK(s%2?e:n,s%4>=2),o=pP.buildLayerMatrix(t);var u=TK(t,o);u<r&&(c=0,a=Bn.cloneDeep(o),r=u)}hP(t,a)}function fP(t,i,e){return Bn.map(i,function(n){return PK(t,n,e)})}function OK(t,i){var e=new MK;Bn.forEach(t,function(n){var o=n.graph().root,r=EK(n,o,e,i);Bn.forEach(r.vs,function(a,s){n.node(a).order=s}),kK(n,e,r.vs)})}function hP(t,i){Bn.forEach(i,function(e){Bn.forEach(e,function(n,o){t.node(n).order=o})})}});var TP=g((Qre,IP)=>{"use strict";var ne=Me(),NK=St().Graph,RK=rt();IP.exports={positionX:LK,findType1Conflicts:gP,findType2Conflicts:vP,addConflict:$_,hasConflict:yP,verticalAlignment:CP,horizontalCompaction:bP,alignCoordinates:wP,findSmallestWidthAlignment:xP,balance:SP};function gP(t,i){var e={};function n(o,r){var a=0,s=0,c=o.length,u=ne.last(r);return ne.forEach(r,function(p,_){var b=AK(t,p),k=b?t.node(b).order:c;(b||p===u)&&(ne.forEach(r.slice(s,_+1),function(P){ne.forEach(t.predecessors(P),function(N){var j=t.node(N),z=j.order;(z<a||k<z)&&!(j.dummy&&t.node(P).dummy)&&$_(e,N,P)})}),s=_+1,a=k)}),r}return ne.reduce(i,n),e}function vP(t,i){var e={};function n(r,a,s,c,u){var p;ne.forEach(ne.range(a,s),function(_){p=r[_],t.node(p).dummy&&ne.forEach(t.predecessors(p),function(b){var k=t.node(b);k.dummy&&(k.order<c||k.order>u)&&$_(e,b,p)})})}function o(r,a){var s=-1,c,u=0;return ne.forEach(a,function(p,_){if(t.node(p).dummy==="border"){var b=t.predecessors(p);b.length&&(c=t.node(b[0]).order,n(a,u,_,s,c),u=_,s=c)}n(a,u,a.length,c,r.length)}),a}return ne.reduce(i,o),e}function AK(t,i){if(t.node(i).dummy)return ne.find(t.predecessors(i),function(e){return t.node(e).dummy})}function $_(t,i,e){if(i>e){var n=i;i=e,e=n}var o=t[i];o||(t[i]=o={}),o[e]=!0}function yP(t,i,e){if(i>e){var n=i;i=e,e=n}return ne.has(t[i],e)}function CP(t,i,e,n){var o={},r={},a={};return ne.forEach(i,function(s){ne.forEach(s,function(c,u){o[c]=c,r[c]=c,a[c]=u})}),ne.forEach(i,function(s){var c=-1;ne.forEach(s,function(u){var p=n(u);if(p.length){p=ne.sortBy(p,function(N){return a[N]});for(var _=(p.length-1)/2,b=Math.floor(_),k=Math.ceil(_);b<=k;++b){var P=p[b];r[u]===u&&c<a[P]&&!yP(e,u,P)&&(r[P]=u,r[u]=o[u]=o[P],c=a[P])}}})}),{root:o,align:r}}function bP(t,i,e,n,o){var r={},a=FK(t,i,e,o),s=o?"borderLeft":"borderRight";function c(_,b){for(var k=a.nodes(),P=k.pop(),N={};P;)N[P]?_(P):(N[P]=!0,k.push(P),k=k.concat(b(P))),P=k.pop()}function u(_){r[_]=a.inEdges(_).reduce(function(b,k){return Math.max(b,r[k.v]+a.edge(k))},0)}function p(_){var b=a.outEdges(_).reduce(function(P,N){return Math.min(P,r[N.w]-a.edge(N))},Number.POSITIVE_INFINITY),k=t.node(_);b!==Number.POSITIVE_INFINITY&&k.borderType!==s&&(r[_]=Math.max(r[_],b))}return c(u,a.predecessors.bind(a)),c(p,a.successors.bind(a)),ne.forEach(n,function(_){r[_]=r[e[_]]}),r}function FK(t,i,e,n){var o=new NK,r=t.graph(),a=BK(r.nodesep,r.edgesep,n);return ne.forEach(i,function(s){var c;ne.forEach(s,function(u){var p=e[u];if(o.setNode(p),c){var _=e[c],b=o.edge(_,p);o.setEdge(_,p,Math.max(a(t,u,c),b||0))}c=u})}),o}function xP(t,i){return ne.minBy(ne.values(i),function(e){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return ne.forIn(e,function(r,a){var s=zK(t,a)/2;n=Math.max(r+s,n),o=Math.min(r-s,o)}),n-o})}function wP(t,i){var e=ne.values(i),n=ne.min(e),o=ne.max(e);ne.forEach(["u","d"],function(r){ne.forEach(["l","r"],function(a){var s=r+a,c=t[s],u;if(c!==i){var p=ne.values(c);u=a==="l"?n-ne.min(p):o-ne.max(p),u&&(t[s]=ne.mapValues(c,function(_){return _+u}))}})})}function SP(t,i){return ne.mapValues(t.ul,function(e,n){if(i)return t[i.toLowerCase()][n];var o=ne.sortBy(ne.map(t,n));return(o[1]+o[2])/2})}function LK(t){var i=RK.buildLayerMatrix(t),e=ne.merge(gP(t,i),vP(t,i)),n={},o;ne.forEach(["u","d"],function(a){o=a==="u"?i:ne.values(i).reverse(),ne.forEach(["l","r"],function(s){s==="r"&&(o=ne.map(o,function(_){return ne.values(_).reverse()}));var c=(a==="u"?t.predecessors:t.successors).bind(t),u=CP(t,o,e,c),p=bP(t,o,u.root,u.align,s==="r");s==="r"&&(p=ne.mapValues(p,function(_){return-_})),n[a+s]=p})});var r=xP(t,n);return wP(n,r),SP(n,t.graph().align)}function BK(t,i,e){return function(n,o,r){var a=n.node(o),s=n.node(r),c=0,u;if(c+=a.width/2,ne.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=e?u:-u),u=0,c+=(a.dummy?i:t)/2,c+=(s.dummy?i:t)/2,c+=s.width/2,ne.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(c+=e?u:-u),u=0,c}}function zK(t,i){return t.node(i).width}});var kP=g((Jre,PP)=>{"use strict";var Lr=Me(),EP=rt(),qK=TP().positionX;PP.exports=VK;function VK(t){t=EP.asNonCompoundGraph(t),HK(t),Lr.forEach(qK(t),function(i,e){t.node(e).x=i})}function HK(t){var i=EP.buildLayerMatrix(t),e=t.graph().ranksep,n=0;Lr.forEach(i,function(o){var r=Lr.max(Lr.map(o,function(a){return t.node(a).height}));Lr.forEach(o,function(a){t.node(a).y=n+r/2}),n+=r+e})}});var AP=g((eae,RP)=>{"use strict";var ae=Me(),MP=fE(),DP=CE(),GK=RE(),jK=rt().normalizeRanks,UK=FE(),WK=rt().removeEmptyRanks,OP=zE(),$K=HE(),NP=WE(),KK=_P(),YK=kP(),zn=rt(),XK=St().Graph;RP.exports=ZK;function ZK(t,i){var e=i&&i.debugTiming?zn.time:zn.notime;e("layout",function(){var n=e(" buildLayoutGraph",function(){return cY(t)});e(" runLayout",function(){QK(n,e)}),e(" updateInputGraph",function(){JK(t,n)})})}function QK(t,i){i(" makeSpaceForEdgeLabels",function(){dY(t)}),i(" removeSelfEdges",function(){vY(t)}),i(" acyclic",function(){MP.run(t)}),i(" nestingGraph.run",function(){OP.run(t)}),i(" rank",function(){GK(zn.asNonCompoundGraph(t))}),i(" injectEdgeLabelProxies",function(){lY(t)}),i(" removeEmptyRanks",function(){WK(t)}),i(" nestingGraph.cleanup",function(){OP.cleanup(t)}),i(" normalizeRanks",function(){jK(t)}),i(" assignRankMinMax",function(){uY(t)}),i(" removeEdgeLabelProxies",function(){pY(t)}),i(" normalize.run",function(){DP.run(t)}),i(" parentDummyChains",function(){UK(t)}),i(" addBorderSegments",function(){$K(t)}),i(" order",function(){KK(t)}),i(" insertSelfEdges",function(){yY(t)}),i(" adjustCoordinateSystem",function(){NP.adjust(t)}),i(" position",function(){YK(t)}),i(" positionSelfEdges",function(){CY(t)}),i(" removeBorderNodes",function(){gY(t)}),i(" normalize.undo",function(){DP.undo(t)}),i(" fixupEdgeLabelCoords",function(){mY(t)}),i(" undoCoordinateSystem",function(){NP.undo(t)}),i(" translateGraph",function(){fY(t)}),i(" assignNodeIntersects",function(){hY(t)}),i(" reversePoints",function(){_Y(t)}),i(" acyclic.undo",function(){MP.undo(t)})}function JK(t,i){ae.forEach(t.nodes(),function(e){var n=t.node(e),o=i.node(e);n&&(n.x=o.x,n.y=o.y,i.children(e).length&&(n.width=o.width,n.height=o.height))}),ae.forEach(t.edges(),function(e){var n=t.edge(e),o=i.edge(e);n.points=o.points,ae.has(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=i.graph().width,t.graph().height=i.graph().height}var eY=["nodesep","edgesep","ranksep","marginx","marginy"],tY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},nY=["acyclicer","ranker","rankdir","align"],iY=["width","height"],oY={width:0,height:0},rY=["minlen","weight","width","height","labeloffset"],aY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sY=["labelpos"];function cY(t){var i=new XK({multigraph:!0,compound:!0}),e=Y_(t.graph());return i.setGraph(ae.merge({},tY,K_(e,eY),ae.pick(e,nY))),ae.forEach(t.nodes(),function(n){var o=Y_(t.node(n));i.setNode(n,ae.defaults(K_(o,iY),oY)),i.setParent(n,t.parent(n))}),ae.forEach(t.edges(),function(n){var o=Y_(t.edge(n));i.setEdge(n,ae.merge({},aY,K_(o,rY),ae.pick(o,sY)))}),i}function dY(t){var i=t.graph();i.ranksep/=2,ae.forEach(t.edges(),function(e){var n=t.edge(e);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(i.rankdir==="TB"||i.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function lY(t){ae.forEach(t.edges(),function(i){var e=t.edge(i);if(e.width&&e.height){var n=t.node(i.v),o=t.node(i.w),r={rank:(o.rank-n.rank)/2+n.rank,e:i};zn.addDummyNode(t,"edge-proxy",r,"_ep")}})}function uY(t){var i=0;ae.forEach(t.nodes(),function(e){var n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,i=ae.max(i,n.maxRank))}),t.graph().maxRank=i}function pY(t){ae.forEach(t.nodes(),function(i){var e=t.node(i);e.dummy==="edge-proxy"&&(t.edge(e.e).labelRank=e.rank,t.removeNode(i))})}function fY(t){var i=Number.POSITIVE_INFINITY,e=0,n=Number.POSITIVE_INFINITY,o=0,r=t.graph(),a=r.marginx||0,s=r.marginy||0;function c(u){var p=u.x,_=u.y,b=u.width,k=u.height;i=Math.min(i,p-b/2),e=Math.max(e,p+b/2),n=Math.min(n,_-k/2),o=Math.max(o,_+k/2)}ae.forEach(t.nodes(),function(u){c(t.node(u))}),ae.forEach(t.edges(),function(u){var p=t.edge(u);ae.has(p,"x")&&c(p)}),i-=a,n-=s,ae.forEach(t.nodes(),function(u){var p=t.node(u);p.x-=i,p.y-=n}),ae.forEach(t.edges(),function(u){var p=t.edge(u);ae.forEach(p.points,function(_){_.x-=i,_.y-=n}),ae.has(p,"x")&&(p.x-=i),ae.has(p,"y")&&(p.y-=n)}),r.width=e-i+a,r.height=o-n+s}function hY(t){ae.forEach(t.edges(),function(i){var e=t.edge(i),n=t.node(i.v),o=t.node(i.w),r,a;e.points?(r=e.points[0],a=e.points[e.points.length-1]):(e.points=[],r=o,a=n),e.points.unshift(zn.intersectRect(n,r)),e.points.push(zn.intersectRect(o,a))})}function mY(t){ae.forEach(t.edges(),function(i){var e=t.edge(i);if(ae.has(e,"x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})}function _Y(t){ae.forEach(t.edges(),function(i){var e=t.edge(i);e.reversed&&e.points.reverse()})}function gY(t){ae.forEach(t.nodes(),function(i){if(t.children(i).length){var e=t.node(i),n=t.node(e.borderTop),o=t.node(e.borderBottom),r=t.node(ae.last(e.borderLeft)),a=t.node(ae.last(e.borderRight));e.width=Math.abs(a.x-r.x),e.height=Math.abs(o.y-n.y),e.x=r.x+e.width/2,e.y=n.y+e.height/2}}),ae.forEach(t.nodes(),function(i){t.node(i).dummy==="border"&&t.removeNode(i)})}function vY(t){ae.forEach(t.edges(),function(i){if(i.v===i.w){var e=t.node(i.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:i,label:t.edge(i)}),t.removeEdge(i)}})}function yY(t){var i=zn.buildLayerMatrix(t);ae.forEach(i,function(e){var n=0;ae.forEach(e,function(o,r){var a=t.node(o);a.order=r+n,ae.forEach(a.selfEdges,function(s){zn.addDummyNode(t,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:r+ ++n,e:s.e,label:s.label},"_se")}),delete a.selfEdges})})}function CY(t){ae.forEach(t.nodes(),function(i){var e=t.node(i);if(e.dummy==="selfedge"){var n=t.node(e.e.v),o=n.x+n.width/2,r=n.y,a=e.x-o,s=n.height/2;t.setEdge(e.e,e.label),t.removeNode(i),e.label.points=[{x:o+2*a/3,y:r-s},{x:o+5*a/6,y:r-s},{x:o+a,y:r},{x:o+5*a/6,y:r+s},{x:o+2*a/3,y:r+s}],e.label.x=e.x,e.label.y=e.y}})}function K_(t,i){return ae.mapValues(ae.pick(t,i),Number)}function Y_(t){var i={};return ae.forEach(t,function(e,n){i[n.toLowerCase()]=e}),i}});var LP=g((tae,FP)=>{"use strict";var nf=Me(),bY=rt(),xY=St().Graph;FP.exports={debugOrdering:wY};function wY(t){var i=bY.buildLayerMatrix(t),e=new xY({compound:!0,multigraph:!0}).setGraph({});return nf.forEach(t.nodes(),function(n){e.setNode(n,{label:n}),e.setParent(n,"layer"+t.node(n).rank)}),nf.forEach(t.edges(),function(n){e.setEdge(n.v,n.w,{},n.name)}),nf.forEach(i,function(n,o){var r="layer"+o;e.setNode(r,{rank:"same"}),nf.reduce(n,function(a,s){return e.setEdge(a,s,{style:"invis"}),s})}),e}});var zP=g((nae,BP)=>{"use strict";BP.exports="0.8.5"});var VP=g((iae,qP)=>{"use strict";qP.exports={graphlib:St(),layout:AP(),debug:LP(),util:{time:rt().time,notime:rt().notime},version:zP()}});var Xn=class{constructor(i,e,n,o,r){this.center=i,this.radiusX=e,this.radiusY=n,this.startAngle=o,this.endAngle=r}},A=class t{static castToPoint(i){return i||t.initialize()}static initialize(i=0,e=0){return{x:i,y:e}}static copy(i){return t.initialize(i.x,i.y)}static isEqual(i,e){return i.x===e.x&&i.y===e.y}static sum(i,e){return{x:i.x+e.x,y:i.y+e.y}}static sub(i,e){return{x:i.x-e.x,y:i.y-e.y}}static div(i,e){return{x:i.x/e,y:i.y/e}}static mult(i,e){return{x:i.x*e,y:i.y*e}}static interpolatePoints(i,e,n){let o=1-n;return t.initialize(i.x*o+e.x*n,i.y*o+e.y*n)}static roundTo(i,e){let n=Math.trunc(i.x/e),o=Math.trunc(i.y/e);return{x:n*e,y:o*e}}static hypotenuse(i,e){let n=e.x-i.x,o=e.y-i.y;return Math.abs(Math.sqrt(n*n+o*o))}static distance(i,e){let n=i.x-e.x,o=i.y-e.y;return Math.sqrt(n*n+o*o)}static getMinimum(i,e){return t.initialize(Math.min(i.x,e.x),Math.min(i.y,e.y))}static getMaximum(i,e){return t.initialize(Math.max(i.x,e.x),Math.max(i.y,e.y))}static matrixTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=i.x,r.y=i.y,n=r.matrixTransform(o.inverse())}return n}static elementTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getBoundingClientRect();return n=t.sub(n,t.initialize(o.left,o.top)),n}},Z=class t{constructor(i=0,e=0){this.x=i,this.y=e}static fromPoint(i){return new t(i.x,i.y)}add(i){let e=A.sum(this,i);return t.fromPoint(e)}sub(i){let e=A.sub(this,i);return t.fromPoint(e)}subNumber(i){let e=A.sub(this,new t(i,i));return t.fromPoint(e)}div(i){let e=A.div(this,i);return t.fromPoint(e)}mult(i){let e=A.mult(this,i);return t.fromPoint(e)}matrixTransform(i){let e=A.matrixTransform(this,i);return t.fromPoint(e)}elementTransform(i){let e=A.elementTransform(this,i);return t.fromPoint(e)}},bo=class{static initialize(i=A.initialize(),e=A.initialize()){return{point1:i,point2:e}}static copy(i){return{point1:i.point1,point2:i.point2}}static hypotenuse(i){return Math.sqrt(Math.pow(i.point1.x-i.point2.x,2)+Math.pow(i.point1.y-i.point2.y,2))}},Zn=class{constructor(i,e){this.point1=i,this.point2=e}},G=class t{static initialize(i=0,e=0,n=0,o=0){n<0&&(i=i+n,n=-n),o<0&&(e=e+o,o=-o);let r=A.initialize(i+n/2,e+o/2);return{x:i,y:e,width:n,height:o,gravityCenter:r}}static copy(i){return t.initialize(i.x,i.y,i.width,i.height)}static fromElement(i){let{x:e,y:n,width:o,height:r}=i.getBoundingClientRect();return t.initialize(e,n,o,r)}static isIncludePoint(i,e){return e.x>=t.left(i)&&e.x<=t.right(i)&&e.y>=t.top(i)&&e.y<=t.bottom(i)}static intersectionWithRect(i,e){return!(i.x+i.width<e.x||e.x+e.width<i.x||i.y+i.height<e.y||e.y+e.height<i.y)}static left(i){return i.x}static top(i){return i.y}static right(i){return i.x+i.width}static bottom(i){return i.y+i.height}static addPoint(i,e){let n=t.copy(i);return n.x+=e.x,n.y+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static mult(i,e){let n=t.copy(i);return n.x*=e,n.y*=e,n.width*=e,n.height*=e,this.initialize(n.x,n.y,n.width,n.height)}static div(i,e){let n=t.copy(i);return n.x/=e,n.y/=e,n.width/=e,n.height/=e,this.initialize(n.x,n.y,n.width,n.height)}static addPointToSize(i,e){let n=t.copy(i);return n.width+=e.x,n.height+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static union(i){return!i||i.length===0?null:i.reduce((e,n)=>{let o=Math.min(e.x,n.x),r=Math.min(e.y,n.y),a=Math.max(e.x+e.width,n.x+n.width),s=Math.max(e.y+e.height,n.y+n.height);return t.initialize(o,r,a-o,s-r)},i[0])}static elementTransform(i,e){let n=e.getBoundingClientRect(),o=A.sub(i,A.initialize(n.left,n.top));return t.initialize(o.x,o.y,i.width,i.height)}static updateIsNotFinite(i){return!Number.isFinite(i.width)||!Number.isFinite(i.height)||!Number.isFinite(i.x)||!Number.isFinite(i.y)?t.initialize(0,0,0,0):i}};function f0(t,i){let e=Math.max(t.width,i),n=Math.max(t.height,i),o=(e-t.width)/2,r=(n-t.height)/2;return G.initialize(t.x-o,t.y-r,e,n)}function $f(t,i){t=G.updateIsNotFinite(t),i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString())}function h0(t,i){t=G.updateIsNotFinite(t),i.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var ze=class t{constructor(i=0,e=0,n=0,o=0,r=0,a=0,s=0,c=0){this.x=i,this.y=e,this.width=n,this.height=o,this.radius1=r,this.radius2=a,this.radius3=s,this.radius4=c,this.gravityCenter=A.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(i){return new Z(i.x+i.width/2,i.y+i.height/2)}static fromRect(i){return new t(i.x,i.y,i.width,i.height)}static fromRoundedRect(i){return new t(i.x,i.y,i.width,i.height,i.radius1,i.radius2,i.radius3,i.radius4)}static fromCenter(i,e,n){return new t(i.gravityCenter.x-e/2,i.gravityCenter.y-n/2,e,n,i.radius1,i.radius2,i.radius3,i.radius4)}static fromPoint(i){return new t(i.x,i.y)}addPoint(i){let e=t.fromRoundedRect(this);return e.x+=i.x,e.y+=i.y,e.gravityCenter=this.calculateGravityCenter(e),e}},it=class t{static initialize(i=0,e=0){return{width:i,height:e}}static isEqual(i,e){return i.width===e.width&&i.height===e.height}static offsetFromElement(i){if(i instanceof SVGGraphicsElement){let e=i.getBBox();return t.initialize(e.width,e.height)}else if(i instanceof HTMLElement)return t.initialize(i.offsetWidth,i.offsetHeight)}};function nM(){return{position:A.initialize(),scaledPosition:A.initialize(),scale:1,rotate:0}}function iM(t){let i;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");i={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:A.initialize(),scale:Number(e[0]),rotate:0}}return i}var yn=class{static toString(i){let e=A.sum(i.position,i.scaledPosition);return`matrix(${i.scale}, 0, 0, ${i.scale}, ${e.x}, ${e.y})`}static fromString(i){return iM(i)}static default(){return nM()}},st=class t{static initialize(i=0,e=0){return A.initialize(i,e)}static fromPoints(i,e){return t.initialize(e.x-i.x,e.y-i.y)}static vectorLength(i){return Math.sqrt(t.magnitudeSquared(i))}static magnitudeSquared(i){return i.x*i.x+i.y*i.y}static dotProduct(i,e){return i.x*e.x+i.y*e.y}static crossProduct(i,e){return i.x*e.y-i.y*e.x}static subtract(i,e){return t.initialize(i.x-e.x,i.y-e.y)}static add(i,e){return t.initialize(i.x+e.x,i.y+e.y)}static scale(i,e){return t.initialize(i.x*e,i.y*e)}static angle(i,e){let n=Math.acos(Math.max(-1,Math.min(t.dotProduct(i,e)/(t.vectorLength(i)*t.vectorLength(e)),1)));return t.crossProduct(i,e)<0?-n:n}},Wf=class{static parseRoundedRect(i){let e=Math.PI*.5,n=i.x,o=i.y,r=i.x+i.width,a=i.y+i.height,s=i.x+i.radius1,c=i.y+i.radius1,u=i.x+i.width-i.radius2,p=i.y+i.radius2,_=i.x+i.width-i.radius3,b=i.y+i.height-i.radius3,k=i.x+i.radius4,P=i.y+i.height-i.radius4;return[new Xn({x:s,y:c},i.radius1,i.radius1,2*e,3*e),new Zn({x:s,y:o},{x:u,y:o}),new Xn({x:u,y:p},i.radius2,i.radius2,3*e,4*e),new Zn({x:r,y:p},{x:r,y:b}),new Xn({x:_,y:b},i.radius3,i.radius3,0,e),new Zn({x:_,y:a},{x:k,y:a}),new Xn({x:k,y:P},i.radius4,i.radius4,e,2*e),new Zn({x:n,y:P},{x:n,y:c})]}},Mi=class{static getRoundedRectIntersections(i,e,n){let o=Wf.parseRoundedRect(n);for(let r of o)if(r instanceof Xn){let a=this.intersectArcWithLine(r,i,e);if(a.length>0)return a}else if(r instanceof Zn){let a=this.intersectLineSegments(i,e,r.point1,r.point2);if(a)return[a]}return[]}static getRoundedRectIntersectionsWithSVGPath(i,e){let n=i.getTotalLength(),o=[];for(let r=0;r<=n;r+=1){let a=i.getPointAtLength(r);o.push({x:a.x,y:a.y})}for(let r=1;r<o.length;r++){let a=this.getRoundedRectIntersections(o[r-1],o[r],e);if(a.length>0)return a}return[]}static intersectArcWithLine(i,e,n){return this.filterPointsWithinArc(this.findEllipseLineIntersections(i.center,i.radiusX,i.radiusY,e,n),i)}static intersectLineSegments(i,e,n,o){let r=e.x-i.x,a=e.y-i.y,s=o.x-n.x,c=o.y-n.y,u=(-a*(i.x-n.x)+r*(i.y-n.y))/(-s*a+r*c),p=(s*(i.y-n.y)-c*(i.x-n.x))/(-s*a+r*c);return u>=0&&u<=1&&p>=0&&p<=1?{x:i.x+p*r,y:i.y+p*a}:null}static filterPointsWithinArc(i,e){let{center:n,startAngle:o,endAngle:r}=e;if(i.length===0)return i;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let a=[];for(let s of i){let c=this.normalizeAngle(st.angle(st.initialize(1,0),st.initialize(s.x-n.x,s.y-n.y)));c<o&&(c+=2*Math.PI),o<=c&&c<=r&&a.push(s)}return a}static normalizeAngle(i){let e=i%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(i,e,n,o,r){let a=st.initialize(o.x,o.y),s=st.fromPoints(o,r),c=st.initialize(i.x,i.y),u=st.subtract(a,c),p=st.initialize(s.x/(e*e),s.y/(n*n)),_=st.initialize(u.x/(e*e),u.y/(n*n)),b=st.dotProduct(s,p),k=st.dotProduct(s,_),P=st.dotProduct(u,_)-1,N=k*k-b*P;return N<0?[]:this.calculateIntersectionPoints(N,b,k,o,r)}static calculateIntersectionPoints(i,e,n,o,r){let a=[];if(i>0){let s=Math.sqrt(i),c=(-n-s)/e,u=(-n+s)/e;c>=0&&c<=1&&a.push(A.interpolatePoints(o,r,c)),u>=0&&u<=1&&a.push(A.interpolatePoints(o,r,u))}else{let s=-n/e;s>=0&&s<=1&&a.push(A.interpolatePoints(o,r,s))}return a}};var Kf=class{handle(i,e){let n=!0;if(this.validator&&(n=e.get(this.validator).handle(i)),!!n)return e.get(this.execution).handle(i)}execute(i,e){return e.get(this.execution).handle(i)}setValidator(i){this.validator=i}setExecution(i){this.execution=i}},D=class t{constructor(){this._injector=l(Xe)}static registerPipeline(i,e,n){if(!i||!i.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(i.fToken)||new Kf;n?o.setValidator(e):o.setExecution(e),this.pipelines.set(i.fToken,o)}send(i){let e=t.pipelines.get(i.constructor.fToken);if(e)return e.handle(i,this._injector);throw new Error("Handler not registered for request type.")}execute(i){return t.pipelines.get(i.constructor.fToken).execute(i,this._injector)}};D.pipelines=new Map;D.\u0275fac=function(i){return new(i||D)};D.\u0275prov=y({token:D,factory:D.\u0275fac});function w(t){return function(i){D.registerPipeline(t,i,!1)}}var oM=(()=>{class t{setItem(e,n){localStorage.setItem(e,n)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),rM=(()=>{class t{storage={};setItem(e,n){this.storage[e]=n}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),aM=new ue("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>sn(l(Hr))?l(oM):l(rM)}),sM=(()=>{class t{getComputedStyle(e){return window.getComputedStyle(e)}get innerWidth(){return window.innerWidth}get innerHeight(){return window.innerHeight}get pageXOffset(){return window.pageXOffset}get pageYOffset(){return window.pageYOffset}isMediaQuery(e){return window.matchMedia(e).matches}requestAnimationFrame(e){return window.requestAnimationFrame(e)}get location(){return window.location}open(e,n,o){window.open(e,n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),cM=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:n=>"0"},{get:(n,o)=>o==="getPropertyValue"?n.getPropertyValue:"0"})}get innerWidth(){return 0}get innerHeight(){return 0}get pageXOffset(){return 0}get pageYOffset(){return 0}isMediaQuery(e){return!1}requestAnimationFrame(e){return setTimeout(e,0)}get location(){return{href:"",pathname:"",search:"",hash:"",origin:""}}open(e,n,o){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),dM=new ue("F_WINDOW",{providedIn:"root",factory:()=>sn(l(Hr))?l(sM):l(cM)}),Cn=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(Cn||{}),Yf;try{Yf=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Yf=!1}var Xf=(()=>{class t{_platformId;isBrowser=!1;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||Yf)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(e){this._platformId=e,this.isBrowser=this._platformId?sn(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),n=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return n.test(e)?r=Cn.MAC_OS:this.IOS?r=Cn.IOS:o.test(e)?r=Cn.WINDOWS:this.ANDROID?r=Cn.ANDROID:!r&&/linux/.test(e)&&(r=Cn.LINUX),r}static \u0275fac=function(n){return new(n||t)(bi(Hr))};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),qe=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,n,o,r){this.injectedDocument=e,this.windowService=n,this.localStorageService=o,this.platformService=r}isBrowser(){return this.platformService.isBrowser}get window(){return this.windowService}get localStorage(){return this.localStorageService}get document(){return this.injectedDocument}toPixels(e,n,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let a=parseFloat(e)/100;return Math.max(n,o)*a}else{if(e.endsWith("em"))return parseFloat(e)*parseFloat(r);if(e.endsWith("rem"))return parseFloat(e)*parseFloat(getComputedStyle(this.document.documentElement).fontSize);if(e.endsWith("vh")){let a=this.window.innerHeight/100;return parseFloat(e)*a}else if(e.endsWith("vw")){let a=this.window.innerWidth/100;return parseFloat(e)*a}}return parseFloat(e)||0}static \u0275fac=function(n){return new(n||t)(bi(Vr),bi(dM),bi(aM),bi(Xf))};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Zf(t,i){return t.reduce((e,n)=>[...e,...i(n)],[])}function Qf(t){let i=t.cloneNode(!0),e=i.querySelectorAll("[id]"),n=t.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return n==="canvas"?g0(t,i):(n==="input"||n==="select"||n==="textarea")&&_0(t,i),m0("canvas",t,i,g0),m0("input, textarea, select",t,i,_0),i}function m0(t,i,e,n){let o=i.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let a=0;a<o.length;a++)n(o[a],r[a])}}var lM=0;function _0(t,i){i.type!=="file"&&(i.value=t.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${lM++}`)}function g0(t,i){let e=i.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function Jf(t,i,e){for(let n in i)if(i.hasOwnProperty(n)){let o=i[n];o?t.setProperty(n,o,e?.has(n)?"important":""):t.removeProperty(n)}return t}function v0(t){Jf(t.style,{"touch-action":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"transparent","user-select":"none","-ms-user-select":"none","-webkit-user-select":"none","-moz-user-select":"none"})}function y0(t,i,e){return uM(t,e).dataset[i]}function uM(t,i){return t.closest(i)}function eh(t,i){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let n=i.createElement("div");return e.forEach(o=>n.appendChild(o)),n}function xo(t,i){let e=pM(t,i);return!!e&&!e.classList.contains(i+"-disabled")}function pM(t,i){return t.closest(i)}function Xt(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function Di(t,i,e){let n=e[t.toUpperCase()]||fM(e,t.toLowerCase());if(n===void 0)throw new Error(`Unknown ${i}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return n}function fM(t,i){return Object.keys(t).find(e=>t[e]===i)}var hM=["markerElement"],mM=["fConnectionGradientRenderer",""],_M=["f-connection-path",""],gM=["fConnectionSelection",""],vM=["f-connection-drag-handle-start",""],yM=["f-connection-drag-handle-end",""],CM=["defs"],bM=["*"],xM=["fGroupsContainer"],wM=["fNodesContainer"],SM=["fConnectionsContainer"],IM=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],TM=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],EM=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],PM=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function kM(t,i){t&1&&(et(),R(0,"linearGradient",3)),t&2&&E("fConnectionGradientRendererFor",i)}function MM(t,i){t&1&&(et(),R(0,"circle",6))}function DM(t,i){t&1&&De(0,4)}var OM="[_nghost-%COMP%]{display:block;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}",NM=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],RM=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],rh=new ue("F_BACKGROUND_PATTERN"),Vd=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(i){this.fPattern=i}},Fi=class{_items=[];_byId=new Map;get(i){return this._byId.get(i)}require(i){let e=this._byId.get(i);if(!e)throw new Error(`${this.kind} not found: ${i}`);return e}has(i){return this._byId.has(i)}getAll(){return this._items}size(){return this._items.length}add(i){let e=i.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(i),this._byId.set(e,i)}addMany(i){for(let e of i)this.add(e)}remove(i){let e=i.fId(),n=this._byId.get(e);if(!n)return!1;this._byId.delete(e);let o=this._items.indexOf(n);return o>=0&&this._items.splice(o,1),!0}removeById(i){let e=this._byId.get(i);if(!e)return;this._byId.delete(i);let n=this._items.indexOf(e);return n>=0&&this._items.splice(n,1),e}clear(){this._items.length=0,this._byId.clear()}};function Qn(t){return{name:t}}var ah=class{_instances=new Map;get(i){return this._instances.get(i.name)}require(i){let e=this.get(i);if(!e)throw new Error(`Instance not found: ${i.name}`);return e}has(i){return this._instances.has(i.name)}add(i,e){if(this._instances.has(i.name))throw new Error(`${i.name} already exists`);this._instances.set(i.name,e)}remove(i){if(!this._instances.has(i.name))throw new Error(`${i.name} does not exist`);return this._instances.delete(i.name),!0}clear(){this._instances.clear()}},So=class extends Fi{kind;constructor(i){super(),this.kind=i}},sh=class extends Fi{kind="Connection Marker"},ch=class extends Fi{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(i){this._instancesForCreate=i}addForSnap(i){this._instancesForSnap=i}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},dh=class extends Fi{kind="Node"},Ni=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(i=!0){this.notifyOnSubscribe=i}};function AM(){return t=>{let i=null,e=null,n=()=>{i!==null&&cancelAnimationFrame(i),e!==null&&cancelAnimationFrame(e),i=e=null};return{callback:()=>{n(),i=requestAnimationFrame(()=>{i=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:n}}}function FM(){return t=>{let i=null;return{callback:()=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,t()})},cleanup:()=>{i!==null&&cancelAnimationFrame(i),i=null}}}}function Hd(t){return i=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,i()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var Ct=class{_listeners=new Set;notify(){this._listeners.forEach(i=>i())}listen(i){return this._listeners.add(i),()=>this.stop(i)}stop(i){this._listeners.delete(i)}},lh=class extends Ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(i){super(),this._htmlElement=i}listen(i){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(i)}stop(i){super.stop(i),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},zt=class t{_channels=[];_operators=[];constructor(...i){this._channels=[...i]}pipe(...i){let e=new t(...this._channels);return e._operators=[...this._operators,...i],e}listen(i,e){let n=e,o=[],r=[],a=[];for(let _ of[...this._operators].reverse()){let b=_(n);n=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&a.push(b.setTeardown)}let s=this._channels.map(_=>_.listen(()=>n())),c=null,u=!1,p=()=>{u||(u=!0,c?.(),c=null,s.forEach(_=>_()),o.forEach(_=>_()))};a.slice().reverse().forEach(_=>_(p)),r.slice().reverse().forEach(_=>_(n)),c=i.onDestroy(p)}};function vp(){return t=>{let i=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{i&&e()})},cleanup:()=>{i=!1}}}}function C0(){return t=>{let i=!1,e=null;return{setTeardown:n=>e=n,callback:()=>{if(!i){i=!0;try{t()}finally{e?.()}}}}}}var LM=(()=>{let t=class va{_store=l(M);handle({notifyOnSubscribe:e}){return e?new zt(this._store.connectionsChanges$).pipe(vp(),Hd(1)):new zt(this._store.connectionsChanges$).pipe(Hd(1))}static \u0275fac=function(n){return new(n||va)};static \u0275prov=y({token:va,factory:va.\u0275fac})};return t=x([w(Ni)],t),t})(),uh=class{static fToken=Symbol("ListenNodesChangesRequest")},BM=(()=>{let t=class ya{_store=l(M);handle(e){return new zt(this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||ya)};static \u0275prov=y({token:ya,factory:ya.\u0275fac})};return t=x([w(uh)],t),t})(),Gd=class{static fToken=Symbol("ListenTransformChangesRequest")},zM=(()=>{let t=class Ca{_store=l(M);handle(e){return new zt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||Ca)};static \u0275prov=y({token:Ca,factory:Ca.\u0275fac})};return t=x([w(Gd)],t),t})(),Jn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},qM=(()=>{let t=class ba{_store=l(M);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||ba)};static \u0275prov=y({token:ba,factory:ba.\u0275fac})};return t=x([w(Jn)],t),t})(),Sn=class{static fToken=Symbol("NotifyTransformChangedRequest")},M=(()=>{class t{transformChanges$=new Ct;viewportAnimationChanges$=new Ct;connectionsChanges$=new Ct;_connectionsRevision=0;connectionsRenderedChanges$=new Ct;_connectionsRenderedRevision=0;_connectionsRenderedNodesRevision=0;_viewportAnimationCount=0;nodesChanges$=new Ct;_nodesRevision=0;progressiveRenderChanges$=new Ct;_pendingProgressiveRenderCount=0;get connectionsRevision(){return this._connectionsRevision}get connectionsRenderedRevision(){return this._connectionsRenderedRevision}get connectionsRenderedNodesRevision(){return this._connectionsRenderedNodesRevision}get nodesRevision(){return this._nodesRevision}get hasPendingProgressiveRender(){return this._pendingProgressiveRenderCount>0}get isViewportAnimating(){return this._viewportAnimationCount>0}get flowHost(){return this.fFlow?.hostElement}fFlow;fCanvas;get transform(){return this.fCanvas?.transform}nodes=new dh;connections=new ch;connectionMarkers=new sh;outputs=new So("Output");inputs=new So("Input");outlets=new So("Outlet");instances=new ah;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,n){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&n<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=n,this.connectionsRenderedChanges$.notify())}beginProgressiveRender(){this._pendingProgressiveRenderCount++,this.progressiveRenderChanges$.notify()}endProgressiveRender(){this._pendingProgressiveRenderCount&&(this._pendingProgressiveRenderCount--,this.progressiveRenderChanges$.notify())}transformChanged(){this.transformChanges$.notify()}beginViewportAnimation(){this._viewportAnimationCount++,this.viewportAnimationChanges$.notify()}endViewportAnimation(){this._viewportAnimationCount&&(this._viewportAnimationCount--,this.viewportAnimationChanges$.notify())}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Se={MAGNETIC_LINES:Qn("magnetic-lines"),MAGNETIC_RECTS:Qn("magnetic-rects"),ZOOM:Qn("zoom-controls"),BACKGROUND:Qn("background"),SELECTION_AREA:Qn("selection-area"),MINIMAP:Qn("minimap"),AUTO_PAN:Qn("auto-pan")},VM=(()=>{let t=class xa{_store=l(M);handle(e){this._store.transformChanged()}static \u0275fac=function(n){return new(n||xa)};static \u0275prov=y({token:xa,factory:xa.\u0275fac})};return t=x([w(Sn)],t),t})(),In=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(i,e){this.key=i,this.instance=e}},HM=(()=>{let t=class wa{_store=l(M);handle({key:e,instance:n}){this._store.instances.add(e,n)}static \u0275fac=function(n){return new(n||wa)};static \u0275prov=y({token:wa,factory:wa.\u0275fac})};return t=x([w(In)],t),t})(),Tn=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(i){this.key=i}},GM=(()=>{let t=class Sa{_store=l(M);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(n){return new(n||Sa)};static \u0275prov=y({token:Sa,factory:Sa.\u0275fac})};return t=x([w(Tn)],t),t})(),jM=[M,BM,LM,zM,qM,VM,HM,GM],UM=0,WM=(()=>{let t=class Ia{_store=l(M);_browser=l(qe);get _backgroundElement(){return this._store.instances.get(Se.BACKGROUND)?.hostElement}handle(e){let n=this._getPatterns(e.fPattern?.hostElement);if(!n?.length)return;let o=Ai("defs",this._browser);if(e.fPattern?.hostElement.remove(),n.forEach(r=>{o.append(r)}),n.length){this._backgroundElement?.firstChild?.appendChild(o),n[n.length-1].id="f-background-pattern-"+UM++;let r=n[n.length-1].id,a=Ai("rect",this._browser);a.setAttribute("fill","url(#"+r+")"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(a);let s=this._store.fCanvas?.transform||yn.default();e.fPattern?.setTransform(s)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(n){return new(n||Ia)};static \u0275prov=y({token:Ia,factory:Ia.\u0275fac})};return t=x([w(Vd)],t),t})(),Io=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(i){this.fTransform=i}},$M=(()=>{let t=class Ta{_store=l(M);handle(e){this._store.instances.get(Se.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(n){return new(n||Ta)};static \u0275prov=y({token:Ta,factory:Ta.\u0275fac})};return t=x([w(Io)],t),t})(),KM=[WM,$M],jd=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(i){this.instance=i}},YM=(()=>{let t=class Ea{_store=l(M);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(n){return new(n||Ea)};static \u0275prov=y({token:Ea,factory:Ea.\u0275fac})};return t=x([w(jd)],t),t})(),Ud=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(i,e){this.id=i,this.animated=e}},XM=(()=>{let t=class Pa{_store=l(M);_mediator=l(D);get _transform(){return this._store.transform}handle({id:e,animated:n}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Li(n,ei.VIEWPORT_ONLY)))}_toCenter(e,n,o){this._transform.scaledPosition=A.initialize(),this._transform.position=A.initialize((n.width-e.width)/2-o.x*this._transform.scale,(n.height-e.height)/2-o.y*this._transform.scale)}_getNodeRect(e){return G.fromElement(e.hostElement)}_getFlowRect(){return G.fromElement(this._store.flowHost)}static \u0275fac=function(n){return new(n||Pa)};static \u0275prov=y({token:Pa,factory:Pa.\u0275fac})};return t=x([w(Ud)],t),t})(),Wd=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(i,e){this.toCenter=i,this.animated=e}},ZM=(()=>{let t=class ka{_store=l(M);get _transform(){return this._store.transform}_mediator=l(D);handle({toCenter:e,animated:n}){let o=this._mediator.execute(new ji)||G.initialize();o.width===0||o.height===0||(this.fitToParent(o,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(r=>r._position),e),this._mediator.execute(new Li(n,ei.VIEWPORT_ONLY)))}fitToParent(e,n,o,r){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let a=e.width/this._transform.scale+r.x,s=e.height/this._transform.scale+r.y;(a>n.width||s>n.height||a<n.width&&s<n.height)&&(this._transform.scale=Math.min(n.width/a,n.height/s));let c=(n.width-a*this._transform.scale)/2-this._transform.position.x*this._transform.scale,u=(n.height-s*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=A.initialize(c+r.x/2*this._transform.scale,u+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(n,o)}static \u0275fac=function(n){return new(n||ka)};static \u0275prov=y({token:ka,factory:ka.\u0275fac})};return t=x([w(Wd)],t),t})(),$d=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(i,e){this.transform=i,this.position=e}},QM=(()=>{let t=class Ma{_store=l(M);handle({transform:e,position:n}){n&&(A.isEqual(this._calculateTransformPosition(e),n)||(e.position=n,e.scaledPosition=A.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return A.sum(e.position,e.scaledPosition)}static \u0275fac=function(n){return new(n||Ma)};static \u0275prov=y({token:Ma,factory:Ma.\u0275fac})};return t=x([w($d)],t),t})(),Kd=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(i,e){this.transform=i,this.scale=e}},JM=(()=>{let t=class Da{_store=l(M);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(n){return new(n||Da)};static \u0275prov=y({token:Da,factory:Da.\u0275fac})};return t=x([w(Kd)],t),t})(),ei=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(ei||{}),Li=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(i,e=ei.WITH_CONNECTION_CHANGES){this.animated=i,this.context=e}};function $0(t,i){let e=n=>{n.propertyName==="transform"&&(t.removeEventListener("transitionend",e),i(n))};t.addEventListener("transitionend",e)}var eD=(()=>{let t=class Oa{_store=l(M);get _canvas(){return this._store.fCanvas}handle(e){e.animated?this._redrawWithAnimation(e.context):this._redraw(e.context),this._canvas?.emitCanvasChangeEvent()}_redrawWithAnimation(e){this._store.beginViewportAnimation(),this._canvas?.redrawWithAnimation(),$0(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===ei.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===ei.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Oa)};static \u0275prov=y({token:Oa,factory:Oa.\u0275fac})};return t=x([w(Li)],t),t})(),Yd=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},tD=(()=>{let t=class Na{_store=l(M);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(n){return new(n||Na)};static \u0275prov=y({token:Na,factory:Na.\u0275fac})};return t=x([w(Yd)],t),t})(),Xd=class{static fToken=Symbol("ResetScaleRequest")},nD=(()=>{let t=class Ra{_store=l(M);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=A.initialize()}static \u0275fac=function(n){return new(n||Ra)};static \u0275prov=y({token:Ra,factory:Ra.\u0275fac})};return t=x([w(Xd)],t),t})(),Zd=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(i){this.animated=i}},iD=(()=>{let t=class Aa{_mediator=l(D);_store=l(M);get _transform(){return this._store.transform}handle({animated:e}){let n=this._mediator.execute(new ji)||G.initialize();n.width===0||n.height===0||(this._oneToOneCentering(n,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Li(e,ei.VIEWPORT_ONLY)))}_oneToOneCentering(e,n,o){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(n.width-e.width/this._transform.scale)/2-this._transform.position.x,a=(n.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=A.initialize(r,a)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(n,o)}static \u0275fac=function(n){return new(n||Aa)};static \u0275prov=y({token:Aa,factory:Aa.\u0275fac})};return t=x([w(Zd)],t),t})(),Qd=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(i,e){this.scale=i,this.toPosition=e}},oD=(()=>{let t=class Fa{_store=l(M);get _transform(){return this._store.transform}handle({scale:e,toPosition:n}){if(e===this._transform.scale)return;let o=A.sum(this._transform.scaledPosition,this._transform.position),r=n.x-(n.x-o.x)*e/this._transform.scale,a=n.y-(n.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=A.sub(A.initialize(r,a),this._transform.position)}static \u0275fac=function(n){return new(n||Fa)};static \u0275prov=y({token:Fa,factory:Fa.\u0275fac})};return t=x([w(Qd)],t),t})(),rD=[YM,XM,ZM,QM,JM,eD,tD,nD,iD,oD],ph=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(i){this.connection=i}},aD=(()=>{let t=class La{_store=l(M);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(n){return new(n||La)};static \u0275prov=y({token:La,factory:La.\u0275fac})};return t=x([w(ph)],t),t})(),Jd=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(i){this.instance=i}},sD=(()=>{let t=class Ba{_store=l(M);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Ba)};static \u0275prov=y({token:Ba,factory:Ba.\u0275fac})};return t=x([w(Jd)],t),t})(),el=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(i){this.connection=i}},cD=(()=>{let t=class za{_store=l(M);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||za)};static \u0275prov=y({token:za,factory:za.\u0275fac})};return t=x([w(el)],t),t})(),fh=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(i){this.connection=i}},dD=(()=>{let t=class qa{_store=l(M);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(n){return new(n||qa)};static \u0275prov=y({token:qa,factory:qa.\u0275fac})};return t=x([w(fh)],t),t})(),Bi=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(i){this.connection=i}},b0=new ue("F_CONNECTION_CONTENT");var tl=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(i){let e=t._removeConsecutiveDuplicates(i);if(e.length<2){this.points=[{x:0,y:0},{x:1,y:0}],this.cumulativeLengths=[0,1],this.segmentTangents=[{x:1,y:0}],this.totalLength=1;return}this.points=e;let n=this.points.length,o=n-1,r=new Array(n).fill(0),a=new Array(o),s=0;for(let c=0;c<o;c++){let u=this.points[c+1].x-this.points[c].x,p=this.points[c+1].y-this.points[c].y,_=Math.hypot(u,p),b=_?u/_:1,k=_?p/_:0;a[c]={x:b,y:k},s+=_,r[c+1]=s}this.cumulativeLengths=r,this.segmentTangents=a,this.totalLength=s||1}static from(i){return new t(i.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(i){let e=[];for(let n of i){let o=e[e.length-1];(!o||o.x!==n.x||o.y!==n.y)&&e.push({x:n.x,y:n.y})}return e}},hh=class t{_polyline;constructor(i=[]){this._polyline=new tl(i)}updatePoints(i){return this._polyline=new tl(i),this._polyline.totalLength}calculateTotalLength(i){return this.updatePoints(i)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(i){let{points:e,cumulativeLengths:n,segmentTangents:o,totalLength:r}=this._polyline,s=t._clamp(i,0,1)*r,c=.5;if(s<=c)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-s<=c){let U=e.length-1;return{point:e[U],tangent:o[U-1]??{x:1,y:0},atEdge:!0}}let u=t._findRightIndex(n,s),p=Math.max(1,u),_=n[p-1],b=n[p],k=t._safeRatio(s-_,b-_),P=e[p-1],N=e[p],j={x:t._lerp(P.x,N.x,k),y:t._lerp(P.y,N.y,k)},z=o[p-1]??{x:1,y:0};return{point:j,tangent:z,atEdge:!1}}getPointAtLength(i){return this.getPointAtProgress(i)}getPointAtDistance(i){let e=this._polyline.totalLength?i/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(i,e){let n=0,o=i.length-1;for(;n<o;){let r=n+o>>1;i[r]<e?n=r+1:o=r}return n}static _lerp(i,e,n){return i+(e-i)*n}static _clamp(i,e,n){return i<e?e:i>n?n:i}static _safeRatio(i,e){let n=Math.abs(e)<1e-6?1e-6:e;return i/n}},K0=(function(t){return t.NONE="none",t.ALONG="along",t})(K0||{}),mh=class{compute(i,e){let n=this._clamp01(e.position()),{point:o,tangent:r}=i.getPointAtLength(n),a={x:-r.y,y:r.x},s=e.offset()??0,c=o.x+a.x*s,u=o.y+a.y*s,_=this._sizeAlongDirection(e.hostElement,r)*.5,b=n*i.totalLength,k=i.totalLength-b,P=this._applyEdgeGuard(c,u,r,b,k,_),N=this._calculateContentRotation(e.align(),r);return{position:P,rotationDeg:N}}_clamp01(i){return i<=0?0:i>=1?1:i}_applyEdgeGuard(i,e,n,o,r,a){if(o<=a){let s=a-o;return{x:i+n.x*s,y:e+n.y*s}}if(r<=a){let s=a-r;return{x:i-n.x*s,y:e-n.y*s}}return{x:i,y:e}}_sizeAlongDirection(i,e){let n=G.fromElement(i);return Math.abs(e.x)*n.width+Math.abs(e.y)*n.height}_normalize180(i){let e=(i+180)%360;return e<0&&(e+=360),e-180}_keepUpright(i){let e=this._normalize180(i);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(i,e){let n=0;return i===K0.ALONG&&(n=Math.atan2(e.y,e.x)*180/Math.PI,n=this._keepUpright(n)),n}},_h=class{_placement;constructor(i=new mh){this._placement=i}layout(i,e){let n=new hh(i),o=n.totalLength;for(let r of e){let{position:a,rotationDeg:s}=this._placement.compute(n,r);r.hostElement.style.transform=this._createTransformString(a,s)}return o}_createTransformString(i,e){return`translate3d(${i.x}px, ${i.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var x0=new ue("F_CONNECTION_WAYPOINTS");function Y0(t,i,e){return(t.x-i.x)**2+(t.y-i.y)**2<=e**2}function lD(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.candidates().find(o=>Y0(i,o,n))}function uD(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.waypoints().find(o=>Y0(i,o,n))}function pD(t,i){for(let e of t){let n=uD(e,i);if(n&&e.fWaypoints()?.visibility())return{connection:e,waypoint:n};let o=lD(e,i);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var yp=new ue("F_CONNECTION_COMPONENTS_PARENT");var _e=(function(t){return t.START="f-connection-marker-start",t.END="f-connection-marker-end",t.SELECTED_START="f-connection-selected-marker-start",t.SELECTED_END="f-connection-selected-marker-end",t.START_ALL_STATES="f-connection-marker-start-all-states",t.END_ALL_STATES="f-connection-marker-end-all-states",t})(_e||{}),nl=new ue("F_CONNECTION_MARKER"),fD=0,il=class{fId=H(`f-marker-${fD++}`);hostElement=l(Re).nativeElement};function X0(t,i=_e.START){if(typeof t!="string")return i;let e=t.trim().toLowerCase();return e?hD(e)??i:i}function hD(t){switch(t){case"start":case"f-connection-marker-start":return _e.START;case"end":case"f-connection-marker-end":return _e.END;case"selected-start":case"f-connection-selected-marker-start":return _e.SELECTED_START;case"selected-end":case"f-connection-selected-marker-end":return _e.SELECTED_END;case"start-all-states":case"f-connection-marker-start-all-states":case"start-all":case"all-start":return _e.START_ALL_STATES;case"end-all-states":case"f-connection-marker-end-all-states":case"end-all":case"all-end":return _e.END_ALL_STATES;default:return null}}var Z0=(()=>{class t extends il{_markerElement=Pe.required("markerElement");_type=O(_e.END_ALL_STATES,{alias:"type",transform:e=>X0(e,_e.END_ALL_STATES)});get markerElement(){return this._markerElement().nativeElement}width=6;height=7;refX=5.5;refY=3.5;get type(){return this._type()}orient="auto";markerUnits="strokeWidth";static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(n,o){n&1&&ut(o._markerElement,hM,5),n&2&&tt()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[ge([{provide:nl,useExisting:t}]),he],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(n,o){n&1&&(et(),W(0,"svg",1,0),Si(2,"path",2),$())},encapsulation:2})}return t})();var Q0=(()=>{class t extends il{_mediator=l(D);markerElement=this.hostElement;width=0;height=0;refX=0;refY=0;type=_e.START;orient="auto";markerUnits="strokeWidth";ngOnInit(){this.hostElement.style.display="none",this._mediator.execute(new Jd(this))}ngOnDestroy(){this._mediator.execute(new Tl(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,selectors:[["svg","fMarker",""]],hostAttrs:[1,"f-component","f-marker"],inputs:{width:"width",height:"height",refX:"refX",refY:"refY",type:[2,"type","type",e=>X0(e,_e.START)],orient:"orient",markerUnits:"markerUnits"},standalone:!1,features:[ge([{provide:nl,useExisting:t}]),he]})}return t})(),xn=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(xn||{}),we=(function(t){return t.DEFAULT="default",t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t})(we||{});function mD({sourceRect:t,targetRect:i}){return{point1:t.gravityCenter,point2:i.gravityCenter}}var F=(function(t){return t.LEFT="left",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t.AUTO="auto",t})(F||{}),Oi=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Oi||{});function _D({sourceRect:t,sourceConnectableSide:i,targetRect:e,targetConnectableSide:n}){return{point1:w0(t,i===F.AUTO?F.BOTTOM:i),point2:w0(e,n===F.AUTO?F.TOP:n)}}function w0(t,i){switch(i){case F.TOP:return{x:t.x+t.width/2,y:t.y};case F.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case F.LEFT:return{x:t.x,y:t.y+t.height/2};case F.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${i}`)}}function J0(t,i,e,n){if(!n||!n.rotationDeg)return Mi.getRoundedRectIntersections(t,i,e)[0];let o=Va(t,-n.rotationDeg,n.pivot),r=Va(i,-n.rotationDeg,n.pivot),a=gD(e,-n.rotationDeg,n.pivot),s=Mi.getRoundedRectIntersections(o,r,a)[0];return s?Va(s,n.rotationDeg,n.pivot):void 0}function gD(t,i,e){let n=Va(vD(t),i,e);return new ze(n.x-t.width/2,n.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function vD(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Va(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,a=Math.cos(r),s=Math.sin(r);return{x:n*a-o*s+e.x,y:n*s+o*a+e.y}}function yD({sourceRect:t,targetRect:i,sourceRotationContext:e,targetRotationContext:n}){return xD(CD(t,i,e),bD(t,i,n),t,i)}function CD(t,i,e){return J0(t.gravityCenter,i.gravityCenter,t,e)}function bD(t,i,e){return J0(i.gravityCenter,t.gravityCenter,i,e)}function xD(t,i,e,n){return{point1:t||e.gravityCenter,point2:i||n.gravityCenter}}var _a=.5,wD={[xn.FLOATING]:yD,[xn.FIXED_CENTER]:mD,[xn.FIXED]:_D},Xi=(()=>{class t{handle(e){let n=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,n),r=this._determineTargetSide(e,n);return e.connection._applyResolvedSidesToConnection(o,r),this._getBehaviorHandler(e.connection.fBehavior)({sourceRect:e.sourceRect,targetRect:e.targetRect,sourceConnectableSide:o,targetConnectableSide:r,sourceRotationContext:e.sourceRotationContext,targetRotationContext:e.targetRotationContext})}_calculateDirectionalVectors(e,n,o,r){let a=o-e,s=r-n;return{sourceToTargetX:a,sourceToTargetY:s,targetToSourceX:-a,targetToSourceY:-s}}_determineSourceSide(e,n){return this._resolveConnectableSide(e.connection.fOutputSide(),n.sourceToTargetX,n.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,n){return this._resolveConnectableSide(e.connection.fInputSide(),n.targetToSourceX,n.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,n,o,r){if(e===we.DEFAULT)return r;let a=Math.abs(n),s=Math.abs(o);if(a<_a&&s<_a)return r;let u=a>=s;switch(e){case we.CALCULATE:return u?n>=0?F.RIGHT:F.LEFT:o>=0?F.BOTTOM:F.TOP;case we.CALCULATE_HORIZONTAL:return a<_a?r:n>=0?F.RIGHT:F.LEFT;case we.CALCULATE_VERTICAL:return s<_a?r:o>=0?F.BOTTOM:F.TOP;case we.TOP:return F.TOP;case we.BOTTOM:return F.BOTTOM;case we.LEFT:return F.LEFT;case we.RIGHT:return F.RIGHT;default:return r}}_getBehaviorHandler(e){let n=wD[e];if(!n)throw new Error(`[Behavior] No handler for behavior: ${e}`);return n}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),kt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(i,e,n,o,r,a,s){this.sourceRect=i,this.targetRect=e,this.connection=n,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=a,this.targetRotationContext=s}};function Cp(t,i,e){return[t,...e??[],i]}function SD(t,i){let e=Math.abs(i.x-t.x)/2,n=i.x<t.x?i.x+e:i.x-e,o=Math.abs(i.y-t.y)/2,r=i.y<t.y?i.y+o:i.y-o;return{x:n,y:r}}function ID(t,i=32){let e=new Array(i+1);e[0]=de({},t[0]);for(let n=1;n<=i;n++)e[n]=ev(t[0],t[1],t[2],t[3],n/i);return e}function ev(t,i,e,n,o){let r=1-o,a=o*o,s=r*r,c=s*r,u=a*o;return{x:c*t.x+3*s*o*i.x+3*r*a*e.x+u*n.x,y:c*t.y+3*s*o*i.y+3*r*a*e.y+u*n.y}}function tv(t){return t.map(i=>ev(i.p0,i.c1,i.c2,i.p3,.5))}function TD(t){if(t.length<2)throw new Error("Polylines must be at least two points");let i=ED(t);return i<=0?[de({},t[0])]:[PD(t,i/2)]}function ED(t){let i=0;for(let e=0;e<t.length-1;e++)i+=nv(t[e],t[e+1]);return i}function PD(t,i){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],a=t[o+1],s=nv(r,a);if(!(s<=0)){if(e+s>=i){let c=(i-e)/s;return{x:r.x+(a.x-r.x)*c,y:r.y+(a.y-r.y)*c}}e+=s}}let n=t[t.length-1];return{x:n.x,y:n.y}}function nv(t,i){return Math.hypot(i.x-t.x,i.y-t.y)}function kD(t){let i=[];for(let e of t)for(let n of e){let o=i[i.length-1];(!o||o.x!==n.x||o.y!==n.y)&&i.push(n)}return i}function iv(t){if(!t.length)return"";let i=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let n=t[e],o=e===t.length-1,r=o?n.p3.x+2e-4:n.p3.x,a=o?n.p3.y+2e-4:n.p3.y;i+=` C ${n.c1.x} ${n.c1.y}, ${n.c2.x} ${n.c2.y}, ${r} ${a}`}return i}function ov(t,i=16){if(!t.length)return[];let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=ID([o.p0,o.c1,o.c2,o.p3],i);n>0&&r.shift(),e.push(...r)}return e}function MD(t,i=1e-6){let e=t.length;if(e<=2)return t;let n=[];n.push(t[0]);for(let r=1;r<e;r++){let a=t[r],s=n[n.length-1];(Math.abs(a.x-s.x)>i||Math.abs(a.y-s.y)>i)&&n.push(a)}if(n.length<=2)return n;let o=[];o.push(n[0]);for(let r=1;r<n.length-1;r++){let a=o[o.length-1],s=n[r],c=n[r+1],u=Math.abs(a.x-s.x)<=i&&Math.abs(s.x-c.x)<=i,p=Math.abs(a.y-s.y)<=i&&Math.abs(s.y-c.y)<=i;!u&&!p&&o.push(s)}return o.push(n[n.length-1]),o}var gh=class t{static _dir(i){switch(i){case F.LEFT:return{x:-1,y:0};case F.RIGHT:return{x:1,y:0};case F.TOP:return{x:0,y:-1};case F.BOTTOM:return{x:0,y:1};case F.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(i){return i===F.LEFT||i===F.RIGHT}static _handleLength(i,e,n,o){let r=Math.abs(e.x-i.x),a=Math.abs(e.y-i.y),s=Math.hypot(r,a),c=n===F.AUTO?Math.max(r,a):this._isHorizontal(n)?r:a,u=Math.max(8,o),p=o+.5*s,_=o*1.05+c*.3;return Math.min(p,Math.max(u,_))}static _softControl(i,e,n,o){let r=this._dir(i),a=n.x-e.x,s=n.y-e.y,c=Math.hypot(a,s)||1,u=a/c,p=s/c;if(i===F.AUTO)return{x:e.x+u*o,y:e.y+p*o};let _=r.x*u+r.y*p,b=.12,k=Math.max(0,-_)*.08,P=Math.min(.2,b+k),N=r.x*(1-P)+u*P,j=r.y*(1-P)+p*P,z=Math.hypot(N,j)||1;return{x:e.x+N/z*o,y:e.y+j/z*o}}handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:a}){let s=Math.max(0,r??0),c=Cp(i,n,a),u=[];for(let _=0;_<c.length-1;_++){let b=c[_],k=c[_+1],P=t._handleLength(b,k,e,s),N=t._handleLength(k,b,o,s),j=t._softControl(e,b,k,P),z=t._softControl(o,k,b,N);u.push({p0:b,c1:j,c2:z,p3:k,chainIndex:_})}let p=ov(u,12);return{path:iv(u),secondPoint:u[0]?.c1??i,penultimatePoint:u[u.length-1]?.c2??n,points:p,candidates:tv(u)}}},vh=class{handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:a}){let s=Cp(i,n,a),c=[];for(let p=0;p<s.length-1;p++){let _=s[p],b=s[p+1],k=S0(e,_,b,r??0),P=S0(o,b,_,r??0);c.push({p0:_,c1:k,c2:P,p3:b,chainIndex:p})}let u=ov(c,12);return{path:iv(c),secondPoint:c[0]?.c1??i,penultimatePoint:c[c.length-1]?.c2??n,points:u,candidates:tv(c)}}};function S0(t,i,e,n){let o={x:i.x,y:i.y};switch(t){case F.LEFT:o.x-=ga(i.x-e.x,n);break;case F.RIGHT:o.x+=ga(e.x-i.x,n);break;case F.TOP:o.y-=ga(i.y-e.y,n);break;case F.BOTTOM:o.y+=ga(e.y-i.y,n);break;case F.AUTO:break}return o}function ga(t,i){return t>=i?t:i*Math.sqrt(i-t)}function DD(t){let{axis:i,source:e,target:n,sourceSide:o,targetSide:r,sourceGap:a,targetGap:s,sourceDir:c,targetDir:u,currentDir:p,offset:_,sourceGapOffset:b,targetGapOffset:k}=t,P=OD(a,s),N=ND(i,c,p,P);return o===r?RD(i,e,n,_,c,p,a,s,b,k):N=AD(i,c,u,a,s,P,N),N}function OD(t,i){return{sourceTarget:[{x:t.x,y:i.y}],targetSource:[{x:i.x,y:t.y}]}}function ND(t,i,e,n){return t==="x"?i.x===e?n.targetSource:n.sourceTarget:i.y===e?n.sourceTarget:n.targetSource}function RD(t,i,e,n,o,r,a,s,c,u){let p=Math.abs(i[t]-e[t]);if(p>n)return;let _=Math.min(n-1,n-p);_<=0||(o[t]===r?c[t]=(a[t]>i[t]?-1:1)*_:u[t]=(s[t]>e[t]?-1:1)*_)}function AD(t,i,e,n,o,r,a){let s=t==="x"?"y":"x",c=i[t]===e[s],u=n[s]>o[s],p=n[s]<o[s];return i[t]===1&&(!c&&u||c&&p)||i[t]!==1&&(!c&&p||c&&u)?t==="x"?r.sourceTarget:r.targetSource:a}var wo=1e-6,I0=2e-4,FD=.75;function LD(t,i){let e=t.length,n=[];n.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)n.push(BD(t[r-1],t[r],t[r+1],i));let o=t[e-1];return n.push(`L ${o.x+I0} ${o.y+I0}`),n.join(" ")}function BD(t,i,e,n){let o=i.x,r=i.y;if(n<=0)return`L ${o} ${r}`;let a=Math.abs(t.x-o)<=wo&&Math.abs(o-e.x)<=wo,s=Math.abs(t.y-r)<=wo&&Math.abs(r-e.y)<=wo;if(a||s)return`L ${o} ${r}`;let c=Math.hypot(o-t.x,r-t.y),u=Math.hypot(e.x-o,e.y-r),p=Math.min(c*.5,u*.5,n);if(p<FD)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=wo){let j=t.x<e.x?-1:1,z=t.y<e.y?1:-1,U=o+p*j,oe=r+p*z;return`L ${U} ${r} Q ${o} ${r} ${o} ${oe}`}let b=t.x<e.x?1:-1,k=t.y<e.y?-1:1,P=r+p*k,N=o+p*b;return`L ${o} ${P} Q ${o} ${r} ${N} ${r}`}var T0={[F.LEFT]:A.initialize(-1,0),[F.RIGHT]:A.initialize(1,0),[F.TOP]:A.initialize(0,-1),[F.BOTTOM]:A.initialize(0,1),[F.AUTO]:A.initialize(0,0)},yh=class{handle({source:i,sourceSide:e,target:n,targetSide:o,waypoints:r,offset:a,radius:s}){let c=Cp(i,n,r),u=[],p=[];for(let P=0;P<c.length-1;P++){let N=c[P],j=c[P+1],z=this._getPathPoints(N,e,j,o,a??0);u.push(z),p.push(...TD(z))}let _=MD(kD(u)),b=_.length>1?_[_.length-2]:i,k=_.length>1?_[1]:n;return{path:LD(_,s??0),penultimatePoint:b,secondPoint:k,points:_,candidates:p}}_getPathPoints(i,e,n,o,r){let a=T0[e],s=T0[o],c={x:i.x+a.x*r,y:i.y+a.y*r},u={x:n.x+s.x*r,y:n.y+s.y*r},p=this._getDirection(c,e,u),_=p.x!==0?"x":"y",b=p[_],k=[],P=A.initialize(),N=A.initialize(),j=SD(i,n);if(a[_]*s[_]===-1){let z=[{x:j.x,y:c.y},{x:j.x,y:u.y}],U=[{x:c.x,y:j.y},{x:u.x,y:j.y}];a[_]===b?k=_==="x"?z:U:k=_==="x"?U:z}else k=DD({axis:_,source:i,target:n,sourceSide:e,targetSide:o,sourceGap:c,targetGap:u,sourceDir:a,targetDir:s,currentDir:b,offset:r,sourceGapOffset:P,targetGapOffset:N});return[i,{x:c.x+P.x,y:c.y+P.y},...k,{x:u.x+N.x,y:u.y+N.y},n]}_getDirection(i,e,n){return e===F.LEFT||e===F.RIGHT?i.x<n.x?A.initialize(1,0):A.initialize(-1,0):i.y<n.y?A.initialize(0,1):A.initialize(0,-1)}},E0=2e-4,Ch=class{handle(i){let e=Cp(i.source,i.target,i.waypoints),n=e.length,o=e[0],r=`M ${o.x} ${o.y}`,a=new Array(n-1);for(let s=0;s<n-1;s++){let c=e[s],u=e[s+1],p=s===n-2,_=p?u.x+E0:u.x,b=p?u.y+E0:u.y;r+=` L ${_} ${b}`,a[s]={x:(c.x+u.x)*.5,y:(c.y+u.y)*.5}}return{path:r,candidates:a,points:e,secondPoint:e[1]??i.target,penultimatePoint:e[n-2]??i.source}}},zD=new ue("F_CONNECTION_BUILDERS"),rv=(()=>{class t{_builtinBuilders={[Oi.STRAIGHT]:new Ch,[Oi.BEZIER]:new vh,[Oi.ADAPTIVE_CURVE]:new gh,[Oi.SEGMENT]:new yh};_providedBuilders;_builders;constructor(){this._providedBuilders=l(zD,{optional:!0})||{},this._builders=de(de({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:n}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(n)}_createBuilderNotFoundError(e){let n=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),a=n.filter(c=>c in this._providedBuilders).sort(),s=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${n.length?n.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,a.length?`Overridden built-ins: ${a.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(s.join(`
|
|
2
|
+
`))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function qD(t,i,e){return Xt("connection_"+t+i+e)}function VD(t,i,e){return Xt("connection_for_selection_"+t+i+e)}function av(t){return Xt("connection_gradient_"+t)}function HD(t){return`url(#${av(t)})`}var GD=(()=>{class t{_connection=l(yp);_hostElement=l(Re).nativeElement;_injector=l(Xe);_hostAttributes=new Map;_startColor;_endColor;gradientId=S(()=>av(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){ie(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),At(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let n=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(n*n+o*o)||.01,a=new Z(.5-.5*n/r,.5-.5*o/r);this._setHostAttribute("x1",a.x.toString()),this._setHostAttribute("y1",a.y.toString());let s=new Z(.5+.5*n/r,.5+.5*o/r);this._setHostAttribute("x2",s.x.toString()),this._setHostAttribute("y2",s.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let n=e||"transparent";this._startColor!==n&&(this._startColor=n,this.stop1Element.setAttribute("stop-color",n),this.stop1Element.style.setProperty("stop-color",n))}_setToColor(e){let n=e||"transparent";this._endColor!==n&&(this._endColor=n,this.stop2Element.setAttribute("stop-color",n),this.stop2Element.style.setProperty("stop-color",n))}_setHostAttribute(e,n){this._hostAttributes.get(e)!==n&&(this._hostAttributes.set(e,n),this._hostElement.setAttribute(e,n))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})(),bh=(()=>{class t extends GD{gradient=O.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(n,o){n&2&&q("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[he],attrs:mM,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(n,o){n&1&&($r(0,0),et(),Si(1,"stop",1)(2,"stop",2),Kr())},encapsulation:2,changeDetection:0})}return t})(),P0=new ue("F_CONNECTION_GRADIENT");var xh=new ue("F_CONNECTION_PATH"),wh=class{hostElement=l(Re).nativeElement},jD=(()=>{class t extends wh{_connection=l(yp);useGradient=O(!1);linkToGradient=S(()=>this.useGradient()?HD(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return qD(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}initialize(){this.deselect()}setPath(e){this.hostElement.setAttribute("d",`${e}`)}select(){this.hostElement.setAttribute("marker-start",`url(#${$D(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${KD(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${UD(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${WD(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(n,o){n&2&&(q("id",o.attrConnectionId)("data-f-path-id",o.fPathId),Tt("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[ge([{provide:xh,useExisting:t}]),he],attrs:_M,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function UD(t){return Xt(`f-connection-marker-start-${t}`)}function WD(t){return Xt(`f-connection-marker-end-${t}`)}function $D(t){return Xt(`f-connection-selected-marker-start-${t}`)}function KD(t){return Xt(`f-connection-selected-marker-end-${t}`)}var Sh=new ue("F_CONNECTION_SELECTION"),Ih=class{hostElement=l(Re).nativeElement},YD=(()=>{class t extends Ih{_connection=l(yp);get connectionForSelectionId(){return VD(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}setPath(e){this.hostElement.setAttribute("d",`${e}`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(n,o){n&2&&q("id",o.connectionForSelectionId)},standalone:!1,features:[ge([{provide:Sh,useExisting:t}]),he],attrs:gM,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),Th=new ue("F_CONNECTION_DRAG_HANDLE_END"),Eh=new ue("F_CONNECTION_DRAG_HANDLE_START"),ol=class{hostElement=l(Re).nativeElement;point=A.initialize();class="f-connection-drag-handle";calculateCircleCenter(i,e,n){let o={x:e.x-i.x,y:e.y-i.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,a={x:o.x/r,y:o.y/r},s={x:a.x*n,y:a.y*n};return{x:e.x-s.x,y:e.y-s.y}}},XD=(()=>{class t extends ol{redraw(e,n){this.point=this.calculateCircleCenter(e,n,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ae(o.class)},standalone:!1,features:[ge([{provide:Eh,useExisting:t}]),he],attrs:vM,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),ZD=(()=>{class t extends ol{redraw(e,n){this.point=this.calculateCircleCenter(e,n,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ae(o.class)},standalone:!1,features:[ge([{provide:Th,useExisting:t}]),he],attrs:yM,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),th="f-selected";function sv(t){return class extends t{fId=H("");fSelectionDisabled=H(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(th)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(th)}isSelected(){return this.hostElement.classList.contains(th)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...i){super(...i)}}}function QD(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...i){super(...i)}}}var JD=sv(QD(class{hostElement;constructor(t){this.hostElement=t}})),eO=(()=>{class t extends JD{_fConnectionBuilder=l(rv);path="";line=bo.initialize();fReassignableStart=H(!1);fDraggingDisabled=H(!1);fSelectionDisabled=H(!1);fDefs=Pe.required("defs");fPath=Pe.required(xh);fDragHandleStart=Pe(Eh);fDragHandleEnd=Pe.required(Th);fSelection=Pe.required(Sh);fContents=Hf(b0,{descendants:!0});fMarkers=Hf(nl,{descendants:!0});fGradient=Zr(P0);_fGradientRenderer=Pe(bh);fWaypoints=Zr(x0);fInputSide=H(we.DEFAULT);_contentLayoutEngine=new _h;_sourceSide=F.AUTO;fOutputSide=H(we.DEFAULT);_targetSide=F.AUTO;_penultimatePoint=A.initialize();_secondPoint=A.initialize();constructor(){super(l(Re).nativeElement)}initialize(){this.redraw(),this.isSelected()?this.markChildrenAsSelected():this.unmarkChildrenAsSelected()}isContains(e){return(this.hostElement.firstChild?.lastChild).contains(e)||Array.from(this.fContents()?.values()??[]).some(n=>n.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:n}){this.line=bo.initialize(e,n);let{path:o,points:r,penultimatePoint:a,secondPoint:s,candidates:c}=this._getPathResult(e,n);this.path=o,this._penultimatePoint=a||e,this._secondPoint=s||n,this.fWaypoints()?.candidates.set(c||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,n){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:n,targetSide:this._targetSide,radius:this.fRadius,offset:this.fOffset,waypoints:this.fWaypoints()?.waypoints()||[]}})}markChildrenAsSelected(){this.fPath().select()}unmarkChildrenAsSelected(){this.fPath().deselect()}redraw(){this.fPath().setPath(this.path),this.fSelection().setPath(this.path),this.fDragHandleEnd().redraw(this._penultimatePoint,this.line.point2),this.fDragHandleStart()?.redraw(this._secondPoint,this.line.point1),this._fGradientRenderer()?.redraw(this.line)}getResolvedSides(){return{sourceSide:this._sourceSide,targetSide:this._targetSide}}_applyResolvedSidesToConnection(e,n){this._sourceSide=e,this._targetSide=n}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,contentQueries:function(n,o,r){n&1&&qf(r,o.fContents,b0,5)(r,o.fMarkers,nl,5)(r,o.fGradient,P0,5)(r,o.fWaypoints,x0,5),n&2&&tt(4)},viewQuery:function(n,o){n&1&&ut(o.fDefs,CM,5)(o.fPath,xh,5)(o.fDragHandleStart,Eh,5)(o.fDragHandleEnd,Th,5)(o.fSelection,Sh,5)(o._fGradientRenderer,bh,5),n&2&&tt(6)},standalone:!1,features:[he]})}return t})(),tO=(()=>{let t=class Ha{_browser=l(qe);_markerCache=new WeakMap;handle({connection:e}){let n=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=nO(n),a=this._markerCache.get(e);if(a?.signature===r&&a.defsElement===o.nativeElement)return!1;let s=dv("defs",this._browser);return n.forEach(c=>{cv(c.type).forEach(u=>{let p=iO(u,c,e.fId(),this._browser),_=c.markerElement.cloneNode(!0);_.setAttribute("height",`${c.height}`),_.setAttribute("width",`${c.width}`),_.removeAttribute("markerUnits"),_.style.display="unset",p.append(_),s.append(p)})}),o.nativeElement.innerHTML=s.innerHTML,this._markerCache.set(e,{signature:r,defsElement:o.nativeElement}),this._makeSafariCompatible(e),!0}_findConnectionMarkers(e){return Array.from(e.fMarkers()??[])}_makeSafariCompatible(e){e.fPath().hostElement.replaceWith(e.fPath().hostElement)}static \u0275fac=function(n){return new(n||Ha)};static \u0275prov=y({token:Ha,factory:Ha.\u0275fac})};return t=x([w(Bi)],t),t})();function nO(t){return t.map(i=>[...cv(i.type),i.width,i.height,i.refX,i.refY,i.orient,i.markerUnits,i.markerElement.outerHTML].join("|")).join("||")}function iO(t,i,e,n){let o=dv("marker",n);return o.setAttribute("id",Xt(t+"-"+e)),o.setAttribute("markerHeight",`${i.height}`),o.setAttribute("markerWidth",`${i.width}`),o.setAttribute("orient",`${i.orient}`),o.setAttribute("refX",`${i.refX}`),o.setAttribute("refY",`${i.refY}`),o.setAttribute("markerUnits",`${i.markerUnits}`),o}function cv(t){switch(t){case _e.START:return[_e.START];case _e.END:return[_e.END];case _e.SELECTED_START:return[_e.SELECTED_START];case _e.SELECTED_END:return[_e.SELECTED_END];case _e.START_ALL_STATES:return[_e.START,_e.SELECTED_START];case _e.END_ALL_STATES:return[_e.END,_e.SELECTED_END];default:return[]}}function dv(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}var bp=(()=>{class t{renderTicket=0;_connectedInPreviousRender=new Set;beginRender(){return++this.renderTicket}resetConnectedConnectors(){for(let e of this._connectedInPreviousRender)e.resetConnected();this._connectedInPreviousRender.clear()}trackConnectedConnectors(e,n){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),oO=String.raw`
|
|
3
|
+
const EPSILON = 0.5;
|
|
4
|
+
|
|
5
|
+
addEventListener('message', (event) => {
|
|
6
|
+
const data = event?.data;
|
|
7
|
+
const requestId = data?.requestId;
|
|
8
|
+
const items = Array.isArray(data?.items) ? data.items : [];
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const results = items.map((item) => calculateItem(item));
|
|
12
|
+
postMessage({ requestId, results });
|
|
13
|
+
} catch (error) {
|
|
14
|
+
const message = error instanceof Error ? error.message : 'Connection worker failed.';
|
|
15
|
+
postMessage({ requestId, error: message });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
function calculateItem(item) {
|
|
20
|
+
const sourceCenterX = item.sourceRect.x + item.sourceRect.width / 2;
|
|
21
|
+
const sourceCenterY = item.sourceRect.y + item.sourceRect.height / 2;
|
|
22
|
+
const targetCenterX = item.targetRect.x + item.targetRect.width / 2;
|
|
23
|
+
const targetCenterY = item.targetRect.y + item.targetRect.height / 2;
|
|
24
|
+
|
|
25
|
+
const sourceSide = resolveConnectableSide(
|
|
26
|
+
item.outputSide,
|
|
27
|
+
targetCenterX - sourceCenterX,
|
|
28
|
+
targetCenterY - sourceCenterY,
|
|
29
|
+
item.sourceConnectableSide,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const targetSide = resolveConnectableSide(
|
|
33
|
+
item.inputSide,
|
|
34
|
+
sourceCenterX - targetCenterX,
|
|
35
|
+
sourceCenterY - targetCenterY,
|
|
36
|
+
item.targetConnectableSide,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
if (item.behavior === 'fixed_center') {
|
|
40
|
+
return {
|
|
41
|
+
originalIndex: item.originalIndex,
|
|
42
|
+
supported: true,
|
|
43
|
+
sourceSide,
|
|
44
|
+
targetSide,
|
|
45
|
+
line: {
|
|
46
|
+
point1: { x: sourceCenterX, y: sourceCenterY },
|
|
47
|
+
point2: { x: targetCenterX, y: targetCenterY },
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (item.sourceRotation || item.targetRotation) {
|
|
53
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (item.behavior !== 'fixed') {
|
|
57
|
+
if (item.behavior !== 'floating') {
|
|
58
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (hasRoundedCorners(item.sourceRect) || hasRoundedCorners(item.targetRect)) {
|
|
62
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
originalIndex: item.originalIndex,
|
|
67
|
+
supported: true,
|
|
68
|
+
sourceSide,
|
|
69
|
+
targetSide,
|
|
70
|
+
line: buildFloatingLine(item.sourceRect, item.targetRect),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const line = buildFixedLine(item.sourceRect, item.targetRect, sourceSide, targetSide);
|
|
75
|
+
if (!line) {
|
|
76
|
+
return { originalIndex: item.originalIndex, supported: false };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
originalIndex: item.originalIndex,
|
|
81
|
+
supported: true,
|
|
82
|
+
sourceSide,
|
|
83
|
+
targetSide,
|
|
84
|
+
line,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resolveConnectableSide(requestedSide, deltaX, deltaY, fallbackSide) {
|
|
89
|
+
if (requestedSide === 'default') {
|
|
90
|
+
return fallbackSide;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const absX = Math.abs(deltaX);
|
|
94
|
+
const absY = Math.abs(deltaY);
|
|
95
|
+
const nearZero = absX < EPSILON && absY < EPSILON;
|
|
96
|
+
|
|
97
|
+
if (nearZero) {
|
|
98
|
+
return fallbackSide;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const horizontalDominant = absX >= absY;
|
|
102
|
+
|
|
103
|
+
switch (requestedSide) {
|
|
104
|
+
case 'calculate':
|
|
105
|
+
return horizontalDominant ? (deltaX >= 0 ? 'right' : 'left') : deltaY >= 0 ? 'bottom' : 'top';
|
|
106
|
+
|
|
107
|
+
case 'calculate_horizontal':
|
|
108
|
+
if (absX < EPSILON) {
|
|
109
|
+
return fallbackSide;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return deltaX >= 0 ? 'right' : 'left';
|
|
113
|
+
|
|
114
|
+
case 'calculate_vertical':
|
|
115
|
+
if (absY < EPSILON) {
|
|
116
|
+
return fallbackSide;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return deltaY >= 0 ? 'bottom' : 'top';
|
|
120
|
+
|
|
121
|
+
case 'top':
|
|
122
|
+
case 'bottom':
|
|
123
|
+
case 'left':
|
|
124
|
+
case 'right':
|
|
125
|
+
return requestedSide;
|
|
126
|
+
|
|
127
|
+
default:
|
|
128
|
+
return fallbackSide;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function buildFixedLine(sourceRect, targetRect, sourceSide, targetSide) {
|
|
133
|
+
const sourceAnchor = sourceSide === 'auto' ? 'bottom' : sourceSide;
|
|
134
|
+
const targetAnchor = targetSide === 'auto' ? 'top' : targetSide;
|
|
135
|
+
|
|
136
|
+
const point1 = getSidePoint(sourceRect, sourceAnchor);
|
|
137
|
+
const point2 = getSidePoint(targetRect, targetAnchor);
|
|
138
|
+
|
|
139
|
+
if (!point1 || !point2) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return { point1, point2 };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function buildFloatingLine(sourceRect, targetRect) {
|
|
147
|
+
const sourceCenter = getRectCenter(sourceRect);
|
|
148
|
+
const targetCenter = getRectCenter(targetRect);
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
point1: getRectBorderIntersection(sourceRect, sourceCenter, targetCenter),
|
|
152
|
+
point2: getRectBorderIntersection(targetRect, targetCenter, sourceCenter),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function hasRoundedCorners(rect) {
|
|
157
|
+
return !!(rect.radius1 || rect.radius2 || rect.radius3 || rect.radius4);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getRectCenter(rect) {
|
|
161
|
+
return {
|
|
162
|
+
x: rect.x + rect.width / 2,
|
|
163
|
+
y: rect.y + rect.height / 2,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function getRectBorderIntersection(rect, from, to) {
|
|
168
|
+
const halfWidth = rect.width / 2;
|
|
169
|
+
const halfHeight = rect.height / 2;
|
|
170
|
+
const center = getRectCenter(rect);
|
|
171
|
+
|
|
172
|
+
const dx = to.x - from.x;
|
|
173
|
+
const dy = to.y - from.y;
|
|
174
|
+
|
|
175
|
+
if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON) {
|
|
176
|
+
return center;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const scaleX = Math.abs(dx) < EPSILON ? Number.POSITIVE_INFINITY : halfWidth / Math.abs(dx);
|
|
180
|
+
const scaleY = Math.abs(dy) < EPSILON ? Number.POSITIVE_INFINITY : halfHeight / Math.abs(dy);
|
|
181
|
+
const scale = Math.min(scaleX, scaleY);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
x: center.x + dx * scale,
|
|
185
|
+
y: center.y + dy * scale,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function getSidePoint(rect, side) {
|
|
190
|
+
const centerX = rect.x + rect.width / 2;
|
|
191
|
+
const centerY = rect.y + rect.height / 2;
|
|
192
|
+
|
|
193
|
+
switch (side) {
|
|
194
|
+
case 'top':
|
|
195
|
+
return { x: centerX, y: rect.y };
|
|
196
|
+
|
|
197
|
+
case 'right':
|
|
198
|
+
return { x: rect.x + rect.width, y: centerY };
|
|
199
|
+
|
|
200
|
+
case 'bottom':
|
|
201
|
+
return { x: centerX, y: rect.y + rect.height };
|
|
202
|
+
|
|
203
|
+
case 'left':
|
|
204
|
+
return { x: rect.x, y: centerY };
|
|
205
|
+
|
|
206
|
+
default:
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`.trim();function lv(t){return!!uv(t)}function uv(t){let i=t,e=i?.Blob,n=i?.Worker,o=i?.URL;return!e||!n||typeof o?.createObjectURL!="function"||typeof o.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:n,urlApi:o}}function rO(t){let i=new t.blobCtor([oO],{type:"text/javascript"});return t.urlApi.createObjectURL(i)}function pv(t,i){if(!t)return;let e=i??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var ci=(()=>{class t{worker=null;workerUrl=null;nextRequestId=0;isDisabled=!1;pending=new Map;resetRuntime(e){this.pending.forEach(n=>n.reject(e)),this.pending.clear(),this.worker?.terminate(),this.worker=null,pv(this.workerUrl),this.workerUrl=null}dispose(){this.resetRuntime(new Error("Connection worker was destroyed."))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),rl=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(i,e){this.connection=i,this.line=e}},aO=(()=>{let t=class Ga{_mediator=l(D);_renderCache=new WeakMap;handle({connection:e,line:n}){!this._mediator.execute(new Bi(e))&&!this._shouldRender(e,n)||(e.setLine(n),e.initialize())}_shouldRender(e,n){let o=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,n),a=this._renderCache.get(e);return a?.signature===r&&a.pathElement===o?!1:(this._renderCache.set(e,{signature:r,pathElement:o}),!0)}_createConnectionRenderSignature(e,n){let{sourceSide:o,targetSide:r}=e.getResolvedSides();return[e.fBehavior,e.fType,e.fRadius,e.fOffset,e.fReassignableStart(),this._serializeContents([...e.fContents()||[]]),o,r,this._serializePoint(n.point1),this._serializePoint(n.point2),this._serializeWaypoints(e.fWaypoints()?.waypoints()||[])].join("|")}_serializePoint(e){return`${e.x}:${e.y}`}_serializeWaypoints(e){return e.map(this._serializePoint).join(";")}_serializeContents(e){return e.map(n=>[n.position(),n.offset(),n.align()].join(":")).join(";")}static \u0275fac=function(n){return new(n||Ga)};static \u0275prov=y({token:Ga,factory:Ga.\u0275fac})};return t=x([w(rl)],t),t})(),al=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(i,e){this.source=i,this.target=e}},sO=(()=>{let t=class ja{_state=l(bp);handle({source:e,target:n}){e.setConnected(n),n.setConnected(e),this._state.trackConnectedConnectors(e,n)}static \u0275fac=function(n){return new(n||ja)};static \u0275prov=y({token:ja,factory:ja.\u0275fac})};return t=x([w(al)],t),t})(),En=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(i,e=!0){this.element=i,this.cache=e}},cO={enabled:!1},qt=new ue("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>de({},cO)});var sl=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(i,e,n,o){this.id=i,this.nodeId=e,this.kind=n,this.element=o}},Vt=(()=>{class t{nodeEntries=new Map;nodeIdByElement=new WeakMap;connectorEntries=new Map;connectorKeysByNodeId=new Map;connectorKeyByElement=new WeakMap;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ph=class{key;id;kind;nodeId;element;rect;constructor(i,e,n,o,r,a){this.key=i,this.id=e,this.kind=n,this.nodeId=o,this.element=r,this.rect=a}},To=class{static build(i,e){return`${i}:${e}`}},kh=class{id;element;reference;rect;constructor(i,e,n,o){this.id=i,this.element=e,this.reference=n,this.rect=o}},zi=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(i,e="manual"){this.nodeId=i,this.reason=e}},dO=(()=>{let t=class Ua{_store=l(Vt);_options=l(qt);handle({nodeId:e,reason:n}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;o.rect=void 0;let r=this._store.connectorKeysByNodeId.get(e);if(r?.size)for(let a of r){let s=this._store.connectorEntries.get(a);s&&(s.rect=void 0)}}static \u0275fac=function(n){return new(n||Ua)};static \u0275prov=y({token:Ua,factory:Ua.\u0275fac})};return t=x([w(zi)],t),t})(),cl=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(i,e,n){this.id=i,this.element=e,this.reference=n}},lO=(()=>{let t=class Wa{_store=l(Vt);_options=l(qt);handle({id:e,element:n,reference:o}){if(!this._options.enabled)return;let r=new kh(e,n,o);this._store.nodeEntries.set(e,r),this._store.nodeIdByElement.set(n,e),this._store.connectorKeysByNodeId.set(e,this._store.connectorKeysByNodeId.get(e)??new Set)}static \u0275fac=function(n){return new(n||Wa)};static \u0275prov=y({token:Wa,factory:Wa.\u0275fac})};return t=x([w(cl)],t),t})(),dl=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(i){this.id=i}},uO=(()=>{let t=class $a{_store=l(Vt);_mediator=l(D);_options=l(qt);handle({id:e}){if(!this._options.enabled)return;let n=this._store.nodeEntries.get(e);if(!n)return;this._store.nodeEntries.delete(e),this._store.nodeIdByElement.delete(n.element);let o=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of o){let a=this._store.connectorEntries.get(r);a&&this._mediator.execute(new Eo(a.id,a.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(n){return new(n||$a)};static \u0275prov=y({token:$a,factory:$a.\u0275fac})};return t=x([w(dl)],t),t})(),pO=(()=>{let t=class Ka{_store=l(Vt);_mediator=l(D);_options=l(qt);handle({id:e,nodeId:n,kind:o,element:r}){if(!this._options.enabled)return;let a=To.build(e,o),s=this._store.connectorEntries.get(a);s&&(this._detachConnectorFromNode(s.key,s.nodeId),this._store.connectorKeyByElement.delete(s.element));let c=new Ph(a,e,o,n,r);this._store.connectorEntries.set(a,c),this._store.connectorKeyByElement.set(r,a);let u=this._store.connectorKeysByNodeId.get(n)??new Set;u.add(a),this._store.connectorKeysByNodeId.set(n,u),this._mediator.execute(new zi(n,"connector-registered"))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Ka)};static \u0275prov=y({token:Ka,factory:Ka.\u0275fac})};return t=x([w(sl)],t),t})(),Eo=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(i,e){this.connectorId=i,this.kind=e}},fO=(()=>{let t=class Ya{_store=l(Vt);_mediator=l(D);_options=l(qt);handle({connectorId:e,kind:n}){if(!this._options.enabled)return;let o=To.build(e,n),r=this._store.connectorEntries.get(o);r&&(this._store.connectorEntries.delete(o),this._store.connectorKeyByElement.delete(r.element),this._detachConnectorFromNode(o,r.nodeId),this._store.nodeEntries.has(r.nodeId)&&this._mediator.execute(new zi(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Ya)};static \u0275prov=y({token:Ya,factory:Ya.\u0275fac})};return t=x([w(Eo)],t),t})(),qi=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(i){this.element=i}},hO=(()=>{let t=class Xa{_store=l(Vt);_options=l(qt);handle({element:e}){if(!this._options.enabled)return;let n=this._store.nodeIdByElement.get(e);if(n){let r=this._store.nodeEntries.get(n)?.rect;if(r)return r}let o=this._store.connectorKeyByElement.get(e);if(o)return this._store.connectorEntries.get(o)?.rect??void 0}static \u0275fac=function(n){return new(n||Xa)};static \u0275prov=y({token:Xa,factory:Xa.\u0275fac})};return t=x([w(qi)],t),t})(),ti=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(i,e,n){this.connectorId=i,this.kind=e,this.rect=n}},mO=(()=>{let t=class Za{_store=l(Vt);_options=l(qt);handle({connectorId:e,kind:n,rect:o}){if(!this._options.enabled)return;let r=To.build(e,n),a=this._store.connectorEntries.get(r);a&&(a.rect=ze.fromRoundedRect(o))}static \u0275fac=function(n){return new(n||Za)};static \u0275prov=y({token:Za,factory:Za.\u0275fac})};return t=x([w(ti)],t),t})(),ni=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(i,e){this.nodeId=i,this.rect=e}},_O=(()=>{let t=class Qa{_store=l(Vt);_options=l(qt);handle({nodeId:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;let r=o.rect;o.rect=G.initialize(n.x,n.y,n.width,n.height),r&&this._updateConnectorRectsByNodeRect(e,r,o.rect)}_updateConnectorRectsByNodeRect(e,n,o){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let a=o.x-n.x,s=o.y-n.y,c=n.width!==0,u=n.height!==0,p=c?o.width/n.width:1,_=u?o.height/n.height:1;for(let b of r){let k=this._store.connectorEntries.get(b);if(!k?.rect)continue;let P=k.rect,N=P.gravityCenter,j=c?o.x+(N.x-n.x)*p:N.x+a,z=u?o.y+(N.y-n.y)*_:N.y+s;k.rect=new ze(j-P.width/2,z-P.height/2,P.width,P.height,P.radius1,P.radius2,P.radius3,P.radius4)}}static \u0275fac=function(n){return new(n||Qa)};static \u0275prov=y({token:Qa,factory:Qa.\u0275fac})};return t=x([w(ni)],t),t})(),Po=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(i,e){this.element=i,this.rect=e}},gO=(()=>{let t=class Ja{_store=l(Vt);_options=l(qt);handle({element:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeIdByElement.get(e);if(o){let s=this._store.nodeEntries.get(o);s&&(s.rect=n);return}let r=this._store.connectorKeyByElement.get(e);if(!r)return;let a=this._store.connectorEntries.get(r);a&&(a.rect=n)}static \u0275fac=function(n){return new(n||Ja)};static \u0275prov=y({token:Ja,factory:Ja.\u0275fac})};return t=x([w(Po)],t),t})(),vO=[Vt,lO,uO,dO,pO,fO,hO,_O,mO,gO];function Zi(t,i,e){return i?Z.fromPoint(t).elementTransform(i).sub(e.scaledPosition).sub(e.position).div(e.scale):Z.fromPoint(t)}function fv(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function Vi(t){return t?`${t}`:void 0}var yO=(()=>{let t=class es{_store=l(M);_mediator=l(D);_browser=l(qe);get _transform(){return this._store.transform}handle({element:e,cache:n}){let o=this._mediator.execute(new qi(e));if(o&&n)return o;let r=this._getElementRoundedRect(e),a=this._normalizePosition(r),s=this._unscaleSize(r),c=this._getUnscaledRect(a,s,r),u=this._getOffsetSize(e,s),p=ze.fromCenter(c,u.width,u.height);return this._mediator.execute(new Po(e,p)),p}_getElementRoundedRect(e){return this._getRoundedRect(G.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,n,o){let[r,a,s,c]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(o.borderTopLeftRadius,n,o.fontSize),this._getSystemRadius(o.borderTopRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomLeftRadius,n,o.fontSize)]);return new ze(e.x,e.y,e.width,e.height,r,a,s,c)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,n,o){return this._browser.toPixels(e,n.clientWidth,n.clientHeight,o)||0}_getSystemRadius(e,n,o){return this._toPixels(e,n,o)*this._transform.scale}_normalizeCircularBorderRadii(e,n,o){let[r,a,s,c]=o.map(p=>Math.max(0,p)),u=Math.min(1,this._getRadiusScaleFactor(e,r+a),this._getRadiusScaleFactor(n,a+s),this._getRadiusScaleFactor(e,s+c),this._getRadiusScaleFactor(n,c+r));return[r*u,a*u,s*u,c*u]}_getRadiusScaleFactor(e,n){return n<=0?1:e<=0?0:e/n}_normalizePosition(e){return Zi(e,this._store.flowHost,this._transform)}_unscaleSize(e){return it.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n,o){return new ze(e.x,e.y,n.width,n.height,this._unscaleRadius(o.radius1),this._unscaleRadius(o.radius2),this._unscaleRadius(o.radius3),this._unscaleRadius(o.radius4))}_unscaleRadius(e){return e/this._transform.scale}_getOffsetSize(e,n){return it.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||es)};static \u0275prov=y({token:es,factory:es.\u0275fac})};return t=x([w(En)],t),t})(),ll=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(i,e){this.connector=i,this.cache=e}},CO=(()=>{let t=class ts{_mediator=l(D);handle({connector:e,cache:n}){let o=this._buildCacheKey(e),r=n.get(o)??this._calculateRect(e);return n.set(o,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new En(e.hostElement))}static \u0275fac=function(n){return new(n||ts)};static \u0275prov=y({token:ts,factory:ts.\u0275fac})};return t=x([w(ll)],t),t})(),ul=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(i){this.connection=i}},bO=(()=>{let t=class ns{_store=l(M);handle({connection:e}){let n=this._store.outputs.get(e.fOutputId()),o=this._store.inputs.get(e.fInputId());return!n||!o?null:{source:n,target:o}}static \u0275fac=function(n){return new(n||ns)};static \u0275prov=y({token:ns,factory:ns.\u0275fac})};return t=x([w(ul)],t),t})(),ko=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(i,e){this.connection=i,this.cache=e}},xO=(()=>{let t=class is{_mediator=l(D);handle({connection:e,cache:n}){let o=this._resolveConnectionEndpoints(e);return o?jn(de({},o),{sourceRect:this._resolveEndpointRect(o.source,n),targetRect:this._resolveEndpointRect(o.target,n)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new ul(e))}_resolveEndpointRect(e,n){return this._mediator.execute(new ll(e,n))}static \u0275fac=function(n){return new(n||is)};static \u0275prov=y({token:is,factory:is.\u0275fac})};return t=x([w(ko)],t),t})(),Fe=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(i){this.element=i}},wO=(()=>{let t=class os{_store=l(M);_mediator=l(D);get _transform(){return this._store.transform}handle({element:e}){let n=this._mediator.execute(new qi(e));if(n)return n;let o=G.fromElement(e),r=this._normalizePosition(o),a=this._unscaleSize(o),s=this._getUnscaledRect(r,a),c=this._getOffsetSize(e,a),u=this._fromCenter(s,c.width,c.height);return this._mediator.execute(new Po(e,u)),u}_fromCenter(e,n,o){return G.initialize(e.gravityCenter.x-n/2,e.gravityCenter.y-o/2,n,o)}_normalizePosition(e){return Zi(e,this._store.flowHost,this._transform)}_unscaleSize(e){return it.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n){return new ze(e.x,e.y,n.width,n.height)}_getOffsetSize(e,n){return it.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||os)};static \u0275prov=y({token:os,factory:os.\u0275fac})};return t=x([w(Fe)],t),t})(),Zt=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(i){this.connector=i}},SO=(()=>{let t=class rs{_store=l(M);_mediator=l(D);handle({connector:e}){if(!e)return;let n=this._store.nodes.get(e.fNodeId);if(!n||!n._rotate)return;let o=this._mediator.execute(new Fe(n.hostElement));return{rotationDeg:n._rotate,pivot:o.gravityCenter}}static \u0275fac=function(n){return new(n||rs)};static \u0275prov=y({token:rs,factory:rs.\u0275fac})};return t=x([w(Zt)],t),t})(),pl=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(i,e){this.connection=i,this.geometry=e}},IO=(()=>{let t=class as{_mediator=l(D);_connectionBehaviour=l(Xi);handle({connection:e,geometry:n}){return this._connectionBehaviour.handle(new kt(n.sourceRect,n.targetRect,e,n.source.fConnectableSide,n.target.fConnectableSide,this._resolveRotationContext(n.source),this._resolveRotationContext(n.target)))}_resolveRotationContext(e){return this._mediator.execute(new Zt(e))}static \u0275fac=function(n){return new(n||as)};static \u0275prov=y({token:as,factory:as.\u0275fac})};return t=x([w(pl)],t),t})(),Mo=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(i,e,n,o){this.connection=i,this.source=e,this.target=n,this.line=o}},TO=(()=>{let t=class ss{_mediator=l(D);handle({connection:e,source:n,target:o,line:r}){this._mediator.execute(new al(n,o)),this._mediator.execute(new rl(e,r))}static \u0275fac=function(n){return new(n||ss)};static \u0275prov=y({token:ss,factory:ss.\u0275fac})};return t=x([w(Mo)],t),t})(),Do=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(i,e){this.connection=i,this.geometry=e}},EO=(()=>{let t=class cs{_mediator=l(D);handle({connection:e,geometry:n}){let o=this._mediator.execute(new pl(e,n));this._mediator.execute(new Mo(e,n.source,n.target,o))}static \u0275fac=function(n){return new(n||cs)};static \u0275prov=y({token:cs,factory:cs.\u0275fac})};return t=x([w(Do)],t),t})(),fl=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(i,e){this.connection=i,this.cache=e}},PO=(()=>{let t=class ds{_mediator=l(D);handle({connection:e,cache:n}){let o=this._mediator.execute(new ko(e,n));o&&this._mediator.execute(new Do(e,o))}static \u0275fac=function(n){return new(n||ds)};static \u0275prov=y({token:ds,factory:ds.\u0275fac})};return t=x([w(fl)],t),t})(),ii=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(i){this.session=i}},kO=(()=>{let t=class ls{_store=l(M);_state=l(bp);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(n){return new(n||ls)};static \u0275prov=y({token:ls,factory:ls.\u0275fac})};return t=x([w(ii)],t),t})(),Oo=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(i){this.session=i}},MO=(()=>{let t=class us{_mediator=l(D);_store=l(M);handle({session:e}){this._mediator.execute(new ii(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(n){return new(n||us)};static \u0275prov=y({token:us,factory:us.\u0275fac})};return t=x([w(Oo)],t),t})(),hl=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(i,e){this.batchItem=i,this.result=e}},DO=(()=>{let t=class ps{_mediator=l(D);handle({batchItem:e,result:n}){if(e){if(!this._isSupportedWorkerResult(n)){this._fallbackToMainThread(e);return}try{e.connection._applyResolvedSidesToConnection(n.sourceSide,n.targetSide),this._mediator.execute(new Mo(e.connection,e.geometry.source,e.geometry.target,n.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new Do(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(n){return new(n||ps)};static \u0275prov=y({token:ps,factory:ps.\u0275fac})};return t=x([w(hl)],t),t})(),wn=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(i,e,n,o,r,a){this.connections=i,this.cache=e,this.startIndex=n,this.session=o,this.batchItems=r,this.workerResults=a}},OO=500,NO=6,RO=(()=>{let t=class fs{_mediator=l(D);_browser=l(qe);handle({connections:e,cache:n,startIndex:o,session:r,batchItems:a,workerResults:s}){if(!this._isCurrent(r))return;let c=this._now(),u=o,p=0;for(;u<e.length&&p<OO&&this._isWithinSliceBudget(c);){let _=e[u];if(a?this._mediator.execute(new hl(a[u]??null,s?.[u])):this._mediator.execute(new fl(_,n)),u++,p++,!this._isCurrent(r))return}if(u>=e.length){this._mediator.execute(new Oo(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new wn(e,n,u,r,a,s)))}_isCurrent(e){return this._mediator.execute(new ii(e))}_requestAnimationFrame(e){let n=this._browser.document.defaultView;if(!n){e();return}n.requestAnimationFrame(e)}_now(){let e=this._browser.document.defaultView?.performance;return e?e.now():Date.now()}_isWithinSliceBudget(e){return this._browser.isBrowser()?this._now()-e<NO:!0}static \u0275fac=function(n){return new(n||fs)};static \u0275prov=y({token:fs,factory:fs.\u0275fac})};return t=x([w(wn)],t),t})(),ml=class{static fToken=Symbol("StartConnectionRedrawRequest")},AO=(()=>{let t=class hs{_store=l(M);_state=l(bp);handle(e){return this._state.resetConnectedConnectors(),{renderTicket:this._state.beginRender(),connectionsRevision:this._store.connectionsRevision,nodesRevision:this._store.nodesRevision}}static \u0275fac=function(n){return new(n||hs)};static \u0275prov=y({token:hs,factory:hs.\u0275fac})};return t=x([w(ml)],t),t})(),No=class{static fToken=Symbol("RedrawConnectionsRequest")},_l=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(i){this.connectionCount=i}},Ro=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},FO=(()=>{let t=class ms{_browser=l(qe);_state=l(ci);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let n=this._browser.document.defaultView;return lv(n)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(n){return new(n||ms)};static \u0275prov=y({token:ms,factory:ms.\u0275fac})};return t=x([w(Ro)],t),t})(),LO=(()=>{let t=class _s{_mediator=l(D);handle({connectionCount:e}){return e>0&&this._mediator.execute(new Ro)}static \u0275fac=function(n){return new(n||_s)};static \u0275prov=y({token:_s,factory:_s.\u0275fac})};return t=x([w(_l)],t),t})(),gl=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(i,e,n){this.connection=i,this.geometry=e,this.originalIndex=n}},BO=(()=>{let t=class gs{_store=l(M);handle({connection:e,geometry:n,originalIndex:o}){let{source:r,target:a,sourceRect:s,targetRect:c}=n;return{originalIndex:o,behavior:e.fBehavior,outputSide:e.fOutputSide(),inputSide:e.fInputSide(),sourceConnectableSide:r.fConnectableSide,targetConnectableSide:a.fConnectableSide,sourceRotation:this._store.nodes.get(r.fNodeId)?._rotate||0,targetRotation:this._store.nodes.get(a.fNodeId)?._rotate||0,sourceRect:{x:s.x,y:s.y,width:s.width,height:s.height,radius1:s.radius1,radius2:s.radius2,radius3:s.radius3,radius4:s.radius4},targetRect:{x:c.x,y:c.y,width:c.width,height:c.height,radius1:c.radius1,radius2:c.radius2,radius3:c.radius3,radius4:c.radius4}}}static \u0275fac=function(n){return new(n||gs)};static \u0275prov=y({token:gs,factory:gs.\u0275fac})};return t=x([w(gl)],t),t})(),vl=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(i,e){this.connections=i,this.cache=e}},zO=(()=>{let t=class vs{_mediator=l(D);handle({connections:e,cache:n}){let o=new Array(e.length),r=[];for(let a=0;a<e.length;a++){let s=this._buildBatchItem(e[a],n,a);o[a]=s,s&&r.push(s.payload)}return{items:o,payload:r}}_buildBatchItem(e,n,o){let r=this._mediator.execute(new ko(e,n));return r?{connection:e,geometry:r,payload:this._mediator.execute(new gl(e,r,o))}:null}static \u0275fac=function(n){return new(n||vs)};static \u0275prov=y({token:vs,factory:vs.\u0275fac})};return t=x([w(vl)],t),t})(),yl=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(i){this.error=i}},Ao=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(i){this.error=i}},qO=(()=>{let t=class ys{_state=l(ci);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(n){return new(n||ys)};static \u0275prov=y({token:ys,factory:ys.\u0275fac})};return t=x([w(Ao)],t),t})(),VO=(()=>{let t=class Cs{_state=l(ci);_mediator=l(D);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new Ao(e))}static \u0275fac=function(n){return new(n||Cs)};static \u0275prov=y({token:Cs,factory:Cs.\u0275fac})};return t=x([w(yl)],t),t})(),Cl=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(i){this.message=i}},HO=(()=>{let t=class bs{_state=l(ci);handle({message:e}){if(!e||typeof e.requestId!="number")return;let n=this._state.pending.get(e.requestId);if(n){if(this._state.pending.delete(e.requestId),e.error){n.reject(new Error(e.error));return}n.resolve(e.results??[])}}static \u0275fac=function(n){return new(n||bs)};static \u0275prov=y({token:bs,factory:bs.\u0275fac})};return t=x([w(Cl)],t),t})(),bl=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},GO=(()=>{let t=class xs{_browser=l(qe);_state=l(ci);_mediator=l(D);handle(e){if(this._state.worker)return this._state.worker;let n=this._browser.document.defaultView;if(!lv(n))return null;let o=uv(n);if(!o)return null;let r=rO(o);try{let a=new o.workerCtor(r,{name:"f-flow-connection-worker"});return a.onmessage=s=>{this._mediator.execute(new Cl(s.data))},a.onerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker runtime error."))},a.onmessageerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker message deserialization error."))},this._state.workerUrl=r,this._state.worker=a,a}catch(a){return pv(r,o.urlApi),this._disableWorker(a instanceof Error?a:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new yl(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new Ao(e))}static \u0275fac=function(n){return new(n||xs)};static \u0275prov=y({token:xs,factory:xs.\u0275fac})};return t=x([w(bl)],t),t})(),xl=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(i){this.payload=i}},jO=(()=>{let t=class ws{_state=l(ci);_mediator=l(D);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new Ro))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let n=this._mediator.execute(new bl);if(!n)return Promise.reject(new Error("Unable to initialize connection worker."));let o=++this._state.nextRequestId;return new Promise((r,a)=>{this._state.pending.set(o,{resolve:r,reject:a});try{n.postMessage({requestId:o,items:e})}catch(s){this._state.pending.delete(o),a(s instanceof Error?s:new Error("Unknown error while posting message to connection worker."))}})}_interruptPendingRequests(){if(!this._state.pending.size)return;let e=new Error("Connection worker request was superseded by a newer redraw.");this._state.pending.forEach(n=>n.reject(e)),this._state.pending.clear()}static \u0275fac=function(n){return new(n||ws)};static \u0275prov=y({token:ws,factory:ws.\u0275fac})};return t=x([w(xl)],t),t})(),wl=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(i){this.batch=i}},UO=(()=>{let t=class Ss{_mediator=l(D);handle({batch:e}){return e.payload.length?this._mediator.execute(new xl(e.payload)):Promise.resolve([])}static \u0275fac=function(n){return new(n||Ss)};static \u0275prov=y({token:Ss,factory:Ss.\u0275fac})};return t=x([w(wl)],t),t})(),Sl=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(i,e,n){this.connections=i,this.cache=e,this.session=n}},WO=(()=>{let t=class Is{_mediator=l(D);handle({connections:e,cache:n,session:o}){let r=this._mediator.execute(new vl(e,n));if(!r.payload.length){this._mediator.execute(new wn(e,n,0,o,r.items));return}this._mediator.execute(new wl(r)).then(a=>{this._mediator.execute(new ii(o))&&this._mediator.execute(new wn(e,n,0,o,r.items,this._alignWorkerResults(a,e.length)))}).catch(()=>{this._mediator.execute(new ii(o))&&this._mediator.execute(new wn(e,n,0,o,r.items))})}_alignWorkerResults(e,n){let o=new Array(n);for(let r of e){let a=r.originalIndex;a<0||a>=n||(o[a]=r)}return o}static \u0275fac=function(n){return new(n||Is)};static \u0275prov=y({token:Is,factory:Is.\u0275fac})};return t=x([w(Sl)],t),t})(),$O=(()=>{let t=class Ts{_mediator=l(D);_store=l(M);handle(e){let n=this._mediator.execute(new ml);this._createMarkersForCreate(),this._createMarkersForSnap();let o=[...this._store.connections.getAll()],r=new Map;if(!o.length){this._mediator.execute(new Oo(n));return}this._shouldUseConnectionWorker(o.length)?this._redrawUsingWorker(o,r,n):this._redrawWithoutWorker(o,r,n)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new Bi(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new Bi(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new _l(e))}_redrawUsingWorker(e,n,o){this._mediator.execute(new Sl(e,n,o))}_redrawWithoutWorker(e,n,o){this._mediator.execute(new wn(e,n,0,o))}static \u0275fac=function(n){return new(n||Ts)};static \u0275prov=y({token:Ts,factory:Ts.\u0275fac})};return t=x([w(No)],t),t})(),Mh=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},KO=(()=>{let t=class Es{_store=l(M);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(n){return new(n||Es)};static \u0275prov=y({token:Es,factory:Es.\u0275fac})};return t=x([w(Mh)],t),t})(),Il=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(i){this.connection=i}},YO=(()=>{let t=class Ps{_store=l(M);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Ps)};static \u0275prov=y({token:Ps,factory:Ps.\u0275fac})};return t=x([w(Il)],t),t})(),Tl=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(i){this.instance=i}},XO=(()=>{let t=class ks{_store=l(M);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||ks)};static \u0275prov=y({token:ks,factory:ks.\u0275fac})};return t=x([w(Tl)],t),t})(),Dh=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(i,e){this.waypointIndex=i,this.connectionId=e}},El=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},ZO=(()=>{let t=class Ms{_store=l(M);_dragSession=l(Q);handle(e){this._store.flowHost.classList.remove(je.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(n){return new(n||Ms)};static \u0275prov=y({token:Ms,factory:Ms.\u0275fac})};return t=x([w(El)],t),t})(),Pl=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},QO=(()=>{let t=class Ds{_mediator=l(D);_store=l(M);_dragContext=l(Q);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(je.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new Fo),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Rl(e.kind,e.data?de({},e.data):void 0,e.fEventType))}static \u0275fac=function(n){return new(n||Ds)};static \u0275prov=y({token:Ds,factory:Ds.\u0275fac})};return t=x([w(Pl)],t),t})(),Fo=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},oi=class{_event;_target;get originalEvent(){return this._event}get targetElement(){return this._target||this.originalEvent.target}get touchEvent(){return this._event}get touches(){return this.touchEvent.touches}constructor(i,e){this._event=i,this._target=e}setTarget(i){this._target=i}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},kl=class extends oi{constructor(i,e){super(i,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},Oh=class extends oi{constructor(i,e){super(i,e)}isMouseLeftButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===0||i.pointerType==="touch"}isMouseRightButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===2||i.pointerType==="touch"}getPosition(){let i=this.originalEvent;return{x:i.clientX,y:i.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},Nh=class extends oi{constructor(i){super(i)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.touches;return{x:i[0].clientX,y:i[0].clientY}}},Rh=class extends oi{constructor(i,e){super(i,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.targetTouches[0];return{x:i.clientX,y:i.clientY}}},ve=(()=>{class t{static _isSupported;static _isPassiveEventListenerSupported(){if(t._isSupported==null&&typeof window<"u")try{window.addEventListener("test",t.emptyListener,{passive:!0}),t._isSupported=!0}catch{t._isSupported=!1}return t._isSupported}static _passiveEventListener(e){return t._isPassiveEventListenerSupported()?e:!!e.capture}static activeListener(){return t._passiveEventListener({passive:!1})}static passiveListener(){return t._passiveEventListener({passive:!0})}static activeCaptureListener(){return t._passiveEventListener({passive:!1,capture:!0})}static emptyListener(){return()=>{}}}return t})(),JO=800,Ah=class{_document=l(Vr);_ngZone=l(Un,{optional:!0});_mouseListeners=ve.emptyListener();_touchListeners=ve.emptyListener();_startListeners=ve.emptyListener();isSyntheticEvent(i){return!!this._lastTouchEventTime&&this._lastTouchEventTime+JO>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=i=>{let e=this.isSyntheticEvent(i),n=tN(i),o=new kl(i);if(e||n||this.disabled||this.isDragStarted)return;this._pointerDownElement=o.targetElement,this.onPointerDown(o)&&(this._dragStartTime=Date.now(),this._dragStartPosition=o.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,ve.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,ve.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())})};_onTouchDown=i=>{let e=nN(i),n=new Nh(i);if(e||this.disabled||this.isDragStarted)return;this._pointerDownElement=n.targetElement,this.onPointerDown(n)&&(this._dragStartTime=Date.now(),this._dragStartPosition=n.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,ve.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,ve.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,ve.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,ve.activeCaptureListener())})};_onSelectStart=i=>{this.onSelect(i)};_onMouseMove=i=>{this._moveHandler(new kl(i))};_onTouchMove=i=>{this._moveHandler(new Rh(i))};_checkDragSequenceToStart(i){let e=i.getPosition();if(!this.isDragStarted&&this._pointerDownElement){i.setTarget(this._pointerDownElement);let n=Math.abs(e.x-this._dragStartPosition.x),o=Math.abs(e.y-this._dragStartPosition.y);if(n+o>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}i.preventDefault(),this.prepareDragSequence(i),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,eN(i.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=i=>{this.isDragStarted&&this.onPointerUp(new Oh(i)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=ve.emptyListener(),this._touchListeners(),this._touchListeners=ve.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,ve.activeListener()),this._listen("touchstart",this._onTouchDown,ve.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,ve.activeListener()),this._unlisten("touchstart",this._onTouchDown,ve.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=ve.emptyListener(),this._touchListeners(),this._touchListeners=ve.emptyListener(),this._mouseListeners(),this._mouseListeners=ve.emptyListener()}_listen(i,e,n){this._document.addEventListener(i,e,n)}_unlisten(i,e,n){this._document.removeEventListener(i,e,n)}_preventDuringDrag=i=>{this.isDragStarted&&i.preventDefault()}};function eN(t){return t.type[0]==="t"}function tN(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function nN(t){let i=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var Fh=class extends oi{_position;_isMouseLeftButton;_isMouseRightButton;constructor(i){super(i.originalEvent,i.targetElement),this._position=i.getPosition(),this._isMouseLeftButton=i.isMouseLeftButton(),this._isMouseRightButton=i.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return de({},this._position)}};function iN(t){return new Fh(t)}var Q=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new Z(0,0);draggableItems=[];autoPanFrameId=null;lastPointerEvent=null;lastPointerPosition=null;isAutoPanCanvasMoved=!1;reset(){for(let e of this.draggableItems)try{e.destroy?.()}catch{console.error(`Error while destroying drag handler of type ${e.type}`)}this.draggableItems=[],this.onPointerDownScale=1,this.onPointerDownPosition=new Z(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=iN(e),this.lastPointerPosition=this.lastPointerEvent.getPosition()}isEmpty(){return!this.draggableItems.length}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Lh=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(i,e,n){this.nodeIds=i,this.groupIds=e,this.connectionIds=n}},oN=(()=>{let t=class Os{_mediator=l(D);_store=l(M);_dragSession=l(Q);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new Sn))}_getSelection(){return this._mediator.execute(new rr)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new Lh(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(n){return new(n||Os)};static \u0275prov=y({token:Os,factory:Os.\u0275fac})};return t=x([w(Fo)],t),t})(),Bh=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(i){this.nodeOrGroup=i}},rN=(()=>{let t=class Ns{_store=l(M);_mediator=l(D);handle({nodeOrGroup:e}){let n=G.initialize(-1/0,-1/0,1/0,1/0),o=this._getNode(e.fParentId());return o&&(n=this._getParentRect(o)),n}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let n=this._getNodeRect(e),o=this._getNodePadding(e,n);return G.initialize(n.x+o[0],n.y+o[1],n.width-o[0]-o[2],n.height-o[1]-o[3])}_getNodeRect(e){return this._mediator.execute(new Fe(e.hostElement))}_getNodePadding(e,n){return this._mediator.execute(new ai(e,n))}static \u0275fac=function(n){return new(n||Ns)};static \u0275prov=y({token:Ns,factory:Ns.\u0275fac})};return t=x([w(Bh)],t),t})(),zh=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(i,e){this.fParentNodes=i,this.fDraggedNodes=e}},aN=(()=>{let t=class Rs{handle(e){return this._isParentNodeInArray(this._getParentNodeIds(e.fParentNodes),e.fDraggedNodes)}_getParentNodeIds(e){return e.map(n=>n.fId())}_isParentNodeInArray(e,n){return n.some(o=>e.includes(o.fId()))}static \u0275fac=function(n){return new(n||Rs)};static \u0275prov=y({token:Rs,factory:Rs.\u0275fac})};return t=x([w(zh)],t),t})(),qh=class{fNodeId;fConnectionIds;constructor(i,e){this.fNodeId=i,this.fConnectionIds=e}},Ml=class extends qh{nodeId;connectionIds;constructor(i,e){super(i,e),this.nodeId=i,this.connectionIds=e}},Dl=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(i){this.nodeOrGroup=i}},sN=(()=>{let t=class As{_mediator=l(D);_store=l(M);handle({nodeOrGroup:e}){let n=this._collectConnectableConnectorIds(e,"source"),o=this._collectConnectableConnectorIds(e,"target");if(!n.size||!o.size)return;let r=this._collectAttachedConnectionIds(n,o),a=this._collectConnectionsUnderNode(e),s=[];for(let c of a){let u=c.fId();r.has(u)||s.push(u)}s.length&&(this._store.fDraggable?.fNodeIntersectedWithConnections.emit(new Ml(e.fId(),s)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Ml(e.fId(),s)))}_collectConnectableConnectorIds(e,n){let o=n==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let a of o)a.canBeConnected&&e.isContains(a.hostElement)&&r.add(a.fId());return r}_collectAttachedConnectionIds(e,n){let o=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||n.has(r.fInputId()))&&o.add(r.fId());return o}_collectConnectionsUnderNode(e){let n=this._mediator.execute(new En(e.hostElement,!1)),o=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,n)&&o.push(r);return o}_hasIntersection(e,n){return Mi.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,n).length>0}static \u0275fac=function(n){return new(n||As)};static \u0275prov=y({token:As,factory:As.\u0275fac})};return t=x([w(Dl)],t),t})(),cN=[QO,ZO,oN,rN,aN,sN],dN=new Set(["create-connection","reassign-connection","drag-node"]),lN=new Set(["selection-area"]),uN=new Set(["assign-to-container"]);function hv(t){let i=null;for(let e of t){if(uN.has(e))continue;let n=dN.has(e)?"rebase":lN.has(e)?"direct":null;if(!n)return null;if(!i){i=n;continue}if(i!==n)return null}return i}function mv(t,i,e,n,o){return A.initialize(k0(t.x,i.left,i.right,e,n,o),k0(t.y,i.top,i.bottom,e,n,o))}function k0(t,i,e,n,o,r){let a=Math.max(0,n),s=Math.max(0,o);if(!a||!s)return 0;if(t<=i+a){let c=D0((i+a-t)/a,0,1);return M0(c,s,r)}if(t>=e-a){let c=D0((t-(e-a))/a,0,1);return-M0(c,s,r)}return 0}function pN(t,i,e){let n=e||1;return Z.fromPoint(t).add(Z.fromPoint(i).div(n))}function M0(t,i,e){return e?i*t:i}function D0(t,i,e){return Math.max(i,Math.min(e,t))}var Ol=class{static fToken=Symbol("RunAutoPanFrameRequest")},Pn=class{static fToken=Symbol("StopAutoPanRequest")},fN=(()=>{let t=class Fs{_store=l(M);_dragContext=l(Q);handle(e){this._dragContext.autoPanFrameId!==null&&(cancelAnimationFrame(this._dragContext.autoPanFrameId),this._dragContext.autoPanFrameId=null),this._dragContext.isAutoPanCanvasMoved&&(this._store.fCanvas?.emitCanvasChangeEvent(),this._dragContext.isAutoPanCanvasMoved=!1)}static \u0275fac=function(n){return new(n||Fs)};static \u0275prov=y({token:Fs,factory:Fs.\u0275fac})};return t=x([w(Pn)],t),t})(),Lo=class{static fToken=Symbol("SyncAutoPanRequest")},hN=(()=>{let t=class Ls{_mediator=l(D);_store=l(M);_dragContext=l(Q);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new Pn);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new Ol)}))}_canAutoPan(){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!this._getAutoPanMode()&&this._edgeThreshold()>0&&this._speed()>0}_hasAutoPanDelta(){let e=this._getAutoPanDelta();return!!e.x||!!e.y}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?A.initialize():mv(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return hv(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Se.AUTO_PAN)}static \u0275fac=function(n){return new(n||Ls)};static \u0275prov=y({token:Ls,factory:Ls.\u0275fac})};return t=x([w(Lo)],t),t})(),mN=(()=>{let t=class Bs{_mediator=l(D);_store=l(M);_dragContext=l(Q);handle(e){let n=this._getAutoPanMode();if(!this._canAutoPan(n)){this._mediator.execute(new Pn);return}let o=this._getAutoPanDelta();if(!o.x&&!o.y){this._mediator.execute(new Pn);return}this._applyCanvasDelta(o,n),this._replayLastPointerMove(),this._mediator.execute(new Lo)}_applyCanvasDelta(e,n){let o=this._store.transform;n==="rebase"&&(this._dragContext.onPointerDownPosition=pN(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||o.scale||1)),o.position=Z.fromPoint(o.position).add(e),this._store.fCanvas?.redraw(),this._dragContext.isAutoPanCanvasMoved=!0}_replayLastPointerMove(){let e=this._dragContext.lastPointerEvent;if(!e)return;let n=this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition);this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(de({},n),e)})}_getPointerPositionInCanvas(e){return Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost)}_canAutoPan(e){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!e&&this._edgeThreshold()>0&&this._speed()>0}_getAutoPanMode(){return hv(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?A.initialize():mv(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Se.AUTO_PAN)}static \u0275fac=function(n){return new(n||Bs)};static \u0275prov=y({token:Bs,factory:Bs.\u0275fac})};return t=x([w(Ol)],t),t})(),_N=[hN,mN,fN],Nl=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(i){this.event=i}},Rl=class{kind;data;fEventType;get fData(){return this.data}constructor(i,e,n){this.kind=i,this.data=e,this.fEventType=n??i}},ot=class{data(){}_features=[];getEvent(){return new Rl(this.kind,this.data(),this.type)}attachFeature(i){this._features.push(i)}featuresPrepare(i){for(let e of this._features)e.onPrepare?.(i)}featuresMove(i,e){for(let n of this._features)n.onMove?.(i,e)}featuresFinalize(i,e){for(let n of this._features)n.onFinalize?.(i,e)}featuresEnd(i){for(let e of this._features)e.onEnd?.(i)}},Al=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=F.AUTO;userFConnectableSide=F.AUTO;isContains(i){return this.hostElement.contains(i)}setConnected(i){this._isConnected=!0,this.toConnector.push(i)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},gN=new ue("F_NODE_INPUT"),vN=(()=>{class t extends Al{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,standalone:!1,features:[he]})}return t})(),Bt=(function(t){return t.LEFT="left",t.LEFT_TOP="left-top",t.TOP="top",t.RIGHT_TOP="right-top",t.RIGHT="right",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.LEFT_BOTTOM="left-bottom",t})(Bt||{});function yN(t){return xo(t,".f-rotate-handle")}var _v=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),xp=new ue("F_NODE"),CN=sv(class{hostElement;constructor(t){this.hostElement=t}}),Fl=class extends CN{_injector=l(Xe);renderer=l(gg);browser=l(qe);stateChanges=new Ct;_position=A.initialize();_rotate=0;_size;connectors=[];positionChanges(){ie(()=>{let i=this.position();At(()=>{A.isEqual(this._position,i)||(this._position=i,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){ie(()=>{let i=this.size();At(()=>{this._isSizeEqual(i)||(this._size=i,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){ie(()=>{let i=this.rotate();At(()=>{this._rotate!==i&&(this._rotate=i,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){ie(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),At(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(i){return this._size?.width===i?.width&&this._size?.height===i?.height}isContains(i){return this.hostElement.contains(i)}redraw(){this._size&&(this.setStyle("width",""+this._size.width+"px"),this.setStyle("height",""+this._size.height+"px")),this.setStyle("transform",`translate(${this._position.x}px,${this._position.y}px) rotate(${this._rotate}deg)`)}resetSize(){this.removeStyle("width"),this.removeStyle("height")}updatePosition(i){this._position=i}updateRotate(i){this._rotate=i}updateSize(i){this._size=i}setClass(i){this.hostElement.classList.add(i)}removeClass(i){this.hostElement.classList.remove(i)}addConnector(i){this.connectors.push(i),this.refresh()}removeConnector(i){let e=this.connectors.indexOf(i);e!==-1&&this.connectors.splice(e,1),this.refresh()}},bN=0,xN=3,Vh=(()=>{class t extends Fl{_debounceTimer=null;_destroyRef=l(at);_mediator=l(D);fId=O(`f-group-${bN++}`,{alias:"fGroupId"});fParentId=O(null,{alias:"fGroupParentId"});position=Kn(A.initialize(),{alias:"fGroupPosition"});size=O(void 0,{alias:"fGroupSize"});sizeChange=Be({alias:"fGroupSizeChange"});rotate=Kn(0,{alias:"fGroupRotate"});fConnectOnNode=O(!0,{transform:me});fMinimapClass=O([]);fDraggingDisabled=O(!1,{alias:"fGroupDraggingDisabled",transform:me});fSelectionDisabled=O(!1,{alias:"fGroupSelectionDisabled",transform:me});fIncludePadding=O(!0,{transform:me});fAutoExpandOnChildHit=O(!1,{transform:me});fAutoSizeToFitChildren=O(!1,{transform:me});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qo(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new Sn),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),xN))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Gi(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new er(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new tr(this))}static \u0275fac=function(n){return new(n||t)(Lf(Re))};static \u0275dir=Te({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(q("data-f-group-id",o.fId()),se("f-group-dragging-disabled",o.fDraggingDisabled())("f-group-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fGroupId","fId"],fParentId:[1,"fGroupParentId","fParentId"],position:[1,"fGroupPosition","position"],size:[1,"fGroupSize","size"],rotate:[1,"fGroupRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fGroupDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fGroupSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fGroupPositionChange",sizeChange:"fGroupSizeChange",rotate:"fGroupRotateChange"},exportAs:["fComponent"],standalone:!1,features:[ge([{provide:xp,useExisting:t}]),he]})}return t})(),O0=0,wN=3,wp=(()=>{class t extends Fl{_debounceTimer=null;_destroyRef=l(at);_mediator=l(D);fId=O(`f-node-${O0++}`,{alias:"fNodeId",transform:e=>Vi(e)||`f-node-${O0++}`});fParentId=O(null,{alias:"fNodeParentId"});position=Kn(A.initialize(),{alias:"fNodePosition"});size=O(void 0,{alias:"fNodeSize"});sizeChange=Be({alias:"fNodeSizeChange"});rotate=Kn(0,{alias:"fNodeRotate"});fConnectOnNode=O(!0,{transform:me});fMinimapClass=O([]);fDraggingDisabled=O(!1,{alias:"fNodeDraggingDisabled",transform:me});fSelectionDisabled=O(!1,{alias:"fNodeSelectionDisabled",transform:me});fIncludePadding=O(!0,{transform:me});fAutoExpandOnChildHit=O(!1,{transform:me});fAutoSizeToFitChildren=O(!1,{transform:me});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qo(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new Sn),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),wN))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Gi(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new er(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new tr(this))}static \u0275fac=function(n){return new(n||t)(Lf(Re))};static \u0275dir=Te({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(q("data-f-node-id",o.fId()),se("f-node-dragging-disabled",o.fDraggingDisabled())("f-node-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fNodeId","fId"],fParentId:[1,"fNodeParentId","fParentId"],position:[1,"fNodePosition","position"],size:[1,"fNodeSize","size"],rotate:[1,"fNodeRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fNodeDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fNodeSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fNodePositionChange",sizeChange:"fNodeSizeChange",rotate:"fNodeRotateChange"},exportAs:["fComponent"],standalone:!1,features:[ge([{provide:xp,useExisting:t}]),he]})}return t})();function SN(t){return!!t.closest("[fNode]")}var N0=0,gv=(()=>{class t extends vN{hostElement=l(Re).nativeElement;_mediator=l(D);_node=l(xp);fId=O(`f-node-input-${N0++}`,{alias:"fInputId",transform:e=>Vi(e)||`f-node-input-${N0++}`});category=O(void 0,{alias:"fInputCategory",transform:Vi});multiple=O(!0,{alias:"fInputMultiple",transform:me});disabled=O(!1,{alias:"fInputDisabled",transform:me});userFConnectableSide=F.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yo(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(je.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new nr(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(n,o){n&2&&(q("data-f-input-id",o.fId()),se("f-node-input-multiple",o.multiple)("f-node-input-disabled",o.disabled()))},inputs:{fId:[1,"fInputId","fId"],category:[1,"fInputCategory","category"],multiple:[1,"fInputMultiple","multiple"],disabled:[1,"fInputDisabled","disabled"],userFConnectableSide:[2,"fInputConnectableSide","userFConnectableSide",e=>Di(e,"fInputConnectableSide",F)]},exportAs:["fNodeInput"],standalone:!1,features:[ge([{provide:gN,useExisting:t}]),he,xi]})}return t})(),IN=(()=>{class t extends Al{get hasConnectionLimits(){return!!this.canBeConnectedInputs&&this.canBeConnectedInputs.length>0}canConnectTo(e){return[e.fId(),e.category()].some(o=>o&&this.canBeConnectedInputs?.includes(o))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,standalone:!1,features:[he]})}return t})();function vv(t){return!!t.closest("[fNodeOutlet]")}var TN=new ue("F_NODE_OUTPUT"),EN=(()=>{class t extends IN{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,standalone:!1,features:[he]})}return t})();function yv(t){return!!t.closest("[fNodeOutput]")}var R0=0,Cv=(()=>{class t extends EN{hostElement=l(Re).nativeElement;_mediator=l(D);_node=l(xp);fId=O(`f-node-output-${R0++}`,{alias:"fOutputId",transform:e=>Vi(e)||`f-node-output-${R0++}`});multiple=O(!1,{alias:"fOutputMultiple",transform:me});disabled=O(!1,{alias:"fOutputDisabled",transform:me});userFConnectableSide=F.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yo(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(je.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new nr(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(n,o){n&2&&(q("data-f-output-id",o.fId()),se("f-node-output-multiple",o.multiple)("f-node-output-disabled",o.disabled())("f-node-output-self-connectable",o.isSelfConnectable))},inputs:{fId:[1,"fOutputId","fId"],multiple:[1,"fOutputMultiple","multiple"],disabled:[1,"fOutputDisabled","disabled"],userFConnectableSide:[2,"fOutputConnectableSide","userFConnectableSide",e=>Di(e,"fOutputConnectableSide",F)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[ge([{provide:TN,useExisting:t}]),he,xi]})}return t})();var Ll=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(i){this.event=i}},Bo=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(i){this.outlet=i}},PN=(()=>{let t=class zs{_store=l(M);handle({outlet:e}){let n=this._findOwnerNode(e);if(!n)throw new Error("The fOutlet must belong to an fNode");let o=this._findFirstConnectableOutputInNode(n);if(!o)throw new Error("Outlet requires at least one connectable output in the same node.");return o}_findOwnerNode(e){let n=e.hostElement;return this._store.nodes.getAll().find(o=>o.isContains(n))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(n=>e.isContains(n.hostElement)&&n.canBeConnected)}static \u0275fac=function(n){return new(n||zs)};static \u0275prov=y({token:zs,factory:zs.\u0275fac})};return t=x([w(Bo)],t),t})(),Hh=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(i,e,n){this.sourceId=i,this.targetId=e,this.dropPosition=n,this.fOutputId=i,this.fInputId=e,this.fDropPosition=n}},Bl=(()=>{class t extends ot{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=l(Mn);_mediator=l(D);_connectionBehaviour=l(Xi);_store=l(M);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new ze;initialize(e,n){this._sourceRef=this._mediator.execute(new pt(e)),this._pointerDown=ze.fromRect(G.initialize(n.x,n.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(A.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Zo(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new Wi(this._targets.map(e=>e.connector)))}_initSnapConnection(){this._snapConnection&&(this._snapConnection.fOutputId.set(this._sourceRef.connector.fId()),this._snapConnection.initialize())}_initCreateConnection(){this._connection.fOutputId.set(this._sourceRef.connector.fId()),this._connection.initialize()}onPointerMove(e){let n=this._pointerDown.addPoint(e),o=this._findClosestTarget(n),r=o?.connector.fConnectableSide||F.TOP;this._drawCreateConnection(n,r);let a=this._snapConnection;if(!a)return;let s=o&&o.distance<a.fSnapThreshold?o:void 0;this._drawSnapConnection(s)}_findClosestTarget(e){return this._mediator.execute(new ri(e,this._targets))}_drawCreateConnection(e,n){let o=this._connectionBehaviour.handle(new kt(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,n,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(o),this._connection.redraw()}_drawSnapConnection(e){let n=this._snapConnection;if(!n)return;if(!e){n.hide();return}let o=this._connectionBehaviour.handle(new kt(this._sourceRef.rect,e.rect,n,this._sourceRef.connector.fConnectableSide,e.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(e.connector)));n.show(),n.setLine(o),n.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new $i(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new Zt(e))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),kN=(()=>{let t=class qs{_result=l(Mn);_mediator=l(D);_store=l(M);_dragContext=l(Q);get _dragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isValid()&&(this._emitEvent(e.event),this._dragHandler.onPointerUp())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Bl)}_getTargetOutput(e){if(!e)throw new Error(`Output with fOutputId ${this._result.getData().fOutputId} not found. Make sure there is no f-connection to a non-existent fOutput.`);return vv(e.hostElement)?this._mediator.execute(new Bo(e)):e}_getOutput(){return this._store.outputs.get(this._result.getData().fOutputId)}_getOutlet(){return this._store.outlets.get(this._result.getData().fOutputId)}_emitEvent(e){this._store.fDraggable?.fCreateConnection.emit(new Hh(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Xo(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(n){return new(n||qs)};static \u0275prov=y({token:qs,factory:qs.\u0275fac})};return t=x([w(Ll)],t),t})(),zo=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(i,e){this.eventPosition=i,this.source=e}},MN=(()=>{let t=class Vs{_store=l(M);_dragContext=l(Q);_dragInjector=l(Ye);get _transform(){return this._store.transform}handle({source:e,eventPosition:n}){this._dragContext.onPointerDownScale=this._transform.scale;let o=this._toFlowSpace(n);this._dragContext.onPointerDownPosition=o;let r=this._toCanvasSpace(o),a=this._dragInjector.get(Bl);a.initialize(e,r),this._dragContext.draggableItems=[a]}_toFlowSpace(e){return Z.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return Z.fromPoint(e).mult(this._transform.scale).sub(this._transform.position).sub(this._transform.scaledPosition).div(this._transform.scale)}static \u0275fac=function(n){return new(n||Vs)};static \u0275prov=y({token:Vs,factory:Vs.\u0275fac})};return t=x([w(zo)],t),t})(),zl=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(i,e){this.event=i,this.node=e}},DN=(()=>{let t=class Hs{_mediator=l(D);_store=l(M);handle({event:e,node:n}){let o=this._findOutlet(n);if(!o||(o.setOutputs(this._getOutputs(n)),!o.canBeConnected))return;let r=o.isConnectionFromOutlet?o:this._resolveOutput(o);!r||!r.canBeConnected||this._startDrag(e.getPosition(),r)}_findOutlet(e){return this._store.outlets.getAll().find(n=>e.isContains(n.hostElement))}_getOutputs(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement))}_resolveOutput(e){return this._mediator.execute(new Bo(e))}_startDrag(e,n){this._mediator.execute(new zo(e,n))}static \u0275fac=function(n){return new(n||Hs)};static \u0275prov=y({token:Hs,factory:Hs.\u0275fac})};return t=x([w(zl)],t),t})(),ql=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(i,e){this.event=i,this.node=e}},ON=(()=>{let t=class Gs{_mediator=l(D);_store=l(M);handle({event:e,node:n}){if(!yv(e.targetElement)||this._hasOutlet(n))return;let o=this._findOutput(e.targetElement);!o||!o.canBeConnected||this._startDrag(e.getPosition(),o)}_hasOutlet(e){return this._store.outlets.getAll().some(n=>e.isContains(n.hostElement))}_findOutput(e){return this._store.outputs.getAll().find(n=>n.hostElement.contains(e))}_startDrag(e,n){this._mediator.execute(new zo(e,n))}static \u0275fac=function(n){return new(n||Gs)};static \u0275prov=y({token:Gs,factory:Gs.\u0275fac})};return t=x([w(ql)],t),t})(),Vl=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},NN=(()=>{let t=class js{_mediator=l(D);_store=l(M);_dragContext=l(Q);handle({event:e,fTrigger:n}){if(!this._isValidConditions()||!this._isValidTrigger(e,n))return;let o=vv(e.targetElement),r=!o&&yv(e.targetElement);if(!o&&!r)return;let a=this._findOwnerNode(e.targetElement);a&&(o?this._mediator.execute(new zl(e,a)):this._mediator.execute(new ql(e,a)))}_findOwnerNode(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_isValidConditions(){return this._dragContext.isEmpty()&&!!this._store.connections.getForCreate()}_isValidTrigger(e,n){return bt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||js)};static \u0275prov=y({token:js,factory:js.\u0275fac})};return t=x([w(Vl)],t),t})(),Hl=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(i){this.event=i}},Gh=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(i,e,n,o,r,a,s){this.connectionId=i,this.endpoint=e,this.previousSourceId=n,this.nextSourceId=o,this.previousTargetId=r,this.nextTargetId=a,this.dropPosition=s,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=n,this.newSourceId=o,this.oldTargetId=r,this.newTargetId=a,this.dropPoint=s}},RN=(()=>{let t=class Us{_dragResult=l(Mn);_mediator=l(D);_store=l(M);_dragContext=l(Q);get _dragDirective(){return this._store.fDraggable}handle({event:e}){let n=this._findReassignHandler();n&&(this._emitIfChanged(e),n.onPointerUp())}_findReassignHandler(){return this._dragContext.draggableItems.find(n=>n.getEvent().fEventType==="reassign-connection")}_emitIfChanged(e){let n=this._dragResult.getData(),o=this._findConnectableConnector(e,n.candidates);o&&!this._isReassignedToDifferentConnector(n,o)||this._dragDirective.fReassignConnection.emit(this._buildEvent(n,e,o))}_findConnectableConnector(e,n){return this._mediator.execute(new Xo(e.getPosition(),n))}_isReassignedToDifferentConnector(e,n){let o=e.connection;return e.draggedEnd==="target"?o.fInputId()!==n.fId():o.fOutputId()!==n.fId()}_buildEvent(e,n,o){let r=e.connection;return new Gh(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?o?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?o?.fId():void 0,n.getPosition())}static \u0275fac=function(n){return new(n||Us)};static \u0275prov=y({token:Us,factory:Us.\u0275fac})};return t=x([w(Hl)],t),t})(),Gl=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function AN(t,i){return bv(t,i)||FN(t,i)}function bv(t,i){return t.fDragHandleEnd()?.point&&xv(i,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function FN(t,i){return!!t.fDragHandleStart()?.point&&xv(i,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function xv(t,i){return(t.x-i.x)**2+(t.y-i.y)**2<=8**2}function wv(t,i){return t&&t.distance<i.fSnapThreshold?t:void 0}function jl(t){return ze.fromRect(G.initialize(t.x,t.y))}var jh=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=jl(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new $u(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(i=>i.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new Wi(this._candidates.map(i=>i.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fInputId.set(this._connection.fInputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(wv(n,r))}_findClosest(i){return this._mediator.execute(new ri(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new kt(i,this._targetRef.rect,this._connection,e,this._targetRef.connector.fConnectableSide,void 0,this._resolveRotationContext(this._targetRef.connector)));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new kt(i.rect,this._targetRef.rect,e,i.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(i.connector),this._resolveRotationContext(this._targetRef.connector)));e.show(),e.setLine(n),e.redraw()}onPointerUp(){this._draw(this._anchorRect,this._sourceRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new $i(this._candidates.map(i=>i.connector)))}_resolveRotationContext(i){return this._mediator.execute(new Zt(i))}},Uh=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=jl(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Zo(this._source,this._sourceRef.rect.gravityCenter));let i=this._connection.fInputId();i&&!this._candidates.some(e=>e.connector.fId()===i)&&this._candidates.push(this._targetRef),this._mediator.execute(new Wi(this._candidates.map(e=>e.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fOutputId.set(this._connection.fOutputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(wv(n,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new $i(this._candidates.map(i=>i.connector)))}_findClosest(i){return this._mediator.execute(new ri(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new kt(this._sourceRef.rect,i,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new kt(this._sourceRef.rect,i.rect,e,this._source.fConnectableSide,i.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(i.connector)));e.show(),e.setLine(n),e.redraw()}_resolveRotationContext(i){return this._mediator.execute(new Zt(i))}},Wh=(()=>{class t extends ot{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=l(Mn);_mediator=l(D);_connectionBehaviour=l(Xi);_store=l(M);get _snapConnection(){return this._store.connections.getForSnap()}_connection;_draggedEnd;_sourceRef;_targetRef;_reassignHandler;initialize(e,n){this._connection=e,this._draggedEnd=n?"target":"source",this._sourceRef=this._mediator.execute(new pt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new pt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new jh(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Uh(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}prepareDragSequence(){this._reassignHandler.collectAndMarkCandidates(),this._reassignHandler.setSnapConnection(this._snapConnection),this._result.setData({draggedEnd:this._draggedEnd,sourceAnchorRect:jl(this._connection.line.point1),targetAnchorRect:jl(this._connection.line.point2),candidates:this._reassignHandler.candidates(),connection:this._connection})}onPointerMove(e){this._reassignHandler.onPointerMove(e)}onPointerUp(){this._reassignHandler.onPointerUp()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),LN=(()=>{let t=class Ws{_mediator=l(D);_store=l(M);_dragContext=l(Q);_dragInjector=l(Ye);get _canvas(){return this._store.fCanvas}get _transform(){return this._store.transform}get _connections(){return this._store.connections.getAll()}handle(e){if(!this._dragContext.isEmpty()||!this._isValidTrigger(e))return;let n=Zi(e.event.getPosition(),this._store.flowHost,this._transform),o=this._findConnectionAt(n);o&&(this._capturePointerDown(e),this._startDrag(o,n),queueMicrotask(()=>this._bringToFront(o)))}_findConnectionAt(e){return this._connections.find(n=>AN(n,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,n){let o=this._dragInjector.get(Wh);o.initialize(e,bv(e,n)),this._dragContext.draggableItems=[o]}_isValidTrigger(e){return bt(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new si(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Ws)};static \u0275prov=y({token:Ws,factory:Ws.\u0275fac})};return t=x([w(Gl)],t),t})(),Ul=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(i){this.event=i}},Wl=class{connectionId;waypoints;constructor(i,e){this.connectionId=i,this.waypoints=e}},$l=(()=>{class t extends ot{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=l(M);_point;_pick;get _waypointsComponent(){return this._pick?.connection.fWaypoints()}get _connection(){return this._pick?.connection}setPick(e){this._pick=e}prepareDragSequence(){this._pick?.candidate?(this._point=de({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=de({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(A.sum(this._point,e)),this._redrawConnection()}onPointerUp(){this._waypointsComponent.update(),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._eventFromPick())}_redrawConnection(){this._connection.setLine(this._connection.line),this._connection.redraw()}_eventFromPick(){return new Wl(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),BN=(()=>{let t=class $s{_dragContext=l(Q);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof $l)}static \u0275fac=function(n){return new(n||$s)};static \u0275prov=y({token:$s,factory:$s.\u0275fac})};return t=x([w(Ul)],t),t})(),Kl=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},zN=(()=>{let t=class Ks{_mediator=l(D);_store=l(M);_dragContext=l(Q);_dragInjector=l(Ye);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _flowHost(){return this._store.flowHost}get _connections(){return this._store.connections.getAll()}handle(e){let n=Zi(e.event.getPosition(),this._flowHost,this._transform),o=this._pickControlPoint(n);if(!o||!this._isValidTrigger(e))return;let r=this._dragInjector.get($l);r.setPick(o),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._flowHost).div(this._transform.scale),this._dragContext.draggableItems=[r],queueMicrotask(()=>this._updateConnectionLayer(o.connection))}_pickControlPoint(e){if(this._dragContext.isEmpty())return pD(this._connections,e)}_isValidTrigger(e){return bt(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new si(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Ks)};static \u0275prov=y({token:Ks,factory:Ks.\u0275fac})};return t=x([w(Kl)],t),t})(),qN=[kN,MN,DN,PN,ON,NN,RN,LN,zN,BN],Yl=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(i){this.event=i}},VN=1,qo=(()=>{class t extends ot{type="move-node-to-parent";kind="assign-to-container";_store=l(M);_dragSession=l(Q);get _transform(){return this._store.transform}_candidateGroups=[];_debounceTimer=null;_activeTarget=null;get activeTarget(){return this._activeTarget}initialize(e){this._candidateGroups=e}prepareDragSequence(){for(let{node:e}of this._candidateGroups)e.hostElement.classList.add(je.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),VN)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(je.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let n=this._getPointerInFlow(e),o=this._findTargetUnderPointer(n);o?this._setActiveTarget(o):this._clearActiveTarget()}_getPointerInFlow(e){let n=Z.fromPoint(this._dragSession.onPointerDownPosition).add(e),o=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return n.sub(o)}_findTargetUnderPointer(e){return this._candidateGroups.find(n=>G.isIncludePoint(n.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(je.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(je.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Xl=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(i){this.nodesAndGroups=i}},$h=class{rootHandlers;participants;constructor(i,e){this.rootHandlers=i,this.participants=e}},Kh=class{fNodeIds;constructor(i){this.fNodeIds=i}},Cm="move-node",bm="drag-node";function HN(t){return t.getEvent().kind===bm||t.getEvent().fEventType===Cm}var kn=(()=>{class t extends ot{type=Cm;kind=bm;data(){return new Kh(this.items.map(e=>e.nodeOrGroup.fId()))}_magneticLines=null;_magneticRects=null;items;roots;initialize(e,n){this.items=e,this.roots=n}setMagneticLines(e){this._magneticLines=e}setMagneticRects(e){this._magneticRects=e}calculateMagneticLinesGuides(e){return this.calculateMagneticSnaps(e).lines}calculateMagneticSnaps(e){this._previewRoots(e);let n=this._rootsUnionRect();return{lines:this._magneticLines?._computeGuides(n),rects:this._magneticRects?._computeRects(n)}}prepareDragSequence(){for(let e of this.roots)e.prepareDragSequence()}onPointerMove(e){this._previewRoots(e);let n=this._rootsUnionRect();this._magneticLines?.scheduleRender(n),this._magneticRects?.scheduleRender(n)}onPointerUp(){for(let e of this.roots)e.onPointerUp();this._magneticLines?.clearGuides(),this._magneticRects?.clearGuides(),requestAnimationFrame(()=>this._refreshDraggedNodes())}_previewRoots(e){for(let n of this.roots)n.onPointerMove(e)}_rootsUnionRect(){let e=null;for(let n of this.roots){let o=n.getLastRect();e=e?G.union([e,o]):o}return e??G.initialize()}_refreshDraggedNodes(){for(let{nodeOrGroup:e}of this.roots)e.refresh()}destroy(){for(let e of this.roots??[])e.destroy?.()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Zl=class{_limits;_quantizeStep;constructor(i,e=.5){this._limits=i,this._quantizeStep=e}applyInto(i,e){let{min:n,max:o}=this._limits,r=this._clamp(i.x,n.x,o.x),a=this._clamp(i.y,n.y,o.y),s=i.x-r,c=i.y-a,u=this._quantizeSigned(s,this._quantizeStep),p=this._quantizeSigned(c,this._quantizeStep);e.value.x=r,e.value.y=a,e.edges.left=u<0,e.edges.right=u>0,e.edges.top=p<0,e.edges.bottom=p>0,e.overflow.x=Math.abs(u),e.overflow.y=Math.abs(p)}_quantizeSigned(i,e){if(e<=0||i===0)return 0;let n=i/e;return(i>0?Math.ceil(n):Math.floor(n))*e}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}},Yh=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(i,e){this._pointerDown=e,this._vCellSize=i.vCellSize(),this._hCellSize=i.hCellSize(),this._snapWhileDragging=i.fCellSizeWhileDragging()}snap(i,e){let n=e||this._snapWhileDragging;return this._strategies[+n](i)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(i){return{x:this._snapToGrid(this._pointerDown.x+i.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+i.y,this._vCellSize)-this._pointerDown.y}}_noSnap(i){return i}_snapToGrid(i,e){return Math.round(i/e)*e}};function A0(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var Xh=class{_snapper;_hardClamp;_hardResult=A0();_softClamps=[];_softResults=[];constructor(i,e,n){let o=i.get(M).fDraggable;this._snapper=new Yh(o,e),this._hardClamp=new Zl(n.hard,.5);for(let r of n.soft)this._softClamps.push(new Zl(r.limits,.5)),this._softResults.push(A0())}apply(i,e=!1){let n=this._snapper.snap(i,e);this._hardClamp.applyInto(n,this._hardResult);let o={x:this._hardResult.value.x,y:this._hardResult.value.y};for(let r=0;r<this._softClamps.length;r++)this._softClamps[r].applyInto(o,this._softResults[r]);return{hardDelta:o,soft:this._softResults}}finalize(i){return this.apply(i,!0)}};function F0(t,i,e){let{x:n,y:o,width:r,height:a}=t;return e.right&&i.x>0&&(r+=i.x),e.left&&i.x>0&&(n-=i.x,r+=i.x),e.bottom&&i.y>0&&(a+=i.y),e.top&&i.y>0&&(o-=i.y,a+=i.y),G.initialize(n,o,r,a)}var Zh=class extends ot{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=Cm;kind=bm;_startPosition=A.initialize();_startRect=G.initialize();_applyConstraints=i=>i;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=A.initialize();_softParentConnectionHandlers=[];_mediator;constructor(i,e,n=[],o=[],r=[]){super(),this._injector=i,this.nodeOrGroup=e,this.children=n,this.sourceConnectionHandlers=o,this.targetConnectionHandlers=r,this._mediator=i.get(D),this._startRect=this._mediator.execute(new Fe(e.hostElement)),this._startPosition=de({},e._position)}setConstraints(i){this._constraints=i,this._deltaConstraints=new Xh(this._injector,this._startPosition,i),this._applyConstraints=e=>{let n=this._deltaConstraints.apply(e);return this._applySoftExpansions(n.soft),n.hardDelta}}setSoftParentConnectionHandlers(i){this._softParentConnectionHandlers=i}finalizeConstraints(){this._applyConstraints=i=>{let e=this._deltaConstraints.finalize(i);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return G.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let i of this.children)i.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(je.DRAG_AND_DROP.DRAGGING)}onPointerMove(i){let e=this._applyConstraints(i);for(let n of this.children)n.onPointerMove(e);this._redraw(this._startPlus(e));for(let n of this.sourceConnectionHandlers)n.setSourceDelta(e);for(let n of this.targetConnectionHandlers)n.setTargetDelta(e)}onPointerUp(){for(let i of this.children)i.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(je.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(i){return A.sum(this._startPosition,i)}_redraw(i){this._lastPosition=i,this.nodeOrGroup.updatePosition(i),this._mediator.execute(new ni(this.nodeOrGroup.fId(),G.initialize(i.x,i.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(i){this._lastSoftResults=i;for(let e=0;e<i.length;e++){let n=i[e],o=this._constraints.soft[e],r=F0(o.boundingRect,n.overflow,n.edges);this._commitParentRect(o.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(i,e){let n=i._position.x!==e.x||i._position.y!==e.y||i._size?.width!==e.width||i._size?.height!==e.height;return i.updateSize({width:e.width,height:e.height}),i.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new ni(i.fId(),e)),i.redraw(),n}_updateParentConnectionHandlers(i){let e=this._softParentConnectionHandlers[i];if(!e)return;let n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceDelta(this._buildDelta(o.baselineRect,r))}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetDelta(this._buildDelta(o.baselineRect,r))}}_readConnectorRect(i,e){let n=`${i.kind}::${i.fId()}`,o=e.get(n);if(o)return o;let r=this._mediator.execute(new pt(i)).rect;return e.set(n,r),r}_buildDelta(i,e){return A.initialize(e.x-i.x,e.y-i.y)}_emitExpandedEvent(){for(let i=0;i<this._lastSoftResults.length;i++){let e=this._lastSoftResults[i];if(!e.overflow.x&&!e.overflow.y)continue;let n=this._constraints.soft[i],o=F0(n.boundingRect,e.overflow,e.edges);n.nodeOrGroup.sizeChange.emit(o)}}destroy(){for(let i of this.children)i.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=i=>i,this._softParentConnectionHandlers=[]}},GN=(()=>{let t=class Ys{_injector=l(Xe);handle({nodesAndGroups:e}){let n=this._createHandlerByNodeId(e),o=this._linkParentsAndCollectRoots(e,n);return new $h(o,Array.from(n.values()))}_createHandlerByNodeId(e){let n=new Map;for(let o of e)n.set(o.fId(),new Zh(this._injector,o));return n}_linkParentsAndCollectRoots(e,n){let o=[];for(let r of e){let a=n.get(r.fId());if(!a)continue;let s=r.fParentId(),c=s?n.get(s):void 0;c?c.children.push(a):o.push(a)}return o}static \u0275fac=function(n){return new(n||Ys)};static \u0275prov=y({token:Ys,factory:Ys.\u0275fac})};return t=x([w(Xl)],t),t})(),Ql=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(i){this.nodeOrGroup=i}},Vo=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(i,e){this.nodeOrGroup=i,this.childrenPaddings=e}},Qh=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(i,e,n,o){this.nodeOrGroup=i,this.boundingRect=e,this.innerRect=n,this.paddings=o}},jN=(()=>{let t=class Xs{_mediator=l(D);handle({nodeOrGroup:e,childrenPaddings:n}){let o=this._readBoundingRect(e),r=this._readOwnPaddings(e,o),a=[r[0]+n[0],r[1]+n[1],r[2]+n[2],r[3]+n[3]],s=G.initialize(o.x+a[0],o.y+a[1],o.width-a[0]-a[2],o.height-a[1]-a[3]);return new Qh(e,o,s,a)}_readBoundingRect(e){return this._mediator.execute(new Fe(e.hostElement))}_readOwnPaddings(e,n){return this._mediator.execute(new ai(e,n))}static \u0275fac=function(n){return new(n||Xs)};static \u0275prov=y({token:Xs,factory:Xs.\u0275fac})};return t=x([w(Vo)],t),t})(),UN=(()=>{let t=class Zs{_mediator=l(D);handle({nodeOrGroup:e}){let n=this._readCurrentRect(e),o=this._readParentsChain(e);return this._buildConstraints(o,n)}_readCurrentRect(e){return this._mediator.execute(new Fe(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Ui(e))??[]}_buildConstraints(e,n){let o=[],r=fv(),a=[0,0,0,0];for(let s of e){let c=this._readParentBounds(s,a);a=c.paddings;let u=this._calculateDifference(c.innerRect,n);if(this._isAutoExpand(s))o.push(this._makeSoftLimit(s,c.boundingRect,u));else{r=u;break}}return{soft:o,hard:r}}_readParentBounds(e,n){return this._mediator.execute(new Vo(e,n))}_calculateDifference(e,n){return{min:this._calculateMinimumDifference(e,n),max:this._calculateMaximumDifference(e,n)}}_calculateMinimumDifference(e,n){return A.initialize(e.x-n.x,e.y-n.y)}_calculateMaximumDifference(e,n){return A.initialize(e.x+e.width-(n.x+n.width),e.y+e.height-(n.y+n.height))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeSoftLimit(e,n,o){return{nodeOrGroup:e,boundingRect:n,initialSize:e._size,limits:o}}static \u0275fac=function(n){return new(n||Zs)};static \u0275prov=y({token:Zs,factory:Zs.\u0275fac})};return t=x([w(Ql)],t),t})(),Jl=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(i,e){this.rootHandlers=i,this.participants=e}},eu=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.constraints=e,this.handlerPool=n}},Ho=class{_mediator=l(D);_store=l(M);_behaviour=l(Xi);_source;_target;_sourceRef;_targetRef;_sourceDelta=A.initialize();_targetDelta=A.initialize();connection;initialize(i){this.connection=i,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target)}setSourceDelta(i){this._sourceDelta=i,this._mediator.execute(new ti(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,i)))}setTargetDelta(i){this._targetDelta=i,this._mediator.execute(new ti(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,i)))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=ze.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=ze.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new kt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return this._mediator.execute(new pt(i))}_withDelta(i,e){return ze.fromRoundedRect(i).addPoint(e)}_resolveRotationContext(i){return this._mediator.execute(new Zt(i))}},Go=(()=>{class t extends Ho{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),jo=(()=>{class t extends Ho{_sourceUpdated=!1;_targetUpdated=!1;setSourceDelta(e){super.setSourceDelta(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetDelta(e){super.setTargetDelta(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,this.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Uo=(()=>{class t extends Ho{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),WN=(()=>{let t=class Qs{_store=l(M);_mediator=l(D);_dragInjector=l(Ye);handle({dragHandler:e,constraints:n,handlerPool:o}){let r=n.soft.map(a=>this._buildParentConnectionHandlers(a.nodeOrGroup,o));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,n){let o=this._store.outputs.getAll().filter(p=>p.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(p=>p.fNodeId===e.fId());if(!o.length&&!r.length)return{source:[],target:[]};let a=new Set(o.map(p=>p.fId())),s=new Set(r.map(p=>p.fId())),c=new Map,u={source:[],target:[]};for(let p of this._store.connections.getAll()){let _=a.has(p.fOutputId()),b=s.has(p.fInputId());if(!_&&!b)continue;let k=this._getExistingConnectionHandler(n,p);if(k||(k=this._createConnectionHandler(p,_,b),n.push(k)),_){let P=this._store.outputs.require(p.fOutputId());u.source.push({handler:k,connector:P,baselineRect:this._readConnectorRect(P,c)})}if(b){let P=this._store.inputs.require(p.fInputId());u.target.push({handler:k,connector:P,baselineRect:this._readConnectorRect(P,c)})}}return u}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n,o){let r;return n&&o?r=this._dragInjector.createInstance(jo):n?r=this._dragInjector.createInstance(Go):r=this._dragInjector.createInstance(Uo),r.initialize(e),r}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let a=this._mediator.execute(new pt(e)).rect;return n.set(o,a),a}static \u0275fac=function(n){return new(n||Qs)};static \u0275prov=y({token:Qs,factory:Qs.\u0275fac})};return t=x([w(eu)],t),t})(),$N=(()=>{let t=class Js{_dragInjector=l(Ye);_mediator=l(D);handle({rootHandlers:e,participants:n}){let o=this._collectConnectionHandlers(n);this._applyConstraintsToRoots(e,o);let r=this._dragInjector.createInstance(kn);return r.initialize(n,e),r}_applyConstraintsToRoots(e,n){for(let o of e){let r=this._calculateConstraints(o.nodeOrGroup);o.setConstraints(r),this._attachSoftParentConnectionHandlers(o,r,n)}}_collectConnectionHandlers(e){let n=new Map;for(let o of e){for(let r of o.sourceConnectionHandlers)n.set(r.connection.fId(),r);for(let r of o.targetConnectionHandlers)n.set(r.connection.fId(),r)}return Array.from(n.values())}_attachSoftParentConnectionHandlers(e,n,o){this._mediator.execute(new eu(e,n,o))}_calculateConstraints(e){return this._mediator.execute(new Ql(e))}static \u0275fac=function(n){return new(n||Js)};static \u0275prov=y({token:Js,factory:Js.\u0275fac})};return t=x([w(Jl)],t),t})(),tu=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.sourceIds=e,this.handlerPool=n}},KN=(()=>{let t=class ec{_store=l(M);_dragInjector=l(Ye);get _connections(){return this._store.connections.getAll()}handle(e){this._getInputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getInputConnections(e){let n=new Set(this._getNodeInputIds(e));return this._connections.filter(o=>n.has(o.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.sourceIds,e),n.handlerPool.push(o)),n.dragHandler.targetConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fOutputId())?o=this._dragInjector.createInstance(jo):o=this._dragInjector.createInstance(Uo),o.initialize(n),o}static \u0275fac=function(n){return new(n||ec)};static \u0275prov=y({token:ec,factory:ec.\u0275fac})};return t=x([w(tu)],t),t})(),nu=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.targetIds=e,this.handlerPool=n}},YN=(()=>{let t=class tc{_store=l(M);_dragInjector=l(Ye);get _connections(){return this._store.connections.getAll()}handle(e){this._getOutputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getOutputConnections(e){let n=new Set(this._getNodeOutputIds(e));return this._connections.filter(o=>n.has(o.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.targetIds,e),n.handlerPool.push(o)),n.dragHandler.sourceConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fInputId())?o=this._dragInjector.createInstance(jo):o=this._dragInjector.createInstance(Go),o.initialize(n),o}static \u0275fac=function(n){return new(n||tc)};static \u0275prov=y({token:tc,factory:tc.\u0275fac})};return t=x([w(nu)],t),t})(),iu=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(i){this.nodeOrGroup=i}},XN=(()=>{let t=class nc{_mediator=l(D);_store=l(M);_dragSession=l(Q);handle({nodeOrGroup:e}){let n=this._collectSelected(e),o=this._withDeepChildren(n),r=this._mediator.execute(new Xl(o)),a=this._collectSourceConnectorIds(o),s=this._collectTargetConnectorIds(o);return this._attachConnectionHandlers(r.participants,a,s),this._mediator.execute(new Jl(r.rootHandlers,r.participants))}_collectSelected(e){let n=[];for(let o of this._dragSession.selectedItems){let r=this._findNodeByHost(o.hostElement);r&&n.push(r)}return e&&!n.includes(e)&&n.push(e),n}_findNodeByHost(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_withDeepChildren(e){let n=[];for(let o of e){n.push(o);let r=this._mediator.execute(new Yi(o.fId()));n.push(...r)}return n}_collectSourceConnectorIds(e){return Zf(e,n=>this._store.outputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_collectTargetConnectorIds(e){return Zf(e,n=>this._store.inputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_attachConnectionHandlers(e,n,o){let r=[];for(let a of e)this._mediator.execute(new nu(a,o,r)),this._mediator.execute(new tu(a,n,r))}static \u0275fac=function(n){return new(n||nc)};static \u0275prov=y({token:nc,factory:nc.\u0275fac})};return t=x([w(iu)],t),t})(),ZN=[GN,UN,$N,KN,YN,WN,jN,XN];function QN(t,i,e=10){let n=i.x,o=i.y,r=n+i.width,a=o+i.height,s=i.gravityCenter.x,c=i.gravityCenter.y,u,p,_=1/0,b,k,P=1/0,N=(z,U)=>{let oe=U<0?-U:U;oe<=e&&oe<_&&(_=oe,u=z,p=U)},j=(z,U)=>{let oe=U<0?-U:U;oe<=e&&oe<P&&(P=oe,b=z,k=U)};for(let z=0;z<t.length;z++){let U=t[z],oe=U.x,Ce=U.y,le=oe+U.width,Ge=Ce+U.height,rn=U.gravityCenter.x,Ot=U.gravityCenter.y;N(oe,n-oe),N(le,n-le),N(rn,s-rn),N(oe,r-oe),N(le,r-le),j(Ce,o-Ce),j(Ge,o-Ge),j(Ot,c-Ot),j(Ce,a-Ce),j(Ge,a-Ge)}return{x:{guide:u,delta:p},y:{guide:b,delta:k}}}var L0=["left","top","width","height"],ou=class{_element;constructor(i,e,n="f-line"){this._element=i.document.createElement("div"),this._element.classList.add(n),this._element.style.position="absolute",this._element.style.display="none",e.appendChild(this._element)}show(){this._element.style.display="block"}hide(){this._element.style.display="none"}render(i){for(let e of L0){let n=i[e];n!=null&&(this._element.style[e]=`${n}px`)}}clearRect(){for(let i of L0)this._element.style.removeProperty(i)}destroy(){this._element.remove()}},Jh=class{_horizontal;_vertical;constructor(i,e){this._horizontal=new ou(i,e),this._vertical=new ou(i,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(i,e,n){this._vertical.show(),this._vertical.render({left:i*n.scale+n.position.x+n.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(i,e,n){this._horizontal.show(),this._horizontal.render({left:0,top:i*n.scale+n.position.y+n.scaledPosition.y,width:e.width,height:1})}hideVertical(){this._vertical.hide()}hideHorizontal(){this._horizontal.hide()}hideAll(){this._vertical.hide(),this._horizontal.hide()}destroy(){this._vertical.destroy(),this._horizontal.destroy()}},ru=class{static fToken=Symbol("MagneticLinesPreparationRequest")},JN=(()=>{let t=class ic{_mediator=l(D);_store=l(M);_browser=l(qe);_injector=l(Xe);_dragSession=l(Q);_renderer;handle(e){let n=this._store.instances.get(Se.MAGNETIC_LINES);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof kn);o&&o.setMagneticLines(new em(this._injector,this._renderer??this._createRenderer(n),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new Jh(this._browser,e),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Fe(r.hostElement)))}static \u0275fac=function(n){return new(n||ic)};static \u0275prov=y({token:ic,factory:ic.\u0275fac})};return t=x([w(ru)],t),t})(),em=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(i,e,n,o){this._renderer=e,this._size=n,this._rects=o;let r=i.get(M);this._alignThreshold=r.instances.require(Se.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(i)),15)}_renderGuides(i){this._renderVertical(i),this._renderHorizontal(i)}_renderVertical(i){i.x.guide!==void 0?this._renderer.drawVerticalLine(i.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(i){i.y.guide!==void 0?this._renderer.drawHorizontalLine(i.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(i){return QN(this._rects,i,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},B0=["top","center","bottom"],z0=["left","center","right"];function eR(t,i,e=10,n=10){let o=i.x,r=i.y,a=o+i.width,s=r+i.height,c=i.gravityCenter.x,u=i.gravityCenter.y,p=tR(t,i,o,r,a,s,c,u,e,n),_=nR(t,i,o,r,a,s,c,u,e,n);return p&&(!_||p.absDelta<=_.absDelta)?{axis:"x",delta:p.delta,gap:p.gap,rects:p.rects,alignMode:p.alignMode,crossDelta:p.crossDelta}:_?{axis:"y",delta:_.delta,gap:_.gap,rects:_.rects,alignMode:_.alignMode,crossDelta:_.crossDelta}:{rects:[]}}function tR(t,i,e,n,o,r,a,s,c,u){let p=1/0,_,b=0,k,P=[],N=0,j=[],z=[],U=[];for(let oe=0;oe<B0.length;oe++){let Ce=oe===0?n:oe===1?s:r;j.length=0,z.length=0,U.length=0;let le=1/0,Ge=-1/0,rn=0,Ot=1/0,ho=1/0;for(let ye=0;ye<t.length;ye++){let pe=t[ye],_o=oe===0?pe.y:oe===1?pe.gravityCenter.y:pe.y+pe.height,Ff=Ce-_o,$t=Ri(Ff);if($t>c)continue;j.push(ye),z.push(pe.x),U.push(pe.x+pe.width);let go=pe.y,vo=pe.y+pe.height;go<le&&(le=go),vo>Ge&&(Ge=vo),($t<Ot||$t===Ot&&ye<ho)&&(Ot=$t,rn=_o,ho=ye)}let $e=j.length;if($e<2)continue;Sv(j,z,U);let Ve=0;for(;Ve<$e&&z[Ve]<=a;)Ve++;let Hn=Ve>0&&Ve<$e,Je,ct;Hn?(Je=Ve-1,ct=Ve):Ve<=0?(Je=0,ct=1):(Je=$e-2,ct=$e-1);let dt=z[ct]-U[Je];if(dt<0)continue;let Ue;if(Hn){Ue=U[Je]+dt;let ye=Ue+i.width,pe=z[ct]-ye;if(Ri(pe-dt)>u)continue}else Ve<=0?Ue=z[0]-dt-i.width:Ue=U[$e-1]+dt;let mo=e-Ue,Gn=Ri(mo);if(Gn>u||Gn>=p)continue;let It=iR(j,z,U,le,Ge);if(Hn){let ye=Ue,pe=Ue+i.width;It.push({left:U[Je],top:le,width:ye-U[Je],height:Ge-le}),It.push({left:pe,top:le,width:z[ct]-pe,height:Ge-le})}else if(Ve<=0){let ye=Ue+i.width;It.push({left:ye,top:le,width:z[0]-ye,height:Ge-le})}else It.push({left:U[$e-1],top:le,width:Ue-U[$e-1],height:Ge-le});let Af=Ce-rn;p=Gn,_=mo,b=dt,k=B0[oe],P=It,N=Af}if(!(_===void 0||k===void 0))return{delta:_,absDelta:p,gap:b,rects:P,alignMode:k,crossDelta:N}}function nR(t,i,e,n,o,r,a,s,c,u){let p=1/0,_,b=0,k,P=[],N=0,j=[],z=[],U=[];for(let oe=0;oe<z0.length;oe++){let Ce=oe===0?e:oe===1?a:o;j.length=0,z.length=0,U.length=0;let le=1/0,Ge=-1/0,rn=0,Ot=1/0,ho=1/0;for(let ye=0;ye<t.length;ye++){let pe=t[ye],_o=oe===0?pe.x:oe===1?pe.gravityCenter.x:pe.x+pe.width,Ff=Ce-_o,$t=Ri(Ff);if($t>c)continue;j.push(ye),z.push(pe.y),U.push(pe.y+pe.height);let go=pe.x,vo=pe.x+pe.width;go<le&&(le=go),vo>Ge&&(Ge=vo),($t<Ot||$t===Ot&&ye<ho)&&(Ot=$t,rn=_o,ho=ye)}let $e=j.length;if($e<2)continue;Sv(j,z,U);let Ve=0;for(;Ve<$e&&z[Ve]<=s;)Ve++;let Hn=Ve>0&&Ve<$e,Je,ct;Hn?(Je=Ve-1,ct=Ve):Ve<=0?(Je=0,ct=1):(Je=$e-2,ct=$e-1);let dt=z[ct]-U[Je];if(dt<0)continue;let Ue;if(Hn){Ue=U[Je]+dt;let ye=Ue+i.height,pe=z[ct]-ye;if(Ri(pe-dt)>u)continue}else Ve<=0?Ue=z[0]-dt-i.height:Ue=U[$e-1]+dt;let mo=n-Ue,Gn=Ri(mo);if(Gn>u||Gn>=p)continue;let It=oR(j,z,U,le,Ge);if(Hn){let ye=Ue,pe=Ue+i.height;It.push({left:le,top:U[Je],width:Ge-le,height:ye-U[Je]}),It.push({left:le,top:pe,width:Ge-le,height:z[ct]-pe})}else if(Ve<=0){let ye=Ue+i.height;It.push({left:le,top:ye,width:Ge-le,height:z[0]-ye})}else It.push({left:le,top:U[$e-1],width:Ge-le,height:Ue-U[$e-1]});let Af=Ce-rn;p=Gn,_=mo,b=dt,k=z0[oe],P=It,N=Af}if(!(_===void 0||k===void 0))return{delta:_,absDelta:p,gap:b,rects:P,alignMode:k,crossDelta:N}}function iR(t,i,e,n,o){let r=[],a=o-n;for(let s=0;s<t.length-1;s++){let c=i[s+1]-e[s];c<0||r.push({left:e[s],top:n,width:c,height:a})}return r}function oR(t,i,e,n,o){let r=[],a=o-n;for(let s=0;s<t.length-1;s++){let c=i[s+1]-e[s];c<0||r.push({left:n,top:e[s],width:a,height:c})}return r}function Sv(t,i,e){for(let n=1;n<i.length;n++){let o=i[n],r=e[n],a=t[n],s=n-1;for(;s>=0;){let c=i[s],u=t[s];if(c<o||c===o&&u<a)break;i[s+1]=c,e[s+1]=e[s],t[s+1]=u,s--}i[s+1]=o,e[s+1]=r,t[s+1]=a}}function Ri(t){return t<0?-t:t}var tm=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(i,e,n="f-rect"){this._element=i.document.createElement("div"),this._element.classList.add(n);let o=this._element.style;o.position="absolute",o.display="none",o.boxSizing="border-box",o.pointerEvents="none",e.appendChild(this._element)}show(){this._isVisible||(this._isVisible=!0,this._element.style.display="block")}hide(){this._isVisible&&(this._isVisible=!1,this._element.style.display="none")}render(i,e,n,o){let r=this._element.style;i!==this._left&&(this._left=i,r.left=i+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),n!==this._width&&(this._width=n,r.width=n+"px"),o!==this._height&&(this._height=o,r.height=o+"px")}clearRect(){this._left=Number.NaN,this._top=Number.NaN,this._width=Number.NaN,this._height=Number.NaN;let i=this._element.style;i.removeProperty("left"),i.removeProperty("top"),i.removeProperty("width"),i.removeProperty("height")}destroy(){this._element.remove()}},nm=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(i,e,n="f-rect"){this._browser=i,this._hostElement=e,this._className=n}draw(i,e){let n=e.scale,o=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let a=0;a<i.length;a++){let s=this._getOrCreate(a),c=i[a];s.show(),s.render(c.left*n+o,c.top*n+r,c.width*n,c.height*n)}for(let a=i.length;a<this._activeCount;a++)this._pool[a].hide();this._activeCount=i.length}hideAll(){for(let i=0;i<this._activeCount;i++)this._pool[i].hide();this._activeCount=0}destroy(){for(let i of this._pool)i.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(i){if(i<this._pool.length)return this._pool[i];let e=new tm(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},au=class{static fToken=Symbol("MagneticRectsPreparationRequest")},rR=(()=>{let t=class oc{_mediator=l(D);_store=l(M);_browser=l(qe);_injector=l(Xe);_dragSession=l(Q);_renderer;handle(e){let n=this._store.instances.get(Se.MAGNETIC_RECTS);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof kn);o&&o.setMagneticRects(new im(this._injector,this._getRenderer(n),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new nm(this._browser,e.hostElement)),this._renderer?.destroy(),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Fe(r.hostElement)))}static \u0275fac=function(n){return new(n||oc)};static \u0275prov=y({token:oc,factory:oc.\u0275fac})};return t=x([w(au)],t),t})(),im=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(i,e,n){this._renderer=e,this._rects=n;let o=i.get(M),r=o.instances.require(Se.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=o.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(i)),15)}_renderRects(i){if(i.axis!==void 0&&i.delta!==void 0&&i.rects.length>0){this._renderer.draw(i.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(i){return eR(this._rects,i,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},su=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(i){this.event=i}},om=class{nodes;fNodes;constructor(i){this.nodes=i,this.fNodes=i}},aR=(()=>{let t=class rc{_mediator=l(D);_store=l(M);_dragSession=l(Q);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let n=this._buildDragDelta(e.getPosition()),o=this._dragHandler.calculateMagneticSnaps(n),r=this._applySnapToDelta(n,o.lines,o.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(HN)}_buildDragDelta(e){return Z.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,n,o){let r=e.x,a=e.y;return n&&(r=this._hasLineSnapValue(n.x)?e.x-(n.x.delta||0):r,a=this._hasLineSnapValue(n.y)?e.y-(n.y.delta||0):a),this._hasRectSnapValue(o)&&(o.axis==="x"?(r=e.x-o.delta,a=e.y-(o.crossDelta??0)):(a=e.y-o.delta,r=e.x-(o.crossDelta??0))),{x:r,y:a}}_hasLineSnapValue(e){return e.guide!==void 0&&e.guide!==null}_hasRectSnapValue(e){return!!e&&e.axis!==void 0&&e.delta!==void 0}_finalizeMove(e,n){for(let o of e.roots)o.finalizeConstraints();e.onPointerMove(n),e.onPointerUp?.(),this._store.fDraggable?.fMoveNodes.emit(this._buildMoveNodesEvent(e))}_buildMoveNodesEvent(e){let n=e.getEvent(),a=((n.data??n.fData)?.fNodeIds??[]).map(s=>({id:s,position:this._store.nodes.get(s)?._position}));return new om(a)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let n=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Dl(n)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(n){return new(n||rc)};static \u0275prov=y({token:rc,factory:rc.\u0275fac})};return t=x([w(su)],t),t})(),cu=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(i,e){this.event=i,this.trigger=e}},sR=(()=>{let t=class ac{_mediator=l(D);_store=l(M);_dragSession=l(Q);handle({event:e,trigger:n}){if(!this._canStartDrag(e,n))return;let o=this._findDraggableNode(e.targetElement);o&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(o)],this._mediator.execute(new ru),this._mediator.execute(new au))}_canStartDrag(e,n){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&bt(e.originalEvent,n)}_isDragHandle(e){return xo(e,".f-drag-handle")}_findDraggableNode(e){let n=this._store.nodes.getAll();for(let o of n)if(!o.fDraggingDisabled()&&o.isContains(e))return o}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Ki(e))}),this._mediator.execute(new iu(e))}static \u0275fac=function(n){return new(n||ac)};static \u0275prov=y({token:ac,factory:ac.\u0275fac})};return t=x([w(cu)],t),t})(),cR=[...ZN,JN,rR,aR,sR],rm=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(i,e,n){this.targetGroupId=i,this.nodeIds=e,this.dropPosition=n,this.fTargetNode=i,this.fNodes=e,this.fDropPosition=n}},dR=(()=>{let t=class sc{_dragSession=l(Q);_store=l(M);handle({event:e}){let n=this._findDropHandler();if(!n)return;let o=n.activeTarget?.node;o&&this._emitDropToGroupEvent(o.fId(),e),n.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof qo)}_emitDropToGroupEvent(e,n){this._store.fDraggable?.fDropToGroup.emit(new rm(e,this._getTopLevelDraggedIds(),n.getPosition()))}_getTopLevelDraggedIds(){let n=this._getMoveSummaryHandler().items.map(a=>a.nodeOrGroup),o=new Set(n.map(a=>a.fId())),r=[];for(let a of n){let s=a.fParentId();(!s||!o.has(s))&&r.push(a.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof kn);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(n){return new(n||sc)};static \u0275prov=y({token:sc,factory:sc.\u0275fac})};return t=x([w(Yl)],t),t})(),du=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(i){this.event=i}},lu=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(i){this.candidates=i}},lR=(()=>{let t=class cc{handle({candidates:e}){let n=e.map((o,r)=>({candidate:o,index:r}));return n.sort((o,r)=>{let a=this._compareDomOrder(o.candidate.node.hostElement,r.candidate.node.hostElement);return a!==0?-a:o.index-r.index}),n.map(o=>o.candidate)}_compareDomOrder(e,n){if(e===n)return 0;let o=e.compareDocumentPosition(n);if((o&Node.DOCUMENT_POSITION_FOLLOWING)!==0)return-1;if((o&Node.DOCUMENT_POSITION_PRECEDING)!==0)return 1;if(o&Node.DOCUMENT_POSITION_DISCONNECTED){let r=e.getBoundingClientRect?.()??{top:0,left:0},a=n.getBoundingClientRect?.()??{top:0,left:0};return r.top!==a.top?r.top<a.top?-1:1:r.left!==a.left?r.left<a.left?-1:1:0}return 0}static \u0275fac=function(n){return new(n||cc)};static \u0275prov=y({token:cc,factory:cc.\u0275fac})};return t=x([w(lu)],t),t})(),am=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(i,e,n){this._onPointerDown=e,this._limit=n;let o=i.get(M);this._vCellSize=o.fDraggable.vCellSize(),this._hCellSize=o.fDraggable.hCellSize(),this._adjustCellSize=o.fDraggable.fCellSizeWhileDragging()}limit(i){let{min:e,max:n}=this._limit,{x:o,y:r}=this._cellSizeStrategies[+this._adjustCellSize](i);return{x:this._clamp(o,e.x,n.x),y:this._clamp(r,e.y,n.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(i){return{x:this._snapToGrid(this._onPointerDown.x+i.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+i.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(i){return i}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}_snapToGrid(i,e){return Math.round(i/e)*e}},uu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(i){this.externalItem=i}},uR=(()=>{let t=class dc{_browser=l(qe);_containerRef=l(Ur);handle({externalItem:e}){let{hostElement:n,placeholder:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(n);return a.classList.add("f-external-item-placeholder"),a.style.pointerEvents="none",a}_fromTemplate(e){return eh(this._createViewRef(e),this._browser.document)}_fromHost(e){return Qf(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}static \u0275fac=function(n){return new(n||dc)};static \u0275prov=y({token:dc,factory:dc.\u0275fac})};return t=x([w(uu)],t),t})(),pu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(i){this.externalItem=i}},pR=(()=>{let t=class lc{_browser=l(qe);_containerRef=l(Ur);handle({externalItem:e}){let{hostElement:n,preview:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(n);return this._setPreviewStyles(a),v0(a),a.classList.add("f-external-item-preview"),a}_fromTemplate(e){return eh(this._createViewRef(e),this._browser.document)}_fromHost(e){return Qf(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}_setPreviewStyles(e){Jf(e.style,{"pointer-events":"none",margin:"showPopover"in e?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":"1000"},new Set(["position"]))}static \u0275fac=function(n){return new(n||lc)};static \u0275prov=y({token:lc,factory:lc.\u0275fac})};return t=x([w(pu)],t),t})(),fu=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(i){this.event=i}},sm=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(i,e,n,o){this.externalItemRect=i,this.data=e,this.targetContainerId=n,this.dropPosition=o,this.rect=i,this.fTargetNode=n,this.fDropPosition=o}},fR="external-item",hR="drag-external-item";function mR(t){return t.getEvent().kind===hR||t.getEvent().fEventType===fR}var _R=(()=>{let t=class uc{_result=l(Mn);_mediator=l(D);_store=l(M);_dragSession=l(Q);_browser=l(qe);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let n=this._findExternalItemHandler();if(!n)return;let o=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),o,e.event.getPosition()),n.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>mR(e))}_getDestinationNodeOrGroupId(){let e=this._getDropToGroupHandler(),n=e.activeTarget?.node.fId();return e.onPointerUp?.(),n}_getDropToGroupHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof qo);if(!e)throw new Error("NodeDragToParentDragHandler not found");return e}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y).filter(n=>!n.closest(".f-external-item")&&!n.closest(".f-external-item-preview"))}_emitEvent(e,n,o){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new sm(this._getPreviewRect(),this._result.getData().externalItem.data(),n,n?o:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new Fe(this._result.getData().preview))}static \u0275fac=function(n){return new(n||uc)};static \u0275prov=y({token:uc,factory:uc.\u0275fac})};return t=x([w(fu)],t),t})(),cm=class{data;constructor(i){this.data=i}},hu=class extends ot{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new cm(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=G.initialize();_pointerDownRect=G.initialize();_absoluteOffsetFromFlow=A.initialize();_grabOffsetFromPointer=A.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=i=>i;constructor(i,e,n){super(),this._externalItem=e,this._pointerDownClientPosition=n,this._store=i.get(M),this._result=i.get(Mn),this._mediator=i.get(D),this._browser=i.get(qe),this._originalDisplay=this._host.style.display,this._initConstraints(i)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(i){this._startRect=this._getStartRect();let e=new am(i,this._startRect,fv());this._applyConstraints=n=>e.limit(n)}_getStartRect(){return this._mediator.execute(new Fe(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=Z.fromPoint(this._pointerDownRect).sub(this._toAbsolutePoint(this._startRect)),this._grabOffsetFromPointer=this._clientToAbsolute(this._pointerDownClientPosition).sub(this._pointerDownRect),this._rememberOriginalPlacement(),this._previewEl=this._createPreview(),this._placeholderEl=this._createPlaceholder(),this._placePreviewIntoOverlay(),this._swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(),this._result.setData({preview:this._previewEl,externalItem:this._externalItem})}_rememberOriginalPlacement(){let i=this._host.parentNode;if(!i){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=i,this._originalNextSibling=this._host.nextSibling}_createPreview(){let i=this._mediator.execute(new pu(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(i,this._pointerDownRect),i.style.transform=q0(this._pointerDownRect),i}_createPlaceholder(){return this._mediator.execute(new uu(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let i=this._originalParent,e=this._placeholderEl;if(!i||!e)return;let n=i.replaceChild(e,this._host);this._overlayRoot.appendChild(n),this._host.style.display="none"}onPointerMove(i,e){if(!this._previewEl)return;let n=this._resolveDeltaFromPointer(i,e),o=this._applyConstraints(n),r=Z.fromPoint(this._startRect).add(o),a=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=q0(a)}onPointerUp(){this._previewEl&&this._previewEl.parentNode&&this._previewEl.parentNode.removeChild(this._previewEl),this._restoreOriginalInParent(),this._host.style.display=this._originalDisplay||"block",this._previewEl=void 0,this._placeholderEl=void 0,this._originalParent=void 0,this._originalNextSibling=null}_restoreOriginalInParent(){let i=this._originalParent,e=this._placeholderEl;if(!(!i||!e)){if(e.parentNode===i){i.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===i?i.insertBefore(this._host,this._originalNextSibling):i.appendChild(this._host)}}_matchSize(i,e){i.style.width=`${e.width}px`,i.style.height=`${e.height}px`}_readAbsoluteRect(i){let e=i.getBoundingClientRect(),n=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,o=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return G.initialize(e.left+o,e.top+n,e.width,e.height)}_toAbsolutePoint(i){let e=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition);return Z.fromPoint(i).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(i,e){let n=e?.getPosition();if(!n)return i;let o=this._clientToAbsolute(n).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(o);return Z.fromPoint(r).sub(this._startRect)}_toFlowPoint(i){let e=this._getFlowHostAbsolutePosition(),n=Z.fromPoint(this._transform.position).add(this._transform.scaledPosition);return Z.fromPoint(i).sub(e).sub(n).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let i=this._store.flowHost.getBoundingClientRect(),e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return A.initialize(i.left+n,i.top+e)}_clientToAbsolute(i){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return Z.fromPoint(i).add(A.initialize(n,e))}};function q0({x:t,y:i}){return`translate3d(${Math.round(t)}px, ${Math.round(i)}px, 0)`}var mu=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function gR(t){return!!t.closest?.("[fExternalItem]")}function vR(t){return t.closest("[fExternalItem]")}var yR=(()=>{class t{_byHost=new Map;_items=H([]);items=S(()=>this._items());getByElement(e){let n=vR(e);return n?this._byHost.get(n):void 0}getByHost(e){return this._byHost.get(e)}register(e){let n=e.hostElement,o=this._byHost.get(n);o!==e&&(o&&o!==e&&this._byHost.delete(n),this._byHost.set(n,e),this._sync())}remove(e){let n=e.hostElement;this._byHost.get(n)===e&&(this._byHost.delete(n),this._sync())}_sync(){this._items.set([...this._byHost.values()])}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var CR=(()=>{let t=class pc{_apiService=l(yR);_dragSession=l(Q);_store=l(M);_injector=l(Xe);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!bt(e.originalEvent,n))return;let o=this._resolveExternalItem(e.targetElement);if(!o||o.disabled())return;let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new hu(this._injector,o,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(n){return new(n||pc)};static \u0275prov=y({token:pc,factory:pc.\u0275fac})};return t=x([w(mu)],t),t})(),_u=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(i){this.event=i}},bR=(()=>{let t=class fc{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let n=this._isExternalItem(e.target),o=this._isExternalItem(e.target.parentNode);return n||o}_isExternalItem(e){let n=!1;try{n=gR(e)}catch{}return n}static \u0275fac=function(n){return new(n||fc)};static \u0275prov=y({token:fc,factory:fc.\u0275fac})};return t=x([w(_u)],t),t})(),xR=[uR,pR,_R,CR,bR],wR=(()=>{let t=class hc{_mediator=l(D);_dragContext=l(Q);_store=l(M);_dragInjector=l(Ye);get _allNodes(){return this._store.nodes.getAll()}handle({event:e}){if(!this._canPrepare())return;let n=this._allNodes.find(a=>a.isContains(e.targetElement));if(!n&&!this._hasExternalDrag())throw new Error("Drag target node not found");let o=this._sortedTargetsForDrop();if(n){let a=n.fParentId(),s=this._mediator.execute(new Wu(a));s.length&&(o=o.filter(c=>s.includes(c.node.fId())))}let r=this._dragInjector.get(qo);r.initialize(o),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof kn)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof hu)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),n=e.some(s=>s instanceof Vh),o=this._withParents(e),a=this._eligibleTargets(o,n).map(s=>{let c=this._mediator.execute(new Fe(s.hostElement));return{node:s,rect:c}});return this._mediator.execute(new lu(a))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(n=>n instanceof kn);return e?e.items.map(n=>n.nodeOrGroup):[]}_withParents(e){return e.reduce((n,o)=>{n.push(o);let r=this._mediator.execute(new Ui(o));return n.push(...r),n},[])}_eligibleTargets(e,n){let o=this._allNodes.filter(r=>!e.includes(r));return n?o.filter(r=>r instanceof Vh):o}static \u0275fac=function(n){return new(n||hc)};static \u0275prov=y({token:hc,factory:hc.\u0275fac})};return t=x([w(du)],t),t})(),SR=[lR,wR,dR],gu=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(i){this.event=i}},IR=.5,vu=(()=>{class t extends ot{type="pinch-to-zoom";kind="pinch-to-zoom";_store=l(M);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(Se.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=V0(this._touches);e!=null&&(this._startDistance=e,this._startScale=this._canvas.transform.scale)}onPointerMove(e,n){if(n.touches.length!==2||this._startDistance==null||this._startScale==null)return;let o=V0(n.touches),r=TR(n.touches);if(o==null||r==null){this._reset();return}if(Math.abs(o-this._startDistance)<IR)return;n.preventDefault();let a=o/this._startDistance,s=this._clamp(this._startScale*a);this._canvas.setScale(s,this._castPositionToFlow(r)),this._canvas.redraw()}_clamp(e){return Math.max(this._zoomComponent.minimum,Math.min(e,this._zoomComponent.maximum))}_castPositionToFlow(e){return Z.fromPoint(e).elementTransform(this._flowHost)}_reset(){this._startScale=null,this._startDistance=null}onPointerUp(){this._reset(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function TR(t){if(t.length!==2)return null;let i=t[0],e=t[1];return A.initialize((i.clientX+e.clientX)/2,(i.clientY+e.clientY)/2)}function V0(t){if(t.length!==2)return null;let i=t[0],e=t[1];return Math.hypot(e.clientX-i.clientX,e.clientY-i.clientY)}var ER=(()=>{let t=class mc{_dragSession=l(Q);handle(e){if(this._hasPinchZoomHandler())for(let n of this._dragSession.draggableItems)n.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof vu)}static \u0275fac=function(n){return new(n||mc)};static \u0275prov=y({token:mc,factory:mc.\u0275fac})};return t=x([w(gu)],t),t})(),yu=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(i){this.event=i}},PR=(()=>{let t=class _c{_dragInjector=l(Ye);_store=l(M);_dragSession=l(Q);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new Z,this._dragSession.draggableItems=[this._getHandler(e)])}_canStart(e){return this._dragSession.isEmpty()&&e.touches?.length===2&&!e.isEventInLockedContext&&this._hasZoomComponent()}_hasZoomComponent(){return this._store.instances.has(Se.ZOOM)}_getHandler(e){let n=this._dragInjector.get(vu);return n.initialize(e.touches),n}static \u0275fac=function(n){return new(n||_c)};static \u0275prov=y({token:_c,factory:_c.\u0275fac})};return t=x([w(yu)],t),t})(),kR=[PR,ER],Cu=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(i){this.event=i}},MR=(()=>{let t=class gc{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>e.getEvent().kind==="selection-area")}static \u0275fac=function(n){return new(n||gc)};static \u0275prov=y({token:gc,factory:gc.\u0275fac})};return t=x([w(Cu)],t),t})(),dm=(()=>{class t extends ot{type="selection-area";kind="selection-area";_store=l(M);_dragSession=l(Q);_mediator=l(D);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return Z.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(Se.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new rp),this._show(),this._draw(G.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let n=Z.fromPoint(e).add(this._dragSession.onPointerDownPosition),o=this._getMinimumPoint(this._dragSession.onPointerDownPosition,n),r=Math.abs(e.x),a=Math.abs(e.y),s=G.initialize(o.x,o.y,r,a);this._draw(s),this._selectedByMove=[],this._canBeSelected.forEach(c=>{c.element.unmarkAsSelected();let u=G.addPoint(G.mult(c.fRect,this._transform.scale),this._canvasPosition);G.intersectionWithRect(u,s)&&(c.element.markAsSelected(),this._selectedByMove.push(c.element))}),this._mediator.execute(new Sn)}_getMinimumPoint(e,n){return A.initialize(Math.min(e.x,n.x),Math.min(e.y,n.y))}onPointerUp(){this._hide(),this._dragSession.selectedItems.push(...this._selectedByMove),this._selectedByMove.length>0&&(this._dragSession.isSelectedChanged=!0)}_draw(e){let n=this._instance.hostElement.style;n.left=e.x+"px",n.top=e.y+"px",n.width=e.width+"px",n.height=e.height+"px"}_show(){this._instance.hostElement.style.display="block"}_hide(){this._instance.hostElement.style.display="none"}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),bu=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(i){this.event=i}},DR=(()=>{let t=class vc{_store=l(M);_dragSession=l(Q);_dragInjector=l(Ye);get _instance(){return this._store.instances.get(Se.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(dm)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&bt(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(n){return new(n||vc)};static \u0275prov=y({token:vc,factory:vc.\u0275fac})};return t=x([w(bu)],t),t})(),OR=[DR,MR],xu=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(i,e){this.rect=i,this.childrenBounds=e}},NR=(()=>{let t=class yc{handle({rect:e,childrenBounds:n}){n&&this._apply(e,n)}_apply(e,n){this._restrictLeft(e,n),this._restrictTop(e,n),this._restrictRight(e,n),this._restrictBottom(e,n),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_restrictLeft(e,n){let o=e.x-n.x;o>0&&(e.x-=o,e.width+=o)}_restrictTop(e,n){let o=e.y-n.y;o>0&&(e.y-=o,e.height+=o)}_restrictRight(e,n){let o=n.x+n.width;e.x+e.width<=o&&(e.width=o-e.x)}_restrictBottom(e,n){let o=n.y+n.height;e.y+e.height<=o&&(e.height=o-e.y)}static \u0275fac=function(n){return new(n||yc)};static \u0275prov=y({token:yc,factory:yc.\u0275fac})};return t=x([w(xu)],t),t})(),wu=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(i,e){this.rect=i,this.limits=e}},RR=(()=>{let t=class Cc{_mediator=l(D);handle({rect:e,limits:n}){this._applyResizeConstraints(e,n)}_applyResizeConstraints(e,n){if(!n)return;let o=this._clampedCopyForCalculation(e,n);this._applySoftParentExpansions(o,n.softLimits),n.hardLimit&&this._clampRectToInner(e,n.hardLimit.innerRect)}_clampedCopyForCalculation(e,n){let o=de({},e);return n.hardLimit&&this._clampRectToInner(o,n.hardLimit.innerRect),o}_clampRectToInner(e,n){if(e.x<n.x){let a=n.x-e.x;e.x+=a,e.width-=a}if(e.y<n.y){let a=n.y-e.y;e.y+=a,e.height-=a}let o=n.x+n.width;e.x+e.width>o&&(e.width=o-e.x);let r=n.y+n.height;e.y+e.height>r&&(e.height=r-e.y),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_applySoftParentExpansions(e,n){if(n?.length)for(let o of n)this._expandParentFromOriginalIfOverflow(e,o)}_expandParentFromOriginalIfOverflow(e,n){let o=n.innerRect,r=n.boundingRect,a=this._computeOverflow(o,e);if(!this._hasOverflow(a)){this._applyParentRect(n,r);return}let s=this._buildExpandedParentRect(r,a);this._applyParentRect(n,s)}_hasOverflow(e){return!!(e.left||e.top||e.right||e.bottom)}_computeOverflow(e,n){let o=Math.max(0,e.x-n.x),r=Math.max(0,e.y-n.y),a=Math.max(0,n.x+n.width-(e.x+e.width)),s=Math.max(0,n.y+n.height-(e.y+e.height));return{left:o,top:r,right:a,bottom:s}}_buildExpandedParentRect(e,n){let o=de({},e);return n.left&&(o.x=e.x-n.left,o.width=e.width+n.left),n.top&&(o.y=e.y-n.top,o.height=e.height+n.top),n.right&&(o.width=(o.width??e.width)+n.right),n.bottom&&(o.height=(o.height??e.height)+n.bottom),o}_applyParentRect(e,n){e.nodeOrGroup.updatePosition(n),e.nodeOrGroup.updateSize(n),this._mediator.execute(new ni(e.nodeOrGroup.fId(),n)),e.nodeOrGroup.redraw()}static \u0275fac=function(n){return new(n||Cc)};static \u0275prov=y({token:Cc,factory:Cc.\u0275fac})};return t=x([w(wu)],t),t})(),Su=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(i,e,n,o){this.originalRect=i,this.difference=e,this.handleType=n,this.minimumSize=o}},H0={[Bt.LEFT]:{x:-1,y:0},[Bt.LEFT_TOP]:{x:-1,y:-1},[Bt.TOP]:{x:0,y:-1},[Bt.RIGHT_TOP]:{x:1,y:-1},[Bt.RIGHT]:{x:1,y:0},[Bt.RIGHT_BOTTOM]:{x:1,y:1},[Bt.BOTTOM]:{x:0,y:1},[Bt.LEFT_BOTTOM]:{x:-1,y:1}},AR=(()=>{let t=class bc{handle({originalRect:e,difference:n,handleType:o,minimumSize:r}){let a=this._changeSizeInRect(e,n,H0[o],r);return this._changePosition(e,n,H0[o],a)}_changeSizeInRect(e,n,o,r){let a=e.width+o.x*n.x,s=e.height+o.y*n.y,c=0,u=0;return a<0&&(c=a,a=Math.abs(a)),a<r.width&&(o.x===-1&&(c+=a-r.width),a=r.width),s<0&&(u=s,s=Math.abs(s)),s<r.height&&(o.y===-1&&(u+=s-r.height),s=r.height),G.initialize(c,u,a,s)}_changePosition(e,n,o,r){let a=e.x+(o.x===-1?n.x:0)+r.x,s=e.y+(o.y===-1?n.y:0)+r.y;return G.initialize(a,s,r.width,r.height)}static \u0275fac=function(n){return new(n||bc)};static \u0275prov=y({token:bc,factory:bc.\u0275fac})};return t=x([w(Su)],t),t})(),Iu=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(i,e){this.nodeOrGroup=i,this.paddings=e}},FR=(()=>{let t=class xc{_mediator=l(D);_store=l(M);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:n}){let o=G.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return o?this._concatRectWithParentPadding(o,n):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(n=>n.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new Fe(e.hostElement))}_concatRectWithParentPadding(e,n){return G.initialize(e.x-n[0],e.y-n[1],e.width+n[0]+n[2],e.height+n[1]+n[3])}static \u0275fac=function(n){return new(n||xc)};static \u0275prov=y({token:xc,factory:xc.\u0275fac})};return t=x([w(Iu)],t),t})(),Wo=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(i,e){this.nodeOrGroup=i,this.rect=e}},LR=(()=>{let t=class wc{_mediator=l(D);handle({nodeOrGroup:e,rect:n}){let o=this._getParentsChain(e),r=this._calculateNodePaddings(e,n);return{limits:this._buildSoftHardLimits(o),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:it.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,n){return this._mediator.execute(new ai(e,n))}_getNormalizedChildrenBounds(e,n){return this._mediator.execute(new Iu(e,n))}_getParentsChain(e){return this._mediator.execute(new Ui(e))??[]}_buildSoftHardLimits(e){let n=[],o,r=[0,0,0,0];for(let a of e){let s=this._getParentInfo(a,r);if(r=s.paddings,this._isAutoExpand(a))n.push(this._makeLimit(a,s));else{o=this._makeLimit(a,s);break}}return{softLimits:n,hardLimit:o}}_getParentInfo(e,n){return this._mediator.execute(new Vo(e,n))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:n,innerRect:o}){return{nodeOrGroup:e,boundingRect:n,innerRect:o}}static \u0275fac=function(n){return new(n||wc)};static \u0275prov=y({token:wc,factory:wc.\u0275fac})};return t=x([w(Wo)],t),t})(),Tu=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(i){this.event=i}},Iv="node-resize",Tv="resize-node";function BR(t){return t.getEvent().kind===Tv||t.getEvent().fEventType===Iv}var zR=(()=>{let t=class Sc{_dragSession=l(Q);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(n=>n.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>BR(e))}static \u0275fac=function(n){return new(n||Sc)};static \u0275prov=y({token:Sc,factory:Sc.\u0275fac})};return t=x([w(Tu)],t),t})(),lm=class{fNodeId;constructor(i){this.fNodeId=i}},um=(()=>{class t extends ot{type=Iv;kind=Tv;data(){return new lm(this._nodeOrGroup.fId())}_mediator=l(D);_baselineRect;_constraints;_lastRect=null;_nodeOrGroup;_handleType;_nodeConnections={source:[],target:[]};_softParentConnections=[];initialize(e,n){this._nodeOrGroup=e,this._handleType=n}setNodeConnectionHandlers(e){this._nodeConnections=e}setSoftParentConnectionHandlers(e){this._softParentConnections=e}prepareDragSequence(){this._baselineRect=this._readBaselineRect(),this._constraints=this._buildConstraints(this._baselineRect),this._lastRect=this._baselineRect}onPointerMove(e){let n=this._calcNextRect(e);this._applyConstraints(n),this._commitRect(n),this._applyConnectionHandlers(this._nodeConnections);for(let o of this._softParentConnections)this._applyConnectionHandlers(o);this._lastRect=n}onPointerUp(){let e=this._lastRect??this._fallbackRectFromModel();this._nodeOrGroup.sizeChange.emit(e),requestAnimationFrame(()=>this._nodeOrGroup.refresh())}_readBaselineRect(){return this._mediator.execute(new Fe(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new Wo(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new Su(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new xu(e,this._constraints.childrenBounds)),this._mediator.execute(new wu(e,this._constraints.limits))}_commitRect(e){this._nodeOrGroup.updatePosition({x:e.x,y:e.y}),this._nodeOrGroup.updateSize({width:e.width,height:e.height}),this._mediator.execute(new ni(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return G.initialize(this._nodeOrGroup._position.x,this._nodeOrGroup._position.y,this._nodeOrGroup._size?.width,this._nodeOrGroup._size?.height)}_applyConnectionHandlers(e){if(!e.source.length&&!e.target.length)return;let n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceRect(r)}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetRect(r)}}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let a=this._mediator.execute(new En(e.hostElement,!1));return n.set(o,a),a}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),$o=class{_mediator=l(D);_store=l(M);_behaviour=l(Xi);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(i){this.connection=i,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target),this._sourceRect=ze.fromRoundedRect(this._sourceRef.rect),this._targetRect=ze.fromRoundedRect(this._targetRef.rect)}setSourceRect(i){this._sourceRect=ze.fromRoundedRect(i),this._mediator.execute(new ti(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(i){this._targetRect=ze.fromRoundedRect(i),this._mediator.execute(new ti(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=ze.fromRoundedRect(this._sourceRect),e=ze.fromRoundedRect(this._targetRect);return this._behaviour.handle(new kt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return{connector:i,rect:this._mediator.execute(new En(i.hostElement,!1))}}_resolveRotationContext(i){return this._mediator.execute(new Zt(i))}},qR=(()=>{class t extends $o{_sourceUpdated=!1;_targetUpdated=!1;setSourceRect(e){super.setSourceRect(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetRect(e){super.setTargetRect(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,super.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),VR=(()=>{class t extends $o{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),HR=(()=>{class t extends $o{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Eu=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},Pu=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(i,e){this.handler=i,this.nodeOrGroup=e}},GR=(()=>{let t=class Ic{_store=l(M);_mediator=l(D);_dragInjector=l(Ye);handle({handler:e,nodeOrGroup:n}){let o=this._readSoftParents(n),r=[n,...o],a=this._collectSourceConnectorIds(r),s=this._collectTargetConnectorIds(r),c=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(n,a,s,c)),e.setSoftParentConnectionHandlers(o.map(u=>this._buildConnectionHandlersForNode(u,a,s,c)))}_readSoftParents(e){let n=this._mediator.execute(new Fe(e.hostElement));return this._mediator.execute(new Wo(e,n)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.outputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_collectTargetConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.inputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_buildConnectionHandlersForNode(e,n,o,r){let a=this._store.outputs.getAll().filter(_=>_.fNodeId===e.fId()),s=this._store.inputs.getAll().filter(_=>_.fNodeId===e.fId());if(!a.length&&!s.length)return{source:[],target:[]};let c=new Set(a.map(_=>_.fId())),u=new Set(s.map(_=>_.fId())),p={source:[],target:[]};for(let _ of this._store.connections.getAll()){let b=c.has(_.fOutputId()),k=u.has(_.fInputId());if(!b&&!k)continue;let P=r.get(_.fId())??this._createConnectionHandler(_,n,o);if(r.set(_.fId(),P),b){let N=this._store.outputs.require(_.fOutputId());p.source.push({handler:P,connector:N})}if(k){let N=this._store.inputs.require(_.fInputId());p.target.push({handler:P,connector:N})}}return p}_createConnectionHandler(e,n,o){let r=n.has(e.fOutputId()),a=o.has(e.fInputId()),s=r&&a?this._dragInjector.createInstance(qR):r?this._dragInjector.createInstance(VR):this._dragInjector.createInstance(HR);return s.initialize(e),s}static \u0275fac=function(n){return new(n||Ic)};static \u0275prov=y({token:Ic,factory:Ic.\u0275fac})};return t=x([w(Pu)],t),t})(),jR=(()=>{let t=class Tc{_mediator=l(D);_store=l(M);_dragSession=l(Q);_dragInjector=l(Ye);get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!bt(e.originalEvent,n))return;let o=this._findResizableNode(e.targetElement);if(!o)return;this._selectBeforeResize(o);let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let a=this._dragInjector.createInstance(um);a.initialize(o,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new Pu(a,o)),this._dragSession.draggableItems=[a]}_isResizeHandle(e){return xo(e,".f-resize-handle")}_findResizableNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));if(n)return n.fDraggingDisabled()?void 0:n}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Ki(e))})}_readResizeHandleType(e){let n=y0(e,"fResizeHandleType",".f-resize-handle");return Bt[n]}static \u0275fac=function(n){return new(n||Tc)};static \u0275prov=y({token:Tc,factory:Tc.\u0275fac})};return t=x([w(Eu)],t),t})(),UR=[NR,RR,AR,FR,LR,GR,zR,jR],ku=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(i){this.event=i}},Ev="node-rotate",Pv="rotate-node";function WR(t){return t.getEvent().kind===Pv||t.getEvent().fEventType===Ev}var $R=(()=>{let t=class Ec{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>WR(e))}static \u0275fac=function(n){return new(n||Ec)};static \u0275prov=y({token:Ec,factory:Ec.\u0275fac})};return t=x([w(ku)],t),t})(),Mu=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},pm=class{fNodeId;constructor(i){this.fNodeId=i}};function KR(t,i,e){let{x:n,y:o}=YR(t,i,e),r=n-t.x,a=o-t.y;return{x:r,y:a}}function YR(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,a=Math.cos(r),s=Math.sin(r),c=n*a-o*s,u=n*s+o*a,p=c+e.x,_=u+e.y;return{x:p,y:_}}var fm=(()=>{class t extends ot{type=Ev;kind=Pv;data(){return new pm(this._nodeOrGroup.fId())}_store=l(M);_mediator=l(D);_dragSession=l(Q);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,n,o){this._nodeOrGroup=e,this._sourceConnections=n,this._targetConnections=o,this._startRotation=this._nodeOrGroup._rotate}prepareDragSequence(){this._nodeRect=this._readNodeRect(),this._nodeCenter=this._nodeRect.gravityCenter,this._pointerDownInFlow=this._calculatePointerDownInFlow();let e=this._angleDeg(this._pointerDownInFlow);this._rotationOffsetDeg=e-this._startRotation}onPointerMove(e){let n=A.sum(this._pointerDownInFlow,e),r=this._angleDeg(n)-this._rotationOffsetDeg;this._applyRotation(r);let a=r-this._startRotation;for(let s of this._sourceConnections)s.connection.setSourceDelta(this._deltaAfterRotation(s.connector,a));for(let s of this._targetConnections)s.connection.setTargetDelta(this._deltaAfterRotation(s.connector,a))}onPointerUp(){this._nodeOrGroup.rotate.set(this._nodeOrGroup._rotate),this._nodeOrGroup.refresh()}_readNodeRect(){return this._mediator.execute(new Fe(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return A.sub(this._dragSession.onPointerDownPosition,A.sum(this._transform.position,this._transform.scaledPosition))}_angleDeg(e){return Math.atan2(e.y-this._nodeCenter.y,e.x-this._nodeCenter.x)*(180/Math.PI)}_applyRotation(e){this._nodeOrGroup.updateRotate(e),this._nodeOrGroup.redraw()}_deltaAfterRotation(e,n){return KR(e,n,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),XR=(()=>{let t=class Pc{_mediator=l(D);_store=l(M);_dragContext=l(Q);_dragInjector=l(Ye);get _transform(){return this._store.transform}handle(e){if(!this._isPreparationAllowed(e))return;let n=this._findRotatableNode(e.event.targetElement);if(!n)return;this._selectBeforeRotate(n);let o=this._transform.scale;this._dragContext.onPointerDownScale=o,this._dragContext.onPointerDownPosition=Z.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(o);let r=this._dragInjector.createInstance(fm);r.initialize(n,this._buildOutputConnectionHandlers(n),this._buildInputConnectionHandlers(n)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:n}){return this._dragContext.isEmpty()&&yN(e.targetElement)&&bt(e.originalEvent,n)}_findRotatableNode(e){for(let n of this._store.nodes.getAll())if(!n.fDraggingDisabled()&&n.isContains(e))return n}_selectBeforeRotate(e){queueMicrotask(()=>{this._mediator.execute(new Ki(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new Fu(e)).map(n=>{let o=this._store.inputs.require(n.fInputId()),r=this._mediator.execute(new pt(o)),a=this._dragInjector.get(Uo);return a.initialize(n),{connection:a,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new Uu(e)).map(n=>{let o=this._store.outputs.require(n.fOutputId()),r=this._mediator.execute(new pt(o)),a=this._dragInjector.get(Go);return a.initialize(n),{connection:a,connector:r.rect.gravityCenter}})}static \u0275fac=function(n){return new(n||Pc)};static \u0275prov=y({token:Pc,factory:Pc.\u0275fac})};return t=x([w(Mu)],t),t})(),ZR=[$R,XR],Ko=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(i,e,n,o){this.flowRect=i,this.canvasPosition=e,this.eventPoint=n,this.minimap=o}},QR=(()=>{let t=class kc{_store=l(M);get _canvasScale(){return this._store.transform.scale||1}handle(e){return A.sub(e.canvasPosition,A.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return Z.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,n){let o=this.normalizeEventPoint(e,n);return A.sum(o,G.mult(n.viewBox,this._canvasScale))}normalizeEventPoint(e,n){return this._getEventPointInMinimap(e,n).mult(n.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,n){return Z.fromPoint(e).elementTransform(n.element)}static \u0275fac=function(n){return new(n||kc)};static \u0275prov=y({token:kc,factory:kc.\u0275fac})};return t=x([w(Ko)],t),t})(),Du=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(i){this.event=i}},JR=(()=>{let t=class Mc{_dragSession=l(Q);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e2)}static \u0275fac=function(n){return new(n||Mc)};static \u0275prov=y({token:Mc,factory:Mc.\u0275fac})};return t=x([w(Du)],t),t})(),kv="minimap",Mv="minimap";function e2(t){return t.getEvent().kind===Mv||t.getEvent().fEventType===kv}var hm=(()=>{class t extends ot{type=kv;kind=Mv;_store=l(M);_mediator=l(D);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,n,o,r){this._flowRect=e,this._startCanvasPosition=n,this._eventPoint=o,this._minimap=r}prepareDragSequence(){this._store.fCanvas?.hostElement.classList.add("f-scaled-animate")}onPointerMove(e){this._lastDelta&&this._isSamePoint(e,this._lastDelta)||(this._lastDelta=e,this._store.fCanvas?.setPosition(this._getNewPosition(Z.fromPoint(this._eventPoint).add(e))),this._store.fCanvas?.redraw())}_isSamePoint(e,n){return e.x===n.x&&e.y===n.y}_getNewPosition(e){return this._mediator.execute(new Ko(this._flowRect,this._startCanvasPosition,e,this._minimap))}onPointerUp(){this._store.fCanvas?.hostElement.classList.remove("f-scaled-animate"),this._store.fCanvas?.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ou=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(i){this.event=i}},t2=(()=>{let t=class Dc{_store=l(M);_mediator=l(D);_dragSession=l(Q);_dragInjector=l(Ye);get _canvas(){return this._store.fCanvas}get _flowHost(){return this._store.flowHost}handle({event:e}){if(!this._isValid(e))return;let n=this._store.instances.require(Se.MINIMAP).state,o=e.getPosition(),r=Z.fromPoint(this._store.transform.position),a=G.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(a,o,n)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=Z.fromPoint(o).elementTransform(this._flowHost);let s=this._dragInjector.createInstance(hm);s.initialize(a,r,o,n),this._dragSession.draggableItems=[s]}_isValid(e){return!(!this._dragSession.isEmpty()||!this._flowHost.contains(e.targetElement)||!e.targetElement.closest(".f-minimap")||!this._store.instances.get(Se.MINIMAP))}_calculateCanvasPosition(e,n,o){return this._mediator.execute(new Ko(e,Z.fromPoint(this._canvas.transform.position),n,o))}static \u0275fac=function(n){return new(n||Dc)};static \u0275prov=y({token:Dc,factory:Dc.\u0275fac})};return t=x([w(Ou)],t),t})(),n2=[QR,JR,t2];function i2(t){return!!t&&typeof t.destroy=="function"}var Ye=(()=>{class t{_injector=l(Xe);_dragInjector=null;_created=[];create(){this._dragInjector=Xe.create({providers:[{provide:Nu,useClass:Nu},{provide:$l,useClass:$l},{provide:Bl,useClass:Bl},{provide:Wh,useClass:Wh},{provide:qo,useClass:qo},{provide:Go,useClass:Go},{provide:Uo,useClass:Uo},{provide:jo,useClass:jo},{provide:kn,useClass:kn},{provide:vu,useClass:vu},{provide:dm,useClass:dm},{provide:um,useClass:um},{provide:fm,useClass:fm},{provide:hm,useClass:hm}],parent:this._injector}),this._created=[]}get(e){if(!this._dragInjector)throw new Error("DragHandlerInjector has not been created. Call create() before using get().");return this._dragInjector.get(e)}createInstance(e){if(!this._dragInjector)throw new Error("DragHandlerInjector is not created");let n=hg(this._dragInjector,()=>new e);return this._created.push(n),n}destroy(){for(let e of this._created)i2(e)&&e.destroy();this._created=[],this._dragInjector?.destroy?.(),this._dragInjector=null}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Mn=(()=>{class t{_data;setData(e){this._data=de(de({},this._data),e)}getData(){return this._data}clear(){this._data=void 0}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),G0="f-canvas-dragging",j0="canvas-dragging",Nu=(()=>{class t extends ot{type="canvas-move";kind="drag-canvas";_store=l(M);_onPointerDownPosition=A.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(G0,j0)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(Z.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(G0,j0)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),o2=(()=>{let t=class Oc{_dragContext=l(Q);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(n=>n.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Nu)}static \u0275fac=function(n){return new(n||Oc)};static \u0275prov=y({token:Oc,factory:Oc.\u0275fac})};return t=x([w(Nl)],t),t})(),Ru=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},r2=(()=>{let t=class Nc{_store=l(M);_dragContext=l(Q);_dragInjector=l(Ye);handle({event:e,fTrigger:n}){!this._isValid(e)||!this._isValidTrigger(e,n)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=Z.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Nu)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(Se.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));return n&&n.fDraggingDisabled()&&(n=void 0),n}_isValidTrigger(e,n){return bt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Nc)};static \u0275prov=y({token:Nc,factory:Nc.\u0275fac})};return t=x([w(Ru)],t),t})(),a2=[o2,r2],Au=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(i,e){this.event=i,this.trigger=e}},s2=(()=>{let t=class Rc{_mediator=l(D);_store=l(M);_dragSession=l(Q);handle({event:e,trigger:n}){if(!this._isSelectionAllowed(e))return;let o=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(o),bt(e.originalEvent,n)?this._applyToggleSelect(o):this._applySingleSelect(o)}_isSelectionAllowed(e){return this._store.flowHost.contains(e.targetElement)&&this._dragSession.isEmpty()}_resolveSelectable(e){return this._findNodeOrGroupAt(e)??this._findConnectionAt(e)}_findNodeOrGroupAt(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_findConnectionAt(e){return this._store.connections.getAll().find(n=>n.isContains(e))}_deferRaiseLayerFor(e){e&&queueMicrotask(()=>{this._mediator.execute(new si(e,e.hostElement.parentElement))})}_applySingleSelect(e){if(!e||e.fSelectionDisabled()){this._clearSelection();return}e.isSelected()||(this._clearSelection(),this._select(e))}_applyToggleSelect(e){!e||e.fSelectionDisabled()||(e.isSelected()?this._deselect(e):this._select(e))}_clearSelection(){if(this._dragSession.selectedItems.length){for(let e of this._dragSession.selectedItems)e.unmarkAsSelected();this._dragSession.markSelectionAsChanged(),this._dragSession.selectedItems=[]}}_select(e){this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.markSelectionAsChanged()}_deselect(e){let n=this._dragSession.selectedItems.indexOf(e);n>=0&&this._dragSession.selectedItems.splice(n,1),e.unmarkAsSelected(),this._dragSession.markSelectionAsChanged()}static \u0275fac=function(n){return new(n||Rc)};static \u0275prov=y({token:Rc,factory:Rc.\u0275fac})};return t=x([w(Au)],t),t})(),c2=[s2];var mm=class extends Ah{hostElement=l(Re).nativeElement};function d2(t){return xo(t,".f-drag-blocker")}var Dv=(()=>{class t extends mm{_result=l(Mn);_mediator=l(D);_platform=l(Xf);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===Cn.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=Et;fCreateConnectionTrigger=Et;fConnectionWaypointsTrigger=O(Et);fMoveControlPointTrigger=Et;fNodeResizeTrigger=Et;fNodeRotateTrigger=Et;fNodeMoveTrigger=Et;fCanvasMoveTrigger=Et;fExternalItemTrigger=Et;fSelectionChange=new lt;fNodeIntersectedWithConnections=new lt;fNodeConnectionsIntersection=Be();fEmitOnNodeIntersect=!1;fCreateNode=new lt;fMoveNodes=new lt;fReassignConnection=new lt;fCreateConnection=new lt;fConnectionWaypointsChanged=Be();fDropToGroup=new lt;vCellSize=O(1,{transform:e=>Ke(e,1)});hCellSize=O(1,{transform:e=>Ke(e,1)});fCellSizeWhileDragging=O(!1,{transform:e=>me(e)});fDragStarted=new lt;fDragEnded=new lt;_dragHandlerInjector=l(Ye);ngOnInit(){this._mediator.execute(new zu(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(d2(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new Vu),this._mediator.execute(new bu(e)),this._mediator.execute(new Ou(e)),this._mediator.execute(new yu(e)),this._mediator.execute(new Au(e,this.fMultiSelectTrigger)),this._mediator.execute(new Gl(e,this.fReassignConnectionTrigger)),this._mediator.execute(new Vl(e,this.fCreateConnectionTrigger)),this._mediator.execute(new Kl(e,this.fConnectionWaypointsTrigger()));let n=e.isMouseLeftButton();return n||this.finalizeDragSequence(),n}prepareDragSequence(e){this._mediator.execute(new Eu(e,this.fNodeResizeTrigger)),this._mediator.execute(new Mu(e,this.fNodeRotateTrigger)),this._mediator.execute(new cu(e,this.fNodeMoveTrigger)),this._mediator.execute(new mu(e,this.fExternalItemTrigger)),this._mediator.execute(new du(e)),this._mediator.execute(new Ru(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Hu)}onSelect(e){this._mediator.execute(new _u(e))}onPointerMove(e){this._mediator.execute(new qu(e))}onPointerUp(e){this._mediator.execute(new Du(e)),this._mediator.execute(new Cu(e)),this._mediator.execute(new Hl(e)),this._mediator.execute(new Ll(e)),this._mediator.execute(new Tu(e)),this._mediator.execute(new ku(e)),this._mediator.execute(new su(e)),this._mediator.execute(new fu(e)),this._mediator.execute(new Yl(e)),this._mediator.execute(new Nl(e)),this._mediator.execute(new gu(e)),this._mediator.execute(new Ul(e)),this._mediator.execute(new El)}finalizeDragSequence(){this._mediator.execute(new Pn),this._mediator.execute(new Fo),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new Pn),this._mediator.execute(new Gu),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",me],fMultiSelectTrigger:"fMultiSelectTrigger",fReassignConnectionTrigger:"fReassignConnectionTrigger",fCreateConnectionTrigger:"fCreateConnectionTrigger",fConnectionWaypointsTrigger:[1,"fConnectionWaypointsTrigger"],fMoveControlPointTrigger:"fMoveControlPointTrigger",fNodeResizeTrigger:"fNodeResizeTrigger",fNodeRotateTrigger:"fNodeRotateTrigger",fNodeMoveTrigger:"fNodeMoveTrigger",fCanvasMoveTrigger:"fCanvasMoveTrigger",fExternalItemTrigger:"fExternalItemTrigger",fEmitOnNodeIntersect:[2,"fEmitOnNodeIntersect","fEmitOnNodeIntersect",me],vCellSize:[1,"vCellSize"],hCellSize:[1,"hCellSize"],fCellSizeWhileDragging:[1,"fCellSizeWhileDragging"]},outputs:{fSelectionChange:"fSelectionChange",fNodeIntersectedWithConnections:"fNodeIntersectedWithConnections",fNodeConnectionsIntersection:"fNodeConnectionsIntersection",fCreateNode:"fCreateNode",fMoveNodes:"fMoveNodes",fReassignConnection:"fReassignConnection",fCreateConnection:"fCreateConnection",fConnectionWaypointsChanged:"fConnectionWaypointsChanged",fDropToGroup:"fDropToGroup",fDragStarted:"fDragStarted",fDragEnded:"fDragEnded"},exportAs:["fDraggable"],standalone:!1,features:[ge([Mn,Ye]),he]})}return t})(),l2=[...a2,...qN,...cN,...c2,...xR,..._N,...n2,...cR,...SR,...UR,...ZR,...OR,...kR],u2=(()=>{let t=class Ac{_store=l(M);handle({waypointIndex:e,connectionId:n}){let o=this._store.connections.require(n),r=o.fWaypoints()?.waypoints().slice();if(!r)throw new Error("Connection waypoints not found");r.splice(e,1),o.fWaypoints()?.waypoints.set(r),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._changeEvent(o))}_changeEvent(e){return new Wl(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(n){return new(n||Ac)};static \u0275prov=y({token:Ac,factory:Ac.\u0275fac})};return t=x([w(Dh)],t),t})(),_m=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},p2=(()=>{let t=class Fc{_store=l(M);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(n){return new(n||Fc)};static \u0275prov=y({token:Fc,factory:Fc.\u0275fac})};return t=x([w(_m)],t),t})(),f2=[bp,ci,aD,sD,cD,dD,tO,DO,aO,IO,zO,BO,MO,VO,GO,HO,kO,FO,sO,$O,PO,EO,TO,CO,SO,bO,xO,qO,RO,jO,UO,LO,AO,WO,KO,YO,XO,p2,u2],Yo=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(i){this.instance=i}},h2=(()=>{let t=class Lc{_store=l(M);_mediator=l(D);handle({instance:e}){switch(e.kind){case"input":this._addInput(e);break;case"output":this._addOutput(e);break;case"outlet":this._addOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_addInput(e){this._store.inputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutput(e){this._store.outputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutlet(e){this._store.outlets.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_geometryRegister(e){this._mediator.execute(new sl(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(n){return new(n||Lc)};static \u0275prov=y({token:Lc,factory:Lc.\u0275fac})};return t=x([w(Yo)],t),t})(),ri=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(i,e){this.position=i,this.connectorRefs=e}},m2=(()=>{let t=class Bc{handle({position:e,connectorRefs:n}){let o,r=1/0;for(let a of n){let s=this._distanceToRect(e,a.rect);s<r&&(r=s,o=a)}return o?jn(de({},o),{distance:r}):void 0}_distanceToRect(e,{x:n,y:o,width:r,height:a}){let s=this._clamp(e.x,n,n+r),c=this._clamp(e.y,o,o+a),u=e.x-s,p=e.y-c;return Math.sqrt(u*u+p*p)}_clamp(e,n,o){return Math.max(n,Math.min(o,e))}static \u0275fac=function(n){return new(n||Bc)};static \u0275prov=y({token:Bc,factory:Bc.\u0275fac})};return t=x([w(ri)],t),t})(),Xo=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(i,e){this.pointerPosition=i,this.connectableConnectors=e}},_2=(()=>{let t=class zc{_mediator=l(D);_store=l(M);_browser=l(qe);get _transform(){return this._store.transform}get _flowHost(){return this._store.flowHost}get _fNodes(){return this._store.nodes.getAll()}get _snapConnection(){return this._store.connections.getForSnap()}handle(e){let n=this._findConnectorAtPosition(e);return n.length>0?n[0]:void 0}_findConnectorAtPosition(e){let n=[];n.push(...this._filterConnectorsThatLocatedAtPosition(e));let o=this._isSnapConnectionEnabledAndHasClosestConnector(e);o&&n.unshift(o.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&n.push(r),n}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(n=>G.isIncludePoint(n.rect,this._calculatePointerInFlow(e.pointerPosition))).map(n=>n.connector)}_calculatePointerInFlow(e){return Zi(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let n=this._mediator.execute(new ri(this._calculatePointerInFlow(e.pointerPosition),e.connectableConnectors));return this._isValidClosestInput(n)?n:void 0}_isValidClosestInput(e){return!!e&&e.distance<this._snapConnection.fSnapThreshold}_getFirstConnectableConnectorOfNodeAtPosition(e){return this._getElementsFromPoint(e.pointerPosition).map(n=>this._findConnectableNode(n)).filter(n=>!!n).map(n=>this._findFirstConnectableConnectorOfNode(e.connectableConnectors,n)).find(n=>!!n)}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y)}_findConnectableNode(e){return this._fNodes.find(n=>n.isContains(e)&&n.fConnectOnNode())}_findFirstConnectableConnectorOfNode(e,n){return e.find(o=>o.connector.fNodeId===n.fId())?.connector}static \u0275fac=function(n){return new(n||zc)};static \u0275prov=y({token:zc,factory:zc.\u0275fac})};return t=x([w(Xo)],t),t})(),Zo=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(i,e){this.source=i,this.pointer=e}},pt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(i){this.connector=i}},g2=(()=>{let t=class qc{_mediator=l(D);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new En(e.hostElement))}static \u0275fac=function(n){return new(n||qc)};static \u0275prov=y({token:qc,factory:qc.\u0275fac})};return t=x([w(pt)],t),t})(),Qo=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(i){this.nodeOrGroup=i}},v2=(()=>{let t=class Vc{_store=l(M);_mediator=l(D);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new cl(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Vc)};static \u0275prov=y({token:Vc,factory:Vc.\u0275fac})};return t=x([w(Qo)],t),t})(),Fu=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},y2=(()=>{let t=class Hc{_store=l(M);handle({nodeOrGroup:e}){let n=this._collectInputIds(e);return this._collectConnections(n)}_collectInputIds(e){let n=new Set,o=this._store.inputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fInputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||Hc)};static \u0275prov=y({token:Hc,factory:Hc.\u0275fac})};return t=x([w(Fu)],t),t})(),Hi=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(i,e){this.connector=i,this.pointerPosition=e}},U0=2,Ze=(function(t){return t[t.NONE=0]="NONE",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.TOP=4]="TOP",t[t.BOTTOM=8]="BOTTOM",t[t.ALL=15]="ALL",t})(Ze||{});function C2(t,i,e,n,o){let r=b2(o),a=e-t,s=n-i,c=x2(a,s);return w2(c,r)?c:S2(a,s,r,c)}function b2(t){if(!t||t.length===0)return Ze.ALL;let i=Ze.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case F.LEFT:i|=Ze.LEFT;break;case F.RIGHT:i|=Ze.RIGHT;break;case F.TOP:i|=Ze.TOP;break;case F.BOTTOM:i|=Ze.BOTTOM;break}return i||Ze.ALL}function x2(t,i){let e=t<0?-t:t,n=i<0?-i:i;return e-n>U0?t<0?F.LEFT:F.RIGHT:(n-e>U0,i<0?F.TOP:F.BOTTOM)}function w2(t,i){switch(t){case F.LEFT:return(i&Ze.LEFT)!==0;case F.RIGHT:return(i&Ze.RIGHT)!==0;case F.TOP:return(i&Ze.TOP)!==0;case F.BOTTOM:return(i&Ze.BOTTOM)!==0;default:return!0}}function S2(t,i,e,n){let o=n,r=-1/0;if(e&Ze.RIGHT){let a=t;a>r&&(r=a,o=F.RIGHT)}if(e&Ze.LEFT){let a=-t;a>r&&(r=a,o=F.LEFT)}if(e&Ze.BOTTOM){let a=i;a>r&&(r=a,o=F.BOTTOM)}if(e&Ze.TOP){let a=-i;a>r&&(r=a,o=F.TOP)}return o}function Lu(t){return t===F.CALCULATE||t===F.CALCULATE_HORIZONTAL||t===F.CALCULATE_VERTICAL}var I2={[F.CALCULATE]:[F.TOP,F.BOTTOM,F.LEFT,F.RIGHT],[F.CALCULATE_HORIZONTAL]:[F.LEFT,F.RIGHT],[F.CALCULATE_VERTICAL]:[F.TOP,F.BOTTOM]},T2=(()=>{let t=class Gc{_mediator=l(D);handle({connector:e,pointerPosition:n}){let o=e.userFConnectableSide,r=this._getConnectorRect(e.hostElement).gravityCenter,a=this._accumulateConnectedCenters(e.hostElement,e.toConnector,n),s=a.sumX/a.count,c=a.sumY/a.count;return C2(r.x,r.y,s,c,I2[o])}_accumulateConnectedCenters(e,n,o){let r=o?.x||0,a=o?.y||0,s=o?1:0;if(n&&n.length)for(let c=0;c<n.length;c++){let u=n[c].hostElement;if(u===e)continue;let p=this._getConnectorRect(u).gravityCenter;r+=p.x,a+=p.y,s++}return{sumX:r,sumY:a,count:s}}_getConnectorRect(e){return this._mediator.execute(new Fe(e))}static \u0275fac=function(n){return new(n||Gc)};static \u0275prov=y({token:Gc,factory:Gc.\u0275fac})};return t=x([w(Hi)],t),t})(),Bu=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(i){this.connector=i}},zu=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(i){this.fComponent=i}},E2=(()=>{let t=class jc{_store=l(M);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(n){return new(n||jc)};static \u0275prov=y({token:jc,factory:jc.\u0275fac})};return t=x([w(zu)],t),t})(),qu=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(i){this.event=i}},P2=(()=>{let t=class Uc{_mediator=l(D);_store=l(M);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=l(Q);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new Lo)}_setDifferenceToDraggableItems(e,n){this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(de({},e),n)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return Z.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(n){return new(n||Uc)};static \u0275prov=y({token:Uc,factory:Uc.\u0275fac})};return t=x([w(qu)],t),t})(),Vu=class{static fToken=Symbol("InitializeDragSequenceRequest")},k2=(()=>{let t=class Wc{_dragContext=l(Q);handle(e){this._dragContext.reset()}static \u0275fac=function(n){return new(n||Wc)};static \u0275prov=y({token:Wc,factory:Wc.\u0275fac})};return t=x([w(Vu)],t),t})(),Dn=class{static fToken=Symbol("IsDragStartedRequest")},M2=(()=>{let t=class $c{_store=l(M);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(n){return new(n||$c)};static \u0275prov=y({token:$c,factory:$c.\u0275fac})};return t=x([w(Dn)],t),t})(),Hu=class{static fToken=Symbol("PrepareDragSequenceRequest")},D2=(()=>{let t=class Kc{_mediator=l(D);_dragContext=l(Q);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new Pl)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(n){return new(n||Kc)};static \u0275prov=y({token:Kc,factory:Kc.\u0275fac})};return t=x([w(Hu)],t),t})(),Gu=class{static fToken=Symbol("RemoveDndFromStoreRequest")},O2=(()=>{let t=class Yc{_store=l(M);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(n){return new(n||Yc)};static \u0275prov=y({token:Yc,factory:Yc.\u0275fac})};return t=x([w(Gu)],t),t})(),N2=[E2,P2,k2,D2,M2,O2],R2=new ue("CONNECTABLE_SIDE_EPSILON"),A2=(()=>{let t=class Xc{_mediator=l(D);_lastSide=new WeakMap;_epsilon=Math.max(0,l(R2,{optional:!0})??2);handle({connector:e}){if(this._isDragging()){let o=this._lastSide.get(e);if(o!==void 0)return o;let r=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,r),r}let n=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,n),n}_getSideByDelta(e,n,o){let r=G.fromElement(e),a=n.getBoundingClientRect(),s=r.gravityCenter.x,c=r.gravityCenter.y,u=s-a.left,p=a.right-s,_=c-a.top,b=a.bottom-c,k=0,P=u,N=[u,p,_,b];for(let U=1;U<4;U++){let oe=N[U];oe<P&&(P=oe,k=U)}let j=k===0?F.LEFT:k===1?F.RIGHT:k===2?F.TOP:F.BOTTOM,z=this._lastSide.get(o);if(z!==void 0&&z!==j){let U=z===F.LEFT?0:z===F.RIGHT?1:z===F.TOP?2:3;(U===0?u:U===1?p:U===2?_:b)-P<=this._epsilon&&(j=z)}return j}_isDragging(){return this._mediator.execute(new Dn)}static \u0275fac=function(n){return new(n||Xc)};static \u0275prov=y({token:Xc,factory:Xc.\u0275fac})};return t=x([w(Bu)],t),t})(),Gi=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(i){this.nodeOrGroup=i}},F2=(()=>{let t=class Zc{_mediator=l(D);handle({nodeOrGroup:e}){let n=e.connectors,o=n.length;for(let a=0;a<o;a++){let s=n[a];s.fConnectableSide=this._resolveSideForConnectorFast(s)}let r=new Set;for(let a=0;a<o;a++){let c=n[a].toConnector;if(c&&c.length)for(let u=0,p=c.length;u<p;u++){let _=c[u],b=_.userFConnectableSide;Lu(b)&&r.add(_)}}r.size>0&&r.forEach(a=>{a.fConnectableSide=this._calculateByConnectedPositions(a)})}_resolveSideForConnectorFast(e){let n=e.userFConnectableSide;return n===F.AUTO?this._mediator.execute(new Bu(e)):Lu(n)?this._calculateByConnectedPositions(e):n}_calculateByConnectedPositions(e){return this._mediator.execute(new Hi(e))}static \u0275fac=function(n){return new(n||Zc)};static \u0275prov=y({token:Zc,factory:Zc.\u0275fac})};return t=x([w(Gi)],t),t})(),ji=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},L2=(()=>{let t=class Qc{_store=l(M);handle(e){return G.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>G.fromElement(e.hostElement))}static \u0275fac=function(n){return new(n||Qc)};static \u0275prov=y({token:Qc,factory:Qc.\u0275fac})};return t=x([w(ji)],t),t})(),ju=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(i){this.fNodes=i}},B2=(()=>{let t=class Jc{_store=l(M);_mediator=l(D);handle(e){return G.union(this._getNodesRects(e.fNodes||this._store.nodes.getAll()))}_getNodesRects(e){return e.map(n=>this._getNodeRect(n))}_getNodeRect(e){let n=this._mediator.execute(new qi(e.hostElement));if(n)return this._getElementRect(e,n);let o=this._mediator.execute(new Fe(e.hostElement));return this._getElementRect(e,o)}_getElementRect(e,n){return G.initialize(e._position.x,e._position.y,n.width,n.height)}static \u0275fac=function(n){return new(n||Jc)};static \u0275prov=y({token:Jc,factory:Jc.\u0275fac})};return t=x([w(ju)],t),t})(),Uu=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},z2=(()=>{let t=class ed{_store=l(M);handle({nodeOrGroup:e}){let n=this._collectOutputIds(e);return this._collectConnections(n)}_collectOutputIds(e){let n=new Set,o=this._store.outputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fOutputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||ed)};static \u0275prov=y({token:ed,factory:ed.\u0275fac})};return t=x([w(Uu)],t),t})(),Jo=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(i){this.nodeOrGroup=i}},ai=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(i,e){this.fNode=i,this.rect=e}},q2=(()=>{let t=class td{_browser=l(qe);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,n){let o=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(o.paddingLeft,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingTop,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingRight,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingBottom,n.width,n.height,o.fontSize)]}static \u0275fac=function(n){return new(n||td)};static \u0275prov=y({token:td,factory:td.\u0275fac})};return t=x([w(ai)],t),t})(),V2=(()=>{let t=class nd{_mediator=l(D);_store=l(M);get _nodes(){return this._store.nodes.getAll()}handle({nodeOrGroup:e}){if(e.fAutoSizeToFitChildren()){let r=this._calculateDirectChildren(e);if(r.length){let a=this._boundingRect(e),s=this._calculateChildrenBounding(r,this._paddings(e,a));e.updatePosition(s),e.updateSize(s),e.redraw()}}let n=e.fParentId();if(!n)return;let o=this._nodes.find(r=>r.fId()===n);o&&this._mediator.execute(new Jo(o))}_calculateDirectChildren(e){return this._nodes.filter(n=>n.fParentId()===e.fId())}_unionRect(e){return G.union(e.map(n=>this._boundingRect(n)))||G.initialize()}_boundingRect(e){return this._mediator.execute(new Fe(e.hostElement))}_paddings(e,n){return this._mediator.execute(new ai(e,n))}_calculateChildrenBounding(e,[n,o,r,a]){let s=this._unionRect(e);return s=G.initialize(s.x-n,s.y-o,s.width+n+r,s.height+o+a),s}static \u0275fac=function(n){return new(n||nd)};static \u0275prov=y({token:nd,factory:nd.\u0275fac})};return t=x([w(Jo)],t),t})(),Wu=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(i){this.id=i}},H2=(()=>{let t=class id{_store=l(M);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let n=new Set,o=[];return this._collectDescendants(e.id,o,n),o}_collectDescendants(e,n,o){if(o.has(e))throw new Error(`Circular reference detected in the node hierarchy. Node id: ${e}`);o.add(e);let r=this._allNodesAndGroups.filter(a=>a.fParentId()===e).map(a=>a.fId());n.push(...r);for(let a of r)this._collectDescendants(a,n,o)}static \u0275fac=function(n){return new(n||id)};static \u0275prov=y({token:id,factory:id.\u0275fac})};return t=x([w(Wu)],t),t})(),Ui=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(i){this.nodeOrGroup=i}},G2=(()=>{let t=class od{_store=l(M);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,n,o){if(n.has(e.fId()))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e.fId());n.add(e.fId());let r=this._store.nodes.get(e.fParentId());return r?(o.push(r),this._getParentNodes(r,n,o)):o}static \u0275fac=function(n){return new(n||od)};static \u0275prov=y({token:od,factory:od.\u0275fac})};return t=x([w(Ui)],t),t})(),er=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(i,e){this.nodeOrGroup=i,this.destroyRef=e}},j2=(()=>{let t=class rd{_mediator=l(D);handle({nodeOrGroup:e,destroyRef:n}){let{hostElement:o,stateChanges:r}=e;new zt(new lh(o),r).listen(n,()=>{this._mediator.execute(new Jn),this._isDragging()||(this._mediator.execute(new zi(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new Gi(e)),this._mediator.execute(new Jo(e)))})}_isDragging(){return this._mediator.execute(new Dn)}static \u0275fac=function(n){return new(n||rd)};static \u0275prov=y({token:rd,factory:rd.\u0275fac})};return t=x([w(er)],t),t})(),tr=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(i){this.instance=i}},U2=(()=>{let t=class ad{_store=l(M);_mediator=l(D);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new dl(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||ad)};static \u0275prov=y({token:ad,factory:ad.\u0275fac})};return t=x([w(tr)],t),t})(),W2=[v2,T2,A2,y2,F2,L2,B2,z2,V2,H2,q2,G2,j2,U2],$2=(()=>{let t=class sd{_mediator=l(D);_store=l(M);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:n}){let o=this._getConnectableTargets(e),r=[];for(let a of o)r.push(this._mediator.execute(new pt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(o=>e.canConnectTo(o));let n=this._targets.filter(o=>o.canBeConnected);return e.isSelfConnectable||(n=n.filter(o=>o.fNodeId!==e.fNodeId)),n}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Lu(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Hi(e,n))}static \u0275fac=function(n){return new(n||sd)};static \u0275prov=y({token:sd,factory:sd.\u0275fac})};return t=x([w(Zo)],t),t})(),$u=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(i,e){this.target=i,this.pointer=e}},K2=(()=>{let t=class cd{_mediator=l(D);_store=l(M);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:n}){let o=this._getConnectableSources(e),r=[];for(let a of o)r.push(this._mediator.execute(new pt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableSources(e){return this._sources.filter(n=>{let o=n.canBeConnected;return o&&n.hasConnectionLimits&&(o=n.canConnectTo(e)),o})}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Lu(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Hi(e,n))}static \u0275fac=function(n){return new(n||cd)};static \u0275prov=y({token:cd,factory:cd.\u0275fac})};return t=x([w($u)],t),t})(),Wi=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},je={DRAG_AND_DROP:{DRAGGING:"f-dragging",CONNECTIONS_DRAGGING:"f-connections-dragging"},GROUPING:{OVER_BOUNDARY:"f-grouping-over-boundary",DROP_ACTIVE:"f-grouping-drop-active"},CONNECTOR:{OUTPUT_CONNECTED:"f-node-output-connected",OUTPUT_NOT_CONNECTABLE:"f-node-output-not-connectable",INPUT_CONNECTED:"f-node-input-connected",INPUT_NOT_CONNECTABLE:"f-node-input-not-connectable",CONNECTABLE:"f-connector-connectable"}},Y2=(()=>{let t=class dd{_store=l(M);handle({connectors:e}){this._store.flowHost.classList.add(je.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._markConnector(n))}_markConnector({hostElement:e}){e.classList.add(je.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||dd)};static \u0275prov=y({token:dd,factory:dd.\u0275fac})};return t=x([w(Wi)],t),t})(),nr=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(i){this.instance=i}},X2=(()=>{let t=class ld{_store=l(M);_mediator=l(D);handle({instance:e}){switch(e.kind){case"input":this._removeInput(e);break;case"output":this._removeOutput(e);break;case"outlet":this._removeOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_removeInput(e){this._store.inputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutput(e){this._store.outputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutlet(e){this._store.outlets.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_geometryUnregister(e){this._mediator.execute(new Eo(e.fId(),e.kind))}static \u0275fac=function(n){return new(n||ld)};static \u0275prov=y({token:ld,factory:ld.\u0275fac})};return t=x([w(nr)],t),t})(),$i=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},Z2=(()=>{let t=class ud{_store=l(M);handle({connectors:e}){this._store.flowHost.classList.remove(je.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._unmarkConnector(n))}_unmarkConnector({hostElement:e}){e.classList.remove(je.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||ud)};static \u0275prov=y({token:ud,factory:ud.\u0275fac})};return t=x([w($i)],t),t})(),Q2=[h2,X2,m2,_2,K2,$2,g2,Y2,Z2],Ku=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(i){this.instance=i}},di=(function(t){return t.TOP_BOTTOM="TOP_BOTTOM",t.BOTTOM_TOP="BOTTOM_TOP",t.LEFT_RIGHT="LEFT_RIGHT",t.RIGHT_LEFT="RIGHT_LEFT",t})(di||{}),bn=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(bn||{});function J2(t){let i=[...t.nodes.map(W0),...t.groups.map(W0)],e=new Set(t.nodes.map(s=>s.id)),n=new Set(t.groups.map(s=>s.id)),o=new Map,r=new Map;for(let s of[...t.nodes,...t.groups]){for(let c of s.fOutputs)o.set(c.id,s.id);for(let c of s.fInputs)r.set(c.id,s.id)}let a=t.connections.reduce((s,c)=>{let u=o.get(c.fOutputId),p=r.get(c.fInputId);return!u||!p||s.push({source:u,target:p}),s},[]);return{nodes:i,connections:a,nodeIds:e,groupIds:n}}function W0(t){return{id:t.id,size:t.measuredSize?de({},t.measuredSize):t.size?de({},t.size):void 0}}var eA=1,Sp=(()=>{class t{_destroyRef=l(at);_flows=new Map;_engine;constructor(){this._destroyRef.onDestroy(()=>{Array.from(this._flows.keys()).forEach(e=>this.unregisterFlow(e)),this._engine=void 0})}attachEngine(e){this._engine=e}registerFlow(e,n){let o=e.fId();this.unregisterFlow(o);let r={flow:e,store:n,nodeSignature:this._buildNodeSignature(n),connectionSignature:this._buildConnectionSignature(n),timeoutId:null,raf1:null,raf2:null,unsubs:[],runId:0,isApplying:!1};r.unsubs.push(n.nodesChanges$.listen(()=>this._handleNodesChanges(o)),n.connectionsChanges$.listen(()=>this._handleConnectionsChanges(o))),this._flows.set(o,r),this._engine?.getMode()===bn.AUTO&&this._scheduleRelayout(o)}unregisterFlow(e){let n=this._flows.get(e);n&&(n.unsubs.forEach(o=>o()),this._clearScheduledWork(n),this._flows.delete(e))}handleModeChanged(e){if(e===bn.AUTO)for(let n of this._flows.keys())this._scheduleRelayout(n)}async relayout(e){if(this._engine){if(e){let n=this._flows.get(e);n&&await this._relayoutRegisteredFlow(e,n);return}for(let[n,o]of this._flows.entries())await this._relayoutRegisteredFlow(n,o)}}_handleNodesChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildNodeSignature(n.store);o!==n.nodeSignature&&(n.nodeSignature=o,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildConnectionSignature(n.store);o!==n.connectionSignature&&(n.connectionSignature=o,this._scheduleRelayout(e))}_scheduleRelayout(e){let n=this._flows.get(e);!n||!this._engine||this._engine.getMode()!==bn.AUTO||(n.timeoutId!==null&&clearTimeout(n.timeoutId),this._cancelAnimationFrames(n),n.timeoutId=setTimeout(()=>{n.timeoutId=null,this._runAfterNextPaint(n,()=>{this._relayoutFlowIfReady(e)})},eA))}async _relayoutFlowIfReady(e){let n=this._flows.get(e);if(!(!n||!this._engine||this._engine.getMode()!==bn.AUTO)){if(n.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,n)}}async _relayoutRegisteredFlow(e,n){if(!this._engine)return;let o=J2(n.flow.getState({measuredSize:!0})),r=++n.runId,a=await this._engine.calculate(o.nodes,o.connections,{flowId:e,mode:this._engine.getMode()}),s=this._flows.get(e);if(!(!s||s.runId!==r||!this._applyPositions(s.store,a.nodes).length)){s.isApplying=!0;try{s.flow.redraw(),this._emitWriteback(e,a.nodes,o.nodeIds,o.groupIds)}finally{queueMicrotask(()=>{let u=this._flows.get(e);u&&(u.isApplying=!1)})}}}_emitWriteback(e,n,o,r){let a=this._engine?.getWriteback();a&&a({flowId:e,nodes:n.filter(s=>o.has(s.id)),groups:n.filter(s=>r.has(s.id))})}_applyPositions(e,n){return n.filter(o=>{let r=e.nodes.get(o.id);return!r||A.isEqual(r._position,o.position)?!1:(r.position.set(de({},o.position)),!0)})}_buildNodeSignature(e){return e.nodes.getAll().map(n=>n.fId()).sort().join("|")}_buildConnectionSignature(e){return e.connections.getAll().map(n=>`${n.fId()}:${n.fOutputId()}:${n.fInputId()}`).sort().join("|")}_runAfterNextPaint(e,n){if(this._cancelAnimationFrames(e),typeof requestAnimationFrame!="function"){n();return}e.raf1=requestAnimationFrame(()=>{e.raf1=null,e.raf2=requestAnimationFrame(()=>{e.raf2=null,n()})})}_clearScheduledWork(e){e.timeoutId!==null&&(clearTimeout(e.timeoutId),e.timeoutId=null),this._cancelAnimationFrames(e)}_cancelAnimationFrames(e){e.raf1!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf1),e.raf1=null),e.raf2!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf2),e.raf2=null)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ov=new ue("F_LAYOUT_OPTIONS");function Nv(t,i){return t.reduce((e,n)=>{let o=i.get(n.id);return o&&e.push({id:n.id,position:o}),e},[])}var tA=new ue("F_LAYOUT"),Yu=class{_controller=l(Sp);_config=l(Ov,{optional:!0})??{};_interactiveOptions;_mode;_writeback;_defaultOptions;interactiveOptions;constructor(i){this._mode=this._config.mode??bn.MANUAL,this._writeback=this._config.writeback??null,this._defaultOptions=this.mergeOptions(i,this._config.options),this._interactiveOptions=H(this.mergeOptions(this._defaultOptions,{})),this.interactiveOptions=S(()=>this.mergeOptions(this._interactiveOptions(),{})),this._controller.attachEngine(this)}setMode(i){this._mode=i,this._controller.handleModeChanged(i)}getMode(){return this._mode}setWriteback(i){this._writeback=i}getWriteback(){return this._writeback}setInteractiveOptions(i){this._interactiveOptions.set(this.mergeOptions(this._interactiveOptions(),i))}relayout(i){return this._controller.relayout(i)}getProviderConfig(){return de({},this._config)}resolveLayoutOptions(i){let e=de({},i??{});return delete e.flowId,delete e.mode,this.mergeOptions(this._interactiveOptions(),e)}};function Rv(t,i){return[Sp,t,{provide:tA,useExisting:t},{provide:Ov,useValue:i??{}}]}var nA=(()=>{let t=class pd{_store=l(M);_layoutController=l(Sp,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(n){return new(n||pd)};static \u0275prov=y({token:pd,factory:pd.\u0275fac})};return t=x([w(Ku)],t),t})(),Xu=class{static fToken=Symbol("GetFlowRequest")},iA=(()=>{let t=class fd{_store=l(M);handle(e){let n=this._store.fFlow;if(!n)throw new Error("Flow not found in store");return n}static \u0275fac=function(n){return new(n||fd)};static \u0275prov=y({token:fd,factory:fd.\u0275fac})};return t=x([w(Xu)],t),t})(),Zu=class{static fToken=Symbol("CalculateConnectionsStateRequest")},oA=(()=>{let t=class hd{_store=l(M);handle(e){return this._store.connections.getAll().map(this._mapToConnectionState)}_mapToConnectionState(e){return{id:e.fId(),fOutputId:e.fOutputId(),fInputId:e.fInputId(),fType:e.fType,fBehavior:e.fBehavior,isSelected:e.isSelected(),waypoints:e.fWaypoints()?.waypoints()||[],fInputSide:e.fInputSide(),fOutputSide:e.fOutputSide()}}static \u0275fac=function(n){return new(n||hd)};static \u0275prov=y({token:hd,factory:hd.\u0275fac})};return t=x([w(Zu)],t),t})(),ir=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(i,e=!1){this.component=i,this.measuredSize=e}},rA=(()=>{let t=class md{_store=l(M);_mediator=l(D);handle({component:e,measuredSize:n}){return this._store.nodes.getAll().filter(o=>o instanceof e).map(o=>{let r=n?this._mediator.execute(new Fe(o.hostElement)):null;return{id:o.fId(),parentId:o.fParentId()??void 0,position:de({},o._position),size:o._size?de({},o._size):void 0,measuredSize:r?{width:r.width,height:r.height}:void 0,rotate:o._rotate,fOutputs:this._getOutputs(o.hostElement),fInputs:this._getInputs(o.hostElement),isSelected:o.isSelected()}})}_getOutputs(e){return this._store.outputs.getAll().filter(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}_getInputs(e){return this._store.inputs.getAll().filter(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}static \u0275fac=function(n){return new(n||md)};static \u0275prov=y({token:md,factory:md.\u0275fac})};return t=x([w(ir)],t),t})(),Qu=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(i=!1){this.measuredSize=i}},aA=(()=>{let t=class _d{_mediator=l(D);_store=l(M);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return A.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new ir(wp,e)),groups:this._mediator.execute(new ir(Vh,e)),connections:this._mediator.execute(new Zu)}}static \u0275fac=function(n){return new(n||_d)};static \u0275prov=y({token:_d,factory:_d.\u0275fac})};return t=x([w(Qu)],t),t})(),sA=[aA,rA,oA],Ju=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(i){this.instance=i}},cA=(()=>{let t=class gd{_store=l(M);_layoutController=l(Sp,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(n){return new(n||gd)};static \u0275prov=y({token:gd,factory:gd.\u0275fac})};return t=x([w(Ju)],t),t})(),Ip=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ep=class{static fToken=Symbol("NotifyNodesRenderedRequest")},xm=new ue("F_FLOW"),gm=class{},dA=(()=>{let t=class vd{_state=l(Ip);_fFlow=l(xm);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||vd)};static \u0275prov=y({token:vd,factory:vd.\u0275fac})};return t=x([w(ep)],t),t})(),tp=class{static fToken=Symbol("NotifyFullRenderedRequest")},lA=(()=>{let t=class yd{_state=l(Ip);_fFlow=l(xm);handle(e){this._state.isFullRendered||(this._state.isFullRendered=!0,this._fFlow.fFullRendered.emit(this._fFlow.fId()),this._fFlow.fLoaded.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||yd)};static \u0275prov=y({token:yd,factory:yd.\u0275fac})};return t=x([w(tp)],t),t})(),or=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(i,e,n,o){this.targetConnectionsRevision=i,this.targetNodesRevision=e,this.callback=n,this.destroyRef=o}},uA=(()=>{let t=class Cd{_store=l(M);handle({targetConnectionsRevision:e,targetNodesRevision:n,callback:o,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=n){o();return}let a=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<n||(a(),o())});r.onDestroy(a)}static \u0275fac=function(n){return new(n||Cd)};static \u0275prov=y({token:Cd,factory:Cd.\u0275fac})};return t=x([w(or)],t),t})(),np=class{static fToken=Symbol("ResetRenderLifecycleRequest")},pA=(()=>{let t=class bd{_state=l(Ip);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(n){return new(n||bd)};static \u0275prov=y({token:bd,factory:bd.\u0275fac})};return t=x([w(np)],t),t})(),ip=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(i){this.destroyRef=i}},Av=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),fA=(()=>{let t=class xd{_state=l(Av);_store=l(M);_mediator=l(D);handle(e){if(this._state.pendingRedraw=!0,this._state.isWaitingForViewportAnimation)return;this._state.isWaitingForViewportAnimation=!0;let n=this._store.viewportAnimationChanges$.listen(()=>{if(this._store.isViewportAnimating)return;let o=this._state.pendingRedraw;n(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,o&&this._mediator.execute(new No)});e.destroyRef.onDestroy(n)}static \u0275fac=function(n){return new(n||xd)};static \u0275prov=y({token:xd,factory:xd.\u0275fac})};return t=x([w(ip)],t),t})(),hA=[nA,iA,...sA,cA,Ip,dA,lA,uA,pA,Av,fA],op=class{static fToken=Symbol("ClearSelectionRequest")},mA=(()=>{let t=class wd{_dragContext=l(Q);handle(e){this._dragContext.selectedItems.forEach(n=>n.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||wd)};static \u0275prov=y({token:wd,factory:wd.\u0275fac})};return t=x([w(op)],t),t})(),rp=class{static fToken=Symbol("CalculateSelectableItemsRequest")},_A=(()=>{let t=class Sd{_mediator=l(D);_store=l(M);_dragContext=l(Q);get _nodes(){return this._store.nodes.getAll()}get _connections(){return this._store.connections.getAll()}handle(){return[...this._nodeRects(),...this._connectionRects()].filter(e=>!this._dragContext.selectedItems.includes(e.element))}_nodeRects(){return this._nodes.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Fe(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Fe(e.boundingElement))}))}static \u0275fac=function(n){return new(n||Sd)};static \u0275prov=y({token:Sd,factory:Sd.\u0275fac})};return t=x([w(rp)],t),t})(),rr=class{static fToken=Symbol("GetCurrentSelectionRequest")},gA=(()=>{let t=class Id{_dragContext=l(Q);handle(){return{fNodeIds:this._getSelectedNodes(),fGroupIds:this._getSelectedGroups(),fConnectionIds:this._getSelectedConnections()}}_getSelectedNodes(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-node")).map(e=>e.hostElement.dataset.fNodeId)}_getSelectedGroups(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.dataset.fGroupId)}_getSelectedConnections(){return this._dragContext.selectedItems.filter(e=>!e.hostElement.classList.contains("f-node")&&!e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.id)}static \u0275fac=function(n){return new(n||Id)};static \u0275prov=y({token:Id,factory:Id.\u0275fac})};return t=x([w(rr)],t),t})(),ap=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(i,e,n=!0){this.nodes=i,this.connections=e,this.isSelectedChanged=n}},vA=(()=>{let t=class Td{_dragContext=l(Q);_store=l(M);handle(e){this._dragContext.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(n=>{let o=this._store.nodes.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),e.connections.forEach(n=>{let o=this._store.connections.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(n){return new(n||Td)};static \u0275prov=y({token:Td,factory:Td.\u0275fac})};return t=x([w(ap)],t),t})(),sp=class{static fToken=Symbol("SelectAllRequest")},yA=(()=>{let t=class Ed{_dragSession=l(Q);_store=l(M);handle(e){this._dragSession.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragSession.selectedItems=[],this._store.nodes.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._store.connections.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._dragSession.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||Ed)};static \u0275prov=y({token:Ed,factory:Ed.\u0275fac})};return t=x([w(sp)],t),t})(),Ki=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(i){this.nodeOrGroup=i}},cp=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(i,e,n,o){this.fItemsContainer=i,this.allElements=e,this.elementsThatShouldBeInFront=n,this.targetIndex=o}},CA=(()=>{let t=class Pd{handle(e){let n=[];for(let o=e.targetIndex+1;o<e.allElements.length;o++){let r=e.allElements[o];e.elementsThatShouldBeInFront.includes(r)||n.push(r)}n.forEach(o=>{e.fItemsContainer.removeChild(o),e.fItemsContainer.insertBefore(o,e.allElements[e.targetIndex])})}static \u0275fac=function(n){return new(n||Pd)};static \u0275prov=y({token:Pd,factory:Pd.\u0275fac})};return t=x([w(cp)],t),t})(),si=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(i,e){this.item=i,this.itemContainer=e}},Yi=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(i){this.nodeOrGroupId=i}},bA=(()=>{let t=class kd{_store=l(M);handle({nodeOrGroupId:e}){return this._getChildrenNodes(e)}_getChildrenNodes(e,n=new Set){if(n.has(e))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e);n.add(e);let o=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return o.reduce((r,a)=>r.concat(this._getChildrenNodes(a.fId(),n)),o)}static \u0275fac=function(n){return new(n||kd)};static \u0275prov=y({token:kd,factory:kd.\u0275fac})};return t=x([w(Yi)],t),t})(),xA=(()=>{let t=class Md{_store=l(M);_mediator=l(D);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _connectionsContainer(){return this._canvas.fConnectionsContainer().nativeElement}handle(e){switch(e.itemContainer){case this._groupsContainer:this._handleGroup(e);break;case this._nodesContainer:this._handleNode(e);break;case this._connectionsContainer:this._handleConnection(e);break;default:throw new Error("Unknown container")}}_handleGroup(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenGroups(n);this._updateLayers(this._groupsContainer,e.item.hostElement,o);let r=this._getChildrenNodes(n);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenNodes(n);this._updateLayers(e.itemContainer,e.item.hostElement,o)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,n,o){let r=Array.from(e.children),a=r.findIndex(s=>s===n);this._isAnythingNeedToBeMoved(r,a,o)&&this._mediator.execute(new cp(e,r,o,a))}_isAnythingNeedToBeMoved(e,n,o){for(let r=n+1;r<e.length;r++)if(!o.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let n=Array.from(this._groupsContainer.children);return e.filter(o=>this._groupsContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){let n=Array.from(this._nodesContainer.children);return e.filter(o=>this._nodesContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new Yi(e)).map(n=>n.hostElement)}static \u0275fac=function(n){return new(n||Md)};static \u0275prov=y({token:Md,factory:Md.\u0275fac})};return t=x([w(si)],t),t})(),wA=(()=>{let t=class Dd{_dragSession=l(Q);_mediator=l(D);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new si(e,e.hostElement.parentElement))}_selectNodeIfNotSelected(e){e.fSelectionDisabled()||this._dragSession.selectedItems.includes(e)||(this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.isSelectedChanged=!0)}static \u0275fac=function(n){return new(n||Dd)};static \u0275prov=y({token:Dd,factory:Dd.\u0275fac})};return t=x([w(Ki)],t),t})(),SA=[mA,_A,gA,vA,yA,wA],dp=class{static fToken=Symbol("ResetZoomRequest")},IA=(()=>{let t=class Od{_store=l(M);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(n){return new(n||Od)};static \u0275prov=y({token:Od,factory:Od.\u0275fac})};return t=x([w(dp)],t),t})(),lp=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(i,e,n,o=!1){this.position=i,this.step=e,this.direction=n,this.animate=o}},TA=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),EA=new Set(["drag-canvas","selection-area"]),PA=(()=>{let t=class Nd{_mediator=l(D);_store=l(M);_dragContext=l(Q,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(Se.ZOOM)}get _isDragStarted(){return this._mediator.execute(new Dn)}handle(e){if(!this._zoomComponent)return;let n=this._canvas.transform.scale,o=this._clamp(n+e.step*e.direction);if(o===n)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let a=this._getDragZoomMode();if(a==="blocked")return;a==="rebase"&&this._rebaseDragContext(r,o)}this._canvas.setScale(o,r),e.animate?this._canvas.redrawWithAnimation():this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}_clamp(e){return Math.max(this._zoomComponent?.minimum||1,Math.min(e,this._zoomComponent?.maximum||1))}_castPositionToFlow(e){return Z.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let n of this._dragContext?.draggableItems??[]){let o=n.getEvent().kind;if(TA.has(o)){e=!0;continue}if(!EA.has(o))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,n){if(!this._dragContext)return;let o=this._dragContext.onPointerDownScale;if(!o||o===n){this._dragContext.onPointerDownScale=n;return}let r=1/n-1/o;this._dragContext.onPointerDownPosition=Z.fromPoint(this._dragContext.onPointerDownPosition).add(Z.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=n}static \u0275fac=function(n){return new(n||Nd)};static \u0275prov=y({token:Nd,factory:Nd.\u0275fac})};return t=x([w(lp)],t),t})(),kA=[IA,PA],up=class{static fToken=Symbol("MinimapDrawNodesRequest")},MA=(()=>{let t=class Rd{_browser=l(qe);_store=l(M);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;return!n||!o?[]:this._store.nodes.getAll().map(a=>this._renderNode(a,n,o))}_renderNode(e,n,o){let r=Ai("rect",this._browser);$f(this._nodeRect(e,n,o),r);let a=e instanceof wp;return r.classList.add("f-component",a?"f-minimap-node":"f-minimap-group"),r.classList.add(...this._minimapClasses(e)),e.isSelected()&&r.classList.add("f-selected"),r}_nodeRect(e,n,o){let r=G.elementTransform(G.fromElement(e.hostElement),n.hostElement);return G.div(r,o.transform.scale)}_minimapClasses(e){let n=e.fMinimapClass();return Array.isArray(n)?n:[n]}static \u0275fac=function(n){return new(n||Rd)};static \u0275prov=y({token:Rd,factory:Rd.\u0275fac})};return t=x([w(up)],t),t})(),pp=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(i,e){this.svg=i,this.minSize=e}},DA=(()=>{let t=class Ad{_mediator=l(D);_store=l(M);handle({svg:e,minSize:n}){let o=this._store.fFlow,r=this._store.fCanvas;if(!o||!r)return{scale:1,viewBox:G.initialize(0,0,0,0)};let a=this._contentRectInMinimapSpace(o,r,n),s=this._minimapRectInFlowSpace(e,o),c=this._viewportScale(a,s),u=this._viewportViewBox(a,s,c);return{scale:c,viewBox:u}}_contentRectInMinimapSpace(e,n,o){let r=this._nodesBoundingBox(),a=G.elementTransform(r,e.hostElement),s=G.div(a,n.transform.scale);return f0(s,o)}_nodesBoundingBox(){return this._mediator.execute(new ji)??G.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,n){return G.elementTransform(G.fromElement(e),n.hostElement)}_viewportScale(e,n){let o=n.width||1,r=n.height||1;return Math.max(e.width/o,e.height/r)}_viewportViewBox(e,n,o){let r=this._viewportSize(n,o),a=e.x-(r.width-e.width)/2,s=e.y-(r.height-e.height)/2;return G.initialize(a,s,r.width,r.height)}_viewportSize(e,n){return it.initialize(e.width*n||0,e.height*n||0)}static \u0275fac=function(n){return new(n||Ad)};static \u0275prov=y({token:Ad,factory:Ad.\u0275fac})};return t=x([w(pp)],t),t})(),fp=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},OA=(()=>{let t=class Fd{_store=l(M);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;if(!n||!o)return G.initialize();let r=G.div(G.fromElement(n.hostElement),o.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(n){return new(n||Fd)};static \u0275prov=y({token:Fd,factory:Fd.\u0275fac})};return t=x([w(fp)],t),t})(),hp=class{element;scale;viewBox;constructor(i,e=1,n=G.initialize(0,0,0,0)){this.element=i,this.scale=e,this.viewBox=n}},NA=[MA,DA,OA],mp=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(i){this.position=i}},RA=(()=>{let t=class Ld{_store=l(M);handle({position:e}){return Zi(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(n){return new(n||Ld)};static \u0275prov=y({token:Ld,factory:Ld.\u0275fac})};return t=x([w(mp)],t),t})(),_p=class{static fToken=Symbol("SortNodeLayersRequest")},AA=(()=>{let t=class Bd{_store=l(M);_mediator=l(D);_browser=l(qe);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _fNodeElements(){return Array.from(this._nodesContainer.children)}handle(e){this._getGroups().forEach(n=>{this._moveChildrenNodes(this._getSortedChildrenNodes(n))})}_getGroups(){return this._store.nodes.getAll().filter(e=>this._groupsContainer.contains(e.hostElement))}_getSortedChildrenNodes(e){let n=this._fNodeElements;return this._getChildrenNodes(e.fId()).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new Yi(e)).filter(n=>this._nodesContainer.contains(n.hostElement)).map(n=>n.hostElement)}_moveChildrenNodes(e){let n=this._browser.document.createDocumentFragment();e.forEach(o=>{n.appendChild(o)}),this._nodesContainer.appendChild(n)}static \u0275fac=function(n){return new(n||Bd)};static \u0275prov=y({token:Bd,factory:Bd.\u0275fac})};return t=x([w(_p)],t),t})(),ar=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(i){this.itemsContainer=i}},FA=(()=>{let t=class zd{_store=l(M);_browser=l(qe);handle({itemsContainer:e}){let n=Array.from(e.children);if(n.length<2)return;let o=this._buildPositions(n),r=this._store.nodes.getAll().filter(c=>e.contains(c.hostElement));if(r.length<2||!r.some(c=>!!c.fParentId()))return;let a=this._buildChildrenByParentId(r),s=new Map;for(let c of r){let u=this._getSortedChildrenBeforeParent(e,o,c,a,s);u.length&&this._moveBeforeNextSibling(e,u,c.hostElement.nextElementSibling)}}_buildPositions(e){let n=new Map;for(let o=0;o<e.length;o++)n.set(e[o],o);return n}_getSortedChildrenBeforeParent(e,n,o,r,a){let s=n.get(o.hostElement);if(s===void 0)return[];let c=this._getDeepChildren(o.fId(),r,a);if(!c.length)return[];let u=[];for(let p of c){let _=p.hostElement;if(!e.contains(_))continue;let b=n.get(_);b===void 0||b>=s||u.push(_)}return u.sort((p,_)=>(n.get(p)??0)-(n.get(_)??0)),u}_buildChildrenByParentId(e){let n=new Map;for(let o of e){let r=o.fParentId();if(!r)continue;let a=n.get(r)??[];a.push(o),n.set(r,a)}return n}_getDeepChildren(e,n,o){let r=o.get(e);if(r)return r;let a=[],s=[...n.get(e)??[]],c=new Set([e]);for(;s.length;){let u=s.pop();if(!u)continue;let p=u.fId();if(c.has(p))continue;c.add(p),a.push(u);let _=n.get(p);_?.length&&s.push(..._)}return o.set(e,a),a}_moveBeforeNextSibling(e,n,o){let r=this._browser.document.createDocumentFragment();for(let a of n)r.appendChild(a);e.insertBefore(r,o)}static \u0275fac=function(n){return new(n||zd)};static \u0275prov=y({token:zd,factory:zd.\u0275fac})};return t=x([w(ar)],t),t})(),gp=class{static fToken=Symbol("SortItemLayersRequest")},LA=(()=>{let t=class qd{_store=l(M);_mediator=l(D);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let n=this._store.nodes.getAll();n.length<2||!n.some(o=>!!o.fParentId())||(this._mediator.execute(new ar(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new _p),this._mediator.execute(new ar(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(n){return new(n||qd)};static \u0275prov=y({token:qd,factory:qd.\u0275fac})};return t=x([w(gp)],t),t})();function Ai(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}function bt(t,i){return i(t)}function Et(t){return!0}function BA(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var zA=[...rD,...f2,...KM,...Q2,...N2,...hA,...W2,...SA,...kA,...NA,...vO,bA,yO,wO,RA,LA,FA,AA,xA,CA],qA=0,Fv=(()=>{class t{_destroyRef=l(at);_elementReference=l(Re);_fBrowser=l(qe);_stateChanges=new Ct;get hostElement(){return this._elementReference.nativeElement}id=O(`f-pattern-${qA++}`);vColor=O("rgba(0,0,0,0.1)");hColor=O("rgba(0,0,0,0.1)");vSize=O(20,{transform:Ke});hSize=O(20,{transform:Ke});_transform=yn.default();_position=A.initialize();_size=it.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=Ai("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=Ai("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=Ai("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new zt(this._stateChanges).pipe(vp()).listen(this._destroyRef,()=>this._redraw())}ngOnChanges(e){(e.vSize||e.hSize||e.vColor||e.hColor)&&this._refresh()}_redraw(){this._calculatePattern(),this._redrawPattern(),this._redrawLine(this._vLine,this.vColor(),this._size.width,0,this._size.width,this._size.height),this._redrawLine(this._hLine,this.hColor(),0,this._size.height,this._size.width,this._size.height)}_calculatePattern(){this._position.x=this._transform.position.x+this._transform.scaledPosition.x,this._position.y=this._transform.position.y+this._transform.scaledPosition.y,this._size=it.initialize(this.hSize()*this._transform.scale,this.vSize()*this._transform.scale)}_redrawPattern(){this._pattern.setAttribute("x",`${this._position.x}`),this._pattern.setAttribute("y",`${this._position.y}`),this._pattern.setAttribute("width",`${this._size.width}`),this._pattern.setAttribute("height",`${this._size.height}`)}_redrawLine(e,n,o,r,a,s){e.setAttribute("stroke",`${n}`),e.setAttribute("x1",`${o}`),e.setAttribute("x2",`${a}`),e.setAttribute("y1",`${r}`),e.setAttribute("y2",`${s}`)}setTransform(e){this._transform=e,this._refresh()}_refresh(){this._stateChanges.notify()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=K({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(n,o){n&2&&q("id",o.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[ge([{provide:rh,useExisting:t}]),xi],decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})();var VA=new ue("F_BACKGROUND"),HA=(()=>{class t{hostElement=l(Re).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})(),Lv=(()=>{class t extends HA{_mediator=l(D);fBackgroundPattern=Zr(rh);ngOnInit(){this._mediator.execute(new In(Se.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new Vd(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new Tn(Se.BACKGROUND))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-background"]],contentQueries:function(n,o,r){n&1&&qf(r,o.fBackgroundPattern,rh,5),n&2&&tt()},hostAttrs:[1,"f-component","f-background"],features:[ge([{provide:VA,useExisting:t}]),he],ngContentSelectors:bM,decls:2,vars:0,template:function(n,o){n&1&&(Kt(),et(),W(0,"svg"),De(1),$())},styles:["[_nghost-%COMP%]{position:absolute;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0})}return t})();var vm=class{position;scale;constructor(i,e){this.position=i,this.scale=e}},GA=new ue("F_CANVAS"),jA=(()=>{class t{transform=yn.default();_fCanvasChange=new Ct;destroyRef=l(at);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new zt(this._fCanvasChange).pipe(Hd(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new vm(A.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})(),sr=(()=>{class t extends jA{_mediator=l(D);_componentsStore=l(M);_elementReference=l(Re);_injector=l(Xe);_flowId;fCanvasChange=Be();position=O(A.initialize(),{transform:A.castToPoint});scale=O(1,{transform:Ke});debounceTime=O(0,{transform:Ke});debounce=S(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=Pe.required("fGroupsContainer");fNodesContainer=Pe.required("fNodesContainer");fConnectionsContainer=Pe.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new Xu).fId(),this._mediator.execute(new jd(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){ie(()=>{this._mediator.execute(new $d(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){ie(()=>{this._mediator.execute(new Kd(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new Io(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=yn.toString(this.transform),this._mediator.execute(new Sn)}redrawWithAnimation(){this._mediator.execute(new Io(this.transform)),this.hostElement.style.transition=`transform ${BA()?80:150}ms ease-in-out`,this.hostElement.style.transform=yn.toString(this.transform),$0(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,n=!0){this._afterRedraw(()=>{this._mediator.execute(new Ud(e,n))})}fitToScreen(e=A.initialize(),n=!0){this._afterRedraw(()=>{this._mediator.execute(new Wd(e,n))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new Zd(e))})}getScale(){return this.transform.scale||1}setScale(e,n=A.initialize()){this._mediator.execute(new Qd(e,n))}resetScale(){this._mediator.execute(new Xd)}ngOnDestroy(){this._mediator.execute(new Yd)}_afterRedraw(e){this._mediator.execute(new or(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>jr(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-canvas"]],viewQuery:function(n,o){n&1&&ut(o.fGroupsContainer,xM,5)(o.fNodesContainer,wM,5)(o.fConnectionsContainer,SM,5),n&2&&tt(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[ge([{provide:GA,useExisting:t}]),he],ngContentSelectors:TM,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(n,o){n&1&&(Kt(IM),$r(0),W(1,"div",null,0),De(3),$(),W(4,"div",3,1),De(6,1),De(7,2),De(8,3),$(),W(9,"div",null,2),De(11,4),$(),Kr())},styles:["[_nghost-%COMP%]{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}.f-canvas-dragging[_nghost-%COMP%], .canvas-dragging[_nghost-%COMP%]{transform:translateZ(0)}.f-connections-container[_ngcontent-%COMP%]{position:absolute;z-index:2}"],changeDetection:0})}return t})();var UA=0,Bv=(()=>{class t extends eO{fId=O(`f-connection-${UA++}`,{alias:"fConnectionId"});fOutputId=O("",{transform:e=>Vi(e)||""});fInputId=O("",{transform:e=>Vi(e)||""});fRadius=8;fOffset=12;fBehavior=xn.FIXED;fType=Oi.STRAIGHT;fSelectionDisabled=O(!1,{transform:me});fReassignableStart=O(!1,{transform:me});fDraggingDisabled=O(!1,{alias:"fReassignDisabled",transform:me});fInputSide=O(we.DEFAULT,{transform:e=>Di(e,"fInputSide",we)});fOutputSide=O(we.DEFAULT,{transform:e=>Di(e,"fOutputSide",we)});get boundingElement(){return this.fPath().hostElement}_mediator=l(D);ngOnInit(){this._mediator.execute(new el(this))}ngOnChanges(){this._mediator.execute(new Jn)}ngOnDestroy(){this._mediator.execute(new Il(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(n,o){n&2&&(q("id",o.fId()),se("f-connection-selection-disabled",o.fSelectionDisabled())("f-connection-reassign-disabled",o.fDraggingDisabled()))},inputs:{fId:[1,"fConnectionId","fId"],fOutputId:[1,"fOutputId"],fInputId:[1,"fInputId"],fRadius:[2,"fRadius","fRadius",Ke],fOffset:[2,"fOffset","fOffset",Ke],fBehavior:[2,"fBehavior","fBehavior",e=>Di(e,"fBehavior",xn)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[ge([{provide:yp,useExisting:t}]),he,xi],ngContentSelectors:PM,decls:15,vars:6,consts:[["defs",""],["xmlns","http://www.w3.org/2000/svg"],[1,"f-connection-group"],["fConnectionGradientRenderer","",3,"fConnectionGradientRendererFor"],["fConnectionSelection",""],["f-connection-path","",3,"useGradient"],["f-connection-drag-handle-start","","r","8"],["f-connection-drag-handle-end","","r","8"]],template:function(n,o){if(n&1&&(Kt(EM),et(),f(0,"svg",1),R(1,"defs",null,0),De(3),f(4,"g",2),I(5,kM,1,1,":svg:linearGradient",3),R(6,"path",4),f(7,"g"),R(8,"path",5),I(9,MM,1,0,":svg:circle",6),R(10,"circle",7),h()()(),De(11,1),De(12,2),De(13,3),I(14,DM,1,0)),n&2){let r;d(5),T((r=o.fGradient())?5:-1,r),d(),q("d",o.path),d(2),E("useGradient",!!o.fGradient()),q("d",o.path),d(),T(o.fReassignableStart()?9:-1),d(5),T(o.fContents().length?14:-1)}},dependencies:[bh,XD,ZD,jD,YD],styles:["[_nghost-%COMP%]{pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{display:block;vertical-align:middle;overflow:visible!important;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%] .f-connection-group[_ngcontent-%COMP%]{pointer-events:all}[_nghost-%COMP%] .f-connection-content[_ngcontent-%COMP%]{pointer-events:all}"],changeDetection:0})}return t})();var WA=new ue("F_MAGNETIC_LINES"),$A=(()=>{class t{hostElement=l(Re).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})();var zv=(()=>{class t extends $A{threshold=O(10,{transform:Ke,alias:"fAlignThreshold"});_mediator=l(D);ngOnInit(){this._mediator.execute(new In(Se.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new Tn(Se.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[ge([{provide:WA,useExisting:t}]),he],decls:0,vars:0,template:function(n,o){},styles:[OM]})}return t})();var nh=(()=>{class t{fMinSize=O(1e3);_mediator=l(D);hostElement=l(Re).nativeElement;model=new hp(this.hostElement);redraw(){let{scale:e,viewBox:n}=this._mediator.execute(new pp(this.hostElement,this.fMinSize()));this.model=new hp(this.hostElement,e,n),h0(n,this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),ih=(()=>{class t{_mediator=l(D);_elementRef=l(Re);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new up).forEach(n=>{e.appendChild(n)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),oh=(()=>{class t{_mediator=l(D);hostElement=l(Re).nativeElement;redraw(){$f(this._mediator.execute(new fp),this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),KA=new ue("F_MINIMAP_BASE"),YA=(()=>{class t{hostElement=l(Re).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})(),qv=(()=>{class t extends YA{_destroyRef=l(at);_mediator=l(D);_browser=l(qe);_store=l(M);_canvas=Pe.required(ih);_flow=Pe.required(nh);_minimapView=Pe.required(oh);fMinSize=O(1e3);fNodeRenderLimit=O(1500,{transform:Ke});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new In(Se.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new Gd).pipe(vp(),FM()).listen(this._destroyRef,()=>{this._redraw()})}_redraw(){if(this._browser.isBrowser()){if(this._isOverNodeRenderLimit()){this._canvas().clear();return}this._flow().redraw(),this._minimapView().redraw(),this._canvas().redraw()}}_isOverNodeRenderLimit(){let e=this.fNodeRenderLimit();return e>0&&this._store.nodes.size()>e}ngOnDestroy(){this._mediator.execute(new Tn(Se.MINIMAP))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-minimap"]],viewQuery:function(n,o){n&1&&ut(o._canvas,ih,5)(o._flow,nh,5)(o._minimapView,oh,5),n&2&&tt(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[ge([{provide:KA,useExisting:t}]),he],decls:3,vars:1,consts:[["fMinimapFlow","","width","100%","height","100%","fLockedContext","",3,"fMinSize"],["fMinimapCanvas",""],["fMinimapView","","x","0","y","0","width","100%","height","100%","stroke","none"]],template:function(n,o){n&1&&(et(),f(0,"svg",0),R(1,"g",1)(2,"rect",2),h()),n&2&&E("fMinSize",o.fMinSize())},dependencies:[nh,ih,oh],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var XA=(()=>{class t{hostElement=l(Re).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,standalone:!1})}return t})(),Vv=(()=>{class t extends XA{_mediator=l(D);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new In(Se.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new Tn(Se.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[he],decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var ZA=0,QA=120,cr=(()=>{class t extends gm{_destroyRef=l(at);_mediator=l(D);_browser=l(qe);_componentsStore=l(M);_cache=l(qt);_injector=l(Xe);fId=O(`f-flow-${ZA++}`,{alias:"fFlowId"});fCache=O(!1,{transform:me});hostElement=l(Re).nativeElement;fNodesRendered=Be();fFullRendered=Be();fLoaded=Be();ngOnInit(){this._mediator.execute(new Ku(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){ie(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new zt(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(vp(),Hd(QA),AM()).listen(this._destroyRef,()=>{this._mediator.execute(new Dn)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new gp),this._mediator.execute(new ep),this._mediator.execute(new or(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new tp),this._destroyRef)),this._mediator.execute(new Jn))})}_listenConnectionsChanges(){this._mediator.execute(new Ni).listen(this._destroyRef,()=>{if(!this._mediator.execute(new Dn)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new ip(this._destroyRef));return}this._mediator.execute(new No)}})}redraw(){this._mediator.execute(new Jn)}reset(){this._mediator.execute(new np)}getNodesBoundingBox(){return this._mediator.execute(new ju)}getSelection(){return this._mediator.execute(new rr)}getPositionInFlow(e){return this._mediator.execute(new mp(e))}getState(e){return this._mediator.execute(new Qu(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new Ni).pipe(C0()).listen(this._destroyRef,()=>{this._mediator.execute(new sp)})}select(e,n,o=!0){this._mediator.execute(new Ni).pipe(C0()).listen(this._destroyRef,()=>{this._mediator.execute(new ap(e,n,o))})}clearSelection(){this._mediator.execute(new op)}ngOnDestroy(){this._mediator.execute(new Ju(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(n,o){n&2&&q("id",o.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[ge([D,...jM,rv,Xi,...zA,Q,...l2,{provide:xm,useExisting:t}]),he],ngContentSelectors:RM,decls:7,vars:0,template:function(n,o){n&1&&(Kt(NM),$r(0),De(1),De(2,1),De(3,2),De(4,3),De(5,4),De(6,5),Kr())},styles:["[_nghost-%COMP%]{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none} .f-connection-content{position:absolute;left:0;top:0;inline-size:max-content;pointer-events:all;transform-origin:50% 50%} .f-node, .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important;box-sizing:border-box} .f-group{z-index:1} .f-connection-content{z-index:3} .f-node{z-index:4}.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})}return t})();var Hv=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=l(Ur);_tpl=l(_g);_zone=l(Un);_componentsStore=l(M,{optional:!0});_views=[];_rafId=null;_isProgressiveRenderActive=!1;ngOnChanges(e){e.fVirtualForOf&&(this._reset(),this._renderProgressively())}ngOnDestroy(){this._reset()}_reset(){this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._finishProgressiveRender(),this._vc.clear(),this._views.length=0}_renderProgressively(){let n=0;this._startProgressiveRender(),this._zone.runOutsideAngular(()=>{let o=()=>{let r=performance.now();for(;n<this.fVirtualForOf.length&&performance.now()-r<10;){let a=this.fVirtualForOf[n],s=this._vc.createEmbeddedView(this._tpl,{$implicit:a,index:n});this._views.push(s),n++}if(n<this.fVirtualForOf.length){this._rafId=requestAnimationFrame(o);return}this._rafId=null,this._finishProgressiveRender()};this._rafId=requestAnimationFrame(o)})}_startProgressiveRender(){this._isProgressiveRenderActive||(this._isProgressiveRenderActive=!0,this._componentsStore?.beginProgressiveRender())}_finishProgressiveRender(){this._isProgressiveRenderActive&&(this._isProgressiveRenderActive=!1,this._componentsStore?.endProgressiveRender())}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Te({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[xi]})}return t})();var Pt=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(Pt||{}),JA=new ue("F_ZOOM"),ym=class{},eF=.1,tF=1,nF=.5,iF=60,oF=.5;function rF(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function aF(t,i,e){return sF(t)?dF(i,e):cF(i,e)}function sF(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function cF(t,i){let e=Math.abs(t)/100,n=Gv(e,eF,tF);return i*n}function dF(t,i){if(Math.abs(t)<nF)return 0;let e=Math.abs(t)/iF,n=Gv(e,0,oF);return i*n}function Gv(t,i,e){return Math.max(i,Math.min(e,t))}var dr=(()=>{class t extends ym{_mediator=l(D);_injector=l(Xe);_store=l(M);_triggersListener=ve.emptyListener();isEnabled=O(!1,{alias:"fZoom",transform:me});fWheelTrigger=Et;fDblClickTrigger=Et;minimum=.1;maximum=4;step=.1;dblClickStep=.5;get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}ngOnInit(){this._mediator.execute(new In(Se.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){ie(()=>{this.isEnabled(),At(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,ve.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,ve.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!bt(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let o=rF(e);if(o===0)return;let r=this._normalizeWheelStep(e,o);r!==0&&this.setZoom(A.initialize(e.clientX,e.clientY),r,this._calculateDirection(o),!1)};_normalizeWheelStep(e,n){return aF(e,n,this.step)}_calculateDirection(e){return e>0?Pt.ZOOM_OUT:Pt.ZOOM_IN}_onDoubleClick=e=>{if(!bt(e,this.fDblClickTrigger))return;e.preventDefault();let n=e.target;SN(n)||n?.closest("[fLockedContext]")||this.setZoom(A.initialize(e.clientX,e.clientY),this.dblClickStep,Pt.ZOOM_IN,!0)};_getToCenterPosition(e,n){return A.initialize(e?.x||n.gravityCenter.x,e?.y||n.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(Pt.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(Pt.ZOOM_OUT,e)}_onZoomToCenter(e,n){this.setZoom(this._getToCenterPosition(n,G.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,n,o,r){this._mediator.execute(new lp(e,n,o,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new dp)}_disposeListeners(){this._triggersListener(),this._triggersListener=ve.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new Tn(Se.ZOOM))}_listen(e,n,o){this._flowHost.addEventListener(e,n,o)}_unlisten(e,n,o){this._flowHost.removeEventListener(e,n,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275dir=Te({type:t,selectors:[["f-canvas","fZoom",""]],hostAttrs:[1,"f-zoom","f-component"],inputs:{isEnabled:[1,"fZoom","isEnabled"],fWheelTrigger:"fWheelTrigger",fDblClickTrigger:"fDblClickTrigger",minimum:[2,"fZoomMinimum","minimum",Ke],maximum:[2,"fZoomMaximum","maximum",Ke],step:[2,"fZoomStep","step",Ke],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",Ke]},features:[ge([{provide:JA,useExisting:t}]),he]})}return t})();var jv=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[Ti]})}return t})();var of=tM(VP(),1);var Br=(function(t){return t.NETWORK_SIMPLEX="network-simplex",t.TIGHT_TREE="tight-tree",t.LONGEST_PATH="longest-path",t})(Br||{}),SY={direction:di.TOP_BOTTOM,nodeGap:48,layerGap:64,algorithm:Br.NETWORK_SIMPLEX,defaultNodeSize:it.initialize(120,72)},X_=(()=>{class t extends Yu{constructor(){super(SY)}mergeOptions(e,n={}){return jn(de(de({},e),n),{defaultNodeSize:n.defaultNodeSize?it.initialize(n.defaultNodeSize.width,n.defaultNodeSize.height):it.initialize(e.defaultNodeSize.width,e.defaultNodeSize.height)})}async calculate(e,n,o){let r=this.resolveLayoutOptions(o),a=this._buildGraph(e,n,r),s=new Map;return of.layout(a),a.nodes().forEach(c=>{let u=a.node(c),p=e.find(b=>b.id===c);if(!u||!p)return;let _=p.size??r.defaultNodeSize;s.set(c,A.initialize(u.x-_.width/2,u.y-_.height/2))}),{nodes:Nv(e,s)}}_buildGraph(e,n,o){let r=new of.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:this._mapDirection(o.direction),nodesep:o.nodeGap,ranksep:o.layerGap,ranker:this._mapAlgorithm(o.algorithm)}),e.forEach(a=>{let s=a.size??o.defaultNodeSize;r.setNode(a.id,{width:s.width,height:s.height})}),n.forEach(a=>{!r.hasNode(a.source)||!r.hasNode(a.target)||r.setEdge(a.source,a.target,{})}),r}_mapAlgorithm(e){switch(e){case Br.TIGHT_TREE:return"tight-tree";case Br.LONGEST_PATH:return"longest-path";case Br.NETWORK_SIMPLEX:default:return"network-simplex"}}_mapDirection(e){switch(e){case di.BOTTOM_TOP:return"BT";case di.LEFT_RIGHT:return"LR";case di.RIGHT_LEFT:return"RL";case di.TOP_BOTTOM:default:return"TB"}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var on={loading:"Loading collection",errorTitle:"Failed to load",emptyTitle:"No nodes match the current filters.",resetFilters:"Reset filters",a11y:{toolbar:"Map controls",panel:"Selected node details"},toolbar:{zoomIn:"Zoom in",zoomOut:"Zoom out",fitToScreen:"Fit to screen",resetLayoutLabel:"Reset layout",resetLayoutTooltip:"Reset layout (re-run auto layout, clear saved positions)",layoutAlgorithmLabel:"Layout algorithm",layoutAlgorithmTooltip:"Layout algorithm (balanced, stretched or organic)",layoutDirectionLabel:"Layout direction",layoutDirectionTooltip:"Layout direction (TB, BT, LR, RL)",layoutDirectionUnavailableTooltip:"Direction does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",layoutSpacingLabel:"Layout spacing",layoutSpacingTooltip:"Layout spacing (compact, normal, spacious)",layoutSpacingUnavailableTooltip:"Spacing does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",connectionTypeLabel:"Edge style",connectionTypeTooltip:"Edge style (orthogonal, straight, bezier or adaptive curve)"},layout:{algorithm:{options:{"network-simplex":{label:"Balanced"},"longest-path":{label:"Stretched"},force:{label:"Organic"}}},direction:{options:{TOP_BOTTOM:{label:"Top to bottom"},BOTTOM_TOP:{label:"Bottom to top"},LEFT_RIGHT:{label:"Left to right"},RIGHT_LEFT:{label:"Right to left"}}},spacing:{options:{compact:{label:"Compact"},normal:{label:"Normal"},spacious:{label:"Spacious"}}},connection:{options:{segment:{label:"Orthogonal"},straight:{label:"Straight"},bezier:{label:"Bezier"},"adaptive-curve":{label:"Adaptive curve"}}}},panel:{resizeLabel:"Resize panel"},resetLayoutConfirm:{header:"Reset layout?",message:"Reset all node positions to the automatic layout. This cannot be undone.",accept:"Reset",reject:"Cancel"}};var po={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0},inspector:{actionMocks:!1}};var IY="adaptive-curve",Z_=["segment","straight","bezier","adaptive-curve"],HP="sm.graph.connection-type",GP="sm.graph.layout-algorithm",jP="sm.graph.layout-direction",UP="sm.graph.layout-spacing",fo=class t{_connectionType=H(rf(HP,TY,IY));_layoutAlgorithm=H(rf(GP,Qg,Yg));_layoutDirection=H(rf(jP,Jg,Xg));_layoutSpacing=H(rf(UP,e0,Zg));connectionType=this._connectionType.asReadonly();layoutAlgorithm=this._layoutAlgorithm.asReadonly();layoutDirection=this._layoutDirection.asReadonly();layoutSpacing=this._layoutSpacing.asReadonly();setConnectionType(i){this._connectionType()!==i&&(this._connectionType.set(i),af(HP,i))}setLayoutAlgorithm(i){this._layoutAlgorithm()!==i&&(this._layoutAlgorithm.set(i),af(GP,i))}setLayoutDirection(i){this._layoutDirection()!==i&&(this._layoutDirection.set(i),af(jP,i))}setLayoutSpacing(i){this._layoutSpacing()!==i&&(this._layoutSpacing.set(i),af(UP,i))}static toFoblexEnum(i){return i}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};function rf(t,i,e){let n=null;try{n=localStorage.getItem(t)}catch{return e}return n&&i(n)?n:e}function af(t,i){try{localStorage.setItem(t,i)}catch{}}function TY(t){return typeof t=="string"&&Z_.includes(t)}var EY={TOP_BOTTOM:{output:we.BOTTOM,input:we.TOP},BOTTOM_TOP:{output:we.TOP,input:we.BOTTOM},LEFT_RIGHT:{output:we.RIGHT,input:we.LEFT},RIGHT_LEFT:{output:we.LEFT,input:we.RIGHT}};function WP(t,i){return ua(t)?EY[i]:{input:we.CALCULATE,output:we.CALCULATE}}var $P=`
|
|
211
|
+
.p-popover {
|
|
212
|
+
margin-block-start: dt('popover.gutter');
|
|
213
|
+
background: dt('popover.background');
|
|
214
|
+
color: dt('popover.color');
|
|
215
|
+
border: 1px solid dt('popover.border.color');
|
|
216
|
+
border-radius: dt('popover.border.radius');
|
|
217
|
+
box-shadow: dt('popover.shadow');
|
|
218
|
+
will-change: transform;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.p-popover-content {
|
|
222
|
+
padding: dt('popover.content.padding');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.p-popover-flipped {
|
|
226
|
+
margin-block-start: calc(dt('popover.gutter') * -1);
|
|
227
|
+
margin-block-end: dt('popover.gutter');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.p-popover:after,
|
|
231
|
+
.p-popover:before {
|
|
232
|
+
bottom: 100%;
|
|
233
|
+
left: calc(dt('popover.arrow.offset') + dt('popover.arrow.left'));
|
|
234
|
+
content: ' ';
|
|
235
|
+
height: 0;
|
|
236
|
+
width: 0;
|
|
237
|
+
position: absolute;
|
|
238
|
+
pointer-events: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.p-popover:after {
|
|
242
|
+
border-width: calc(dt('popover.gutter') - 2px);
|
|
243
|
+
margin-left: calc(-1 * (dt('popover.gutter') - 2px));
|
|
244
|
+
border-style: solid;
|
|
245
|
+
border-color: transparent;
|
|
246
|
+
border-bottom-color: dt('popover.background');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.p-popover:before {
|
|
250
|
+
border-width: dt('popover.gutter');
|
|
251
|
+
margin-left: calc(-1 * dt('popover.gutter'));
|
|
252
|
+
border-style: solid;
|
|
253
|
+
border-color: transparent;
|
|
254
|
+
border-bottom-color: dt('popover.border.color');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.p-popover-flipped:after,
|
|
258
|
+
.p-popover-flipped:before {
|
|
259
|
+
bottom: auto;
|
|
260
|
+
top: 100%;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.p-popover.p-popover-flipped:after {
|
|
264
|
+
border-bottom-color: transparent;
|
|
265
|
+
border-top-color: dt('popover.background');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.p-popover.p-popover-flipped:before {
|
|
269
|
+
border-bottom-color: transparent;
|
|
270
|
+
border-top-color: dt('popover.border.color');
|
|
271
|
+
}
|
|
272
|
+
`;var MY=["content"],DY=["*"],OY=t=>({closeCallback:t});function NY(t,i){}function RY(t,i){t&1&&be(0,NY,0,0,"ng-template")}function AY(t,i){if(t&1){let e=re();f(0,"div",1),V("click",function(o){L(e);let r=m();return B(r.onOverlayClick(o))})("pMotionOnEnter",function(o){L(e);let r=m();return B(r.onAnimationStart(o))})("pMotionOnAfterLeave",function(){L(e);let o=m();return B(o.onAnimationEnd())}),f(1,"div",2),V("click",function(o){L(e);let r=m();return B(r.onContentClick(o))})("mousedown",function(o){L(e);let r=m();return B(r.onContentClick(o))}),De(2),be(3,RY,1,0,null,3),h()()}if(t&2){let e=m();Xr(e.sx("root")),Ae(e.cn(e.cx("root"),e.styleClass)),E("pBind",e.ptm("root"))("ngStyle",e.style)("pMotion",e.overlayVisible)("pMotionAppear",!0)("pMotionOptions",e.computedMotionOptions()),q("aria-modal",e.overlayVisible)("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy),d(),Ae(e.cx("content")),E("pBind",e.ptm("content")),d(2),E("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",yt(17,OY,e.onCloseClick.bind(e)))}}var FY={root:()=>({position:"absolute"})},LY={root:"p-popover p-component",content:"p-popover-content"},KP=(()=>{class t extends ta{name="popover";style=$P;classes=LY;inlineStyles=FY;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),YP=new ue("POPOVER_INSTANCE"),Q_=(()=>{class t extends ia{componentName="Popover";$pcPopover=l(YP,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=l(Ft,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm("host"))}ariaLabel;ariaLabelledBy;dismissable=!0;style;styleClass;appendTo=O("body");autoZIndex=!0;ariaCloseLabel;baseZIndex=0;focusOnShow=!0;showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions=".1s linear";motionOptions=O(void 0);computedMotionOptions=S(()=>de(de({},this.ptm("motion")),this.motionOptions()));onShow=new lt;onHide=new lt;$appendTo=S(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=!1;render=!1;selfClick=!1;documentClickListener;target;willHide;scrollHandler;documentResizeListener;contentTemplate;templates;_contentTemplate;destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=l(KP);zone=l(Un);overlayService=l(kg);onAfterContentInit(){this.templates.forEach(e=>{e.getType()==="content"&&(this._contentTemplate=e.template)})}bindDocumentClickListener(){if(sn(this.platformId)&&!this.documentClickListener){let e=Tg()?"touchstart":"click",n=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(n,e,o=>{this.dismissable&&(!this.container?.contains(o.target)&&this.target!==o.target&&!this.target.contains(o.target)&&!this.selfClick&&this.hide(),this.selfClick=!1,this.cd.markForCheck())})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null,this.selfClick=!1)}toggle(e,n){this.overlayVisible?(this.hasTargetChanged(e,n)&&(this.destroyCallback=()=>{this.show(null,n||e.currentTarget||e.target)}),this.hide()):this.show(e,n)}show(e,n){n&&e&&e.stopPropagation(),this.container&&!this.overlayVisible&&(this.container=null),this.target=n||e.currentTarget||e.target,this.overlayVisible=!0,this.render=!0,this.cd.markForCheck()}onOverlayClick(e){this.overlayService.add({originalEvent:e,target:this.el.nativeElement}),this.selfClick=!0}onContentClick(e){let n=e.target;this.selfClick=e.offsetX<n.clientWidth&&e.offsetY<n.clientHeight}hasTargetChanged(e,n){return this.target!=null&&this.target!==(n||e.currentTarget||e.target)}appendOverlay(){this.$appendTo()&&this.$appendTo()!=="self"&&(this.$appendTo()==="body"?ea(this.document.body,this.container):ea(this.$appendTo(),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!=="self"&&ea(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex&&ra.set("overlay",this.container,this.baseZIndex+this.config.zIndex.overlay)}align(){if(this.target&&this.container){Sg(this.container,this.target,!1);let e=Gf(this.container),n=Gf(this.target),o=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue("border-radius"),r=0;e.left<n.left&&(r=n.left-e.left-parseFloat(o)*2),this.container.style.setProperty(Og("popover.arrow.left").name,`${r}px`),e.top<n.top&&(this.container.setAttribute("data-p-popover-flipped","true"),!this.$unstyled()&&wg(this.container,"p-popover-flipped"))}}onAnimationStart(e){this.container=e.element,this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.align(),this.setZIndex(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.focusOnShow&&this.focus(),this.overlayEventListener=n=>{this.container&&this.container.contains(n.target)&&(this.selfClick=!0)},this.overlaySubscription=this.overlayService.clickObservable.subscribe(this.overlayEventListener),this.onShow.emit(null)}onAnimationEnd(){this.overlayVisible||(this.destroyCallback&&(this.destroyCallback(),this.destroyCallback=null),this.overlaySubscription&&this.overlaySubscription.unsubscribe(),this.autoZIndex&&ra.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render=!1,this.container=null)}focus(){let e=Ig(this.container,"[autofocus]");e&&this.zone.runOutsideAngular(()=>{setTimeout(()=>e.focus(),5)})}hide(){this.overlayVisible=!1,this.cd.markForCheck()}onCloseClick(e){this.hide(),e.preventDefault()}onEscapeKeydown(e){this.hide()}onWindowResize(){this.overlayVisible&&!Eg()&&this.hide()}bindDocumentResizeListener(){if(sn(this.platformId)&&!this.documentResizeListener){let e=this.document.defaultView;this.documentResizeListener=this.renderer.listen(e,"resize",this.onWindowResize.bind(this))}}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){sn(this.platformId)&&(this.scrollHandler||(this.scrollHandler=new Ng(this.target,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener())}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}onContainerDestroy(){this.cd.destroyed||(this.target=null),this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}onDestroy(){this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.container&&this.autoZIndex&&ra.clear(this.container),this.cd.destroyed||(this.target=null),this.destroyCallback=null,this.container&&(this.restoreAppend(),this.onContainerDestroy()),this.overlaySubscription&&this.overlaySubscription.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["p-popover"]],contentQueries:function(n,o,r){if(n&1&&Yr(r,MY,4)(r,Pi,4),n&2){let a;gt(a=vt())&&(o.contentTemplate=a.first),gt(a=vt())&&(o.templates=a)}},hostBindings:function(n,o){n&1&&V("keydown.escape",function(a){return o.onEscapeKeydown(a)},Gr)},inputs:{ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",dismissable:[2,"dismissable","dismissable",me],style:"style",styleClass:"styleClass",appendTo:[1,"appendTo"],autoZIndex:[2,"autoZIndex","autoZIndex",me],ariaCloseLabel:"ariaCloseLabel",baseZIndex:[2,"baseZIndex","baseZIndex",Ke],focusOnShow:[2,"focusOnShow","focusOnShow",me],showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",motionOptions:[1,"motionOptions"]},outputs:{onShow:"onShow",onHide:"onHide"},features:[ge([KP,{provide:YP,useExisting:t},{provide:na,useExisting:t}]),Wr([Ft]),he],ngContentSelectors:DY,decls:1,vars:1,consts:[["role","dialog","pMotionName","p-anchored-overlay",3,"pBind","class","style","ngStyle","pMotion","pMotionAppear","pMotionOptions"],["role","dialog","pMotionName","p-anchored-overlay",3,"click","pMotionOnEnter","pMotionOnAfterLeave","pBind","ngStyle","pMotion","pMotionAppear","pMotionOptions"],[3,"click","mousedown","pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){n&1&&(Kt(),I(0,AY,4,19,"div",0)),n&2&&T(o.render?0:-1)},dependencies:[Ti,Qr,Cg,cn,Ft,Ag,Rg],encapsulation:2,changeDetection:0})}return t})(),XP=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[Q_,cn,cn]})}return t})();function zY(t,i){if(t&1){let e=re();f(0,"li",12)(1,"button",17),V("click",function(){let o=L(e).$implicit,r=m(),a=Yt(7);return r.setLayoutAlgorithm(o),B(a.hide())}),v(2),h()()}if(t&2){let e=i.$implicit,n=m();d(),se("is-active",n.layoutAlgorithm()===e),q("aria-checked",n.layoutAlgorithm()===e)("data-testid","graph-layout-algorithm-option-"+e),d(),Le(" ",n.layoutAlgorithmLabel(e)," ")}}function qY(t,i){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Yt(12);return r.setLayoutDirection(o),B(a.hide())}),R(1,"i",19),h()}if(t&2){let e=i.$implicit,n=m();se("is-active",n.layoutDirection()===e),E("pTooltip",n.layoutDirectionLabel(e)),q("aria-checked",n.layoutDirection()===e)("aria-label",n.layoutDirectionLabel(e))("data-testid","graph-layout-direction-option-"+e),d(),Ae(n.directionItemIcon(e))}}function VY(t,i){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Yt(17);return r.setLayoutSpacing(o),B(a.hide())}),R(1,"i",19),h()}if(t&2){let e=i.$implicit,n=m();se("is-active",n.layoutSpacing()===e),E("pTooltip",n.layoutSpacingLabel(e)),q("aria-checked",n.layoutSpacing()===e)("aria-label",n.layoutSpacingLabel(e))("data-testid","graph-layout-spacing-option-"+e),d(),Ae(n.spacingItemIcon(e))}}function HY(t,i){if(t&1){let e=re();f(0,"button",18),V("click",function(){let o=L(e).$implicit,r=m(),a=Yt(22);return r.setConnectionType(o),B(a.hide())}),et(),f(1,"svg",20),R(2,"path",9),h()()}if(t&2){let e=i.$implicit,n=m();se("is-active",n.connectionType()===e),E("pTooltip",n.connectionTypeLabel(e)),q("aria-checked",n.connectionType()===e)("aria-label",n.connectionTypeLabel(e))("data-testid","graph-connection-type-option-"+e),d(2),q("d",n.connectionTypeItemPath(e))}}var ZP={TOP_BOTTOM:"pi pi-arrow-down",BOTTOM_TOP:"pi pi-arrow-up",LEFT_RIGHT:"pi pi-arrow-right",RIGHT_LEFT:"pi pi-arrow-left"},QP={compact:"pi pi-window-minimize",normal:"pi pi-bars",spacious:"pi pi-window-maximize"},GY={segment:"M 2 14 L 8 14 L 8 2 L 14 2",straight:"M 2 14 L 14 2",bezier:"M 2 14 C 6 14, 10 2, 14 2","adaptive-curve":"M 2 14 C 8 14, 8 2, 14 2"},sf=class t{graphPreferences=l(fo);texts=on;layoutAlgorithms=Ug;layoutDirections=$g;layoutSpacings=Kg;connectionTypes=Z_;layoutAlgorithm=this.graphPreferences.layoutAlgorithm;layoutDirection=this.graphPreferences.layoutDirection;layoutSpacing=this.graphPreferences.layoutSpacing;connectionType=this.graphPreferences.connectionType;directionIcon=S(()=>ZP[this.layoutDirection()]);spacingIcon=S(()=>QP[this.layoutSpacing()]);directionAvailable=S(()=>ua(this.layoutAlgorithm()));spacingAvailable=S(()=>Wg(this.layoutAlgorithm()));layoutAlgorithmLabel(i){return on.layout.algorithm.options[i].label}layoutDirectionLabel(i){return on.layout.direction.options[i].label}layoutSpacingLabel(i){return on.layout.spacing.options[i].label}connectionTypeLabel(i){return on.layout.connection.options[i].label}setLayoutAlgorithm(i){this.graphPreferences.setLayoutAlgorithm(i)}setLayoutDirection(i){this.graphPreferences.setLayoutDirection(i)}setLayoutSpacing(i){this.graphPreferences.setLayoutSpacing(i)}setConnectionType(i){this.graphPreferences.setConnectionType(i)}directionItemIcon(i){return ZP[i]}spacingItemIcon(i){return QP[i]}connectionTypeItemPath(i){return GY[i]}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-graph-layout-toolbar"]],decls:26,vars:21,consts:[["algorithmPopover",""],["directionPopover",""],["spacingPopover",""],["connectionTypePopover",""],["icon","pi pi-sitemap","severity","secondary","size","small","data-testid","graph-layout-algorithm-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["severity","secondary","size","small","data-testid","graph-layout-direction-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-layout-spacing-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-connection-type-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg","graph__connection-svg--toggle"],["fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["appendTo","body","styleClass","graph__layout-popover"],["role","menu","data-testid","graph-layout-algorithm-menu",1,"graph__layout-menu"],["role","none"],["role","menu","data-testid","graph-layout-direction-menu",1,"graph__layout-icon-row"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"is-active","pTooltip"],["role","menu","data-testid","graph-layout-spacing-menu",1,"graph__layout-icon-row"],["role","menu","data-testid","graph-connection-type-menu",1,"graph__layout-icon-row"],["type","button","role","menuitemradio",1,"graph__layout-menu-item",3,"click"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"click","pTooltip"],["aria-hidden","true"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg"]],template:function(e,n){if(e&1){let o=re();f(0,"p-button",4),V("onClick",function(a){L(o);let s=Yt(7);return B(s.toggle(a))}),h(),f(1,"p-button",5),V("onClick",function(a){L(o);let s=Yt(12);return B(s.toggle(a))}),h(),f(2,"p-button",6),V("onClick",function(a){L(o);let s=Yt(17);return B(s.toggle(a))}),h(),f(3,"p-button",7),V("onClick",function(a){L(o);let s=Yt(22);return B(s.toggle(a))}),et(),f(4,"svg",8),R(5,"path",9),h()(),qr(),f(6,"p-popover",10,0)(8,"ul",11),Y(9,zY,3,5,"li",12,Ee),h()(),f(11,"p-popover",10,1)(13,"div",13),Y(14,qY,2,8,"button",14,Ee),h()(),f(16,"p-popover",10,2)(18,"div",15),Y(19,VY,2,8,"button",14,Ee),h()(),f(21,"p-popover",10,3)(23,"div",16),Y(24,HY,3,7,"button",14,Ee),h()()}e&2&&(E("ariaLabel",n.texts.toolbar.layoutAlgorithmLabel)("pTooltip",n.texts.toolbar.layoutAlgorithmTooltip)("text",!0)("rounded",!0),d(),E("icon",n.directionIcon())("ariaLabel",n.texts.toolbar.layoutDirectionLabel)("pTooltip",n.directionAvailable()?n.texts.toolbar.layoutDirectionTooltip:n.texts.toolbar.layoutDirectionUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!n.directionAvailable()),d(),E("icon",n.spacingIcon())("ariaLabel",n.texts.toolbar.layoutSpacingLabel)("pTooltip",n.spacingAvailable()?n.texts.toolbar.layoutSpacingTooltip:n.texts.toolbar.layoutSpacingUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!n.spacingAvailable()),d(),E("ariaLabel",n.texts.toolbar.connectionTypeLabel)("pTooltip",n.texts.toolbar.connectionTypeTooltip)("text",!0)("rounded",!0),d(2),q("d",n.connectionTypeItemPath(n.connectionType())),d(4),X(n.layoutAlgorithms),d(5),X(n.layoutDirections),d(5),X(n.layoutSpacings),d(5),X(n.connectionTypes))},dependencies:[ln,dn,XP,Q_,Ne,Oe],styles:['[_nghost-%COMP%] .graph__layout-popover .p-popover-content{padding:4px}.graph__layout-menu[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;min-width:160px}.graph__layout-menu-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);font:inherit;text-align:left;padding:6px 10px;border-radius:var(--sm-radius-sm);cursor:pointer;display:flex;align-items:center;gap:8px;transition:background .12s ease,color .12s ease}.graph__layout-menu-item[_ngcontent-%COMP%]:hover, .graph__layout-menu-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color);font-weight:600}.graph__layout-menu-item[_ngcontent-%COMP%]:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:transparent;flex-shrink:0}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]:before{background:var(--p-primary-color)}.graph__layout-icon-row[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row;gap:2px;padding:2px}.graph__layout-icon-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);cursor:pointer;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--sm-radius-sm);transition:background .12s ease,color .12s ease}.graph__layout-icon-item[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:1rem}.graph__connection-svg[_ngcontent-%COMP%]{width:20px;height:20px;overflow:visible}.graph__connection-svg--toggle[_ngcontent-%COMP%]{width:16px;height:16px}.graph__layout-icon-item[_ngcontent-%COMP%]:hover, .graph__layout-icon-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-icon-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color)}'],changeDetection:0})};var JP={a11y:{toolbarLabel:"Toggle node kinds"},favorites:{label:"Favorites"},search:{openTooltip:"Search nodes",closeTooltip:"Close search",placeholder:"Search\u2026",inputAriaLabel:"Search nodes by name or tag"}};function jY(t,i){if(t&1&&Si(0,"i",4),t&2){let e=m();Ae(e.piClass()),Tt("font-size",e.size(),"px")}}function UY(t,i){if(t&1&&(et(),W(0,"svg",1),Si(1,"path"),$()),t&2){let e=m();q("width",e.size())("height",e.size()),d(),q("d",e.svgPath())}}function WY(t,i){if(t&1&&(W(0,"span",4),v(1),$()),t&2){let e=m();Tt("font-size",e.size(),"px")("line-height",e.size(),"px"),d(),C(e.emoji())}}function $Y(t,i){if(t&1&&(W(0,"span",5),v(1),$()),t&2){let e=m();Tt("font-size",e.size(),"px")("line-height",e.size(),"px"),d(),C(e.letter())}}var qn=class t{kindRegistry=l(ki);kind=O.required();size=O(18);provider=O(null);resolvedUi=S(()=>this.kindRegistry.lookup(this.kind()));variant=S(()=>{let i=this.resolvedUi();return i?.icon?.kind==="pi"?"pi":i?.icon?.kind==="svg"?"svg":i?.emoji?"emoji":"letter"});piClass=S(()=>{let i=this.resolvedUi()?.icon;return i?.kind==="pi"?`pi ${i.id}`:""});svgPath=S(()=>{let i=this.resolvedUi()?.icon;return i?.kind==="svg"?i.path:""});emoji=S(()=>this.resolvedUi()?.emoji??"");letter=S(()=>this.kindRegistry.labelOf(this.kind()).charAt(0).toUpperCase());static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-kind-icon"]],inputs:{kind:[1,"kind"],size:[1,"size"],provider:[1,"provider"]},decls:4,vars:1,consts:[["aria-hidden","true",3,"class","font-size"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2.2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["aria-hidden","true",3,"font-size","line-height"],["aria-hidden","true",1,"kind-icon__letter",3,"font-size","line-height"],["aria-hidden","true"],["aria-hidden","true",1,"kind-icon__letter"]],template:function(e,n){if(e&1&&I(0,jY,1,4,"i",0)(1,UY,2,3,":svg:svg",1)(2,WY,2,5,"span",2)(3,$Y,2,5,"span",3),e&2){let o;T((o=n.variant())==="pi"?0:o==="svg"?1:o==="emoji"?2:o==="letter"?3:-1)}},styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;justify-content:center;line-height:1}"],changeDetection:0})};var KY=["searchInput"],ek=()=>({class:"kind-palette__content"}),tk=t=>({content:t}),YY=(t,i)=>i.kind;function XY(t,i){if(t&1&&(R(0,"sm-kind-icon",10),f(1,"span"),v(2),h()),t&2){let e=m().$implicit;E("kind",e.kind)("size",16),d(2),C(e.count)}}function ZY(t,i){if(t&1){let e=re();f(0,"p-togglebutton",9),V("ngModelChange",function(){let o=L(e).$implicit,r=m();return B(r.toggle(o.kind))}),be(1,XY,3,3,"ng-template",null,1,Rt),h()}if(t&2){let e=i.$implicit,n=m();E("ngModel",n.isActive(e.kind))("pTooltip",e.label)("ariaLabel",e.label)("styleClass","kind-palette__btn kind-palette__btn--"+e.kind)("pt",yt(7,tk,Nt(6,ek))),q("data-testid","kind-palette-"+e.kind)}}function QY(t,i){if(t&1&&(R(0,"i",12),f(1,"span"),v(2),h()),t&2){let e=m(2);se("pi-star-fill",e.favoritesActive())("pi-star",!e.favoritesActive()),d(2),C(e.favoritesCount())}}function JY(t,i){if(t&1){let e=re();f(0,"p-togglebutton",11),V("ngModelChange",function(){L(e);let o=m();return B(o.toggleFavoritesOnly())}),be(1,QY,3,5,"ng-template",null,1,Rt),h()}if(t&2){let e=m();E("ngModel",e.favoritesActive())("pTooltip",e.texts.favorites.label)("ariaLabel",e.texts.favorites.label)("pt",yt(5,tk,Nt(4,ek)))}}var cf=class t{loader=l(Lt);filters=l(pn);kindRegistry=l(ki);texts=JP;entries=S(()=>{let i=new Map;for(let e of this.loader.nodes())i.set(e.kind,(i.get(e.kind)??0)+1);return this.kindRegistry.kinds().map(e=>({kind:e.name,label:e.label,count:i.get(e.name)??0})).filter(e=>e.count>0)});favoritesCount=S(()=>this.loader.nodes().filter(i=>i.isFavorite===!0).length);showFavorites=S(()=>this.loader.hasAnyFavorites()||this.filters.favoritesOnly());favoritesActive=S(()=>this.filters.favoritesOnly());searchExpanded=H(!1);searchActive=S(()=>this.filters.searchText().trim().length>0);searchInputRef=Pe("searchInput");constructor(){ie(()=>{this.searchExpanded()&&queueMicrotask(()=>this.searchInputRef()?.nativeElement.focus())})}toggleSearch(){this.searchExpanded.set(!this.searchExpanded())}onSearchInput(i){this.filters.setSearchText(i)}onSearchKeydown(i){i.key==="Escape"&&(i.stopPropagation(),this.searchExpanded.set(!1))}onSearchBlur(){this.searchActive()||this.searchExpanded.set(!1)}isActive(i){return this.filters.isKindActive(i)}toggle(i){let e=this.entries().map(n=>n.kind);this.filters.toggleKind(i,e)}toggleFavoritesOnly(){this.filters.setFavoritesOnly(!this.filters.favoritesOnly())}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-kind-palette"]],viewQuery:function(e,n){e&1&&ut(n.searchInputRef,KY,5),e&2&&tt()},decls:9,vars:13,consts:[["searchInput",""],["content",""],["data-testid","kind-palette-search",1,"kind-palette-search"],["type","button","tooltipPosition","right","data-testid","kind-palette-search-toggle",1,"kind-palette-search__icon",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-search"],["type","text","data-testid","kind-palette-search-input",1,"kind-palette-search__input",3,"input","keydown","blur","placeholder","value"],["role","toolbar","data-testid","kind-palette",1,"kind-palette"],[3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModel","pTooltip","ariaLabel","pt"],[3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],[3,"kind","size"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],["aria-hidden","true",1,"pi"]],template:function(e,n){e&1&&(f(0,"div",2)(1,"button",3),V("click",function(){return n.toggleSearch()}),R(2,"i",4),h(),f(3,"input",5,0),V("input",function(r){return n.onSearchInput(r.target.value)})("keydown",function(r){return n.onSearchKeydown(r)})("blur",function(){return n.onSearchBlur()}),h()(),f(5,"div",6),Y(6,ZY,3,9,"p-togglebutton",7,YY),I(8,JY,3,7,"p-togglebutton",8),h()),e&2&&(se("kind-palette-search--expanded",n.searchExpanded())("kind-palette-search--active",n.searchActive()),d(),E("pTooltip",n.searchExpanded()?n.texts.search.closeTooltip:n.texts.search.openTooltip),q("aria-label",n.searchExpanded()?n.texts.search.closeTooltip:n.texts.search.openTooltip)("aria-expanded",n.searchExpanded()),d(2),E("placeholder",n.texts.search.placeholder)("value",n.filters.searchText()),q("aria-label",n.texts.search.inputAriaLabel)("tabindex",n.searchExpanded()?0:-1),d(2),q("aria-label",n.texts.a11y.toolbarLabel),d(),X(n.entries()),d(2),T(n.showFavorites()?8:-1))},dependencies:[mn,fn,hn,gn,_n,Ne,Oe,qn],styles:["[_nghost-%COMP%]{position:relative;display:block;pointer-events:auto}.kind-palette[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating);margin-top:44px}.kind-palette-search[_ngcontent-%COMP%]{position:absolute;top:0;left:0;display:inline-flex;align-items:center;width:64px;height:38px;padding:4px;border:1px solid var(--sm-border);border-radius:.65rem;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);box-shadow:var(--sm-shadow-floating);overflow:hidden;transition:width .2s ease-out;z-index:1}.kind-palette-search--expanded[_ngcontent-%COMP%]{width:240px}.kind-palette-search__icon[_ngcontent-%COMP%]{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:56px;height:30px;padding:0;border:0;background:transparent;border-radius:var(--sm-radius-pill);color:var(--p-text-muted-color);cursor:pointer;transition:color .12s ease-out,width .2s ease-out,background .12s ease-out}.kind-palette-search__icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.95rem;line-height:1}.kind-palette-search__icon[_ngcontent-%COMP%]:hover, .kind-palette-search__icon[_ngcontent-%COMP%]:focus-visible{color:var(--p-text-color);background:var(--sm-bg-hover)}.kind-palette-search--expanded[_ngcontent-%COMP%] .kind-palette-search__icon[_ngcontent-%COMP%]{width:30px;color:var(--p-text-color)}.kind-palette-search--active[_ngcontent-%COMP%]:not(.kind-palette-search--expanded) .kind-palette-search__icon[_ngcontent-%COMP%]{color:var(--p-primary-color)}.kind-palette-search__input[_ngcontent-%COMP%]{flex:1;min-width:0;height:100%;border:0;outline:none;background:transparent;font-size:.8rem;color:var(--p-text-color);padding:0 .5rem 0 0;opacity:0;pointer-events:none;transition:opacity .16s ease-out}.kind-palette-search__input[_ngcontent-%COMP%]::placeholder{color:var(--p-text-muted-color)}.kind-palette-search--expanded[_ngcontent-%COMP%] .kind-palette-search__input[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0 .55rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);--p-togglebutton-icon-color: var(--p-text-muted-color);--p-togglebutton-icon-hover-color: var(--p-text-color);--p-togglebutton-icon-checked-color: var(--p-text-color);width:56px;height:30px;font-size:.72rem;font-weight:600;font-variant-numeric:tabular-nums}[_nghost-%COMP%] .kind-palette__content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .kind-palette__content>span{flex:1;text-align:right}[_nghost-%COMP%] .kind-palette__btn sm-kind-icon{display:inline-flex;align-items:center;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn[aria-pressed=true] sm-kind-icon{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--skill[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-skill)}[_nghost-%COMP%] .kind-palette__btn--agent[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-agent)}[_nghost-%COMP%] .kind-palette__btn--command[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-command)}[_nghost-%COMP%] .kind-palette__btn--markdown[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-markdown)}[_nghost-%COMP%] .kind-palette__btn--favorites .pi{font-size:.95rem;line-height:1;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn--favorites:hover .pi{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--favorites[aria-pressed=true] .pi{color:var(--p-primary-color)}"],changeDetection:0})};var Wt={a11y:{toolbarLabel:"Link kind filters"},kinds:{invokes:"Invokes",references:"References",mentions:"Mentions",supersedes:"Supersedes"},tooltips:{invokes:`Invokes:
|
|
273
|
+
"/skill-command"`,references:`References:
|
|
274
|
+
"[link](./link.md)"`,mentions:`Mention:
|
|
275
|
+
"@agent.md"`,supersedes:`Supersedes:
|
|
276
|
+
.sm annotation`}};var eX=()=>({class:"link-kind-palette__content"}),tX=t=>({content:t}),nX=(t,i)=>i.kind;function iX(t,i){if(t&1&&v(0),t&2){let e=m(2).$implicit;Le(" ",e.text," ")}}function oX(t,i){if(t&1&&R(0,"i"),t&2){let e=m(2).$implicit;Ae(e.icon)}}function rX(t,i){if(t&1&&(f(0,"span",4),I(1,iX,1,1)(2,oX,1,2,"i",5),h()),t&2){let e=m().$implicit;d(),T(e.text?1:e.icon?2:-1)}}function aX(t,i){if(t&1){let e=re();f(0,"p-togglebutton",3),V("ngModelChange",function(){let o=L(e).$implicit,r=m(2);return B(r.toggle(o.kind))}),be(1,rX,3,1,"ng-template",null,0,Rt),h()}if(t&2){let e=i.$implicit,n=m(2);E("ngModel",n.isActive(e.kind))("pTooltip",e.tooltip)("ariaLabel",e.label)("styleClass","link-kind-palette__btn link-kind-palette__btn--"+e.kind)("pt",yt(7,tX,Nt(6,eX))),q("data-testid","link-kind-palette-"+e.kind)}}function sX(t,i){if(t&1&&(f(0,"div",1),Y(1,aX,3,9,"p-togglebutton",2,nX),h()),t&2){let e=m();q("aria-label",e.texts.a11y.toolbarLabel),d(),X(e.entries())}}var nk=[{kind:"invokes",label:Wt.kinds.invokes,tooltip:Wt.tooltips.invokes,text:"/"},{kind:"references",label:Wt.kinds.references,tooltip:Wt.tooltips.references,icon:"pi pi-link"},{kind:"mentions",label:Wt.kinds.mentions,tooltip:Wt.tooltips.mentions,text:"@"},{kind:"supersedes",label:Wt.kinds.supersedes,tooltip:Wt.tooltips.supersedes,icon:"pi pi-angle-double-right"}];for(let t of nk)if(!jg.includes(t.kind))throw new Error(`link-kind-palette: unknown link kind "${t.kind}"`);var df=class t{loader=l(Lt);filters=l(pn);texts=Wt;counts=S(()=>{let i=this.loader.scan(),e=new Map;if(!i)return e;for(let n of i.links)e.set(n.kind,(e.get(n.kind)??0)+1);return e});entries=S(()=>{let i=this.counts(),e=this.filters.selectedLinkKinds(),n=new Set(e);return nk.filter(o=>(i.get(o.kind)??0)>0||n.has(o.kind))});constructor(){ie(()=>{let i=this.counts(),e=this.filters.selectedLinkKinds(),n=e.filter(o=>(i.get(o)??0)>0);n.length!==e.length&&this.filters.setLinkKinds(n)})}isActive(i){return this.filters.isLinkKindActive(i)}toggle(i){this.filters.toggleLinkKind(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-link-kind-palette"]],decls:1,vars:1,consts:[["content",""],["role","toolbar","data-testid","link-kind-palette",1,"link-kind-palette"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],["aria-hidden","true",1,"link-kind-palette__glyph"],[3,"class"]],template:function(e,n){e&1&&I(0,sX,3,1,"div",1),e&2&&T(n.entries().length>0?0:-1)},dependencies:[mn,fn,hn,gn,_n,Ne,Oe],styles:["[_nghost-%COMP%]{display:block;width:100%;pointer-events:auto}.link-kind-palette[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.link-kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);width:100%;height:30px}[_nghost-%COMP%] .link-kind-palette__content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__glyph{font-size:.95rem;line-height:1;font-weight:600;display:inline-flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__btn--invokes .link-kind-palette__glyph{color:var(--sm-edge-invokes)}[_nghost-%COMP%] .link-kind-palette__btn--invokes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-invokes-active)}[_nghost-%COMP%] .link-kind-palette__btn--references .link-kind-palette__glyph{color:var(--sm-edge-references)}[_nghost-%COMP%] .link-kind-palette__btn--references[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-references-active)}[_nghost-%COMP%] .link-kind-palette__btn--mentions .link-kind-palette__glyph{color:var(--sm-edge-mentions)}[_nghost-%COMP%] .link-kind-palette__btn--mentions[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-mentions-active)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes .link-kind-palette__glyph{color:var(--sm-edge-supersedes)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-supersedes-active)}[_nghost-%COMP%] .link-kind-palette__tooltip .p-tooltip-text{white-space:pre-line;text-align:center;line-height:1.35}"],changeDetection:0})};var ik={a11y:{toolbarLabel:"Toggle severity filters"},error:{label:"Errors",tooltip:"Only nodes with errors"},warn:{label:"Warnings",tooltip:"Only nodes with warnings"}};var rk=()=>({class:"severity-palette__content"}),ak=t=>({content:t});function cX(t,i){if(t&1&&(f(0,"span",5),R(1,"i",6),h(),f(2,"span",7),v(3),h()),t&2){let e=m(3);d(3),C(e.errorCount())}}function dX(t,i){if(t&1){let e=re();f(0,"p-togglebutton",4),V("ngModelChange",function(){L(e);let o=m(2);return B(o.toggle("error"))}),be(1,cX,4,1,"ng-template",null,0,Rt),h()}if(t&2){let e=m(2);E("ngModel",e.isActive("error"))("pTooltip",e.texts.error.tooltip)("ariaLabel",e.texts.error.label)("pt",yt(5,ak,Nt(4,rk)))}}function lX(t,i){if(t&1&&(f(0,"span",5),R(1,"i",9),h(),f(2,"span",7),v(3),h()),t&2){let e=m(3);d(3),C(e.warnCount())}}function uX(t,i){if(t&1){let e=re();f(0,"p-togglebutton",8),V("ngModelChange",function(){L(e);let o=m(2);return B(o.toggle("warn"))}),be(1,lX,4,1,"ng-template",null,0,Rt),h()}if(t&2){let e=m(2);E("ngModel",e.isActive("warn"))("pTooltip",e.texts.warn.tooltip)("ariaLabel",e.texts.warn.label)("pt",yt(5,ak,Nt(4,rk)))}}function pX(t,i){if(t&1&&(f(0,"div",1),I(1,dX,3,7,"p-togglebutton",2),I(2,uX,3,7,"p-togglebutton",3),h()),t&2){let e=m();q("aria-label",e.texts.a11y.toolbarLabel),d(),T(e.showError()?1:-1),d(),T(e.showWarn()?2:-1)}}var lf=class t{loader=l(Lt);filters=l(pn);issuePaths=l(pa);texts=ik;visibleSet=S(()=>{let i=this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()),e=new Set;for(let n of i)e.add(n.path);return e});rawErrorCount=S(()=>this.issuePaths.bySeverity().errors.size);rawWarnCount=S(()=>this.issuePaths.bySeverity().warns.size);errorCount=S(()=>ok(this.issuePaths.bySeverity().errors,this.visibleSet()));warnCount=S(()=>ok(this.issuePaths.bySeverity().warns,this.visibleSet()));showError=S(()=>this.rawErrorCount()>0||this.filters.severityErrorActive());showWarn=S(()=>this.rawWarnCount()>0||this.filters.severityWarnActive());hasAny=S(()=>this.showError()||this.showWarn());constructor(){ie(()=>{this.rawErrorCount()===0&&this.filters.severityErrorActive()&&this.filters.toggleSeverity("error"),this.rawWarnCount()===0&&this.filters.severityWarnActive()&&this.filters.toggleSeverity("warn")})}isActive(i){return this.filters.isSeverityActive(i)}toggle(i){this.filters.toggleSeverity(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-severity-palette"]],decls:1,vars:1,consts:[["content",""],["role","toolbar","data-testid","severity-palette",1,"severity-palette"],["styleClass","severity-palette__btn severity-palette__btn--error","data-testid","severity-palette-error",3,"ngModel","pTooltip","ariaLabel","pt"],["styleClass","severity-palette__btn severity-palette__btn--warn","data-testid","severity-palette-warn",3,"ngModel","pTooltip","ariaLabel","pt"],["styleClass","severity-palette__btn severity-palette__btn--error","data-testid","severity-palette-error",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],["aria-hidden","true",1,"severity-palette__glyph"],[1,"pi","pi-times-circle"],[1,"severity-palette__count"],["styleClass","severity-palette__btn severity-palette__btn--warn","data-testid","severity-palette-warn",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],[1,"pi","pi-exclamation-triangle"]],template:function(e,n){e&1&&I(0,pX,3,3,"div",1),e&2&&T(n.hasAny()?0:-1)},dependencies:[mn,fn,hn,gn,_n,Ne,Oe],styles:["[_nghost-%COMP%]{display:block;width:100%;pointer-events:auto}.severity-palette[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.severity-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0 .55rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);--p-togglebutton-icon-color: var(--p-text-muted-color);--p-togglebutton-icon-hover-color: var(--p-text-color);--p-togglebutton-icon-checked-color: var(--p-text-color);width:56px;height:30px;font-size:.72rem;font-weight:600;font-variant-numeric:tabular-nums}.severity-palette__btn--error[_ngcontent-%COMP%]{--p-togglebutton-content-checked-background: color-mix(in srgb, var(--sm-severity-error-bg) 55%, var(--sm-bg-content))}.severity-palette__btn--warn[_ngcontent-%COMP%]{--p-togglebutton-content-checked-background: color-mix(in srgb, var(--sm-severity-warn-bg) 55%, var(--sm-bg-content))}[_nghost-%COMP%] .severity-palette__content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .severity-palette__count{flex:1;text-align:right}[_nghost-%COMP%] .severity-palette__glyph{display:inline-flex;align-items:center;justify-content:center;font-size:.95rem;line-height:1}[_nghost-%COMP%] .severity-palette__btn--error .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-error) 55%,var(--p-text-muted-color))}[_nghost-%COMP%] .severity-palette__btn--warn .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-warn) 55%,var(--p-text-muted-color))}[_nghost-%COMP%] .severity-palette__btn--error:hover .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error:hover .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-error) 80%,var(--p-text-color))}[_nghost-%COMP%] .severity-palette__btn--warn:hover .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn:hover .severity-palette__count{color:color-mix(in srgb,var(--sm-severity-warn) 80%,var(--p-text-color))}[_nghost-%COMP%] .severity-palette__btn--error[aria-pressed=true] .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--error[aria-pressed=true] .severity-palette__count{color:var(--sm-severity-error)}[_nghost-%COMP%] .severity-palette__btn--warn[aria-pressed=true] .severity-palette__glyph, [_nghost-%COMP%] .severity-palette__btn--warn[aria-pressed=true] .severity-palette__count{color:var(--sm-severity-warn)}"],changeDetection:0})};function ok(t,i){let[e,n]=t.size<=i.size?[t,i]:[i,t],o=0;for(let r of e)n.has(r)&&o++;return o}var fX=(t,i)=>i.source+":"+i.tag,hX=(t,i)=>i.step;function mX(t,i){t&1&&(f(0,"span",8),v(1),h()),t&2&&(d(),C(i))}function _X(t,i){if(t&1&&(f(0,"span",12)(1,"span",28),v(2,"T"),h(),v(3),h()),t&2){let e=m(),n=J(0);E("pTooltip",e.texts.stats.tokens(n.tokensTotal)),d(3),C(e.tokensShort())}}function gX(t,i){if(t&1&&(f(0,"span",13)(1,"span",28),v(2,"B"),h(),v(3),h()),t&2){let e=m(),n=J(0);E("pTooltip",e.texts.stats.bytes(n.bytesTotal)),d(3),C(e.bytesShort())}}function vX(t,i){if(t&1&&(f(0,"span",31),v(1),h()),t&2){let e=i.$implicit;se("sm-gnode__tag-chip--author",e.source==="author")("sm-gnode__tag-chip--user",e.source==="user"),q("data-tag-source",e.source),d(),C(e.tag)}}function yX(t,i){if(t&1&&(f(0,"span",30),v(1),h()),t&2){let e=m(2),n=J(2);d(),C(e.texts.tagOverflow(n))}}function CX(t,i){if(t&1&&(f(0,"div",17),Y(1,vX,2,6,"span",29,fX),I(3,yX,2,1,"span",30),h()),t&2){m();let e=J(1),n=J(2);d(),X(e),d(2),T(n>0?3:-1)}}function bX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function xX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,bX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.topics.tooltip),d(),C(n.texts.llm.topics.label),d(2),X(e.topics)}}function wX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function SX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,wX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.facts.tooltip),d(),C(n.texts.llm.facts.label),d(2),X(e.keyFacts)}}function IX(t,i){if(t&1&&(I(0,xX,6,2,"div",32),I(1,SX,6,2,"div",32)),t&2){let e=i;T(e.topics!=null&&e.topics.length?0:-1),d(),T(e.keyFacts!=null&&e.keyFacts.length?1:-1)}}function TX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"span"),v(4),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.when.tooltip),d(),C(n.texts.llm.when.label),d(2),C(e.whenToUse)}}function EX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"span"),v(4),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.style.tooltip),d(),C(n.texts.llm.style.label),d(2),C(e.interactionStyle)}}function PX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function kX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,PX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.does.tooltip),d(),C(n.texts.llm.does.label),d(2),X(e.capabilities)}}function MX(t,i){if(t&1&&(I(0,TX,5,3,"div",32),I(1,EX,5,3,"div",32),I(2,kX,6,2,"div",32)),t&2){let e=i;T(e.whenToUse?0:-1),d(),T(e.interactionStyle?1:-1),d(),T(e.capabilities!=null&&e.capabilities.length?2:-1)}}function DX(t,i){if(t&1&&v(0),t&2){let e=i.$implicit,n=i.$index,o=i.$count;vg("",e.step,". ",e.description,"",n===o-1?"":" \xB7 ")}}function OX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"span"),Y(4,DX,1,3,null,null,hX),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.steps.tooltip),d(),C(n.texts.llm.steps.label),d(2),X(e.recipe)}}function NX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function RX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,NX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.pre.tooltip),d(),C(n.texts.llm.pre.label),d(2),X(e.preconditions)}}function AX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function FX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,AX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.out.tooltip),d(),C(n.texts.llm.out.label),d(2),X(e.outputs)}}function LX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function BX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,LX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.fx.tooltip),d(),C(n.texts.llm.fx.label),d(2),X(e.sideEffects)}}function zX(t,i){if(t&1&&(I(0,OX,6,2,"div",32),I(1,RX,6,2,"div",32),I(2,FX,6,2,"div",32),I(3,BX,6,2,"div",32)),t&2){let e=i;T(e.recipe!=null&&e.recipe.length?0:-1),d(),T(e.preconditions!=null&&e.preconditions.length?1:-1),d(),T(e.outputs!=null&&e.outputs.length?2:-1),d(),T(e.sideEffects!=null&&e.sideEffects.length?3:-1)}}function qX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"code",36),v(4),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.eg.tooltip),d(),C(n.texts.llm.eg.label),d(2),C(e.invocationExample)}}function VX(t,i){if(t&1&&(f(0,"span",35),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function HX(t,i){if(t&1&&(f(0,"div",32)(1,"span",33),v(2),h(),f(3,"div",34),Y(4,VX,2,1,"span",35,Ee),h()()),t&2){let e=m(),n=m(2);d(),E("pTooltip",n.texts.llm.fx.tooltip),d(),C(n.texts.llm.fx.label),d(2),X(e.sideEffects)}}function GX(t,i){if(t&1&&(I(0,qX,5,3,"div",32),I(1,HX,6,2,"div",32)),t&2){let e=i;T(e.invocationExample?0:-1),d(),T(e.sideEffects!=null&&e.sideEffects.length?1:-1)}}function jX(t,i){if(t&1&&(f(0,"div",22),I(1,IX,2,2),I(2,MX,3,3),I(3,zX,4,4),I(4,GX,2,2),h()),t&2){let e,n,o,r,a=m();d(),T((e=a.summaryMarkdown())?1:-1,e),d(),T((n=a.summaryAgent())?2:-1,n),d(),T((o=a.summarySkill())?3:-1,o),d(),T((r=a.summaryCommand())?4:-1,r)}}function UX(t,i){if(t&1&&(f(0,"div",23),v(1),h()),t&2){let e=m();d(),C(e.description())}}function WX(t,i){if(t&1&&(f(0,"div",37)(1,"div",38)(2,"span",39),v(3),h(),f(4,"span",40),v(5),h()()()),t&2){let e=m(),n=m();d(3),C(n.texts.meta.model),d(2),C(e.model)}}function $X(t,i){t&1&&I(0,WX,6,2,"div",37),t&2&&T(i.model?0:-1)}var KX={selected:!1,highlighted:!1,dimmed:!1},uf=class t{node=O.required();stats=O({linksIn:0,linksOut:0});summary=O(null);selection=O(KX);isFavorite=O(!1);favoriteToggle=Be();texts=Yn;expanded=Kn(!1);fmAgent=S(()=>{let i=this.node();return i.kind==="agent"?i.frontmatter:null});summaryAgent=S(()=>{let i=this.summary();return i?.kind==="agent"?i:null});summarySkill=S(()=>{let i=this.summary();return i?.kind==="skill"?i:null});summaryCommand=S(()=>{let i=this.summary();return i?.kind==="command"?i:null});summaryMarkdown=S(()=>{let i=this.summary();return i?.kind==="markdown"?i:null});hasLlmCluster=S(()=>{let i=this.summary();return i!==null&&this.hasLlmContent(i)});hasLlmContent(i){switch(i.kind){case"markdown":return(i.topics?.length??0)>0||(i.keyFacts?.length??0)>0;case"agent":return!!i.whenToUse||!!i.interactionStyle||(i.capabilities?.length??0)>0;case"skill":return(i.recipe?.length??0)>0||(i.preconditions?.length??0)>0||(i.outputs?.length??0)>0||(i.sideEffects?.length??0)>0;case"command":return!!i.invocationExample||(i.sideEffects?.length??0)>0;default:return!1}}nodeColor=S(()=>this.agentVendorColor());kindRegistry=l(ki);providerAccent=S(()=>null);bytesShort=S(()=>{let i=this.stats().bytesTotal;return i===void 0?null:Uf(i)});tokensShort=S(()=>{let i=this.stats().tokensTotal;return i===void 0?null:Uf(i)});version=S(()=>da(this.node()));stability=S(()=>la(this.node()));tagChips=S(()=>{let i=this.node(),e=[],o=i.frontmatter.tags;if(Array.isArray(o))for(let r of o)typeof r=="string"&&r.length>0&&e.push({tag:r,source:"author"});for(let r of Hg(i))e.push({tag:r,source:"user"});return e});visibleTagChips=S(()=>this.tagChips().slice(0,3));moreTagsCount=S(()=>Math.max(0,this.tagChips().length-3));agentVendorColor=S(()=>{let i=this.node();if(i.kind!=="agent")return null;let n=i.frontmatter.color;return typeof n=="string"&&n.length>0?n:null});displayName=S(()=>{let i=this.node().frontmatter;return i.name?i.name:t0(this.node().path)});description=S(()=>this.node().frontmatter.description??"");toggleExpanded(i){i.stopPropagation(),this.expanded.update(e=>!e)}toggleFavorite(i){i.stopPropagation();let e=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:e})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:17,hostBindings:function(e,n){e&2&&(q("data-kind",n.node().kind),Tt("--node-color",n.nodeColor())("--accent",n.providerAccent()),se("sm-gnode--with-color",!!n.nodeColor())("sm-gnode--deprecated",n.stability()==="deprecated")("sm-gnode--expanded",n.expanded())("sm-gnode--selected",n.selection().selected)("sm-gnode--highlighted",n.selection().highlighted)("sm-gnode--dimmed",n.selection().dimmed))},inputs:{node:[1,"node"],stats:[1,"stats"],summary:[1,"summary"],selection:[1,"selection"],isFavorite:[1,"isFavorite"],expanded:[1,"expanded"]},outputs:{favoriteToggle:"favoriteToggle",expanded:"expandedChange"},decls:34,vars:30,consts:[[1,"sm-gnode__main"],["aria-hidden","true",1,"sm-gnode__icon-box"],[3,"kind","provider","size"],[1,"sm-gnode__content"],[1,"sm-gnode__name-row"],[1,"sm-gnode__name",3,"pTooltip"],["slot","card.title.right",3,"node"],[1,"sm-gnode__actions"],["data-testid","node-card-version",1,"sm-gnode__name-version"],["type","button",1,"sm-gnode__chevron",3,"click"],["aria-hidden","true",1,"pi","pi-chevron-down"],[1,"sm-gnode__sub"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--tokens",3,"pTooltip"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--bytes",3,"pTooltip"],["type","button","data-testid","node-card-favorite",1,"sm-gnode__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["slot","card.subtitle.left",3,"node"],["data-testid","node-card-tags",1,"sm-gnode__tagrow"],[1,"sm-gnode__panel"],["data-testid","node-card-path",1,"sm-gnode__path",3,"pTooltip"],["aria-hidden","true",1,"fa-regular","fa-folder-open","sm-gnode__path-icon"],[1,"sm-gnode__path-value"],[1,"sm-gnode__llm"],[1,"sm-gnode__desc"],[1,"sm-gnode__footer"],["slot","card.footer.left",3,"node"],[1,"sm-gnode__footer-right-cluster"],["slot","card.footer.right",3,"node"],[1,"sm-gnode__sub-key"],[1,"sm-gnode__tag-chip",3,"sm-gnode__tag-chip--author","sm-gnode__tag-chip--user"],["data-testid","node-card-tags-more",1,"sm-gnode__tag-more"],[1,"sm-gnode__tag-chip"],[1,"sm-gnode__llm-line"],[1,"sm-gnode__llm-label",3,"pTooltip"],[1,"sm-gnode__chips"],[1,"sm-gnode__chip","sm-gnode__chip--llm"],[1,"sm-gnode__llm-code"],[1,"sm-gnode__meta"],[1,"sm-gnode__meta-row"],[1,"sm-gnode__meta-label"],[1,"sm-gnode__meta-value","sm-gnode__meta-value--mono"]],template:function(e,n){if(e&1&&(nt(0)(1)(2),f(3,"div",0)(4,"div",1),R(5,"sm-kind-icon",2),h(),f(6,"div",3)(7,"div",4)(8,"span",5),v(9),h(),R(10,"sm-view-contributions-host",6),h()(),f(11,"div",7),I(12,mX,2,1,"span",8),f(13,"button",9),V("click",function(r){return n.toggleExpanded(r)}),R(14,"i",10),h()(),f(15,"div",11),I(16,_X,4,2,"span",12),I(17,gX,4,2,"span",13),f(18,"button",14),V("click",function(r){return n.toggleFavorite(r)}),R(19,"i",15),h(),R(20,"sm-view-contributions-host",16),h()(),I(21,CX,4,1,"div",17),f(22,"div",18)(23,"div",19),R(24,"i",20),f(25,"span",21),v(26),h()(),I(27,jX,5,4,"div",22),I(28,UX,2,1,"div",23),I(29,$X,1,1),h(),f(30,"div",24),R(31,"sm-view-contributions-host",25),f(32,"div",26),R(33,"sm-view-contributions-host",27),h()()),e&2){let o,r,a=n.node();We(n.stats()),d();let s=We(n.visibleTagChips());d(),We(n.moreTagsCount()),d(3),E("kind",a.kind)("provider",a.provider)("size",18),d(3),E("pTooltip",n.displayName()),d(),C(n.displayName()),d(),E("node",n.node()),d(2),T((o=n.version())?12:-1,o),d(),q("aria-label",n.texts.ariaExpand),d(3),T(n.tokensShort()!==null?16:-1),d(),T(n.bytesShort()!==null?17:-1),d(),se("sm-gnode__favorite--on",n.isFavorite()),E("pTooltip",n.isFavorite()?n.texts.favoriteRemoveTooltip:n.texts.favoriteAddTooltip),q("aria-label",n.isFavorite()?n.texts.ariaFavoriteRemove:n.texts.ariaFavoriteAdd),d(),se("pi-star-fill",n.isFavorite())("pi-star",!n.isFavorite()),d(),E("node",n.node()),d(),T(s.length?21:-1),d(2),E("pTooltip",a.path),d(3),C(a.path),d(),T(n.hasLlmCluster()?27:-1),d(),T(n.description()?28:-1),d(),T((r=n.fmAgent())?29:-1,r),d(2),E("node",n.node()),d(2),E("node",n.node())}},dependencies:[qn,Ne,Oe,vn],styles:['[_nghost-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:inline-block;width:260px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:8px;box-shadow:var(--sm-shadow-card);overflow:hidden;transition:box-shadow .12s ease,border-color .12s ease,transform .12s ease;-webkit-user-select:none;user-select:none;text-align:start}[_nghost-%COMP%]:hover{box-shadow:var(--sm-shadow-card-hover)}[_nghost-%COMP%]:before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--accent)}[data-kind="skill"][_nghost-%COMP%]{--accent: var(--sm-kind-skill)}[data-kind="agent"][_nghost-%COMP%]{--accent: var(--sm-kind-agent)}[data-kind="command"][_nghost-%COMP%]{--accent: var(--sm-kind-command)}[data-kind="markdown"][_nghost-%COMP%]{--accent: var(--sm-kind-markdown)}.sm-gnode--deprecated[_nghost-%COMP%]{opacity:.55}.sm-gnode--selected[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color),0 4px 16px color-mix(in srgb,var(--p-primary-color) 25%,transparent)}.sm-gnode--highlighted[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:var(--sm-shadow-card-hover)}.sm-gnode--dimmed[_nghost-%COMP%]{opacity:.25}.sm-gnode__main[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.6rem;row-gap:.3rem;align-items:start;padding:.6rem .65rem}.sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg);width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--kind-bg);color:var(--kind-fg);flex:none;font-size:1.05rem;grid-row:1 / span 2;align-self:center}[data-kind="skill"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-skill-bg);--kind-fg: var(--sm-kind-skill-fg)}[data-kind="agent"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-agent-bg);--kind-fg: var(--sm-kind-agent-fg)}[data-kind="command"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-command-bg);--kind-fg: var(--sm-kind-command-fg)}[data-kind="markdown"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg)}.sm-gnode__content[_ngcontent-%COMP%]{min-width:0;width:100%;justify-self:stretch;display:flex;flex-direction:column;gap:.15rem}.sm-gnode__name-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;min-width:0}.sm-gnode__name-row[_ngcontent-%COMP%] > sm-view-contributions-host[_ngcontent-%COMP%]{margin-left:auto;align-self:center}.sm-gnode__name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--p-text-color);flex:0 1 auto;min-width:0}.sm-gnode__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.65rem;color:var(--sm-text-muted);background:color-mix(in srgb,var(--accent) 10%,transparent);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none;align-self:center}.sm-gnode--with-color[_nghost-%COMP%] .sm-gnode__name[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--node-color) 7%,transparent);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.2rem}.sm-gnode__confidence[_ngcontent-%COMP%]{display:flex;align-items:flex-start;font-size:.65rem;font-weight:600;font-variant-numeric:tabular-nums;line-height:1;flex:none;cursor:help;padding-top:.35rem}.sm-gnode__llm-marker--high[_ngcontent-%COMP%]{color:var(--sm-severity-success)}.sm-gnode__llm-marker--med[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__llm-marker--low[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__chevron[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);transition:transform .16s ease,background .12s ease,color .12s ease}.sm-gnode__chevron[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.7rem;line-height:1}.sm-gnode__chevron[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__chevron[_ngcontent-%COMP%]{transform:rotate(180deg)}.sm-gnode__favorite[_ngcontent-%COMP%]{position:absolute;top:-3px;right:0;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.sm-gnode__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.8rem;line-height:1}.sm-gnode__favorite[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode__favorite--on[_ngcontent-%COMP%], .sm-gnode__favorite--on[_ngcontent-%COMP%]:hover{color:var(--p-primary-color)}.sm-gnode__sub[_ngcontent-%COMP%]{position:relative;grid-column:2 / -1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);line-height:1.2;margin-top:.1rem;min-width:0;width:100%;padding-right:28px}.sm-gnode__sub-stat[_ngcontent-%COMP%]{padding:.08rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);font-weight:400;flex:none}.sm-gnode__sub-stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.15rem}.sm-gnode__sub-stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem}.sm-gnode__sub-key[_ngcontent-%COMP%]{font-weight:700}.sm-gnode__sub-stat--tokens[_ngcontent-%COMP%]{background:var(--sm-stat-tokens-bg)}.sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:var(--sm-stat-bytes-bg)}.sm-gnode__panel[_ngcontent-%COMP%]{display:none;border-top:1px solid var(--sm-border)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__panel[_ngcontent-%COMP%]{display:block}.sm-gnode__llm[_ngcontent-%COMP%]{padding:.5rem .7rem;display:flex;flex-direction:column;gap:.25rem;font-size:.75rem;line-height:1.4}.sm-gnode__llm-line[_ngcontent-%COMP%]{display:flex;gap:.4rem;align-items:baseline;color:var(--p-text-color);font-style:italic;min-width:0}.sm-gnode__llm-label[_ngcontent-%COMP%]{flex:none;font-style:normal;color:var(--sm-text-muted);font-size:.6rem;letter-spacing:.04em;text-transform:uppercase;font-weight:600;min-width:2.2rem;padding-top:.2rem;cursor:help}.sm-gnode__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.25rem;flex:1;min-width:0}.sm-gnode__chip[_ngcontent-%COMP%]{font-size:.65rem;padding:.1rem .4rem;border-radius:var(--sm-radius-sm);border:1px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);line-height:1.3}.sm-gnode__chip--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.sm-gnode__chip--allowed[_ngcontent-%COMP%]{border-style:dashed;background:transparent;color:var(--sm-text-muted)}.sm-gnode__chip--llm[_ngcontent-%COMP%]{font-style:italic}.sm-gnode__chip-required[_ngcontent-%COMP%]{color:var(--sm-severity-error);margin-left:2px}.sm-gnode__llm-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-size:.7rem;font-style:normal;color:var(--p-text-color)}.sm-gnode__path[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;padding:.4rem .7rem;font-family:var(--sm-font-mono);font-size:.68rem;color:var(--sm-text-muted);background:var(--sm-bg-hover);border-top:1px solid var(--sm-border);min-width:0}.sm-gnode__path-icon[_ngcontent-%COMP%]{flex:none;font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__path-value[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;unicode-bidi:plaintext;text-align:left}.sm-gnode__desc[_ngcontent-%COMP%]{padding:.55rem .7rem;font-size:.78rem;line-height:1.45;color:var(--p-text-color);max-height:140px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--sm-border);scrollbar-width:thin;scrollbar-color:var(--sm-border) transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--sm-border);border-radius:var(--sm-radius-sm)}.sm-gnode__meta[_ngcontent-%COMP%]{padding:.5rem .7rem;border-top:1px solid var(--sm-border);display:flex;flex-direction:column;gap:.35rem}.sm-gnode__meta-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;font-size:.7rem;min-width:0}.sm-gnode__meta-label[_ngcontent-%COMP%]{color:var(--sm-text-muted);text-transform:uppercase;letter-spacing:.04em;font-weight:600;font-size:.6rem;flex:none;min-width:60px;padding-top:.15rem}.sm-gnode__meta-value[_ngcontent-%COMP%]{color:var(--p-text-color);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm-gnode__meta-value--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.08rem .4rem;border-radius:var(--sm-radius-sm);font-size:.68rem}.sm-gnode__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.7rem;min-height:1.4rem;padding:.4rem .7rem;border-top:1px solid var(--sm-border);background:var(--sm-bg-hover);font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__footer-right-cluster[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.7rem;margin-left:auto}.sm-gnode__stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;line-height:1}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.6rem;line-height:1;display:block}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{transform:translateY(1px)}.sm-gnode__stat-num[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color);line-height:1;display:block}.sm-gnode__stat--error[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--error[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__stat--warn[_ngcontent-%COMP%]{background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--warn[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%], .sm-gnode__stat--stale[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__tagrow[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:0 .65rem .35rem}.sm-gnode__tag-chip[_ngcontent-%COMP%]{font-size:.6rem;font-family:var(--sm-font-mono);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--sm-text-muted);border:1px solid var(--sm-border);line-height:1.4}.sm-gnode__tag-chip--author[_ngcontent-%COMP%]{background:transparent;border-color:var(--accent);color:var(--accent)}.sm-gnode__tag-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})};var sk={a11y:{expand:"Expand performance HUD",collapse:"Collapse performance HUD"},units:{fps:t=>`${t} fps`,ms:t=>`${t}ms`,mb:t=>`${t} MB`,longTasks:t=>`${t} long`,domNodes:t=>`${t} dom`,nodes:(t,i)=>`${t}/${i} nodes`,links:t=>`${t} links`}};var YX=["sparkline"],XX=()=>({class:"perf-hud__content"}),ZX=t=>({content:t});function QX(t,i){if(t&1&&(f(0,"span",9),v(1),h()),t&2){let e=m(2);d(),C(e.texts.units.mb(e.heapMb()))}}function JX(t,i){if(t&1&&(f(0,"div",3)(1,"span",4),v(2),h()(),f(3,"div",5)(4,"div",6)(5,"div",7),R(6,"canvas",8,1),f(8,"span",9),v(9),h()(),f(10,"div",10)(11,"div",11),I(12,QX,2,1,"span",9),f(13,"span",9),v(14),h(),f(15,"span",9),v(16),h()()(),f(17,"div",10)(18,"div",11)(19,"span",9),v(20),h(),f(21,"span",9),v(22),h()()()()()),t&2){let e=m();d(2),C(e.texts.units.fps(e.fps())),d(),q("aria-hidden",!e.expanded()),d(6),C(e.texts.units.ms(e.frameTimeMs())),d(3),T(e.hasHeap()?12:-1),d(2),C(e.texts.units.domNodes(e.domNodes())),d(2),C(e.texts.units.longTasks(e.longTasks())),d(4),C(e.texts.units.nodes(e.visible(),e.total())),d(2),C(e.texts.units.links(e.edges()))}}var e9=30,ng=60,pf=14,ff=class t{visible=O(0);total=O(0);edges=O(0);texts=sk;destroyRef=l(at);zone=l(Un);fps=H(0);frameTimeMs=H(0);fpsSamples=H([]);sparklineCanvas=Pe("sparkline");heapMb=H(null);longTasks=H(0);domNodes=H(0);expanded=H(t9());hasHeap=S(()=>this.heapMb()!==null);constructor(){let i=0,e=0,n=performance.now(),o=n,r=0,a=c=>{let u=c-n;if(n=c,i+=1,e+=u,c-o>=1e3){let p=(c-o)/1e3,_=Math.round(i/p);this.fps.set(_),this.frameTimeMs.set(Math.round(e/Math.max(i,1))),this.heapMb.set(i9()),this.domNodes.set(document.querySelectorAll("*").length),this.fpsSamples.update(b=>{let k=b.length>=e9?b.slice(1):b.slice();return k.push(_),k}),i=0,e=0,o=c}r=requestAnimationFrame(a)};this.zone.runOutsideAngular(()=>{r=requestAnimationFrame(a)});let s=null;if(typeof PerformanceObserver<"u")try{s=new PerformanceObserver(c=>{this.longTasks.update(u=>u+c.getEntries().length)}),s.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(r),s?.disconnect()}),ie(()=>{let c=this.sparklineCanvas(),u=this.fpsSamples();c&&o9(c.nativeElement,u)})}setExpanded(i){this.expanded.set(i),n9(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-perf-hud"]],viewQuery:function(e,n){e&1&&ut(n.sparklineCanvas,YX,5),e&2&&tt()},inputs:{visible:[1,"visible"],total:[1,"total"],edges:[1,"edges"]},decls:3,vars:7,consts:[["content",""],["sparkline",""],["data-testid","perf-hud",3,"ngModelChange","ngModel","ariaLabel","styleClass","pt"],[1,"perf-hud__header"],[1,"perf-hud__cell","perf-hud__cell--fps"],[1,"perf-hud__expandable"],[1,"perf-hud__expandable-inner"],[1,"perf-hud__row","perf-hud__row--sparkline"],["aria-hidden","true",1,"perf-hud__sparkline"],[1,"perf-hud__cell"],[1,"perf-hud__section"],[1,"perf-hud__row"]],template:function(e,n){e&1&&(f(0,"p-togglebutton",2),V("ngModelChange",function(r){return n.setExpanded(r)}),be(1,JX,23,8,"ng-template",null,0,Rt),h()),e&2&&E("ngModel",n.expanded())("ariaLabel",n.expanded()?n.texts.a11y.collapse:n.texts.a11y.expand)("styleClass",n.expanded()?"perf-hud perf-hud--expanded":"perf-hud")("pt",yt(5,ZX,Nt(4,XX)))},dependencies:[mn,fn,hn,gn,_n],styles:["[_nghost-%COMP%]{position:absolute;bottom:16px;left:16px;z-index:2;pointer-events:none}.perf-hud[_ngcontent-%COMP%]{pointer-events:auto;--p-togglebutton-padding: 0;--p-togglebutton-content-padding: .25rem .7rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: var(--sm-bg-content);--p-togglebutton-checked-background: var(--sm-bg-content);--p-togglebutton-hover-background: var(--sm-bg-content);--p-togglebutton-border-color: var(--sm-border);--p-togglebutton-checked-border-color: var(--sm-border);--p-togglebutton-content-checked-background: transparent;--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-muted-color);box-shadow:var(--sm-shadow-floating);font-family:var(--sm-font-mono);font-size:.7rem;font-weight:500;line-height:14px;opacity:.75;transition:opacity .15s ease,color .15s ease}.perf-hud[_ngcontent-%COMP%]:hover{opacity:1}.perf-hud--expanded[_ngcontent-%COMP%]{--p-togglebutton-border-radius: var(--sm-radius-md);--p-togglebutton-content-border-radius: var(--sm-radius-md);--p-togglebutton-content-padding: .45rem .7rem;line-height:1.35;opacity:.95}[_nghost-%COMP%] .perf-hud__content{display:flex;flex-direction:column;align-items:stretch;gap:0}.perf-hud__cell[_ngcontent-%COMP%]{white-space:nowrap;font-variant-numeric:tabular-nums}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__cell--fps[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color)}.perf-hud__sparkline[_ngcontent-%COMP%]{width:60px;height:14px;opacity:.6}.perf-hud__header[_ngcontent-%COMP%]{display:flex;align-items:center}.perf-hud__expandable[_ngcontent-%COMP%]{display:grid;grid-template-rows:0fr;grid-template-columns:0fr;overflow:hidden;transition:grid-template-rows .22s ease,grid-template-columns .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable[_ngcontent-%COMP%]{grid-template-rows:1fr;grid-template-columns:1fr}.perf-hud__expandable-inner[_ngcontent-%COMP%]{min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;gap:.3rem;padding-top:0;transition:padding-top .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable-inner[_ngcontent-%COMP%]{padding-top:.3rem}.perf-hud__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem;padding-top:.3rem;border-top:1px solid var(--sm-border)}.perf-hud__section[_ngcontent-%COMP%]:first-child{padding-top:0;border-top:0}.perf-hud__row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.6rem;white-space:nowrap}.perf-hud__row--sparkline[_ngcontent-%COMP%]{justify-content:space-between;gap:.6rem}"],changeDetection:0})},ck="sm.perf-hud.expanded";function t9(){try{return localStorage.getItem(ck)==="1"}catch{return!1}}function n9(t){try{localStorage.setItem(ck,t?"1":"0")}catch{}}function i9(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function o9(t,i){let e=window.devicePixelRatio||1,n=ng*e,o=pf*e;(t.width!==n||t.height!==o)&&(t.width=n,t.height=o);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,ng,pf),i.length<2))return;let a=Math.max(60,...i),s=ng/(i.length-1);r.beginPath();for(let c=0;c<i.length;c+=1){let u=c*s,p=pf-i[c]/a*pf;c===0?r.moveTo(u,p):r.lineTo(u,p)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var r9="debug-perf",hf=class t{visible=H(this.resolveInitial());resolveInitial(){let e=new URLSearchParams(window.location.search).get(r9);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:po.graph.perfHud}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};var Vn={emptyNoSelection:{title:"No node selected",descPrefix:"Pick a node from the ",listLink:"files",descMiddle:" or ",mapLink:"map",descSuffix:"."},emptyNotFound:{title:"Node not found",descSuffix:" does not exist in the collection. ",backLink:"Back to files",descAfterLink:"."},backToList:"\u2190 back to files",sections:{annotations:"Annotations",connections:"Connections",findings:"Findings",audit:"Audit",plugins:"Plugin contributions",viewContributions:"View contributions",debug:"Debug",body:"Body"},body:{loading:"Loading body\u2026",empty:"This file has no body content (only frontmatter).",unavailable:"Body content unavailable. The source file may have moved or been deleted since the last scan.",renderError:"Failed to render markdown body.",refreshLabel:"Refresh body"},bump:{label:"Bump version",tooltipEnabled:"Increment the sidecar version and refresh hashes.",tooltipDisabledFresh:"No drift detected (bump is only available when the body or frontmatter has changed since the last bump).",tooltipDisabledNoSidecar:"No sidecar yet. Run `sm sidecar annotate <path>` from your terminal to create one.",errorPrefix:"Bump failed:",errorFresh:"This node is fresh; nothing to bump.",errorNotFound:"Node not found on the server.",errorGeneric:"Could not bump the sidecar.",consentHeader:"Allow skill-map to create files in this project?",consentMessage:`Skill-map will create companion files (*.sm) next to your markdown files to track version, history and tags. Your markdown stays clean, metadata never gets mixed into the content you wrote.
|
|
277
|
+
|
|
278
|
+
The choice is per-project and per-machine, it does not travel with the repo, and we won't ask again.`,consentAccept:"Yes, allow",consentReject:"Not now",consentDialogAriaLabel:"Sidecar consent"},stats:{bytes:"bytes",tokens:"tokens",out:"out",in:"in",ext:"external"},findingHintLabel:"Hint:",bumpErrorDismissAriaLabel:"Dismiss",audit:{headerSummary:(t,i)=>`last bumped ${t} by ${i}`,headerEmpty:"never bumped",fields:{lastBumpedAt:"Last bumped",lastBumpedBy:"by",createdAt:"Created",createdBy:"by"}},supersededByBanner:t=>`Superseded by ${t}`,debugToggleAriaLabel:"Toggle debug panel",debugToggleTooltip:"Show diagnostic fields (hash diffs, resolved provider/kind, sidecar status enum).",actionMocks:{label:"Actions",summary:"Generate summary",audit:"Run audit",validate:"Validate"},close:{label:"Close",tooltip:"Close inspector"}};var mf=class t{dataSource=l(un);async bump(i,e={}){return this.dataSource.bumpSidecar(i,e)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})};var dk={cardHeader:"Annotations",emptyOverlay:"No sidecar (.sm) file present for this node.",emptyAnnotations:"Sidecar present but no annotations are declared yet.",sections:{lifecycle:"Lifecycle",supersession:"Supersession",provenance:"Provenance",taxonomy:"Taxonomy",docs:"Docs"},fields:{version:"Version",stability:"Stability",supersedes:"Supersedes",supersededBy:"Superseded by",authors:"Authors",license:"License",source:"Source",sourceVersion:"Source version",tags:"Tags",docsUrl:"Docs URL"},brokenRefTooltip:"This path does not resolve to a node in the current scan scope."};function zr(t){if(typeof t!="string"||t.length===0)return null;try{let i=new URL(t);return i.protocol==="http:"||i.protocol==="https:"?t:null}catch{return null}}var s9=(t,i)=>"a:"+i,c9=(t,i)=>"u:"+i;function d9(t,i){if(t&1&&(f(0,"p",1),v(1),h()),t&2){let e=m(2);d(),C(e.texts.emptyOverlay)}}function l9(t,i){if(t&1&&(f(0,"p",2),v(1),h()),t&2){let e=m(2);d(),C(e.texts.emptyAnnotations)}}function u9(t,i){if(t&1&&I(0,d9,2,1,"p",1)(1,l9,2,1,"p",2),t&2){let e,n=m();T((e=n.overlay())!=null&&e.present?1:0)}}function p9(t,i){if(t&1&&(f(0,"code",4),v(1),h()),t&2){m();let e=J(0);d(),Le("v",e.version)}}function f9(t,i){if(t&1&&R(0,"p-tag",5),t&2){m();let e=J(0),n=m(2);E("value",e.stability)("severity",n.stabilitySeverity(e.stability))("rounded",!0)}}function h9(t,i){if(t&1&&(nt(0),f(1,"dt"),v(2),h(),f(3,"dd",3),I(4,p9,2,1,"code",4),I(5,f9,1,3,"p-tag",5),h()),t&2){let e=m(2),n=We(e.lifecycle());d(2),C(e.texts.sections.lifecycle),d(2),T(n.version!==null?4:-1),d(),T(n.stability!==null?5:-1)}}function m9(t,i){if(t&1){let e=re();f(0,"span",7),R(1,"i",8),f(2,"span"),v(3),h()(),f(4,"p-chip",9),V("click",function(){L(e),m();let o=J(0),r=m(2);return B(r.onOpenPath(o.supersededBy))}),h()}if(t&2){m();let e=J(0),n=m(2);d(3),C(n.texts.fields.supersededBy),d(),E("label",e.supersededBy)("styleClass",n.isBroken(e.supersededBy)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e.supersededBy)?n.texts.brokenRefTooltip:"")}}function _9(t,i){if(t&1){let e=re();f(0,"p-chip",9),V("click",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpenPath(o))}),h()}if(t&2){let e=i.$implicit,n=m(4);E("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function g9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",10),f(2,"span"),v(3),h()(),Y(4,_9,1,3,"p-chip",11,Ee)),t&2){m();let e=J(0),n=m(2);d(3),C(n.texts.fields.supersedes),d(),X(e.supersedes)}}function v9(t,i){if(t&1&&(nt(0),f(1,"dt"),v(2),h(),f(3,"dd",6),I(4,m9,5,4),I(5,g9,6,1),h()),t&2){let e=m(2),n=We(e.supersession());d(2),C(e.texts.sections.supersession),d(2),T(n.supersededBy!==null?4:-1),d(),T(n.supersedes.length?5:-1)}}function y9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",13),f(2,"span"),v(3),h()()),t&2){let e=i.$implicit;d(3),C(e)}}function C9(t,i){if(t&1&&Y(0,y9,4,1,"span",7,Ee),t&2){m();let e=J(0);X(e.authors)}}function b9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",14),f(2,"span"),v(3),h()()),t&2){m();let e=J(0);d(3),C(e.license)}}function x9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",15),f(2,"a",16),v(3),h()()),t&2){m();let e=J(0);d(2),E("href",e.source,yo),d(),C(e.source)}}function w9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",17),f(2,"code"),v(3),h()()),t&2){m();let e=J(0);d(3),C(e.sourceVersion)}}function S9(t,i){if(t&1&&(nt(0),f(1,"dt"),v(2),h(),f(3,"dd",12),I(4,C9,2,0),I(5,b9,4,1,"span",7),I(6,x9,4,2,"span",7),I(7,w9,4,1,"span",7),h()),t&2){let e=m(2),n=We(e.provenance());d(2),C(e.texts.sections.provenance),d(2),T(n.authors.length?4:-1),d(),T(n.license!==null?5:-1),d(),T(n.source!==null?6:-1),d(),T(n.sourceVersion!==null?7:-1)}}function I9(t,i){if(t&1){let e=re();f(0,"p-chip",22),V("click",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.enter",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.space",function(o){let r=L(e).$implicit;return m(3).tagClick.emit(r),B(o.preventDefault())}),h()}if(t&2){let e=i.$implicit,n=m(3);E("label",e)("styleClass","ann-panel__chip ann-panel__chip--author"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function T9(t,i){if(t&1){let e=re();f(0,"p-chip",23),V("click",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.enter",function(){let o=L(e).$implicit,r=m(3);return B(r.tagClick.emit(o))})("keydown.space",function(o){let r=L(e).$implicit;return m(3).tagClick.emit(r),B(o.preventDefault())}),h()}if(t&2){let e=i.$implicit,n=m(3);E("label",e)("styleClass","ann-panel__chip ann-panel__chip--user"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function E9(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",18)(3,"div",19),Y(4,I9,1,2,"p-chip",20,s9),Y(6,T9,1,2,"p-chip",21,c9),h()()),t&2){let e=m(2),n=e.taxonomy();d(),C(e.texts.fields.tags),d(3),X(n.authorTags),d(2),X(n.userTags)}}function P9(t,i){if(t&1&&(f(0,"span",7),R(1,"i",25),f(2,"a",16),v(3),h()()),t&2){m();let e=J(0);d(2),E("href",e.docsUrl,yo),d(),C(e.docsUrl)}}function k9(t,i){if(t&1&&(nt(0),f(1,"dt"),v(2),h(),f(3,"dd",24),I(4,P9,4,2,"span",7),h()),t&2){let e=m(2),n=We(e.docs());d(2),C(e.texts.sections.docs),d(2),T(n.docsUrl!==null?4:-1)}}function M9(t,i){if(t&1&&(f(0,"dl",0),I(1,h9,6,4),I(2,v9,6,4),I(3,S9,8,6),I(4,E9,8,1),I(5,k9,5,3),h()),t&2){let e=m();d(),T(e.hasLifecycle()?1:-1),d(),T(e.hasSupersession()?2:-1),d(),T(e.hasProvenance()?3:-1),d(),T(e.hasTaxonomy()?4:-1),d(),T(e.hasDocs()?5:-1)}}var gf=class t{overlay=O(void 0);authorTags=O([]);knownPaths=O(null);openPath=Be();tagClick=Be();activeTag=O(null);isActiveTag(i){return this.activeTag()===i}texts=dk;annotations=S(()=>{let i=this.overlay();return!i||!i.present?null:i.annotations??null});hasAnnotations=S(()=>{let i=this.annotations();return i!==null&&Object.keys(i).length>0});hasAnyContent=S(()=>this.hasLifecycle()||this.hasSupersession()||this.hasProvenance()||this.hasTaxonomy()||this.hasDocs());lifecycle=S(()=>{let i=this.annotations()??{};return{version:D9(i.version),stability:O9(i.stability)}});hasLifecycle=S(()=>_f(this.lifecycle()));supersession=S(()=>{let i=this.annotations()??{};return{supersedes:og(i.supersedes),supersededBy:ig(i.supersededBy)}});hasSupersession=S(()=>_f(this.supersession()));provenance=S(()=>{let i=this.annotations()??{};return{authors:og(i.authors),license:ig(i.license),source:zr(i.source),sourceVersion:ig(i.sourceVersion)}});hasProvenance=S(()=>_f(this.provenance()));taxonomy=S(()=>{let i=this.annotations()??{};return{authorTags:this.authorTags(),userTags:og(i.tags)}});hasTaxonomy=S(()=>{let i=this.taxonomy();return i.authorTags.length>0||i.userTags.length>0});docs=S(()=>{let i=this.annotations()??{};return{docsUrl:zr(i.docsUrl)}});hasDocs=S(()=>_f(this.docs()));stabilitySeverity(i){return o0[i]}isBroken(i){let e=this.knownPaths();return e?!e.has(i):!1}onOpenPath(i){this.isBroken(i)||this.openPath.emit(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-annotations-panel"]],inputs:{overlay:[1,"overlay"],authorTags:[1,"authorTags"],knownPaths:[1,"knownPaths"],activeTag:[1,"activeTag"]},outputs:{openPath:"openPath",tagClick:"tagClick"},decls:2,vars:1,consts:[[1,"ann-panel__rows","sm-block__kv"],["data-testid","annotations-panel-empty-overlay",1,"ann-panel__empty"],["data-testid","annotations-panel-empty-annotations",1,"ann-panel__empty"],["data-testid","annotations-section-lifecycle",1,"ann-panel__inline"],["data-testid","annotations-version"],["data-testid","annotations-stability",3,"value","severity","rounded"],["data-testid","annotations-section-supersession",1,"ann-panel__inline"],[1,"ann-panel__meta"],["aria-hidden","true",1,"pi","pi-arrow-down"],[3,"click","label","styleClass","pTooltip"],["aria-hidden","true",1,"pi","pi-arrow-up"],[3,"label","styleClass","pTooltip"],["data-testid","annotations-section-provenance",1,"ann-panel__inline"],["aria-hidden","true",1,"pi","pi-user"],["aria-hidden","true",1,"pi","pi-shield"],["aria-hidden","true",1,"pi","pi-link"],["target","_blank","rel","noopener noreferrer",3,"href"],["aria-hidden","true",1,"pi","pi-tag"],["data-testid","annotations-section-taxonomy",1,"ann-panel__chips"],["data-testid","annotations-tags",1,"ann-panel__chips-row"],["data-tag-source","author","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","author","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"],["data-testid","annotations-section-docs",1,"ann-panel__inline"],["aria-hidden","true",1,"pi","pi-external-link"]],template:function(e,n){e&1&&I(0,u9,2,1)(1,M9,6,5,"dl",0),e&2&&T(n.hasAnyContent()?1:0)},dependencies:[fa,i0,ma,ha,Ne,Oe],styles:["[_nghost-%COMP%]{display:block}.ann-panel__empty[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-style:italic;font-size:.85rem;margin:0}.ann-panel__rows[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{display:flex;align-items:center}.ann-panel__inline[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .65rem;row-gap:.35rem}.ann-panel__meta[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;font-size:.83rem;color:var(--p-text-color)}.ann-panel__meta[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-size:.85rem}.ann-panel__meta[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--p-primary-color);word-break:break-all}.ann-panel__meta[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);font-size:.78rem}.ann-panel__chips[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap}.ann-panel__chips-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.3rem}[_nghost-%COMP%] .chip--broken{background:var(--sm-bg-hover);color:var(--sm-text-muted);text-decoration:line-through;cursor:not-allowed}[_nghost-%COMP%] .chip--link{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover{background:var(--p-primary-100)}[_nghost-%COMP%] .ann-panel__chip--author{background:transparent;border:1px solid var(--p-primary-color);color:var(--p-primary-color)}[_nghost-%COMP%] .ann-panel__chip--user{background:var(--p-chip-background);color:var(--p-chip-color)}[_nghost-%COMP%] .ann-panel__chip--author, [_nghost-%COMP%] .ann-panel__chip--user{cursor:pointer;transition:filter .1s ease,box-shadow .1s ease}[_nghost-%COMP%] .ann-panel__chip--author:hover, [_nghost-%COMP%] .ann-panel__chip--user:hover{filter:brightness(1.05)}[_nghost-%COMP%] .ann-panel__chip--author:focus-visible, [_nghost-%COMP%] .ann-panel__chip--user:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}[_nghost-%COMP%] .ann-panel__chip--active{background:var(--p-primary-color);color:var(--p-primary-color-text);border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-200)}"],changeDetection:0})};function D9(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function ig(t){return typeof t=="string"&&t.length>0?t:null}function O9(t){return t==="stable"||t==="experimental"||t==="deprecated"?t:null}function og(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function _f(t){for(let i of Object.values(t))if(i!=null){if(Array.isArray(i)){if(i.length>0)return!0;continue}if(typeof i=="string"){if(i.length>0)return!0;continue}return!0}return!1}var lk=`
|
|
279
|
+
.p-card {
|
|
280
|
+
background: dt('card.background');
|
|
281
|
+
color: dt('card.color');
|
|
282
|
+
box-shadow: dt('card.shadow');
|
|
283
|
+
border-radius: dt('card.border.radius');
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.p-card-caption {
|
|
289
|
+
display: flex;
|
|
290
|
+
flex-direction: column;
|
|
291
|
+
gap: dt('card.caption.gap');
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.p-card-body {
|
|
295
|
+
padding: dt('card.body.padding');
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
gap: dt('card.body.gap');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.p-card-title {
|
|
302
|
+
font-size: dt('card.title.font.size');
|
|
303
|
+
font-weight: dt('card.title.font.weight');
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.p-card-subtitle {
|
|
307
|
+
color: dt('card.subtitle.color');
|
|
308
|
+
}
|
|
309
|
+
`;var N9=["header"],R9=["title"],A9=["subtitle"],F9=["content"],L9=["footer"],B9=["*",[["p-header"]],[["p-footer"]]],z9=["*","p-header","p-footer"];function q9(t,i){t&1&&Ii(0)}function V9(t,i){if(t&1&&(f(0,"div",1),De(1,1),be(2,q9,1,0,"ng-container",2),h()),t&2){let e=m();Ae(e.cx("header")),E("pBind",e.ptm("header")),d(2),E("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function H9(t,i){if(t&1&&(Wn(0),v(1),$n()),t&2){let e=m(2);d(),C(e.header)}}function G9(t,i){t&1&&Ii(0)}function j9(t,i){if(t&1&&(f(0,"div",1),be(1,H9,2,1,"ng-container",3)(2,G9,1,0,"ng-container",2),h()),t&2){let e=m();Ae(e.cx("title")),E("pBind",e.ptm("title")),d(),E("ngIf",e.header&&!e._titleTemplate&&!e.titleTemplate),d(),E("ngTemplateOutlet",e.titleTemplate||e._titleTemplate)}}function U9(t,i){if(t&1&&(Wn(0),v(1),$n()),t&2){let e=m(2);d(),C(e.subheader)}}function W9(t,i){t&1&&Ii(0)}function $9(t,i){if(t&1&&(f(0,"div",1),be(1,U9,2,1,"ng-container",3)(2,W9,1,0,"ng-container",2),h()),t&2){let e=m();Ae(e.cx("subtitle")),E("pBind",e.ptm("subtitle")),d(),E("ngIf",e.subheader&&!e._subtitleTemplate&&!e.subtitleTemplate),d(),E("ngTemplateOutlet",e.subtitleTemplate||e._subtitleTemplate)}}function K9(t,i){t&1&&Ii(0)}function Y9(t,i){t&1&&Ii(0)}function X9(t,i){if(t&1&&(f(0,"div",1),De(1,2),be(2,Y9,1,0,"ng-container",2),h()),t&2){let e=m();Ae(e.cx("footer")),E("pBind",e.ptm("footer")),d(2),E("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var Z9=`
|
|
310
|
+
${lk}
|
|
311
|
+
|
|
312
|
+
.p-card {
|
|
313
|
+
display: block;
|
|
314
|
+
}
|
|
315
|
+
`,Q9={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},uk=(()=>{class t extends ta{name="card";style=Z9;classes=Q9;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var pk=new ue("CARD_INSTANCE"),rg=(()=>{class t extends ia{componentName="Card";$pcCard=l(pk,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=l(Ft,{self:!0});_componentStyle=l(uk);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}header;subheader;set style(e){Pg(this._style(),e)||(this._style.set(e),this.el?.nativeElement&&e&&Object.keys(e).forEach(n=>{this.el.nativeElement.style[n]=e[n]}))}get style(){return this._style()}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=H(null);getBlockableElement(){return this.el.nativeElement}templates;onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"header":this._headerTemplate=e.template;break;case"title":this._titleTemplate=e.template;break;case"subtitle":this._subtitleTemplate=e.template;break;case"content":this._contentTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ee(t)))(o||t)}})();static \u0275cmp=K({type:t,selectors:[["p-card"]],contentQueries:function(n,o,r){if(n&1&&Yr(r,Mg,5)(r,Dg,5)(r,N9,4)(r,R9,4)(r,A9,4)(r,F9,4)(r,L9,4)(r,Pi,4),n&2){let a;gt(a=vt())&&(o.headerFacet=a.first),gt(a=vt())&&(o.footerFacet=a.first),gt(a=vt())&&(o.headerTemplate=a.first),gt(a=vt())&&(o.titleTemplate=a.first),gt(a=vt())&&(o.subtitleTemplate=a.first),gt(a=vt())&&(o.contentTemplate=a.first),gt(a=vt())&&(o.footerTemplate=a.first),gt(a=vt())&&(o.templates=a)}},hostVars:4,hostBindings:function(n,o){n&2&&(Xr(o._style()),Ae(o.cn(o.cx("root"),o.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[ge([uk,{provide:pk,useExisting:t},{provide:na,useExisting:t}]),Wr([Ft]),he],ngContentSelectors:z9,decls:8,vars:11,consts:[[3,"pBind","class",4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(n,o){n&1&&(Kt(B9),be(0,V9,3,4,"div",0),f(1,"div",1),be(2,j9,3,5,"div",0)(3,$9,3,5,"div",0),f(4,"div",1),De(5),be(6,K9,1,0,"ng-container",2),h(),be(7,X9,3,4,"div",0),h()),n&2&&(E("ngIf",o.headerFacet||o.headerTemplate||o._headerTemplate),d(),Ae(o.cx("body")),E("pBind",o.ptm("body")),d(),E("ngIf",o.header||o.titleTemplate||o._titleTemplate),d(),E("ngIf",o.subheader||o.subtitleTemplate||o._subtitleTemplate),d(),Ae(o.cx("content")),E("pBind",o.ptm("content")),d(2),E("ngTemplateOutlet",o.contentTemplate||o._contentTemplate),d(),E("ngIf",o.footerFacet||o.footerTemplate||o._footerTemplate))},dependencies:[Ti,yg,Qr,cn,oa,Ft],encapsulation:2,changeDetection:0})}return t})(),fk=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=wi({type:t});static \u0275inj=Ci({imports:[rg,cn,oa,cn,oa]})}return t})();var hk={cardHeader:"Linked nodes",refreshLabel:"Refresh links",outgoingHeader:"Outgoing",incomingHeader:"Incoming",findingsHeader:"Findings",emptyFindings:"No findings on this node.",loading:"Loading links\u2026",error:"Failed to load links.",emptyOutgoing:"No outgoing links from this node.",emptyIncoming:"No incoming links to this node.",confidence:{high:"high",medium:"medium",low:"low"},sourcesPrefix:"detected by ",sourcesSeparator:", ",issueOnTargetTooltip:"Target has an issue: ",issueOnSourceTooltip:"Source has an issue: ",occurrencesHeader:"Occurs at:",occurrencesItem:"line {{line}} \xB7 `{{trigger}}` ({{extractor}})",occurrencesItemUnknownLine:"`{{trigger}}` ({{extractor}})",externalRefsHeader:"External references",emptyExternalRefs:"No external URLs in this node's body.",externalRefsItemLine:"line {{line}}",externalRefsItemUnknownLine:"unknown line"};var eZ=(t,i)=>i.url+"|"+(i.line??-1),tZ=(t,i)=>i.analyzerId+"|"+((i.data==null?null:i.data.target)??"")+"|"+i.message,_k=(t,i)=>i.source+"|"+i.target+"|"+i.kind+"|"+((i.trigger==null?null:i.trigger.normalizedTrigger)??""),gk=(t,i)=>i.extractor+"|"+i.originalTrigger+"|"+((i.location==null?null:i.location.line)??-1);function nZ(t,i){if(t&1){let e=re();f(0,"div",4)(1,"h3",5),v(2),h(),f(3,"p-button",6),V("onClick",function(){L(e);let o=m(2);return B(o.refresh())}),h()()}if(t&2){let e=m(2);d(2),C(e.texts.cardHeader),d(),E("rounded",!0)("text",!0)("ariaLabel",e.texts.refreshLabel)("pTooltip",e.texts.refreshLabel)("disabled",e.state()==="loading")}}function iZ(t,i){if(t&1&&(f(0,"p",2),v(1),h()),t&2){let e=m(2);d(),C(e.texts.loading)}}function oZ(t,i){if(t&1&&(f(0,"p",3),v(1),h()),t&2){let e=m(2);d(),C(e.texts.error)}}function rZ(t,i){if(t&1&&v(0),t&2){let e=m().$implicit,n=m(4);Le(" ",n.texts.externalRefsItemLine.replace("{{line}}",e.line.toString())," ")}}function aZ(t,i){if(t&1&&v(0),t&2){let e=m(5);Le(" ",e.texts.externalRefsItemUnknownLine," ")}}function sZ(t,i){if(t&1&&(f(0,"li",16)(1,"span",17),I(2,rZ,1,1)(3,aZ,1,1),h(),f(4,"a",18),v(5),h()()),t&2){let e=i.$implicit;q("data-testid","linked-nodes-external-ref-"+e.url),d(2),T(e.line?2:3),d(2),E("href",e.url,yo),d(),C(e.url)}}function cZ(t,i){if(t&1&&(f(0,"section",7)(1,"h4",9),v(2),h(),f(3,"ul",11),Y(4,sZ,6,4,"li",16,eZ),h()()),t&2){let e=m(3);d(2),C(e.texts.externalRefsHeader),d(2),X(e.externalRefs())}}function dZ(t,i){if(t&1&&(f(0,"p",10),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyFindings)}}function lZ(t,i){if(t&1&&(f(0,"li",19),R(1,"p-tag",20),f(2,"span",21),v(3),h()()),t&2){let e=i.$implicit,n=m(4);q("data-testid","linked-nodes-finding-"+e.analyzerId),d(),E("value",e.analyzerId)("severity",n.issueSeverity(e.severity))("rounded",!0),d(2),C(e.message)}}function uZ(t,i){if(t&1&&(f(0,"ul",11),Y(1,lZ,4,5,"li",19,tZ),h()),t&2){let e=m(3);d(),X(e.findings())}}function pZ(t,i){if(t&1&&(f(0,"p",13),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyOutgoing)}}function fZ(t,i){if(t&1&&R(0,"p-tag",25),t&2){let e=i,n=m().$implicit,o=m(4);E("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),q("data-testid","linked-nodes-outgoing-issue-"+n.target)}}function hZ(t,i){if(t&1&&(f(0,"span",26),v(1),h()),t&2){let e=m().$implicit,n=m(4);d(),Vf(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function mZ(t,i){if(t&1&&(f(0,"li",29),v(1),h()),t&2){let e=i.$implicit,n=m(6);d(),C(n.occurrenceLabel(e))}}function _Z(t,i){if(t&1&&(f(0,"ul",27)(1,"li",28),v(2),h(),Y(3,mZ,2,1,"li",29,gk),h()),t&2){let e=m().$implicit,n=m(4);q("data-testid","linked-nodes-occurrences-"+e.target),d(2),C(n.texts.occurrencesHeader),d(),X(e.occurrences)}}function gZ(t,i){if(t&1){let e=re();f(0,"li",22),R(1,"p-tag",23),f(2,"p-button",24),V("onClick",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpen(o.target))}),h(),R(3,"p-tag",25),I(4,fZ,1,5,"p-tag",25),I(5,hZ,2,2,"span",26),I(6,_Z,5,2,"ul",27),h()}if(t&2){let e,n=i.$implicit,o=m(4);q("data-testid","linked-nodes-outgoing-row-"+n.target),d(),E("value",n.kind)("severity",o.kindSeverity(n.kind)),d(),E("link",!0)("label",n.target),q("data-testid","linked-nodes-outgoing-link-"+n.target),d(),E("value",o.confidenceValue(n.confidence))("severity",o.confidenceSeverity(n.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(n.confidence)),d(),T((e=o.issueForOutgoing(n))?4:-1,e),d(),T(n.sources.length?5:-1),d(),T(n.occurrences&&n.occurrences.length>0?6:-1)}}function vZ(t,i){if(t&1&&(f(0,"ul",11),Y(1,gZ,7,13,"li",22,_k),h()),t&2){let e=m(3);d(),X(e.outgoing())}}function yZ(t,i){if(t&1&&(f(0,"p",15),v(1),h()),t&2){let e=m(3);d(),C(e.texts.emptyIncoming)}}function CZ(t,i){if(t&1&&R(0,"p-tag",25),t&2){let e=i,n=m().$implicit,o=m(4);E("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),q("data-testid","linked-nodes-incoming-issue-"+n.source)}}function bZ(t,i){if(t&1&&(f(0,"span",26),v(1),h()),t&2){let e=m().$implicit,n=m(4);d(),Vf(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function xZ(t,i){if(t&1&&(f(0,"li",29),v(1),h()),t&2){let e=i.$implicit,n=m(6);d(),C(n.occurrenceLabel(e))}}function wZ(t,i){if(t&1&&(f(0,"ul",27)(1,"li",28),v(2),h(),Y(3,xZ,2,1,"li",29,gk),h()),t&2){let e=m().$implicit,n=m(4);q("data-testid","linked-nodes-occurrences-"+e.target),d(2),C(n.texts.occurrencesHeader),d(),X(e.occurrences)}}function SZ(t,i){if(t&1){let e=re();f(0,"li",22),R(1,"p-tag",23),f(2,"p-button",24),V("onClick",function(){let o=L(e).$implicit,r=m(4);return B(r.onOpen(o.source))}),h(),R(3,"p-tag",25),I(4,CZ,1,5,"p-tag",25),I(5,bZ,2,2,"span",26),I(6,wZ,5,2,"ul",27),h()}if(t&2){let e,n=i.$implicit,o=m(4);q("data-testid","linked-nodes-incoming-row-"+n.source),d(),E("value",n.kind)("severity",o.kindSeverity(n.kind)),d(),E("link",!0)("label",n.source),q("data-testid","linked-nodes-incoming-link-"+n.source),d(),E("value",o.confidenceValue(n.confidence))("severity",o.confidenceSeverity(n.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(n.confidence)),d(),T((e=o.issueForIncoming(n))?4:-1,e),d(),T(n.sources.length?5:-1),d(),T(n.occurrences&&n.occurrences.length>0?6:-1)}}function IZ(t,i){if(t&1&&(f(0,"ul",11),Y(1,SZ,7,13,"li",22,_k),h()),t&2){let e=m(3);d(),X(e.incoming())}}function TZ(t,i){if(t&1&&(I(0,cZ,6,1,"section",7),f(1,"section",8)(2,"h4",9),v(3),h(),I(4,dZ,2,1,"p",10)(5,uZ,3,0,"ul",11),h(),f(6,"section",12)(7,"h4",9),v(8),h(),I(9,pZ,2,1,"p",13)(10,vZ,3,0,"ul",11),h(),f(11,"section",14)(12,"h4",9),v(13),h(),I(14,yZ,2,1,"p",15)(15,IZ,3,0,"ul",11),h()),t&2){let e=m(2);T(e.externalRefs().length>0?0:-1),d(3),C(e.texts.findingsHeader),d(),T(e.findings().length===0?4:5),d(4),C(e.texts.outgoingHeader),d(),T(e.outgoing().length===0?9:10),d(4),C(e.texts.incomingHeader),d(),T(e.incoming().length===0?14:15)}}function EZ(t,i){if(t&1&&(f(0,"p-card",0),be(1,nZ,4,6,"ng-template",1),I(2,iZ,2,1,"p",2)(3,oZ,2,1,"p",3)(4,TZ,16,7),h()),t&2){let e,n=m();d(2),T((e=n.state())==="loading"?2:e==="error"?3:e==="ready"?4:-1)}}var vf=class t{dataSource=l(un);wsEvents=l(Lg);destroyRef=l(at);texts=hk;path=O(null);openPath=Be();state=H("idle");outgoingRaw=H([]);incomingRaw=H([]);outgoing=S(()=>this.outgoingRaw().filter(i=>!mk(i)));incoming=S(()=>this.incomingRaw().filter(i=>!mk(i)));issues=H([]);externalRefsRaw=H([]);externalRefs=S(()=>this.externalRefsRaw().filter(i=>zr(i.url)!==null));fetchToken=0;hasResults=S(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));findings=S(()=>{let i=this.path();return i?this.issues().filter(e=>e.nodeIds.includes(i)):[]});constructor(){this.wsEvents.scanCompleted$.pipe(ca(this.destroyRef)).subscribe(()=>{let i=this.path();i&&this.fetch(i)}),ie(()=>{let i=this.path();if(!i){this.fetchToken++,this.state.set("idle"),this.outgoingRaw.set([]),this.incomingRaw.set([]);return}this.fetch(i)})}refresh(){let i=this.path();i&&this.fetch(i)}onOpen(i){this.openPath.emit(i)}kindSeverity(i){return r0[i]??"secondary"}confidenceSeverity(i){return s0(i)}confidenceLabel(i){return this.texts.confidence[a0(i)]}confidenceValue(i){return i.toFixed(2)}issueSeverity(i){return i==="error"?"danger":i==="warn"?"warn":"info"}issueForOutgoing(i){let e=this.path();if(!e)return null;let n=[i.target,i.resolvedTarget].filter(s=>typeof s=="string"),o=this.issues().find(s=>{if(!s.nodeIds.includes(e))return!1;let c=s.data?.target;return typeof c!="string"?!1:n.includes(c)});if(o)return o;let r=i.resolvedTarget??i.target;return this.issues().find(s=>{if(!s.nodeIds.includes(r))return!1;let c=s.data?.target;return typeof c!="string"||c===r})??null}occurrenceLabel(i){let e=i.location?.line;return typeof e!="number"?this.texts.occurrencesItemUnknownLine.replace("{{trigger}}",i.originalTrigger).replace("{{extractor}}",i.extractor):this.texts.occurrencesItem.replace("{{line}}",String(e)).replace("{{trigger}}",i.originalTrigger).replace("{{extractor}}",i.extractor)}issueForIncoming(i){let e=this.path();if(!e)return null;let n=[i.target,i.resolvedTarget,e].filter(r=>typeof r=="string");return this.issues().find(r=>{if(!r.nodeIds.includes(i.source))return!1;let a=r.data?.target;return typeof a!="string"?!1:n.includes(a)})??null}async fetch(i){let e=++this.fetchToken;this.state.set("loading");try{let[n,o,r]=await Promise.allSettled([this.dataSource.listLinks({from:i}),this.dataSource.listLinks({to:i}),this.dataSource.getNode(i)]);if(e!==this.fetchToken)return;if(n.status!=="fulfilled"||o.status!=="fulfilled"){this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}let a=n.value.items,s=o.value.items,c=PZ(i,a,s),u;try{let p=await this.dataSource.listIssues({nodes:c});if(e!==this.fetchToken)return;u=p.items}catch{if(e!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}this.outgoingRaw.set(a),this.incomingRaw.set(s),this.issues.set(u),this.externalRefsRaw.set(r.status==="fulfilled"?r.value?.item?.externalRefs??[]:[]),this.state.set("ready")}catch{if(e!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-linked-nodes-panel"]],inputs:{path:[1,"path"]},outputs:{openPath:"openPath"},decls:1,vars:1,consts:[["styleClass","linked-nodes-panel","data-testid","linked-nodes-panel"],["pTemplate","header"],["data-testid","linked-nodes-loading",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-error",1,"linked-nodes-panel__status","linked-nodes-panel__status--warn"],[1,"linked-nodes-panel__header"],[1,"linked-nodes-panel__title"],["icon","pi pi-refresh","severity","secondary","data-testid","linked-nodes-refresh",3,"onClick","rounded","text","ariaLabel","pTooltip","disabled"],["data-testid","linked-nodes-external-refs",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-findings",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["data-testid","linked-nodes-findings-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__rows"],["data-testid","linked-nodes-outgoing",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-outgoing-empty",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-incoming",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-incoming-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--external-ref"],[1,"linked-nodes-panel__external-ref-line"],["target","_blank","rel","noopener noreferrer",1,"linked-nodes-panel__external-ref-url",3,"href"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--finding"],[3,"value","severity","rounded"],[1,"linked-nodes-panel__finding-message"],[1,"linked-nodes-panel__row"],[3,"value","severity"],["severity","primary","styleClass","linked-nodes-panel__path",3,"onClick","link","label"],[3,"value","severity","rounded","pTooltip"],[1,"linked-nodes-panel__sources"],[1,"linked-nodes-panel__occurrences"],[1,"linked-nodes-panel__occurrences-header"],[1,"linked-nodes-panel__occurrences-item"]],template:function(e,n){e&1&&I(0,EZ,5,1,"p-card",0),e&2&&T(n.path()?0:-1)},dependencies:[fk,rg,Pi,ma,ha,fa,ln,dn,Ne,Oe],styles:["[_nghost-%COMP%]{display:block}.linked-nodes-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem 0}.linked-nodes-panel__title[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600}.linked-nodes-panel__status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.linked-nodes-panel__status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.linked-nodes-panel__section[_ngcontent-%COMP%] + .linked-nodes-panel__section[_ngcontent-%COMP%]{margin-top:1rem}.linked-nodes-panel__section-title[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__rows[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.linked-nodes-panel__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.4rem .5rem;border-radius:var(--sm-radius-md);background:var(--p-content-background);border:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem;padding:0;text-underline-offset:2px}.linked-nodes-panel__sources[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);margin-left:auto}.linked-nodes-panel__occurrences[_ngcontent-%COMP%]{flex-basis:100%;list-style:none;margin:.25rem 0 0;padding:.25rem 0 0;border-top:1px dashed var(--p-content-border-color);display:flex;flex-direction:column;gap:.15rem}.linked-nodes-panel__occurrences-header[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__occurrences-item[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--p-text-muted-color)}.linked-nodes-panel__row--finding[_ngcontent-%COMP%]{align-items:flex-start}.linked-nodes-panel__finding-message[_ngcontent-%COMP%]{font-size:.8rem;line-height:1.4;color:var(--p-text-color)}.linked-nodes-panel__row--external-ref[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem}.linked-nodes-panel__external-ref-line[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);min-width:4.5rem}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]{flex:1;word-break:break-all;color:var(--p-primary-color);text-decoration:none}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};function PZ(t,i,e){let n=new Set([t]);for(let o of i)o.resolvedTarget&&n.add(o.resolvedTarget),o.target&&n.add(o.target);for(let o of e)o.source&&n.add(o.source);return[...n]}function mk(t){return!!(t.source===t.target||t.resolvedTarget&&t.source===t.resolvedTarget)}var vk={sections:{behavior:"Behavior",capabilities:"Capabilities",initialPrompt:"Initial prompt"},fields:{tools:"Tools",model:"Model",skills:"Skills",disallowedTools:"Disallowed",permissionMode:"Permission",maxTurns:"Max turns",memory:"Memory",background:"Background",effort:"Effort",isolation:"Isolation",mcpServers:"MCP servers",hooks:"Hooks"},skillBaseFields:{whenToUse:"When to use",argumentHint:"Argument hint",arguments:"Arguments",allowedTools:"Allowed tools",model:"Model",effort:"Effort",context:"Context",agent:"Agent",shell:"Shell",paths:"Paths",disableModelInvocation:"Model invocation",userInvocable:"User invocable"}};var kZ=(t,i)=>i.name,MZ=(t,i)=>i.event;function DZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.model),d(3),C(i)}}function OZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){let e=m(3);d(),C(e.texts.fields.effort),d(2),C(i)}}function NZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.permissionMode),d(3),C(i)}}function RZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){let e=m(3);d(),C(e.texts.fields.maxTurns),d(2),C(e.maxTurns())}}function AZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.memory),d(3),C(i)}}function FZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4,"true"),h()()),t&2){let e=m(3);d(),C(e.texts.fields.background)}}function LZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){let e=m(3);d(),C(e.texts.fields.isolation),d(3),C(i)}}function BZ(t,i){if(t&1&&(f(0,"section",1)(1,"h3",4),v(2),h(),f(3,"dl",5),I(4,DZ,5,2),I(5,OZ,4,2),I(6,NZ,5,2),I(7,RZ,4,2),I(8,AZ,5,2),I(9,FZ,5,1),I(10,LZ,5,2),h()()),t&2){let e,n,o,r,a,s=m(2);d(2),C(s.texts.sections.behavior),d(2),T((e=s.model())?4:-1,e),d(),T((n=s.effort())?5:-1,n),d(),T((o=s.permissionMode())?6:-1,o),d(),T(s.maxTurns()!==null?7:-1),d(),T((r=s.memory())?8:-1,r),d(),T(s.background()?9:-1),d(),T((a=s.isolation())?10:-1,a)}}function zZ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function qZ(t,i){if(t&1&&(f(0,"code"),v(1),h(),I(2,zZ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(),C(e),d(),T(n!==o-1?2:-1)}}function VZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,qZ,3,2,null,null,Ee),h()),t&2){let e=m(4);d(),C(e.texts.fields.tools),d(2),X(e.tools())}}function HZ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function GZ(t,i){if(t&1&&(f(0,"span",9),R(1,"i",10),f(2,"code"),v(3),h()(),I(4,HZ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(3),C(e),d(),T(n!==o-1?4:-1)}}function jZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,GZ,5,2,null,null,Ee),h()),t&2){let e=m(4);d(),C(e.texts.fields.disallowedTools),d(2),X(e.disallowedTools())}}function UZ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function WZ(t,i){if(t&1){let e=re();f(0,"a",11),V("click",function(){let o=L(e).$implicit,r=m(5);return B(r.onSkillChipClick(o))})("keydown.enter",function(){let o=L(e).$implicit,r=m(5);return B(r.onSkillChipClick(o))}),R(1,"i",12),v(2),h(),I(3,UZ,2,0,"span",8)}if(t&2){let e=i.$implicit,n=i.$index,o=i.$count,r=m(5);se("vfm__link--known",r.isSkillKnown(e)),d(2),Le(" ",e," "),d(),T(n!==o-1?3:-1)}}function $Z(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,WZ,4,4,null,null,Ee),h()),t&2){let e=m(4);d(),C(e.texts.fields.skills),d(2),X(e.skills())}}function KZ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function YZ(t,i){if(t&1&&(f(0,"code",13),v(1),h(),I(2,KZ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;E("pTooltip",e.command??""),d(),C(e.name),d(),T(n!==o-1?2:-1)}}function XZ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,YZ,3,3,null,null,kZ),h()),t&2){let e=m(4);d(),C(e.texts.fields.mcpServers),d(2),X(e.mcpServers())}}function ZZ(t,i){if(t&1&&(f(0,"span",15),v(1,"\u2192"),h(),f(2,"code"),v(3),h()),t&2){let e=m().$implicit;d(3),C(e.keys[0])}}function QZ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function JZ(t,i){if(t&1&&(f(0,"span",14)(1,"code"),v(2),h(),I(3,ZZ,4,1),h(),I(4,QZ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(2),C(e.event),d(),T(e.keys.length?3:-1),d(),T(n!==o-1?4:-1)}}function eQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,JZ,5,3,null,null,MZ),h()),t&2){let e=m(4);d(),C(e.texts.fields.hooks),d(2),X(e.hooks())}}function tQ(t,i){if(t&1&&(f(0,"dl",5),I(1,VZ,5,1),I(2,jZ,5,1),I(3,$Z,5,1),I(4,XZ,5,1),I(5,eQ,5,1),h()),t&2){let e=m(3);d(),T(e.tools().length?1:-1),d(),T(e.disallowedTools().length?2:-1),d(),T(e.skills().length?3:-1),d(),T(e.mcpServers().length?4:-1),d(),T(e.hooks().length?5:-1)}}function nQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.whenToUse),d(2),C(e.when_to_use)}}function iQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.argumentHint),d(3),C(e.argumentHint)}}function oQ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function rQ(t,i){if(t&1&&(f(0,"code"),v(1),h(),I(2,oQ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(),C(e),d(),T(n!==o-1?2:-1)}}function aQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,rQ,3,2,null,null,Ee),h()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.arguments),d(2),X(e.arguments)}}function sQ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function cQ(t,i){if(t&1&&(f(0,"code"),v(1),h(),I(2,sQ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(),C(e),d(),T(n!==o-1?2:-1)}}function dQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,cQ,3,2,null,null,Ee),h()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.allowedTools),d(2),X(e.allowedTools)}}function lQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.model),d(3),C(e.model)}}function uQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd"),v(3),h()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.effort),d(2),C(e.effort)}}function pQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.context),d(3),C(e.context)}}function fQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.agent),d(3),C(e.agent)}}function hQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.shell),d(3),C(e.shell)}}function mQ(t,i){t&1&&(f(0,"span",8),v(1,"\xB7"),h())}function _Q(t,i){if(t&1&&(f(0,"code"),v(1),h(),I(2,mQ,2,0,"span",8)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;d(),C(e),d(),T(n!==o-1?2:-1)}}function gQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd",7),Y(3,_Q,3,2,null,null,Ee),h()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.paths),d(2),X(e.paths)}}function vQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4,"disabled"),h()()),t&2){let e=m(4);d(),C(e.texts.skillBaseFields.disableModelInvocation)}}function yQ(t,i){if(t&1&&(f(0,"dt"),v(1),h(),f(2,"dd")(3,"code"),v(4),h()()),t&2){m();let e=J(0),n=m(3);d(),C(n.texts.skillBaseFields.userInvocable),d(3),C(e.userInvocable)}}function CQ(t,i){if(t&1&&(nt(0),f(1,"dl",6),I(2,nQ,4,2),I(3,iQ,5,2),I(4,aQ,5,1),I(5,dQ,5,1),I(6,lQ,5,2),I(7,uQ,4,2),I(8,pQ,5,2),I(9,fQ,5,2),I(10,hQ,5,2),I(11,gQ,5,1),I(12,vQ,5,1),I(13,yQ,5,2),h()),t&2){let e=We(m(3).skillBase());d(2),T(e.when_to_use!==null?2:-1),d(),T(e.argumentHint!==null?3:-1),d(),T(e.arguments.length?4:-1),d(),T(e.allowedTools.length?5:-1),d(),T(e.model!==null?6:-1),d(),T(e.effort!==null?7:-1),d(),T(e.context!==null?8:-1),d(),T(e.agent!==null?9:-1),d(),T(e.shell!==null?10:-1),d(),T(e.paths.length?11:-1),d(),T(e.disableModelInvocation?12:-1),d(),T(e.userInvocable!==null?13:-1)}}function bQ(t,i){if(t&1&&(f(0,"section",2)(1,"h3",4),v(2),h(),I(3,tQ,6,5,"dl",5)(4,CQ,14,13,"dl",6),h()),t&2){let e=m(2);d(2),C(e.texts.sections.capabilities),d(),T(e.isAgent()?3:e.isSkillOrCommand()?4:-1)}}function xQ(t,i){if(t&1&&(f(0,"section",3)(1,"h3",4),v(2),h(),f(3,"blockquote",16),v(4),h()()),t&2){let e=m(2);d(2),C(e.texts.sections.initialPrompt),d(2),C(e.initialPrompt())}}function wQ(t,i){if(t&1&&(f(0,"div",0),I(1,BZ,11,8,"section",1),I(2,bQ,5,2,"section",2),I(3,xQ,5,2,"section",3),h()),t&2){let e=m();d(),T(e.hasBehavior()?1:-1),d(),T(e.hasCapabilities()?2:-1),d(),T(e.hasInitialPrompt()?3:-1)}}var Cf=class t{frontmatter=O.required();kind=O.required();provider=O(void 0);knownPaths=O(null);onSkillClick=O(null);texts=vk;hasVendorSurface=S(()=>{let i=this.kind();return i==="agent"||i==="skill"||i==="command"});isAgent=S(()=>this.kind()==="agent");isSkillOrCommand=S(()=>{let i=this.kind();return i==="skill"||i==="command"});tools=S(()=>yf(this.fm().tools));model=S(()=>_t(this.fm().model));skills=S(()=>yf(this.fm().skills));disallowedTools=S(()=>yf(this.fm().disallowedTools));initialPrompt=S(()=>_t(this.fm().initialPrompt));permissionMode=S(()=>_t(this.fm().permissionMode));maxTurns=S(()=>SQ(this.fm().maxTurns));memory=S(()=>_t(this.fm().memory));background=S(()=>this.fm().background===!0);effort=S(()=>_t(this.fm().effort));isolation=S(()=>_t(this.fm().isolation));mcpServers=S(()=>{let i=this.fm().mcpServers;return Array.isArray(i)?i.filter(e=>typeof e=="object"&&e!==null).map((e,n)=>{let o=e.args,r=Array.isArray(o)?o.length:0;return{name:typeof e.name=="string"&&e.name.length>0?e.name:`mcpServer[${n}]`,command:typeof e.command=="string"?e.command:null,argsCount:r}}):[]});hooks=S(()=>{let i=this.fm().hooks;if(typeof i!="object"||i===null)return[];let e=[];for(let[n,o]of Object.entries(i)){let r=typeof o=="object"&&o!==null?Object.keys(o):[];e.push({event:n,keys:r})}return e});skillBase=S(()=>{let i=this.fm();return{when_to_use:_t(i.when_to_use),argumentHint:_t(i["argument-hint"]),arguments:ag(i.arguments),disableModelInvocation:i["disable-model-invocation"]===!0,userInvocable:typeof i["user-invocable"]=="boolean"?i["user-invocable"]:null,allowedTools:ag(i["allowed-tools"]),model:_t(i.model),effort:_t(i.effort),context:_t(i.context),agent:_t(i.agent),paths:ag(i.paths),shell:_t(i.shell)}});hasBehavior=S(()=>this.isAgent()?this.model()!==null||this.permissionMode()!==null||this.maxTurns()!==null||this.memory()!==null||this.background()||this.effort()!==null||this.isolation()!==null:!1);hasCapabilities=S(()=>{if(this.isAgent())return this.tools().length>0||this.disallowedTools().length>0||this.skills().length>0||this.mcpServers().length>0||this.hooks().length>0;if(this.isSkillOrCommand()){let i=this.skillBase();return i.when_to_use!==null||i.argumentHint!==null||i.arguments.length>0||i.allowedTools.length>0||i.model!==null||i.effort!==null||i.context!==null||i.agent!==null||i.shell!==null||i.paths.length>0||i.disableModelInvocation||i.userInvocable!==null}return!1});hasInitialPrompt=S(()=>this.isAgent()&&this.initialPrompt()!==null);hasAnyContent=S(()=>this.hasVendorSurface()&&(this.hasBehavior()||this.hasCapabilities()||this.hasInitialPrompt()));onSkillChipClick(i){let e=this.onSkillClick();e&&e(i)}isSkillKnown(i){let e=this.knownPaths();return e?e.has(i):!1}fm(){return this.frontmatter()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-vendor-frontmatter"]],inputs:{frontmatter:[1,"frontmatter"],kind:[1,"kind"],provider:[1,"provider"],knownPaths:[1,"knownPaths"],onSkillClick:[1,"onSkillClick"]},decls:1,vars:1,consts:[["data-testid","vendor-frontmatter",1,"vfm"],["data-testid","vendor-frontmatter-behavior",1,"sm-block"],["data-testid","vendor-frontmatter-capabilities",1,"sm-block"],["data-testid","vendor-frontmatter-initial-prompt",1,"sm-block"],[1,"sm-block__title"],[1,"sm-block__kv"],["data-testid","vendor-frontmatter-skill-base",1,"sm-block__kv"],[1,"vfm__inline"],["aria-hidden","true",1,"vfm__sep"],[1,"vfm__danger"],["aria-hidden","true",1,"pi","pi-ban"],["role","button","tabindex","0",1,"vfm__link",3,"click","keydown.enter"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],[3,"pTooltip"],[1,"vfm__hook"],["aria-hidden","true",1,"vfm__sep-arrow"],["data-testid","vendor-frontmatter-initial-prompt-quote",1,"vfm__quote"]],template:function(e,n){e&1&&I(0,wQ,4,3,"div",0),e&2&&T(n.hasAnyContent()?0:-1)},dependencies:[Ne,Oe],styles:["[_nghost-%COMP%]{display:block}.vfm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.7rem}.vfm__inline[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem;font-size:.83rem}.vfm__inline[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.78rem;color:var(--p-text-color);font-family:var(--sm-font-mono)}.vfm__sep[_ngcontent-%COMP%]{color:var(--sm-border);font-size:.75rem}.vfm__sep-arrow[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-size:.78rem;margin:0 .1rem}.vfm__danger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;color:var(--sm-severity-error)}.vfm__danger[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.vfm__danger[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.7rem}.vfm__link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;color:var(--p-text-muted-color);cursor:default;text-decoration:none;font-size:.83rem}.vfm__link[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.7rem}.vfm__link--known[_ngcontent-%COMP%]{color:var(--p-primary-color);cursor:pointer}.vfm__link--known[_ngcontent-%COMP%]:hover{text-decoration:underline}.vfm__hook[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}.vfm__hook[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.78rem;font-family:var(--sm-font-mono)}.vfm__quote[_ngcontent-%COMP%]{margin:0;padding:.7rem .95rem;border-left:2px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);font-style:italic;font-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-sm) var(--sm-radius-sm) 0;white-space:pre-wrap}"],changeDetection:0})};function _t(t){return typeof t=="string"&&t.length>0?t:null}function SQ(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function yf(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function ag(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?yf(t):[]}var yk={header:"Plugin contributions",count:t=>`${t} namespace${t===1?"":"s"}`,unregisteredBadge:"unregistered",rootContribBadge:t=>`from plugin: ${t}`,empty:"No plugin contributions on this sidecar."};var xk=(t,i)=>i.key,IQ=(t,i)=>i.pluginId;function TQ(t,i){if(t&1&&(f(0,"p",0),v(1),h()),t&2){let e=m();d(),C(e.texts.empty)}}function EQ(t,i){if(t&1&&(f(0,"span",5),v(1),h()),t&2){let e=m().$implicit,n=m(3);d(),C(n.texts.rootContribBadge(e.pluginId))}}function PQ(t,i){if(t&1&&(f(0,"div",3)(1,"code",4),v(2),h(),I(3,EQ,2,1,"span",5),f(4,"pre",6),v(5),h()()),t&2){let e=i.$implicit;d(2),C(e.key),d(),T(e.pluginId!==null?3:-1),d(2),C(e.value)}}function kQ(t,i){if(t&1&&(f(0,"div",1),Y(1,PQ,6,3,"div",3,xk),h()),t&2){let e=m(2);d(),X(e.rootContributions())}}function MQ(t,i){if(t&1&&(f(0,"span",10),v(1),h()),t&2){let e=m(4);d(),C(e.texts.unregisteredBadge)}}function DQ(t,i){if(t&1&&(f(0,"dt",12),v(1),h(),f(2,"dd")(3,"pre"),v(4),h()()),t&2){let e=i.$implicit;E("pTooltip",e.description??""),d(),C(e.key),d(3),C(e.value)}}function OQ(t,i){if(t&1&&(f(0,"section",7)(1,"h5",8)(2,"span",9),v(3),h(),I(4,MQ,2,1,"span",10),h(),f(5,"dl",11),Y(6,DQ,5,3,null,null,xk),h()()),t&2){let e=i.$implicit;q("data-testid","plugin-contributions-ns-"+e.pluginId),d(3),C(e.pluginId),d(),T(e.registered?-1:4),d(2),X(e.rows)}}function NQ(t,i){if(t&1&&(f(0,"div",2),Y(1,OQ,8,3,"section",7,IQ),h()),t&2){let e=m(2);d(),X(e.namespaces())}}function RQ(t,i){if(t&1&&(I(0,kQ,3,0,"div",1),I(1,NQ,3,0,"div",2)),t&2){let e=m();T(e.rootContributions().length?0:-1),d(),T(e.namespaces().length?1:-1)}}var Ck=new Set(["identity","annotations","settings","audit"]),bf=class t{dataSource=l(un);sidecarRoot=O(void 0);texts=yk;catalog=H(null);constructor(){this.fetchCatalog()}namespaces=S(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog(),n=new Map;if(e)for(let r of e){if(r.location!=="namespaced")continue;let a=n.get(r.pluginId);a?a.push(r):n.set(r.pluginId,[r])}let o=[];for(let[r,a]of Object.entries(i)){if(Ck.has(r)||this.isRegisteredRootKey(r))continue;let c=typeof a=="object"&&a!==null&&!Array.isArray(a)?a:{value:a},u=n.has(r),p=n.get(r)??[],_=Object.entries(c).map(([b,k])=>({key:b,value:bk(k),description:u?AQ(p,b):null}));o.push({pluginId:r,registered:u,rows:_})}return o});rootContributions=S(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog();if(!e)return[];let n=new Map;for(let r of e)r.location==="root"&&n.set(r.key,r);let o=[];for(let[r,a]of Object.entries(i)){if(Ck.has(r))continue;let s=n.get(r);s&&o.push({key:r,pluginId:s.pluginId,value:bk(a)})}return o});count=S(()=>this.namespaces().length+this.rootContributions().length);isEmpty=S(()=>this.count()===0);isRegisteredRootKey(i){let e=this.catalog();return e?e.some(n=>n.location==="root"&&n.key===i):!1}async fetchCatalog(){try{let i=await this.dataSource.getRegisteredAnnotations();this.catalog.set(i)}catch{this.catalog.set([])}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-plugin-contributions"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","plugin-contributions-empty",1,"pcp__empty"],["data-testid","plugin-contributions-roots",1,"pcp__roots"],[1,"pcp__namespaces"],[1,"pcp__root-row"],[1,"pcp__root-key"],[1,"pcp__root-badge"],[1,"pcp__root-value"],[1,"pcp__ns"],[1,"pcp__ns-header"],[1,"pcp__ns-name"],["data-testid","plugin-contributions-unregistered-badge",1,"pcp__ns-badge"],[1,"pcp__kv"],[3,"pTooltip"]],template:function(e,n){e&1&&I(0,TQ,2,1,"p",0)(1,RQ,2,2),e&2&&T(n.isEmpty()?0:1)},dependencies:[Ne,Oe],styles:["[_nghost-%COMP%]{display:block}.pcp__empty[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--sm-text-muted);font-style:italic}.pcp__roots[_ngcontent-%COMP%], .pcp__namespaces[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.pcp__root-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;font-size:.85rem}.pcp__root-key[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-weight:600}.pcp__root-badge[_ngcontent-%COMP%]{font-size:.7rem;color:var(--sm-text-muted);font-style:italic;background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm)}.pcp__root-value[_ngcontent-%COMP%]{flex:1 1 100%;margin:.2rem 0 0;padding:.45rem .6rem;background:var(--sm-bg-hover);border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}.pcp__ns[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.pcp__ns[_ngcontent-%COMP%] + .pcp__ns[_ngcontent-%COMP%]{border-top:1px solid var(--sm-border);padding-top:.5rem}.pcp__ns-header[_ngcontent-%COMP%]{margin:0;display:inline-flex;align-items:center;gap:.5rem;font-size:.85rem;font-weight:600}.pcp__ns-name[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.pcp__ns-badge[_ngcontent-%COMP%]{font-size:.65rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--sm-text-muted);background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.pcp__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.pcp__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500;font-family:var(--sm-font-mono);cursor:help}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}"],changeDetection:0})};function bk(t){if(t===null)return"null";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function AQ(t,i){for(let e of t)if(e.key===i){let n=e.schema.description;return typeof n=="string"&&n.length>0?n:null}return null}var xf=class t{node=O(null);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-slots-panel"]],inputs:{node:[1,"node"]},decls:6,vars:6,consts:[["slot","inspector.body.panel.breakdown",3,"node"],["slot","inspector.body.panel.records",3,"node"],["slot","inspector.body.panel.tree",3,"node"],["slot","inspector.body.panel.key-values",3,"node"],["slot","inspector.body.panel.link-list",3,"node"],["slot","inspector.body.panel.markdown",3,"node"]],template:function(e,n){e&1&&R(0,"sm-view-contributions-host",0)(1,"sm-view-contributions-host",1)(2,"sm-view-contributions-host",2)(3,"sm-view-contributions-host",3)(4,"sm-view-contributions-host",4)(5,"sm-view-contributions-host",5),e&2&&(E("node",n.node()),d(),E("node",n.node()),d(),E("node",n.node()),d(),E("node",n.node()),d(),E("node",n.node()),d(),E("node",n.node()))},dependencies:[vn],encapsulation:2,changeDetection:0})};var wk={header:"Debug",toggleAriaLabel:"Toggle debug panel",fields:{forPath:"for.path",bodyHashStored:"for.bodyHash (stored)",bodyHashLive:"node.bodyHash (live)",frontmatterHashStored:"for.frontmatterHash (stored)",frontmatterHashLive:"node.frontmatterHash (live)",resolvedProvider:"for.resolvedAs.provider",resolvedKind:"for.resolvedAs.kind",sidecarStatus:"sidecar.status",sidecarPresent:"sidecar.present"},diffMarker:"!=",absentMarker:"(absent)",notSetMarker:"(not set)"};function FQ(t,i){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(i))}function LQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function BQ(t,i){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();se("dbg__diff",e.bodyHashDrift()),d(),C(i)}}function zQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function qQ(t,i){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();se("dbg__diff",e.bodyHashDrift()),d(),C(i)}}function VQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function HQ(t,i){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();se("dbg__diff",e.frontmatterHashDrift()),d(),C(i)}}function GQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function jQ(t,i){if(t&1&&(W(0,"code"),v(1),$()),t&2){let e=m();se("dbg__diff",e.frontmatterHashDrift()),d(),C(i)}}function UQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}function WQ(t,i){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(i))}function $Q(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.notSetMarker)}}function KQ(t,i){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(i))}function YQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.notSetMarker)}}function XQ(t,i){t&1&&(W(0,"code"),v(1),$()),t&2&&(d(),C(i))}function ZQ(t,i){if(t&1&&(W(0,"span",2),v(1),$()),t&2){let e=m();d(),C(e.texts.absentMarker)}}var wf=class t{node=O.required();sidecarRoot=O(null);overlay=O(void 0);texts=wk;identityBlock=S(()=>{let i=this.sidecarRoot(),e={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!i)return e;let n=i.identity;if(typeof n!="object"||n===null)return e;let o=n,r=typeof o.resolvedAs=="object"&&o.resolvedAs!==null?o.resolvedAs:null;return{path:typeof o.path=="string"?o.path:null,bodyHash:typeof o.bodyHash=="string"?o.bodyHash:null,frontmatterHash:typeof o.frontmatterHash=="string"?o.frontmatterHash:null,resolvedProvider:r&&typeof r.provider=="string"?r.provider:null,resolvedKind:r&&typeof r.kind=="string"?r.kind:null}});bodyHashLive=S(()=>this.node().bodyHash??null);frontmatterHashLive=S(()=>this.node().frontmatterHash??null);bodyHashDrift=S(()=>{let i=this.identityBlock().bodyHash,e=this.bodyHashLive();return i!==null&&e!==null&&i!==e});frontmatterHashDrift=S(()=>{let i=this.identityBlock().frontmatterHash,e=this.frontmatterHashLive();return i!==null&&e!==null&&i!==e});sidecarStatusLiteral=S(()=>{let i=this.overlay();if(!i)return null;let e=i.status??null;return e===null?null:String(e)});sidecarPresent=S(()=>this.overlay()?.present===!0);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-debug-panel"]],inputs:{node:[1,"node"],sidecarRoot:[1,"sidecarRoot"],overlay:[1,"overlay"]},decls:46,vars:18,consts:[["data-testid","inspector-debug-panel",1,"dbg__kv"],["data-testid","dbg-for-path"],[1,"dbg__absent"],["data-testid","dbg-body-hash-stored"],[3,"dbg__diff"],["data-testid","dbg-body-hash-live"],["data-testid","dbg-fm-hash-stored"],["data-testid","dbg-fm-hash-live"],["data-testid","dbg-resolved-provider"],["data-testid","dbg-resolved-kind"],["data-testid","dbg-sidecar-status"],["data-testid","dbg-sidecar-present"]],template:function(e,n){if(e&1&&(W(0,"dl",0)(1,"dt"),v(2),$(),W(3,"dd",1),I(4,FQ,2,1,"code")(5,LQ,2,1,"span",2),$(),W(6,"dt"),v(7),$(),W(8,"dd",3),I(9,BQ,2,3,"code",4)(10,zQ,2,1,"span",2),$(),W(11,"dt"),v(12),$(),W(13,"dd",5),I(14,qQ,2,3,"code",4)(15,VQ,2,1,"span",2),$(),W(16,"dt"),v(17),$(),W(18,"dd",6),I(19,HQ,2,3,"code",4)(20,GQ,2,1,"span",2),$(),W(21,"dt"),v(22),$(),W(23,"dd",7),I(24,jQ,2,3,"code",4)(25,UQ,2,1,"span",2),$(),W(26,"dt"),v(27),$(),W(28,"dd",8),I(29,WQ,2,1,"code")(30,$Q,2,1,"span",2),$(),W(31,"dt"),v(32),$(),W(33,"dd",9),I(34,KQ,2,1,"code")(35,YQ,2,1,"span",2),$(),W(36,"dt"),v(37),$(),W(38,"dd",10),I(39,XQ,2,1,"code")(40,ZQ,2,1,"span",2),$(),W(41,"dt"),v(42),$(),W(43,"dd",11)(44,"code"),v(45),$()()()),e&2){let o,r,a,s,c,u,p,_;d(2),C(n.texts.fields.forPath),d(2),T((o=n.identityBlock().path)?4:5,o),d(3),C(n.texts.fields.bodyHashStored),d(2),T((r=n.identityBlock().bodyHash)?9:10,r),d(3),C(n.texts.fields.bodyHashLive),d(2),T((a=n.bodyHashLive())?14:15,a),d(3),C(n.texts.fields.frontmatterHashStored),d(2),T((s=n.identityBlock().frontmatterHash)?19:20,s),d(3),C(n.texts.fields.frontmatterHashLive),d(2),T((c=n.frontmatterHashLive())?24:25,c),d(3),C(n.texts.fields.resolvedProvider),d(2),T((u=n.identityBlock().resolvedProvider)?29:30,u),d(3),C(n.texts.fields.resolvedKind),d(2),T((p=n.identityBlock().resolvedKind)?34:35,p),d(3),C(n.texts.fields.sidecarStatus),d(2),T((_=n.sidecarStatusLiteral())?39:40,_),d(3),C(n.texts.fields.sidecarPresent),d(3),C(n.sidecarPresent())}},styles:["[_nghost-%COMP%]{display:block}.dbg__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.8rem}.dbg__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-family:var(--sm-font-mono);font-weight:500}.dbg__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.dbg__kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;background:var(--sm-bg-hover);padding:.05rem .3rem;border-radius:var(--sm-radius-sm);word-break:break-all}.dbg__diff[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.dbg__absent[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted);font-style:italic}"],changeDetection:0})};function QQ(t,i){if(t&1&&(W(0,"span",3),v(1),W(2,"code"),v(3),$()()),t&2){m(2);let e=J(0),n=m();d(),Le(" ",n.texts.fields.lastBumpedBy," "),d(2),C(e.lastBumpedBy)}}function JQ(t,i){if(t&1&&(W(0,"dt"),v(1),$(),W(2,"dd")(3,"span",2),v(4),$(),I(5,QQ,4,2,"span",3),$()),t&2){m();let e=J(0),n=m();d(),C(n.texts.fields.lastBumpedAt),d(2),zf("title",e.lastBumpedAt),d(),C(n.lastBumpedRel()),d(),T(e.lastBumpedBy!==null?5:-1)}}function eJ(t,i){if(t&1&&(W(0,"span",3),v(1),W(2,"code"),v(3),$()()),t&2){m(2);let e=J(0),n=m();d(),Le(" ",n.texts.fields.createdBy," "),d(2),C(e.createdBy)}}function tJ(t,i){if(t&1&&(W(0,"dt"),v(1),$(),W(2,"dd")(3,"span",2),v(4),$(),I(5,eJ,4,2,"span",3),$()),t&2){m();let e=J(0),n=m();d(),C(n.texts.fields.createdAt),d(2),zf("title",e.createdAt),d(),C(n.createdRel()),d(),T(e.createdBy!==null?5:-1)}}function nJ(t,i){if(t&1&&(nt(0),W(1,"dl",0),I(2,JQ,6,4),I(3,tJ,6,4),$()),t&2){let e=We(m().audit());d(2),T(e.lastBumpedAt!==null?2:-1),d(),T(e.createdAt!==null?3:-1)}}function iJ(t,i){if(t&1&&(W(0,"p",1),v(1),$()),t&2){let e=m();d(),C(e.texts.headerEmpty)}}var If=class t{sidecarRoot=O(null);texts=Vn.audit;audit=S(()=>{let i=this.sidecarRoot(),e={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!i)return e;let n=i.audit;if(typeof n!="object"||n===null)return e;let o=n;return{lastBumpedAt:Sf(o.lastBumpedAt),lastBumpedBy:Sf(o.lastBumpedBy),createdAt:Sf(o.createdAt),createdBy:Sf(o.createdBy)}});hasContent=S(()=>{let i=this.audit();return i.lastBumpedAt!==null||i.lastBumpedBy!==null||i.createdAt!==null||i.createdBy!==null});lastBumpedRel=S(()=>{let i=this.audit().lastBumpedAt;return i===null?null:Co(i)});createdRel=S(()=>{let i=this.audit().createdAt;return i===null?null:Co(i)});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-audit-panel"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","inspector-audit-panel",1,"audit__kv"],["data-testid","inspector-audit-panel-empty",1,"audit__empty"],[3,"title"],[1,"audit__by"]],template:function(e,n){e&1&&I(0,nJ,4,3,"dl",0)(1,iJ,2,1,"p",1),e&2&&T(n.hasContent()?0:1)},styles:["[_nghost-%COMP%]{display:block}.audit__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.audit__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500}.audit__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.audit__by[_ngcontent-%COMP%]{color:var(--sm-text-muted)}.audit__by[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem}.audit__empty[_ngcontent-%COMP%]{margin:0;font-style:italic;color:var(--sm-text-muted);font-size:.85rem}"],changeDetection:0})};function Sf(t){return typeof t=="string"&&t.length>0?t:null}var oJ=["closeBtn"];function rJ(t,i){if(t&1&&(f(0,"span",23),v(1,"\xB7"),h(),f(2,"span",24),v(3),h()),t&2){m();let e=J(0);d(3),C(e.provider)}}function aJ(t,i){if(t&1&&(f(0,"span",23),v(1,"\xB7"),h(),f(2,"span",25)(3,"span",26),v(4,"\u25CF"),h(),v(5),h()),t&2){let e=i,n=m();d(2),E("pTooltip",e==="experimental"?n.cardTexts.stability.experimental:e==="deprecated"?n.cardTexts.stability.deprecated:""),q("data-stability",e),d(3),Le(" ",e," ")}}function sJ(t,i){if(t&1&&(f(0,"span",10)(1,"code"),v(2),h(),v(3),h()),t&2){let e=m(),n=J(0);d(2),C(n.bytesTotal),d(),Le(" ",e.texts.stats.bytes)}}function cJ(t,i){if(t&1&&(f(0,"span",10)(1,"code"),v(2),h(),v(3),h()),t&2){let e=m(),n=J(0);d(2),C(n.tokensTotal),d(),Le(" ",e.texts.stats.tokens)}}function dJ(t,i){if(t&1&&(f(0,"code"),v(1),h(),R(2,"i",27)),t&2){m();let e=J(0);d(),C(e.externalRefsCount)}}function lJ(t,i){if(t&1&&(f(0,"span",16),R(1,"i",28),h()),t&2){let e=m();E("pTooltip",e.headerStaleTooltip())}}function uJ(t,i){t&1&&(f(0,"span",17),v(1),h()),t&2&&(d(),C(i))}function pJ(t,i){if(t&1){let e=re();f(0,"button",29,0),V("click",function(o){L(e);let r=m();return B(r.onCloseClick(o))}),R(2,"i",30),h()}if(t&2){let e=m();E("pTooltip",e.texts.close.tooltip),q("aria-label",e.texts.close.label)}}function fJ(t,i){if(t&1&&(f(0,"div",21)(1,"span",31),v(2),h(),f(3,"button",32),R(4,"i",33),f(5,"span"),v(6),h()(),f(7,"button",34),R(8,"i",35),f(9,"span"),v(10),h()(),f(11,"button",36),R(12,"i",37),f(13,"span"),v(14),h()()()),t&2){let e=m();d(2),C(e.texts.actionMocks.label),d(4),C(e.texts.actionMocks.summary),d(4),C(e.texts.actionMocks.audit),d(4),C(e.texts.actionMocks.validate)}}function hJ(t,i){if(t&1&&(f(0,"span",38),v(1),h()),t&2){let e=i.$implicit;d(),C(e)}}function mJ(t,i){if(t&1&&(f(0,"div",22),Y(1,hJ,2,1,"span",38,Ee),h()),t&2){let e=m();d(),X(e.headerTools())}}var _J=new Set(["red","orange","yellow","green","cyan","blue","purple","pink"]),Tf=class t{node=O.required();mode=O("standalone");showActionMocks=O(!1);close=Be();favoriteToggle=Be();texts=Vn;cardTexts=Yn;closeBtn=Pe("closeBtn");constructor(){ie(()=>{this.mode()==="embedded"&&(this.node(),queueMicrotask(()=>this.closeBtn()?.nativeElement.focus({preventScroll:!0})))})}headerVersion=S(()=>da(this.node()));headerStability=S(()=>la(this.node()));headerTitleColor=S(()=>{let i=this.node(),n=i.frontmatter.color;return typeof n=="string"&&_J.has(n)?n:`var(--sm-kind-${i.kind})`});headerTools=S(()=>zg(this.node()));headerIsStale=S(()=>qg(this.node()));headerStaleTooltip=S(()=>Gg(this.node(),Yn.sidecar));onCloseClick(i){i.stopPropagation(),this.close.emit()}onFavoriteClick(i){i.stopPropagation(),this.favoriteToggle.emit(this.node().path)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-header"]],viewQuery:function(e,n){e&1&&ut(n.closeBtn,oJ,5),e&2&&tt()},inputs:{node:[1,"node"],mode:[1,"mode"],showActionMocks:[1,"showActionMocks"]},outputs:{close:"close",favoriteToggle:"favoriteToggle"},decls:35,vars:37,consts:[["closeBtn",""],["data-testid","inspector-title",1,"inspector__header"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","provider","size"],[1,"inspector__content"],["data-testid","inspector-title-text",1,"inspector__name"],["data-testid","inspector-subtitle",1,"inspector__subtitle"],["data-testid","inspector-kind-chip",1,"inspector__subtitle-kind"],["data-testid","inspector-path",1,"inspector__path-code"],["data-testid","inspector-metastrip",1,"inspector__metastrip"],[1,"inspector__metaitem"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["aria-hidden","true",1,"pi","pi-arrow-down-left"],[1,"inspector__actions-cluster"],["type","button","data-testid","inspector-favorite",1,"inspector__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["data-testid","inspector-stale-badge",1,"inspector__stale-icon",3,"pTooltip"],["data-testid","inspector-version",1,"inspector__name-version"],["slot","inspector.header.badge.counter",3,"node"],["slot","inspector.header.badge.tag",3,"node"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"pTooltip"],["data-testid","inspector-plugin-actions",1,"inspector__plugin-actions"],["data-testid","inspector-header-tools",1,"inspector__tools"],["aria-hidden","true",1,"inspector__subtitle-sep"],[1,"inspector__subtitle-provider"],["data-testid","inspector-stability-tag",1,"inspector__subtitle-stability",3,"pTooltip"],["aria-hidden","true",1,"inspector__subtitle-dot"],["aria-hidden","true",1,"pi","pi-external-link"],["aria-hidden","true",1,"pi","pi-clock"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-times"],[1,"inspector__plugin-actions-label"],["type","button","data-testid","inspector-plugin-btn-summary",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-sparkles"],["type","button","data-testid","inspector-plugin-btn-audit",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-search"],["type","button","data-testid","inspector-plugin-btn-validate",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-check-circle"],[1,"inspector__tool-tag"]],template:function(e,n){if(e&1&&(nt(0),f(1,"header",1)(2,"div",2),R(3,"sm-kind-icon",3),h(),f(4,"div",4)(5,"h2",5),v(6),h(),f(7,"div",6)(8,"span",7),v(9),h(),I(10,rJ,4,1),I(11,aJ,6,3),h(),f(12,"code",8),v(13),h(),f(14,"div",9),I(15,sJ,4,2,"span",10),I(16,cJ,4,2,"span",10),f(17,"span",10)(18,"code"),v(19),h(),R(20,"i",11),f(21,"code"),v(22),h(),R(23,"i",12),I(24,dJ,3,1),h()()(),f(25,"div",13)(26,"button",14),V("click",function(r){return n.onFavoriteClick(r)}),R(27,"i",15),h(),I(28,lJ,2,1,"span",16),I(29,uJ,2,1,"span",17),R(30,"sm-view-contributions-host",18)(31,"sm-view-contributions-host",19),I(32,pJ,3,2,"button",20),h(),I(33,fJ,15,4,"div",21),I(34,mJ,3,0,"div",22),h()),e&2){let o,r,a=We(n.node());d(),se("inspector__header--skill",a.kind==="skill")("inspector__header--agent",a.kind==="agent")("inspector__header--command",a.kind==="command")("inspector__header--markdown",a.kind==="markdown"),d(2),E("kind",a.kind)("provider",a.provider)("size",18),d(3),C(a.frontmatter.name),d(3),C(a.kind),d(),T(a.provider?10:-1),d(),T((o=n.headerStability())?11:-1,o),d(2),C(a.path),d(2),T(a.bytesTotal!==void 0?15:-1),d(),T(a.tokensTotal!==void 0?16:-1),d(3),C(a.linksOutCount??0),d(3),C(a.linksInCount??0),d(2),T(a.externalRefsCount!==void 0&&a.externalRefsCount>0?24:-1),d(2),se("inspector__favorite--on",a.isFavorite===!0),E("pTooltip",a.isFavorite===!0?n.cardTexts.favoriteRemoveTooltip:n.cardTexts.favoriteAddTooltip),q("aria-label",a.isFavorite===!0?n.cardTexts.ariaFavoriteRemove:n.cardTexts.ariaFavoriteAdd),d(),se("pi-star-fill",a.isFavorite===!0)("pi-star",a.isFavorite!==!0),d(),T(n.headerIsStale()?28:-1),d(),T((r=n.headerVersion())?29:-1,r),d(),E("node",a),d(),E("node",a),d(),T(n.mode()==="embedded"?32:-1),d(),T(n.showActionMocks()?33:-1),d(),T(n.headerTools().length>0?34:-1)}},dependencies:[Ne,Oe,qn,vn],styles:["[_nghost-%COMP%]{display:block}.inspector__header[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.3rem;align-items:start;padding:.9rem 1rem;background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 8%,var(--sm-bg-content)) 0%,var(--sm-bg-content) 55%);color:var(--p-text-color);border:1px solid var(--sm-border);border-radius:var(--sm-radius-lg);box-shadow:var(--sm-shadow-card)}.inspector__header--skill[_ngcontent-%COMP%]{--accent: var(--sm-kind-skill)}.inspector__header--agent[_ngcontent-%COMP%]{--accent: var(--sm-kind-agent)}.inspector__header--command[_ngcontent-%COMP%]{--accent: var(--sm-kind-command)}.inspector__header--markdown[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown)}.inspector__icon-box[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:var(--sm-radius-md);display:flex;align-items:center;justify-content:center;background:var(--accent);color:var(--sm-accent-fg);flex:none;font-size:1.05rem;grid-row:1 / span 3;align-self:center;box-shadow:0 2px 5px color-mix(in srgb,var(--accent) 30%,transparent)}.inspector__content[_ngcontent-%COMP%]{min-width:0;width:100%;display:flex;flex-direction:column;gap:.18rem}.inspector__name[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600;line-height:1.25;letter-spacing:-.01em;word-break:break-word;color:var(--p-text-color)}.inspector__subtitle[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;font-size:.78rem;color:var(--p-text-muted-color);line-height:1.4}.inspector__subtitle-kind[_ngcontent-%COMP%]{color:var(--accent);font-weight:600;text-transform:lowercase}.inspector__subtitle-provider[_ngcontent-%COMP%]{color:var(--p-text-muted-color);text-transform:lowercase}.inspector__subtitle-sep[_ngcontent-%COMP%]{color:var(--sm-border);font-size:.7rem}.inspector__subtitle-stability[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;font-weight:500;text-transform:lowercase;cursor:help}.inspector__subtitle-dot[_ngcontent-%COMP%]{font-size:.55rem;line-height:1}.inspector__subtitle-stability[data-stability=stable][_ngcontent-%COMP%]{color:var(--sm-severity-success)}.inspector__subtitle-stability[data-stability=experimental][_ngcontent-%COMP%]{color:var(--sm-severity-info)}.inspector__subtitle-stability[data-stability=deprecated][_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.inspector__path-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:var(--p-text-muted-color);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);word-break:break-all;align-self:flex-start;max-width:100%;margin-top:.15rem}.inspector__metastrip[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.7rem;margin-top:.35rem;font-size:.72rem;color:var(--p-text-muted-color)}.inspector__metaitem[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}.inspector__metaitem[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.04rem .3rem;border-radius:var(--sm-radius-sm);font-size:.68rem;color:var(--p-text-color);font-family:var(--sm-font-mono)}.inspector__metaitem[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.68rem;color:var(--p-text-muted-color)}.inspector__actions-cluster[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.3rem;align-self:center}.inspector__favorite[_ngcontent-%COMP%]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;padding:0;cursor:pointer;color:var(--p-text-muted-color);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.inspector__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.85rem;line-height:1}.inspector__favorite[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.inspector__favorite[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.inspector__favorite--on[_ngcontent-%COMP%]{color:var(--p-primary-color)}.inspector__stale-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;color:var(--sm-severity-warn);cursor:help}.inspector__stale-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.78rem;width:1em;height:1em;line-height:1}.inspector__close[_ngcontent-%COMP%]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:1px solid var(--sm-border);border-radius:var(--sm-radius-md);padding:0;margin-left:.25rem;color:var(--p-text-muted-color);cursor:pointer;flex:none;transition:background .12s ease,color .12s ease,border-color .12s ease}.inspector__close[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.78rem;line-height:1}.inspector__close[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color);border-color:var(--p-text-muted-color)}.inspector__close[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.inspector__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:var(--p-text-color);background:var(--sm-bg-hover);padding:.08rem .4rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none}.inspector__plugin-actions[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin-top:.55rem;padding-top:.5rem;border-top:1px solid var(--sm-border)}.inspector__plugin-actions-label[_ngcontent-%COMP%]{font-size:.6rem;text-transform:uppercase;letter-spacing:.05em;font-weight:600;color:var(--p-text-muted-color);margin-right:.15rem}.inspector__plugin-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .65rem;border:1px solid var(--sm-border);border-radius:var(--sm-radius-md);background:var(--sm-bg-content);color:var(--p-text-color);font-size:.78rem;font-weight:500;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease;font-family:inherit}.inspector__plugin-btn[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);border-color:var(--p-text-muted-color);color:var(--p-text-color)}.inspector__plugin-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.82rem}.inspector__tools[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem;margin-top:.55rem;padding-top:.5rem;border-top:1px solid var(--sm-border)}.inspector__tool-tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.1rem .5rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--p-text-color);font-family:var(--sm-font-mono);font-size:.7rem;font-weight:500;line-height:1.35;flex:none}"],changeDetection:0})};function sg(t){an(sg);let{path:i,dataSource:e,markdown:n}=t,o=H("idle"),r=H(null),a=0,s=async(u,p)=>{try{let _=await e.getNode(u,{includeBody:!0});if(p!==a)return;if(_===null){o.set("unavailable");return}let b=_.item.body;if(b===null){o.set("unavailable");return}if(b===void 0||b.trim().length===0){o.set("empty");return}let k=await n.render(b);if(p!==a)return;r.set(k),o.set("ready")}catch{if(p!==a)return;o.set("error")}};ie(()=>{let u=i(),p=++a;if(r.set(null),!u){o.set("idle");return}o.set("loading"),s(u,p)});let c=()=>{let u=i();if(!u||o()==="loading")return;let p=++a;r.set(null),o.set("loading"),s(u,p)};return{bodyState:o.asReadonly(),bodyHtml:r.asReadonly(),refresh:c}}function cg(t){an(cg);let{node:i,sidecarService:e,confirmation:n}=t,o=Vn,r=S(()=>{let P=i();if(!P)return!1;let N=P.sidecar;return!N||N.present===!1||N.status==="fresh"?!1:Bg(N)}),a=H(!1),s=H(null),c=S(()=>{let N=i()?.sidecar;return!N||N.present===!1?o.bump.tooltipDisabledNoSidecar:r()?o.bump.tooltipEnabled:o.bump.tooltipDisabledFresh}),u=P=>{if(P instanceof jf)switch(P.code){case"sidecar-fresh":return`${o.bump.errorPrefix} ${o.bump.errorFresh}`;case"not-found":return`${o.bump.errorPrefix} ${o.bump.errorNotFound}`;default:return`${o.bump.errorPrefix} ${P.message||o.bump.errorGeneric}`}let N=P instanceof Error?P.message:String(P);return`${o.bump.errorPrefix} ${N||o.bump.errorGeneric}`},p=async P=>{if(!a()){a.set(!0),s.set(null);try{await e.bump(P,{confirm:!0})}catch(N){s.set(u(N))}finally{a.set(!1)}}},_=P=>{n.confirm({header:o.bump.consentHeader,message:o.bump.consentMessage,acceptLabel:o.bump.consentAccept,rejectLabel:o.bump.consentReject,acceptButtonProps:{severity:"primary"},rejectButtonProps:{severity:"secondary"},accept:()=>{p(P)}})},b=async()=>{let P=i();if(P&&r()&&!a()){a.set(!0),s.set(null);try{await e.bump(P.path)}catch(N){if(N instanceof jf&&N.code==="confirm-required"&&gJ(N.details)){_(P.path);return}s.set(u(N))}finally{a.set(!1)}}},k=()=>{s.set(null)};return{canBump:r,bumpInFlight:a.asReadonly(),bumpError:s.asReadonly(),bumpTooltip:c,onBumpClick:b,dismissBumpError:k}}function gJ(t){return typeof t!="object"||t===null?!1:t.key==="allowEditSmFiles"}function dg(t){an(dg);let{path:i,pathSet:e,dataSource:n}=t,o=H(new Set),r=H(new Set),a=H(new Set);return ie(()=>{i(),o.set(new Set),r.set(new Set),a.set(new Set)}),{linkStatus:p=>e().has(p)||o().has(p)?"live":r().has(p)?"dead-confirmed":"dead-heuristic",isVerifying:p=>a().has(p),verifyDeadLink:async p=>{if(!(o().has(p)||r().has(p))&&!a().has(p)){a.update(_=>new Set(_).add(p));try{await n.getNode(p)===null?r.update(b=>new Set(b).add(p)):o.update(b=>new Set(b).add(p))}catch{}finally{a.update(_=>{let b=new Set(_);return b.delete(p),b})}}}}}function lg(t){an(lg);let i=H(!1),e=H(!1),n=H(!1);return ie(()=>{t.path(),i.set(!1),e.set(!1),n.set(!1)}),{auditExpanded:i.asReadonly(),pluginsExpanded:e.asReadonly(),debugVisible:n.asReadonly(),toggleAudit:()=>i.update(o=>!o),togglePlugins:()=>e.update(o=>!o),toggleDebug:()=>n.update(o=>!o)}}var vJ=new Set(["inspector.body.panel.breakdown","inspector.body.panel.records","inspector.body.panel.tree","inspector.body.panel.key-values","inspector.body.panel.link-list","inspector.body.panel.markdown"]),yJ=new Set(["identity","annotations","settings","audit"]),CJ=new Set(["agent","skill","command"]);function Sk(t){let{node:i,texts:e}=t,n=S(()=>{let c=i()?.sidecar;if(!c||!c.present)return null;if(c.root)return c.root;let u={};return c.annotations&&(u.annotations=c.annotations),u}),o=S(()=>{let c=i()?.kind;return c!==void 0&&CJ.has(c)}),r=S(()=>{let c=n();if(!c)return!1;for(let u of Object.keys(c))if(!yJ.has(u))return!0;return!1}),a=S(()=>{let c=i()?.contributions??[];for(let u of c)if(vJ.has(u.slot))return!0;return!1}),s=S(()=>{let c=n();if(!c)return e.audit.headerEmpty;let u=c.audit;if(typeof u!="object"||u===null)return e.audit.headerEmpty;let p=u,_=typeof p.lastBumpedAt=="string"?p.lastBumpedAt:null,b=typeof p.lastBumpedBy=="string"?p.lastBumpedBy:null;return _===null?e.audit.headerEmpty:e.audit.headerSummary(Co(_),b??"?")});return{sidecarRoot:n,hasVendorFrontmatter:o,hasPluginContributions:r,hasViewContributions:a,auditSummary:s}}function xJ(t,i){if(t&1&&(f(0,"section",0)(1,"div",1),R(2,"span",2),f(3,"p",3),v(4),h(),f(5,"p",4)(6,"span"),v(7),h(),f(8,"a",5),v(9),h(),f(10,"span"),v(11),h(),f(12,"a",6),v(13),h(),f(14,"span"),v(15),h()()()()),t&2){let e=m();d(4),C(e.texts.emptyNoSelection.title),d(3),C(e.texts.emptyNoSelection.descPrefix),d(2),C(e.texts.emptyNoSelection.listLink),d(2),C(e.texts.emptyNoSelection.descMiddle),d(2),C(e.texts.emptyNoSelection.mapLink),d(2),C(e.texts.emptyNoSelection.descSuffix)}}function wJ(t,i){if(t&1&&(f(0,"section",0)(1,"div",7),R(2,"span",8),f(3,"p",3),v(4),h(),f(5,"p",4)(6,"code"),v(7),h(),f(8,"span"),v(9),h(),f(10,"a",5),v(11),h(),f(12,"span"),v(13),h()()()()),t&2){let e=m();d(4),C(e.texts.emptyNotFound.title),d(3),C(e.path()),d(2),C(e.texts.emptyNotFound.descSuffix),d(2),C(e.texts.emptyNotFound.backLink),d(2),C(e.texts.emptyNotFound.descAfterLink)}}function SJ(t,i){if(t&1&&(f(0,"p",10),v(1),h()),t&2){m();let e=J(1);d(),C(e.description)}}function IJ(t,i){if(t&1&&(f(0,"div",11),R(1,"i",40),f(2,"span"),v(3),h()()),t&2){let e=m(2);d(3),C(e.texts.supersededByBanner(i))}}function TJ(t,i){if(t&1){let e=re();f(0,"div",12),R(1,"i",41),f(2,"span"),v(3),h(),f(4,"button",42),V("click",function(){L(e);let o=m(2);return B(o.dismissBumpError())}),R(5,"i",43),h()()}if(t&2){let e=m(2);d(3),C(i),d(),q("aria-label",e.texts.bumpErrorDismissAriaLabel)}}function EJ(t,i){if(t&1&&(f(0,"a",16),v(1),h()),t&2){let e=m(2);d(),C(e.texts.backToList)}}function PJ(t,i){if(t&1&&(f(0,"div",17),R(1,"sm-vendor-frontmatter",44),h()),t&2){m();let e=J(0),n=J(1),o=m();d(),E("frontmatter",n)("kind",e.kind)("provider",e.provider)("knownPaths",o.pathSet())("onSkillClick",o.onSkillChip)}}function kJ(t,i){if(t&1){let e=re();f(0,"section",18)(1,"h3",20),v(2),h(),f(3,"sm-annotations-panel",45),V("openPath",function(o){L(e);let r=m(2);return B(r.openPath(o))})("tagClick",function(o){L(e);let r=m(2);return B(r.tagSelect.emit(o))}),h()()}if(t&2){m();let e=J(0),n=m();d(2),C(n.texts.sections.annotations),d(),E("overlay",e.sidecar)("authorTags",n.authorTags())("knownPaths",n.pathSet())("activeTag",n.activeTag())}}function MJ(t,i){if(t&1&&(f(0,"p",53)(1,"strong"),v(2),h(),v(3),h()),t&2){let e=m(4);d(2),C(e.texts.findingHintLabel),d(),Le(" ",i," ")}}function DJ(t,i){if(t&1&&(f(0,"li",48)(1,"div",49)(2,"span",50),v(3),h(),f(4,"code",51),v(5),h()(),f(6,"p",52),v(7),h(),I(8,MJ,4,2,"p",53),h()),t&2){let e,n=i.$implicit;q("data-severity",n.severity),d(2),q("data-severity",n.severity),d(),C(n.severity),d(2),C(n.analyzerId),d(2),C(n.message),d(),T((e=n.fix==null?null:n.fix.summary)?8:-1,e)}}function OJ(t,i){if(t&1&&(f(0,"section",22)(1,"h3",20),v(2),f(3,"span",46),v(4),h()(),f(5,"ul",47),Y(6,DJ,9,6,"li",48,Bf),h()()),t&2){let e=m(2);d(2),Le(" ",e.texts.sections.findings," "),d(2),Le("(",e.issues().length,")"),d(2),X(e.issues())}}function NJ(t,i){if(t&1&&R(0,"sm-inspector-audit-panel",27),t&2){let e=m(2);E("sidecarRoot",e.sidecarRoot())}}function RJ(t,i){if(t&1&&R(0,"sm-plugin-contributions",27),t&2){let e=m(3);E("sidecarRoot",e.sidecarRoot())}}function AJ(t,i){if(t&1){let e=re();f(0,"section",28)(1,"button",54),V("click",function(){L(e);let o=m(2);return B(o.togglePlugins())}),f(2,"span",20),v(3),h(),R(4,"i",26),h(),I(5,RJ,1,1,"sm-plugin-contributions",27),h()}if(t&2){let e=m(2);d(),q("aria-expanded",e.pluginsExpanded()),d(2),C(e.texts.sections.plugins),d(),se("pi-chevron-right",!e.pluginsExpanded())("pi-chevron-down",e.pluginsExpanded()),d(),T(e.pluginsExpanded()?5:-1)}}function FJ(t,i){if(t&1&&(f(0,"section",29)(1,"h3",20),v(2),h(),R(3,"sm-inspector-slots-panel",55),h()),t&2){let e=m(2);d(2),C(e.texts.sections.viewContributions),d(),E("node",e.node())}}function LJ(t,i){if(t&1&&(f(0,"div",32),R(1,"sm-inspector-debug-panel",56),h()),t&2){m();let e=J(0),n=m();d(),E("node",e)("sidecarRoot",n.sidecarRoot())("overlay",e.sidecar)}}function BJ(t,i){if(t&1&&(f(0,"p",34),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.loading)}}function zJ(t,i){if(t&1&&(f(0,"p",35),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.empty)}}function qJ(t,i){if(t&1&&(f(0,"p",36),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.unavailable)}}function VJ(t,i){if(t&1&&(f(0,"p",37),v(1),h()),t&2){let e=m(2);d(),C(e.texts.body.renderError)}}function HJ(t,i){if(t&1&&R(0,"div",38),t&2){let e=m(2);E("innerHTML",e.bodyHtml(),mg)}}function GJ(t,i){if(t&1){let e=re();nt(0)(1),f(2,"section",0)(3,"sm-inspector-header",9),V("close",function(){L(e);let o=m();return B(o.onHeaderClose())})("favoriteToggle",function(o){L(e);let r=m();return B(r.onHeaderFavoriteToggle(o))}),h(),I(4,SJ,2,1,"p",10),I(5,IJ,4,1,"div",11),I(6,TJ,6,2,"div",12),f(7,"div",13)(8,"p-button",14),V("onClick",function(){L(e);let o=m();return B(o.onBumpClick())}),h(),f(9,"p-button",15),V("onClick",function(){L(e);let o=m();return B(o.refreshBody())}),h(),I(10,EJ,2,1,"a",16),h(),I(11,PJ,2,5,"div",17),I(12,kJ,4,5,"section",18),f(13,"section",19)(14,"h3",20),v(15),h(),f(16,"sm-linked-nodes-panel",21),V("openPath",function(o){L(e);let r=m();return B(r.openPath(o))}),h()(),I(17,OJ,8,2,"section",22),f(18,"section",23)(19,"button",24),V("click",function(){L(e);let o=m();return B(o.toggleAudit())}),f(20,"span",20),v(21),h(),f(22,"span",25),v(23),h(),R(24,"i",26),h(),I(25,NJ,1,1,"sm-inspector-audit-panel",27),h(),I(26,AJ,6,7,"section",28),I(27,FJ,4,2,"section",29),f(28,"section",30)(29,"button",31),V("click",function(){L(e);let o=m();return B(o.toggleDebug())}),f(30,"span",20),v(31),h(),R(32,"i",26),h(),I(33,LJ,2,3,"div",32),h(),f(34,"section",33)(35,"h3",20),v(36),h(),I(37,BJ,2,1,"p",34)(38,zJ,2,1,"p",35)(39,qJ,2,1,"p",36)(40,VJ,2,1,"p",37)(41,HJ,1,1,"div",38),h(),R(42,"p-confirmdialog",39),h()}if(t&2){let e,n,o,r=m(),a=We(r.node());d();let s=We(a.frontmatter);d(2),E("node",a)("mode",r.mode())("showActionMocks",r.showActionMocks),d(),T(s.description?4:-1),d(),T((e=r.headerSupersededBy())?5:-1,e),d(),T((n=r.bumpError())?6:-1,n),d(2),E("label",r.texts.bump.label)("disabled",!r.canBump()||r.bumpInFlight())("loading",r.bumpInFlight())("pTooltip",r.bumpTooltip()),d(),E("text",!0)("ariaLabel",r.texts.body.refreshLabel)("pTooltip",r.texts.body.refreshLabel)("disabled",r.bodyState()==="loading"||!r.path())("loading",r.bodyState()==="loading"),d(),T(r.mode()==="standalone"?10:-1),d(),T(r.hasVendorFrontmatter()?11:-1),d(),T(a.sidecar!=null&&a.sidecar.present||r.authorTags().length>0?12:-1),d(3),C(r.texts.sections.connections),d(),E("path",a.path),d(),T(r.issues().length>0?17:-1),d(2),q("aria-expanded",r.auditExpanded()),d(2),C(r.texts.sections.audit),d(2),C(r.auditSummary()),d(),se("pi-chevron-right",!r.auditExpanded())("pi-chevron-down",r.auditExpanded()),d(),T(r.auditExpanded()?25:-1),d(),T(r.hasPluginContributions()?26:-1),d(),T(r.hasViewContributions()?27:-1),d(2),E("pTooltip",r.texts.debugToggleTooltip),q("aria-expanded",r.debugVisible())("aria-label",r.texts.debugToggleAriaLabel),d(2),C(r.texts.sections.debug),d(),se("pi-chevron-right",!r.debugVisible())("pi-chevron-down",r.debugVisible()),d(),T(r.debugVisible()?33:-1),d(3),C(r.texts.sections.body),d(),T((o=r.bodyState())==="loading"?37:o==="empty"?38:o==="unavailable"?39:o==="error"?40:o==="ready"?41:-1),d(5),E("ariaLabel",r.texts.bump.consentDialogAriaLabel)}}var Ef=class t{loader=l(Lt);router=l(Jr);dataSource=l(un);markdown=l(n0);sidecarService=l(mf);confirmation=l(Ei);texts=Vn;cardTexts=Yn;showActionMocks=po.inspector.actionMocks;path=O(void 0);mode=O("standalone");activeTag=O(null);close=Be();tagSelect=Be();node=S(()=>{let i=this.path();return i?this.loader.nodes().find(e=>e.path===i)??null:null});pathSet=S(()=>{let i=new Set;for(let e of this.loader.nodes())i.add(e.path);return i});authorTags=S(()=>{let e=(this.node()?.frontmatter??{}).tags;if(!Array.isArray(e))return[];let n=e.filter(o=>typeof o=="string"&&o.length>0);return[...new Set(n)].sort()});headerSupersededBy=S(()=>Vg(this.node()));bodyHandle=sg({path:this.path,dataSource:this.dataSource,markdown:this.markdown});bodyState=this.bodyHandle.bodyState;bodyHtml=this.bodyHandle.bodyHtml;deadLink=dg({path:this.path,pathSet:this.pathSet,dataSource:this.dataSource});sectionCollapse=lg({path:this.path});auditExpanded=this.sectionCollapse.auditExpanded;pluginsExpanded=this.sectionCollapse.pluginsExpanded;debugVisible=this.sectionCollapse.debugVisible;derivations=Sk({node:this.node,texts:this.texts});sidecarRoot=this.derivations.sidecarRoot;hasVendorFrontmatter=this.derivations.hasVendorFrontmatter;hasPluginContributions=this.derivations.hasPluginContributions;hasViewContributions=this.derivations.hasViewContributions;auditSummary=this.derivations.auditSummary;issues=H([]);issuesLoaderEffect=ie(i=>{let e=this.path();if(this.issues.set([]),!e)return;let n=!1;i(()=>{n=!0}),this.dataSource.listIssues({node:e}).then(o=>{n||this.issues.set(o.items)}).catch(()=>{n||this.issues.set([])})});ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}openPath(i){this.router.navigate(["/map"],{queryParams:{path:i}})}onSkillChip=i=>{this.openPath(i)};pathExists(i){return this.pathSet().has(i)}linkStatus(i){return this.deadLink.linkStatus(i)}isVerifying(i){return this.deadLink.isVerifying(i)}verifyDeadLink(i){return this.deadLink.verifyDeadLink(i)}refreshBody(){this.bodyHandle.refresh()}onHeaderFavoriteToggle(i){let e=this.node();!e||e.path!==i||this.loader.toggleFavorite(i,!e.isFavorite)}onHeaderClose(){this.close.emit()}toggleAudit(){this.sectionCollapse.toggleAudit()}togglePlugins(){this.sectionCollapse.togglePlugins()}toggleDebug(){this.sectionCollapse.toggleDebug()}bumpHandle=cg({node:this.node,sidecarService:this.sidecarService,confirmation:this.confirmation});canBump=this.bumpHandle.canBump;bumpInFlight=this.bumpHandle.bumpInFlight;bumpError=this.bumpHandle.bumpError;bumpTooltip=this.bumpHandle.bumpTooltip;onBumpClick(){return this.bumpHandle.onBumpClick()}dismissBumpError(){this.bumpHandle.dismissBumpError()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-inspector-view"]],hostVars:2,hostBindings:function(e,n){e&2&&se("inspector-view--embedded",n.mode()==="embedded")},inputs:{path:[1,"path"],mode:[1,"mode"],activeTag:[1,"activeTag"]},outputs:{close:"close",tagSelect:"tagSelect"},features:[ge([Ei])],decls:3,vars:1,consts:[["data-testid","inspector-view",1,"inspector"],["data-testid","inspector-empty-no-selection",1,"empty-state"],[1,"empty-state__icon","pi","pi-eye"],[1,"empty-state__title"],[1,"empty-state__desc"],["routerLink","/files",1,"inspector__back"],["routerLink","/map",1,"inspector__back"],["data-testid","inspector-empty-not-found",1,"empty-state"],[1,"empty-state__icon","empty-state__icon--warn","pi","pi-question-circle"],[3,"close","favoriteToggle","node","mode","showActionMocks"],["data-testid","inspector-description",1,"inspector__desc"],["data-testid","inspector-superseded-banner",1,"inspector__banner","inspector__banner--warn"],["data-testid","inspector-bump-error",1,"inspector__banner","inspector__banner--error"],[1,"inspector__toolbar"],["icon","pi pi-arrow-up-right","severity","secondary","size","small","data-testid","inspector-bump",3,"onClick","label","disabled","loading","pTooltip"],["icon","pi pi-refresh","severity","secondary","size","small","data-testid","inspector-body-refresh",3,"onClick","text","ariaLabel","pTooltip","disabled","loading"],["routerLink","/files","data-testid","inspector-back",1,"inspector__back"],["data-testid","inspector-card-vendor-frontmatter",1,"inspector__vendor"],["data-testid","inspector-card-annotations",1,"sm-block"],["data-testid","inspector-card-linked-nodes",1,"sm-block"],[1,"sm-block__title"],[3,"openPath","path"],["data-testid","inspector-findings",1,"sm-block"],["data-testid","inspector-card-audit",1,"sm-block","sm-block--collapsible"],["type","button","data-testid","inspector-audit-toggle",1,"sm-block__row","sm-block__row--toggle",3,"click"],["data-testid","inspector-audit-summary",1,"sm-block__summary"],["aria-hidden","true",1,"pi","sm-block__chevron"],[3,"sidecarRoot"],["data-testid","inspector-card-plugins",1,"sm-block","sm-block--collapsible"],["data-testid","inspector-card-view-contributions",1,"sm-block"],["data-testid","inspector-card-debug",1,"sm-block","sm-block--collapsible"],["type","button","data-testid","inspector-debug-toggle",1,"sm-block__row","sm-block__row--toggle",3,"click","pTooltip"],["data-testid","inspector-debug-section",1,"inspector__debug"],["data-testid","inspector-card-body",1,"sm-block","inspector__body-section"],["data-testid","inspector-body-loading",1,"inspector__body-status"],["data-testid","inspector-body-empty",1,"inspector__body-status"],["data-testid","inspector-body-unavailable",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-error",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-rendered",1,"inspector__body-rendered",3,"innerHTML"],["data-testid","inspector-bump-consent","styleClass","sm-consent-dialog",3,"ariaLabel"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["type","button",1,"inspector__banner-dismiss",3,"click"],["aria-hidden","true",1,"pi","pi-times"],[3,"frontmatter","kind","provider","knownPaths","onSkillClick"],[3,"openPath","tagClick","overlay","authorTags","knownPaths","activeTag"],[1,"sm-block__count"],[1,"inspector__findings-list"],["data-testid","inspector-finding",1,"inspector__finding"],[1,"inspector__finding-head"],[1,"inspector__finding-severity"],[1,"inspector__finding-analyzer"],[1,"inspector__finding-message"],["data-testid","inspector-finding-hint",1,"inspector__finding-hint"],["type","button","data-testid","inspector-plugins-toggle",1,"sm-block__row","sm-block__row--toggle",3,"click"],[3,"node"],[3,"node","sidecarRoot","overlay"]],template:function(e,n){e&1&&I(0,xJ,16,6,"section",0)(1,wJ,14,5,"section",0)(2,GJ,43,45,"section",0),e&2&&T(n.path()?n.node()?2:1:0)},dependencies:[xg,ln,dn,Ne,Oe,sa,aa,vf,gf,Cf,bf,xf,wf,If,Tf],styles:["[_nghost-%COMP%]{display:block}.inspector[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.7rem;padding:1rem 1.1rem 1.25rem;background:var(--sm-bg-page);color:var(--p-text-color)}.inspector--empty[_ngcontent-%COMP%]{padding:2rem;color:var(--p-text-muted-color)}.inspector__back[_ngcontent-%COMP%]{font-size:.85rem;color:var(--p-primary-color)}.inspector__desc[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);font-size:.9rem;line-height:1.55;max-width:72ch}.inspector__toolbar[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;flex-wrap:wrap}[_nghost-%COMP%] .sm-block{display:flex;flex-direction:column;gap:.55rem;padding:.8rem .95rem;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:var(--sm-radius-lg);box-shadow:var(--sm-shadow-card)}[_nghost-%COMP%] .sm-block--collapsible{transition:box-shadow .14s ease}[_nghost-%COMP%] .sm-block--collapsible:hover{box-shadow:var(--sm-shadow-card-hover)}[_nghost-%COMP%] .sm-block__title{margin:0;font-size:.82rem;font-weight:600;letter-spacing:0;color:var(--p-text-color);display:flex;align-items:baseline;gap:.4rem}[_nghost-%COMP%] .sm-block__count{font-size:.75rem;font-weight:500;color:var(--p-text-muted-color)}[_nghost-%COMP%] .sm-block__sub{margin:0;font-size:.72rem;font-weight:500;color:var(--p-text-muted-color);text-transform:uppercase;letter-spacing:.05em}[_nghost-%COMP%] .sm-block__row{display:flex;align-items:center;gap:.5rem;width:100%;padding:0;margin:0;background:transparent;border:none;text-align:left;font:inherit;color:var(--p-text-color)}[_nghost-%COMP%] .sm-block__row--toggle{cursor:pointer}[_nghost-%COMP%] .sm-block--collapsible>.sm-block__row--toggle+:not(.inspector__debug){margin-top:.5rem;padding-top:.7rem;border-top:1px solid var(--sm-border)}[_nghost-%COMP%] .sm-block__row--toggle:hover .sm-block__title{color:var(--p-primary-color)}[_nghost-%COMP%] .sm-block__summary{font-size:.78rem;color:var(--p-text-muted-color);font-weight:400;flex:1 1 auto;margin-left:.3rem}[_nghost-%COMP%] .sm-block__chevron{color:var(--p-text-muted-color);font-size:.75rem;margin-left:auto}[_nghost-%COMP%] .sm-block__kv{display:grid;grid-template-columns:max-content 1fr;column-gap:1rem;row-gap:.35rem;margin:0;font-size:.85rem;align-items:baseline}[_nghost-%COMP%] .sm-block__kv dt{color:var(--p-text-muted-color);font-weight:500;font-size:.8rem}[_nghost-%COMP%] .sm-block__kv dd{margin:0;word-break:break-word;color:var(--p-text-color)}[_nghost-%COMP%] .sm-block__kv code{background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.78rem;font-family:var(--sm-font-mono)}.inspector__vendor[_ngcontent-%COMP%]{display:contents}.inspector__body-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.inspector__body-status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.inspector__body-status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.inspector__body-rendered[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.6;max-height:600px;overflow:auto;padding:.25rem 0 0}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{background:var(--p-content-background);border:1px solid var(--p-content-border-color);border-radius:var(--sm-radius-md);padding:.75rem;margin:.75rem 0;white-space:pre-wrap;word-wrap:break-word;font-family:var(--sm-font-mono);font-size:.85rem;line-height:1.5;overflow-x:auto}.inspector__body-rendered[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.1rem .3rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:transparent;padding:0;border-radius:0}.inspector__banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.55rem;padding:.55rem .75rem;border-radius:var(--sm-radius-md);font-size:.85rem;border:1px solid transparent}.inspector__banner--warn[_ngcontent-%COMP%]{background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);border-color:color-mix(in srgb,var(--sm-severity-warn) 30%,transparent)}.inspector__banner--error[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error);border-color:color-mix(in srgb,var(--sm-severity-error) 30%,transparent)}.inspector__banner-dismiss[_ngcontent-%COMP%]{margin-left:auto;background:transparent;border:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;justify-content:center}.inspector__debug[_ngcontent-%COMP%]{margin-top:.5rem;padding-top:.7rem;border-top:1px solid var(--sm-border)}.inspector__findings-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.45rem}.inspector__finding[_ngcontent-%COMP%]{padding:.55rem .7rem;border-left:3px solid var(--p-content-border-color);background:var(--p-content-background);border-radius:var(--sm-radius-sm)}.inspector__finding[data-severity=error][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-error);background:var(--sm-severity-error-bg)}.inspector__finding[data-severity=warn][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-warn);background:var(--sm-severity-warn-bg)}.inspector__finding[data-severity=info][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-info);background:var(--sm-severity-info-bg)}.inspector__finding-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.2rem}.inspector__finding-severity[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.65rem;font-weight:700;letter-spacing:.05em;padding:.05rem .4rem;border-radius:var(--sm-radius-sm);color:var(--p-content-background);background:var(--p-text-color)}.inspector__finding-severity[data-severity=error][_ngcontent-%COMP%]{background:var(--sm-severity-error)}.inspector__finding-severity[data-severity=warn][_ngcontent-%COMP%]{background:var(--sm-severity-warn)}.inspector__finding-severity[data-severity=info][_ngcontent-%COMP%]{background:var(--sm-severity-info)}.inspector__finding-analyzer[_ngcontent-%COMP%]{font-size:.78rem;color:var(--p-text-muted-color)}.inspector__finding-message[_ngcontent-%COMP%]{margin:0;font-size:.88rem;color:var(--p-text-color)}.inspector__finding-hint[_ngcontent-%COMP%]{margin:.35rem 0 0;font-size:.82rem;color:var(--p-text-color);background:var(--p-content-background);padding:.35rem .5rem;border-radius:var(--sm-radius-sm)}.inspector-view--embedded[_nghost-%COMP%] .inspector[_ngcontent-%COMP%]{gap:.6rem;padding:.85rem .85rem 1.1rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__desc[_ngcontent-%COMP%]{font-size:.88rem;line-height:1.5;max-width:none}.inspector-view--embedded[_nghost-%COMP%] .inspector__body-rendered[_ngcontent-%COMP%]{max-height:480px}[_nghost-%COMP%] .ann-panel__chip--author, [_nghost-%COMP%] .ann-panel__chip--user{padding:.1rem .55rem}"],changeDetection:0})};var Pf=class t{smMiddleMousePan=O.required();origin=null;rafId=null;pendingPosition=null;onMouseDown(i){if(i.button!==1)return;let e=this.smMiddleMousePan();if(!e)return;i.preventDefault();let n=e.getPosition()??{x:0,y:0};this.origin={mouseX:i.clientX,mouseY:i.clientY,canvasX:n.x,canvasY:n.y},document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd)}ngOnDestroy(){this.onEnd()}onMove=i=>{this.origin&&(this.pendingPosition={x:this.origin.canvasX+(i.clientX-this.origin.mouseX),y:this.origin.canvasY+(i.clientY-this.origin.mouseY)},this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let e=this.smMiddleMousePan();!e||!this.pendingPosition||(e.setPosition(this.pendingPosition),e.redraw())})))};onEnd=()=>{this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingPosition=null,this.origin=null,document.removeEventListener("mousemove",this.onMove),document.removeEventListener("mouseup",this.onEnd),this.smMiddleMousePan()?.emitCanvasChangeEvent()};static \u0275fac=function(e){return new(e||t)};static \u0275dir=Te({type:t,selectors:[["","smMiddleMousePan",""]],hostBindings:function(e,n){e&1&&V("mousedown",function(r){return n.onMouseDown(r)})},inputs:{smMiddleMousePan:[1,"smMiddleMousePan"]}})};function Ik(t,i){if(t.size===0)return{next:t,dirty:!1};let e=!1,n=new Set;for(let o of t)i.has(o)?n.add(o):e=!0;return{next:e?n:t,dirty:e}}function Tk(t){let{nodes:i,current:e,layout:n}=t,o=new Set(i.map(c=>c.path)),r=!1,a=new Map(e);for(let c of a.keys())o.has(c)||(a.delete(c),r=!0);let s=!1;for(let c of o)if(!a.has(c)){s=!0;break}for(let c of o){let u=n.positions.get(c);if(!u)continue;let p=a.get(c);if(!p){a.set(c,{x:u.x,y:u.y}),r=!0;continue}p.manual!==!0&&s&&(p.x===u.x&&p.y===u.y||(a.set(c,{x:u.x,y:u.y}),r=!0))}return{next:a,dirty:r}}function Ek(t){let{selectedPath:i,setSelectedNodeId:e,readSelectedNodeId:n,graphNodes:o,router:r,route:a}=t,s=Fg(a.queryParamMap.pipe(pg(c=>c.get("path"))),{initialValue:a.snapshot.queryParamMap.get("path")});ie(()=>{let c=s(),u=o();if(u.length===0||!c)return;let p=At(()=>n());if(p!==null&&u.find(k=>k.id===p)?.view.path===c)return;let _=u.find(b=>b.view.path===c);_&&e(_.id)}),ie(()=>{let c=i(),u=At(()=>s());(c??null)!==(u??null)&&r.navigate([],{relativeTo:a,queryParams:{path:c??null},queryParamsHandling:"merge",replaceUrl:!0})})}function Pk(t,i){let n=t.frontmatter.tags;if(Array.isArray(n)&&n.includes(i))return!0;let r=t.sidecar?.annotations?.tags;return!!(Array.isArray(r)&&r.includes(i))}function kk(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)}function Mk(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&typeof i.scale=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.scale)&&i.scale>0}function Dk(t){return t.querySelector(".p-overlay-mask, .p-dialog, .p-overlay")!==null}var Ok="sm.graph.viewport",Nk="sm.graph.node-positions",Rk="sm.graph.node-expanded",Ak="sm.graph.panel-width";function Fk(){let t=null;try{t=localStorage.getItem(Ok)}catch{return null}if(!t)return null;let i;try{i=JSON.parse(t)}catch{return null}return Mk(i)?i:null}function Lk(t){try{localStorage.setItem(Ok,JSON.stringify(t))}catch{}}function Bk(){let t=new Map,i=null;try{i=localStorage.getItem(Nk)}catch{return t}if(!i)return t;let e;try{e=JSON.parse(i)}catch{return t}if(typeof e!="object"||e===null)return t;for(let[n,o]of Object.entries(e)){if(!kk(o))continue;let r=o,s=r.manual===!0?{x:r.x,y:r.y,manual:!0}:{x:r.x,y:r.y};t.set(n,s)}return t}function kf(t){try{let i={};for(let[e,n]of t)i[e]=n.manual?{x:n.x,y:n.y,manual:!0}:{x:n.x,y:n.y};localStorage.setItem(Nk,JSON.stringify(i))}catch{}}function zk(){let t=null;try{t=localStorage.getItem(Rk)}catch{return new Set}if(!t)return new Set;let i;try{i=JSON.parse(t)}catch{return new Set}if(!Array.isArray(i))return new Set;let e=new Set;for(let n of i)typeof n=="string"&&n.length>0&&e.add(n);return e}function Mf(t){try{localStorage.setItem(Rk,JSON.stringify([...t]))}catch{}}function qk(){let t=null;try{t=localStorage.getItem(Ak)}catch{return null}if(!t)return null;let i=Number(t);return!Number.isFinite(i)||i<=0?null:i}function Vk(t){try{localStorage.setItem(Ak,String(Math.round(t)))}catch{}}var Hk=400,Df=400,Gk=80;function jk(t){let i=H(t.initialWidth),e=H(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&fg(window,"resize").pipe(ca(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let n=S(()=>{let _=Math.max(Df,e()-Gk),b=i();return b>_||b<Df?Math.min(Hk,_):b}),o=null,r=null,a=null,s=()=>{a=null,r!==null&&(i.set(r),r=null)},c=_=>{if(!o)return;let b=_.clientX-o.mouseX,k=o.widthAtStart-b,P=Math.max(Df,e()-Gk);r=Math.min(P,Math.max(Df,k)),a===null&&typeof window<"u"&&(a=window.requestAnimationFrame(s))},u=()=>{o&&(o=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),a!==null&&typeof window<"u"&&(window.cancelAnimationFrame(a),a=null),r!==null&&(i.set(r),r=null),t.onCommit(i()))};return{clampedPanelWidth:n,onPanelResizeStart:_=>{_.button===0&&(_.preventDefault(),_.stopPropagation(),o={mouseX:_.clientX,widthAtStart:n()},document.addEventListener("mousemove",c),document.addEventListener("mouseup",u))}}}function Of(t){let{points:i,wrap:e,panelW:n,zoomMin:o}=t;if(i.length===0)return null;let r=1/0,a=1/0,s=-1/0,c=-1/0;for(let Ce of i)Ce.x<r&&(r=Ce.x),Ce.y<a&&(a=Ce.y),Ce.x+260>s&&(s=Ce.x+260),Ce.y+120>c&&(c=Ce.y+120);let u=Math.max(1,e.width-n),p=Math.max(1,s-r),_=Math.max(1,c-a),b=Math.max(1,u-160),k=Math.max(1,e.height-160),P=Math.min(b/p,k/_),N=Math.min(2,Math.max(o,P)),j=(r+s)/2,z=(a+c)/2,U=u/2-j*N,oe=e.height/2-z*N;return{position:{x:U,y:oe},scale:N}}function Nf(t,i,e){if(typeof requestAnimationFrame>"u"||e<=0){t.writePosition(i.position),t.writeScale(i.scale);return}let n=t.readPosition(),o=t.readScale(),r=performance.now(),a=s=>{if(t.isStaleToken())return;let c=Math.min(1,(s-r)/e),u=jJ(c);t.writePosition({x:n.x+(i.position.x-n.x)*u,y:n.y+(i.position.y-n.y)*u}),t.writeScale(o+(i.scale-o)*u),c<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}function jJ(t){return 1-Math.pow(1-t,3)}var Uk=320;function Wk(t){let i=H(null),e=null,n=0,o=(c,u)=>{let p=++n;Nf({readPosition:()=>t.viewportPosition(),readScale:()=>t.viewportScale(),writePosition:_=>t.viewportPosition.set(_),writeScale:_=>t.viewportScale.set(_),isStaleToken:()=>p!==n},c,u)},r=c=>{let u=t.canvasWrap();if(!u||c.length===0)return;let p=t.fullLayout(),_=[];for(let k of c){let P=p.positions.get(k);P&&_.push(P)}if(_.length===0)return;let b=Of({points:_,wrap:u,panelW:t.selectedNodeId()!==null?t.clampedPanelWidth():0,zoomMin:t.zoomMin});b&&o(b,Uk)},a=()=>{let c=e;c&&(e=null,o({position:c.position,scale:c.scale},Uk))};return{activeTagSelection:i,onTagSelect:c=>{let u=t.flow();if(!u)return;if(i()===c){u.clearSelection(),i.set(null),a();return}let p=t.nodes().filter(_=>Pk(_,c)).map(_=>_.path);if(p.length===0){u.clearSelection(),i.set(null),a();return}e===null&&(e={position:de({},t.viewportPosition()),scale:t.viewportScale()}),u.select(p,[]),i.set(c),r(p)}}}var Rf=.25,ug=2;function $k(t){let i=H(t.savedViewport?{x:t.savedViewport.x,y:t.savedViewport.y}:{x:0,y:0}),e=H(t.savedViewport?.scale??1),n=S(()=>e()<ug-1e-6),o=S(()=>e()>Rf+1e-6);return{viewportPosition:i,viewportScale:e,canZoomIn:n,canZoomOut:o,onCanvasChange:a=>{let s=i();(s.x!==a.position.x||s.y!==a.position.y)&&i.set({x:a.position.x,y:a.position.y}),e()!==a.scale&&e.set(a.scale),t.hasCompletedInitialLayout()&&Lk({x:a.position.x,y:a.position.y,scale:a.scale})}}}function Kk(t){let i=S(()=>{let c=new Map;for(let u of t.graph().edges)c.has(u.from)||c.set(u.from,new Set),c.has(u.to)||c.set(u.to,new Set),c.get(u.from).add(u.to),c.get(u.to).add(u.from);return c}),e=c=>t.selectedNodeId()===c,n=c=>{let u=t.selectedNodeId();return u===null||u===c?!1:i().get(u)?.has(c)??!1},o=c=>{if(t.activeTagSelection()!==null)return!1;let u=t.selectedNodeId();return u===null||u===c?!1:!(i().get(u)?.has(c)??!1)},r=c=>{let u=t.selectedNodeId();return u!==null&&(c.from===u||c.to===u)},a=c=>{if(t.activeTagSelection()!==null)return!1;let u=t.selectedNodeId();return u===null?!1:c.from!==u&&c.to!==u},s=S(()=>{let c=t.selectedNodeId(),u=t.activeTagSelection()!==null,p=c!==null?i().get(c)??null:null,_=new Map;for(let b of t.graph().nodes){let k=b.id,P=c===k,N=!P&&c!==null&&(p?.has(k)??!1),j=!u&&c!==null&&!P&&!(p?.has(k)??!1);_.set(k,{selected:P,highlighted:N,dimmed:j})}return _});return{isSelected:e,isHighlighted:n,isDimmed:o,isEdgeHighlighted:r,isEdgeDimmed:a,selectionView:s}}function Yk(t){let i=t.onCommit??kf,e=null,n=!1,o=null,r=()=>{queueMicrotask(()=>{if(!n){o=null;return}n=!1,o&&(t.nodePositions.set(o),o=null),i(t.nodePositions())})},a=(u,p)=>{o||(o=new Map(t.nodePositions())),o.set(u,{x:p.x,y:p.y,manual:!0}),n=!0},s=u=>{e={x:u.clientX,y:u.clientY},document.addEventListener("mouseup",r,{once:!0})},c=u=>{let p=e;if(e=null,!p)return!0;let _=u.clientX-p.x,b=u.clientY-p.y;return Math.hypot(_,b)<=4};return t.destroyRef.onDestroy(()=>{document.removeEventListener("mouseup",r)}),{onNodePositionChange:a,onNodePointerDown:s,isClickWithoutDrag:c}}function Xk(t){let i=H(zk());return ie(()=>{let r=new Set(t.nodes().map(s=>s.path));if(r.size===0)return;let a=Ik(i(),r);a.dirty&&(i.set(a.next),Mf(a.next))}),{isExpanded:r=>i().has(r),setExpanded:(r,a)=>{let s=i();if(s.has(r)===a)return;let c=new Set(s);a?c.add(r):c.delete(r),i.set(c),Mf(c)},resetAll:()=>{i.set(new Set),Mf(new Set)},expandedNodeIds:i}}function Zk(t){let i=!1,e=null;return ie(()=>{let n=t.visibleNodes();i||n.length!==0&&queueMicrotask(()=>{i=!0,t.savedViewport||t.fit()})}),ie(()=>{let n=t.pathsFingerprint();if(!i){e=n;return}e!==n&&(e=n,(t.animatedFit??t.fit)())}),{hasCompletedInitialLayout:()=>i}}var UJ=["canvasWrap"],eM=(t,i)=>i.id;function WJ(t,i){if(t&1&&(f(0,"div",2),R(1,"span",7),f(2,"p",8),v(3),h()()),t&2){let e=m();d(3),C(e.texts.loading)}}function $J(t,i){if(t&1&&(f(0,"div",3),R(1,"span",9),f(2,"p",8),v(3),h(),f(4,"p",10),v(5),h()()),t&2){let e=m();d(3),C(e.texts.errorTitle),d(2),C(e.error())}}function KJ(t,i){if(t&1){let e=re();f(0,"div",4),R(1,"i",11),f(2,"p",12),v(3),h(),f(4,"p-button",13),V("onClick",function(){L(e);let o=m();return B(o.resetFilters())}),h()()}if(t&2){let e=m();d(3),C(e.texts.emptyTitle),d(),E("label",e.texts.resetFilters)("text",!0)}}function YJ(t,i){if(t&1&&(f(0,"f-connection",33),et(),f(1,"svg",34),R(2,"circle",35),h(),qr(),R(3,"f-connection-marker-arrow",36),h()),t&2){let e=i.$implicit,n=m(2);Ae("f-conn--"+e.kind),Tt("opacity",n.edgeOpacity(e)),se("f-conn--highlighted",n.isEdgeHighlighted(e))("f-conn--dimmed",n.isEdgeDimmed(e)),E("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fOutputSide",n.outputSide())("fInputSide",n.inputSide())("fType",n.connectionType())("fBehavior",n.connectionBehavior)("fReassignDisabled",!0),d(),E("type",n.markerStart)("width",9)("height",9)("refX",4.5)("refY",4.5),d(2),E("type",n.markerEnd)}}function XJ(t,i){if(t&1){let e=re();Wn(0,20),f(1,"div",38),V("fNodePositionChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){L(e);let r=m(3);return B(r.onNodePointerDown(o))})("click",function(o){let r=L(e).$implicit,a=m(3);return B(a.selectNode(r,o))})("dblclick",function(){let o=L(e).$implicit,r=m(3);return B(r.openNode(o))}),f(2,"sm-node-card",39),V("expandedChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.setExpanded(r.id,o))})("favoriteToggle",function(o){L(e);let r=m(3);return B(r.onFavoriteToggle(o))}),h(),f(3,"div",40),R(4,"sm-view-contributions-host",41),h()(),$n()}if(t&2){let e=i.$implicit,n=m(3);d(),E("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide())("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide()),q("data-testid","graph-node-"+e.id),d(),E("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),d(2),E("node",e.view)}}function ZJ(t,i){if(t&1&&be(0,XJ,5,14,"ng-container",37),t&2){let e=m(2);E("fVirtualForOf",e.graph().nodes)}}function QJ(t,i){if(t&1){let e=re();f(0,"div",43),V("fNodePositionChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){L(e);let r=m(3);return B(r.onNodePointerDown(o))})("click",function(o){let r=L(e).$implicit,a=m(3);return B(a.selectNode(r,o))})("dblclick",function(){let o=L(e).$implicit,r=m(3);return B(r.openNode(o))}),f(1,"sm-node-card",39),V("expandedChange",function(o){let r=L(e).$implicit,a=m(3);return B(a.setExpanded(r.id,o))})("favoriteToggle",function(o){L(e);let r=m(3);return B(r.onFavoriteToggle(o))}),h(),f(2,"div",40),R(3,"sm-view-contributions-host",41),h()()}if(t&2){let e=i.$implicit,n=m(3);E("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fOutputId",e.id+"-out"),q("data-testid","graph-node-"+e.id),d(),E("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),d(2),E("node",e.view)}}function JJ(t,i){if(t&1&&(Wn(0,20),Y(1,QJ,4,12,"div",42,eM),$n()),t&2){let e=m(2);d(),X(e.graph().nodes)}}function eee(t,i){if(t&1&&R(0,"sm-perf-hud",26),t&2){let e=m(2);E("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())}}function tee(t,i){if(t&1){let e=re();f(0,"div",14,0),V("click",function(o){L(e);let r=m();return B(r.onCanvasClick(o))}),f(2,"f-flow",15),V("fLoaded",function(){L(e);let o=m();return B(o.onLoaded())}),R(3,"f-selection-area"),f(4,"f-background"),R(5,"f-rect-pattern"),h(),R(6,"f-line-alignment",16),f(7,"f-canvas",17),V("fCanvasChange",function(o){L(e);let r=m();return B(r.onCanvasChange(o))}),Wn(8,18),Y(9,YJ,4,21,"f-connection",19,eM),$n(),I(11,ZJ,1,1,"ng-container",20)(12,JJ,3,0,"ng-container",20),h(),R(13,"f-minimap"),h(),f(14,"div",21),R(15,"sm-kind-palette")(16,"sm-severity-palette")(17,"sm-link-kind-palette"),h(),f(18,"aside",22)(19,"div",23),V("mousedown",function(o){L(e);let r=m();return B(r.onPanelResizeStart(o))}),h(),f(20,"div",24)(21,"sm-inspector-view",25),V("close",function(){L(e);let o=m();return B(o.closePanel())})("tagSelect",function(o){L(e);let r=m();return B(r.onTagSelect(o))}),h()()(),I(22,eee,1,3,"sm-perf-hud",26),f(23,"div",27)(24,"p-button",28),V("onClick",function(){L(e);let o=m();return B(o.zoomIn())}),h(),f(25,"p-button",29),V("onClick",function(){L(e);let o=m();return B(o.zoomOut())}),h(),f(26,"p-button",30),V("onClick",function(){L(e);let o=m();return B(o.fitToScreen())}),h(),R(27,"span",31)(28,"sm-graph-layout-toolbar")(29,"span",31),f(30,"p-button",32),V("onClick",function(){L(e);let o=m();return B(o.resetLayout())}),h()()()}if(t&2){let e=m();E("smMiddleMousePan",e.canvas()),d(2),E("fCache",e.perf.cache),d(4),E("fAlignThreshold",20),d(),E("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("fZoomMinimum",e.zoomMin)("fZoomMaximum",e.zoomMax)("debounceTime",150),d(2),X(e.graph().edges),d(2),T(e.perf.virtualization?11:12),d(7),Tt("width",e.clampedPanelWidth(),"px"),se("is-open",e.selectedNodeId()!==null),q("aria-label",e.texts.a11y.panel),d(),q("aria-label",e.texts.panel.resizeLabel),d(2),E("path",e.selectedPath())("activeTag",e.activeTagSelection()),d(),T(e.perfHud()?22:-1),d(),q("aria-label",e.texts.a11y.toolbar),d(),E("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),d(),E("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),d(),E("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),d(4),E("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0)}}var Qk=.2,nee=420,iee=.15,oee=.25,ree=.75,aee=.6,see={selected:!1,highlighted:!1,dimmed:!1},Jk=class t{loader=l(Lt);filters=l(pn);issuePaths=l(pa);graphPreferences=l(fo);router=l(Jr);route=l(bg);confirmationService=l(Ei);destroyRef=l(at);dagreLayout=l(X_);injector=l(Xe);flow=Pe(cr);canvas=Pe(sr);zoom=Pe(dr);canvasWrap=Pe("canvasWrap");connectionType=this.graphPreferences.connectionType;connectionBehavior=xn.FIXED;markerStart=_e.START_ALL_STATES;markerEnd=_e.END_ALL_STATES;perf=po.graph.perf;perfHud=l(hf).visible;savedViewport=Fk();viewportStore=$k({savedViewport:this.savedViewport,hasCompletedInitialLayout:()=>this.layoutFit.hasCompletedInitialLayout()});viewportPosition=this.viewportStore.viewportPosition;viewportScale=this.viewportStore.viewportScale;canZoomIn=this.viewportStore.canZoomIn;canZoomOut=this.viewportStore.canZoomOut;zoomMin=Rf;zoomMax=ug;texts=on;nodePositions=H(Bk());nodeDrag=Yk({destroyRef:this.destroyRef,nodePositions:this.nodePositions});expansion=Xk({nodes:this.loader.nodes});panelResize=jk({destroyRef:this.destroyRef,initialWidth:qk()??400,onCommit:i=>Vk(i)});clampedPanelWidth=this.panelResize.clampedPanelWidth;loading=this.loader.loading;error=this.loader.error;visibleNodes=S(()=>this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()));topology=S(()=>d0(this.loader.nodes(),this.loader.scan()));layoutPositions=H(new Map);layoutComputedAtSignal=H(0);fullLayout=S(()=>jn(de({},this.topology()),{positions:this.layoutPositions(),computedAt:this.layoutComputedAtSignal()}));graph=S(()=>{let i=new Set(this.visibleNodes().map(o=>o.path)),e=this.filters.selectedLinkKinds(),n=e.length>0?new Set(e):null;return p0(this.fullLayout(),i,this.nodePositions(),n)});hasData=S(()=>this.graph().nodes.length>0);showEmptyState=S(()=>!this.hasData()&&!this.filters.kindToggleExplicitEmpty()&&this.filters.searchText().trim().length===0);visibleCount=S(()=>this.graph().nodes.length);totalCount=S(()=>this.loader.nodes().length);edgeCount=S(()=>this.graph().edges.length);layoutComputedAt=S(()=>this.layoutComputedAtSignal());connectionSides=S(()=>WP(this.graphPreferences.layoutAlgorithm(),this.graphPreferences.layoutDirection()));inputSide=S(()=>this.connectionSides().input);outputSide=S(()=>this.connectionSides().output);selectedNodeId=H(null);selectedPath=S(()=>{let i=this.selectedNodeId();return i?this.graph().nodes.find(n=>n.id===i)?.view.path:void 0});selectionGuard=ie(()=>{let i=this.selectedNodeId();if(i===null)return;this.graph().nodes.some(n=>n.id===i)||this.selectedNodeId.set(null)});pathsFingerprint=S(()=>this.loader.nodes().map(i=>i.path).sort().join("|"));layoutFit=Zk({visibleNodes:this.visibleNodes,pathsFingerprint:this.pathsFingerprint,savedViewport:this.savedViewport,fit:()=>this.fitToScreenClamped(),animatedFit:()=>this.animatedFitToScreen()});constructor(){let i=S(()=>this.loader.nodes().map(o=>({id:o.path,view:{path:o.path}})),{equal:(o,r)=>{if(o.length!==r.length)return!1;for(let a=0;a<o.length;a++)if(o[a]?.id!==r[a]?.id)return!1;return!0}});Ek({selectedPath:this.selectedPath,setSelectedNodeId:o=>this.selectedNodeId.set(o),readSelectedNodeId:()=>this.selectedNodeId(),graphNodes:i,router:this.router,route:this.route}),ie(()=>{let o=this.loader.nodes();if(o.length===0)return;let r=this.fullLayout();if(r.positions.size===0)return;let a=Tk({nodes:o,current:this.nodePositions(),layout:r});a.dirty&&(this.nodePositions.set(a.next),kf(a.next))}),ie(()=>{this.layoutComputedAt(),this.autoFitPending&&(this.autoFitPending=!1,this.runAnimatedFit())});let e="",n="";ie(()=>{let o=this.loader.nodes(),r=this.topology(),a={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()};if(o.length===0)return;let s=c0(o,r.edges),c=`${a.algorithm}|${a.direction}|${a.spacing}`,u=`${s}|${c}`;if(u===e)return;let p=n!==""&&n!==c;e=u,n=c,(a.algorithm==="force"?Promise.resolve(u0(o,r.edges)):Promise.resolve().then(()=>l0(this.dagreLayout,o,r.edges,a))).then(b=>{this.layoutPositions.set(b),this.layoutComputedAtSignal.set(performance.now()),p&&(this.nodePositions.set(new Map),this.fitToScreenClamped())}).catch(b=>{console.error("[graph-view] layout failed:",b)})})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange=this.viewportStore.onCanvasChange;fitToScreenClamped(){let i=this.canvas(),e=this.zoom();i&&(i.fitToScreen({x:40,y:40},!1),jr(()=>{let n=i.transform.scale;if(n<=this.zoomMax&&n>=this.zoomMin)return;let o=Math.max(this.zoomMin,Math.min(n,this.zoomMax)),r=Math.abs(n-o),a=n>o?Pt.ZOOM_OUT:Pt.ZOOM_IN;e?.setZoom(this.getViewportCenter(),r,a,!1)},{injector:this.injector}))}autoFitAnimToken=0;autoFitPending=!1;animatedFitToScreen(){this.autoFitPending=!0}runAnimatedFit(){let i=this.canvasWrap()?.nativeElement;if(!i)return;let e={width:i.clientWidth,height:i.clientHeight},n=this.fullLayout().positions;if(n.size===0)return;let o=this.nodePositions(),r=this.visibleNodes().map(u=>u.path),a=[];for(let u of r){let p=o.get(u)??n.get(u);p&&a.push({x:p.x,y:p.y})}if(a.length===0)return;let s=Of({points:a,wrap:e,panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,zoomMin:this.zoomMin});if(!s)return;let c=++this.autoFitAnimToken;Nf({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:u=>this.viewportPosition.set(u),writeScale:u=>this.viewportScale.set(u),isStaleToken:()=>c!==this.autoFitAnimToken},s,nee)}onNodePositionChange(i,e){this.nodeDrag.onNodePositionChange(i,e)}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),Qk,Pt.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),Qk,Pt.ZOOM_OUT,!0)}fitToScreen(){this.fitToScreenClamped()}resetLayout(){let i=on.resetLayoutConfirm;this.confirmationService.confirm({header:i.header,message:i.message,icon:"pi pi-exclamation-triangle",acceptButtonProps:{label:i.accept,severity:"danger"},rejectButtonProps:{label:i.reject,severity:"secondary",outlined:!0},accept:()=>{this.nodePositions.set(new Map),this.expansion.resetAll(),this.fitToScreenClamped()}})}getViewportCenter(){let i=this.canvasWrap()?.nativeElement;if(!i)return{x:0,y:0};let e=i.getBoundingClientRect();return{x:e.width/2,y:e.height/2}}onNodePointerDown(i){this.nodeDrag.onNodePointerDown(i)}selectNode(i,e){this.nodeDrag.isClickWithoutDrag(e)&&this.selectedNodeId.set(i.id)}tagSelection=Wk({flow:this.flow,nodes:this.loader.nodes,fullLayout:S(()=>this.fullLayout()),canvasWrap:()=>{let i=this.canvasWrap()?.nativeElement;return i?{width:i.clientWidth,height:i.clientHeight}:null},selectedNodeId:this.selectedNodeId,clampedPanelWidth:this.clampedPanelWidth,zoomMin:Rf,viewportPosition:this.viewportPosition,viewportScale:this.viewportScale});activeTagSelection=this.tagSelection.activeTagSelection;selectionState=Kk({graph:this.graph,selectedNodeId:this.selectedNodeId,activeTagSelection:this.activeTagSelection});onTagSelect(i){this.tagSelection.onTagSelect(i)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&(typeof document<"u"&&Dk(document)||this.closePanel())}resetFilters(){this.filters.reset()}onPanelResizeStart(i){this.panelResize.onPanelResizeStart(i)}openNode(i){this.selectedNodeId.set(i.id)}onCanvasClick(i){let e=i.target;e?.closest(".sm-gnode")||e?.closest(".graph__toolbar")||e?.closest(".perf-hud")||e?.closest(".kind-palette")||e?.closest(".graph__panel")||this.selectedNodeId.set(null)}isSelected(i){return this.selectionState.isSelected(i)}isHighlighted(i){return this.selectionState.isHighlighted(i)}isDimmed(i){return this.selectionState.isDimmed(i)}selectionFor(i){return this.selectionState.selectionView().get(i)??see}isExpanded(i){return this.expansion.isExpanded(i)}setExpanded(i,e){this.expansion.setExpanded(i,e)}onFavoriteToggle(i){this.loader.toggleFavorite(i.path,i.value)}isEdgeHighlighted(i){return this.selectionState.isEdgeHighlighted(i)}isEdgeDimmed(i){return this.selectionState.isEdgeDimmed(i)}edgeOpacity(i){if(this.isEdgeDimmed(i))return iee;let e=typeof i.confidence=="number"?i.confidence:aee;return oee+ree*e}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=K({type:t,selectors:[["sm-graph-view"]],viewQuery:function(e,n){e&1&&ut(n.flow,cr,5)(n.canvas,sr,5)(n.zoom,dr,5)(n.canvasWrap,UJ,5),e&2&&tt(4)},hostBindings:function(e,n){e&1&&V("keydown.escape",function(){return n.onEscape()},Gr)},features:[ge([Ei,Rv(X_,{mode:bn.MANUAL})])],decls:6,vars:2,consts:[["canvasWrap",""],["data-testid","graph-view",1,"graph"],["data-testid","graph-loading",1,"empty-state"],["data-testid","graph-error",1,"empty-state"],["data-testid","graph-empty",1,"empty-state"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"smMiddleMousePan"],["styleClass","graph__confirm","maskStyleClass","graph__confirm-mask","data-testid","graph-reset-layout-confirm",3,"ariaLabel"],[1,"empty-state__icon","fa-solid","fa-spinner","fa-spin"],[1,"empty-state__title"],[1,"empty-state__icon","empty-state__icon--error","fa-solid","fa-circle-exclamation"],[1,"empty-state__desc"],["aria-hidden","true",1,"pi","pi-filter-slash","empty-state__icon"],["data-testid","graph-empty-filtered",1,"empty-state__title"],["size","small","data-testid","graph-reset-filters",3,"onClick","label","text"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"click","smMiddleMousePan"],["fDraggable","",3,"fLoaded","fCache"],[3,"fAlignThreshold"],["fZoom","",3,"fCanvasChange","position","scale","fZoomStep","fZoomDblClickStep","fZoomMinimum","fZoomMaximum","debounceTime"],["ngProjectAs","[fConnections]",5,["","fConnections",""]],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled","class","f-conn--highlighted","f-conn--dimmed","opacity"],["ngProjectAs","[fNodes]",5,["","fNodes",""]],[1,"graph__filter-stack"],["role","complementary","data-testid","graph-panel",1,"graph__panel"],["role","separator","aria-orientation","vertical","data-testid","graph-panel-resize",1,"graph__panel-resize",3,"mousedown"],[1,"graph__panel-scroll"],["mode","embedded",3,"close","tagSelect","path","activeTag"],[3,"visible","total","edges"],["role","toolbar","data-testid","graph-toolbar",1,"graph__toolbar"],["icon","pi pi-search-plus","severity","secondary","size","small","data-testid","graph-zoom-in",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-search-minus","severity","secondary","size","small","data-testid","graph-zoom-out",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-stop","severity","secondary","size","small","data-testid","graph-fit-to-screen",3,"onClick","ariaLabel","pTooltip","text","rounded"],["aria-hidden","true",1,"graph__toolbar-sep"],["icon","pi pi-history","severity","secondary","size","small","data-testid","graph-reset-layout",3,"onClick","ariaLabel","pTooltip","text","rounded"],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled"],["fMarker","","viewBox","0 0 9 9","markerUnits","userSpaceOnUse",1,"sm-edge-dot",3,"type","width","height","refX","refY"],["cx","4.5","cy","4.5","r","3.5"],[3,"type"],["ngProjectAs","[fNodes]",5,["","fNodes",""],4,"fVirtualFor","fVirtualForOf"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fInputConnectableSide","fOutputId","fOutputConnectableSide"],[3,"expandedChange","favoriteToggle","node","stats","summary","selection","expanded","isFavorite"],[1,"sm-gnode__marker-anchor"],["slot","graph.node.alert",3,"node"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodeId","fNodePosition","fInputId","fOutputId"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fOutputId"]],template:function(e,n){e&1&&(f(0,"section",1),I(1,WJ,4,1,"div",2)(2,$J,6,2,"div",3)(3,KJ,5,3,"div",4)(4,tee,31,39,"div",5),R(5,"p-confirmdialog",6),h()),e&2&&(d(),T(n.loading()&&!n.hasData()?1:n.error()&&!n.hasData()?2:n.showEmptyState()?3:4),d(4),E("ariaLabel",n.texts.resetLayoutConfirm.header))},dependencies:[jv,cr,sr,Lv,Fv,dr,Vv,Z0,Q0,Bv,gv,Cv,zv,qv,wp,_v,Hv,Dv,sf,cf,df,lf,uf,ff,Ef,ln,dn,sa,aa,Ne,Oe,vn,Pf],styles:["[_nghost-%COMP%]{display:block;height:100%}.graph[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-height:0;background:var(--sm-bg-content);overflow:hidden;--ff-connection-drag-handle-stroke: transparent;--ff-connection-drag-handle-fill: transparent;--ff-canvas-background-color: transparent}.graph__filter-stack[_ngcontent-%COMP%]{position:absolute;top:16px;left:16px;z-index:2;display:flex;flex-direction:column;gap:8px;pointer-events:none}.graph__filter-stack[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.graph__canvas-wrap[_ngcontent-%COMP%] f-flow[_ngcontent-%COMP%]{width:100%;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%] .f-connection-drag-handle{fill:transparent;stroke:transparent}.graph__panel[_ngcontent-%COMP%]{position:absolute;top:0;right:0;bottom:0;background:var(--sm-bg-content);border-left:1px solid var(--sm-border);box-shadow:0 4px 24px #0000002e;transform:translate(100%);transition:transform .22s ease;z-index:20;pointer-events:none;display:flex;overflow:hidden}.graph__panel.is-open[_ngcontent-%COMP%]{transform:translate(0);pointer-events:auto}.graph__panel-scroll[_ngcontent-%COMP%]{flex:1;min-height:0;min-width:0;overflow-y:auto}.graph__panel-resize[_ngcontent-%COMP%]{position:absolute;top:0;left:0;bottom:0;width:6px;cursor:ew-resize;z-index:2;background:transparent;transition:background .12s ease}.graph__panel-resize[_ngcontent-%COMP%]:hover, .graph__panel-resize[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--p-primary-color) 30%,transparent)}.graph__toolbar[_ngcontent-%COMP%]{position:absolute;bottom:16px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:var(--sm-radius-pill);box-shadow:var(--sm-shadow-floating);z-index:2;pointer-events:auto;transition:box-shadow .22s ease}.graph__toolbar-sep[_ngcontent-%COMP%]{width:1px;height:18px;margin:0 2px;background:var(--sm-border);flex-shrink:0}.sm-gnode-host[_ngcontent-%COMP%]{position:relative;display:inline-block;cursor:pointer;--ff-node-width: auto;--ff-node-min-height: 0;--ff-node-padding: 0;--ff-node-background-color: transparent;--ff-node-border-color: transparent;--ff-node-border-color-selected: transparent;--ff-node-border-radius: 0;--ff-node-shadow: none;--ff-node-shadow-selected: none}.sm-gnode-host.f-selected[_ngcontent-%COMP%]{filter:drop-shadow(0 0 6px var(--p-primary-color-300))}.sm-gnode-host.f-selected[_ngcontent-%COMP%] > .sm-gnode[_ngcontent-%COMP%]{box-shadow:0 0 0 3px var(--p-primary-color),var(--sm-shadow-card)}.f-conn--invokes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes);--ff-connection-width: 1.5px;--ff-marker-color: var(--sm-edge-invokes)}.f-conn--references[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-references)}.f-conn--mentions[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions);--ff-connection-width: 1px;--ff-marker-color: var(--sm-edge-mentions)}.f-conn--supersedes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-supersedes)}.graph__canvas-wrap[_ngcontent-%COMP%] .f-conn--supersedes .f-connection-path{stroke-dasharray:none}.f-conn--highlighted[_ngcontent-%COMP%]{--ff-connection-width: 2px}.f-conn--dimmed[_ngcontent-%COMP%]{opacity:.15}.f-connection.f-selected[_ngcontent-%COMP%]{--ff-connection-width: 2.5px}.f-conn--invokes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes-active);--ff-connection-selected-color: var(--sm-edge-invokes-active);--ff-marker-color: var(--sm-edge-invokes-active)}.f-conn--references.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references-active);--ff-connection-selected-color: var(--sm-edge-references-active);--ff-marker-color: var(--sm-edge-references-active)}.f-conn--mentions.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions-active);--ff-connection-selected-color: var(--sm-edge-mentions-active);--ff-marker-color: var(--sm-edge-mentions-active)}.f-conn--supersedes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes-active);--ff-connection-selected-color: var(--sm-edge-supersedes-active);--ff-marker-color: var(--sm-edge-supersedes-active)}.sm-gnode__marker-anchor[_ngcontent-%COMP%]{position:absolute;top:-10px;right:-10px;z-index:4;display:inline-flex;align-items:center;gap:.25rem;pointer-events:none;transition:opacity .15s ease}sm-node-card.sm-gnode--dimmed[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.25}sm-node-card.sm-gnode--deprecated[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.55}"],changeDetection:0})};export{Jk as GraphView};
|