@skill-map/cli 0.53.2 → 0.53.4
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 +112 -52
- package/dist/cli/tutorial/sm-tutorial/references/_core.md +65 -15
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +31 -16
- package/dist/cli/tutorial/sm-tutorial/references/fixtures.md +50 -27
- package/dist/cli/tutorial/sm-tutorial/references/part-authoring.md +7 -7
- package/dist/cli/tutorial/sm-tutorial/references/part-cli.md +2 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-connect-harness.md +14 -11
- package/dist/cli/tutorial/sm-tutorial/references/part-fundamentals.md +16 -22
- package/dist/cli/tutorial/sm-tutorial/references/part-live-site.md +111 -112
- package/dist/cli/tutorial/sm-tutorial/references/part-maintain.md +19 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-mcp.md +4 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +5 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +11 -13
- package/dist/cli/tutorial/sm-tutorial/references/part-run-harness.md +155 -0
- package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +6 -5
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/kernel/index.js +3 -3
- package/dist/ui/{chunk-OFDQMBSJ.js → chunk-4CXAL43H.js} +1 -1
- package/dist/ui/{chunk-IUZM6XLN.js → chunk-HWQTV6ZL.js} +1 -1
- package/dist/ui/{chunk-UHNBYD6J.js → chunk-JQE4N6JU.js} +3 -3
- package/dist/ui/{chunk-EQ72PEHT.js → chunk-NBXEOYS4.js} +1 -1
- package/dist/ui/{chunk-UV5Q423S.js → chunk-R2IJXS47.js} +3 -3
- package/dist/ui/index.html +2 -2
- package/dist/ui/{main-TXPLL7VU.js → main-ZXOCLPLS.js} +3 -3
- package/dist/ui/{styles-Q4NCOJQY.css → styles-L6FZYH7X.css} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Xn,b as Zn,d as sb,e as lb,f as cb,g as hb,h as fb,i as bo}from"./chunk-GEI6INVH.js";import{A as kb,B as Ib,C as Eb,D as Jn,E as Mb,G as Db,H as Pb,I as Nf,J as Af,K as Rb,a as is,b as po,c as Y0,d as X0,e as ho,f as Z0,g as vr,h as Rf,i as Q0,j as on,k as fo,l as cs,m as mb,n as ds,o as _b,p as gb,q as bb,r as vb,s as yb,t as Cb,u as us,w as xb,x as wb,y as Tb,z as Sb}from"./chunk-IUZM6XLN.js";import{f as Ja,i as es}from"./chunk-UBQUCSQ4.js";import{a as Qn,b as db,c as go,g as ls,h as Vt}from"./chunk-OFDQMBSJ.js";import"./chunk-P2DAPRK7.js";import{a as q0,b as G0,c as j0,d as U0,e as eb,f as tb,g as os,h as as,i as ss,j as nb,k as ib,l as _o,n as ob,o as Ff,p as rb,q as ab,r as ub,s as pb}from"./chunk-JXRIGHET.js";import{A as uo,B as ns,C as Te,D as $0,E as W0,F as br,G as Ee,H as K0,I as Sn,J as Ve,K as ze,L as J0,M as mo,N as we,O as Of,P as rs,Q as _n,R as kn,a as pt,c as Df,d as B0,e as Pf,f as V0,g as lo,i as bt,j as Le,k as nn,l as St,o as Yn,p as H0,q as co,r as Lt,s as Bt,t as kt,u as It,v as Bn,w as Ie,x as Tn}from"./chunk-GBKHMJ4B.js";import{f as Wn,g as M0,h as so,i as fn,j as Kn,k as Rt,l as gt,p as $t}from"./chunk-LCOYSPKE.js";import{B as Mf,Ca as z0,D as R0,F as O0,H as F0,J as ts,O as _r,T as N0,V as A0,W as L0,a as mn,b as hr,ba as gr,k as fr,l as If,m as D0,n as P0,p as Mi,t as wn,u as ut,w as Ef,z as mr}from"./chunk-4SG4352Z.js";import{$ as xt,$a as S,$b as I0,Ab as _e,Bb as le,Cb as Ya,Db as Xa,Ea as ki,Eb as $,Ec as j,Fa as lr,Fb as ot,Fc as xe,Ga as Wa,Gb as A,Ha as l,Ib as d,J as Cn,Jb as pn,K as y,Kb as $e,L as mt,Lb as en,Ma as ao,Mb as xn,N as be,Na as x0,Nb as Q,O as oo,Ob as J,P as p,Pa as w0,Pb as Tf,Qa as un,Qb as hn,Ra as Ka,Rb as jt,Sb as yt,T as C0,Tb as Ne,U as Ln,Ub as ue,V as w,Vb as Pt,W as T,Wa as z,Wb as H,X as W,Xa as _t,Xb as b,Y as ja,Ya as je,Yb as x,Z as dt,Za as wt,Zb as Se,_ as Ua,_a as Z,_b as k0,ac as cr,ba as ne,bc as dr,ca as Jt,cc as ur,d as io,dc as Ut,ec as Tt,fc as Ce,g as P,ga as X,gc as ke,hc as At,ia as de,ic as Re,ja as ro,jb as O,jc as $n,ka as G,kb as T0,kc as Ii,la as Qe,lb as S0,lc as Sf,mb as M,mc as Za,n as y0,nb as D,nc as pr,ob as wf,oc as E0,pa as $a,pb as Ue,pc as We,qb as re,rb as ae,rc as tn,sb as m,sc as E,t as Ga,tb as f,tc as Ke,ub as _,uc as B,vb as F,vc as nt,wb as se,wc as Qa,xb as fe,xc as kf,yb as ie,yc as Ei,zb as me}from"./chunk-Q2A6FWC7.js";import{a as ge,b as Dt,c as no,e as v,g as a3}from"./chunk-WCABR6TI.js";var IC=v((Y_e,kC)=>{"use strict";function uz(){this.__data__=[],this.size=0}kC.exports=uz});var Wi=v((X_e,EC)=>{"use strict";function pz(t,o){return t===o||t!==t&&o!==o}EC.exports=pz});var da=v((Z_e,MC)=>{"use strict";var hz=Wi();function fz(t,o){for(var e=t.length;e--;)if(hz(t[e][0],o))return e;return-1}MC.exports=fz});var PC=v((Q_e,DC)=>{"use strict";var mz=da(),_z=Array.prototype,gz=_z.splice;function bz(t){var o=this.__data__,e=mz(o,t);if(e<0)return!1;var n=o.length-1;return e==n?o.pop():gz.call(o,e,1),--this.size,!0}DC.exports=bz});var OC=v((J_e,RC)=>{"use strict";var vz=da();function yz(t){var o=this.__data__,e=vz(o,t);return e<0?void 0:o[e][1]}RC.exports=yz});var NC=v((ege,FC)=>{"use strict";var Cz=da();function xz(t){return Cz(this.__data__,t)>-1}FC.exports=xz});var LC=v((tge,AC)=>{"use strict";var wz=da();function Tz(t,o){var e=this.__data__,n=wz(e,t);return n<0?(++this.size,e.push([t,o])):e[n][1]=o,this}AC.exports=Tz});var ua=v((nge,BC)=>{"use strict";var Sz=IC(),kz=PC(),Iz=OC(),Ez=NC(),Mz=LC();function Go(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}Go.prototype.clear=Sz;Go.prototype.delete=kz;Go.prototype.get=Iz;Go.prototype.has=Ez;Go.prototype.set=Mz;BC.exports=Go});var zC=v((ige,VC)=>{"use strict";var Dz=ua();function Pz(){this.__data__=new Dz,this.size=0}VC.exports=Pz});var qC=v((oge,HC)=>{"use strict";function Rz(t){var o=this.__data__,e=o.delete(t);return this.size=o.size,e}HC.exports=Rz});var jC=v((rge,GC)=>{"use strict";function Oz(t){return this.__data__.get(t)}GC.exports=Oz});var $C=v((age,UC)=>{"use strict";function Fz(t){return this.__data__.has(t)}UC.exports=Fz});var D_=v((sge,WC)=>{"use strict";var Nz=typeof global=="object"&&global&&global.Object===Object&&global;WC.exports=Nz});var sn=v((lge,KC)=>{"use strict";var Az=D_(),Lz=typeof self=="object"&&self&&self.Object===Object&&self,Bz=Az||Lz||Function("return this")();KC.exports=Bz});var Ki=v((cge,YC)=>{"use strict";var Vz=sn(),zz=Vz.Symbol;YC.exports=zz});var JC=v((dge,QC)=>{"use strict";var XC=Ki(),ZC=Object.prototype,Hz=ZC.hasOwnProperty,qz=ZC.toString,pa=XC?XC.toStringTag:void 0;function Gz(t){var o=Hz.call(t,pa),e=t[pa];try{t[pa]=void 0;var n=!0}catch{}var i=qz.call(t);return n&&(o?t[pa]=e:delete t[pa]),i}QC.exports=Gz});var t1=v((uge,e1)=>{"use strict";var jz=Object.prototype,Uz=jz.toString;function $z(t){return Uz.call(t)}e1.exports=$z});var mi=v((pge,o1)=>{"use strict";var n1=Ki(),Wz=JC(),Kz=t1(),Yz="[object Null]",Xz="[object Undefined]",i1=n1?n1.toStringTag:void 0;function Zz(t){return t==null?t===void 0?Xz:Yz:i1&&i1 in Object(t)?Wz(t):Kz(t)}o1.exports=Zz});var Yt=v((hge,r1)=>{"use strict";function Qz(t){var o=typeof t;return t!=null&&(o=="object"||o=="function")}r1.exports=Qz});var jo=v((fge,a1)=>{"use strict";var Jz=mi(),eH=Yt(),tH="[object AsyncFunction]",nH="[object Function]",iH="[object GeneratorFunction]",oH="[object Proxy]";function rH(t){if(!eH(t))return!1;var o=Jz(t);return o==nH||o==iH||o==tH||o==oH}a1.exports=rH});var l1=v((mge,s1)=>{"use strict";var aH=sn(),sH=aH["__core-js_shared__"];s1.exports=sH});var u1=v((_ge,d1)=>{"use strict";var P_=l1(),c1=(function(){var t=/[^.]+$/.exec(P_&&P_.keys&&P_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function lH(t){return!!c1&&c1 in t}d1.exports=lH});var R_=v((gge,p1)=>{"use strict";var cH=Function.prototype,dH=cH.toString;function uH(t){if(t!=null){try{return dH.call(t)}catch{}try{return t+""}catch{}}return""}p1.exports=uH});var f1=v((bge,h1)=>{"use strict";var pH=jo(),hH=u1(),fH=Yt(),mH=R_(),_H=/[\\^$.*+?()[\]{}|]/g,gH=/^\[object .+?Constructor\]$/,bH=Function.prototype,vH=Object.prototype,yH=bH.toString,CH=vH.hasOwnProperty,xH=RegExp("^"+yH.call(CH).replace(_H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wH(t){if(!fH(t)||hH(t))return!1;var o=pH(t)?xH:gH;return o.test(mH(t))}h1.exports=wH});var _1=v((vge,m1)=>{"use strict";function TH(t,o){return t?.[o]}m1.exports=TH});var _i=v((yge,g1)=>{"use strict";var SH=f1(),kH=_1();function IH(t,o){var e=kH(t,o);return SH(e)?e:void 0}g1.exports=IH});var Mh=v((Cge,b1)=>{"use strict";var EH=_i(),MH=sn(),DH=EH(MH,"Map");b1.exports=DH});var ha=v((xge,v1)=>{"use strict";var PH=_i(),RH=PH(Object,"create");v1.exports=RH});var x1=v((wge,C1)=>{"use strict";var y1=ha();function OH(){this.__data__=y1?y1(null):{},this.size=0}C1.exports=OH});var T1=v((Tge,w1)=>{"use strict";function FH(t){var o=this.has(t)&&delete this.__data__[t];return this.size-=o?1:0,o}w1.exports=FH});var k1=v((Sge,S1)=>{"use strict";var NH=ha(),AH="__lodash_hash_undefined__",LH=Object.prototype,BH=LH.hasOwnProperty;function VH(t){var o=this.__data__;if(NH){var e=o[t];return e===AH?void 0:e}return BH.call(o,t)?o[t]:void 0}S1.exports=VH});var E1=v((kge,I1)=>{"use strict";var zH=ha(),HH=Object.prototype,qH=HH.hasOwnProperty;function GH(t){var o=this.__data__;return zH?o[t]!==void 0:qH.call(o,t)}I1.exports=GH});var D1=v((Ige,M1)=>{"use strict";var jH=ha(),UH="__lodash_hash_undefined__";function $H(t,o){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=jH&&o===void 0?UH:o,this}M1.exports=$H});var R1=v((Ege,P1)=>{"use strict";var WH=x1(),KH=T1(),YH=k1(),XH=E1(),ZH=D1();function Uo(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}Uo.prototype.clear=WH;Uo.prototype.delete=KH;Uo.prototype.get=YH;Uo.prototype.has=XH;Uo.prototype.set=ZH;P1.exports=Uo});var N1=v((Mge,F1)=>{"use strict";var O1=R1(),QH=ua(),JH=Mh();function eq(){this.size=0,this.__data__={hash:new O1,map:new(JH||QH),string:new O1}}F1.exports=eq});var L1=v((Dge,A1)=>{"use strict";function tq(t){var o=typeof t;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?t!=="__proto__":t===null}A1.exports=tq});var fa=v((Pge,B1)=>{"use strict";var nq=L1();function iq(t,o){var e=t.__data__;return nq(o)?e[typeof o=="string"?"string":"hash"]:e.map}B1.exports=iq});var z1=v((Rge,V1)=>{"use strict";var oq=fa();function rq(t){var o=oq(this,t).delete(t);return this.size-=o?1:0,o}V1.exports=rq});var q1=v((Oge,H1)=>{"use strict";var aq=fa();function sq(t){return aq(this,t).get(t)}H1.exports=sq});var j1=v((Fge,G1)=>{"use strict";var lq=fa();function cq(t){return lq(this,t).has(t)}G1.exports=cq});var $1=v((Nge,U1)=>{"use strict";var dq=fa();function uq(t,o){var e=dq(this,t),n=e.size;return e.set(t,o),this.size+=e.size==n?0:1,this}U1.exports=uq});var Dh=v((Age,W1)=>{"use strict";var pq=N1(),hq=z1(),fq=q1(),mq=j1(),_q=$1();function $o(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}$o.prototype.clear=pq;$o.prototype.delete=hq;$o.prototype.get=fq;$o.prototype.has=mq;$o.prototype.set=_q;W1.exports=$o});var Y1=v((Lge,K1)=>{"use strict";var gq=ua(),bq=Mh(),vq=Dh(),yq=200;function Cq(t,o){var e=this.__data__;if(e instanceof gq){var n=e.__data__;if(!bq||n.length<yq-1)return n.push([t,o]),this.size=++e.size,this;e=this.__data__=new vq(n)}return e.set(t,o),this.size=e.size,this}K1.exports=Cq});var ma=v((Bge,X1)=>{"use strict";var xq=ua(),wq=zC(),Tq=qC(),Sq=jC(),kq=$C(),Iq=Y1();function Wo(t){var o=this.__data__=new xq(t);this.size=o.size}Wo.prototype.clear=wq;Wo.prototype.delete=Tq;Wo.prototype.get=Sq;Wo.prototype.has=kq;Wo.prototype.set=Iq;X1.exports=Wo});var Ph=v((Vge,Z1)=>{"use strict";function Eq(t,o){for(var e=-1,n=t==null?0:t.length;++e<n&&o(t[e],e,t)!==!1;);return t}Z1.exports=Eq});var O_=v((zge,Q1)=>{"use strict";var Mq=_i(),Dq=(function(){try{var t=Mq(Object,"defineProperty");return t({},"",{}),t}catch{}})();Q1.exports=Dq});var _a=v((Hge,ex)=>{"use strict";var J1=O_();function Pq(t,o,e){o=="__proto__"&&J1?J1(t,o,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[o]=e}ex.exports=Pq});var ga=v((qge,tx)=>{"use strict";var Rq=_a(),Oq=Wi(),Fq=Object.prototype,Nq=Fq.hasOwnProperty;function Aq(t,o,e){var n=t[o];(!(Nq.call(t,o)&&Oq(n,e))||e===void 0&&!(o in t))&&Rq(t,o,e)}tx.exports=Aq});var Ko=v((Gge,nx)=>{"use strict";var Lq=ga(),Bq=_a();function Vq(t,o,e,n){var i=!e;e||(e={});for(var r=-1,a=o.length;++r<a;){var s=o[r],c=n?n(e[s],t[s],s,e,t):void 0;c===void 0&&(c=t[s]),i?Bq(e,s,c):Lq(e,s,c)}return e}nx.exports=Vq});var ox=v((jge,ix)=>{"use strict";function zq(t,o){for(var e=-1,n=Array(t);++e<t;)n[e]=o(e);return n}ix.exports=zq});var yn=v((Uge,rx)=>{"use strict";function Hq(t){return t!=null&&typeof t=="object"}rx.exports=Hq});var sx=v(($ge,ax)=>{"use strict";var qq=mi(),Gq=yn(),jq="[object Arguments]";function Uq(t){return Gq(t)&&qq(t)==jq}ax.exports=Uq});var Yo=v((Wge,dx)=>{"use strict";var lx=sx(),$q=yn(),cx=Object.prototype,Wq=cx.hasOwnProperty,Kq=cx.propertyIsEnumerable,Yq=lx((function(){return arguments})())?lx:function(t){return $q(t)&&Wq.call(t,"callee")&&!Kq.call(t,"callee")};dx.exports=Yq});var lt=v((Kge,ux)=>{"use strict";var Xq=Array.isArray;ux.exports=Xq});var hx=v((Yge,px)=>{"use strict";function Zq(){return!1}px.exports=Zq});var Yi=v((ba,Xo)=>{"use strict";var Qq=sn(),Jq=hx(),_x=typeof ba=="object"&&ba&&!ba.nodeType&&ba,fx=_x&&typeof Xo=="object"&&Xo&&!Xo.nodeType&&Xo,eG=fx&&fx.exports===_x,mx=eG?Qq.Buffer:void 0,tG=mx?mx.isBuffer:void 0,nG=tG||Jq;Xo.exports=nG});var va=v((Xge,gx)=>{"use strict";var iG=9007199254740991,oG=/^(?:0|[1-9]\d*)$/;function rG(t,o){var e=typeof t;return o=o??iG,!!o&&(e=="number"||e!="symbol"&&oG.test(t))&&t>-1&&t%1==0&&t<o}gx.exports=rG});var Rh=v((Zge,bx)=>{"use strict";var aG=9007199254740991;function sG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=aG}bx.exports=sG});var yx=v((Qge,vx)=>{"use strict";var lG=mi(),cG=Rh(),dG=yn(),uG="[object Arguments]",pG="[object Array]",hG="[object Boolean]",fG="[object Date]",mG="[object Error]",_G="[object Function]",gG="[object Map]",bG="[object Number]",vG="[object Object]",yG="[object RegExp]",CG="[object Set]",xG="[object String]",wG="[object WeakMap]",TG="[object ArrayBuffer]",SG="[object DataView]",kG="[object Float32Array]",IG="[object Float64Array]",EG="[object Int8Array]",MG="[object Int16Array]",DG="[object Int32Array]",PG="[object Uint8Array]",RG="[object Uint8ClampedArray]",OG="[object Uint16Array]",FG="[object Uint32Array]",Je={};Je[kG]=Je[IG]=Je[EG]=Je[MG]=Je[DG]=Je[PG]=Je[RG]=Je[OG]=Je[FG]=!0;Je[uG]=Je[pG]=Je[TG]=Je[hG]=Je[SG]=Je[fG]=Je[mG]=Je[_G]=Je[gG]=Je[bG]=Je[vG]=Je[yG]=Je[CG]=Je[xG]=Je[wG]=!1;function NG(t){return dG(t)&&cG(t.length)&&!!Je[lG(t)]}vx.exports=NG});var ya=v((Jge,Cx)=>{"use strict";function AG(t){return function(o){return t(o)}}Cx.exports=AG});var Oh=v((Ca,Zo)=>{"use strict";var LG=D_(),xx=typeof Ca=="object"&&Ca&&!Ca.nodeType&&Ca,xa=xx&&typeof Zo=="object"&&Zo&&!Zo.nodeType&&Zo,BG=xa&&xa.exports===xx,F_=BG&&LG.process,VG=(function(){try{var t=xa&&xa.require&&xa.require("util").types;return t||F_&&F_.binding&&F_.binding("util")}catch{}})();Zo.exports=VG});var Qo=v((e0e,Sx)=>{"use strict";var zG=yx(),HG=ya(),wx=Oh(),Tx=wx&&wx.isTypedArray,qG=Tx?HG(Tx):zG;Sx.exports=qG});var N_=v((t0e,kx)=>{"use strict";var GG=ox(),jG=Yo(),UG=lt(),$G=Yi(),WG=va(),KG=Qo(),YG=Object.prototype,XG=YG.hasOwnProperty;function ZG(t,o){var e=UG(t),n=!e&&jG(t),i=!e&&!n&&$G(t),r=!e&&!n&&!i&&KG(t),a=e||n||i||r,s=a?GG(t.length,String):[],c=s.length;for(var u in t)(o||XG.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||WG(u,c)))&&s.push(u);return s}kx.exports=ZG});var wa=v((n0e,Ix)=>{"use strict";var QG=Object.prototype;function JG(t){var o=t&&t.constructor,e=typeof o=="function"&&o.prototype||QG;return t===e}Ix.exports=JG});var A_=v((i0e,Ex)=>{"use strict";function ej(t,o){return function(e){return t(o(e))}}Ex.exports=ej});var Dx=v((o0e,Mx)=>{"use strict";var tj=A_(),nj=tj(Object.keys,Object);Mx.exports=nj});var Fh=v((r0e,Px)=>{"use strict";var ij=wa(),oj=Dx(),rj=Object.prototype,aj=rj.hasOwnProperty;function sj(t){if(!ij(t))return oj(t);var o=[];for(var e in Object(t))aj.call(t,e)&&e!="constructor"&&o.push(e);return o}Px.exports=sj});var Pn=v((a0e,Rx)=>{"use strict";var lj=jo(),cj=Rh();function dj(t){return t!=null&&cj(t.length)&&!lj(t)}Rx.exports=dj});var Hn=v((s0e,Ox)=>{"use strict";var uj=N_(),pj=Fh(),hj=Pn();function fj(t){return hj(t)?uj(t):pj(t)}Ox.exports=fj});var Nx=v((l0e,Fx)=>{"use strict";var mj=Ko(),_j=Hn();function gj(t,o){return t&&mj(o,_j(o),t)}Fx.exports=gj});var Lx=v((c0e,Ax)=>{"use strict";function bj(t){var o=[];if(t!=null)for(var e in Object(t))o.push(e);return o}Ax.exports=bj});var Vx=v((d0e,Bx)=>{"use strict";var vj=Yt(),yj=wa(),Cj=Lx(),xj=Object.prototype,wj=xj.hasOwnProperty;function Tj(t){if(!vj(t))return Cj(t);var o=yj(t),e=[];for(var n in t)n=="constructor"&&(o||!wj.call(t,n))||e.push(n);return e}Bx.exports=Tj});var gi=v((u0e,zx)=>{"use strict";var Sj=N_(),kj=Vx(),Ij=Pn();function Ej(t){return Ij(t)?Sj(t,!0):kj(t)}zx.exports=Ej});var qx=v((p0e,Hx)=>{"use strict";var Mj=Ko(),Dj=gi();function Pj(t,o){return t&&Mj(o,Dj(o),t)}Hx.exports=Pj});var L_=v((Ta,Jo)=>{"use strict";var Rj=sn(),$x=typeof Ta=="object"&&Ta&&!Ta.nodeType&&Ta,Gx=$x&&typeof Jo=="object"&&Jo&&!Jo.nodeType&&Jo,Oj=Gx&&Gx.exports===$x,jx=Oj?Rj.Buffer:void 0,Ux=jx?jx.allocUnsafe:void 0;function Fj(t,o){if(o)return t.slice();var e=t.length,n=Ux?Ux(e):new t.constructor(e);return t.copy(n),n}Jo.exports=Fj});var B_=v((h0e,Wx)=>{"use strict";function Nj(t,o){var e=-1,n=t.length;for(o||(o=Array(n));++e<n;)o[e]=t[e];return o}Wx.exports=Nj});var V_=v((f0e,Kx)=>{"use strict";function Aj(t,o){for(var e=-1,n=t==null?0:t.length,i=0,r=[];++e<n;){var a=t[e];o(a,e,t)&&(r[i++]=a)}return r}Kx.exports=Aj});var z_=v((m0e,Yx)=>{"use strict";function Lj(){return[]}Yx.exports=Lj});var Nh=v((_0e,Zx)=>{"use strict";var Bj=V_(),Vj=z_(),zj=Object.prototype,Hj=zj.propertyIsEnumerable,Xx=Object.getOwnPropertySymbols,qj=Xx?function(t){return t==null?[]:(t=Object(t),Bj(Xx(t),function(o){return Hj.call(t,o)}))}:Vj;Zx.exports=qj});var Jx=v((g0e,Qx)=>{"use strict";var Gj=Ko(),jj=Nh();function Uj(t,o){return Gj(t,jj(t),o)}Qx.exports=Uj});var Ah=v((b0e,ew)=>{"use strict";function $j(t,o){for(var e=-1,n=o.length,i=t.length;++e<n;)t[i+e]=o[e];return t}ew.exports=$j});var Sa=v((v0e,tw)=>{"use strict";var Wj=A_(),Kj=Wj(Object.getPrototypeOf,Object);tw.exports=Kj});var H_=v((y0e,nw)=>{"use strict";var Yj=Ah(),Xj=Sa(),Zj=Nh(),Qj=z_(),Jj=Object.getOwnPropertySymbols,eU=Jj?function(t){for(var o=[];t;)Yj(o,Zj(t)),t=Xj(t);return o}:Qj;nw.exports=eU});var ow=v((C0e,iw)=>{"use strict";var tU=Ko(),nU=H_();function iU(t,o){return tU(t,nU(t),o)}iw.exports=iU});var q_=v((x0e,rw)=>{"use strict";var oU=Ah(),rU=lt();function aU(t,o,e){var n=o(t);return rU(t)?n:oU(n,e(t))}rw.exports=aU});var G_=v((w0e,aw)=>{"use strict";var sU=q_(),lU=Nh(),cU=Hn();function dU(t){return sU(t,cU,lU)}aw.exports=dU});var lw=v((T0e,sw)=>{"use strict";var uU=q_(),pU=H_(),hU=gi();function fU(t){return uU(t,hU,pU)}sw.exports=fU});var dw=v((S0e,cw)=>{"use strict";var mU=_i(),_U=sn(),gU=mU(_U,"DataView");cw.exports=gU});var pw=v((k0e,uw)=>{"use strict";var bU=_i(),vU=sn(),yU=bU(vU,"Promise");uw.exports=yU});var j_=v((I0e,hw)=>{"use strict";var CU=_i(),xU=sn(),wU=CU(xU,"Set");hw.exports=wU});var mw=v((E0e,fw)=>{"use strict";var TU=_i(),SU=sn(),kU=TU(SU,"WeakMap");fw.exports=kU});var Zi=v((M0e,xw)=>{"use strict";var U_=dw(),$_=Mh(),W_=pw(),K_=j_(),Y_=mw(),Cw=mi(),er=R_(),_w="[object Map]",IU="[object Object]",gw="[object Promise]",bw="[object Set]",vw="[object WeakMap]",yw="[object DataView]",EU=er(U_),MU=er($_),DU=er(W_),PU=er(K_),RU=er(Y_),Xi=Cw;(U_&&Xi(new U_(new ArrayBuffer(1)))!=yw||$_&&Xi(new $_)!=_w||W_&&Xi(W_.resolve())!=gw||K_&&Xi(new K_)!=bw||Y_&&Xi(new Y_)!=vw)&&(Xi=function(t){var o=Cw(t),e=o==IU?t.constructor:void 0,n=e?er(e):"";if(n)switch(n){case EU:return yw;case MU:return _w;case DU:return gw;case PU:return bw;case RU:return vw}return o});xw.exports=Xi});var Tw=v((D0e,ww)=>{"use strict";var OU=Object.prototype,FU=OU.hasOwnProperty;function NU(t){var o=t.length,e=new t.constructor(o);return o&&typeof t[0]=="string"&&FU.call(t,"index")&&(e.index=t.index,e.input=t.input),e}ww.exports=NU});var X_=v((P0e,Sw)=>{"use strict";var AU=sn(),LU=AU.Uint8Array;Sw.exports=LU});var Lh=v((R0e,Iw)=>{"use strict";var kw=X_();function BU(t){var o=new t.constructor(t.byteLength);return new kw(o).set(new kw(t)),o}Iw.exports=BU});var Mw=v((O0e,Ew)=>{"use strict";var VU=Lh();function zU(t,o){var e=o?VU(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}Ew.exports=zU});var Pw=v((F0e,Dw)=>{"use strict";var HU=/\w*$/;function qU(t){var o=new t.constructor(t.source,HU.exec(t));return o.lastIndex=t.lastIndex,o}Dw.exports=qU});var Aw=v((N0e,Nw)=>{"use strict";var Rw=Ki(),Ow=Rw?Rw.prototype:void 0,Fw=Ow?Ow.valueOf:void 0;function GU(t){return Fw?Object(Fw.call(t)):{}}Nw.exports=GU});var Z_=v((A0e,Lw)=>{"use strict";var jU=Lh();function UU(t,o){var e=o?jU(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}Lw.exports=UU});var Vw=v((L0e,Bw)=>{"use strict";var $U=Lh(),WU=Mw(),KU=Pw(),YU=Aw(),XU=Z_(),ZU="[object Boolean]",QU="[object Date]",JU="[object Map]",e$="[object Number]",t$="[object RegExp]",n$="[object Set]",i$="[object String]",o$="[object Symbol]",r$="[object ArrayBuffer]",a$="[object DataView]",s$="[object Float32Array]",l$="[object Float64Array]",c$="[object Int8Array]",d$="[object Int16Array]",u$="[object Int32Array]",p$="[object Uint8Array]",h$="[object Uint8ClampedArray]",f$="[object Uint16Array]",m$="[object Uint32Array]";function _$(t,o,e){var n=t.constructor;switch(o){case r$:return $U(t);case ZU:case QU:return new n(+t);case a$:return WU(t,e);case s$:case l$:case c$:case d$:case u$:case p$:case h$:case f$:case m$:return XU(t,e);case JU:return new n;case e$:case i$:return new n(t);case t$:return KU(t);case n$:return new n;case o$:return YU(t)}}Bw.exports=_$});var Q_=v((B0e,Hw)=>{"use strict";var g$=Yt(),zw=Object.create,b$=(function(){function t(){}return function(o){if(!g$(o))return{};if(zw)return zw(o);t.prototype=o;var e=new t;return t.prototype=void 0,e}})();Hw.exports=b$});var J_=v((V0e,qw)=>{"use strict";var v$=Q_(),y$=Sa(),C$=wa();function x$(t){return typeof t.constructor=="function"&&!C$(t)?v$(y$(t)):{}}qw.exports=x$});var jw=v((z0e,Gw)=>{"use strict";var w$=Zi(),T$=yn(),S$="[object Map]";function k$(t){return T$(t)&&w$(t)==S$}Gw.exports=k$});var Kw=v((H0e,Ww)=>{"use strict";var I$=jw(),E$=ya(),Uw=Oh(),$w=Uw&&Uw.isMap,M$=$w?E$($w):I$;Ww.exports=M$});var Xw=v((q0e,Yw)=>{"use strict";var D$=Zi(),P$=yn(),R$="[object Set]";function O$(t){return P$(t)&&D$(t)==R$}Yw.exports=O$});var eT=v((G0e,Jw)=>{"use strict";var F$=Xw(),N$=ya(),Zw=Oh(),Qw=Zw&&Zw.isSet,A$=Qw?N$(Qw):F$;Jw.exports=A$});var eg=v((j0e,oT)=>{"use strict";var L$=ma(),B$=Ph(),V$=ga(),z$=Nx(),H$=qx(),q$=L_(),G$=B_(),j$=Jx(),U$=ow(),$$=G_(),W$=lw(),K$=Zi(),Y$=Tw(),X$=Vw(),Z$=J_(),Q$=lt(),J$=Yi(),eW=Kw(),tW=Yt(),nW=eT(),iW=Hn(),oW=gi(),rW=1,aW=2,sW=4,tT="[object Arguments]",lW="[object Array]",cW="[object Boolean]",dW="[object Date]",uW="[object Error]",nT="[object Function]",pW="[object GeneratorFunction]",hW="[object Map]",fW="[object Number]",iT="[object Object]",mW="[object RegExp]",_W="[object Set]",gW="[object String]",bW="[object Symbol]",vW="[object WeakMap]",yW="[object ArrayBuffer]",CW="[object DataView]",xW="[object Float32Array]",wW="[object Float64Array]",TW="[object Int8Array]",SW="[object Int16Array]",kW="[object Int32Array]",IW="[object Uint8Array]",EW="[object Uint8ClampedArray]",MW="[object Uint16Array]",DW="[object Uint32Array]",Ze={};Ze[tT]=Ze[lW]=Ze[yW]=Ze[CW]=Ze[cW]=Ze[dW]=Ze[xW]=Ze[wW]=Ze[TW]=Ze[SW]=Ze[kW]=Ze[hW]=Ze[fW]=Ze[iT]=Ze[mW]=Ze[_W]=Ze[gW]=Ze[bW]=Ze[IW]=Ze[EW]=Ze[MW]=Ze[DW]=!0;Ze[uW]=Ze[nT]=Ze[vW]=!1;function Bh(t,o,e,n,i,r){var a,s=o&rW,c=o&aW,u=o&sW;if(e&&(a=i?e(t,n,i,r):e(t)),a!==void 0)return a;if(!tW(t))return t;var h=Q$(t);if(h){if(a=Y$(t),!s)return G$(t,a)}else{var g=K$(t),C=g==nT||g==pW;if(J$(t))return q$(t,s);if(g==iT||g==tT||C&&!i){if(a=c||C?{}:Z$(t),!s)return c?U$(t,H$(a,t)):j$(t,z$(a,t))}else{if(!Ze[g])return i?t:{};a=X$(t,g,s)}}r||(r=new L$);var k=r.get(t);if(k)return k;r.set(t,a),nW(t)?t.forEach(function(q){a.add(Bh(q,o,e,q,t,r))}):eW(t)&&t.forEach(function(q,Y){a.set(Y,Bh(q,o,e,Y,t,r))});var I=u?c?W$:$$:c?oW:iW,N=h?void 0:I(t);return B$(N||t,function(q,Y){N&&(Y=q,q=t[Y]),V$(a,Y,Bh(q,o,e,Y,t,r))}),a}oT.exports=Bh});var aT=v((U0e,rT)=>{"use strict";var PW=eg(),RW=4;function OW(t){return PW(t,RW)}rT.exports=OW});var Vh=v(($0e,sT)=>{"use strict";function FW(t){return function(){return t}}sT.exports=FW});var cT=v((W0e,lT)=>{"use strict";function NW(t){return function(o,e,n){for(var i=-1,r=Object(o),a=n(o),s=a.length;s--;){var c=a[t?s:++i];if(e(r[c],c,r)===!1)break}return o}}lT.exports=NW});var zh=v((K0e,dT)=>{"use strict";var AW=cT(),LW=AW();dT.exports=LW});var Hh=v((Y0e,uT)=>{"use strict";var BW=zh(),VW=Hn();function zW(t,o){return t&&BW(t,o,VW)}uT.exports=zW});var hT=v((X0e,pT)=>{"use strict";var HW=Pn();function qW(t,o){return function(e,n){if(e==null)return e;if(!HW(e))return t(e,n);for(var i=e.length,r=o?i:-1,a=Object(e);(o?r--:++r<i)&&n(a[r],r,a)!==!1;);return e}}pT.exports=qW});var ka=v((Z0e,fT)=>{"use strict";var GW=Hh(),jW=hT(),UW=jW(GW);fT.exports=UW});var bi=v((Q0e,mT)=>{"use strict";function $W(t){return t}mT.exports=$W});var tg=v((J0e,_T)=>{"use strict";var WW=bi();function KW(t){return typeof t=="function"?t:WW}_T.exports=KW});var ng=v((ebe,gT)=>{"use strict";var YW=Ph(),XW=ka(),ZW=tg(),QW=lt();function JW(t,o){var e=QW(t)?YW:XW;return e(t,ZW(o))}gT.exports=JW});var ig=v((tbe,bT)=>{"use strict";bT.exports=ng()});var yT=v((nbe,vT)=>{"use strict";var eK=ka();function tK(t,o){var e=[];return eK(t,function(n,i,r){o(n,i,r)&&e.push(n)}),e}vT.exports=tK});var xT=v((ibe,CT)=>{"use strict";var nK="__lodash_hash_undefined__";function iK(t){return this.__data__.set(t,nK),this}CT.exports=iK});var TT=v((obe,wT)=>{"use strict";function oK(t){return this.__data__.has(t)}wT.exports=oK});var og=v((rbe,ST)=>{"use strict";var rK=Dh(),aK=xT(),sK=TT();function qh(t){var o=-1,e=t==null?0:t.length;for(this.__data__=new rK;++o<e;)this.add(t[o])}qh.prototype.add=qh.prototype.push=aK;qh.prototype.has=sK;ST.exports=qh});var IT=v((abe,kT)=>{"use strict";function lK(t,o){for(var e=-1,n=t==null?0:t.length;++e<n;)if(o(t[e],e,t))return!0;return!1}kT.exports=lK});var rg=v((sbe,ET)=>{"use strict";function cK(t,o){return t.has(o)}ET.exports=cK});var ag=v((lbe,MT)=>{"use strict";var dK=og(),uK=IT(),pK=rg(),hK=1,fK=2;function mK(t,o,e,n,i,r){var a=e&hK,s=t.length,c=o.length;if(s!=c&&!(a&&c>s))return!1;var u=r.get(t),h=r.get(o);if(u&&h)return u==o&&h==t;var g=-1,C=!0,k=e&fK?new dK:void 0;for(r.set(t,o),r.set(o,t);++g<s;){var I=t[g],N=o[g];if(n)var q=a?n(N,I,g,o,t,r):n(I,N,g,t,o,r);if(q!==void 0){if(q)continue;C=!1;break}if(k){if(!uK(o,function(Y,ee){if(!pK(k,ee)&&(I===Y||i(I,Y,e,n,r)))return k.push(ee)})){C=!1;break}}else if(!(I===N||i(I,N,e,n,r))){C=!1;break}}return r.delete(t),r.delete(o),C}MT.exports=mK});var PT=v((cbe,DT)=>{"use strict";function _K(t){var o=-1,e=Array(t.size);return t.forEach(function(n,i){e[++o]=[i,n]}),e}DT.exports=_K});var Gh=v((dbe,RT)=>{"use strict";function gK(t){var o=-1,e=Array(t.size);return t.forEach(function(n){e[++o]=n}),e}RT.exports=gK});var LT=v((ube,AT)=>{"use strict";var OT=Ki(),FT=X_(),bK=Wi(),vK=ag(),yK=PT(),CK=Gh(),xK=1,wK=2,TK="[object Boolean]",SK="[object Date]",kK="[object Error]",IK="[object Map]",EK="[object Number]",MK="[object RegExp]",DK="[object Set]",PK="[object String]",RK="[object Symbol]",OK="[object ArrayBuffer]",FK="[object DataView]",NT=OT?OT.prototype:void 0,sg=NT?NT.valueOf:void 0;function NK(t,o,e,n,i,r,a){switch(e){case FK:if(t.byteLength!=o.byteLength||t.byteOffset!=o.byteOffset)return!1;t=t.buffer,o=o.buffer;case OK:return!(t.byteLength!=o.byteLength||!r(new FT(t),new FT(o)));case TK:case SK:case EK:return bK(+t,+o);case kK:return t.name==o.name&&t.message==o.message;case MK:case PK:return t==o+"";case IK:var s=yK;case DK:var c=n&xK;if(s||(s=CK),t.size!=o.size&&!c)return!1;var u=a.get(t);if(u)return u==o;n|=wK,a.set(t,o);var h=vK(s(t),s(o),n,i,r,a);return a.delete(t),h;case RK:if(sg)return sg.call(t)==sg.call(o)}return!1}AT.exports=NK});var zT=v((pbe,VT)=>{"use strict";var BT=G_(),AK=1,LK=Object.prototype,BK=LK.hasOwnProperty;function VK(t,o,e,n,i,r){var a=e&AK,s=BT(t),c=s.length,u=BT(o),h=u.length;if(c!=h&&!a)return!1;for(var g=c;g--;){var C=s[g];if(!(a?C in o:BK.call(o,C)))return!1}var k=r.get(t),I=r.get(o);if(k&&I)return k==o&&I==t;var N=!0;r.set(t,o),r.set(o,t);for(var q=a;++g<c;){C=s[g];var Y=t[C],ee=o[C];if(n)var ce=a?n(ee,Y,C,o,t,r):n(Y,ee,C,t,o,r);if(!(ce===void 0?Y===ee||i(Y,ee,e,n,r):ce)){N=!1;break}q||(q=C=="constructor")}if(N&&!q){var Oe=t.constructor,De=o.constructor;Oe!=De&&"constructor"in t&&"constructor"in o&&!(typeof Oe=="function"&&Oe instanceof Oe&&typeof De=="function"&&De instanceof De)&&(N=!1)}return r.delete(t),r.delete(o),N}VT.exports=VK});var KT=v((hbe,WT)=>{"use strict";var lg=ma(),zK=ag(),HK=LT(),qK=zT(),HT=Zi(),qT=lt(),GT=Yi(),GK=Qo(),jK=1,jT="[object Arguments]",UT="[object Array]",jh="[object Object]",UK=Object.prototype,$T=UK.hasOwnProperty;function $K(t,o,e,n,i,r){var a=qT(t),s=qT(o),c=a?UT:HT(t),u=s?UT:HT(o);c=c==jT?jh:c,u=u==jT?jh:u;var h=c==jh,g=u==jh,C=c==u;if(C&>(t)){if(!GT(o))return!1;a=!0,h=!1}if(C&&!h)return r||(r=new lg),a||GK(t)?zK(t,o,e,n,i,r):HK(t,o,c,e,n,i,r);if(!(e&jK)){var k=h&&$T.call(t,"__wrapped__"),I=g&&$T.call(o,"__wrapped__");if(k||I){var N=k?t.value():t,q=I?o.value():o;return r||(r=new lg),i(N,q,e,n,r)}}return C?(r||(r=new lg),qK(t,o,e,n,i,r)):!1}WT.exports=$K});var cg=v((fbe,ZT)=>{"use strict";var WK=KT(),YT=yn();function XT(t,o,e,n,i){return t===o?!0:t==null||o==null||!YT(t)&&!YT(o)?t!==t&&o!==o:WK(t,o,e,n,XT,i)}ZT.exports=XT});var JT=v((mbe,QT)=>{"use strict";var KK=ma(),YK=cg(),XK=1,ZK=2;function QK(t,o,e,n){var i=e.length,r=i,a=!n;if(t==null)return!r;for(t=Object(t);i--;){var s=e[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<r;){s=e[i];var c=s[0],u=t[c],h=s[1];if(a&&s[2]){if(u===void 0&&!(c in t))return!1}else{var g=new KK;if(n)var C=n(u,h,c,t,o,g);if(!(C===void 0?YK(h,u,XK|ZK,n,g):C))return!1}}return!0}QT.exports=QK});var dg=v((_be,e2)=>{"use strict";var JK=Yt();function eY(t){return t===t&&!JK(t)}e2.exports=eY});var n2=v((gbe,t2)=>{"use strict";var tY=dg(),nY=Hn();function iY(t){for(var o=nY(t),e=o.length;e--;){var n=o[e],i=t[n];o[e]=[n,i,tY(i)]}return o}t2.exports=iY});var ug=v((bbe,i2)=>{"use strict";function oY(t,o){return function(e){return e==null?!1:e[t]===o&&(o!==void 0||t in Object(e))}}i2.exports=oY});var r2=v((vbe,o2)=>{"use strict";var rY=JT(),aY=n2(),sY=ug();function lY(t){var o=aY(t);return o.length==1&&o[0][2]?sY(o[0][0],o[0][1]):function(e){return e===t||rY(e,t,o)}}o2.exports=lY});var Qi=v((ybe,a2)=>{"use strict";var cY=mi(),dY=yn(),uY="[object Symbol]";function pY(t){return typeof t=="symbol"||dY(t)&&cY(t)==uY}a2.exports=pY});var Uh=v((Cbe,s2)=>{"use strict";var hY=lt(),fY=Qi(),mY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Y=/^\w*$/;function gY(t,o){if(hY(t))return!1;var e=typeof t;return e=="number"||e=="symbol"||e=="boolean"||t==null||fY(t)?!0:_Y.test(t)||!mY.test(t)||o!=null&&t in Object(o)}s2.exports=gY});var d2=v((xbe,c2)=>{"use strict";var l2=Dh(),bY="Expected a function";function pg(t,o){if(typeof t!="function"||o!=null&&typeof o!="function")throw new TypeError(bY);var e=function(){var n=arguments,i=o?o.apply(this,n):n[0],r=e.cache;if(r.has(i))return r.get(i);var a=t.apply(this,n);return e.cache=r.set(i,a)||r,a};return e.cache=new(pg.Cache||l2),e}pg.Cache=l2;c2.exports=pg});var p2=v((wbe,u2)=>{"use strict";var vY=d2(),yY=500;function CY(t){var o=vY(t,function(n){return e.size===yY&&e.clear(),n}),e=o.cache;return o}u2.exports=CY});var f2=v((Tbe,h2)=>{"use strict";var xY=p2(),wY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TY=/\\(\\)?/g,SY=xY(function(t){var o=[];return t.charCodeAt(0)===46&&o.push(""),t.replace(wY,function(e,n,i,r){o.push(i?r.replace(TY,"$1"):n||e)}),o});h2.exports=SY});var Ia=v((Sbe,m2)=>{"use strict";function kY(t,o){for(var e=-1,n=t==null?0:t.length,i=Array(n);++e<n;)i[e]=o(t[e],e,t);return i}m2.exports=kY});var C2=v((kbe,y2)=>{"use strict";var _2=Ki(),IY=Ia(),EY=lt(),MY=Qi(),DY=1/0,g2=_2?_2.prototype:void 0,b2=g2?g2.toString:void 0;function v2(t){if(typeof t=="string")return t;if(EY(t))return IY(t,v2)+"";if(MY(t))return b2?b2.call(t):"";var o=t+"";return o=="0"&&1/t==-DY?"-0":o}y2.exports=v2});var hg=v((Ibe,x2)=>{"use strict";var PY=C2();function RY(t){return t==null?"":PY(t)}x2.exports=RY});var Ea=v((Ebe,w2)=>{"use strict";var OY=lt(),FY=Uh(),NY=f2(),AY=hg();function LY(t,o){return OY(t)?t:FY(t,o)?[t]:NY(AY(t))}w2.exports=LY});var tr=v((Mbe,T2)=>{"use strict";var BY=Qi(),VY=1/0;function zY(t){if(typeof t=="string"||BY(t))return t;var o=t+"";return o=="0"&&1/t==-VY?"-0":o}T2.exports=zY});var Ma=v((Dbe,S2)=>{"use strict";var HY=Ea(),qY=tr();function GY(t,o){o=HY(o,t);for(var e=0,n=o.length;t!=null&&e<n;)t=t[qY(o[e++])];return e&&e==n?t:void 0}S2.exports=GY});var I2=v((Pbe,k2)=>{"use strict";var jY=Ma();function UY(t,o,e){var n=t==null?void 0:jY(t,o);return n===void 0?e:n}k2.exports=UY});var M2=v((Rbe,E2)=>{"use strict";function $Y(t,o){return t!=null&&o in Object(t)}E2.exports=$Y});var fg=v((Obe,D2)=>{"use strict";var WY=Ea(),KY=Yo(),YY=lt(),XY=va(),ZY=Rh(),QY=tr();function JY(t,o,e){o=WY(o,t);for(var n=-1,i=o.length,r=!1;++n<i;){var a=QY(o[n]);if(!(r=t!=null&&e(t,a)))break;t=t[a]}return r||++n!=i?r:(i=t==null?0:t.length,!!i&&ZY(i)&&XY(a,i)&&(YY(t)||KY(t)))}D2.exports=JY});var mg=v((Fbe,P2)=>{"use strict";var eX=M2(),tX=fg();function nX(t,o){return t!=null&&tX(t,o,eX)}P2.exports=nX});var O2=v((Nbe,R2)=>{"use strict";var iX=cg(),oX=I2(),rX=mg(),aX=Uh(),sX=dg(),lX=ug(),cX=tr(),dX=1,uX=2;function pX(t,o){return aX(t)&&sX(o)?lX(cX(t),o):function(e){var n=oX(e,t);return n===void 0&&n===o?rX(e,t):iX(o,n,dX|uX)}}R2.exports=pX});var _g=v((Abe,F2)=>{"use strict";function hX(t){return function(o){return o?.[t]}}F2.exports=hX});var A2=v((Lbe,N2)=>{"use strict";var fX=Ma();function mX(t){return function(o){return fX(o,t)}}N2.exports=mX});var B2=v((Bbe,L2)=>{"use strict";var _X=_g(),gX=A2(),bX=Uh(),vX=tr();function yX(t){return bX(t)?_X(vX(t)):gX(t)}L2.exports=yX});var Rn=v((Vbe,V2)=>{"use strict";var CX=r2(),xX=O2(),wX=bi(),TX=lt(),SX=B2();function kX(t){return typeof t=="function"?t:t==null?wX:typeof t=="object"?TX(t)?xX(t[0],t[1]):CX(t):SX(t)}V2.exports=kX});var gg=v((zbe,z2)=>{"use strict";var IX=V_(),EX=yT(),MX=Rn(),DX=lt();function PX(t,o){var e=DX(t)?IX:EX;return e(t,MX(o,3))}z2.exports=PX});var q2=v((Hbe,H2)=>{"use strict";var RX=Object.prototype,OX=RX.hasOwnProperty;function FX(t,o){return t!=null&&OX.call(t,o)}H2.exports=FX});var bg=v((qbe,G2)=>{"use strict";var NX=q2(),AX=fg();function LX(t,o){return t!=null&&AX(t,o,NX)}G2.exports=LX});var U2=v((Gbe,j2)=>{"use strict";var BX=Fh(),VX=Zi(),zX=Yo(),HX=lt(),qX=Pn(),GX=Yi(),jX=wa(),UX=Qo(),$X="[object Map]",WX="[object Set]",KX=Object.prototype,YX=KX.hasOwnProperty;function XX(t){if(t==null)return!0;if(qX(t)&&(HX(t)||typeof t=="string"||typeof t.splice=="function"||GX(t)||UX(t)||zX(t)))return!t.length;var o=VX(t);if(o==$X||o==WX)return!t.size;if(jX(t))return!BX(t).length;for(var e in t)if(YX.call(t,e))return!1;return!0}j2.exports=XX});var vg=v((jbe,$2)=>{"use strict";function ZX(t){return t===void 0}$2.exports=ZX});var yg=v((Ube,W2)=>{"use strict";var QX=ka(),JX=Pn();function eZ(t,o){var e=-1,n=JX(t)?Array(t.length):[];return QX(t,function(i,r,a){n[++e]=o(i,r,a)}),n}W2.exports=eZ});var Cg=v(($be,K2)=>{"use strict";var tZ=Ia(),nZ=Rn(),iZ=yg(),oZ=lt();function rZ(t,o){var e=oZ(t)?tZ:iZ;return e(t,nZ(o,3))}K2.exports=rZ});var X2=v((Wbe,Y2)=>{"use strict";function aZ(t,o,e,n){var i=-1,r=t==null?0:t.length;for(n&&r&&(e=t[++i]);++i<r;)e=o(e,t[i],i,t);return e}Y2.exports=aZ});var Q2=v((Kbe,Z2)=>{"use strict";function sZ(t,o,e,n,i){return i(t,function(r,a,s){e=n?(n=!1,r):o(e,r,a,s)}),e}Z2.exports=sZ});var xg=v((Ybe,J2)=>{"use strict";var lZ=X2(),cZ=ka(),dZ=Rn(),uZ=Q2(),pZ=lt();function hZ(t,o,e){var n=pZ(t)?lZ:uZ,i=arguments.length<3;return n(t,dZ(o,4),e,i,cZ)}J2.exports=hZ});var tS=v((Xbe,eS)=>{"use strict";var fZ=mi(),mZ=lt(),_Z=yn(),gZ="[object String]";function bZ(t){return typeof t=="string"||!mZ(t)&&_Z(t)&&fZ(t)==gZ}eS.exports=bZ});var iS=v((Zbe,nS)=>{"use strict";var vZ=_g(),yZ=vZ("length");nS.exports=yZ});var rS=v((Qbe,oS)=>{"use strict";var CZ="\\ud800-\\udfff",xZ="\\u0300-\\u036f",wZ="\\ufe20-\\ufe2f",TZ="\\u20d0-\\u20ff",SZ=xZ+wZ+TZ,kZ="\\ufe0e\\ufe0f",IZ="\\u200d",EZ=RegExp("["+IZ+CZ+SZ+kZ+"]");function MZ(t){return EZ.test(t)}oS.exports=MZ});var fS=v((Jbe,hS)=>{"use strict";var sS="\\ud800-\\udfff",DZ="\\u0300-\\u036f",PZ="\\ufe20-\\ufe2f",RZ="\\u20d0-\\u20ff",OZ=DZ+PZ+RZ,FZ="\\ufe0e\\ufe0f",NZ="["+sS+"]",wg="["+OZ+"]",Tg="\\ud83c[\\udffb-\\udfff]",AZ="(?:"+wg+"|"+Tg+")",lS="[^"+sS+"]",cS="(?:\\ud83c[\\udde6-\\uddff]){2}",dS="[\\ud800-\\udbff][\\udc00-\\udfff]",LZ="\\u200d",uS=AZ+"?",pS="["+FZ+"]?",BZ="(?:"+LZ+"(?:"+[lS,cS,dS].join("|")+")"+pS+uS+")*",VZ=pS+uS+BZ,zZ="(?:"+[lS+wg+"?",wg,cS,dS,NZ].join("|")+")",aS=RegExp(Tg+"(?="+Tg+")|"+zZ+VZ,"g");function HZ(t){for(var o=aS.lastIndex=0;aS.test(t);)++o;return o}hS.exports=HZ});var _S=v((eve,mS)=>{"use strict";var qZ=iS(),GZ=rS(),jZ=fS();function UZ(t){return GZ(t)?jZ(t):qZ(t)}mS.exports=UZ});var bS=v((tve,gS)=>{"use strict";var $Z=Fh(),WZ=Zi(),KZ=Pn(),YZ=tS(),XZ=_S(),ZZ="[object Map]",QZ="[object Set]";function JZ(t){if(t==null)return 0;if(KZ(t))return YZ(t)?XZ(t):t.length;var o=WZ(t);return o==ZZ||o==QZ?t.size:$Z(t).length}gS.exports=JZ});var yS=v((nve,vS)=>{"use strict";var eQ=Ph(),tQ=Q_(),nQ=Hh(),iQ=Rn(),oQ=Sa(),rQ=lt(),aQ=Yi(),sQ=jo(),lQ=Yt(),cQ=Qo();function dQ(t,o,e){var n=rQ(t),i=n||aQ(t)||cQ(t);if(o=iQ(o,4),e==null){var r=t&&t.constructor;i?e=n?new r:[]:lQ(t)?e=sQ(r)?tQ(oQ(t)):{}:e={}}return(i?eQ:nQ)(t,function(a,s,c){return o(e,a,s,c)}),e}vS.exports=dQ});var TS=v((ive,wS)=>{"use strict";var CS=Ki(),uQ=Yo(),pQ=lt(),xS=CS?CS.isConcatSpreadable:void 0;function hQ(t){return pQ(t)||uQ(t)||!!(xS&&t&&t[xS])}wS.exports=hQ});var $h=v((ove,kS)=>{"use strict";var fQ=Ah(),mQ=TS();function SS(t,o,e,n,i){var r=-1,a=t.length;for(e||(e=mQ),i||(i=[]);++r<a;){var s=t[r];o>0&&e(s)?o>1?SS(s,o-1,e,n,i):fQ(i,s):n||(i[i.length]=s)}return i}kS.exports=SS});var ES=v((rve,IS)=>{"use strict";function _Q(t,o,e){switch(e.length){case 0:return t.call(o);case 1:return t.call(o,e[0]);case 2:return t.call(o,e[0],e[1]);case 3:return t.call(o,e[0],e[1],e[2])}return t.apply(o,e)}IS.exports=_Q});var Sg=v((ave,DS)=>{"use strict";var gQ=ES(),MS=Math.max;function bQ(t,o,e){return o=MS(o===void 0?t.length-1:o,0),function(){for(var n=arguments,i=-1,r=MS(n.length-o,0),a=Array(r);++i<r;)a[i]=n[o+i];i=-1;for(var s=Array(o+1);++i<o;)s[i]=n[i];return s[o]=e(a),gQ(t,this,s)}}DS.exports=bQ});var OS=v((sve,RS)=>{"use strict";var vQ=Vh(),PS=O_(),yQ=bi(),CQ=PS?function(t,o){return PS(t,"toString",{configurable:!0,enumerable:!1,value:vQ(o),writable:!0})}:yQ;RS.exports=CQ});var NS=v((lve,FS)=>{"use strict";var xQ=800,wQ=16,TQ=Date.now;function SQ(t){var o=0,e=0;return function(){var n=TQ(),i=wQ-(n-e);if(e=n,i>0){if(++o>=xQ)return arguments[0]}else o=0;return t.apply(void 0,arguments)}}FS.exports=SQ});var kg=v((cve,AS)=>{"use strict";var kQ=OS(),IQ=NS(),EQ=IQ(kQ);AS.exports=EQ});var Da=v((dve,LS)=>{"use strict";var MQ=bi(),DQ=Sg(),PQ=kg();function RQ(t,o){return PQ(DQ(t,o,MQ),t+"")}LS.exports=RQ});var Ig=v((uve,BS)=>{"use strict";function OQ(t,o,e,n){for(var i=t.length,r=e+(n?1:-1);n?r--:++r<i;)if(o(t[r],r,t))return r;return-1}BS.exports=OQ});var zS=v((pve,VS)=>{"use strict";function FQ(t){return t!==t}VS.exports=FQ});var qS=v((hve,HS)=>{"use strict";function NQ(t,o,e){for(var n=e-1,i=t.length;++n<i;)if(t[n]===o)return n;return-1}HS.exports=NQ});var jS=v((fve,GS)=>{"use strict";var AQ=Ig(),LQ=zS(),BQ=qS();function VQ(t,o,e){return o===o?BQ(t,o,e):AQ(t,LQ,e)}GS.exports=VQ});var $S=v((mve,US)=>{"use strict";var zQ=jS();function HQ(t,o){var e=t==null?0:t.length;return!!e&&zQ(t,o,0)>-1}US.exports=HQ});var KS=v((_ve,WS)=>{"use strict";function qQ(t,o,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(o,t[n]))return!0;return!1}WS.exports=qQ});var XS=v((gve,YS)=>{"use strict";function GQ(){}YS.exports=GQ});var QS=v((bve,ZS)=>{"use strict";var Eg=j_(),jQ=XS(),UQ=Gh(),$Q=1/0,WQ=Eg&&1/UQ(new Eg([,-0]))[1]==$Q?function(t){return new Eg(t)}:jQ;ZS.exports=WQ});var ek=v((vve,JS)=>{"use strict";var KQ=og(),YQ=$S(),XQ=KS(),ZQ=rg(),QQ=QS(),JQ=Gh(),eJ=200;function tJ(t,o,e){var n=-1,i=YQ,r=t.length,a=!0,s=[],c=s;if(e)a=!1,i=XQ;else if(r>=eJ){var u=o?null:QQ(t);if(u)return JQ(u);a=!1,i=ZQ,c=new KQ}else c=o?[]:s;e:for(;++n<r;){var h=t[n],g=o?o(h):h;if(h=e||h!==0?h:0,a&&g===g){for(var C=c.length;C--;)if(c[C]===g)continue e;o&&c.push(g),s.push(h)}else i(c,g,e)||(c!==s&&c.push(g),s.push(h))}return s}JS.exports=tJ});var Mg=v((yve,tk)=>{"use strict";var nJ=Pn(),iJ=yn();function oJ(t){return iJ(t)&&nJ(t)}tk.exports=oJ});var ik=v((Cve,nk)=>{"use strict";var rJ=$h(),aJ=Da(),sJ=ek(),lJ=Mg(),cJ=aJ(function(t){return sJ(rJ(t,1,lJ,!0))});nk.exports=cJ});var rk=v((xve,ok)=>{"use strict";var dJ=Ia();function uJ(t,o){return dJ(o,function(e){return t[e]})}ok.exports=uJ});var Dg=v((wve,ak)=>{"use strict";var pJ=rk(),hJ=Hn();function fJ(t){return t==null?[]:pJ(t,hJ(t))}ak.exports=fJ});var Xt=v((Tve,sk)=>{"use strict";var Wh;if(typeof no=="function")try{Wh={clone:aT(),constant:Vh(),each:ig(),filter:gg(),has:bg(),isArray:lt(),isEmpty:U2(),isFunction:jo(),isUndefined:vg(),keys:Hn(),map:Cg(),reduce:xg(),size:bS(),transform:yS(),union:ik(),values:Dg()}}catch{}Wh||(Wh=window._);sk.exports=Wh});var Kh=v((kve,uk)=>{"use strict";var ve=Xt();uk.exports=Pe;var mJ="\0",Ji="\0",lk="";function Pe(t){this._isDirected=ve.has(t,"directed")?t.directed:!0,this._isMultigraph=ve.has(t,"multigraph")?t.multigraph:!1,this._isCompound=ve.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ve.constant(void 0),this._defaultEdgeLabelFn=ve.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Ji]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}Pe.prototype._nodeCount=0;Pe.prototype._edgeCount=0;Pe.prototype.isDirected=function(){return this._isDirected};Pe.prototype.isMultigraph=function(){return this._isMultigraph};Pe.prototype.isCompound=function(){return this._isCompound};Pe.prototype.setGraph=function(t){return this._label=t,this};Pe.prototype.graph=function(){return this._label};Pe.prototype.setDefaultNodeLabel=function(t){return ve.isFunction(t)||(t=ve.constant(t)),this._defaultNodeLabelFn=t,this};Pe.prototype.nodeCount=function(){return this._nodeCount};Pe.prototype.nodes=function(){return ve.keys(this._nodes)};Pe.prototype.sources=function(){var t=this;return ve.filter(this.nodes(),function(o){return ve.isEmpty(t._in[o])})};Pe.prototype.sinks=function(){var t=this;return ve.filter(this.nodes(),function(o){return ve.isEmpty(t._out[o])})};Pe.prototype.setNodes=function(t,o){var e=arguments,n=this;return ve.each(t,function(i){e.length>1?n.setNode(i,o):n.setNode(i)}),this};Pe.prototype.setNode=function(t,o){return ve.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=o),this):(this._nodes[t]=arguments.length>1?o:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Ji,this._children[t]={},this._children[Ji][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};Pe.prototype.node=function(t){return this._nodes[t]};Pe.prototype.hasNode=function(t){return ve.has(this._nodes,t)};Pe.prototype.removeNode=function(t){var o=this;if(ve.has(this._nodes,t)){var e=function(n){o.removeEdge(o._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],ve.each(this.children(t),function(n){o.setParent(n)}),delete this._children[t]),ve.each(ve.keys(this._in[t]),e),delete this._in[t],delete this._preds[t],ve.each(ve.keys(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};Pe.prototype.setParent=function(t,o){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ve.isUndefined(o))o=Ji;else{o+="";for(var e=o;!ve.isUndefined(e);e=this.parent(e))if(e===t)throw new Error("Setting "+o+" as parent of "+t+" would create a cycle");this.setNode(o)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=o,this._children[o][t]=!0,this};Pe.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};Pe.prototype.parent=function(t){if(this._isCompound){var o=this._parent[t];if(o!==Ji)return o}};Pe.prototype.children=function(t){if(ve.isUndefined(t)&&(t=Ji),this._isCompound){var o=this._children[t];if(o)return ve.keys(o)}else{if(t===Ji)return this.nodes();if(this.hasNode(t))return[]}};Pe.prototype.predecessors=function(t){var o=this._preds[t];if(o)return ve.keys(o)};Pe.prototype.successors=function(t){var o=this._sucs[t];if(o)return ve.keys(o)};Pe.prototype.neighbors=function(t){var o=this.predecessors(t);if(o)return ve.union(o,this.successors(t))};Pe.prototype.isLeaf=function(t){var o;return this.isDirected()?o=this.successors(t):o=this.neighbors(t),o.length===0};Pe.prototype.filterNodes=function(t){var o=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});o.setGraph(this.graph());var e=this;ve.each(this._nodes,function(r,a){t(a)&&o.setNode(a,r)}),ve.each(this._edgeObjs,function(r){o.hasNode(r.v)&&o.hasNode(r.w)&&o.setEdge(r,e.edge(r))});var n={};function i(r){var a=e.parent(r);return a===void 0||o.hasNode(a)?(n[r]=a,a):a in n?n[a]:i(a)}return this._isCompound&&ve.each(o.nodes(),function(r){o.setParent(r,i(r))}),o};Pe.prototype.setDefaultEdgeLabel=function(t){return ve.isFunction(t)||(t=ve.constant(t)),this._defaultEdgeLabelFn=t,this};Pe.prototype.edgeCount=function(){return this._edgeCount};Pe.prototype.edges=function(){return ve.values(this._edgeObjs)};Pe.prototype.setPath=function(t,o){var e=this,n=arguments;return ve.reduce(t,function(i,r){return n.length>1?e.setEdge(i,r,o):e.setEdge(i,r),r}),this};Pe.prototype.setEdge=function(){var t,o,e,n,i=!1,r=arguments[0];typeof r=="object"&&r!==null&&"v"in r?(t=r.v,o=r.w,e=r.name,arguments.length===2&&(n=arguments[1],i=!0)):(t=r,o=arguments[1],e=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,o=""+o,ve.isUndefined(e)||(e=""+e);var a=Pa(this._isDirected,t,o,e);if(ve.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!ve.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(o),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,o,e);var s=_J(this._isDirected,t,o,e);return t=s.v,o=s.w,Object.freeze(s),this._edgeObjs[a]=s,ck(this._preds[o],t),ck(this._sucs[t],o),this._in[o][a]=s,this._out[t][a]=s,this._edgeCount++,this};Pe.prototype.edge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e);return this._edgeLabels[n]};Pe.prototype.hasEdge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e);return ve.has(this._edgeLabels,n)};Pe.prototype.removeEdge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e),i=this._edgeObjs[n];return i&&(t=i.v,o=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],dk(this._preds[o],t),dk(this._sucs[t],o),delete this._in[o][n],delete this._out[t][n],this._edgeCount--),this};Pe.prototype.inEdges=function(t,o){var e=this._in[t];if(e){var n=ve.values(e);return o?ve.filter(n,function(i){return i.v===o}):n}};Pe.prototype.outEdges=function(t,o){var e=this._out[t];if(e){var n=ve.values(e);return o?ve.filter(n,function(i){return i.w===o}):n}};Pe.prototype.nodeEdges=function(t,o){var e=this.inEdges(t,o);if(e)return e.concat(this.outEdges(t,o))};function ck(t,o){t[o]?t[o]++:t[o]=1}function dk(t,o){--t[o]||delete t[o]}function Pa(t,o,e,n){var i=""+o,r=""+e;if(!t&&i>r){var a=i;i=r,r=a}return i+lk+r+lk+(ve.isUndefined(n)?mJ:n)}function _J(t,o,e,n){var i=""+o,r=""+e;if(!t&&i>r){var a=i;i=r,r=a}var s={v:i,w:r};return n&&(s.name=n),s}function Pg(t,o){return Pa(t,o.v,o.w,o.name)}});var hk=v((Ive,pk)=>{"use strict";pk.exports="2.1.8"});var mk=v((Eve,fk)=>{"use strict";fk.exports={Graph:Kh(),version:hk()}});var gk=v((Mve,_k)=>{"use strict";var On=Xt(),gJ=Kh();_k.exports={write:bJ,read:CJ};function bJ(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:vJ(t),edges:yJ(t)};return On.isUndefined(t.graph())||(o.value=On.clone(t.graph())),o}function vJ(t){return On.map(t.nodes(),function(o){var e=t.node(o),n=t.parent(o),i={v:o};return On.isUndefined(e)||(i.value=e),On.isUndefined(n)||(i.parent=n),i})}function yJ(t){return On.map(t.edges(),function(o){var e=t.edge(o),n={v:o.v,w:o.w};return On.isUndefined(o.name)||(n.name=o.name),On.isUndefined(e)||(n.value=e),n})}function CJ(t){var o=new gJ(t.options).setGraph(t.value);return On.each(t.nodes,function(e){o.setNode(e.v,e.value),e.parent&&o.setParent(e.v,e.parent)}),On.each(t.edges,function(e){o.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),o}});var vk=v((Dve,bk)=>{"use strict";var Yh=Xt();bk.exports=xJ;function xJ(t){var o={},e=[],n;function i(r){Yh.has(o,r)||(o[r]=!0,n.push(r),Yh.each(t.successors(r),i),Yh.each(t.predecessors(r),i))}return Yh.each(t.nodes(),function(r){n=[],i(r),n.length&&e.push(n)}),e}});var Rg=v((Pve,Ck)=>{"use strict";var yk=Xt();Ck.exports=ln;function ln(){this._arr=[],this._keyIndices={}}ln.prototype.size=function(){return this._arr.length};ln.prototype.keys=function(){return this._arr.map(function(t){return t.key})};ln.prototype.has=function(t){return yk.has(this._keyIndices,t)};ln.prototype.priority=function(t){var o=this._keyIndices[t];if(o!==void 0)return this._arr[o].priority};ln.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};ln.prototype.add=function(t,o){var e=this._keyIndices;if(t=String(t),!yk.has(e,t)){var n=this._arr,i=n.length;return e[t]=i,n.push({key:t,priority:o}),this._decrease(i),!0}return!1};ln.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};ln.prototype.decrease=function(t,o){var e=this._keyIndices[t];if(o>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+o);this._arr[e].priority=o,this._decrease(e)};ln.prototype._heapify=function(t){var o=this._arr,e=2*t,n=e+1,i=t;e<o.length&&(i=o[e].priority<o[i].priority?e:i,n<o.length&&(i=o[n].priority<o[i].priority?n:i),i!==t&&(this._swap(t,i),this._heapify(i)))};ln.prototype._decrease=function(t){for(var o=this._arr,e=o[t].priority,n;t!==0&&(n=t>>1,!(o[n].priority<e));)this._swap(t,n),t=n};ln.prototype._swap=function(t,o){var e=this._arr,n=this._keyIndices,i=e[t],r=e[o];e[t]=r,e[o]=i,n[r.key]=t,n[i.key]=o}});var Og=v((Rve,xk)=>{"use strict";var wJ=Xt(),TJ=Rg();xk.exports=kJ;var SJ=wJ.constant(1);function kJ(t,o,e,n){return IJ(t,String(o),e||SJ,n||function(i){return t.outEdges(i)})}function IJ(t,o,e,n){var i={},r=new TJ,a,s,c=function(u){var h=u.v!==a?u.v:u.w,g=i[h],C=e(u),k=s.distance+C;if(C<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+C);k<g.distance&&(g.distance=k,g.predecessor=a,r.decrease(h,k))};for(t.nodes().forEach(function(u){var h=u===o?0:Number.POSITIVE_INFINITY;i[u]={distance:h},r.add(u,h)});r.size()>0&&(a=r.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)n(a).forEach(c);return i}});var Tk=v((Ove,wk)=>{"use strict";var EJ=Og(),MJ=Xt();wk.exports=DJ;function DJ(t,o,e){return MJ.transform(t.nodes(),function(n,i){n[i]=EJ(t,i,o,e)},{})}});var Fg=v((Fve,kk)=>{"use strict";var Sk=Xt();kk.exports=PJ;function PJ(t){var o=0,e=[],n={},i=[];function r(a){var s=n[a]={onStack:!0,lowlink:o,index:o++};if(e.push(a),t.successors(a).forEach(function(h){Sk.has(n,h)?n[h].onStack&&(s.lowlink=Math.min(s.lowlink,n[h].index)):(r(h),s.lowlink=Math.min(s.lowlink,n[h].lowlink))}),s.lowlink===s.index){var c=[],u;do u=e.pop(),n[u].onStack=!1,c.push(u);while(a!==u);i.push(c)}}return t.nodes().forEach(function(a){Sk.has(n,a)||r(a)}),i}});var Ek=v((Nve,Ik)=>{"use strict";var RJ=Xt(),OJ=Fg();Ik.exports=FJ;function FJ(t){return RJ.filter(OJ(t),function(o){return o.length>1||o.length===1&&t.hasEdge(o[0],o[0])})}});var Dk=v((Ave,Mk)=>{"use strict";var NJ=Xt();Mk.exports=LJ;var AJ=NJ.constant(1);function LJ(t,o,e){return BJ(t,o||AJ,e||function(n){return t.outEdges(n)})}function BJ(t,o,e){var n={},i=t.nodes();return i.forEach(function(r){n[r]={},n[r][r]={distance:0},i.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=o(a);n[r][s]={distance:c,predecessor:r}})}),i.forEach(function(r){var a=n[r];i.forEach(function(s){var c=n[s];i.forEach(function(u){var h=c[r],g=a[u],C=c[u],k=h.distance+g.distance;k<C.distance&&(C.distance=k,C.predecessor=g.predecessor)})})}),n}});var Ng=v((Lve,Rk)=>{"use strict";var Ra=Xt();Rk.exports=Pk;Pk.CycleException=Xh;function Pk(t){var o={},e={},n=[];function i(r){if(Ra.has(e,r))throw new Xh;Ra.has(o,r)||(e[r]=!0,o[r]=!0,Ra.each(t.predecessors(r),i),delete e[r],n.push(r))}if(Ra.each(t.sinks(),i),Ra.size(o)!==t.nodeCount())throw new Xh;return n}function Xh(){}Xh.prototype=new Error});var Nk=v((Bve,Fk)=>{"use strict";var Ok=Ng();Fk.exports=VJ;function VJ(t){try{Ok(t)}catch(o){if(o instanceof Ok.CycleException)return!1;throw o}return!0}});var Ag=v((Vve,Lk)=>{"use strict";var Zh=Xt();Lk.exports=zJ;function zJ(t,o,e){Zh.isArray(o)||(o=[o]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],r={};return Zh.each(o,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);Ak(t,a,e==="post",r,n,i)}),i}function Ak(t,o,e,n,i,r){Zh.has(n,o)||(n[o]=!0,e||r.push(o),Zh.each(i(o),function(a){Ak(t,a,e,n,i,r)}),e&&r.push(o))}});var Vk=v((zve,Bk)=>{"use strict";var HJ=Ag();Bk.exports=qJ;function qJ(t,o){return HJ(t,o,"post")}});var Hk=v((Hve,zk)=>{"use strict";var GJ=Ag();zk.exports=jJ;function jJ(t,o){return GJ(t,o,"pre")}});var jk=v((qve,Gk)=>{"use strict";var qk=Xt(),UJ=Kh(),$J=Rg();Gk.exports=WJ;function WJ(t,o){var e=new UJ,n={},i=new $J,r;function a(c){var u=c.v===r?c.w:c.v,h=i.priority(u);if(h!==void 0){var g=o(c);g<h&&(n[u]=r,i.decrease(u,g))}}if(t.nodeCount()===0)return e;qk.each(t.nodes(),function(c){i.add(c,Number.POSITIVE_INFINITY),e.setNode(c)}),i.decrease(t.nodes()[0],0);for(var s=!1;i.size()>0;){if(r=i.removeMin(),qk.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 $k=v((Gve,Uk)=>{"use strict";Uk.exports={components:vk(),dijkstra:Og(),dijkstraAll:Tk(),findCycles:Ek(),floydWarshall:Dk(),isAcyclic:Nk(),postorder:Vk(),preorder:Hk(),prim:jk(),tarjan:Fg(),topsort:Ng()}});var Yk=v((jve,Kk)=>{"use strict";var Wk=mk();Kk.exports={Graph:Wk.Graph,json:gk(),alg:$k(),version:Wk.version}});var cn=v((Uve,Xk)=>{"use strict";var Qh;if(typeof no=="function")try{Qh=Yk()}catch{}Qh||(Qh=window.graphlib);Xk.exports=Qh});var Qk=v((Wve,Zk)=>{"use strict";var KJ=eg(),YJ=1,XJ=4;function ZJ(t){return KJ(t,YJ|XJ)}Zk.exports=ZJ});var Oa=v((Kve,Jk)=>{"use strict";var QJ=Wi(),JJ=Pn(),eee=va(),tee=Yt();function nee(t,o,e){if(!tee(e))return!1;var n=typeof o;return(n=="number"?JJ(e)&&eee(o,e.length):n=="string"&&o in e)?QJ(e[o],t):!1}Jk.exports=nee});var nI=v((Yve,tI)=>{"use strict";var iee=Da(),oee=Wi(),ree=Oa(),aee=gi(),eI=Object.prototype,see=eI.hasOwnProperty,lee=iee(function(t,o){t=Object(t);var e=-1,n=o.length,i=n>2?o[2]:void 0;for(i&&ree(o[0],o[1],i)&&(n=1);++e<n;)for(var r=o[e],a=aee(r),s=-1,c=a.length;++s<c;){var u=a[s],h=t[u];(h===void 0||oee(h,eI[u])&&!see.call(t,u))&&(t[u]=r[u])}return t});tI.exports=lee});var oI=v((Xve,iI)=>{"use strict";var cee=Rn(),dee=Pn(),uee=Hn();function pee(t){return function(o,e,n){var i=Object(o);if(!dee(o)){var r=cee(e,3);o=uee(o),e=function(s){return r(i[s],s,i)}}var a=t(o,e,n);return a>-1?i[r?o[a]:a]:void 0}}iI.exports=pee});var aI=v((Zve,rI)=>{"use strict";var hee=/\s/;function fee(t){for(var o=t.length;o--&&hee.test(t.charAt(o)););return o}rI.exports=fee});var lI=v((Qve,sI)=>{"use strict";var mee=aI(),_ee=/^\s+/;function gee(t){return t&&t.slice(0,mee(t)+1).replace(_ee,"")}sI.exports=gee});var pI=v((Jve,uI)=>{"use strict";var bee=lI(),cI=Yt(),vee=Qi(),dI=NaN,yee=/^[-+]0x[0-9a-f]+$/i,Cee=/^0b[01]+$/i,xee=/^0o[0-7]+$/i,wee=parseInt;function Tee(t){if(typeof t=="number")return t;if(vee(t))return dI;if(cI(t)){var o=typeof t.valueOf=="function"?t.valueOf():t;t=cI(o)?o+"":o}if(typeof t!="string")return t===0?t:+t;t=bee(t);var e=Cee.test(t);return e||xee.test(t)?wee(t.slice(2),e?2:8):yee.test(t)?dI:+t}uI.exports=Tee});var Lg=v((eye,fI)=>{"use strict";var See=pI(),hI=1/0,kee=17976931348623157e292;function Iee(t){if(!t)return t===0?t:0;if(t=See(t),t===hI||t===-hI){var o=t<0?-1:1;return o*kee}return t===t?t:0}fI.exports=Iee});var _I=v((tye,mI)=>{"use strict";var Eee=Lg();function Mee(t){var o=Eee(t),e=o%1;return o===o?e?o-e:o:0}mI.exports=Mee});var bI=v((nye,gI)=>{"use strict";var Dee=Ig(),Pee=Rn(),Ree=_I(),Oee=Math.max;function Fee(t,o,e){var n=t==null?0:t.length;if(!n)return-1;var i=e==null?0:Ree(e);return i<0&&(i=Oee(n+i,0)),Dee(t,Pee(o,3),i)}gI.exports=Fee});var yI=v((iye,vI)=>{"use strict";var Nee=oI(),Aee=bI(),Lee=Nee(Aee);vI.exports=Lee});var Bg=v((oye,CI)=>{"use strict";var Bee=$h();function Vee(t){var o=t==null?0:t.length;return o?Bee(t,1):[]}CI.exports=Vee});var wI=v((rye,xI)=>{"use strict";var zee=zh(),Hee=tg(),qee=gi();function Gee(t,o){return t==null?t:zee(t,Hee(o),qee)}xI.exports=Gee});var SI=v((aye,TI)=>{"use strict";function jee(t){var o=t==null?0:t.length;return o?t[o-1]:void 0}TI.exports=jee});var II=v((sye,kI)=>{"use strict";var Uee=_a(),$ee=Hh(),Wee=Rn();function Kee(t,o){var e={};return o=Wee(o,3),$ee(t,function(n,i,r){Uee(e,i,o(n,i,r))}),e}kI.exports=Kee});var Jh=v((lye,EI)=>{"use strict";var Yee=Qi();function Xee(t,o,e){for(var n=-1,i=t.length;++n<i;){var r=t[n],a=o(r);if(a!=null&&(s===void 0?a===a&&!Yee(a):e(a,s)))var s=a,c=r}return c}EI.exports=Xee});var DI=v((cye,MI)=>{"use strict";function Zee(t,o){return t>o}MI.exports=Zee});var RI=v((dye,PI)=>{"use strict";var Qee=Jh(),Jee=DI(),ete=bi();function tte(t){return t&&t.length?Qee(t,ete,Jee):void 0}PI.exports=tte});var Vg=v((uye,OI)=>{"use strict";var nte=_a(),ite=Wi();function ote(t,o,e){(e!==void 0&&!ite(t[o],e)||e===void 0&&!(o in t))&&nte(t,o,e)}OI.exports=ote});var AI=v((pye,NI)=>{"use strict";var rte=mi(),ate=Sa(),ste=yn(),lte="[object Object]",cte=Function.prototype,dte=Object.prototype,FI=cte.toString,ute=dte.hasOwnProperty,pte=FI.call(Object);function hte(t){if(!ste(t)||rte(t)!=lte)return!1;var o=ate(t);if(o===null)return!0;var e=ute.call(o,"constructor")&&o.constructor;return typeof e=="function"&&e instanceof e&&FI.call(e)==pte}NI.exports=hte});var zg=v((hye,LI)=>{"use strict";function fte(t,o){if(!(o==="constructor"&&typeof t[o]=="function")&&o!="__proto__")return t[o]}LI.exports=fte});var VI=v((fye,BI)=>{"use strict";var mte=Ko(),_te=gi();function gte(t){return mte(t,_te(t))}BI.exports=gte});var UI=v((mye,jI)=>{"use strict";var zI=Vg(),bte=L_(),vte=Z_(),yte=B_(),Cte=J_(),HI=Yo(),qI=lt(),xte=Mg(),wte=Yi(),Tte=jo(),Ste=Yt(),kte=AI(),Ite=Qo(),GI=zg(),Ete=VI();function Mte(t,o,e,n,i,r,a){var s=GI(t,e),c=GI(o,e),u=a.get(c);if(u){zI(t,e,u);return}var h=r?r(s,c,e+"",t,o,a):void 0,g=h===void 0;if(g){var C=qI(c),k=!C&&wte(c),I=!C&&!k&&Ite(c);h=c,C||k||I?qI(s)?h=s:xte(s)?h=yte(s):k?(g=!1,h=bte(c,!0)):I?(g=!1,h=vte(c,!0)):h=[]:kte(c)||HI(c)?(h=s,HI(s)?h=Ete(s):(!Ste(s)||Tte(s))&&(h=Cte(c))):g=!1}g&&(a.set(c,h),i(h,c,n,r,a),a.delete(c)),zI(t,e,h)}jI.exports=Mte});var KI=v((_ye,WI)=>{"use strict";var Dte=ma(),Pte=Vg(),Rte=zh(),Ote=UI(),Fte=Yt(),Nte=gi(),Ate=zg();function $I(t,o,e,n,i){t!==o&&Rte(o,function(r,a){if(i||(i=new Dte),Fte(r))Ote(t,o,a,e,$I,n,i);else{var s=n?n(Ate(t,a),r,a+"",t,o,i):void 0;s===void 0&&(s=r),Pte(t,a,s)}},Nte)}WI.exports=$I});var XI=v((gye,YI)=>{"use strict";var Lte=Da(),Bte=Oa();function Vte(t){return Lte(function(o,e){var n=-1,i=e.length,r=i>1?e[i-1]:void 0,a=i>2?e[2]:void 0;for(r=t.length>3&&typeof r=="function"?(i--,r):void 0,a&&Bte(e[0],e[1],a)&&(r=i<3?void 0:r,i=1),o=Object(o);++n<i;){var s=e[n];s&&t(o,s,n,r)}return o})}YI.exports=Vte});var QI=v((bye,ZI)=>{"use strict";var zte=KI(),Hte=XI(),qte=Hte(function(t,o,e){zte(t,o,e)});ZI.exports=qte});var Hg=v((vye,JI)=>{"use strict";function Gte(t,o){return t<o}JI.exports=Gte});var tE=v((yye,eE)=>{"use strict";var jte=Jh(),Ute=Hg(),$te=bi();function Wte(t){return t&&t.length?jte(t,$te,Ute):void 0}eE.exports=Wte});var iE=v((Cye,nE)=>{"use strict";var Kte=Jh(),Yte=Rn(),Xte=Hg();function Zte(t,o){return t&&t.length?Kte(t,Yte(o,2),Xte):void 0}nE.exports=Zte});var rE=v((xye,oE)=>{"use strict";var Qte=sn(),Jte=function(){return Qte.Date.now()};oE.exports=Jte});var lE=v((wye,sE)=>{"use strict";var ene=ga(),tne=Ea(),nne=va(),aE=Yt(),ine=tr();function one(t,o,e,n){if(!aE(t))return t;o=tne(o,t);for(var i=-1,r=o.length,a=r-1,s=t;s!=null&&++i<r;){var c=ine(o[i]),u=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=a){var h=s[c];u=n?n(h,c,s):void 0,u===void 0&&(u=aE(h)?h:nne(o[i+1])?[]:{})}ene(s,c,u),s=s[c]}return t}sE.exports=one});var dE=v((Tye,cE)=>{"use strict";var rne=Ma(),ane=lE(),sne=Ea();function lne(t,o,e){for(var n=-1,i=o.length,r={};++n<i;){var a=o[n],s=rne(t,a);e(s,a)&&ane(r,sne(a,t),s)}return r}cE.exports=lne});var pE=v((Sye,uE)=>{"use strict";var cne=dE(),dne=mg();function une(t,o){return cne(t,o,function(e,n){return dne(t,n)})}uE.exports=une});var fE=v((kye,hE)=>{"use strict";var pne=Bg(),hne=Sg(),fne=kg();function mne(t){return fne(hne(t,void 0,pne),t+"")}hE.exports=mne});var _E=v((Iye,mE)=>{"use strict";var _ne=pE(),gne=fE(),bne=gne(function(t,o){return t==null?{}:_ne(t,o)});mE.exports=bne});var bE=v((Eye,gE)=>{"use strict";var vne=Math.ceil,yne=Math.max;function Cne(t,o,e,n){for(var i=-1,r=yne(vne((o-t)/(e||1)),0),a=Array(r);r--;)a[n?r:++i]=t,t+=e;return a}gE.exports=Cne});var yE=v((Mye,vE)=>{"use strict";var xne=bE(),wne=Oa(),qg=Lg();function Tne(t){return function(o,e,n){return n&&typeof n!="number"&&wne(o,e,n)&&(e=n=void 0),o=qg(o),e===void 0?(e=o,o=0):e=qg(e),n=n===void 0?o<e?1:-1:qg(n),xne(o,e,n,t)}}vE.exports=Tne});var xE=v((Dye,CE)=>{"use strict";var Sne=yE(),kne=Sne();CE.exports=kne});var TE=v((Pye,wE)=>{"use strict";function Ine(t,o){var e=t.length;for(t.sort(o);e--;)t[e]=t[e].value;return t}wE.exports=Ine});var IE=v((Rye,kE)=>{"use strict";var SE=Qi();function Ene(t,o){if(t!==o){var e=t!==void 0,n=t===null,i=t===t,r=SE(t),a=o!==void 0,s=o===null,c=o===o,u=SE(o);if(!s&&!u&&!r&&t>o||r&&a&&c&&!s&&!u||n&&a&&c||!e&&c||!i)return 1;if(!n&&!r&&!u&&t<o||u&&e&&i&&!n&&!r||s&&e&&i||!a&&i||!c)return-1}return 0}kE.exports=Ene});var ME=v((Oye,EE)=>{"use strict";var Mne=IE();function Dne(t,o,e){for(var n=-1,i=t.criteria,r=o.criteria,a=i.length,s=e.length;++n<a;){var c=Mne(i[n],r[n]);if(c){if(n>=s)return c;var u=e[n];return c*(u=="desc"?-1:1)}}return t.index-o.index}EE.exports=Dne});var PE=v((Fye,DE)=>{"use strict";var Gg=Ia(),Pne=Ma(),Rne=Rn(),One=yg(),Fne=TE(),Nne=ya(),Ane=ME(),Lne=bi(),Bne=lt();function Vne(t,o,e){o.length?o=Gg(o,function(r){return Bne(r)?function(a){return Pne(a,r.length===1?r[0]:r)}:r}):o=[Lne];var n=-1;o=Gg(o,Nne(Rne));var i=One(t,function(r,a,s){var c=Gg(o,function(u){return u(r)});return{criteria:c,index:++n,value:r}});return Fne(i,function(r,a){return Ane(r,a,e)})}DE.exports=Vne});var FE=v((Nye,OE)=>{"use strict";var zne=$h(),Hne=PE(),qne=Da(),RE=Oa(),Gne=qne(function(t,o){if(t==null)return[];var e=o.length;return e>1&&RE(t,o[0],o[1])?o=[]:e>2&&RE(o[0],o[1],o[2])&&(o=[o[0]]),Hne(t,zne(o,1),[])});OE.exports=Gne});var AE=v((Aye,NE)=>{"use strict";var jne=hg(),Une=0;function $ne(t){var o=++Une;return jne(t)+o}NE.exports=$ne});var BE=v((Lye,LE)=>{"use strict";function Wne(t,o,e){for(var n=-1,i=t.length,r=o.length,a={};++n<i;){var s=n<r?o[n]:void 0;e(a,t[n],s)}return a}LE.exports=Wne});var zE=v((Bye,VE)=>{"use strict";var Kne=ga(),Yne=BE();function Xne(t,o){return Yne(t||[],o||[],Kne)}VE.exports=Xne});var et=v((Vye,HE)=>{"use strict";var ef;if(typeof no=="function")try{ef={cloneDeep:Qk(),constant:Vh(),defaults:nI(),each:ig(),filter:gg(),find:yI(),flatten:Bg(),forEach:ng(),forIn:wI(),has:bg(),isUndefined:vg(),last:SI(),map:Cg(),mapValues:II(),max:RI(),merge:QI(),min:tE(),minBy:iE(),now:rE(),pick:_E(),range:xE(),reduce:xg(),sortBy:FE(),uniqueId:AE(),values:Dg(),zipObject:zE()}}catch{}ef||(ef=window._);HE.exports=ef});var jE=v((Hye,GE)=>{"use strict";GE.exports=tf;function tf(){var t={};t._next=t._prev=t,this._sentinel=t}tf.prototype.dequeue=function(){var t=this._sentinel,o=t._prev;if(o!==t)return qE(o),o};tf.prototype.enqueue=function(t){var o=this._sentinel;t._prev&&t._next&&qE(t),t._next=o._next,o._next._prev=t,o._next=t,t._prev=o};tf.prototype.toString=function(){for(var t=[],o=this._sentinel,e=o._prev;e!==o;)t.push(JSON.stringify(e,Zne)),e=e._prev;return"["+t.join(", ")+"]"};function qE(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Zne(t,o){if(t!=="_next"&&t!=="_prev")return o}});var $E=v((qye,UE)=>{"use strict";var qn=et(),Qne=cn().Graph,Jne=jE();UE.exports=tie;var eie=qn.constant(1);function tie(t,o){if(t.nodeCount()<=1)return[];var e=iie(t,o||eie),n=nie(e.graph,e.buckets,e.zeroIdx);return qn.flatten(qn.map(n,function(i){return t.outEdges(i.v,i.w)}),!0)}function nie(t,o,e){for(var n=[],i=o[o.length-1],r=o[0],a;t.nodeCount();){for(;a=r.dequeue();)jg(t,o,e,a);for(;a=i.dequeue();)jg(t,o,e,a);if(t.nodeCount()){for(var s=o.length-2;s>0;--s)if(a=o[s].dequeue(),a){n=n.concat(jg(t,o,e,a,!0));break}}}return n}function jg(t,o,e,n,i){var r=i?[]:void 0;return qn.forEach(t.inEdges(n.v),function(a){var s=t.edge(a),c=t.node(a.v);i&&r.push({v:a.v,w:a.w}),c.out-=s,Ug(o,e,c)}),qn.forEach(t.outEdges(n.v),function(a){var s=t.edge(a),c=a.w,u=t.node(c);u.in-=s,Ug(o,e,u)}),t.removeNode(n.v),r}function iie(t,o){var e=new Qne,n=0,i=0;qn.forEach(t.nodes(),function(s){e.setNode(s,{v:s,in:0,out:0})}),qn.forEach(t.edges(),function(s){var c=e.edge(s.v,s.w)||0,u=o(s),h=c+u;e.setEdge(s.v,s.w,h),i=Math.max(i,e.node(s.v).out+=u),n=Math.max(n,e.node(s.w).in+=u)});var r=qn.range(i+n+3).map(function(){return new Jne}),a=n+1;return qn.forEach(e.nodes(),function(s){Ug(r,a,e.node(s))}),{graph:e,buckets:r,zeroIdx:a}}function Ug(t,o,e){e.out?e.in?t[e.out-e.in+o].enqueue(e):t[t.length-1].enqueue(e):t[0].enqueue(e)}});var KE=v((Gye,WE)=>{"use strict";var eo=et(),oie=$E();WE.exports={run:rie,undo:sie};function rie(t){var o=t.graph().acyclicer==="greedy"?oie(t,e(t)):aie(t);eo.forEach(o,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,eo.uniqueId("rev"))});function e(n){return function(i){return n.edge(i).weight}}}function aie(t){var o=[],e={},n={};function i(r){eo.has(n,r)||(n[r]=!0,e[r]=!0,eo.forEach(t.outEdges(r),function(a){eo.has(e,a.w)?o.push(a):i(a.w)}),delete e[r])}return eo.forEach(t.nodes(),i),o}function sie(t){eo.forEach(t.edges(),function(o){var e=t.edge(o);if(e.reversed){t.removeEdge(o);var n=e.forwardName;delete e.reversed,delete e.forwardName,t.setEdge(o.w,o.v,e,n)}})}});var Nt=v((jye,QE)=>{"use strict";var Ae=et(),YE=cn().Graph;QE.exports={addDummyNode:XE,simplify:lie,asNonCompoundGraph:cie,successorWeights:die,predecessorWeights:uie,intersectRect:pie,buildLayerMatrix:hie,normalizeRanks:fie,removeEmptyRanks:mie,addBorderNode:_ie,maxRank:ZE,partition:gie,time:bie,notime:vie};function XE(t,o,e,n){var i;do i=Ae.uniqueId(n);while(t.hasNode(i));return e.dummy=o,t.setNode(i,e),i}function lie(t){var o=new YE().setGraph(t.graph());return Ae.forEach(t.nodes(),function(e){o.setNode(e,t.node(e))}),Ae.forEach(t.edges(),function(e){var n=o.edge(e.v,e.w)||{weight:0,minlen:1},i=t.edge(e);o.setEdge(e.v,e.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),o}function cie(t){var o=new YE({multigraph:t.isMultigraph()}).setGraph(t.graph());return Ae.forEach(t.nodes(),function(e){t.children(e).length||o.setNode(e,t.node(e))}),Ae.forEach(t.edges(),function(e){o.setEdge(e,t.edge(e))}),o}function die(t){var o=Ae.map(t.nodes(),function(e){var n={};return Ae.forEach(t.outEdges(e),function(i){n[i.w]=(n[i.w]||0)+t.edge(i).weight}),n});return Ae.zipObject(t.nodes(),o)}function uie(t){var o=Ae.map(t.nodes(),function(e){var n={};return Ae.forEach(t.inEdges(e),function(i){n[i.v]=(n[i.v]||0)+t.edge(i).weight}),n});return Ae.zipObject(t.nodes(),o)}function pie(t,o){var e=t.x,n=t.y,i=o.x-e,r=o.y-n,a=t.width/2,s=t.height/2;if(!i&&!r)throw new Error("Not possible to find intersection inside of the rectangle");var c,u;return Math.abs(r)*a>Math.abs(i)*s?(r<0&&(s=-s),c=s*i/r,u=s):(i<0&&(a=-a),c=a,u=a*r/i),{x:e+c,y:n+u}}function hie(t){var o=Ae.map(Ae.range(ZE(t)+1),function(){return[]});return Ae.forEach(t.nodes(),function(e){var n=t.node(e),i=n.rank;Ae.isUndefined(i)||(o[i][n.order]=e)}),o}function fie(t){var o=Ae.min(Ae.map(t.nodes(),function(e){return t.node(e).rank}));Ae.forEach(t.nodes(),function(e){var n=t.node(e);Ae.has(n,"rank")&&(n.rank-=o)})}function mie(t){var o=Ae.min(Ae.map(t.nodes(),function(r){return t.node(r).rank})),e=[];Ae.forEach(t.nodes(),function(r){var a=t.node(r).rank-o;e[a]||(e[a]=[]),e[a].push(r)});var n=0,i=t.graph().nodeRankFactor;Ae.forEach(e,function(r,a){Ae.isUndefined(r)&&a%i!==0?--n:n&&Ae.forEach(r,function(s){t.node(s).rank+=n})})}function _ie(t,o,e,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=e,i.order=n),XE(t,"border",i,o)}function ZE(t){return Ae.max(Ae.map(t.nodes(),function(o){var e=t.node(o).rank;if(!Ae.isUndefined(e))return e}))}function gie(t,o){var e={lhs:[],rhs:[]};return Ae.forEach(t,function(n){o(n)?e.lhs.push(n):e.rhs.push(n)}),e}function bie(t,o){var e=Ae.now();try{return o()}finally{console.log(t+" time: "+(Ae.now()-e)+"ms")}}function vie(t,o){return o()}});var tM=v((Uye,eM)=>{"use strict";var JE=et(),yie=Nt();eM.exports={run:Cie,undo:wie};function Cie(t){t.graph().dummyChains=[],JE.forEach(t.edges(),function(o){xie(t,o)})}function xie(t,o){var e=o.v,n=t.node(e).rank,i=o.w,r=t.node(i).rank,a=o.name,s=t.edge(o),c=s.labelRank;if(r!==n+1){t.removeEdge(o);var u,h,g;for(g=0,++n;n<r;++g,++n)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:o,rank:n},u=yie.addDummyNode(t,"edge",h,"_d"),n===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(e,u,{weight:s.weight},a),g===0&&t.graph().dummyChains.push(u),e=u;t.setEdge(e,i,{weight:s.weight},a)}}function wie(t){JE.forEach(t.graph().dummyChains,function(o){var e=t.node(o),n=e.edgeLabel,i;for(t.setEdge(e.edgeObj,n);e.dummy;)i=t.successors(o)[0],t.removeNode(o),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),o=i,e=t.node(o)})}});var Fa=v(($ye,nM)=>{"use strict";var nf=et();nM.exports={longestPath:Tie,slack:Sie};function Tie(t){var o={};function e(n){var i=t.node(n);if(nf.has(o,n))return i.rank;o[n]=!0;var r=nf.min(nf.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),i.rank=r}nf.forEach(t.sources(),e)}function Sie(t,o){return t.node(o.w).rank-t.node(o.v).rank-t.edge(o).minlen}});var $g=v((Wye,iM)=>{"use strict";var of=et(),kie=cn().Graph,rf=Fa().slack;iM.exports=Iie;function Iie(t){var o=new kie({directed:!1}),e=t.nodes()[0],n=t.nodeCount();o.setNode(e,{});for(var i,r;Eie(o,t)<n;)i=Mie(o,t),r=o.hasNode(i.v)?rf(t,i):-rf(t,i),Die(o,t,r);return o}function Eie(t,o){function e(n){of.forEach(o.nodeEdges(n),function(i){var r=i.v,a=n===r?i.w:r;!t.hasNode(a)&&!rf(o,i)&&(t.setNode(a,{}),t.setEdge(n,a,{}),e(a))})}return of.forEach(t.nodes(),e),t.nodeCount()}function Mie(t,o){return of.minBy(o.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return rf(o,e)})}function Die(t,o,e){of.forEach(t.nodes(),function(n){o.node(n).rank+=e})}});var uM=v((Kye,dM)=>{"use strict";var Gn=et(),Pie=$g(),Rie=Fa().slack,Oie=Fa().longestPath,Fie=cn().alg.preorder,Nie=cn().alg.postorder,Aie=Nt().simplify;dM.exports=to;to.initLowLimValues=Kg;to.initCutValues=Wg;to.calcCutValue=rM;to.leaveEdge=sM;to.enterEdge=lM;to.exchangeEdges=cM;function to(t){t=Aie(t),Oie(t);var o=Pie(t);Kg(o),Wg(o,t);for(var e,n;e=sM(o);)n=lM(o,t,e),cM(o,t,e,n)}function Wg(t,o){var e=Nie(t,t.nodes());e=e.slice(0,e.length-1),Gn.forEach(e,function(n){Lie(t,o,n)})}function Lie(t,o,e){var n=t.node(e),i=n.parent;t.edge(e,i).cutvalue=rM(t,o,e)}function rM(t,o,e){var n=t.node(e),i=n.parent,r=!0,a=o.edge(e,i),s=0;return a||(r=!1,a=o.edge(i,e)),s=a.weight,Gn.forEach(o.nodeEdges(e),function(c){var u=c.v===e,h=u?c.w:c.v;if(h!==i){var g=u===r,C=o.edge(c).weight;if(s+=g?C:-C,Vie(t,e,h)){var k=t.edge(e,h).cutvalue;s+=g?-k:k}}}),s}function Kg(t,o){arguments.length<2&&(o=t.nodes()[0]),aM(t,{},1,o)}function aM(t,o,e,n,i){var r=e,a=t.node(n);return o[n]=!0,Gn.forEach(t.neighbors(n),function(s){Gn.has(o,s)||(e=aM(t,o,e,s,n))}),a.low=r,a.lim=e++,i?a.parent=i:delete a.parent,e}function sM(t){return Gn.find(t.edges(),function(o){return t.edge(o).cutvalue<0})}function lM(t,o,e){var n=e.v,i=e.w;o.hasEdge(n,i)||(n=e.w,i=e.v);var r=t.node(n),a=t.node(i),s=r,c=!1;r.lim>a.lim&&(s=a,c=!0);var u=Gn.filter(o.edges(),function(h){return c===oM(t,t.node(h.v),s)&&c!==oM(t,t.node(h.w),s)});return Gn.minBy(u,function(h){return Rie(o,h)})}function cM(t,o,e,n){var i=e.v,r=e.w;t.removeEdge(i,r),t.setEdge(n.v,n.w,{}),Kg(t),Wg(t,o),Bie(t,o)}function Bie(t,o){var e=Gn.find(t.nodes(),function(i){return!o.node(i).parent}),n=Fie(t,e);n=n.slice(1),Gn.forEach(n,function(i){var r=t.node(i).parent,a=o.edge(i,r),s=!1;a||(a=o.edge(r,i),s=!0),o.node(i).rank=o.node(r).rank+(s?a.minlen:-a.minlen)})}function Vie(t,o,e){return t.hasEdge(o,e)}function oM(t,o,e){return e.low<=o.lim&&o.lim<=e.lim}});var mM=v((Yye,fM)=>{"use strict";var zie=Fa(),hM=zie.longestPath,Hie=$g(),qie=uM();fM.exports=Gie;function Gie(t){switch(t.graph().ranker){case"network-simplex":pM(t);break;case"tight-tree":Uie(t);break;case"longest-path":jie(t);break;default:pM(t)}}var jie=hM;function Uie(t){hM(t),Hie(t)}function pM(t){qie(t)}});var gM=v((Xye,_M)=>{"use strict";var Yg=et();_M.exports=$ie;function $ie(t){var o=Kie(t);Yg.forEach(t.graph().dummyChains,function(e){for(var n=t.node(e),i=n.edgeObj,r=Wie(t,o,i.v,i.w),a=r.path,s=r.lca,c=0,u=a[c],h=!0;e!==i.w;){if(n=t.node(e),h){for(;(u=a[c])!==s&&t.node(u).maxRank<n.rank;)c++;u===s&&(h=!1)}if(!h){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 Wie(t,o,e,n){var i=[],r=[],a=Math.min(o[e].low,o[n].low),s=Math.max(o[e].lim,o[n].lim),c,u;c=e;do c=t.parent(c),i.push(c);while(c&&(o[c].low>a||s>o[c].lim));for(u=c,c=n;(c=t.parent(c))!==u;)r.push(c);return{path:i.concat(r.reverse()),lca:u}}function Kie(t){var o={},e=0;function n(i){var r=e;Yg.forEach(t.children(i),n),o[i]={low:r,lim:e++}}return Yg.forEach(t.children(),n),o}});var yM=v((Zye,vM)=>{"use strict";var jn=et(),Xg=Nt();vM.exports={run:Yie,cleanup:Qie};function Yie(t){var o=Xg.addDummyNode(t,"root",{},"_root"),e=Xie(t),n=jn.max(jn.values(e))-1,i=2*n+1;t.graph().nestingRoot=o,jn.forEach(t.edges(),function(a){t.edge(a).minlen*=i});var r=Zie(t)+1;jn.forEach(t.children(),function(a){bM(t,o,i,r,n,e,a)}),t.graph().nodeRankFactor=i}function bM(t,o,e,n,i,r,a){var s=t.children(a);if(!s.length){a!==o&&t.setEdge(o,a,{weight:0,minlen:e});return}var c=Xg.addBorderNode(t,"_bt"),u=Xg.addBorderNode(t,"_bb"),h=t.node(a);t.setParent(c,a),h.borderTop=c,t.setParent(u,a),h.borderBottom=u,jn.forEach(s,function(g){bM(t,o,e,n,i,r,g);var C=t.node(g),k=C.borderTop?C.borderTop:g,I=C.borderBottom?C.borderBottom:g,N=C.borderTop?n:2*n,q=k!==I?1:i-r[a]+1;t.setEdge(c,k,{weight:N,minlen:q,nestingEdge:!0}),t.setEdge(I,u,{weight:N,minlen:q,nestingEdge:!0})}),t.parent(a)||t.setEdge(o,c,{weight:0,minlen:i+r[a]})}function Xie(t){var o={};function e(n,i){var r=t.children(n);r&&r.length&&jn.forEach(r,function(a){e(a,i+1)}),o[n]=i}return jn.forEach(t.children(),function(n){e(n,1)}),o}function Zie(t){return jn.reduce(t.edges(),function(o,e){return o+t.edge(e).weight},0)}function Qie(t){var o=t.graph();t.removeNode(o.nestingRoot),delete o.nestingRoot,jn.forEach(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}});var wM=v((Qye,xM)=>{"use strict";var Zg=et(),Jie=Nt();xM.exports=eoe;function eoe(t){function o(e){var n=t.children(e),i=t.node(e);if(n.length&&Zg.forEach(n,o),Zg.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var r=i.minRank,a=i.maxRank+1;r<a;++r)CM(t,"borderLeft","_bl",e,i,r),CM(t,"borderRight","_br",e,i,r)}}Zg.forEach(t.children(),o)}function CM(t,o,e,n,i,r){var a={width:0,height:0,rank:r,borderType:o},s=i[o][r-1],c=Jie.addDummyNode(t,"border",a,e);i[o][r]=c,t.setParent(c,n),s&&t.setEdge(s,c,{weight:1})}});var IM=v((Jye,kM)=>{"use strict";var Fn=et();kM.exports={adjust:toe,undo:noe};function toe(t){var o=t.graph().rankdir.toLowerCase();(o==="lr"||o==="rl")&&SM(t)}function noe(t){var o=t.graph().rankdir.toLowerCase();(o==="bt"||o==="rl")&&ioe(t),(o==="lr"||o==="rl")&&(ooe(t),SM(t))}function SM(t){Fn.forEach(t.nodes(),function(o){TM(t.node(o))}),Fn.forEach(t.edges(),function(o){TM(t.edge(o))})}function TM(t){var o=t.width;t.width=t.height,t.height=o}function ioe(t){Fn.forEach(t.nodes(),function(o){Qg(t.node(o))}),Fn.forEach(t.edges(),function(o){var e=t.edge(o);Fn.forEach(e.points,Qg),Fn.has(e,"y")&&Qg(e)})}function Qg(t){t.y=-t.y}function ooe(t){Fn.forEach(t.nodes(),function(o){Jg(t.node(o))}),Fn.forEach(t.edges(),function(o){var e=t.edge(o);Fn.forEach(e.points,Jg),Fn.has(e,"x")&&Jg(e)})}function Jg(t){var o=t.x;t.x=t.y,t.y=o}});var MM=v((eCe,EM)=>{"use strict";var Un=et();EM.exports=roe;function roe(t){var o={},e=Un.filter(t.nodes(),function(s){return!t.children(s).length}),n=Un.max(Un.map(e,function(s){return t.node(s).rank})),i=Un.map(Un.range(n+1),function(){return[]});function r(s){if(!Un.has(o,s)){o[s]=!0;var c=t.node(s);i[c.rank].push(s),Un.forEach(t.successors(s),r)}}var a=Un.sortBy(e,function(s){return t.node(s).rank});return Un.forEach(a,r),i}});var PM=v((tCe,DM)=>{"use strict";var vi=et();DM.exports=aoe;function aoe(t,o){for(var e=0,n=1;n<o.length;++n)e+=soe(t,o[n-1],o[n]);return e}function soe(t,o,e){for(var n=vi.zipObject(e,vi.map(e,function(u,h){return h})),i=vi.flatten(vi.map(o,function(u){return vi.sortBy(vi.map(t.outEdges(u),function(h){return{pos:n[h.w],weight:t.edge(h).weight}}),"pos")}),!0),r=1;r<e.length;)r<<=1;var a=2*r-1;r-=1;var s=vi.map(new Array(a),function(){return 0}),c=0;return vi.forEach(i.forEach(function(u){var h=u.pos+r;s[h]+=u.weight;for(var g=0;h>0;)h%2&&(g+=s[h+1]),h=h-1>>1,s[h]+=u.weight;c+=u.weight*g})),c}});var FM=v((nCe,OM)=>{"use strict";var RM=et();OM.exports=loe;function loe(t,o){return RM.map(o,function(e){var n=t.inEdges(e);if(n.length){var i=RM.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:i.sum/i.weight,weight:i.weight}}else return{v:e}})}});var AM=v((iCe,NM)=>{"use strict";var Zt=et();NM.exports=coe;function coe(t,o){var e={};Zt.forEach(t,function(i,r){var a=e[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:r};Zt.isUndefined(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),Zt.forEach(o.edges(),function(i){var r=e[i.v],a=e[i.w];!Zt.isUndefined(r)&&!Zt.isUndefined(a)&&(a.indegree++,r.out.push(e[i.w]))});var n=Zt.filter(e,function(i){return!i.indegree});return doe(n)}function doe(t){var o=[];function e(r){return function(a){a.merged||(Zt.isUndefined(a.barycenter)||Zt.isUndefined(r.barycenter)||a.barycenter>=r.barycenter)&&uoe(r,a)}}function n(r){return function(a){a.in.push(r),--a.indegree===0&&t.push(a)}}for(;t.length;){var i=t.pop();o.push(i),Zt.forEach(i.in.reverse(),e(i)),Zt.forEach(i.out,n(i))}return Zt.map(Zt.filter(o,function(r){return!r.merged}),function(r){return Zt.pick(r,["vs","i","barycenter","weight"])})}function uoe(t,o){var e=0,n=0;t.weight&&(e+=t.barycenter*t.weight,n+=t.weight),o.weight&&(e+=o.barycenter*o.weight,n+=o.weight),t.vs=o.vs.concat(t.vs),t.barycenter=e/n,t.weight=n,t.i=Math.min(o.i,t.i),o.merged=!0}});var VM=v((oCe,BM)=>{"use strict";var Na=et(),poe=Nt();BM.exports=hoe;function hoe(t,o){var e=poe.partition(t,function(h){return Na.has(h,"barycenter")}),n=e.lhs,i=Na.sortBy(e.rhs,function(h){return-h.i}),r=[],a=0,s=0,c=0;n.sort(foe(!!o)),c=LM(r,i,c),Na.forEach(n,function(h){c+=h.vs.length,r.push(h.vs),a+=h.barycenter*h.weight,s+=h.weight,c=LM(r,i,c)});var u={vs:Na.flatten(r,!0)};return s&&(u.barycenter=a/s,u.weight=s),u}function LM(t,o,e){for(var n;o.length&&(n=Na.last(o)).i<=e;)o.pop(),t.push(n.vs),e++;return e}function foe(t){return function(o,e){return o.barycenter<e.barycenter?-1:o.barycenter>e.barycenter?1:t?e.i-o.i:o.i-e.i}}});var qM=v((rCe,HM)=>{"use strict";var yi=et(),moe=FM(),_oe=AM(),goe=VM();HM.exports=zM;function zM(t,o,e,n){var i=t.children(o),r=t.node(o),a=r?r.borderLeft:void 0,s=r?r.borderRight:void 0,c={};a&&(i=yi.filter(i,function(I){return I!==a&&I!==s}));var u=moe(t,i);yi.forEach(u,function(I){if(t.children(I.v).length){var N=zM(t,I.v,e,n);c[I.v]=N,yi.has(N,"barycenter")&&voe(I,N)}});var h=_oe(u,e);boe(h,c);var g=goe(h,n);if(a&&(g.vs=yi.flatten([a,g.vs,s],!0),t.predecessors(a).length)){var C=t.node(t.predecessors(a)[0]),k=t.node(t.predecessors(s)[0]);yi.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+C.order+k.order)/(g.weight+2),g.weight+=2}return g}function boe(t,o){yi.forEach(t,function(e){e.vs=yi.flatten(e.vs.map(function(n){return o[n]?o[n].vs:n}),!0)})}function voe(t,o){yi.isUndefined(t.barycenter)?(t.barycenter=o.barycenter,t.weight=o.weight):(t.barycenter=(t.barycenter*t.weight+o.barycenter*o.weight)/(t.weight+o.weight),t.weight+=o.weight)}});var jM=v((aCe,GM)=>{"use strict";var Aa=et(),yoe=cn().Graph;GM.exports=Coe;function Coe(t,o,e){var n=xoe(t),i=new yoe({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(r){return t.node(r)});return Aa.forEach(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===o||a.minRank<=o&&o<=a.maxRank)&&(i.setNode(r),i.setParent(r,s||n),Aa.forEach(t[e](r),function(c){var u=c.v===r?c.w:c.v,h=i.edge(u,r),g=Aa.isUndefined(h)?0:h.weight;i.setEdge(u,r,{weight:t.edge(c).weight+g})}),Aa.has(a,"minRank")&&i.setNode(r,{borderLeft:a.borderLeft[o],borderRight:a.borderRight[o]}))}),i}function xoe(t){for(var o;t.hasNode(o=Aa.uniqueId("_root")););return o}});var $M=v((sCe,UM)=>{"use strict";var woe=et();UM.exports=Toe;function Toe(t,o,e){var n={},i;woe.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=i,i=a),c&&c!==a){o.setEdge(c,a);return}a=s}})}});var ZM=v((lCe,XM)=>{"use strict";var Ci=et(),Soe=MM(),koe=PM(),Ioe=qM(),Eoe=jM(),Moe=$M(),Doe=cn().Graph,WM=Nt();XM.exports=Poe;function Poe(t){var o=WM.maxRank(t),e=KM(t,Ci.range(1,o+1),"inEdges"),n=KM(t,Ci.range(o-1,-1,-1),"outEdges"),i=Soe(t);YM(t,i);for(var r=Number.POSITIVE_INFINITY,a,s=0,c=0;c<4;++s,++c){Roe(s%2?e:n,s%4>=2),i=WM.buildLayerMatrix(t);var u=koe(t,i);u<r&&(c=0,a=Ci.cloneDeep(i),r=u)}YM(t,a)}function KM(t,o,e){return Ci.map(o,function(n){return Eoe(t,n,e)})}function Roe(t,o){var e=new Doe;Ci.forEach(t,function(n){var i=n.graph().root,r=Ioe(n,i,e,o);Ci.forEach(r.vs,function(a,s){n.node(a).order=s}),Moe(n,e,r.vs)})}function YM(t,o){Ci.forEach(o,function(e){Ci.forEach(e,function(n,i){t.node(n).order=i})})}});var sD=v((cCe,aD)=>{"use strict";var ye=et(),Ooe=cn().Graph,Foe=Nt();aD.exports={positionX:Loe,findType1Conflicts:QM,findType2Conflicts:JM,addConflict:e0,hasConflict:eD,verticalAlignment:tD,horizontalCompaction:nD,alignCoordinates:oD,findSmallestWidthAlignment:iD,balance:rD};function QM(t,o){var e={};function n(i,r){var a=0,s=0,c=i.length,u=ye.last(r);return ye.forEach(r,function(h,g){var C=Noe(t,h),k=C?t.node(C).order:c;(C||h===u)&&(ye.forEach(r.slice(s,g+1),function(I){ye.forEach(t.predecessors(I),function(N){var q=t.node(N),Y=q.order;(Y<a||k<Y)&&!(q.dummy&&t.node(I).dummy)&&e0(e,N,I)})}),s=g+1,a=k)}),r}return ye.reduce(o,n),e}function JM(t,o){var e={};function n(r,a,s,c,u){var h;ye.forEach(ye.range(a,s),function(g){h=r[g],t.node(h).dummy&&ye.forEach(t.predecessors(h),function(C){var k=t.node(C);k.dummy&&(k.order<c||k.order>u)&&e0(e,C,h)})})}function i(r,a){var s=-1,c,u=0;return ye.forEach(a,function(h,g){if(t.node(h).dummy==="border"){var C=t.predecessors(h);C.length&&(c=t.node(C[0]).order,n(a,u,g,s,c),u=g,s=c)}n(a,u,a.length,c,r.length)}),a}return ye.reduce(o,i),e}function Noe(t,o){if(t.node(o).dummy)return ye.find(t.predecessors(o),function(e){return t.node(e).dummy})}function e0(t,o,e){if(o>e){var n=o;o=e,e=n}var i=t[o];i||(t[o]=i={}),i[e]=!0}function eD(t,o,e){if(o>e){var n=o;o=e,e=n}return ye.has(t[o],e)}function tD(t,o,e,n){var i={},r={},a={};return ye.forEach(o,function(s){ye.forEach(s,function(c,u){i[c]=c,r[c]=c,a[c]=u})}),ye.forEach(o,function(s){var c=-1;ye.forEach(s,function(u){var h=n(u);if(h.length){h=ye.sortBy(h,function(N){return a[N]});for(var g=(h.length-1)/2,C=Math.floor(g),k=Math.ceil(g);C<=k;++C){var I=h[C];r[u]===u&&c<a[I]&&!eD(e,u,I)&&(r[I]=u,r[u]=i[u]=i[I],c=a[I])}}})}),{root:i,align:r}}function nD(t,o,e,n,i){var r={},a=Aoe(t,o,e,i),s=i?"borderLeft":"borderRight";function c(g,C){for(var k=a.nodes(),I=k.pop(),N={};I;)N[I]?g(I):(N[I]=!0,k.push(I),k=k.concat(C(I))),I=k.pop()}function u(g){r[g]=a.inEdges(g).reduce(function(C,k){return Math.max(C,r[k.v]+a.edge(k))},0)}function h(g){var C=a.outEdges(g).reduce(function(I,N){return Math.min(I,r[N.w]-a.edge(N))},Number.POSITIVE_INFINITY),k=t.node(g);C!==Number.POSITIVE_INFINITY&&k.borderType!==s&&(r[g]=Math.max(r[g],C))}return c(u,a.predecessors.bind(a)),c(h,a.successors.bind(a)),ye.forEach(n,function(g){r[g]=r[e[g]]}),r}function Aoe(t,o,e,n){var i=new Ooe,r=t.graph(),a=Boe(r.nodesep,r.edgesep,n);return ye.forEach(o,function(s){var c;ye.forEach(s,function(u){var h=e[u];if(i.setNode(h),c){var g=e[c],C=i.edge(g,h);i.setEdge(g,h,Math.max(a(t,u,c),C||0))}c=u})}),i}function iD(t,o){return ye.minBy(ye.values(o),function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return ye.forIn(e,function(r,a){var s=Voe(t,a)/2;n=Math.max(r+s,n),i=Math.min(r-s,i)}),n-i})}function oD(t,o){var e=ye.values(o),n=ye.min(e),i=ye.max(e);ye.forEach(["u","d"],function(r){ye.forEach(["l","r"],function(a){var s=r+a,c=t[s],u;if(c!==o){var h=ye.values(c);u=a==="l"?n-ye.min(h):i-ye.max(h),u&&(t[s]=ye.mapValues(c,function(g){return g+u}))}})})}function rD(t,o){return ye.mapValues(t.ul,function(e,n){if(o)return t[o.toLowerCase()][n];var i=ye.sortBy(ye.map(t,n));return(i[1]+i[2])/2})}function Loe(t){var o=Foe.buildLayerMatrix(t),e=ye.merge(QM(t,o),JM(t,o)),n={},i;ye.forEach(["u","d"],function(a){i=a==="u"?o:ye.values(o).reverse(),ye.forEach(["l","r"],function(s){s==="r"&&(i=ye.map(i,function(g){return ye.values(g).reverse()}));var c=(a==="u"?t.predecessors:t.successors).bind(t),u=tD(t,i,e,c),h=nD(t,i,u.root,u.align,s==="r");s==="r"&&(h=ye.mapValues(h,function(g){return-g})),n[a+s]=h})});var r=iD(t,n);return oD(n,r),rD(n,t.graph().align)}function Boe(t,o,e){return function(n,i,r){var a=n.node(i),s=n.node(r),c=0,u;if(c+=a.width/2,ye.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?o:t)/2,c+=(s.dummy?o:t)/2,c+=s.width/2,ye.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 Voe(t,o){return t.node(o).width}});var dD=v((dCe,cD)=>{"use strict";var La=et(),lD=Nt(),zoe=sD().positionX;cD.exports=Hoe;function Hoe(t){t=lD.asNonCompoundGraph(t),qoe(t),La.forEach(zoe(t),function(o,e){t.node(e).x=o})}function qoe(t){var o=lD.buildLayerMatrix(t),e=t.graph().ranksep,n=0;La.forEach(o,function(i){var r=La.max(La.map(i,function(a){return t.node(a).height}));La.forEach(i,function(a){t.node(a).y=n+r/2}),n+=r+e})}});var _D=v((uCe,mD)=>{"use strict";var Me=et(),uD=KE(),pD=tM(),Goe=mM(),joe=Nt().normalizeRanks,Uoe=gM(),$oe=Nt().removeEmptyRanks,hD=yM(),Woe=wM(),fD=IM(),Koe=ZM(),Yoe=dD(),xi=Nt(),Xoe=cn().Graph;mD.exports=Zoe;function Zoe(t,o){var e=o&&o.debugTiming?xi.time:xi.notime;e("layout",function(){var n=e(" buildLayoutGraph",function(){return lre(t)});e(" runLayout",function(){Qoe(n,e)}),e(" updateInputGraph",function(){Joe(t,n)})})}function Qoe(t,o){o(" makeSpaceForEdgeLabels",function(){cre(t)}),o(" removeSelfEdges",function(){bre(t)}),o(" acyclic",function(){uD.run(t)}),o(" nestingGraph.run",function(){hD.run(t)}),o(" rank",function(){Goe(xi.asNonCompoundGraph(t))}),o(" injectEdgeLabelProxies",function(){dre(t)}),o(" removeEmptyRanks",function(){$oe(t)}),o(" nestingGraph.cleanup",function(){hD.cleanup(t)}),o(" normalizeRanks",function(){joe(t)}),o(" assignRankMinMax",function(){ure(t)}),o(" removeEdgeLabelProxies",function(){pre(t)}),o(" normalize.run",function(){pD.run(t)}),o(" parentDummyChains",function(){Uoe(t)}),o(" addBorderSegments",function(){Woe(t)}),o(" order",function(){Koe(t)}),o(" insertSelfEdges",function(){vre(t)}),o(" adjustCoordinateSystem",function(){fD.adjust(t)}),o(" position",function(){Yoe(t)}),o(" positionSelfEdges",function(){yre(t)}),o(" removeBorderNodes",function(){gre(t)}),o(" normalize.undo",function(){pD.undo(t)}),o(" fixupEdgeLabelCoords",function(){mre(t)}),o(" undoCoordinateSystem",function(){fD.undo(t)}),o(" translateGraph",function(){hre(t)}),o(" assignNodeIntersects",function(){fre(t)}),o(" reversePoints",function(){_re(t)}),o(" acyclic.undo",function(){uD.undo(t)})}function Joe(t,o){Me.forEach(t.nodes(),function(e){var n=t.node(e),i=o.node(e);n&&(n.x=i.x,n.y=i.y,o.children(e).length&&(n.width=i.width,n.height=i.height))}),Me.forEach(t.edges(),function(e){var n=t.edge(e),i=o.edge(e);n.points=i.points,Me.has(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=o.graph().width,t.graph().height=o.graph().height}var ere=["nodesep","edgesep","ranksep","marginx","marginy"],tre={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},nre=["acyclicer","ranker","rankdir","align"],ire=["width","height"],ore={width:0,height:0},rre=["minlen","weight","width","height","labeloffset"],are={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sre=["labelpos"];function lre(t){var o=new Xoe({multigraph:!0,compound:!0}),e=n0(t.graph());return o.setGraph(Me.merge({},tre,t0(e,ere),Me.pick(e,nre))),Me.forEach(t.nodes(),function(n){var i=n0(t.node(n));o.setNode(n,Me.defaults(t0(i,ire),ore)),o.setParent(n,t.parent(n))}),Me.forEach(t.edges(),function(n){var i=n0(t.edge(n));o.setEdge(n,Me.merge({},are,t0(i,rre),Me.pick(i,sre)))}),o}function cre(t){var o=t.graph();o.ranksep/=2,Me.forEach(t.edges(),function(e){var n=t.edge(e);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(o.rankdir==="TB"||o.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function dre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);if(e.width&&e.height){var n=t.node(o.v),i=t.node(o.w),r={rank:(i.rank-n.rank)/2+n.rank,e:o};xi.addDummyNode(t,"edge-proxy",r,"_ep")}})}function ure(t){var o=0;Me.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,o=Me.max(o,n.maxRank))}),t.graph().maxRank=o}function pre(t){Me.forEach(t.nodes(),function(o){var e=t.node(o);e.dummy==="edge-proxy"&&(t.edge(e.e).labelRank=e.rank,t.removeNode(o))})}function hre(t){var o=Number.POSITIVE_INFINITY,e=0,n=Number.POSITIVE_INFINITY,i=0,r=t.graph(),a=r.marginx||0,s=r.marginy||0;function c(u){var h=u.x,g=u.y,C=u.width,k=u.height;o=Math.min(o,h-C/2),e=Math.max(e,h+C/2),n=Math.min(n,g-k/2),i=Math.max(i,g+k/2)}Me.forEach(t.nodes(),function(u){c(t.node(u))}),Me.forEach(t.edges(),function(u){var h=t.edge(u);Me.has(h,"x")&&c(h)}),o-=a,n-=s,Me.forEach(t.nodes(),function(u){var h=t.node(u);h.x-=o,h.y-=n}),Me.forEach(t.edges(),function(u){var h=t.edge(u);Me.forEach(h.points,function(g){g.x-=o,g.y-=n}),Me.has(h,"x")&&(h.x-=o),Me.has(h,"y")&&(h.y-=n)}),r.width=e-o+a,r.height=i-n+s}function fre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o),n=t.node(o.v),i=t.node(o.w),r,a;e.points?(r=e.points[0],a=e.points[e.points.length-1]):(e.points=[],r=i,a=n),e.points.unshift(xi.intersectRect(n,r)),e.points.push(xi.intersectRect(i,a))})}function mre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);if(Me.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 _re(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);e.reversed&&e.points.reverse()})}function gre(t){Me.forEach(t.nodes(),function(o){if(t.children(o).length){var e=t.node(o),n=t.node(e.borderTop),i=t.node(e.borderBottom),r=t.node(Me.last(e.borderLeft)),a=t.node(Me.last(e.borderRight));e.width=Math.abs(a.x-r.x),e.height=Math.abs(i.y-n.y),e.x=r.x+e.width/2,e.y=n.y+e.height/2}}),Me.forEach(t.nodes(),function(o){t.node(o).dummy==="border"&&t.removeNode(o)})}function bre(t){Me.forEach(t.edges(),function(o){if(o.v===o.w){var e=t.node(o.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:o,label:t.edge(o)}),t.removeEdge(o)}})}function vre(t){var o=xi.buildLayerMatrix(t);Me.forEach(o,function(e){var n=0;Me.forEach(e,function(i,r){var a=t.node(i);a.order=r+n,Me.forEach(a.selfEdges,function(s){xi.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 yre(t){Me.forEach(t.nodes(),function(o){var e=t.node(o);if(e.dummy==="selfedge"){var n=t.node(e.e.v),i=n.x+n.width/2,r=n.y,a=e.x-i,s=n.height/2;t.setEdge(e.e,e.label),t.removeNode(o),e.label.points=[{x:i+2*a/3,y:r-s},{x:i+5*a/6,y:r-s},{x:i+a,y:r},{x:i+5*a/6,y:r+s},{x:i+2*a/3,y:r+s}],e.label.x=e.x,e.label.y=e.y}})}function t0(t,o){return Me.mapValues(Me.pick(t,o),Number)}function n0(t){var o={};return Me.forEach(t,function(e,n){o[n.toLowerCase()]=e}),o}});var bD=v((pCe,gD)=>{"use strict";var af=et(),Cre=Nt(),xre=cn().Graph;gD.exports={debugOrdering:wre};function wre(t){var o=Cre.buildLayerMatrix(t),e=new xre({compound:!0,multigraph:!0}).setGraph({});return af.forEach(t.nodes(),function(n){e.setNode(n,{label:n}),e.setParent(n,"layer"+t.node(n).rank)}),af.forEach(t.edges(),function(n){e.setEdge(n.v,n.w,{},n.name)}),af.forEach(o,function(n,i){var r="layer"+i;e.setNode(r,{rank:"same"}),af.reduce(n,function(a,s){return e.setEdge(a,s,{style:"invis"}),s})}),e}});var yD=v((hCe,vD)=>{"use strict";vD.exports="0.8.5"});var xD=v((fCe,CD)=>{"use strict";CD.exports={graphlib:cn(),layout:_D(),debug:bD(),util:{time:Nt().time,notime:Nt().notime},version:yD()}});var Ob={rail:{label:"Files",collapse:"Collapse files panel",expand:"Expand files panel",resize:"Resize files panel",searchPlaceholder:"Search\u2026",searchAriaLabel:"Search nodes by name or tag"}};var ps=new be("MAP_ISOLATE_INTENT",{providedIn:"root",factory:()=>({isolate:()=>{}})});var Fb=`
|
|
1
|
+
import{a as Xn,b as Zn,d as sb,e as lb,f as cb,g as hb,h as fb,i as bo}from"./chunk-GEI6INVH.js";import{A as kb,B as Ib,C as Eb,D as Jn,E as Mb,G as Db,H as Pb,I as Nf,J as Af,K as Rb,a as is,b as po,c as Y0,d as X0,e as ho,f as Z0,g as vr,h as Rf,i as Q0,j as on,k as fo,l as cs,m as mb,n as ds,o as _b,p as gb,q as bb,r as vb,s as yb,t as Cb,u as us,w as xb,x as wb,y as Tb,z as Sb}from"./chunk-HWQTV6ZL.js";import{f as Ja,i as es}from"./chunk-UBQUCSQ4.js";import{a as Qn,b as db,c as go,g as ls,h as Vt}from"./chunk-4CXAL43H.js";import"./chunk-P2DAPRK7.js";import{a as q0,b as G0,c as j0,d as U0,e as eb,f as tb,g as os,h as as,i as ss,j as nb,k as ib,l as _o,n as ob,o as Ff,p as rb,q as ab,r as ub,s as pb}from"./chunk-JXRIGHET.js";import{A as uo,B as ns,C as Te,D as $0,E as W0,F as br,G as Ee,H as K0,I as Sn,J as Ve,K as ze,L as J0,M as mo,N as we,O as Of,P as rs,Q as _n,R as kn,a as pt,c as Df,d as B0,e as Pf,f as V0,g as lo,i as bt,j as Le,k as nn,l as St,o as Yn,p as H0,q as co,r as Lt,s as Bt,t as kt,u as It,v as Bn,w as Ie,x as Tn}from"./chunk-GBKHMJ4B.js";import{f as Wn,g as M0,h as so,i as fn,j as Kn,k as Rt,l as gt,p as $t}from"./chunk-LCOYSPKE.js";import{B as Mf,Ca as z0,D as R0,F as O0,H as F0,J as ts,O as _r,T as N0,V as A0,W as L0,a as mn,b as hr,ba as gr,k as fr,l as If,m as D0,n as P0,p as Mi,t as wn,u as ut,w as Ef,z as mr}from"./chunk-4SG4352Z.js";import{$ as xt,$a as S,$b as I0,Ab as _e,Bb as le,Cb as Ya,Db as Xa,Ea as ki,Eb as $,Ec as j,Fa as lr,Fb as ot,Fc as xe,Ga as Wa,Gb as A,Ha as l,Ib as d,J as Cn,Jb as pn,K as y,Kb as $e,L as mt,Lb as en,Ma as ao,Mb as xn,N as be,Na as x0,Nb as Q,O as oo,Ob as J,P as p,Pa as w0,Pb as Tf,Qa as un,Qb as hn,Ra as Ka,Rb as jt,Sb as yt,T as C0,Tb as Ne,U as Ln,Ub as ue,V as w,Vb as Pt,W as T,Wa as z,Wb as H,X as W,Xa as _t,Xb as b,Y as ja,Ya as je,Yb as x,Z as dt,Za as wt,Zb as Se,_ as Ua,_a as Z,_b as k0,ac as cr,ba as ne,bc as dr,ca as Jt,cc as ur,d as io,dc as Ut,ec as Tt,fc as Ce,g as P,ga as X,gc as ke,hc as At,ia as de,ic as Re,ja as ro,jb as O,jc as $n,ka as G,kb as T0,kc as Ii,la as Qe,lb as S0,lc as Sf,mb as M,mc as Za,n as y0,nb as D,nc as pr,ob as wf,oc as E0,pa as $a,pb as Ue,pc as We,qb as re,rb as ae,rc as tn,sb as m,sc as E,t as Ga,tb as f,tc as Ke,ub as _,uc as B,vb as F,vc as nt,wb as se,wc as Qa,xb as fe,xc as kf,yb as ie,yc as Ei,zb as me}from"./chunk-Q2A6FWC7.js";import{a as ge,b as Dt,c as no,e as v,g as a3}from"./chunk-WCABR6TI.js";var IC=v((Y_e,kC)=>{"use strict";function uz(){this.__data__=[],this.size=0}kC.exports=uz});var Wi=v((X_e,EC)=>{"use strict";function pz(t,o){return t===o||t!==t&&o!==o}EC.exports=pz});var da=v((Z_e,MC)=>{"use strict";var hz=Wi();function fz(t,o){for(var e=t.length;e--;)if(hz(t[e][0],o))return e;return-1}MC.exports=fz});var PC=v((Q_e,DC)=>{"use strict";var mz=da(),_z=Array.prototype,gz=_z.splice;function bz(t){var o=this.__data__,e=mz(o,t);if(e<0)return!1;var n=o.length-1;return e==n?o.pop():gz.call(o,e,1),--this.size,!0}DC.exports=bz});var OC=v((J_e,RC)=>{"use strict";var vz=da();function yz(t){var o=this.__data__,e=vz(o,t);return e<0?void 0:o[e][1]}RC.exports=yz});var NC=v((ege,FC)=>{"use strict";var Cz=da();function xz(t){return Cz(this.__data__,t)>-1}FC.exports=xz});var LC=v((tge,AC)=>{"use strict";var wz=da();function Tz(t,o){var e=this.__data__,n=wz(e,t);return n<0?(++this.size,e.push([t,o])):e[n][1]=o,this}AC.exports=Tz});var ua=v((nge,BC)=>{"use strict";var Sz=IC(),kz=PC(),Iz=OC(),Ez=NC(),Mz=LC();function Go(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}Go.prototype.clear=Sz;Go.prototype.delete=kz;Go.prototype.get=Iz;Go.prototype.has=Ez;Go.prototype.set=Mz;BC.exports=Go});var zC=v((ige,VC)=>{"use strict";var Dz=ua();function Pz(){this.__data__=new Dz,this.size=0}VC.exports=Pz});var qC=v((oge,HC)=>{"use strict";function Rz(t){var o=this.__data__,e=o.delete(t);return this.size=o.size,e}HC.exports=Rz});var jC=v((rge,GC)=>{"use strict";function Oz(t){return this.__data__.get(t)}GC.exports=Oz});var $C=v((age,UC)=>{"use strict";function Fz(t){return this.__data__.has(t)}UC.exports=Fz});var D_=v((sge,WC)=>{"use strict";var Nz=typeof global=="object"&&global&&global.Object===Object&&global;WC.exports=Nz});var sn=v((lge,KC)=>{"use strict";var Az=D_(),Lz=typeof self=="object"&&self&&self.Object===Object&&self,Bz=Az||Lz||Function("return this")();KC.exports=Bz});var Ki=v((cge,YC)=>{"use strict";var Vz=sn(),zz=Vz.Symbol;YC.exports=zz});var JC=v((dge,QC)=>{"use strict";var XC=Ki(),ZC=Object.prototype,Hz=ZC.hasOwnProperty,qz=ZC.toString,pa=XC?XC.toStringTag:void 0;function Gz(t){var o=Hz.call(t,pa),e=t[pa];try{t[pa]=void 0;var n=!0}catch{}var i=qz.call(t);return n&&(o?t[pa]=e:delete t[pa]),i}QC.exports=Gz});var t1=v((uge,e1)=>{"use strict";var jz=Object.prototype,Uz=jz.toString;function $z(t){return Uz.call(t)}e1.exports=$z});var mi=v((pge,o1)=>{"use strict";var n1=Ki(),Wz=JC(),Kz=t1(),Yz="[object Null]",Xz="[object Undefined]",i1=n1?n1.toStringTag:void 0;function Zz(t){return t==null?t===void 0?Xz:Yz:i1&&i1 in Object(t)?Wz(t):Kz(t)}o1.exports=Zz});var Yt=v((hge,r1)=>{"use strict";function Qz(t){var o=typeof t;return t!=null&&(o=="object"||o=="function")}r1.exports=Qz});var jo=v((fge,a1)=>{"use strict";var Jz=mi(),eH=Yt(),tH="[object AsyncFunction]",nH="[object Function]",iH="[object GeneratorFunction]",oH="[object Proxy]";function rH(t){if(!eH(t))return!1;var o=Jz(t);return o==nH||o==iH||o==tH||o==oH}a1.exports=rH});var l1=v((mge,s1)=>{"use strict";var aH=sn(),sH=aH["__core-js_shared__"];s1.exports=sH});var u1=v((_ge,d1)=>{"use strict";var P_=l1(),c1=(function(){var t=/[^.]+$/.exec(P_&&P_.keys&&P_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function lH(t){return!!c1&&c1 in t}d1.exports=lH});var R_=v((gge,p1)=>{"use strict";var cH=Function.prototype,dH=cH.toString;function uH(t){if(t!=null){try{return dH.call(t)}catch{}try{return t+""}catch{}}return""}p1.exports=uH});var f1=v((bge,h1)=>{"use strict";var pH=jo(),hH=u1(),fH=Yt(),mH=R_(),_H=/[\\^$.*+?()[\]{}|]/g,gH=/^\[object .+?Constructor\]$/,bH=Function.prototype,vH=Object.prototype,yH=bH.toString,CH=vH.hasOwnProperty,xH=RegExp("^"+yH.call(CH).replace(_H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wH(t){if(!fH(t)||hH(t))return!1;var o=pH(t)?xH:gH;return o.test(mH(t))}h1.exports=wH});var _1=v((vge,m1)=>{"use strict";function TH(t,o){return t?.[o]}m1.exports=TH});var _i=v((yge,g1)=>{"use strict";var SH=f1(),kH=_1();function IH(t,o){var e=kH(t,o);return SH(e)?e:void 0}g1.exports=IH});var Mh=v((Cge,b1)=>{"use strict";var EH=_i(),MH=sn(),DH=EH(MH,"Map");b1.exports=DH});var ha=v((xge,v1)=>{"use strict";var PH=_i(),RH=PH(Object,"create");v1.exports=RH});var x1=v((wge,C1)=>{"use strict";var y1=ha();function OH(){this.__data__=y1?y1(null):{},this.size=0}C1.exports=OH});var T1=v((Tge,w1)=>{"use strict";function FH(t){var o=this.has(t)&&delete this.__data__[t];return this.size-=o?1:0,o}w1.exports=FH});var k1=v((Sge,S1)=>{"use strict";var NH=ha(),AH="__lodash_hash_undefined__",LH=Object.prototype,BH=LH.hasOwnProperty;function VH(t){var o=this.__data__;if(NH){var e=o[t];return e===AH?void 0:e}return BH.call(o,t)?o[t]:void 0}S1.exports=VH});var E1=v((kge,I1)=>{"use strict";var zH=ha(),HH=Object.prototype,qH=HH.hasOwnProperty;function GH(t){var o=this.__data__;return zH?o[t]!==void 0:qH.call(o,t)}I1.exports=GH});var D1=v((Ige,M1)=>{"use strict";var jH=ha(),UH="__lodash_hash_undefined__";function $H(t,o){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=jH&&o===void 0?UH:o,this}M1.exports=$H});var R1=v((Ege,P1)=>{"use strict";var WH=x1(),KH=T1(),YH=k1(),XH=E1(),ZH=D1();function Uo(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}Uo.prototype.clear=WH;Uo.prototype.delete=KH;Uo.prototype.get=YH;Uo.prototype.has=XH;Uo.prototype.set=ZH;P1.exports=Uo});var N1=v((Mge,F1)=>{"use strict";var O1=R1(),QH=ua(),JH=Mh();function eq(){this.size=0,this.__data__={hash:new O1,map:new(JH||QH),string:new O1}}F1.exports=eq});var L1=v((Dge,A1)=>{"use strict";function tq(t){var o=typeof t;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?t!=="__proto__":t===null}A1.exports=tq});var fa=v((Pge,B1)=>{"use strict";var nq=L1();function iq(t,o){var e=t.__data__;return nq(o)?e[typeof o=="string"?"string":"hash"]:e.map}B1.exports=iq});var z1=v((Rge,V1)=>{"use strict";var oq=fa();function rq(t){var o=oq(this,t).delete(t);return this.size-=o?1:0,o}V1.exports=rq});var q1=v((Oge,H1)=>{"use strict";var aq=fa();function sq(t){return aq(this,t).get(t)}H1.exports=sq});var j1=v((Fge,G1)=>{"use strict";var lq=fa();function cq(t){return lq(this,t).has(t)}G1.exports=cq});var $1=v((Nge,U1)=>{"use strict";var dq=fa();function uq(t,o){var e=dq(this,t),n=e.size;return e.set(t,o),this.size+=e.size==n?0:1,this}U1.exports=uq});var Dh=v((Age,W1)=>{"use strict";var pq=N1(),hq=z1(),fq=q1(),mq=j1(),_q=$1();function $o(t){var o=-1,e=t==null?0:t.length;for(this.clear();++o<e;){var n=t[o];this.set(n[0],n[1])}}$o.prototype.clear=pq;$o.prototype.delete=hq;$o.prototype.get=fq;$o.prototype.has=mq;$o.prototype.set=_q;W1.exports=$o});var Y1=v((Lge,K1)=>{"use strict";var gq=ua(),bq=Mh(),vq=Dh(),yq=200;function Cq(t,o){var e=this.__data__;if(e instanceof gq){var n=e.__data__;if(!bq||n.length<yq-1)return n.push([t,o]),this.size=++e.size,this;e=this.__data__=new vq(n)}return e.set(t,o),this.size=e.size,this}K1.exports=Cq});var ma=v((Bge,X1)=>{"use strict";var xq=ua(),wq=zC(),Tq=qC(),Sq=jC(),kq=$C(),Iq=Y1();function Wo(t){var o=this.__data__=new xq(t);this.size=o.size}Wo.prototype.clear=wq;Wo.prototype.delete=Tq;Wo.prototype.get=Sq;Wo.prototype.has=kq;Wo.prototype.set=Iq;X1.exports=Wo});var Ph=v((Vge,Z1)=>{"use strict";function Eq(t,o){for(var e=-1,n=t==null?0:t.length;++e<n&&o(t[e],e,t)!==!1;);return t}Z1.exports=Eq});var O_=v((zge,Q1)=>{"use strict";var Mq=_i(),Dq=(function(){try{var t=Mq(Object,"defineProperty");return t({},"",{}),t}catch{}})();Q1.exports=Dq});var _a=v((Hge,ex)=>{"use strict";var J1=O_();function Pq(t,o,e){o=="__proto__"&&J1?J1(t,o,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[o]=e}ex.exports=Pq});var ga=v((qge,tx)=>{"use strict";var Rq=_a(),Oq=Wi(),Fq=Object.prototype,Nq=Fq.hasOwnProperty;function Aq(t,o,e){var n=t[o];(!(Nq.call(t,o)&&Oq(n,e))||e===void 0&&!(o in t))&&Rq(t,o,e)}tx.exports=Aq});var Ko=v((Gge,nx)=>{"use strict";var Lq=ga(),Bq=_a();function Vq(t,o,e,n){var i=!e;e||(e={});for(var r=-1,a=o.length;++r<a;){var s=o[r],c=n?n(e[s],t[s],s,e,t):void 0;c===void 0&&(c=t[s]),i?Bq(e,s,c):Lq(e,s,c)}return e}nx.exports=Vq});var ox=v((jge,ix)=>{"use strict";function zq(t,o){for(var e=-1,n=Array(t);++e<t;)n[e]=o(e);return n}ix.exports=zq});var yn=v((Uge,rx)=>{"use strict";function Hq(t){return t!=null&&typeof t=="object"}rx.exports=Hq});var sx=v(($ge,ax)=>{"use strict";var qq=mi(),Gq=yn(),jq="[object Arguments]";function Uq(t){return Gq(t)&&qq(t)==jq}ax.exports=Uq});var Yo=v((Wge,dx)=>{"use strict";var lx=sx(),$q=yn(),cx=Object.prototype,Wq=cx.hasOwnProperty,Kq=cx.propertyIsEnumerable,Yq=lx((function(){return arguments})())?lx:function(t){return $q(t)&&Wq.call(t,"callee")&&!Kq.call(t,"callee")};dx.exports=Yq});var lt=v((Kge,ux)=>{"use strict";var Xq=Array.isArray;ux.exports=Xq});var hx=v((Yge,px)=>{"use strict";function Zq(){return!1}px.exports=Zq});var Yi=v((ba,Xo)=>{"use strict";var Qq=sn(),Jq=hx(),_x=typeof ba=="object"&&ba&&!ba.nodeType&&ba,fx=_x&&typeof Xo=="object"&&Xo&&!Xo.nodeType&&Xo,eG=fx&&fx.exports===_x,mx=eG?Qq.Buffer:void 0,tG=mx?mx.isBuffer:void 0,nG=tG||Jq;Xo.exports=nG});var va=v((Xge,gx)=>{"use strict";var iG=9007199254740991,oG=/^(?:0|[1-9]\d*)$/;function rG(t,o){var e=typeof t;return o=o??iG,!!o&&(e=="number"||e!="symbol"&&oG.test(t))&&t>-1&&t%1==0&&t<o}gx.exports=rG});var Rh=v((Zge,bx)=>{"use strict";var aG=9007199254740991;function sG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=aG}bx.exports=sG});var yx=v((Qge,vx)=>{"use strict";var lG=mi(),cG=Rh(),dG=yn(),uG="[object Arguments]",pG="[object Array]",hG="[object Boolean]",fG="[object Date]",mG="[object Error]",_G="[object Function]",gG="[object Map]",bG="[object Number]",vG="[object Object]",yG="[object RegExp]",CG="[object Set]",xG="[object String]",wG="[object WeakMap]",TG="[object ArrayBuffer]",SG="[object DataView]",kG="[object Float32Array]",IG="[object Float64Array]",EG="[object Int8Array]",MG="[object Int16Array]",DG="[object Int32Array]",PG="[object Uint8Array]",RG="[object Uint8ClampedArray]",OG="[object Uint16Array]",FG="[object Uint32Array]",Je={};Je[kG]=Je[IG]=Je[EG]=Je[MG]=Je[DG]=Je[PG]=Je[RG]=Je[OG]=Je[FG]=!0;Je[uG]=Je[pG]=Je[TG]=Je[hG]=Je[SG]=Je[fG]=Je[mG]=Je[_G]=Je[gG]=Je[bG]=Je[vG]=Je[yG]=Je[CG]=Je[xG]=Je[wG]=!1;function NG(t){return dG(t)&&cG(t.length)&&!!Je[lG(t)]}vx.exports=NG});var ya=v((Jge,Cx)=>{"use strict";function AG(t){return function(o){return t(o)}}Cx.exports=AG});var Oh=v((Ca,Zo)=>{"use strict";var LG=D_(),xx=typeof Ca=="object"&&Ca&&!Ca.nodeType&&Ca,xa=xx&&typeof Zo=="object"&&Zo&&!Zo.nodeType&&Zo,BG=xa&&xa.exports===xx,F_=BG&&LG.process,VG=(function(){try{var t=xa&&xa.require&&xa.require("util").types;return t||F_&&F_.binding&&F_.binding("util")}catch{}})();Zo.exports=VG});var Qo=v((e0e,Sx)=>{"use strict";var zG=yx(),HG=ya(),wx=Oh(),Tx=wx&&wx.isTypedArray,qG=Tx?HG(Tx):zG;Sx.exports=qG});var N_=v((t0e,kx)=>{"use strict";var GG=ox(),jG=Yo(),UG=lt(),$G=Yi(),WG=va(),KG=Qo(),YG=Object.prototype,XG=YG.hasOwnProperty;function ZG(t,o){var e=UG(t),n=!e&&jG(t),i=!e&&!n&&$G(t),r=!e&&!n&&!i&&KG(t),a=e||n||i||r,s=a?GG(t.length,String):[],c=s.length;for(var u in t)(o||XG.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||WG(u,c)))&&s.push(u);return s}kx.exports=ZG});var wa=v((n0e,Ix)=>{"use strict";var QG=Object.prototype;function JG(t){var o=t&&t.constructor,e=typeof o=="function"&&o.prototype||QG;return t===e}Ix.exports=JG});var A_=v((i0e,Ex)=>{"use strict";function ej(t,o){return function(e){return t(o(e))}}Ex.exports=ej});var Dx=v((o0e,Mx)=>{"use strict";var tj=A_(),nj=tj(Object.keys,Object);Mx.exports=nj});var Fh=v((r0e,Px)=>{"use strict";var ij=wa(),oj=Dx(),rj=Object.prototype,aj=rj.hasOwnProperty;function sj(t){if(!ij(t))return oj(t);var o=[];for(var e in Object(t))aj.call(t,e)&&e!="constructor"&&o.push(e);return o}Px.exports=sj});var Pn=v((a0e,Rx)=>{"use strict";var lj=jo(),cj=Rh();function dj(t){return t!=null&&cj(t.length)&&!lj(t)}Rx.exports=dj});var Hn=v((s0e,Ox)=>{"use strict";var uj=N_(),pj=Fh(),hj=Pn();function fj(t){return hj(t)?uj(t):pj(t)}Ox.exports=fj});var Nx=v((l0e,Fx)=>{"use strict";var mj=Ko(),_j=Hn();function gj(t,o){return t&&mj(o,_j(o),t)}Fx.exports=gj});var Lx=v((c0e,Ax)=>{"use strict";function bj(t){var o=[];if(t!=null)for(var e in Object(t))o.push(e);return o}Ax.exports=bj});var Vx=v((d0e,Bx)=>{"use strict";var vj=Yt(),yj=wa(),Cj=Lx(),xj=Object.prototype,wj=xj.hasOwnProperty;function Tj(t){if(!vj(t))return Cj(t);var o=yj(t),e=[];for(var n in t)n=="constructor"&&(o||!wj.call(t,n))||e.push(n);return e}Bx.exports=Tj});var gi=v((u0e,zx)=>{"use strict";var Sj=N_(),kj=Vx(),Ij=Pn();function Ej(t){return Ij(t)?Sj(t,!0):kj(t)}zx.exports=Ej});var qx=v((p0e,Hx)=>{"use strict";var Mj=Ko(),Dj=gi();function Pj(t,o){return t&&Mj(o,Dj(o),t)}Hx.exports=Pj});var L_=v((Ta,Jo)=>{"use strict";var Rj=sn(),$x=typeof Ta=="object"&&Ta&&!Ta.nodeType&&Ta,Gx=$x&&typeof Jo=="object"&&Jo&&!Jo.nodeType&&Jo,Oj=Gx&&Gx.exports===$x,jx=Oj?Rj.Buffer:void 0,Ux=jx?jx.allocUnsafe:void 0;function Fj(t,o){if(o)return t.slice();var e=t.length,n=Ux?Ux(e):new t.constructor(e);return t.copy(n),n}Jo.exports=Fj});var B_=v((h0e,Wx)=>{"use strict";function Nj(t,o){var e=-1,n=t.length;for(o||(o=Array(n));++e<n;)o[e]=t[e];return o}Wx.exports=Nj});var V_=v((f0e,Kx)=>{"use strict";function Aj(t,o){for(var e=-1,n=t==null?0:t.length,i=0,r=[];++e<n;){var a=t[e];o(a,e,t)&&(r[i++]=a)}return r}Kx.exports=Aj});var z_=v((m0e,Yx)=>{"use strict";function Lj(){return[]}Yx.exports=Lj});var Nh=v((_0e,Zx)=>{"use strict";var Bj=V_(),Vj=z_(),zj=Object.prototype,Hj=zj.propertyIsEnumerable,Xx=Object.getOwnPropertySymbols,qj=Xx?function(t){return t==null?[]:(t=Object(t),Bj(Xx(t),function(o){return Hj.call(t,o)}))}:Vj;Zx.exports=qj});var Jx=v((g0e,Qx)=>{"use strict";var Gj=Ko(),jj=Nh();function Uj(t,o){return Gj(t,jj(t),o)}Qx.exports=Uj});var Ah=v((b0e,ew)=>{"use strict";function $j(t,o){for(var e=-1,n=o.length,i=t.length;++e<n;)t[i+e]=o[e];return t}ew.exports=$j});var Sa=v((v0e,tw)=>{"use strict";var Wj=A_(),Kj=Wj(Object.getPrototypeOf,Object);tw.exports=Kj});var H_=v((y0e,nw)=>{"use strict";var Yj=Ah(),Xj=Sa(),Zj=Nh(),Qj=z_(),Jj=Object.getOwnPropertySymbols,eU=Jj?function(t){for(var o=[];t;)Yj(o,Zj(t)),t=Xj(t);return o}:Qj;nw.exports=eU});var ow=v((C0e,iw)=>{"use strict";var tU=Ko(),nU=H_();function iU(t,o){return tU(t,nU(t),o)}iw.exports=iU});var q_=v((x0e,rw)=>{"use strict";var oU=Ah(),rU=lt();function aU(t,o,e){var n=o(t);return rU(t)?n:oU(n,e(t))}rw.exports=aU});var G_=v((w0e,aw)=>{"use strict";var sU=q_(),lU=Nh(),cU=Hn();function dU(t){return sU(t,cU,lU)}aw.exports=dU});var lw=v((T0e,sw)=>{"use strict";var uU=q_(),pU=H_(),hU=gi();function fU(t){return uU(t,hU,pU)}sw.exports=fU});var dw=v((S0e,cw)=>{"use strict";var mU=_i(),_U=sn(),gU=mU(_U,"DataView");cw.exports=gU});var pw=v((k0e,uw)=>{"use strict";var bU=_i(),vU=sn(),yU=bU(vU,"Promise");uw.exports=yU});var j_=v((I0e,hw)=>{"use strict";var CU=_i(),xU=sn(),wU=CU(xU,"Set");hw.exports=wU});var mw=v((E0e,fw)=>{"use strict";var TU=_i(),SU=sn(),kU=TU(SU,"WeakMap");fw.exports=kU});var Zi=v((M0e,xw)=>{"use strict";var U_=dw(),$_=Mh(),W_=pw(),K_=j_(),Y_=mw(),Cw=mi(),er=R_(),_w="[object Map]",IU="[object Object]",gw="[object Promise]",bw="[object Set]",vw="[object WeakMap]",yw="[object DataView]",EU=er(U_),MU=er($_),DU=er(W_),PU=er(K_),RU=er(Y_),Xi=Cw;(U_&&Xi(new U_(new ArrayBuffer(1)))!=yw||$_&&Xi(new $_)!=_w||W_&&Xi(W_.resolve())!=gw||K_&&Xi(new K_)!=bw||Y_&&Xi(new Y_)!=vw)&&(Xi=function(t){var o=Cw(t),e=o==IU?t.constructor:void 0,n=e?er(e):"";if(n)switch(n){case EU:return yw;case MU:return _w;case DU:return gw;case PU:return bw;case RU:return vw}return o});xw.exports=Xi});var Tw=v((D0e,ww)=>{"use strict";var OU=Object.prototype,FU=OU.hasOwnProperty;function NU(t){var o=t.length,e=new t.constructor(o);return o&&typeof t[0]=="string"&&FU.call(t,"index")&&(e.index=t.index,e.input=t.input),e}ww.exports=NU});var X_=v((P0e,Sw)=>{"use strict";var AU=sn(),LU=AU.Uint8Array;Sw.exports=LU});var Lh=v((R0e,Iw)=>{"use strict";var kw=X_();function BU(t){var o=new t.constructor(t.byteLength);return new kw(o).set(new kw(t)),o}Iw.exports=BU});var Mw=v((O0e,Ew)=>{"use strict";var VU=Lh();function zU(t,o){var e=o?VU(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}Ew.exports=zU});var Pw=v((F0e,Dw)=>{"use strict";var HU=/\w*$/;function qU(t){var o=new t.constructor(t.source,HU.exec(t));return o.lastIndex=t.lastIndex,o}Dw.exports=qU});var Aw=v((N0e,Nw)=>{"use strict";var Rw=Ki(),Ow=Rw?Rw.prototype:void 0,Fw=Ow?Ow.valueOf:void 0;function GU(t){return Fw?Object(Fw.call(t)):{}}Nw.exports=GU});var Z_=v((A0e,Lw)=>{"use strict";var jU=Lh();function UU(t,o){var e=o?jU(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}Lw.exports=UU});var Vw=v((L0e,Bw)=>{"use strict";var $U=Lh(),WU=Mw(),KU=Pw(),YU=Aw(),XU=Z_(),ZU="[object Boolean]",QU="[object Date]",JU="[object Map]",e$="[object Number]",t$="[object RegExp]",n$="[object Set]",i$="[object String]",o$="[object Symbol]",r$="[object ArrayBuffer]",a$="[object DataView]",s$="[object Float32Array]",l$="[object Float64Array]",c$="[object Int8Array]",d$="[object Int16Array]",u$="[object Int32Array]",p$="[object Uint8Array]",h$="[object Uint8ClampedArray]",f$="[object Uint16Array]",m$="[object Uint32Array]";function _$(t,o,e){var n=t.constructor;switch(o){case r$:return $U(t);case ZU:case QU:return new n(+t);case a$:return WU(t,e);case s$:case l$:case c$:case d$:case u$:case p$:case h$:case f$:case m$:return XU(t,e);case JU:return new n;case e$:case i$:return new n(t);case t$:return KU(t);case n$:return new n;case o$:return YU(t)}}Bw.exports=_$});var Q_=v((B0e,Hw)=>{"use strict";var g$=Yt(),zw=Object.create,b$=(function(){function t(){}return function(o){if(!g$(o))return{};if(zw)return zw(o);t.prototype=o;var e=new t;return t.prototype=void 0,e}})();Hw.exports=b$});var J_=v((V0e,qw)=>{"use strict";var v$=Q_(),y$=Sa(),C$=wa();function x$(t){return typeof t.constructor=="function"&&!C$(t)?v$(y$(t)):{}}qw.exports=x$});var jw=v((z0e,Gw)=>{"use strict";var w$=Zi(),T$=yn(),S$="[object Map]";function k$(t){return T$(t)&&w$(t)==S$}Gw.exports=k$});var Kw=v((H0e,Ww)=>{"use strict";var I$=jw(),E$=ya(),Uw=Oh(),$w=Uw&&Uw.isMap,M$=$w?E$($w):I$;Ww.exports=M$});var Xw=v((q0e,Yw)=>{"use strict";var D$=Zi(),P$=yn(),R$="[object Set]";function O$(t){return P$(t)&&D$(t)==R$}Yw.exports=O$});var eT=v((G0e,Jw)=>{"use strict";var F$=Xw(),N$=ya(),Zw=Oh(),Qw=Zw&&Zw.isSet,A$=Qw?N$(Qw):F$;Jw.exports=A$});var eg=v((j0e,oT)=>{"use strict";var L$=ma(),B$=Ph(),V$=ga(),z$=Nx(),H$=qx(),q$=L_(),G$=B_(),j$=Jx(),U$=ow(),$$=G_(),W$=lw(),K$=Zi(),Y$=Tw(),X$=Vw(),Z$=J_(),Q$=lt(),J$=Yi(),eW=Kw(),tW=Yt(),nW=eT(),iW=Hn(),oW=gi(),rW=1,aW=2,sW=4,tT="[object Arguments]",lW="[object Array]",cW="[object Boolean]",dW="[object Date]",uW="[object Error]",nT="[object Function]",pW="[object GeneratorFunction]",hW="[object Map]",fW="[object Number]",iT="[object Object]",mW="[object RegExp]",_W="[object Set]",gW="[object String]",bW="[object Symbol]",vW="[object WeakMap]",yW="[object ArrayBuffer]",CW="[object DataView]",xW="[object Float32Array]",wW="[object Float64Array]",TW="[object Int8Array]",SW="[object Int16Array]",kW="[object Int32Array]",IW="[object Uint8Array]",EW="[object Uint8ClampedArray]",MW="[object Uint16Array]",DW="[object Uint32Array]",Ze={};Ze[tT]=Ze[lW]=Ze[yW]=Ze[CW]=Ze[cW]=Ze[dW]=Ze[xW]=Ze[wW]=Ze[TW]=Ze[SW]=Ze[kW]=Ze[hW]=Ze[fW]=Ze[iT]=Ze[mW]=Ze[_W]=Ze[gW]=Ze[bW]=Ze[IW]=Ze[EW]=Ze[MW]=Ze[DW]=!0;Ze[uW]=Ze[nT]=Ze[vW]=!1;function Bh(t,o,e,n,i,r){var a,s=o&rW,c=o&aW,u=o&sW;if(e&&(a=i?e(t,n,i,r):e(t)),a!==void 0)return a;if(!tW(t))return t;var h=Q$(t);if(h){if(a=Y$(t),!s)return G$(t,a)}else{var g=K$(t),C=g==nT||g==pW;if(J$(t))return q$(t,s);if(g==iT||g==tT||C&&!i){if(a=c||C?{}:Z$(t),!s)return c?U$(t,H$(a,t)):j$(t,z$(a,t))}else{if(!Ze[g])return i?t:{};a=X$(t,g,s)}}r||(r=new L$);var k=r.get(t);if(k)return k;r.set(t,a),nW(t)?t.forEach(function(q){a.add(Bh(q,o,e,q,t,r))}):eW(t)&&t.forEach(function(q,Y){a.set(Y,Bh(q,o,e,Y,t,r))});var I=u?c?W$:$$:c?oW:iW,N=h?void 0:I(t);return B$(N||t,function(q,Y){N&&(Y=q,q=t[Y]),V$(a,Y,Bh(q,o,e,Y,t,r))}),a}oT.exports=Bh});var aT=v((U0e,rT)=>{"use strict";var PW=eg(),RW=4;function OW(t){return PW(t,RW)}rT.exports=OW});var Vh=v(($0e,sT)=>{"use strict";function FW(t){return function(){return t}}sT.exports=FW});var cT=v((W0e,lT)=>{"use strict";function NW(t){return function(o,e,n){for(var i=-1,r=Object(o),a=n(o),s=a.length;s--;){var c=a[t?s:++i];if(e(r[c],c,r)===!1)break}return o}}lT.exports=NW});var zh=v((K0e,dT)=>{"use strict";var AW=cT(),LW=AW();dT.exports=LW});var Hh=v((Y0e,uT)=>{"use strict";var BW=zh(),VW=Hn();function zW(t,o){return t&&BW(t,o,VW)}uT.exports=zW});var hT=v((X0e,pT)=>{"use strict";var HW=Pn();function qW(t,o){return function(e,n){if(e==null)return e;if(!HW(e))return t(e,n);for(var i=e.length,r=o?i:-1,a=Object(e);(o?r--:++r<i)&&n(a[r],r,a)!==!1;);return e}}pT.exports=qW});var ka=v((Z0e,fT)=>{"use strict";var GW=Hh(),jW=hT(),UW=jW(GW);fT.exports=UW});var bi=v((Q0e,mT)=>{"use strict";function $W(t){return t}mT.exports=$W});var tg=v((J0e,_T)=>{"use strict";var WW=bi();function KW(t){return typeof t=="function"?t:WW}_T.exports=KW});var ng=v((ebe,gT)=>{"use strict";var YW=Ph(),XW=ka(),ZW=tg(),QW=lt();function JW(t,o){var e=QW(t)?YW:XW;return e(t,ZW(o))}gT.exports=JW});var ig=v((tbe,bT)=>{"use strict";bT.exports=ng()});var yT=v((nbe,vT)=>{"use strict";var eK=ka();function tK(t,o){var e=[];return eK(t,function(n,i,r){o(n,i,r)&&e.push(n)}),e}vT.exports=tK});var xT=v((ibe,CT)=>{"use strict";var nK="__lodash_hash_undefined__";function iK(t){return this.__data__.set(t,nK),this}CT.exports=iK});var TT=v((obe,wT)=>{"use strict";function oK(t){return this.__data__.has(t)}wT.exports=oK});var og=v((rbe,ST)=>{"use strict";var rK=Dh(),aK=xT(),sK=TT();function qh(t){var o=-1,e=t==null?0:t.length;for(this.__data__=new rK;++o<e;)this.add(t[o])}qh.prototype.add=qh.prototype.push=aK;qh.prototype.has=sK;ST.exports=qh});var IT=v((abe,kT)=>{"use strict";function lK(t,o){for(var e=-1,n=t==null?0:t.length;++e<n;)if(o(t[e],e,t))return!0;return!1}kT.exports=lK});var rg=v((sbe,ET)=>{"use strict";function cK(t,o){return t.has(o)}ET.exports=cK});var ag=v((lbe,MT)=>{"use strict";var dK=og(),uK=IT(),pK=rg(),hK=1,fK=2;function mK(t,o,e,n,i,r){var a=e&hK,s=t.length,c=o.length;if(s!=c&&!(a&&c>s))return!1;var u=r.get(t),h=r.get(o);if(u&&h)return u==o&&h==t;var g=-1,C=!0,k=e&fK?new dK:void 0;for(r.set(t,o),r.set(o,t);++g<s;){var I=t[g],N=o[g];if(n)var q=a?n(N,I,g,o,t,r):n(I,N,g,t,o,r);if(q!==void 0){if(q)continue;C=!1;break}if(k){if(!uK(o,function(Y,ee){if(!pK(k,ee)&&(I===Y||i(I,Y,e,n,r)))return k.push(ee)})){C=!1;break}}else if(!(I===N||i(I,N,e,n,r))){C=!1;break}}return r.delete(t),r.delete(o),C}MT.exports=mK});var PT=v((cbe,DT)=>{"use strict";function _K(t){var o=-1,e=Array(t.size);return t.forEach(function(n,i){e[++o]=[i,n]}),e}DT.exports=_K});var Gh=v((dbe,RT)=>{"use strict";function gK(t){var o=-1,e=Array(t.size);return t.forEach(function(n){e[++o]=n}),e}RT.exports=gK});var LT=v((ube,AT)=>{"use strict";var OT=Ki(),FT=X_(),bK=Wi(),vK=ag(),yK=PT(),CK=Gh(),xK=1,wK=2,TK="[object Boolean]",SK="[object Date]",kK="[object Error]",IK="[object Map]",EK="[object Number]",MK="[object RegExp]",DK="[object Set]",PK="[object String]",RK="[object Symbol]",OK="[object ArrayBuffer]",FK="[object DataView]",NT=OT?OT.prototype:void 0,sg=NT?NT.valueOf:void 0;function NK(t,o,e,n,i,r,a){switch(e){case FK:if(t.byteLength!=o.byteLength||t.byteOffset!=o.byteOffset)return!1;t=t.buffer,o=o.buffer;case OK:return!(t.byteLength!=o.byteLength||!r(new FT(t),new FT(o)));case TK:case SK:case EK:return bK(+t,+o);case kK:return t.name==o.name&&t.message==o.message;case MK:case PK:return t==o+"";case IK:var s=yK;case DK:var c=n&xK;if(s||(s=CK),t.size!=o.size&&!c)return!1;var u=a.get(t);if(u)return u==o;n|=wK,a.set(t,o);var h=vK(s(t),s(o),n,i,r,a);return a.delete(t),h;case RK:if(sg)return sg.call(t)==sg.call(o)}return!1}AT.exports=NK});var zT=v((pbe,VT)=>{"use strict";var BT=G_(),AK=1,LK=Object.prototype,BK=LK.hasOwnProperty;function VK(t,o,e,n,i,r){var a=e&AK,s=BT(t),c=s.length,u=BT(o),h=u.length;if(c!=h&&!a)return!1;for(var g=c;g--;){var C=s[g];if(!(a?C in o:BK.call(o,C)))return!1}var k=r.get(t),I=r.get(o);if(k&&I)return k==o&&I==t;var N=!0;r.set(t,o),r.set(o,t);for(var q=a;++g<c;){C=s[g];var Y=t[C],ee=o[C];if(n)var ce=a?n(ee,Y,C,o,t,r):n(Y,ee,C,t,o,r);if(!(ce===void 0?Y===ee||i(Y,ee,e,n,r):ce)){N=!1;break}q||(q=C=="constructor")}if(N&&!q){var Oe=t.constructor,De=o.constructor;Oe!=De&&"constructor"in t&&"constructor"in o&&!(typeof Oe=="function"&&Oe instanceof Oe&&typeof De=="function"&&De instanceof De)&&(N=!1)}return r.delete(t),r.delete(o),N}VT.exports=VK});var KT=v((hbe,WT)=>{"use strict";var lg=ma(),zK=ag(),HK=LT(),qK=zT(),HT=Zi(),qT=lt(),GT=Yi(),GK=Qo(),jK=1,jT="[object Arguments]",UT="[object Array]",jh="[object Object]",UK=Object.prototype,$T=UK.hasOwnProperty;function $K(t,o,e,n,i,r){var a=qT(t),s=qT(o),c=a?UT:HT(t),u=s?UT:HT(o);c=c==jT?jh:c,u=u==jT?jh:u;var h=c==jh,g=u==jh,C=c==u;if(C&>(t)){if(!GT(o))return!1;a=!0,h=!1}if(C&&!h)return r||(r=new lg),a||GK(t)?zK(t,o,e,n,i,r):HK(t,o,c,e,n,i,r);if(!(e&jK)){var k=h&&$T.call(t,"__wrapped__"),I=g&&$T.call(o,"__wrapped__");if(k||I){var N=k?t.value():t,q=I?o.value():o;return r||(r=new lg),i(N,q,e,n,r)}}return C?(r||(r=new lg),qK(t,o,e,n,i,r)):!1}WT.exports=$K});var cg=v((fbe,ZT)=>{"use strict";var WK=KT(),YT=yn();function XT(t,o,e,n,i){return t===o?!0:t==null||o==null||!YT(t)&&!YT(o)?t!==t&&o!==o:WK(t,o,e,n,XT,i)}ZT.exports=XT});var JT=v((mbe,QT)=>{"use strict";var KK=ma(),YK=cg(),XK=1,ZK=2;function QK(t,o,e,n){var i=e.length,r=i,a=!n;if(t==null)return!r;for(t=Object(t);i--;){var s=e[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<r;){s=e[i];var c=s[0],u=t[c],h=s[1];if(a&&s[2]){if(u===void 0&&!(c in t))return!1}else{var g=new KK;if(n)var C=n(u,h,c,t,o,g);if(!(C===void 0?YK(h,u,XK|ZK,n,g):C))return!1}}return!0}QT.exports=QK});var dg=v((_be,e2)=>{"use strict";var JK=Yt();function eY(t){return t===t&&!JK(t)}e2.exports=eY});var n2=v((gbe,t2)=>{"use strict";var tY=dg(),nY=Hn();function iY(t){for(var o=nY(t),e=o.length;e--;){var n=o[e],i=t[n];o[e]=[n,i,tY(i)]}return o}t2.exports=iY});var ug=v((bbe,i2)=>{"use strict";function oY(t,o){return function(e){return e==null?!1:e[t]===o&&(o!==void 0||t in Object(e))}}i2.exports=oY});var r2=v((vbe,o2)=>{"use strict";var rY=JT(),aY=n2(),sY=ug();function lY(t){var o=aY(t);return o.length==1&&o[0][2]?sY(o[0][0],o[0][1]):function(e){return e===t||rY(e,t,o)}}o2.exports=lY});var Qi=v((ybe,a2)=>{"use strict";var cY=mi(),dY=yn(),uY="[object Symbol]";function pY(t){return typeof t=="symbol"||dY(t)&&cY(t)==uY}a2.exports=pY});var Uh=v((Cbe,s2)=>{"use strict";var hY=lt(),fY=Qi(),mY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_Y=/^\w*$/;function gY(t,o){if(hY(t))return!1;var e=typeof t;return e=="number"||e=="symbol"||e=="boolean"||t==null||fY(t)?!0:_Y.test(t)||!mY.test(t)||o!=null&&t in Object(o)}s2.exports=gY});var d2=v((xbe,c2)=>{"use strict";var l2=Dh(),bY="Expected a function";function pg(t,o){if(typeof t!="function"||o!=null&&typeof o!="function")throw new TypeError(bY);var e=function(){var n=arguments,i=o?o.apply(this,n):n[0],r=e.cache;if(r.has(i))return r.get(i);var a=t.apply(this,n);return e.cache=r.set(i,a)||r,a};return e.cache=new(pg.Cache||l2),e}pg.Cache=l2;c2.exports=pg});var p2=v((wbe,u2)=>{"use strict";var vY=d2(),yY=500;function CY(t){var o=vY(t,function(n){return e.size===yY&&e.clear(),n}),e=o.cache;return o}u2.exports=CY});var f2=v((Tbe,h2)=>{"use strict";var xY=p2(),wY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TY=/\\(\\)?/g,SY=xY(function(t){var o=[];return t.charCodeAt(0)===46&&o.push(""),t.replace(wY,function(e,n,i,r){o.push(i?r.replace(TY,"$1"):n||e)}),o});h2.exports=SY});var Ia=v((Sbe,m2)=>{"use strict";function kY(t,o){for(var e=-1,n=t==null?0:t.length,i=Array(n);++e<n;)i[e]=o(t[e],e,t);return i}m2.exports=kY});var C2=v((kbe,y2)=>{"use strict";var _2=Ki(),IY=Ia(),EY=lt(),MY=Qi(),DY=1/0,g2=_2?_2.prototype:void 0,b2=g2?g2.toString:void 0;function v2(t){if(typeof t=="string")return t;if(EY(t))return IY(t,v2)+"";if(MY(t))return b2?b2.call(t):"";var o=t+"";return o=="0"&&1/t==-DY?"-0":o}y2.exports=v2});var hg=v((Ibe,x2)=>{"use strict";var PY=C2();function RY(t){return t==null?"":PY(t)}x2.exports=RY});var Ea=v((Ebe,w2)=>{"use strict";var OY=lt(),FY=Uh(),NY=f2(),AY=hg();function LY(t,o){return OY(t)?t:FY(t,o)?[t]:NY(AY(t))}w2.exports=LY});var tr=v((Mbe,T2)=>{"use strict";var BY=Qi(),VY=1/0;function zY(t){if(typeof t=="string"||BY(t))return t;var o=t+"";return o=="0"&&1/t==-VY?"-0":o}T2.exports=zY});var Ma=v((Dbe,S2)=>{"use strict";var HY=Ea(),qY=tr();function GY(t,o){o=HY(o,t);for(var e=0,n=o.length;t!=null&&e<n;)t=t[qY(o[e++])];return e&&e==n?t:void 0}S2.exports=GY});var I2=v((Pbe,k2)=>{"use strict";var jY=Ma();function UY(t,o,e){var n=t==null?void 0:jY(t,o);return n===void 0?e:n}k2.exports=UY});var M2=v((Rbe,E2)=>{"use strict";function $Y(t,o){return t!=null&&o in Object(t)}E2.exports=$Y});var fg=v((Obe,D2)=>{"use strict";var WY=Ea(),KY=Yo(),YY=lt(),XY=va(),ZY=Rh(),QY=tr();function JY(t,o,e){o=WY(o,t);for(var n=-1,i=o.length,r=!1;++n<i;){var a=QY(o[n]);if(!(r=t!=null&&e(t,a)))break;t=t[a]}return r||++n!=i?r:(i=t==null?0:t.length,!!i&&ZY(i)&&XY(a,i)&&(YY(t)||KY(t)))}D2.exports=JY});var mg=v((Fbe,P2)=>{"use strict";var eX=M2(),tX=fg();function nX(t,o){return t!=null&&tX(t,o,eX)}P2.exports=nX});var O2=v((Nbe,R2)=>{"use strict";var iX=cg(),oX=I2(),rX=mg(),aX=Uh(),sX=dg(),lX=ug(),cX=tr(),dX=1,uX=2;function pX(t,o){return aX(t)&&sX(o)?lX(cX(t),o):function(e){var n=oX(e,t);return n===void 0&&n===o?rX(e,t):iX(o,n,dX|uX)}}R2.exports=pX});var _g=v((Abe,F2)=>{"use strict";function hX(t){return function(o){return o?.[t]}}F2.exports=hX});var A2=v((Lbe,N2)=>{"use strict";var fX=Ma();function mX(t){return function(o){return fX(o,t)}}N2.exports=mX});var B2=v((Bbe,L2)=>{"use strict";var _X=_g(),gX=A2(),bX=Uh(),vX=tr();function yX(t){return bX(t)?_X(vX(t)):gX(t)}L2.exports=yX});var Rn=v((Vbe,V2)=>{"use strict";var CX=r2(),xX=O2(),wX=bi(),TX=lt(),SX=B2();function kX(t){return typeof t=="function"?t:t==null?wX:typeof t=="object"?TX(t)?xX(t[0],t[1]):CX(t):SX(t)}V2.exports=kX});var gg=v((zbe,z2)=>{"use strict";var IX=V_(),EX=yT(),MX=Rn(),DX=lt();function PX(t,o){var e=DX(t)?IX:EX;return e(t,MX(o,3))}z2.exports=PX});var q2=v((Hbe,H2)=>{"use strict";var RX=Object.prototype,OX=RX.hasOwnProperty;function FX(t,o){return t!=null&&OX.call(t,o)}H2.exports=FX});var bg=v((qbe,G2)=>{"use strict";var NX=q2(),AX=fg();function LX(t,o){return t!=null&&AX(t,o,NX)}G2.exports=LX});var U2=v((Gbe,j2)=>{"use strict";var BX=Fh(),VX=Zi(),zX=Yo(),HX=lt(),qX=Pn(),GX=Yi(),jX=wa(),UX=Qo(),$X="[object Map]",WX="[object Set]",KX=Object.prototype,YX=KX.hasOwnProperty;function XX(t){if(t==null)return!0;if(qX(t)&&(HX(t)||typeof t=="string"||typeof t.splice=="function"||GX(t)||UX(t)||zX(t)))return!t.length;var o=VX(t);if(o==$X||o==WX)return!t.size;if(jX(t))return!BX(t).length;for(var e in t)if(YX.call(t,e))return!1;return!0}j2.exports=XX});var vg=v((jbe,$2)=>{"use strict";function ZX(t){return t===void 0}$2.exports=ZX});var yg=v((Ube,W2)=>{"use strict";var QX=ka(),JX=Pn();function eZ(t,o){var e=-1,n=JX(t)?Array(t.length):[];return QX(t,function(i,r,a){n[++e]=o(i,r,a)}),n}W2.exports=eZ});var Cg=v(($be,K2)=>{"use strict";var tZ=Ia(),nZ=Rn(),iZ=yg(),oZ=lt();function rZ(t,o){var e=oZ(t)?tZ:iZ;return e(t,nZ(o,3))}K2.exports=rZ});var X2=v((Wbe,Y2)=>{"use strict";function aZ(t,o,e,n){var i=-1,r=t==null?0:t.length;for(n&&r&&(e=t[++i]);++i<r;)e=o(e,t[i],i,t);return e}Y2.exports=aZ});var Q2=v((Kbe,Z2)=>{"use strict";function sZ(t,o,e,n,i){return i(t,function(r,a,s){e=n?(n=!1,r):o(e,r,a,s)}),e}Z2.exports=sZ});var xg=v((Ybe,J2)=>{"use strict";var lZ=X2(),cZ=ka(),dZ=Rn(),uZ=Q2(),pZ=lt();function hZ(t,o,e){var n=pZ(t)?lZ:uZ,i=arguments.length<3;return n(t,dZ(o,4),e,i,cZ)}J2.exports=hZ});var tS=v((Xbe,eS)=>{"use strict";var fZ=mi(),mZ=lt(),_Z=yn(),gZ="[object String]";function bZ(t){return typeof t=="string"||!mZ(t)&&_Z(t)&&fZ(t)==gZ}eS.exports=bZ});var iS=v((Zbe,nS)=>{"use strict";var vZ=_g(),yZ=vZ("length");nS.exports=yZ});var rS=v((Qbe,oS)=>{"use strict";var CZ="\\ud800-\\udfff",xZ="\\u0300-\\u036f",wZ="\\ufe20-\\ufe2f",TZ="\\u20d0-\\u20ff",SZ=xZ+wZ+TZ,kZ="\\ufe0e\\ufe0f",IZ="\\u200d",EZ=RegExp("["+IZ+CZ+SZ+kZ+"]");function MZ(t){return EZ.test(t)}oS.exports=MZ});var fS=v((Jbe,hS)=>{"use strict";var sS="\\ud800-\\udfff",DZ="\\u0300-\\u036f",PZ="\\ufe20-\\ufe2f",RZ="\\u20d0-\\u20ff",OZ=DZ+PZ+RZ,FZ="\\ufe0e\\ufe0f",NZ="["+sS+"]",wg="["+OZ+"]",Tg="\\ud83c[\\udffb-\\udfff]",AZ="(?:"+wg+"|"+Tg+")",lS="[^"+sS+"]",cS="(?:\\ud83c[\\udde6-\\uddff]){2}",dS="[\\ud800-\\udbff][\\udc00-\\udfff]",LZ="\\u200d",uS=AZ+"?",pS="["+FZ+"]?",BZ="(?:"+LZ+"(?:"+[lS,cS,dS].join("|")+")"+pS+uS+")*",VZ=pS+uS+BZ,zZ="(?:"+[lS+wg+"?",wg,cS,dS,NZ].join("|")+")",aS=RegExp(Tg+"(?="+Tg+")|"+zZ+VZ,"g");function HZ(t){for(var o=aS.lastIndex=0;aS.test(t);)++o;return o}hS.exports=HZ});var _S=v((eve,mS)=>{"use strict";var qZ=iS(),GZ=rS(),jZ=fS();function UZ(t){return GZ(t)?jZ(t):qZ(t)}mS.exports=UZ});var bS=v((tve,gS)=>{"use strict";var $Z=Fh(),WZ=Zi(),KZ=Pn(),YZ=tS(),XZ=_S(),ZZ="[object Map]",QZ="[object Set]";function JZ(t){if(t==null)return 0;if(KZ(t))return YZ(t)?XZ(t):t.length;var o=WZ(t);return o==ZZ||o==QZ?t.size:$Z(t).length}gS.exports=JZ});var yS=v((nve,vS)=>{"use strict";var eQ=Ph(),tQ=Q_(),nQ=Hh(),iQ=Rn(),oQ=Sa(),rQ=lt(),aQ=Yi(),sQ=jo(),lQ=Yt(),cQ=Qo();function dQ(t,o,e){var n=rQ(t),i=n||aQ(t)||cQ(t);if(o=iQ(o,4),e==null){var r=t&&t.constructor;i?e=n?new r:[]:lQ(t)?e=sQ(r)?tQ(oQ(t)):{}:e={}}return(i?eQ:nQ)(t,function(a,s,c){return o(e,a,s,c)}),e}vS.exports=dQ});var TS=v((ive,wS)=>{"use strict";var CS=Ki(),uQ=Yo(),pQ=lt(),xS=CS?CS.isConcatSpreadable:void 0;function hQ(t){return pQ(t)||uQ(t)||!!(xS&&t&&t[xS])}wS.exports=hQ});var $h=v((ove,kS)=>{"use strict";var fQ=Ah(),mQ=TS();function SS(t,o,e,n,i){var r=-1,a=t.length;for(e||(e=mQ),i||(i=[]);++r<a;){var s=t[r];o>0&&e(s)?o>1?SS(s,o-1,e,n,i):fQ(i,s):n||(i[i.length]=s)}return i}kS.exports=SS});var ES=v((rve,IS)=>{"use strict";function _Q(t,o,e){switch(e.length){case 0:return t.call(o);case 1:return t.call(o,e[0]);case 2:return t.call(o,e[0],e[1]);case 3:return t.call(o,e[0],e[1],e[2])}return t.apply(o,e)}IS.exports=_Q});var Sg=v((ave,DS)=>{"use strict";var gQ=ES(),MS=Math.max;function bQ(t,o,e){return o=MS(o===void 0?t.length-1:o,0),function(){for(var n=arguments,i=-1,r=MS(n.length-o,0),a=Array(r);++i<r;)a[i]=n[o+i];i=-1;for(var s=Array(o+1);++i<o;)s[i]=n[i];return s[o]=e(a),gQ(t,this,s)}}DS.exports=bQ});var OS=v((sve,RS)=>{"use strict";var vQ=Vh(),PS=O_(),yQ=bi(),CQ=PS?function(t,o){return PS(t,"toString",{configurable:!0,enumerable:!1,value:vQ(o),writable:!0})}:yQ;RS.exports=CQ});var NS=v((lve,FS)=>{"use strict";var xQ=800,wQ=16,TQ=Date.now;function SQ(t){var o=0,e=0;return function(){var n=TQ(),i=wQ-(n-e);if(e=n,i>0){if(++o>=xQ)return arguments[0]}else o=0;return t.apply(void 0,arguments)}}FS.exports=SQ});var kg=v((cve,AS)=>{"use strict";var kQ=OS(),IQ=NS(),EQ=IQ(kQ);AS.exports=EQ});var Da=v((dve,LS)=>{"use strict";var MQ=bi(),DQ=Sg(),PQ=kg();function RQ(t,o){return PQ(DQ(t,o,MQ),t+"")}LS.exports=RQ});var Ig=v((uve,BS)=>{"use strict";function OQ(t,o,e,n){for(var i=t.length,r=e+(n?1:-1);n?r--:++r<i;)if(o(t[r],r,t))return r;return-1}BS.exports=OQ});var zS=v((pve,VS)=>{"use strict";function FQ(t){return t!==t}VS.exports=FQ});var qS=v((hve,HS)=>{"use strict";function NQ(t,o,e){for(var n=e-1,i=t.length;++n<i;)if(t[n]===o)return n;return-1}HS.exports=NQ});var jS=v((fve,GS)=>{"use strict";var AQ=Ig(),LQ=zS(),BQ=qS();function VQ(t,o,e){return o===o?BQ(t,o,e):AQ(t,LQ,e)}GS.exports=VQ});var $S=v((mve,US)=>{"use strict";var zQ=jS();function HQ(t,o){var e=t==null?0:t.length;return!!e&&zQ(t,o,0)>-1}US.exports=HQ});var KS=v((_ve,WS)=>{"use strict";function qQ(t,o,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(o,t[n]))return!0;return!1}WS.exports=qQ});var XS=v((gve,YS)=>{"use strict";function GQ(){}YS.exports=GQ});var QS=v((bve,ZS)=>{"use strict";var Eg=j_(),jQ=XS(),UQ=Gh(),$Q=1/0,WQ=Eg&&1/UQ(new Eg([,-0]))[1]==$Q?function(t){return new Eg(t)}:jQ;ZS.exports=WQ});var ek=v((vve,JS)=>{"use strict";var KQ=og(),YQ=$S(),XQ=KS(),ZQ=rg(),QQ=QS(),JQ=Gh(),eJ=200;function tJ(t,o,e){var n=-1,i=YQ,r=t.length,a=!0,s=[],c=s;if(e)a=!1,i=XQ;else if(r>=eJ){var u=o?null:QQ(t);if(u)return JQ(u);a=!1,i=ZQ,c=new KQ}else c=o?[]:s;e:for(;++n<r;){var h=t[n],g=o?o(h):h;if(h=e||h!==0?h:0,a&&g===g){for(var C=c.length;C--;)if(c[C]===g)continue e;o&&c.push(g),s.push(h)}else i(c,g,e)||(c!==s&&c.push(g),s.push(h))}return s}JS.exports=tJ});var Mg=v((yve,tk)=>{"use strict";var nJ=Pn(),iJ=yn();function oJ(t){return iJ(t)&&nJ(t)}tk.exports=oJ});var ik=v((Cve,nk)=>{"use strict";var rJ=$h(),aJ=Da(),sJ=ek(),lJ=Mg(),cJ=aJ(function(t){return sJ(rJ(t,1,lJ,!0))});nk.exports=cJ});var rk=v((xve,ok)=>{"use strict";var dJ=Ia();function uJ(t,o){return dJ(o,function(e){return t[e]})}ok.exports=uJ});var Dg=v((wve,ak)=>{"use strict";var pJ=rk(),hJ=Hn();function fJ(t){return t==null?[]:pJ(t,hJ(t))}ak.exports=fJ});var Xt=v((Tve,sk)=>{"use strict";var Wh;if(typeof no=="function")try{Wh={clone:aT(),constant:Vh(),each:ig(),filter:gg(),has:bg(),isArray:lt(),isEmpty:U2(),isFunction:jo(),isUndefined:vg(),keys:Hn(),map:Cg(),reduce:xg(),size:bS(),transform:yS(),union:ik(),values:Dg()}}catch{}Wh||(Wh=window._);sk.exports=Wh});var Kh=v((kve,uk)=>{"use strict";var ve=Xt();uk.exports=Pe;var mJ="\0",Ji="\0",lk="";function Pe(t){this._isDirected=ve.has(t,"directed")?t.directed:!0,this._isMultigraph=ve.has(t,"multigraph")?t.multigraph:!1,this._isCompound=ve.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ve.constant(void 0),this._defaultEdgeLabelFn=ve.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Ji]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}Pe.prototype._nodeCount=0;Pe.prototype._edgeCount=0;Pe.prototype.isDirected=function(){return this._isDirected};Pe.prototype.isMultigraph=function(){return this._isMultigraph};Pe.prototype.isCompound=function(){return this._isCompound};Pe.prototype.setGraph=function(t){return this._label=t,this};Pe.prototype.graph=function(){return this._label};Pe.prototype.setDefaultNodeLabel=function(t){return ve.isFunction(t)||(t=ve.constant(t)),this._defaultNodeLabelFn=t,this};Pe.prototype.nodeCount=function(){return this._nodeCount};Pe.prototype.nodes=function(){return ve.keys(this._nodes)};Pe.prototype.sources=function(){var t=this;return ve.filter(this.nodes(),function(o){return ve.isEmpty(t._in[o])})};Pe.prototype.sinks=function(){var t=this;return ve.filter(this.nodes(),function(o){return ve.isEmpty(t._out[o])})};Pe.prototype.setNodes=function(t,o){var e=arguments,n=this;return ve.each(t,function(i){e.length>1?n.setNode(i,o):n.setNode(i)}),this};Pe.prototype.setNode=function(t,o){return ve.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=o),this):(this._nodes[t]=arguments.length>1?o:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Ji,this._children[t]={},this._children[Ji][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};Pe.prototype.node=function(t){return this._nodes[t]};Pe.prototype.hasNode=function(t){return ve.has(this._nodes,t)};Pe.prototype.removeNode=function(t){var o=this;if(ve.has(this._nodes,t)){var e=function(n){o.removeEdge(o._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],ve.each(this.children(t),function(n){o.setParent(n)}),delete this._children[t]),ve.each(ve.keys(this._in[t]),e),delete this._in[t],delete this._preds[t],ve.each(ve.keys(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};Pe.prototype.setParent=function(t,o){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ve.isUndefined(o))o=Ji;else{o+="";for(var e=o;!ve.isUndefined(e);e=this.parent(e))if(e===t)throw new Error("Setting "+o+" as parent of "+t+" would create a cycle");this.setNode(o)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=o,this._children[o][t]=!0,this};Pe.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};Pe.prototype.parent=function(t){if(this._isCompound){var o=this._parent[t];if(o!==Ji)return o}};Pe.prototype.children=function(t){if(ve.isUndefined(t)&&(t=Ji),this._isCompound){var o=this._children[t];if(o)return ve.keys(o)}else{if(t===Ji)return this.nodes();if(this.hasNode(t))return[]}};Pe.prototype.predecessors=function(t){var o=this._preds[t];if(o)return ve.keys(o)};Pe.prototype.successors=function(t){var o=this._sucs[t];if(o)return ve.keys(o)};Pe.prototype.neighbors=function(t){var o=this.predecessors(t);if(o)return ve.union(o,this.successors(t))};Pe.prototype.isLeaf=function(t){var o;return this.isDirected()?o=this.successors(t):o=this.neighbors(t),o.length===0};Pe.prototype.filterNodes=function(t){var o=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});o.setGraph(this.graph());var e=this;ve.each(this._nodes,function(r,a){t(a)&&o.setNode(a,r)}),ve.each(this._edgeObjs,function(r){o.hasNode(r.v)&&o.hasNode(r.w)&&o.setEdge(r,e.edge(r))});var n={};function i(r){var a=e.parent(r);return a===void 0||o.hasNode(a)?(n[r]=a,a):a in n?n[a]:i(a)}return this._isCompound&&ve.each(o.nodes(),function(r){o.setParent(r,i(r))}),o};Pe.prototype.setDefaultEdgeLabel=function(t){return ve.isFunction(t)||(t=ve.constant(t)),this._defaultEdgeLabelFn=t,this};Pe.prototype.edgeCount=function(){return this._edgeCount};Pe.prototype.edges=function(){return ve.values(this._edgeObjs)};Pe.prototype.setPath=function(t,o){var e=this,n=arguments;return ve.reduce(t,function(i,r){return n.length>1?e.setEdge(i,r,o):e.setEdge(i,r),r}),this};Pe.prototype.setEdge=function(){var t,o,e,n,i=!1,r=arguments[0];typeof r=="object"&&r!==null&&"v"in r?(t=r.v,o=r.w,e=r.name,arguments.length===2&&(n=arguments[1],i=!0)):(t=r,o=arguments[1],e=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,o=""+o,ve.isUndefined(e)||(e=""+e);var a=Pa(this._isDirected,t,o,e);if(ve.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!ve.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(o),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,o,e);var s=_J(this._isDirected,t,o,e);return t=s.v,o=s.w,Object.freeze(s),this._edgeObjs[a]=s,ck(this._preds[o],t),ck(this._sucs[t],o),this._in[o][a]=s,this._out[t][a]=s,this._edgeCount++,this};Pe.prototype.edge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e);return this._edgeLabels[n]};Pe.prototype.hasEdge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e);return ve.has(this._edgeLabels,n)};Pe.prototype.removeEdge=function(t,o,e){var n=arguments.length===1?Pg(this._isDirected,arguments[0]):Pa(this._isDirected,t,o,e),i=this._edgeObjs[n];return i&&(t=i.v,o=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],dk(this._preds[o],t),dk(this._sucs[t],o),delete this._in[o][n],delete this._out[t][n],this._edgeCount--),this};Pe.prototype.inEdges=function(t,o){var e=this._in[t];if(e){var n=ve.values(e);return o?ve.filter(n,function(i){return i.v===o}):n}};Pe.prototype.outEdges=function(t,o){var e=this._out[t];if(e){var n=ve.values(e);return o?ve.filter(n,function(i){return i.w===o}):n}};Pe.prototype.nodeEdges=function(t,o){var e=this.inEdges(t,o);if(e)return e.concat(this.outEdges(t,o))};function ck(t,o){t[o]?t[o]++:t[o]=1}function dk(t,o){--t[o]||delete t[o]}function Pa(t,o,e,n){var i=""+o,r=""+e;if(!t&&i>r){var a=i;i=r,r=a}return i+lk+r+lk+(ve.isUndefined(n)?mJ:n)}function _J(t,o,e,n){var i=""+o,r=""+e;if(!t&&i>r){var a=i;i=r,r=a}var s={v:i,w:r};return n&&(s.name=n),s}function Pg(t,o){return Pa(t,o.v,o.w,o.name)}});var hk=v((Ive,pk)=>{"use strict";pk.exports="2.1.8"});var mk=v((Eve,fk)=>{"use strict";fk.exports={Graph:Kh(),version:hk()}});var gk=v((Mve,_k)=>{"use strict";var On=Xt(),gJ=Kh();_k.exports={write:bJ,read:CJ};function bJ(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:vJ(t),edges:yJ(t)};return On.isUndefined(t.graph())||(o.value=On.clone(t.graph())),o}function vJ(t){return On.map(t.nodes(),function(o){var e=t.node(o),n=t.parent(o),i={v:o};return On.isUndefined(e)||(i.value=e),On.isUndefined(n)||(i.parent=n),i})}function yJ(t){return On.map(t.edges(),function(o){var e=t.edge(o),n={v:o.v,w:o.w};return On.isUndefined(o.name)||(n.name=o.name),On.isUndefined(e)||(n.value=e),n})}function CJ(t){var o=new gJ(t.options).setGraph(t.value);return On.each(t.nodes,function(e){o.setNode(e.v,e.value),e.parent&&o.setParent(e.v,e.parent)}),On.each(t.edges,function(e){o.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),o}});var vk=v((Dve,bk)=>{"use strict";var Yh=Xt();bk.exports=xJ;function xJ(t){var o={},e=[],n;function i(r){Yh.has(o,r)||(o[r]=!0,n.push(r),Yh.each(t.successors(r),i),Yh.each(t.predecessors(r),i))}return Yh.each(t.nodes(),function(r){n=[],i(r),n.length&&e.push(n)}),e}});var Rg=v((Pve,Ck)=>{"use strict";var yk=Xt();Ck.exports=ln;function ln(){this._arr=[],this._keyIndices={}}ln.prototype.size=function(){return this._arr.length};ln.prototype.keys=function(){return this._arr.map(function(t){return t.key})};ln.prototype.has=function(t){return yk.has(this._keyIndices,t)};ln.prototype.priority=function(t){var o=this._keyIndices[t];if(o!==void 0)return this._arr[o].priority};ln.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};ln.prototype.add=function(t,o){var e=this._keyIndices;if(t=String(t),!yk.has(e,t)){var n=this._arr,i=n.length;return e[t]=i,n.push({key:t,priority:o}),this._decrease(i),!0}return!1};ln.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};ln.prototype.decrease=function(t,o){var e=this._keyIndices[t];if(o>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+o);this._arr[e].priority=o,this._decrease(e)};ln.prototype._heapify=function(t){var o=this._arr,e=2*t,n=e+1,i=t;e<o.length&&(i=o[e].priority<o[i].priority?e:i,n<o.length&&(i=o[n].priority<o[i].priority?n:i),i!==t&&(this._swap(t,i),this._heapify(i)))};ln.prototype._decrease=function(t){for(var o=this._arr,e=o[t].priority,n;t!==0&&(n=t>>1,!(o[n].priority<e));)this._swap(t,n),t=n};ln.prototype._swap=function(t,o){var e=this._arr,n=this._keyIndices,i=e[t],r=e[o];e[t]=r,e[o]=i,n[r.key]=t,n[i.key]=o}});var Og=v((Rve,xk)=>{"use strict";var wJ=Xt(),TJ=Rg();xk.exports=kJ;var SJ=wJ.constant(1);function kJ(t,o,e,n){return IJ(t,String(o),e||SJ,n||function(i){return t.outEdges(i)})}function IJ(t,o,e,n){var i={},r=new TJ,a,s,c=function(u){var h=u.v!==a?u.v:u.w,g=i[h],C=e(u),k=s.distance+C;if(C<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+C);k<g.distance&&(g.distance=k,g.predecessor=a,r.decrease(h,k))};for(t.nodes().forEach(function(u){var h=u===o?0:Number.POSITIVE_INFINITY;i[u]={distance:h},r.add(u,h)});r.size()>0&&(a=r.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)n(a).forEach(c);return i}});var Tk=v((Ove,wk)=>{"use strict";var EJ=Og(),MJ=Xt();wk.exports=DJ;function DJ(t,o,e){return MJ.transform(t.nodes(),function(n,i){n[i]=EJ(t,i,o,e)},{})}});var Fg=v((Fve,kk)=>{"use strict";var Sk=Xt();kk.exports=PJ;function PJ(t){var o=0,e=[],n={},i=[];function r(a){var s=n[a]={onStack:!0,lowlink:o,index:o++};if(e.push(a),t.successors(a).forEach(function(h){Sk.has(n,h)?n[h].onStack&&(s.lowlink=Math.min(s.lowlink,n[h].index)):(r(h),s.lowlink=Math.min(s.lowlink,n[h].lowlink))}),s.lowlink===s.index){var c=[],u;do u=e.pop(),n[u].onStack=!1,c.push(u);while(a!==u);i.push(c)}}return t.nodes().forEach(function(a){Sk.has(n,a)||r(a)}),i}});var Ek=v((Nve,Ik)=>{"use strict";var RJ=Xt(),OJ=Fg();Ik.exports=FJ;function FJ(t){return RJ.filter(OJ(t),function(o){return o.length>1||o.length===1&&t.hasEdge(o[0],o[0])})}});var Dk=v((Ave,Mk)=>{"use strict";var NJ=Xt();Mk.exports=LJ;var AJ=NJ.constant(1);function LJ(t,o,e){return BJ(t,o||AJ,e||function(n){return t.outEdges(n)})}function BJ(t,o,e){var n={},i=t.nodes();return i.forEach(function(r){n[r]={},n[r][r]={distance:0},i.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=o(a);n[r][s]={distance:c,predecessor:r}})}),i.forEach(function(r){var a=n[r];i.forEach(function(s){var c=n[s];i.forEach(function(u){var h=c[r],g=a[u],C=c[u],k=h.distance+g.distance;k<C.distance&&(C.distance=k,C.predecessor=g.predecessor)})})}),n}});var Ng=v((Lve,Rk)=>{"use strict";var Ra=Xt();Rk.exports=Pk;Pk.CycleException=Xh;function Pk(t){var o={},e={},n=[];function i(r){if(Ra.has(e,r))throw new Xh;Ra.has(o,r)||(e[r]=!0,o[r]=!0,Ra.each(t.predecessors(r),i),delete e[r],n.push(r))}if(Ra.each(t.sinks(),i),Ra.size(o)!==t.nodeCount())throw new Xh;return n}function Xh(){}Xh.prototype=new Error});var Nk=v((Bve,Fk)=>{"use strict";var Ok=Ng();Fk.exports=VJ;function VJ(t){try{Ok(t)}catch(o){if(o instanceof Ok.CycleException)return!1;throw o}return!0}});var Ag=v((Vve,Lk)=>{"use strict";var Zh=Xt();Lk.exports=zJ;function zJ(t,o,e){Zh.isArray(o)||(o=[o]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],r={};return Zh.each(o,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);Ak(t,a,e==="post",r,n,i)}),i}function Ak(t,o,e,n,i,r){Zh.has(n,o)||(n[o]=!0,e||r.push(o),Zh.each(i(o),function(a){Ak(t,a,e,n,i,r)}),e&&r.push(o))}});var Vk=v((zve,Bk)=>{"use strict";var HJ=Ag();Bk.exports=qJ;function qJ(t,o){return HJ(t,o,"post")}});var Hk=v((Hve,zk)=>{"use strict";var GJ=Ag();zk.exports=jJ;function jJ(t,o){return GJ(t,o,"pre")}});var jk=v((qve,Gk)=>{"use strict";var qk=Xt(),UJ=Kh(),$J=Rg();Gk.exports=WJ;function WJ(t,o){var e=new UJ,n={},i=new $J,r;function a(c){var u=c.v===r?c.w:c.v,h=i.priority(u);if(h!==void 0){var g=o(c);g<h&&(n[u]=r,i.decrease(u,g))}}if(t.nodeCount()===0)return e;qk.each(t.nodes(),function(c){i.add(c,Number.POSITIVE_INFINITY),e.setNode(c)}),i.decrease(t.nodes()[0],0);for(var s=!1;i.size()>0;){if(r=i.removeMin(),qk.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 $k=v((Gve,Uk)=>{"use strict";Uk.exports={components:vk(),dijkstra:Og(),dijkstraAll:Tk(),findCycles:Ek(),floydWarshall:Dk(),isAcyclic:Nk(),postorder:Vk(),preorder:Hk(),prim:jk(),tarjan:Fg(),topsort:Ng()}});var Yk=v((jve,Kk)=>{"use strict";var Wk=mk();Kk.exports={Graph:Wk.Graph,json:gk(),alg:$k(),version:Wk.version}});var cn=v((Uve,Xk)=>{"use strict";var Qh;if(typeof no=="function")try{Qh=Yk()}catch{}Qh||(Qh=window.graphlib);Xk.exports=Qh});var Qk=v((Wve,Zk)=>{"use strict";var KJ=eg(),YJ=1,XJ=4;function ZJ(t){return KJ(t,YJ|XJ)}Zk.exports=ZJ});var Oa=v((Kve,Jk)=>{"use strict";var QJ=Wi(),JJ=Pn(),eee=va(),tee=Yt();function nee(t,o,e){if(!tee(e))return!1;var n=typeof o;return(n=="number"?JJ(e)&&eee(o,e.length):n=="string"&&o in e)?QJ(e[o],t):!1}Jk.exports=nee});var nI=v((Yve,tI)=>{"use strict";var iee=Da(),oee=Wi(),ree=Oa(),aee=gi(),eI=Object.prototype,see=eI.hasOwnProperty,lee=iee(function(t,o){t=Object(t);var e=-1,n=o.length,i=n>2?o[2]:void 0;for(i&&ree(o[0],o[1],i)&&(n=1);++e<n;)for(var r=o[e],a=aee(r),s=-1,c=a.length;++s<c;){var u=a[s],h=t[u];(h===void 0||oee(h,eI[u])&&!see.call(t,u))&&(t[u]=r[u])}return t});tI.exports=lee});var oI=v((Xve,iI)=>{"use strict";var cee=Rn(),dee=Pn(),uee=Hn();function pee(t){return function(o,e,n){var i=Object(o);if(!dee(o)){var r=cee(e,3);o=uee(o),e=function(s){return r(i[s],s,i)}}var a=t(o,e,n);return a>-1?i[r?o[a]:a]:void 0}}iI.exports=pee});var aI=v((Zve,rI)=>{"use strict";var hee=/\s/;function fee(t){for(var o=t.length;o--&&hee.test(t.charAt(o)););return o}rI.exports=fee});var lI=v((Qve,sI)=>{"use strict";var mee=aI(),_ee=/^\s+/;function gee(t){return t&&t.slice(0,mee(t)+1).replace(_ee,"")}sI.exports=gee});var pI=v((Jve,uI)=>{"use strict";var bee=lI(),cI=Yt(),vee=Qi(),dI=NaN,yee=/^[-+]0x[0-9a-f]+$/i,Cee=/^0b[01]+$/i,xee=/^0o[0-7]+$/i,wee=parseInt;function Tee(t){if(typeof t=="number")return t;if(vee(t))return dI;if(cI(t)){var o=typeof t.valueOf=="function"?t.valueOf():t;t=cI(o)?o+"":o}if(typeof t!="string")return t===0?t:+t;t=bee(t);var e=Cee.test(t);return e||xee.test(t)?wee(t.slice(2),e?2:8):yee.test(t)?dI:+t}uI.exports=Tee});var Lg=v((eye,fI)=>{"use strict";var See=pI(),hI=1/0,kee=17976931348623157e292;function Iee(t){if(!t)return t===0?t:0;if(t=See(t),t===hI||t===-hI){var o=t<0?-1:1;return o*kee}return t===t?t:0}fI.exports=Iee});var _I=v((tye,mI)=>{"use strict";var Eee=Lg();function Mee(t){var o=Eee(t),e=o%1;return o===o?e?o-e:o:0}mI.exports=Mee});var bI=v((nye,gI)=>{"use strict";var Dee=Ig(),Pee=Rn(),Ree=_I(),Oee=Math.max;function Fee(t,o,e){var n=t==null?0:t.length;if(!n)return-1;var i=e==null?0:Ree(e);return i<0&&(i=Oee(n+i,0)),Dee(t,Pee(o,3),i)}gI.exports=Fee});var yI=v((iye,vI)=>{"use strict";var Nee=oI(),Aee=bI(),Lee=Nee(Aee);vI.exports=Lee});var Bg=v((oye,CI)=>{"use strict";var Bee=$h();function Vee(t){var o=t==null?0:t.length;return o?Bee(t,1):[]}CI.exports=Vee});var wI=v((rye,xI)=>{"use strict";var zee=zh(),Hee=tg(),qee=gi();function Gee(t,o){return t==null?t:zee(t,Hee(o),qee)}xI.exports=Gee});var SI=v((aye,TI)=>{"use strict";function jee(t){var o=t==null?0:t.length;return o?t[o-1]:void 0}TI.exports=jee});var II=v((sye,kI)=>{"use strict";var Uee=_a(),$ee=Hh(),Wee=Rn();function Kee(t,o){var e={};return o=Wee(o,3),$ee(t,function(n,i,r){Uee(e,i,o(n,i,r))}),e}kI.exports=Kee});var Jh=v((lye,EI)=>{"use strict";var Yee=Qi();function Xee(t,o,e){for(var n=-1,i=t.length;++n<i;){var r=t[n],a=o(r);if(a!=null&&(s===void 0?a===a&&!Yee(a):e(a,s)))var s=a,c=r}return c}EI.exports=Xee});var DI=v((cye,MI)=>{"use strict";function Zee(t,o){return t>o}MI.exports=Zee});var RI=v((dye,PI)=>{"use strict";var Qee=Jh(),Jee=DI(),ete=bi();function tte(t){return t&&t.length?Qee(t,ete,Jee):void 0}PI.exports=tte});var Vg=v((uye,OI)=>{"use strict";var nte=_a(),ite=Wi();function ote(t,o,e){(e!==void 0&&!ite(t[o],e)||e===void 0&&!(o in t))&&nte(t,o,e)}OI.exports=ote});var AI=v((pye,NI)=>{"use strict";var rte=mi(),ate=Sa(),ste=yn(),lte="[object Object]",cte=Function.prototype,dte=Object.prototype,FI=cte.toString,ute=dte.hasOwnProperty,pte=FI.call(Object);function hte(t){if(!ste(t)||rte(t)!=lte)return!1;var o=ate(t);if(o===null)return!0;var e=ute.call(o,"constructor")&&o.constructor;return typeof e=="function"&&e instanceof e&&FI.call(e)==pte}NI.exports=hte});var zg=v((hye,LI)=>{"use strict";function fte(t,o){if(!(o==="constructor"&&typeof t[o]=="function")&&o!="__proto__")return t[o]}LI.exports=fte});var VI=v((fye,BI)=>{"use strict";var mte=Ko(),_te=gi();function gte(t){return mte(t,_te(t))}BI.exports=gte});var UI=v((mye,jI)=>{"use strict";var zI=Vg(),bte=L_(),vte=Z_(),yte=B_(),Cte=J_(),HI=Yo(),qI=lt(),xte=Mg(),wte=Yi(),Tte=jo(),Ste=Yt(),kte=AI(),Ite=Qo(),GI=zg(),Ete=VI();function Mte(t,o,e,n,i,r,a){var s=GI(t,e),c=GI(o,e),u=a.get(c);if(u){zI(t,e,u);return}var h=r?r(s,c,e+"",t,o,a):void 0,g=h===void 0;if(g){var C=qI(c),k=!C&&wte(c),I=!C&&!k&&Ite(c);h=c,C||k||I?qI(s)?h=s:xte(s)?h=yte(s):k?(g=!1,h=bte(c,!0)):I?(g=!1,h=vte(c,!0)):h=[]:kte(c)||HI(c)?(h=s,HI(s)?h=Ete(s):(!Ste(s)||Tte(s))&&(h=Cte(c))):g=!1}g&&(a.set(c,h),i(h,c,n,r,a),a.delete(c)),zI(t,e,h)}jI.exports=Mte});var KI=v((_ye,WI)=>{"use strict";var Dte=ma(),Pte=Vg(),Rte=zh(),Ote=UI(),Fte=Yt(),Nte=gi(),Ate=zg();function $I(t,o,e,n,i){t!==o&&Rte(o,function(r,a){if(i||(i=new Dte),Fte(r))Ote(t,o,a,e,$I,n,i);else{var s=n?n(Ate(t,a),r,a+"",t,o,i):void 0;s===void 0&&(s=r),Pte(t,a,s)}},Nte)}WI.exports=$I});var XI=v((gye,YI)=>{"use strict";var Lte=Da(),Bte=Oa();function Vte(t){return Lte(function(o,e){var n=-1,i=e.length,r=i>1?e[i-1]:void 0,a=i>2?e[2]:void 0;for(r=t.length>3&&typeof r=="function"?(i--,r):void 0,a&&Bte(e[0],e[1],a)&&(r=i<3?void 0:r,i=1),o=Object(o);++n<i;){var s=e[n];s&&t(o,s,n,r)}return o})}YI.exports=Vte});var QI=v((bye,ZI)=>{"use strict";var zte=KI(),Hte=XI(),qte=Hte(function(t,o,e){zte(t,o,e)});ZI.exports=qte});var Hg=v((vye,JI)=>{"use strict";function Gte(t,o){return t<o}JI.exports=Gte});var tE=v((yye,eE)=>{"use strict";var jte=Jh(),Ute=Hg(),$te=bi();function Wte(t){return t&&t.length?jte(t,$te,Ute):void 0}eE.exports=Wte});var iE=v((Cye,nE)=>{"use strict";var Kte=Jh(),Yte=Rn(),Xte=Hg();function Zte(t,o){return t&&t.length?Kte(t,Yte(o,2),Xte):void 0}nE.exports=Zte});var rE=v((xye,oE)=>{"use strict";var Qte=sn(),Jte=function(){return Qte.Date.now()};oE.exports=Jte});var lE=v((wye,sE)=>{"use strict";var ene=ga(),tne=Ea(),nne=va(),aE=Yt(),ine=tr();function one(t,o,e,n){if(!aE(t))return t;o=tne(o,t);for(var i=-1,r=o.length,a=r-1,s=t;s!=null&&++i<r;){var c=ine(o[i]),u=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=a){var h=s[c];u=n?n(h,c,s):void 0,u===void 0&&(u=aE(h)?h:nne(o[i+1])?[]:{})}ene(s,c,u),s=s[c]}return t}sE.exports=one});var dE=v((Tye,cE)=>{"use strict";var rne=Ma(),ane=lE(),sne=Ea();function lne(t,o,e){for(var n=-1,i=o.length,r={};++n<i;){var a=o[n],s=rne(t,a);e(s,a)&&ane(r,sne(a,t),s)}return r}cE.exports=lne});var pE=v((Sye,uE)=>{"use strict";var cne=dE(),dne=mg();function une(t,o){return cne(t,o,function(e,n){return dne(t,n)})}uE.exports=une});var fE=v((kye,hE)=>{"use strict";var pne=Bg(),hne=Sg(),fne=kg();function mne(t){return fne(hne(t,void 0,pne),t+"")}hE.exports=mne});var _E=v((Iye,mE)=>{"use strict";var _ne=pE(),gne=fE(),bne=gne(function(t,o){return t==null?{}:_ne(t,o)});mE.exports=bne});var bE=v((Eye,gE)=>{"use strict";var vne=Math.ceil,yne=Math.max;function Cne(t,o,e,n){for(var i=-1,r=yne(vne((o-t)/(e||1)),0),a=Array(r);r--;)a[n?r:++i]=t,t+=e;return a}gE.exports=Cne});var yE=v((Mye,vE)=>{"use strict";var xne=bE(),wne=Oa(),qg=Lg();function Tne(t){return function(o,e,n){return n&&typeof n!="number"&&wne(o,e,n)&&(e=n=void 0),o=qg(o),e===void 0?(e=o,o=0):e=qg(e),n=n===void 0?o<e?1:-1:qg(n),xne(o,e,n,t)}}vE.exports=Tne});var xE=v((Dye,CE)=>{"use strict";var Sne=yE(),kne=Sne();CE.exports=kne});var TE=v((Pye,wE)=>{"use strict";function Ine(t,o){var e=t.length;for(t.sort(o);e--;)t[e]=t[e].value;return t}wE.exports=Ine});var IE=v((Rye,kE)=>{"use strict";var SE=Qi();function Ene(t,o){if(t!==o){var e=t!==void 0,n=t===null,i=t===t,r=SE(t),a=o!==void 0,s=o===null,c=o===o,u=SE(o);if(!s&&!u&&!r&&t>o||r&&a&&c&&!s&&!u||n&&a&&c||!e&&c||!i)return 1;if(!n&&!r&&!u&&t<o||u&&e&&i&&!n&&!r||s&&e&&i||!a&&i||!c)return-1}return 0}kE.exports=Ene});var ME=v((Oye,EE)=>{"use strict";var Mne=IE();function Dne(t,o,e){for(var n=-1,i=t.criteria,r=o.criteria,a=i.length,s=e.length;++n<a;){var c=Mne(i[n],r[n]);if(c){if(n>=s)return c;var u=e[n];return c*(u=="desc"?-1:1)}}return t.index-o.index}EE.exports=Dne});var PE=v((Fye,DE)=>{"use strict";var Gg=Ia(),Pne=Ma(),Rne=Rn(),One=yg(),Fne=TE(),Nne=ya(),Ane=ME(),Lne=bi(),Bne=lt();function Vne(t,o,e){o.length?o=Gg(o,function(r){return Bne(r)?function(a){return Pne(a,r.length===1?r[0]:r)}:r}):o=[Lne];var n=-1;o=Gg(o,Nne(Rne));var i=One(t,function(r,a,s){var c=Gg(o,function(u){return u(r)});return{criteria:c,index:++n,value:r}});return Fne(i,function(r,a){return Ane(r,a,e)})}DE.exports=Vne});var FE=v((Nye,OE)=>{"use strict";var zne=$h(),Hne=PE(),qne=Da(),RE=Oa(),Gne=qne(function(t,o){if(t==null)return[];var e=o.length;return e>1&&RE(t,o[0],o[1])?o=[]:e>2&&RE(o[0],o[1],o[2])&&(o=[o[0]]),Hne(t,zne(o,1),[])});OE.exports=Gne});var AE=v((Aye,NE)=>{"use strict";var jne=hg(),Une=0;function $ne(t){var o=++Une;return jne(t)+o}NE.exports=$ne});var BE=v((Lye,LE)=>{"use strict";function Wne(t,o,e){for(var n=-1,i=t.length,r=o.length,a={};++n<i;){var s=n<r?o[n]:void 0;e(a,t[n],s)}return a}LE.exports=Wne});var zE=v((Bye,VE)=>{"use strict";var Kne=ga(),Yne=BE();function Xne(t,o){return Yne(t||[],o||[],Kne)}VE.exports=Xne});var et=v((Vye,HE)=>{"use strict";var ef;if(typeof no=="function")try{ef={cloneDeep:Qk(),constant:Vh(),defaults:nI(),each:ig(),filter:gg(),find:yI(),flatten:Bg(),forEach:ng(),forIn:wI(),has:bg(),isUndefined:vg(),last:SI(),map:Cg(),mapValues:II(),max:RI(),merge:QI(),min:tE(),minBy:iE(),now:rE(),pick:_E(),range:xE(),reduce:xg(),sortBy:FE(),uniqueId:AE(),values:Dg(),zipObject:zE()}}catch{}ef||(ef=window._);HE.exports=ef});var jE=v((Hye,GE)=>{"use strict";GE.exports=tf;function tf(){var t={};t._next=t._prev=t,this._sentinel=t}tf.prototype.dequeue=function(){var t=this._sentinel,o=t._prev;if(o!==t)return qE(o),o};tf.prototype.enqueue=function(t){var o=this._sentinel;t._prev&&t._next&&qE(t),t._next=o._next,o._next._prev=t,o._next=t,t._prev=o};tf.prototype.toString=function(){for(var t=[],o=this._sentinel,e=o._prev;e!==o;)t.push(JSON.stringify(e,Zne)),e=e._prev;return"["+t.join(", ")+"]"};function qE(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Zne(t,o){if(t!=="_next"&&t!=="_prev")return o}});var $E=v((qye,UE)=>{"use strict";var qn=et(),Qne=cn().Graph,Jne=jE();UE.exports=tie;var eie=qn.constant(1);function tie(t,o){if(t.nodeCount()<=1)return[];var e=iie(t,o||eie),n=nie(e.graph,e.buckets,e.zeroIdx);return qn.flatten(qn.map(n,function(i){return t.outEdges(i.v,i.w)}),!0)}function nie(t,o,e){for(var n=[],i=o[o.length-1],r=o[0],a;t.nodeCount();){for(;a=r.dequeue();)jg(t,o,e,a);for(;a=i.dequeue();)jg(t,o,e,a);if(t.nodeCount()){for(var s=o.length-2;s>0;--s)if(a=o[s].dequeue(),a){n=n.concat(jg(t,o,e,a,!0));break}}}return n}function jg(t,o,e,n,i){var r=i?[]:void 0;return qn.forEach(t.inEdges(n.v),function(a){var s=t.edge(a),c=t.node(a.v);i&&r.push({v:a.v,w:a.w}),c.out-=s,Ug(o,e,c)}),qn.forEach(t.outEdges(n.v),function(a){var s=t.edge(a),c=a.w,u=t.node(c);u.in-=s,Ug(o,e,u)}),t.removeNode(n.v),r}function iie(t,o){var e=new Qne,n=0,i=0;qn.forEach(t.nodes(),function(s){e.setNode(s,{v:s,in:0,out:0})}),qn.forEach(t.edges(),function(s){var c=e.edge(s.v,s.w)||0,u=o(s),h=c+u;e.setEdge(s.v,s.w,h),i=Math.max(i,e.node(s.v).out+=u),n=Math.max(n,e.node(s.w).in+=u)});var r=qn.range(i+n+3).map(function(){return new Jne}),a=n+1;return qn.forEach(e.nodes(),function(s){Ug(r,a,e.node(s))}),{graph:e,buckets:r,zeroIdx:a}}function Ug(t,o,e){e.out?e.in?t[e.out-e.in+o].enqueue(e):t[t.length-1].enqueue(e):t[0].enqueue(e)}});var KE=v((Gye,WE)=>{"use strict";var eo=et(),oie=$E();WE.exports={run:rie,undo:sie};function rie(t){var o=t.graph().acyclicer==="greedy"?oie(t,e(t)):aie(t);eo.forEach(o,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,eo.uniqueId("rev"))});function e(n){return function(i){return n.edge(i).weight}}}function aie(t){var o=[],e={},n={};function i(r){eo.has(n,r)||(n[r]=!0,e[r]=!0,eo.forEach(t.outEdges(r),function(a){eo.has(e,a.w)?o.push(a):i(a.w)}),delete e[r])}return eo.forEach(t.nodes(),i),o}function sie(t){eo.forEach(t.edges(),function(o){var e=t.edge(o);if(e.reversed){t.removeEdge(o);var n=e.forwardName;delete e.reversed,delete e.forwardName,t.setEdge(o.w,o.v,e,n)}})}});var Nt=v((jye,QE)=>{"use strict";var Ae=et(),YE=cn().Graph;QE.exports={addDummyNode:XE,simplify:lie,asNonCompoundGraph:cie,successorWeights:die,predecessorWeights:uie,intersectRect:pie,buildLayerMatrix:hie,normalizeRanks:fie,removeEmptyRanks:mie,addBorderNode:_ie,maxRank:ZE,partition:gie,time:bie,notime:vie};function XE(t,o,e,n){var i;do i=Ae.uniqueId(n);while(t.hasNode(i));return e.dummy=o,t.setNode(i,e),i}function lie(t){var o=new YE().setGraph(t.graph());return Ae.forEach(t.nodes(),function(e){o.setNode(e,t.node(e))}),Ae.forEach(t.edges(),function(e){var n=o.edge(e.v,e.w)||{weight:0,minlen:1},i=t.edge(e);o.setEdge(e.v,e.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),o}function cie(t){var o=new YE({multigraph:t.isMultigraph()}).setGraph(t.graph());return Ae.forEach(t.nodes(),function(e){t.children(e).length||o.setNode(e,t.node(e))}),Ae.forEach(t.edges(),function(e){o.setEdge(e,t.edge(e))}),o}function die(t){var o=Ae.map(t.nodes(),function(e){var n={};return Ae.forEach(t.outEdges(e),function(i){n[i.w]=(n[i.w]||0)+t.edge(i).weight}),n});return Ae.zipObject(t.nodes(),o)}function uie(t){var o=Ae.map(t.nodes(),function(e){var n={};return Ae.forEach(t.inEdges(e),function(i){n[i.v]=(n[i.v]||0)+t.edge(i).weight}),n});return Ae.zipObject(t.nodes(),o)}function pie(t,o){var e=t.x,n=t.y,i=o.x-e,r=o.y-n,a=t.width/2,s=t.height/2;if(!i&&!r)throw new Error("Not possible to find intersection inside of the rectangle");var c,u;return Math.abs(r)*a>Math.abs(i)*s?(r<0&&(s=-s),c=s*i/r,u=s):(i<0&&(a=-a),c=a,u=a*r/i),{x:e+c,y:n+u}}function hie(t){var o=Ae.map(Ae.range(ZE(t)+1),function(){return[]});return Ae.forEach(t.nodes(),function(e){var n=t.node(e),i=n.rank;Ae.isUndefined(i)||(o[i][n.order]=e)}),o}function fie(t){var o=Ae.min(Ae.map(t.nodes(),function(e){return t.node(e).rank}));Ae.forEach(t.nodes(),function(e){var n=t.node(e);Ae.has(n,"rank")&&(n.rank-=o)})}function mie(t){var o=Ae.min(Ae.map(t.nodes(),function(r){return t.node(r).rank})),e=[];Ae.forEach(t.nodes(),function(r){var a=t.node(r).rank-o;e[a]||(e[a]=[]),e[a].push(r)});var n=0,i=t.graph().nodeRankFactor;Ae.forEach(e,function(r,a){Ae.isUndefined(r)&&a%i!==0?--n:n&&Ae.forEach(r,function(s){t.node(s).rank+=n})})}function _ie(t,o,e,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=e,i.order=n),XE(t,"border",i,o)}function ZE(t){return Ae.max(Ae.map(t.nodes(),function(o){var e=t.node(o).rank;if(!Ae.isUndefined(e))return e}))}function gie(t,o){var e={lhs:[],rhs:[]};return Ae.forEach(t,function(n){o(n)?e.lhs.push(n):e.rhs.push(n)}),e}function bie(t,o){var e=Ae.now();try{return o()}finally{console.log(t+" time: "+(Ae.now()-e)+"ms")}}function vie(t,o){return o()}});var tM=v((Uye,eM)=>{"use strict";var JE=et(),yie=Nt();eM.exports={run:Cie,undo:wie};function Cie(t){t.graph().dummyChains=[],JE.forEach(t.edges(),function(o){xie(t,o)})}function xie(t,o){var e=o.v,n=t.node(e).rank,i=o.w,r=t.node(i).rank,a=o.name,s=t.edge(o),c=s.labelRank;if(r!==n+1){t.removeEdge(o);var u,h,g;for(g=0,++n;n<r;++g,++n)s.points=[],h={width:0,height:0,edgeLabel:s,edgeObj:o,rank:n},u=yie.addDummyNode(t,"edge",h,"_d"),n===c&&(h.width=s.width,h.height=s.height,h.dummy="edge-label",h.labelpos=s.labelpos),t.setEdge(e,u,{weight:s.weight},a),g===0&&t.graph().dummyChains.push(u),e=u;t.setEdge(e,i,{weight:s.weight},a)}}function wie(t){JE.forEach(t.graph().dummyChains,function(o){var e=t.node(o),n=e.edgeLabel,i;for(t.setEdge(e.edgeObj,n);e.dummy;)i=t.successors(o)[0],t.removeNode(o),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),o=i,e=t.node(o)})}});var Fa=v(($ye,nM)=>{"use strict";var nf=et();nM.exports={longestPath:Tie,slack:Sie};function Tie(t){var o={};function e(n){var i=t.node(n);if(nf.has(o,n))return i.rank;o[n]=!0;var r=nf.min(nf.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),i.rank=r}nf.forEach(t.sources(),e)}function Sie(t,o){return t.node(o.w).rank-t.node(o.v).rank-t.edge(o).minlen}});var $g=v((Wye,iM)=>{"use strict";var of=et(),kie=cn().Graph,rf=Fa().slack;iM.exports=Iie;function Iie(t){var o=new kie({directed:!1}),e=t.nodes()[0],n=t.nodeCount();o.setNode(e,{});for(var i,r;Eie(o,t)<n;)i=Mie(o,t),r=o.hasNode(i.v)?rf(t,i):-rf(t,i),Die(o,t,r);return o}function Eie(t,o){function e(n){of.forEach(o.nodeEdges(n),function(i){var r=i.v,a=n===r?i.w:r;!t.hasNode(a)&&!rf(o,i)&&(t.setNode(a,{}),t.setEdge(n,a,{}),e(a))})}return of.forEach(t.nodes(),e),t.nodeCount()}function Mie(t,o){return of.minBy(o.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return rf(o,e)})}function Die(t,o,e){of.forEach(t.nodes(),function(n){o.node(n).rank+=e})}});var uM=v((Kye,dM)=>{"use strict";var Gn=et(),Pie=$g(),Rie=Fa().slack,Oie=Fa().longestPath,Fie=cn().alg.preorder,Nie=cn().alg.postorder,Aie=Nt().simplify;dM.exports=to;to.initLowLimValues=Kg;to.initCutValues=Wg;to.calcCutValue=rM;to.leaveEdge=sM;to.enterEdge=lM;to.exchangeEdges=cM;function to(t){t=Aie(t),Oie(t);var o=Pie(t);Kg(o),Wg(o,t);for(var e,n;e=sM(o);)n=lM(o,t,e),cM(o,t,e,n)}function Wg(t,o){var e=Nie(t,t.nodes());e=e.slice(0,e.length-1),Gn.forEach(e,function(n){Lie(t,o,n)})}function Lie(t,o,e){var n=t.node(e),i=n.parent;t.edge(e,i).cutvalue=rM(t,o,e)}function rM(t,o,e){var n=t.node(e),i=n.parent,r=!0,a=o.edge(e,i),s=0;return a||(r=!1,a=o.edge(i,e)),s=a.weight,Gn.forEach(o.nodeEdges(e),function(c){var u=c.v===e,h=u?c.w:c.v;if(h!==i){var g=u===r,C=o.edge(c).weight;if(s+=g?C:-C,Vie(t,e,h)){var k=t.edge(e,h).cutvalue;s+=g?-k:k}}}),s}function Kg(t,o){arguments.length<2&&(o=t.nodes()[0]),aM(t,{},1,o)}function aM(t,o,e,n,i){var r=e,a=t.node(n);return o[n]=!0,Gn.forEach(t.neighbors(n),function(s){Gn.has(o,s)||(e=aM(t,o,e,s,n))}),a.low=r,a.lim=e++,i?a.parent=i:delete a.parent,e}function sM(t){return Gn.find(t.edges(),function(o){return t.edge(o).cutvalue<0})}function lM(t,o,e){var n=e.v,i=e.w;o.hasEdge(n,i)||(n=e.w,i=e.v);var r=t.node(n),a=t.node(i),s=r,c=!1;r.lim>a.lim&&(s=a,c=!0);var u=Gn.filter(o.edges(),function(h){return c===oM(t,t.node(h.v),s)&&c!==oM(t,t.node(h.w),s)});return Gn.minBy(u,function(h){return Rie(o,h)})}function cM(t,o,e,n){var i=e.v,r=e.w;t.removeEdge(i,r),t.setEdge(n.v,n.w,{}),Kg(t),Wg(t,o),Bie(t,o)}function Bie(t,o){var e=Gn.find(t.nodes(),function(i){return!o.node(i).parent}),n=Fie(t,e);n=n.slice(1),Gn.forEach(n,function(i){var r=t.node(i).parent,a=o.edge(i,r),s=!1;a||(a=o.edge(r,i),s=!0),o.node(i).rank=o.node(r).rank+(s?a.minlen:-a.minlen)})}function Vie(t,o,e){return t.hasEdge(o,e)}function oM(t,o,e){return e.low<=o.lim&&o.lim<=e.lim}});var mM=v((Yye,fM)=>{"use strict";var zie=Fa(),hM=zie.longestPath,Hie=$g(),qie=uM();fM.exports=Gie;function Gie(t){switch(t.graph().ranker){case"network-simplex":pM(t);break;case"tight-tree":Uie(t);break;case"longest-path":jie(t);break;default:pM(t)}}var jie=hM;function Uie(t){hM(t),Hie(t)}function pM(t){qie(t)}});var gM=v((Xye,_M)=>{"use strict";var Yg=et();_M.exports=$ie;function $ie(t){var o=Kie(t);Yg.forEach(t.graph().dummyChains,function(e){for(var n=t.node(e),i=n.edgeObj,r=Wie(t,o,i.v,i.w),a=r.path,s=r.lca,c=0,u=a[c],h=!0;e!==i.w;){if(n=t.node(e),h){for(;(u=a[c])!==s&&t.node(u).maxRank<n.rank;)c++;u===s&&(h=!1)}if(!h){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 Wie(t,o,e,n){var i=[],r=[],a=Math.min(o[e].low,o[n].low),s=Math.max(o[e].lim,o[n].lim),c,u;c=e;do c=t.parent(c),i.push(c);while(c&&(o[c].low>a||s>o[c].lim));for(u=c,c=n;(c=t.parent(c))!==u;)r.push(c);return{path:i.concat(r.reverse()),lca:u}}function Kie(t){var o={},e=0;function n(i){var r=e;Yg.forEach(t.children(i),n),o[i]={low:r,lim:e++}}return Yg.forEach(t.children(),n),o}});var yM=v((Zye,vM)=>{"use strict";var jn=et(),Xg=Nt();vM.exports={run:Yie,cleanup:Qie};function Yie(t){var o=Xg.addDummyNode(t,"root",{},"_root"),e=Xie(t),n=jn.max(jn.values(e))-1,i=2*n+1;t.graph().nestingRoot=o,jn.forEach(t.edges(),function(a){t.edge(a).minlen*=i});var r=Zie(t)+1;jn.forEach(t.children(),function(a){bM(t,o,i,r,n,e,a)}),t.graph().nodeRankFactor=i}function bM(t,o,e,n,i,r,a){var s=t.children(a);if(!s.length){a!==o&&t.setEdge(o,a,{weight:0,minlen:e});return}var c=Xg.addBorderNode(t,"_bt"),u=Xg.addBorderNode(t,"_bb"),h=t.node(a);t.setParent(c,a),h.borderTop=c,t.setParent(u,a),h.borderBottom=u,jn.forEach(s,function(g){bM(t,o,e,n,i,r,g);var C=t.node(g),k=C.borderTop?C.borderTop:g,I=C.borderBottom?C.borderBottom:g,N=C.borderTop?n:2*n,q=k!==I?1:i-r[a]+1;t.setEdge(c,k,{weight:N,minlen:q,nestingEdge:!0}),t.setEdge(I,u,{weight:N,minlen:q,nestingEdge:!0})}),t.parent(a)||t.setEdge(o,c,{weight:0,minlen:i+r[a]})}function Xie(t){var o={};function e(n,i){var r=t.children(n);r&&r.length&&jn.forEach(r,function(a){e(a,i+1)}),o[n]=i}return jn.forEach(t.children(),function(n){e(n,1)}),o}function Zie(t){return jn.reduce(t.edges(),function(o,e){return o+t.edge(e).weight},0)}function Qie(t){var o=t.graph();t.removeNode(o.nestingRoot),delete o.nestingRoot,jn.forEach(t.edges(),function(e){var n=t.edge(e);n.nestingEdge&&t.removeEdge(e)})}});var wM=v((Qye,xM)=>{"use strict";var Zg=et(),Jie=Nt();xM.exports=eoe;function eoe(t){function o(e){var n=t.children(e),i=t.node(e);if(n.length&&Zg.forEach(n,o),Zg.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var r=i.minRank,a=i.maxRank+1;r<a;++r)CM(t,"borderLeft","_bl",e,i,r),CM(t,"borderRight","_br",e,i,r)}}Zg.forEach(t.children(),o)}function CM(t,o,e,n,i,r){var a={width:0,height:0,rank:r,borderType:o},s=i[o][r-1],c=Jie.addDummyNode(t,"border",a,e);i[o][r]=c,t.setParent(c,n),s&&t.setEdge(s,c,{weight:1})}});var IM=v((Jye,kM)=>{"use strict";var Fn=et();kM.exports={adjust:toe,undo:noe};function toe(t){var o=t.graph().rankdir.toLowerCase();(o==="lr"||o==="rl")&&SM(t)}function noe(t){var o=t.graph().rankdir.toLowerCase();(o==="bt"||o==="rl")&&ioe(t),(o==="lr"||o==="rl")&&(ooe(t),SM(t))}function SM(t){Fn.forEach(t.nodes(),function(o){TM(t.node(o))}),Fn.forEach(t.edges(),function(o){TM(t.edge(o))})}function TM(t){var o=t.width;t.width=t.height,t.height=o}function ioe(t){Fn.forEach(t.nodes(),function(o){Qg(t.node(o))}),Fn.forEach(t.edges(),function(o){var e=t.edge(o);Fn.forEach(e.points,Qg),Fn.has(e,"y")&&Qg(e)})}function Qg(t){t.y=-t.y}function ooe(t){Fn.forEach(t.nodes(),function(o){Jg(t.node(o))}),Fn.forEach(t.edges(),function(o){var e=t.edge(o);Fn.forEach(e.points,Jg),Fn.has(e,"x")&&Jg(e)})}function Jg(t){var o=t.x;t.x=t.y,t.y=o}});var MM=v((eCe,EM)=>{"use strict";var Un=et();EM.exports=roe;function roe(t){var o={},e=Un.filter(t.nodes(),function(s){return!t.children(s).length}),n=Un.max(Un.map(e,function(s){return t.node(s).rank})),i=Un.map(Un.range(n+1),function(){return[]});function r(s){if(!Un.has(o,s)){o[s]=!0;var c=t.node(s);i[c.rank].push(s),Un.forEach(t.successors(s),r)}}var a=Un.sortBy(e,function(s){return t.node(s).rank});return Un.forEach(a,r),i}});var PM=v((tCe,DM)=>{"use strict";var vi=et();DM.exports=aoe;function aoe(t,o){for(var e=0,n=1;n<o.length;++n)e+=soe(t,o[n-1],o[n]);return e}function soe(t,o,e){for(var n=vi.zipObject(e,vi.map(e,function(u,h){return h})),i=vi.flatten(vi.map(o,function(u){return vi.sortBy(vi.map(t.outEdges(u),function(h){return{pos:n[h.w],weight:t.edge(h).weight}}),"pos")}),!0),r=1;r<e.length;)r<<=1;var a=2*r-1;r-=1;var s=vi.map(new Array(a),function(){return 0}),c=0;return vi.forEach(i.forEach(function(u){var h=u.pos+r;s[h]+=u.weight;for(var g=0;h>0;)h%2&&(g+=s[h+1]),h=h-1>>1,s[h]+=u.weight;c+=u.weight*g})),c}});var FM=v((nCe,OM)=>{"use strict";var RM=et();OM.exports=loe;function loe(t,o){return RM.map(o,function(e){var n=t.inEdges(e);if(n.length){var i=RM.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:i.sum/i.weight,weight:i.weight}}else return{v:e}})}});var AM=v((iCe,NM)=>{"use strict";var Zt=et();NM.exports=coe;function coe(t,o){var e={};Zt.forEach(t,function(i,r){var a=e[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:r};Zt.isUndefined(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),Zt.forEach(o.edges(),function(i){var r=e[i.v],a=e[i.w];!Zt.isUndefined(r)&&!Zt.isUndefined(a)&&(a.indegree++,r.out.push(e[i.w]))});var n=Zt.filter(e,function(i){return!i.indegree});return doe(n)}function doe(t){var o=[];function e(r){return function(a){a.merged||(Zt.isUndefined(a.barycenter)||Zt.isUndefined(r.barycenter)||a.barycenter>=r.barycenter)&&uoe(r,a)}}function n(r){return function(a){a.in.push(r),--a.indegree===0&&t.push(a)}}for(;t.length;){var i=t.pop();o.push(i),Zt.forEach(i.in.reverse(),e(i)),Zt.forEach(i.out,n(i))}return Zt.map(Zt.filter(o,function(r){return!r.merged}),function(r){return Zt.pick(r,["vs","i","barycenter","weight"])})}function uoe(t,o){var e=0,n=0;t.weight&&(e+=t.barycenter*t.weight,n+=t.weight),o.weight&&(e+=o.barycenter*o.weight,n+=o.weight),t.vs=o.vs.concat(t.vs),t.barycenter=e/n,t.weight=n,t.i=Math.min(o.i,t.i),o.merged=!0}});var VM=v((oCe,BM)=>{"use strict";var Na=et(),poe=Nt();BM.exports=hoe;function hoe(t,o){var e=poe.partition(t,function(h){return Na.has(h,"barycenter")}),n=e.lhs,i=Na.sortBy(e.rhs,function(h){return-h.i}),r=[],a=0,s=0,c=0;n.sort(foe(!!o)),c=LM(r,i,c),Na.forEach(n,function(h){c+=h.vs.length,r.push(h.vs),a+=h.barycenter*h.weight,s+=h.weight,c=LM(r,i,c)});var u={vs:Na.flatten(r,!0)};return s&&(u.barycenter=a/s,u.weight=s),u}function LM(t,o,e){for(var n;o.length&&(n=Na.last(o)).i<=e;)o.pop(),t.push(n.vs),e++;return e}function foe(t){return function(o,e){return o.barycenter<e.barycenter?-1:o.barycenter>e.barycenter?1:t?e.i-o.i:o.i-e.i}}});var qM=v((rCe,HM)=>{"use strict";var yi=et(),moe=FM(),_oe=AM(),goe=VM();HM.exports=zM;function zM(t,o,e,n){var i=t.children(o),r=t.node(o),a=r?r.borderLeft:void 0,s=r?r.borderRight:void 0,c={};a&&(i=yi.filter(i,function(I){return I!==a&&I!==s}));var u=moe(t,i);yi.forEach(u,function(I){if(t.children(I.v).length){var N=zM(t,I.v,e,n);c[I.v]=N,yi.has(N,"barycenter")&&voe(I,N)}});var h=_oe(u,e);boe(h,c);var g=goe(h,n);if(a&&(g.vs=yi.flatten([a,g.vs,s],!0),t.predecessors(a).length)){var C=t.node(t.predecessors(a)[0]),k=t.node(t.predecessors(s)[0]);yi.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+C.order+k.order)/(g.weight+2),g.weight+=2}return g}function boe(t,o){yi.forEach(t,function(e){e.vs=yi.flatten(e.vs.map(function(n){return o[n]?o[n].vs:n}),!0)})}function voe(t,o){yi.isUndefined(t.barycenter)?(t.barycenter=o.barycenter,t.weight=o.weight):(t.barycenter=(t.barycenter*t.weight+o.barycenter*o.weight)/(t.weight+o.weight),t.weight+=o.weight)}});var jM=v((aCe,GM)=>{"use strict";var Aa=et(),yoe=cn().Graph;GM.exports=Coe;function Coe(t,o,e){var n=xoe(t),i=new yoe({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(r){return t.node(r)});return Aa.forEach(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===o||a.minRank<=o&&o<=a.maxRank)&&(i.setNode(r),i.setParent(r,s||n),Aa.forEach(t[e](r),function(c){var u=c.v===r?c.w:c.v,h=i.edge(u,r),g=Aa.isUndefined(h)?0:h.weight;i.setEdge(u,r,{weight:t.edge(c).weight+g})}),Aa.has(a,"minRank")&&i.setNode(r,{borderLeft:a.borderLeft[o],borderRight:a.borderRight[o]}))}),i}function xoe(t){for(var o;t.hasNode(o=Aa.uniqueId("_root")););return o}});var $M=v((sCe,UM)=>{"use strict";var woe=et();UM.exports=Toe;function Toe(t,o,e){var n={},i;woe.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=i,i=a),c&&c!==a){o.setEdge(c,a);return}a=s}})}});var ZM=v((lCe,XM)=>{"use strict";var Ci=et(),Soe=MM(),koe=PM(),Ioe=qM(),Eoe=jM(),Moe=$M(),Doe=cn().Graph,WM=Nt();XM.exports=Poe;function Poe(t){var o=WM.maxRank(t),e=KM(t,Ci.range(1,o+1),"inEdges"),n=KM(t,Ci.range(o-1,-1,-1),"outEdges"),i=Soe(t);YM(t,i);for(var r=Number.POSITIVE_INFINITY,a,s=0,c=0;c<4;++s,++c){Roe(s%2?e:n,s%4>=2),i=WM.buildLayerMatrix(t);var u=koe(t,i);u<r&&(c=0,a=Ci.cloneDeep(i),r=u)}YM(t,a)}function KM(t,o,e){return Ci.map(o,function(n){return Eoe(t,n,e)})}function Roe(t,o){var e=new Doe;Ci.forEach(t,function(n){var i=n.graph().root,r=Ioe(n,i,e,o);Ci.forEach(r.vs,function(a,s){n.node(a).order=s}),Moe(n,e,r.vs)})}function YM(t,o){Ci.forEach(o,function(e){Ci.forEach(e,function(n,i){t.node(n).order=i})})}});var sD=v((cCe,aD)=>{"use strict";var ye=et(),Ooe=cn().Graph,Foe=Nt();aD.exports={positionX:Loe,findType1Conflicts:QM,findType2Conflicts:JM,addConflict:e0,hasConflict:eD,verticalAlignment:tD,horizontalCompaction:nD,alignCoordinates:oD,findSmallestWidthAlignment:iD,balance:rD};function QM(t,o){var e={};function n(i,r){var a=0,s=0,c=i.length,u=ye.last(r);return ye.forEach(r,function(h,g){var C=Noe(t,h),k=C?t.node(C).order:c;(C||h===u)&&(ye.forEach(r.slice(s,g+1),function(I){ye.forEach(t.predecessors(I),function(N){var q=t.node(N),Y=q.order;(Y<a||k<Y)&&!(q.dummy&&t.node(I).dummy)&&e0(e,N,I)})}),s=g+1,a=k)}),r}return ye.reduce(o,n),e}function JM(t,o){var e={};function n(r,a,s,c,u){var h;ye.forEach(ye.range(a,s),function(g){h=r[g],t.node(h).dummy&&ye.forEach(t.predecessors(h),function(C){var k=t.node(C);k.dummy&&(k.order<c||k.order>u)&&e0(e,C,h)})})}function i(r,a){var s=-1,c,u=0;return ye.forEach(a,function(h,g){if(t.node(h).dummy==="border"){var C=t.predecessors(h);C.length&&(c=t.node(C[0]).order,n(a,u,g,s,c),u=g,s=c)}n(a,u,a.length,c,r.length)}),a}return ye.reduce(o,i),e}function Noe(t,o){if(t.node(o).dummy)return ye.find(t.predecessors(o),function(e){return t.node(e).dummy})}function e0(t,o,e){if(o>e){var n=o;o=e,e=n}var i=t[o];i||(t[o]=i={}),i[e]=!0}function eD(t,o,e){if(o>e){var n=o;o=e,e=n}return ye.has(t[o],e)}function tD(t,o,e,n){var i={},r={},a={};return ye.forEach(o,function(s){ye.forEach(s,function(c,u){i[c]=c,r[c]=c,a[c]=u})}),ye.forEach(o,function(s){var c=-1;ye.forEach(s,function(u){var h=n(u);if(h.length){h=ye.sortBy(h,function(N){return a[N]});for(var g=(h.length-1)/2,C=Math.floor(g),k=Math.ceil(g);C<=k;++C){var I=h[C];r[u]===u&&c<a[I]&&!eD(e,u,I)&&(r[I]=u,r[u]=i[u]=i[I],c=a[I])}}})}),{root:i,align:r}}function nD(t,o,e,n,i){var r={},a=Aoe(t,o,e,i),s=i?"borderLeft":"borderRight";function c(g,C){for(var k=a.nodes(),I=k.pop(),N={};I;)N[I]?g(I):(N[I]=!0,k.push(I),k=k.concat(C(I))),I=k.pop()}function u(g){r[g]=a.inEdges(g).reduce(function(C,k){return Math.max(C,r[k.v]+a.edge(k))},0)}function h(g){var C=a.outEdges(g).reduce(function(I,N){return Math.min(I,r[N.w]-a.edge(N))},Number.POSITIVE_INFINITY),k=t.node(g);C!==Number.POSITIVE_INFINITY&&k.borderType!==s&&(r[g]=Math.max(r[g],C))}return c(u,a.predecessors.bind(a)),c(h,a.successors.bind(a)),ye.forEach(n,function(g){r[g]=r[e[g]]}),r}function Aoe(t,o,e,n){var i=new Ooe,r=t.graph(),a=Boe(r.nodesep,r.edgesep,n);return ye.forEach(o,function(s){var c;ye.forEach(s,function(u){var h=e[u];if(i.setNode(h),c){var g=e[c],C=i.edge(g,h);i.setEdge(g,h,Math.max(a(t,u,c),C||0))}c=u})}),i}function iD(t,o){return ye.minBy(ye.values(o),function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return ye.forIn(e,function(r,a){var s=Voe(t,a)/2;n=Math.max(r+s,n),i=Math.min(r-s,i)}),n-i})}function oD(t,o){var e=ye.values(o),n=ye.min(e),i=ye.max(e);ye.forEach(["u","d"],function(r){ye.forEach(["l","r"],function(a){var s=r+a,c=t[s],u;if(c!==o){var h=ye.values(c);u=a==="l"?n-ye.min(h):i-ye.max(h),u&&(t[s]=ye.mapValues(c,function(g){return g+u}))}})})}function rD(t,o){return ye.mapValues(t.ul,function(e,n){if(o)return t[o.toLowerCase()][n];var i=ye.sortBy(ye.map(t,n));return(i[1]+i[2])/2})}function Loe(t){var o=Foe.buildLayerMatrix(t),e=ye.merge(QM(t,o),JM(t,o)),n={},i;ye.forEach(["u","d"],function(a){i=a==="u"?o:ye.values(o).reverse(),ye.forEach(["l","r"],function(s){s==="r"&&(i=ye.map(i,function(g){return ye.values(g).reverse()}));var c=(a==="u"?t.predecessors:t.successors).bind(t),u=tD(t,i,e,c),h=nD(t,i,u.root,u.align,s==="r");s==="r"&&(h=ye.mapValues(h,function(g){return-g})),n[a+s]=h})});var r=iD(t,n);return oD(n,r),rD(n,t.graph().align)}function Boe(t,o,e){return function(n,i,r){var a=n.node(i),s=n.node(r),c=0,u;if(c+=a.width/2,ye.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?o:t)/2,c+=(s.dummy?o:t)/2,c+=s.width/2,ye.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 Voe(t,o){return t.node(o).width}});var dD=v((dCe,cD)=>{"use strict";var La=et(),lD=Nt(),zoe=sD().positionX;cD.exports=Hoe;function Hoe(t){t=lD.asNonCompoundGraph(t),qoe(t),La.forEach(zoe(t),function(o,e){t.node(e).x=o})}function qoe(t){var o=lD.buildLayerMatrix(t),e=t.graph().ranksep,n=0;La.forEach(o,function(i){var r=La.max(La.map(i,function(a){return t.node(a).height}));La.forEach(i,function(a){t.node(a).y=n+r/2}),n+=r+e})}});var _D=v((uCe,mD)=>{"use strict";var Me=et(),uD=KE(),pD=tM(),Goe=mM(),joe=Nt().normalizeRanks,Uoe=gM(),$oe=Nt().removeEmptyRanks,hD=yM(),Woe=wM(),fD=IM(),Koe=ZM(),Yoe=dD(),xi=Nt(),Xoe=cn().Graph;mD.exports=Zoe;function Zoe(t,o){var e=o&&o.debugTiming?xi.time:xi.notime;e("layout",function(){var n=e(" buildLayoutGraph",function(){return lre(t)});e(" runLayout",function(){Qoe(n,e)}),e(" updateInputGraph",function(){Joe(t,n)})})}function Qoe(t,o){o(" makeSpaceForEdgeLabels",function(){cre(t)}),o(" removeSelfEdges",function(){bre(t)}),o(" acyclic",function(){uD.run(t)}),o(" nestingGraph.run",function(){hD.run(t)}),o(" rank",function(){Goe(xi.asNonCompoundGraph(t))}),o(" injectEdgeLabelProxies",function(){dre(t)}),o(" removeEmptyRanks",function(){$oe(t)}),o(" nestingGraph.cleanup",function(){hD.cleanup(t)}),o(" normalizeRanks",function(){joe(t)}),o(" assignRankMinMax",function(){ure(t)}),o(" removeEdgeLabelProxies",function(){pre(t)}),o(" normalize.run",function(){pD.run(t)}),o(" parentDummyChains",function(){Uoe(t)}),o(" addBorderSegments",function(){Woe(t)}),o(" order",function(){Koe(t)}),o(" insertSelfEdges",function(){vre(t)}),o(" adjustCoordinateSystem",function(){fD.adjust(t)}),o(" position",function(){Yoe(t)}),o(" positionSelfEdges",function(){yre(t)}),o(" removeBorderNodes",function(){gre(t)}),o(" normalize.undo",function(){pD.undo(t)}),o(" fixupEdgeLabelCoords",function(){mre(t)}),o(" undoCoordinateSystem",function(){fD.undo(t)}),o(" translateGraph",function(){hre(t)}),o(" assignNodeIntersects",function(){fre(t)}),o(" reversePoints",function(){_re(t)}),o(" acyclic.undo",function(){uD.undo(t)})}function Joe(t,o){Me.forEach(t.nodes(),function(e){var n=t.node(e),i=o.node(e);n&&(n.x=i.x,n.y=i.y,o.children(e).length&&(n.width=i.width,n.height=i.height))}),Me.forEach(t.edges(),function(e){var n=t.edge(e),i=o.edge(e);n.points=i.points,Me.has(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=o.graph().width,t.graph().height=o.graph().height}var ere=["nodesep","edgesep","ranksep","marginx","marginy"],tre={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},nre=["acyclicer","ranker","rankdir","align"],ire=["width","height"],ore={width:0,height:0},rre=["minlen","weight","width","height","labeloffset"],are={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sre=["labelpos"];function lre(t){var o=new Xoe({multigraph:!0,compound:!0}),e=n0(t.graph());return o.setGraph(Me.merge({},tre,t0(e,ere),Me.pick(e,nre))),Me.forEach(t.nodes(),function(n){var i=n0(t.node(n));o.setNode(n,Me.defaults(t0(i,ire),ore)),o.setParent(n,t.parent(n))}),Me.forEach(t.edges(),function(n){var i=n0(t.edge(n));o.setEdge(n,Me.merge({},are,t0(i,rre),Me.pick(i,sre)))}),o}function cre(t){var o=t.graph();o.ranksep/=2,Me.forEach(t.edges(),function(e){var n=t.edge(e);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(o.rankdir==="TB"||o.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function dre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);if(e.width&&e.height){var n=t.node(o.v),i=t.node(o.w),r={rank:(i.rank-n.rank)/2+n.rank,e:o};xi.addDummyNode(t,"edge-proxy",r,"_ep")}})}function ure(t){var o=0;Me.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,o=Me.max(o,n.maxRank))}),t.graph().maxRank=o}function pre(t){Me.forEach(t.nodes(),function(o){var e=t.node(o);e.dummy==="edge-proxy"&&(t.edge(e.e).labelRank=e.rank,t.removeNode(o))})}function hre(t){var o=Number.POSITIVE_INFINITY,e=0,n=Number.POSITIVE_INFINITY,i=0,r=t.graph(),a=r.marginx||0,s=r.marginy||0;function c(u){var h=u.x,g=u.y,C=u.width,k=u.height;o=Math.min(o,h-C/2),e=Math.max(e,h+C/2),n=Math.min(n,g-k/2),i=Math.max(i,g+k/2)}Me.forEach(t.nodes(),function(u){c(t.node(u))}),Me.forEach(t.edges(),function(u){var h=t.edge(u);Me.has(h,"x")&&c(h)}),o-=a,n-=s,Me.forEach(t.nodes(),function(u){var h=t.node(u);h.x-=o,h.y-=n}),Me.forEach(t.edges(),function(u){var h=t.edge(u);Me.forEach(h.points,function(g){g.x-=o,g.y-=n}),Me.has(h,"x")&&(h.x-=o),Me.has(h,"y")&&(h.y-=n)}),r.width=e-o+a,r.height=i-n+s}function fre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o),n=t.node(o.v),i=t.node(o.w),r,a;e.points?(r=e.points[0],a=e.points[e.points.length-1]):(e.points=[],r=i,a=n),e.points.unshift(xi.intersectRect(n,r)),e.points.push(xi.intersectRect(i,a))})}function mre(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);if(Me.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 _re(t){Me.forEach(t.edges(),function(o){var e=t.edge(o);e.reversed&&e.points.reverse()})}function gre(t){Me.forEach(t.nodes(),function(o){if(t.children(o).length){var e=t.node(o),n=t.node(e.borderTop),i=t.node(e.borderBottom),r=t.node(Me.last(e.borderLeft)),a=t.node(Me.last(e.borderRight));e.width=Math.abs(a.x-r.x),e.height=Math.abs(i.y-n.y),e.x=r.x+e.width/2,e.y=n.y+e.height/2}}),Me.forEach(t.nodes(),function(o){t.node(o).dummy==="border"&&t.removeNode(o)})}function bre(t){Me.forEach(t.edges(),function(o){if(o.v===o.w){var e=t.node(o.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:o,label:t.edge(o)}),t.removeEdge(o)}})}function vre(t){var o=xi.buildLayerMatrix(t);Me.forEach(o,function(e){var n=0;Me.forEach(e,function(i,r){var a=t.node(i);a.order=r+n,Me.forEach(a.selfEdges,function(s){xi.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 yre(t){Me.forEach(t.nodes(),function(o){var e=t.node(o);if(e.dummy==="selfedge"){var n=t.node(e.e.v),i=n.x+n.width/2,r=n.y,a=e.x-i,s=n.height/2;t.setEdge(e.e,e.label),t.removeNode(o),e.label.points=[{x:i+2*a/3,y:r-s},{x:i+5*a/6,y:r-s},{x:i+a,y:r},{x:i+5*a/6,y:r+s},{x:i+2*a/3,y:r+s}],e.label.x=e.x,e.label.y=e.y}})}function t0(t,o){return Me.mapValues(Me.pick(t,o),Number)}function n0(t){var o={};return Me.forEach(t,function(e,n){o[n.toLowerCase()]=e}),o}});var bD=v((pCe,gD)=>{"use strict";var af=et(),Cre=Nt(),xre=cn().Graph;gD.exports={debugOrdering:wre};function wre(t){var o=Cre.buildLayerMatrix(t),e=new xre({compound:!0,multigraph:!0}).setGraph({});return af.forEach(t.nodes(),function(n){e.setNode(n,{label:n}),e.setParent(n,"layer"+t.node(n).rank)}),af.forEach(t.edges(),function(n){e.setEdge(n.v,n.w,{},n.name)}),af.forEach(o,function(n,i){var r="layer"+i;e.setNode(r,{rank:"same"}),af.reduce(n,function(a,s){return e.setEdge(a,s,{style:"invis"}),s})}),e}});var yD=v((hCe,vD)=>{"use strict";vD.exports="0.8.5"});var xD=v((fCe,CD)=>{"use strict";CD.exports={graphlib:cn(),layout:_D(),debug:bD(),util:{time:Nt().time,notime:Nt().notime},version:yD()}});var Ob={rail:{label:"Files",collapse:"Collapse files panel",expand:"Expand files panel",resize:"Resize files panel",searchPlaceholder:"Search\u2026",searchAriaLabel:"Search nodes by name or tag"}};var ps=new be("MAP_ISOLATE_INTENT",{providedIn:"root",factory:()=>({isolate:()=>{}})});var Fb=`
|
|
2
2
|
.p-datatable {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: block;
|
|
@@ -2135,7 +2135,7 @@ function getSidePoint(rect, side) {
|
|
|
2135
2135
|
return null;
|
|
2136
2136
|
}
|
|
2137
2137
|
}
|
|
2138
|
-
`.trim();function Uy(t){return!!$y(t)}function $y(t){let o=t,e=o?.Blob,n=o?.Worker,i=o?.URL;return!e||!n||typeof i?.createObjectURL!="function"||typeof i.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:n,urlApi:i}}function r7(t){let o=new t.blobCtor([o7],{type:"text/javascript"});return t.urlApi.createObjectURL(o)}function Wy(t,o){if(!t)return;let e=o??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var Ui=(()=>{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,Wy(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})(),lu=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(o,e){this.connection=o,this.line=e}},a7=(()=>{let t=class $s{_mediator=p(V);_renderCache=new WeakMap;handle({connection:e,line:n}){!this._mediator.execute(new Mo(e))&&!this._shouldRender(e,n)||(e.setLine(n),e.initialize())}_shouldRender(e,n){let i=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,n),a=this._renderCache.get(e);return a?.signature===r&&a.pathElement===i?!1:(this._renderCache.set(e,{signature:r,pathElement:i}),!0)}_createConnectionRenderSignature(e,n){let{sourceSide:i,targetSide:r}=e.getResolvedSides();return[e.fBehavior,e.fType,e.fRadius,e.fOffset,e.fReassignableStart(),this._serializeContents([...e.fContents()||[]]),i,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||$s)};static \u0275prov=y({token:$s,factory:$s.\u0275fac})};return t=P([R(lu)],t),t})(),cu=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(o,e){this.source=o,this.target=e}},s7=(()=>{let t=class Ws{_state=p(Th);handle({source:e,target:n}){e.setConnected(n),n.setConnected(e),this._state.trackConnectedConnectors(e,n)}static \u0275fac=function(n){return new(n||Ws)};static \u0275prov=y({token:Ws,factory:Ws.\u0275fac})};return t=P([R(cu)],t),t})(),di=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(o,e=!0){this.element=o,this.cache=e}},l7={enabled:!1},Mn=new be("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>ge({},l7)});var du=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(o,e,n,i){this.id=o,this.nodeId=e,this.kind=n,this.element=i}},Dn=(()=>{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})(),Nm=class{key;id;kind;nodeId;element;rect;constructor(o,e,n,i,r,a){this.key=o,this.id=e,this.kind=n,this.nodeId=i,this.element=r,this.rect=a}},kr=class{static build(o,e){return`${o}:${e}`}},Am=class{id;element;reference;rect;constructor(o,e,n,i){this.id=o,this.element=e,this.reference=n,this.rect=i}},Do=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(o,e="manual"){this.nodeId=o,this.reason=e}},c7=(()=>{let t=class Ks{_store=p(Dn);_options=p(Mn);handle({nodeId:e,reason:n}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;i.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||Ks)};static \u0275prov=y({token:Ks,factory:Ks.\u0275fac})};return t=P([R(Do)],t),t})(),uu=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(o,e,n){this.id=o,this.element=e,this.reference=n}},d7=(()=>{let t=class Ys{_store=p(Dn);_options=p(Mn);handle({id:e,element:n,reference:i}){if(!this._options.enabled)return;let r=new Am(e,n,i);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||Ys)};static \u0275prov=y({token:Ys,factory:Ys.\u0275fac})};return t=P([R(uu)],t),t})(),pu=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(o){this.id=o}},u7=(()=>{let t=class Xs{_store=p(Dn);_mediator=p(V);_options=p(Mn);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 i=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of i){let a=this._store.connectorEntries.get(r);a&&this._mediator.execute(new Ir(a.id,a.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(n){return new(n||Xs)};static \u0275prov=y({token:Xs,factory:Xs.\u0275fac})};return t=P([R(pu)],t),t})(),p7=(()=>{let t=class Zs{_store=p(Dn);_mediator=p(V);_options=p(Mn);handle({id:e,nodeId:n,kind:i,element:r}){if(!this._options.enabled)return;let a=kr.build(e,i),s=this._store.connectorEntries.get(a);s&&(this._detachConnectorFromNode(s.key,s.nodeId),this._store.connectorKeyByElement.delete(s.element));let c=new Nm(a,e,i,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 Do(n,"connector-registered"))}_detachConnectorFromNode(e,n){let i=this._store.connectorKeysByNodeId.get(n);i&&(i.delete(e),i.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Zs)};static \u0275prov=y({token:Zs,factory:Zs.\u0275fac})};return t=P([R(du)],t),t})(),Ir=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(o,e){this.connectorId=o,this.kind=e}},h7=(()=>{let t=class Qs{_store=p(Dn);_mediator=p(V);_options=p(Mn);handle({connectorId:e,kind:n}){if(!this._options.enabled)return;let i=kr.build(e,n),r=this._store.connectorEntries.get(i);r&&(this._store.connectorEntries.delete(i),this._store.connectorKeyByElement.delete(r.element),this._detachConnectorFromNode(i,r.nodeId),this._store.nodeEntries.has(r.nodeId)&&this._mediator.execute(new Do(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,n){let i=this._store.connectorKeysByNodeId.get(n);i&&(i.delete(e),i.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Qs)};static \u0275prov=y({token:Qs,factory:Qs.\u0275fac})};return t=P([R(Ir)],t),t})(),Po=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(o){this.element=o}},f7=(()=>{let t=class Js{_store=p(Dn);_options=p(Mn);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 i=this._store.connectorKeyByElement.get(e);if(i)return this._store.connectorEntries.get(i)?.rect??void 0}static \u0275fac=function(n){return new(n||Js)};static \u0275prov=y({token:Js,factory:Js.\u0275fac})};return t=P([R(Po)],t),t})(),Bi=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(o,e,n){this.connectorId=o,this.kind=e,this.rect=n}},m7=(()=>{let t=class el{_store=p(Dn);_options=p(Mn);handle({connectorId:e,kind:n,rect:i}){if(!this._options.enabled)return;let r=kr.build(e,n),a=this._store.connectorEntries.get(r);a&&(a.rect=rt.fromRoundedRect(i))}static \u0275fac=function(n){return new(n||el)};static \u0275prov=y({token:el,factory:el.\u0275fac})};return t=P([R(Bi)],t),t})(),Vi=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(o,e){this.nodeId=o,this.rect=e}},_7=(()=>{let t=class tl{_store=p(Dn);_options=p(Mn);handle({nodeId:e,rect:n}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;let r=i.rect;i.rect=te.initialize(n.x,n.y,n.width,n.height),r&&this._updateConnectorRectsByNodeRect(e,r,i.rect)}_updateConnectorRectsByNodeRect(e,n,i){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let a=i.x-n.x,s=i.y-n.y,c=n.width!==0,u=n.height!==0,h=c?i.width/n.width:1,g=u?i.height/n.height:1;for(let C of r){let k=this._store.connectorEntries.get(C);if(!k?.rect)continue;let I=k.rect,N=I.gravityCenter,q=c?i.x+(N.x-n.x)*h:N.x+a,Y=u?i.y+(N.y-n.y)*g:N.y+s;k.rect=new rt(q-I.width/2,Y-I.height/2,I.width,I.height,I.radius1,I.radius2,I.radius3,I.radius4)}}static \u0275fac=function(n){return new(n||tl)};static \u0275prov=y({token:tl,factory:tl.\u0275fac})};return t=P([R(Vi)],t),t})(),Er=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(o,e){this.element=o,this.rect=e}},g7=(()=>{let t=class nl{_store=p(Dn);_options=p(Mn);handle({element:e,rect:n}){if(!this._options.enabled)return;let i=this._store.nodeIdByElement.get(e);if(i){let s=this._store.nodeEntries.get(i);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||nl)};static \u0275prov=y({token:nl,factory:nl.\u0275fac})};return t=P([R(Er)],t),t})(),b7=[Dn,d7,u7,c7,p7,h7,f7,_7,m7,g7];function qo(t,o,e){return o?pe.fromPoint(t).elementTransform(o).sub(e.scaledPosition).sub(e.position).div(e.scale):pe.fromPoint(t)}function Ky(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function Ro(t){return t?`${t}`:void 0}var v7=(()=>{let t=class il{_store=p(L);_mediator=p(V);_browser=p(at);get _transform(){return this._store.transform}handle({element:e,cache:n}){let i=this._mediator.execute(new Po(e));if(i&&n)return i;let r=this._getElementRoundedRect(e),a=this._normalizePosition(r),s=this._unscaleSize(r),c=this._getUnscaledRect(a,s,r),u=this._getOffsetSize(e,s),h=rt.fromCenter(c,u.width,u.height);return this._mediator.execute(new Er(e,h)),h}_getElementRoundedRect(e){return this._getRoundedRect(te.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,n,i){let[r,a,s,c]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(i.borderTopLeftRadius,n,i.fontSize),this._getSystemRadius(i.borderTopRightRadius,n,i.fontSize),this._getSystemRadius(i.borderBottomRightRadius,n,i.fontSize),this._getSystemRadius(i.borderBottomLeftRadius,n,i.fontSize)]);return new rt(e.x,e.y,e.width,e.height,r,a,s,c)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,n,i){return this._browser.toPixels(e,n.clientWidth,n.clientHeight,i)||0}_getSystemRadius(e,n,i){return this._toPixels(e,n,i)*this._transform.scale}_normalizeCircularBorderRadii(e,n,i){let[r,a,s,c]=i.map(h=>Math.max(0,h)),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 qo(e,this._store.flowHost,this._transform)}_unscaleSize(e){return Ot.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n,i){return new rt(e.x,e.y,n.width,n.height,this._unscaleRadius(i.radius1),this._unscaleRadius(i.radius2),this._unscaleRadius(i.radius3),this._unscaleRadius(i.radius4))}_unscaleRadius(e){return e/this._transform.scale}_getOffsetSize(e,n){return Ot.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||il)};static \u0275prov=y({token:il,factory:il.\u0275fac})};return t=P([R(di)],t),t})(),hu=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(o,e){this.connector=o,this.cache=e}},y7=(()=>{let t=class ol{_mediator=p(V);handle({connector:e,cache:n}){let i=this._buildCacheKey(e),r=n.get(i)??this._calculateRect(e);return n.set(i,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new di(e.hostElement))}static \u0275fac=function(n){return new(n||ol)};static \u0275prov=y({token:ol,factory:ol.\u0275fac})};return t=P([R(hu)],t),t})(),fu=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(o){this.connection=o}},C7=(()=>{let t=class rl{_store=p(L);handle({connection:e}){let n=this._store.outputs.get(e.fOutputId()),i=this._store.inputs.get(e.fInputId());return!n||!i?null:{source:n,target:i}}static \u0275fac=function(n){return new(n||rl)};static \u0275prov=y({token:rl,factory:rl.\u0275fac})};return t=P([R(fu)],t),t})(),Mr=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(o,e){this.connection=o,this.cache=e}},x7=(()=>{let t=class al{_mediator=p(V);handle({connection:e,cache:n}){let i=this._resolveConnectionEndpoints(e);return i?Dt(ge({},i),{sourceRect:this._resolveEndpointRect(i.source,n),targetRect:this._resolveEndpointRect(i.target,n)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new fu(e))}_resolveEndpointRect(e,n){return this._mediator.execute(new hu(e,n))}static \u0275fac=function(n){return new(n||al)};static \u0275prov=y({token:al,factory:al.\u0275fac})};return t=P([R(Mr)],t),t})(),it=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(o){this.element=o}},w7=(()=>{let t=class sl{_store=p(L);_mediator=p(V);get _transform(){return this._store.transform}handle({element:e}){let n=this._mediator.execute(new Po(e));if(n)return n;let i=te.fromElement(e),r=this._normalizePosition(i),a=this._unscaleSize(i),s=this._getUnscaledRect(r,a),c=this._getOffsetSize(e,a),u=this._fromCenter(s,c.width,c.height);return this._mediator.execute(new Er(e,u)),u}_fromCenter(e,n,i){return te.initialize(e.gravityCenter.x-n/2,e.gravityCenter.y-i/2,n,i)}_normalizePosition(e){return qo(e,this._store.flowHost,this._transform)}_unscaleSize(e){return Ot.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n){return new rt(e.x,e.y,n.width,n.height)}_getOffsetSize(e,n){return Ot.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||sl)};static \u0275prov=y({token:sl,factory:sl.\u0275fac})};return t=P([R(it)],t),t})(),zn=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(o){this.connector=o}},T7=(()=>{let t=class ll{_store=p(L);_mediator=p(V);handle({connector:e}){if(!e)return;let n=this._store.nodes.get(e.fNodeId);if(!n||!n._rotate)return;let i=this._mediator.execute(new it(n.hostElement));return{rotationDeg:n._rotate,pivot:i.gravityCenter}}static \u0275fac=function(n){return new(n||ll)};static \u0275prov=y({token:ll,factory:ll.\u0275fac})};return t=P([R(zn)],t),t})(),mu=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(o,e){this.connection=o,this.geometry=e}},S7=(()=>{let t=class cl{_mediator=p(V);_connectionBehaviour=p(Ho);handle({connection:e,geometry:n}){return this._connectionBehaviour.handle(new vn(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 zn(e))}static \u0275fac=function(n){return new(n||cl)};static \u0275prov=y({token:cl,factory:cl.\u0275fac})};return t=P([R(mu)],t),t})(),Dr=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(o,e,n,i){this.connection=o,this.source=e,this.target=n,this.line=i}},k7=(()=>{let t=class dl{_mediator=p(V);handle({connection:e,source:n,target:i,line:r}){this._mediator.execute(new cu(n,i)),this._mediator.execute(new lu(e,r))}static \u0275fac=function(n){return new(n||dl)};static \u0275prov=y({token:dl,factory:dl.\u0275fac})};return t=P([R(Dr)],t),t})(),Pr=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(o,e){this.connection=o,this.geometry=e}},I7=(()=>{let t=class ul{_mediator=p(V);handle({connection:e,geometry:n}){let i=this._mediator.execute(new mu(e,n));this._mediator.execute(new Dr(e,n.source,n.target,i))}static \u0275fac=function(n){return new(n||ul)};static \u0275prov=y({token:ul,factory:ul.\u0275fac})};return t=P([R(Pr)],t),t})(),_u=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(o,e){this.connection=o,this.cache=e}},E7=(()=>{let t=class pl{_mediator=p(V);handle({connection:e,cache:n}){let i=this._mediator.execute(new Mr(e,n));i&&this._mediator.execute(new Pr(e,i))}static \u0275fac=function(n){return new(n||pl)};static \u0275prov=y({token:pl,factory:pl.\u0275fac})};return t=P([R(_u)],t),t})(),zi=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(o){this.session=o}},M7=(()=>{let t=class hl{_store=p(L);_state=p(Th);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(n){return new(n||hl)};static \u0275prov=y({token:hl,factory:hl.\u0275fac})};return t=P([R(zi)],t),t})(),Rr=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(o){this.session=o}},D7=(()=>{let t=class fl{_mediator=p(V);_store=p(L);handle({session:e}){this._mediator.execute(new zi(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(n){return new(n||fl)};static \u0275prov=y({token:fl,factory:fl.\u0275fac})};return t=P([R(Rr)],t),t})(),gu=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(o,e){this.batchItem=o,this.result=e}},P7=(()=>{let t=class ml{_mediator=p(V);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 Dr(e.connection,e.geometry.source,e.geometry.target,n.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new Pr(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(n){return new(n||ml)};static \u0275prov=y({token:ml,factory:ml.\u0275fac})};return t=P([R(gu)],t),t})(),ai=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(o,e,n,i,r,a){this.connections=o,this.cache=e,this.startIndex=n,this.session=i,this.batchItems=r,this.workerResults=a}},R7=500,O7=6,F7=(()=>{let t=class _l{_mediator=p(V);_browser=p(at);handle({connections:e,cache:n,startIndex:i,session:r,batchItems:a,workerResults:s}){if(!this._isCurrent(r))return;let c=this._now(),u=i,h=0;for(;u<e.length&&h<R7&&this._isWithinSliceBudget(c);){let g=e[u];if(a?this._mediator.execute(new gu(a[u]??null,s?.[u])):this._mediator.execute(new _u(g,n)),u++,h++,!this._isCurrent(r))return}if(u>=e.length){this._mediator.execute(new Rr(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new ai(e,n,u,r,a,s)))}_isCurrent(e){return this._mediator.execute(new zi(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<O7:!0}static \u0275fac=function(n){return new(n||_l)};static \u0275prov=y({token:_l,factory:_l.\u0275fac})};return t=P([R(ai)],t),t})(),bu=class{static fToken=Symbol("StartConnectionRedrawRequest")},N7=(()=>{let t=class gl{_store=p(L);_state=p(Th);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||gl)};static \u0275prov=y({token:gl,factory:gl.\u0275fac})};return t=P([R(bu)],t),t})(),Or=class{static fToken=Symbol("RedrawConnectionsRequest")},vu=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(o){this.connectionCount=o}},Fr=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},A7=(()=>{let t=class bl{_browser=p(at);_state=p(Ui);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let n=this._browser.document.defaultView;return Uy(n)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(n){return new(n||bl)};static \u0275prov=y({token:bl,factory:bl.\u0275fac})};return t=P([R(Fr)],t),t})(),L7=(()=>{let t=class vl{_mediator=p(V);handle({connectionCount:e}){return e>0&&this._mediator.execute(new Fr)}static \u0275fac=function(n){return new(n||vl)};static \u0275prov=y({token:vl,factory:vl.\u0275fac})};return t=P([R(vu)],t),t})(),yu=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(o,e,n){this.connection=o,this.geometry=e,this.originalIndex=n}},B7=(()=>{let t=class yl{_store=p(L);handle({connection:e,geometry:n,originalIndex:i}){let{source:r,target:a,sourceRect:s,targetRect:c}=n;return{originalIndex:i,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||yl)};static \u0275prov=y({token:yl,factory:yl.\u0275fac})};return t=P([R(yu)],t),t})(),Cu=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(o,e){this.connections=o,this.cache=e}},V7=(()=>{let t=class Cl{_mediator=p(V);handle({connections:e,cache:n}){let i=new Array(e.length),r=[];for(let a=0;a<e.length;a++){let s=this._buildBatchItem(e[a],n,a);i[a]=s,s&&r.push(s.payload)}return{items:i,payload:r}}_buildBatchItem(e,n,i){let r=this._mediator.execute(new Mr(e,n));return r?{connection:e,geometry:r,payload:this._mediator.execute(new yu(e,r,i))}:null}static \u0275fac=function(n){return new(n||Cl)};static \u0275prov=y({token:Cl,factory:Cl.\u0275fac})};return t=P([R(Cu)],t),t})(),xu=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(o){this.error=o}},Nr=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(o){this.error=o}},z7=(()=>{let t=class xl{_state=p(Ui);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(n){return new(n||xl)};static \u0275prov=y({token:xl,factory:xl.\u0275fac})};return t=P([R(Nr)],t),t})(),H7=(()=>{let t=class wl{_state=p(Ui);_mediator=p(V);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new Nr(e))}static \u0275fac=function(n){return new(n||wl)};static \u0275prov=y({token:wl,factory:wl.\u0275fac})};return t=P([R(xu)],t),t})(),wu=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(o){this.message=o}},q7=(()=>{let t=class Tl{_state=p(Ui);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||Tl)};static \u0275prov=y({token:Tl,factory:Tl.\u0275fac})};return t=P([R(wu)],t),t})(),Tu=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},G7=(()=>{let t=class Sl{_browser=p(at);_state=p(Ui);_mediator=p(V);handle(e){if(this._state.worker)return this._state.worker;let n=this._browser.document.defaultView;if(!Uy(n))return null;let i=$y(n);if(!i)return null;let r=r7(i);try{let a=new i.workerCtor(r,{name:"f-flow-connection-worker"});return a.onmessage=s=>{this._mediator.execute(new wu(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 Wy(r,i.urlApi),this._disableWorker(a instanceof Error?a:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new xu(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new Nr(e))}static \u0275fac=function(n){return new(n||Sl)};static \u0275prov=y({token:Sl,factory:Sl.\u0275fac})};return t=P([R(Tu)],t),t})(),Su=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(o){this.payload=o}},j7=(()=>{let t=class kl{_state=p(Ui);_mediator=p(V);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new Fr))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let n=this._mediator.execute(new Tu);if(!n)return Promise.reject(new Error("Unable to initialize connection worker."));let i=++this._state.nextRequestId;return new Promise((r,a)=>{this._state.pending.set(i,{resolve:r,reject:a});try{n.postMessage({requestId:i,items:e})}catch(s){this._state.pending.delete(i),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||kl)};static \u0275prov=y({token:kl,factory:kl.\u0275fac})};return t=P([R(Su)],t),t})(),ku=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(o){this.batch=o}},U7=(()=>{let t=class Il{_mediator=p(V);handle({batch:e}){return e.payload.length?this._mediator.execute(new Su(e.payload)):Promise.resolve([])}static \u0275fac=function(n){return new(n||Il)};static \u0275prov=y({token:Il,factory:Il.\u0275fac})};return t=P([R(ku)],t),t})(),Iu=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(o,e,n){this.connections=o,this.cache=e,this.session=n}},$7=(()=>{let t=class El{_mediator=p(V);handle({connections:e,cache:n,session:i}){let r=this._mediator.execute(new Cu(e,n));if(!r.payload.length){this._mediator.execute(new ai(e,n,0,i,r.items));return}this._mediator.execute(new ku(r)).then(a=>{this._mediator.execute(new zi(i))&&this._mediator.execute(new ai(e,n,0,i,r.items,this._alignWorkerResults(a,e.length)))}).catch(()=>{this._mediator.execute(new zi(i))&&this._mediator.execute(new ai(e,n,0,i,r.items))})}_alignWorkerResults(e,n){let i=new Array(n);for(let r of e){let a=r.originalIndex;a<0||a>=n||(i[a]=r)}return i}static \u0275fac=function(n){return new(n||El)};static \u0275prov=y({token:El,factory:El.\u0275fac})};return t=P([R(Iu)],t),t})(),W7=(()=>{let t=class Ml{_mediator=p(V);_store=p(L);handle(e){let n=this._mediator.execute(new bu);this._createMarkersForCreate(),this._createMarkersForSnap();let i=[...this._store.connections.getAll()],r=new Map;if(!i.length){this._mediator.execute(new Rr(n));return}this._shouldUseConnectionWorker(i.length)?this._redrawUsingWorker(i,r,n):this._redrawWithoutWorker(i,r,n)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new Mo(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new Mo(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new vu(e))}_redrawUsingWorker(e,n,i){this._mediator.execute(new Iu(e,n,i))}_redrawWithoutWorker(e,n,i){this._mediator.execute(new ai(e,n,0,i))}static \u0275fac=function(n){return new(n||Ml)};static \u0275prov=y({token:Ml,factory:Ml.\u0275fac})};return t=P([R(Or)],t),t})(),Lm=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},K7=(()=>{let t=class Dl{_store=p(L);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(n){return new(n||Dl)};static \u0275prov=y({token:Dl,factory:Dl.\u0275fac})};return t=P([R(Lm)],t),t})(),Eu=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(o){this.connection=o}},Y7=(()=>{let t=class Pl{_store=p(L);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Pl)};static \u0275prov=y({token:Pl,factory:Pl.\u0275fac})};return t=P([R(Eu)],t),t})(),Mu=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(o){this.instance=o}},X7=(()=>{let t=class Rl{_store=p(L);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Rl)};static \u0275prov=y({token:Rl,factory:Rl.\u0275fac})};return t=P([R(Mu)],t),t})(),Bm=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(o,e){this.waypointIndex=o,this.connectionId=e}},Du=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},Z7=(()=>{let t=class Ol{_store=p(L);_dragSession=p(he);handle(e){this._store.flowHost.classList.remove(ht.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(n){return new(n||Ol)};static \u0275prov=y({token:Ol,factory:Ol.\u0275fac})};return t=P([R(Du)],t),t})(),Pu=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},Q7=(()=>{let t=class Fl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(ht.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new Ar),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Lu(e.kind,e.data?ge({},e.data):void 0,e.fEventType))}static \u0275fac=function(n){return new(n||Fl)};static \u0275prov=y({token:Fl,factory:Fl.\u0275fac})};return t=P([R(Pu)],t),t})(),Ar=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},Hi=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(o,e){this._event=o,this._target=e}setTarget(o){this._target=o}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},Ru=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},Vm=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){let o=this.originalEvent;return o.pointerType==="mouse"&&o.button===0||o.pointerType==="touch"}isMouseRightButton(){let o=this.originalEvent;return o.pointerType==="mouse"&&o.button===2||o.pointerType==="touch"}getPosition(){let o=this.originalEvent;return{x:o.clientX,y:o.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},zm=class extends Hi{constructor(o){super(o)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let o=this.originalEvent.touches;return{x:o[0].clientX,y:o[0].clientY}}},Hm=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let o=this.originalEvent.targetTouches[0];return{x:o.clientX,y:o.clientY}}},He=(()=>{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})(),J7=800,qm=class{_document=p(Ua);_ngZone=p(Jt,{optional:!0});_mouseListeners=He.emptyListener();_touchListeners=He.emptyListener();_startListeners=He.emptyListener();isSyntheticEvent(o){return!!this._lastTouchEventTime&&this._lastTouchEventTime+J7>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=o=>{let e=this.isSyntheticEvent(o),n=tB(o),i=new Ru(o);if(e||n||this.disabled||this.isDragStarted)return;this._pointerDownElement=i.targetElement,this.onPointerDown(i)&&(this._dragStartTime=Date.now(),this._dragStartPosition=i.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,He.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,He.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,He.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,He.activeCaptureListener())})};_onTouchDown=o=>{let e=nB(o),n=new zm(o);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,He.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,He.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,He.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,He.activeCaptureListener())})};_onSelectStart=o=>{this.onSelect(o)};_onMouseMove=o=>{this._moveHandler(new Ru(o))};_onTouchMove=o=>{this._moveHandler(new Hm(o))};_checkDragSequenceToStart(o){let e=o.getPosition();if(!this.isDragStarted&&this._pointerDownElement){o.setTarget(this._pointerDownElement);let n=Math.abs(e.x-this._dragStartPosition.x),i=Math.abs(e.y-this._dragStartPosition.y);if(n+i>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}o.preventDefault(),this.prepareDragSequence(o),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,eB(o.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=o=>{this.isDragStarted&&this.onPointerUp(new Vm(o)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=He.emptyListener(),this._touchListeners(),this._touchListeners=He.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,He.activeListener()),this._listen("touchstart",this._onTouchDown,He.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,He.activeListener()),this._unlisten("touchstart",this._onTouchDown,He.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=He.emptyListener(),this._touchListeners(),this._touchListeners=He.emptyListener(),this._mouseListeners(),this._mouseListeners=He.emptyListener()}_listen(o,e,n){this._document.addEventListener(o,e,n)}_unlisten(o,e,n){this._document.removeEventListener(o,e,n)}_preventDuringDrag=o=>{this.isDragStarted&&o.preventDefault()}};function eB(t){return t.type[0]==="t"}function tB(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function nB(t){let o=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!o&&o.identifier===-1&&(o.radiusX==null||o.radiusX===1)&&(o.radiusY==null||o.radiusY===1)}var Gm=class extends Hi{_position;_isMouseLeftButton;_isMouseRightButton;constructor(o){super(o.originalEvent,o.targetElement),this._position=o.getPosition(),this._isMouseLeftButton=o.isMouseLeftButton(),this._isMouseRightButton=o.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return ge({},this._position)}};function iB(t){return new Gm(t)}var he=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new pe(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 pe(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=iB(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})(),jm=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(o,e,n){this.nodeIds=o,this.groupIds=e,this.connectionIds=n}},oB=(()=>{let t=class Nl{_mediator=p(V);_store=p(L);_dragSession=p(he);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new si))}_getSelection(){return this._mediator.execute(new ra)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new jm(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(n){return new(n||Nl)};static \u0275prov=y({token:Nl,factory:Nl.\u0275fac})};return t=P([R(Ar)],t),t})(),Um=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(o){this.nodeOrGroup=o}},rB=(()=>{let t=class Al{_store=p(L);_mediator=p(V);handle({nodeOrGroup:e}){let n=te.initialize(-1/0,-1/0,1/0,1/0),i=this._getNode(e.fParentId());return i&&(n=this._getParentRect(i)),n}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let n=this._getNodeRect(e),i=this._getNodePadding(e,n);return te.initialize(n.x+i[0],n.y+i[1],n.width-i[0]-i[2],n.height-i[1]-i[3])}_getNodeRect(e){return this._mediator.execute(new it(e.hostElement))}_getNodePadding(e,n){return this._mediator.execute(new Gi(e,n))}static \u0275fac=function(n){return new(n||Al)};static \u0275prov=y({token:Al,factory:Al.\u0275fac})};return t=P([R(Um)],t),t})(),$m=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(o,e){this.fParentNodes=o,this.fDraggedNodes=e}},aB=(()=>{let t=class Ll{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(i=>e.includes(i.fId()))}static \u0275fac=function(n){return new(n||Ll)};static \u0275prov=y({token:Ll,factory:Ll.\u0275fac})};return t=P([R($m)],t),t})(),Wm=class{fNodeId;fConnectionIds;constructor(o,e){this.fNodeId=o,this.fConnectionIds=e}},Ou=class extends Wm{nodeId;connectionIds;constructor(o,e){super(o,e),this.nodeId=o,this.connectionIds=e}},Fu=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(o){this.nodeOrGroup=o}},sB=(()=>{let t=class Bl{_mediator=p(V);_store=p(L);handle({nodeOrGroup:e}){let n=this._collectConnectableConnectorIds(e,"source"),i=this._collectConnectableConnectorIds(e,"target");if(!n.size||!i.size)return;let r=this._collectAttachedConnectionIds(n,i),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 Ou(e.fId(),s)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Ou(e.fId(),s)))}_collectConnectableConnectorIds(e,n){let i=n==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let a of i)a.canBeConnected&&e.isContains(a.hostElement)&&r.add(a.fId());return r}_collectAttachedConnectionIds(e,n){let i=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||n.has(r.fInputId()))&&i.add(r.fId());return i}_collectConnectionsUnderNode(e){let n=this._mediator.execute(new di(e.hostElement,!1)),i=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,n)&&i.push(r);return i}_hasIntersection(e,n){return Co.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,n).length>0}static \u0275fac=function(n){return new(n||Bl)};static \u0275prov=y({token:Bl,factory:Bl.\u0275fac})};return t=P([R(Fu)],t),t})(),lB=[Q7,Z7,oB,rB,aB,sB],cB=new Set(["create-connection","reassign-connection","drag-node"]),dB=new Set(["selection-area"]),uB=new Set(["assign-to-container"]);function Yy(t){let o=null;for(let e of t){if(uB.has(e))continue;let n=cB.has(e)?"rebase":dB.has(e)?"direct":null;if(!n)return null;if(!o){o=n;continue}if(o!==n)return null}return o}function Xy(t,o,e,n,i){return U.initialize(dy(t.x,o.left,o.right,e,n,i),dy(t.y,o.top,o.bottom,e,n,i))}function dy(t,o,e,n,i,r){let a=Math.max(0,n),s=Math.max(0,i);if(!a||!s)return 0;if(t<=o+a){let c=py((o+a-t)/a,0,1);return uy(c,s,r)}if(t>=e-a){let c=py((t-(e-a))/a,0,1);return-uy(c,s,r)}return 0}function pB(t,o,e){let n=e||1;return pe.fromPoint(t).add(pe.fromPoint(o).div(n))}function uy(t,o,e){return e?o*t:o}function py(t,o,e){return Math.max(o,Math.min(e,t))}var Nu=class{static fToken=Symbol("RunAutoPanFrameRequest")},ui=class{static fToken=Symbol("StopAutoPanRequest")},hB=(()=>{let t=class Vl{_store=p(L);_dragContext=p(he);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||Vl)};static \u0275prov=y({token:Vl,factory:Vl.\u0275fac})};return t=P([R(ui)],t),t})(),Lr=class{static fToken=Symbol("SyncAutoPanRequest")},fB=(()=>{let t=class zl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new ui);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new Nu)}))}_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?U.initialize():Xy(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return Yy(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(Xe.AUTO_PAN)}static \u0275fac=function(n){return new(n||zl)};static \u0275prov=y({token:zl,factory:zl.\u0275fac})};return t=P([R(Lr)],t),t})(),mB=(()=>{let t=class Hl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){let n=this._getAutoPanMode();if(!this._canAutoPan(n)){this._mediator.execute(new ui);return}let i=this._getAutoPanDelta();if(!i.x&&!i.y){this._mediator.execute(new ui);return}this._applyCanvasDelta(i,n),this._replayLastPointerMove(),this._mediator.execute(new Lr)}_applyCanvasDelta(e,n){let i=this._store.transform;n==="rebase"&&(this._dragContext.onPointerDownPosition=pB(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||i.scale||1)),i.position=pe.fromPoint(i.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(i=>{i.onPointerMove(ge({},n),e)})}_getPointerPositionInCanvas(e){return pe.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 Yy(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?U.initialize():Xy(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(Xe.AUTO_PAN)}static \u0275fac=function(n){return new(n||Hl)};static \u0275prov=y({token:Hl,factory:Hl.\u0275fac})};return t=P([R(Nu)],t),t})(),_B=[fB,mB,hB],Au=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(o){this.event=o}},Lu=class{kind;data;fEventType;get fData(){return this.data}constructor(o,e,n){this.kind=o,this.data=e,this.fEventType=n??o}},Ft=class{data(){}_features=[];getEvent(){return new Lu(this.kind,this.data(),this.type)}attachFeature(o){this._features.push(o)}featuresPrepare(o){for(let e of this._features)e.onPrepare?.(o)}featuresMove(o,e){for(let n of this._features)n.onMove?.(o,e)}featuresFinalize(o,e){for(let n of this._features)n.onFinalize?.(o,e)}featuresEnd(o){for(let e of this._features)e.onEnd?.(o)}},Bu=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=K.AUTO;userFConnectableSide=K.AUTO;isContains(o){return this.hostElement.contains(o)}setConnected(o){this._isConnected=!0,this.toConnector.push(o)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},gB=new be("F_NODE_INPUT"),bB=(()=>{class t extends Bu{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})(),In=(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})(In||{});function vB(t){return xr(t,".f-rotate-handle")}var Zy=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Sh=new be("F_NODE"),yB=qy(class{hostElement;constructor(t){this.hostElement=t}}),Vu=class extends yB{_injector=p(dt);renderer=p(w0);browser=p(at);stateChanges=new rn;_position=U.initialize();_rotate=0;_size;connectors=[];positionChanges(){de(()=>{let o=this.position();tn(()=>{U.isEqual(this._position,o)||(this._position=o,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){de(()=>{let o=this.size();tn(()=>{this._isSizeEqual(o)||(this._size=o,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){de(()=>{let o=this.rotate();tn(()=>{this._rotate!==o&&(this._rotate=o,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){de(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),tn(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(o){return this._size?.width===o?.width&&this._size?.height===o?.height}isContains(o){return this.hostElement.contains(o)}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(o){this._position=o}updateRotate(o){this._rotate=o}updateSize(o){this._size=o}setClass(o){this.hostElement.classList.add(o)}removeClass(o){this.hostElement.classList.remove(o)}addConnector(o){this.connectors.push(o),this.refresh()}removeConnector(o){let e=this.connectors.indexOf(o);e!==-1&&this.connectors.splice(e,1),this.refresh()}},CB=0,xB=3,Km=(()=>{class t extends Vu{_debounceTimer=null;_destroyRef=p(xt);_mediator=p(V);fId=B(`f-group-${CB++}`,{alias:"fGroupId"});fParentId=B(null,{alias:"fGroupParentId"});position=Ei(U.initialize(),{alias:"fGroupPosition"});size=B(void 0,{alias:"fGroupSize"});sizeChange=Ke({alias:"fGroupSizeChange"});rotate=Ei(0,{alias:"fGroupRotate"});fConnectOnNode=B(!0,{transform:j});fMinimapClass=B([]);fDraggingDisabled=B(!1,{alias:"fGroupDraggingDisabled",transform:j});fSelectionDisabled=B(!1,{alias:"fGroupSelectionDisabled",transform:j});fIncludePadding=B(!0,{transform:j});fAutoExpandOnChildHit=B(!1,{transform:j});fAutoSizeToFitChildren=B(!1,{transform:j});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qr(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 si),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),xB))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Fo(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new ea(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ta(this))}static \u0275fac=function(n){return new(n||t)(un(Qe))};static \u0275dir=je({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-group-id",i.fId()),ue("f-group-dragging-disabled",i.fDraggingDisabled())("f-group-selection-disabled",i.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:[ke([{provide:Sh,useExisting:t}]),Z]})}return t})(),hy=0,wB=3,kh=(()=>{class t extends Vu{_debounceTimer=null;_destroyRef=p(xt);_mediator=p(V);fId=B(`f-node-${hy++}`,{alias:"fNodeId",transform:e=>Ro(e)||`f-node-${hy++}`});fParentId=B(null,{alias:"fNodeParentId"});position=Ei(U.initialize(),{alias:"fNodePosition"});size=B(void 0,{alias:"fNodeSize"});sizeChange=Ke({alias:"fNodeSizeChange"});rotate=Ei(0,{alias:"fNodeRotate"});fConnectOnNode=B(!0,{transform:j});fMinimapClass=B([]);fDraggingDisabled=B(!1,{alias:"fNodeDraggingDisabled",transform:j});fSelectionDisabled=B(!1,{alias:"fNodeSelectionDisabled",transform:j});fIncludePadding=B(!0,{transform:j});fAutoExpandOnChildHit=B(!1,{transform:j});fAutoSizeToFitChildren=B(!1,{transform:j});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qr(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 si),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),wB))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Fo(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new ea(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ta(this))}static \u0275fac=function(n){return new(n||t)(un(Qe))};static \u0275dir=je({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-node-id",i.fId()),ue("f-node-dragging-disabled",i.fDraggingDisabled())("f-node-selection-disabled",i.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:[ke([{provide:Sh,useExisting:t}]),Z]})}return t})();function TB(t){return!!t.closest("[fNode]")}var fy=0,Qy=(()=>{class t extends bB{hostElement=p(Qe).nativeElement;_mediator=p(V);_node=p(Sh);fId=B(`f-node-input-${fy++}`,{alias:"fInputId",transform:e=>Ro(e)||`f-node-input-${fy++}`});category=B(void 0,{alias:"fInputCategory",transform:Ro});multiple=B(!0,{alias:"fInputMultiple",transform:j});disabled=B(!1,{alias:"fInputDisabled",transform:j});userFConnectableSide=K.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yr(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new na(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-input-id",i.fId()),ue("f-node-input-multiple",i.multiple)("f-node-input-disabled",i.disabled()))},inputs:{fId:[1,"fInputId","fId"],category:[1,"fInputCategory","category"],multiple:[1,"fInputMultiple","multiple"],disabled:[1,"fInputDisabled","disabled"],userFConnectableSide:[2,"fInputConnectableSide","userFConnectableSide",e=>xo(e,"fInputConnectableSide",K)]},exportAs:["fNodeInput"],standalone:!1,features:[ke([{provide:gB,useExisting:t}]),Z,ro]})}return t})(),SB=(()=>{class t extends Bu{get hasConnectionLimits(){return!!this.canBeConnectedInputs&&this.canBeConnectedInputs.length>0}canConnectTo(e){return[e.fId(),e.category()].some(i=>i&&this.canBeConnectedInputs?.includes(i))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})();function Jy(t){return!!t.closest("[fNodeOutlet]")}var kB=new be("F_NODE_OUTPUT"),IB=(()=>{class t extends SB{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})();function eC(t){return!!t.closest("[fNodeOutput]")}var my=0,tC=(()=>{class t extends IB{hostElement=p(Qe).nativeElement;_mediator=p(V);_node=p(Sh);fId=B(`f-node-output-${my++}`,{alias:"fOutputId",transform:e=>Ro(e)||`f-node-output-${my++}`});multiple=B(!1,{alias:"fOutputMultiple",transform:j});disabled=B(!1,{alias:"fOutputDisabled",transform:j});userFConnectableSide=K.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yr(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new na(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(n,i){n&2&&(O("data-f-output-id",i.fId()),ue("f-node-output-multiple",i.multiple)("f-node-output-disabled",i.disabled())("f-node-output-self-connectable",i.isSelfConnectable))},inputs:{fId:[1,"fOutputId","fId"],multiple:[1,"fOutputMultiple","multiple"],disabled:[1,"fOutputDisabled","disabled"],userFConnectableSide:[2,"fOutputConnectableSide","userFConnectableSide",e=>xo(e,"fOutputConnectableSide",K)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[ke([{provide:kB,useExisting:t}]),Z,ro]})}return t})();var zu=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(o){this.event=o}},Br=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(o){this.outlet=o}},EB=(()=>{let t=class ql{_store=p(L);handle({outlet:e}){let n=this._findOwnerNode(e);if(!n)throw new Error("The fOutlet must belong to an fNode");let i=this._findFirstConnectableOutputInNode(n);if(!i)throw new Error("Outlet requires at least one connectable output in the same node.");return i}_findOwnerNode(e){let n=e.hostElement;return this._store.nodes.getAll().find(i=>i.isContains(n))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(n=>e.isContains(n.hostElement)&&n.canBeConnected)}static \u0275fac=function(n){return new(n||ql)};static \u0275prov=y({token:ql,factory:ql.\u0275fac})};return t=P([R(Br)],t),t})(),Ym=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(o,e,n){this.sourceId=o,this.targetId=e,this.dropPosition=n,this.fOutputId=o,this.fInputId=e,this.fDropPosition=n}},Hu=(()=>{class t extends Ft{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=p(hi);_mediator=p(V);_connectionBehaviour=p(Ho);_store=p(L);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new rt;initialize(e,n){this._sourceRef=this._mediator.execute(new Kt(e)),this._pointerDown=rt.fromRect(te.initialize(n.x,n.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(U.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Zr(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new Lo(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),i=this._findClosestTarget(n),r=i?.connector.fConnectableSide||K.TOP;this._drawCreateConnection(n,r);let a=this._snapConnection;if(!a)return;let s=i&&i.distance<a.fSnapThreshold?i:void 0;this._drawSnapConnection(s)}_findClosestTarget(e){return this._mediator.execute(new qi(e,this._targets))}_drawCreateConnection(e,n){let i=this._connectionBehaviour.handle(new vn(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,n,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(i),this._connection.redraw()}_drawSnapConnection(e){let n=this._snapConnection;if(!n)return;if(!e){n.hide();return}let i=this._connectionBehaviour.handle(new vn(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(i),n.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new Bo(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new zn(e))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),MB=(()=>{let t=class Gl{_result=p(hi);_mediator=p(V);_store=p(L);_dragContext=p(he);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 Hu)}_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 Jy(e.hostElement)?this._mediator.execute(new Br(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 Ym(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Xr(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(n){return new(n||Gl)};static \u0275prov=y({token:Gl,factory:Gl.\u0275fac})};return t=P([R(zu)],t),t})(),Vr=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(o,e){this.eventPosition=o,this.source=e}},DB=(()=>{let t=class jl{_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);get _transform(){return this._store.transform}handle({source:e,eventPosition:n}){this._dragContext.onPointerDownScale=this._transform.scale;let i=this._toFlowSpace(n);this._dragContext.onPointerDownPosition=i;let r=this._toCanvasSpace(i),a=this._dragInjector.get(Hu);a.initialize(e,r),this._dragContext.draggableItems=[a]}_toFlowSpace(e){return pe.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return pe.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||jl)};static \u0275prov=y({token:jl,factory:jl.\u0275fac})};return t=P([R(Vr)],t),t})(),qu=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(o,e){this.event=o,this.node=e}},PB=(()=>{let t=class Ul{_mediator=p(V);_store=p(L);handle({event:e,node:n}){let i=this._findOutlet(n);if(!i||(i.setOutputs(this._getOutputs(n)),!i.canBeConnected))return;let r=i.isConnectionFromOutlet?i:this._resolveOutput(i);!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 Br(e))}_startDrag(e,n){this._mediator.execute(new Vr(e,n))}static \u0275fac=function(n){return new(n||Ul)};static \u0275prov=y({token:Ul,factory:Ul.\u0275fac})};return t=P([R(qu)],t),t})(),Gu=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(o,e){this.event=o,this.node=e}},RB=(()=>{let t=class $l{_mediator=p(V);_store=p(L);handle({event:e,node:n}){if(!eC(e.targetElement)||this._hasOutlet(n))return;let i=this._findOutput(e.targetElement);!i||!i.canBeConnected||this._startDrag(e.getPosition(),i)}_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 Vr(e,n))}static \u0275fac=function(n){return new(n||$l)};static \u0275prov=y({token:$l,factory:$l.\u0275fac})};return t=P([R(Gu)],t),t})(),ju=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},OB=(()=>{let t=class Wl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle({event:e,fTrigger:n}){if(!this._isValidConditions()||!this._isValidTrigger(e,n))return;let i=Jy(e.targetElement),r=!i&&eC(e.targetElement);if(!i&&!r)return;let a=this._findOwnerNode(e.targetElement);a&&(i?this._mediator.execute(new qu(e,a)):this._mediator.execute(new Gu(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 an(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Wl)};static \u0275prov=y({token:Wl,factory:Wl.\u0275fac})};return t=P([R(ju)],t),t})(),Uu=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(o){this.event=o}},Xm=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(o,e,n,i,r,a,s){this.connectionId=o,this.endpoint=e,this.previousSourceId=n,this.nextSourceId=i,this.previousTargetId=r,this.nextTargetId=a,this.dropPosition=s,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=n,this.newSourceId=i,this.oldTargetId=r,this.newTargetId=a,this.dropPoint=s}},FB=(()=>{let t=class Kl{_dragResult=p(hi);_mediator=p(V);_store=p(L);_dragContext=p(he);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(),i=this._findConnectableConnector(e,n.candidates);i&&!this._isReassignedToDifferentConnector(n,i)||this._dragDirective.fReassignConnection.emit(this._buildEvent(n,e,i))}_findConnectableConnector(e,n){return this._mediator.execute(new Xr(e.getPosition(),n))}_isReassignedToDifferentConnector(e,n){let i=e.connection;return e.draggedEnd==="target"?i.fInputId()!==n.fId():i.fOutputId()!==n.fId()}_buildEvent(e,n,i){let r=e.connection;return new Xm(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?i?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?i?.fId():void 0,n.getPosition())}static \u0275fac=function(n){return new(n||Kl)};static \u0275prov=y({token:Kl,factory:Kl.\u0275fac})};return t=P([R(Uu)],t),t})(),$u=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}};function NB(t,o){return nC(t,o)||AB(t,o)}function nC(t,o){return t.fDragHandleEnd()?.point&&iC(o,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function AB(t,o){return!!t.fDragHandleStart()?.point&&iC(o,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function iC(t,o){return(t.x-o.x)**2+(t.y-o.y)**2<=8**2}function oC(t,o){return t&&t.distance<o.fSnapThreshold?t:void 0}function Wu(t){return rt.fromRect(te.initialize(t.x,t.y))}var Zm=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(o,e,n,i,r){this._mediator=o,this._behaviour=e,this._connection=n,this._sourceRef=i,this._targetRef=r,this._anchorRect=Wu(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Xp(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(o=>o.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new Lo(this._candidates.map(o=>o.connector)))}setSnapConnection(o){this._snap=o,o&&(o.fInputId.set(this._connection.fInputId()),o.initialize())}onPointerMove(o){let e=this._anchorRect.addPoint(o),n=this._findClosest(e.gravityCenter),i=n?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,i);let r=this._snap;r&&this._drawSnap(oC(n,r))}_findClosest(o){return this._mediator.execute(new qi(o,this._candidates))}_draw(o,e){let n=this._behaviour.handle(new vn(o,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(o){let e=this._snap;if(!e)return;if(!o){e.hide();return}let n=this._behaviour.handle(new vn(o.rect,this._targetRef.rect,e,o.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(o.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 Bo(this._candidates.map(o=>o.connector)))}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Qm=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(o,e,n,i,r){this._mediator=o,this._behaviour=e,this._connection=n,this._sourceRef=i,this._targetRef=r,this._anchorRect=Wu(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Zr(this._source,this._sourceRef.rect.gravityCenter));let o=this._connection.fInputId();o&&!this._candidates.some(e=>e.connector.fId()===o)&&this._candidates.push(this._targetRef),this._mediator.execute(new Lo(this._candidates.map(e=>e.connector)))}setSnapConnection(o){this._snap=o,o&&(o.fOutputId.set(this._connection.fOutputId()),o.initialize())}onPointerMove(o){let e=this._anchorRect.addPoint(o),n=this._findClosest(e.gravityCenter),i=n?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,i);let r=this._snap;r&&this._drawSnap(oC(n,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Bo(this._candidates.map(o=>o.connector)))}_findClosest(o){return this._mediator.execute(new qi(o,this._candidates))}_draw(o,e){let n=this._behaviour.handle(new vn(this._sourceRef.rect,o,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(n),this._connection.redraw()}_drawSnap(o){let e=this._snap;if(!e)return;if(!o){e.hide();return}let n=this._behaviour.handle(new vn(this._sourceRef.rect,o.rect,e,this._source.fConnectableSide,o.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(o.connector)));e.show(),e.setLine(n),e.redraw()}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Jm=(()=>{class t extends Ft{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=p(hi);_mediator=p(V);_connectionBehaviour=p(Ho);_store=p(L);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 Kt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new Kt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new Zm(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Qm(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:Wu(this._connection.line.point1),targetAnchorRect:Wu(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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),LB=(()=>{let t=class Yl{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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=qo(e.event.getPosition(),this._store.flowHost,this._transform),i=this._findConnectionAt(n);i&&(this._capturePointerDown(e),this._startDrag(i,n),queueMicrotask(()=>this._bringToFront(i)))}_findConnectionAt(e){return this._connections.find(n=>NB(n,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,n){let i=this._dragInjector.get(Jm);i.initialize(e,nC(e,n)),this._dragContext.draggableItems=[i]}_isValidTrigger(e){return an(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new ji(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Yl)};static \u0275prov=y({token:Yl,factory:Yl.\u0275fac})};return t=P([R($u)],t),t})(),Ku=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(o){this.event=o}},Yu=class{connectionId;waypoints;constructor(o,e){this.connectionId=o,this.waypoints=e}},Xu=(()=>{class t extends Ft{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=p(L);_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=ge({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=ge({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(U.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 Yu(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),BB=(()=>{let t=class Xl{_dragContext=p(he);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof Xu)}static \u0275fac=function(n){return new(n||Xl)};static \u0275prov=y({token:Xl,factory:Xl.\u0275fac})};return t=P([R(Ku)],t),t})(),Zu=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},VB=(()=>{let t=class Zl{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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=qo(e.event.getPosition(),this._flowHost,this._transform),i=this._pickControlPoint(n);if(!i||!this._isValidTrigger(e))return;let r=this._dragInjector.get(Xu);r.setPick(i),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._flowHost).div(this._transform.scale),this._dragContext.draggableItems=[r],queueMicrotask(()=>this._updateConnectionLayer(i.connection))}_pickControlPoint(e){if(this._dragContext.isEmpty())return p6(this._connections,e)}_isValidTrigger(e){return an(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new ji(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Zl)};static \u0275prov=y({token:Zl,factory:Zl.\u0275fac})};return t=P([R(Zu)],t),t})(),zB=[MB,DB,PB,EB,RB,OB,FB,LB,VB,BB],Qu=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(o){this.event=o}},HB=1,zr=(()=>{class t extends Ft{type="move-node-to-parent";kind="assign-to-container";_store=p(L);_dragSession=p(he);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(ht.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),HB)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(ht.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let n=this._getPointerInFlow(e),i=this._findTargetUnderPointer(n);i?this._setActiveTarget(i):this._clearActiveTarget()}_getPointerInFlow(e){let n=pe.fromPoint(this._dragSession.onPointerDownPosition).add(e),i=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return n.sub(i)}_findTargetUnderPointer(e){return this._candidateGroups.find(n=>te.isIncludePoint(n.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(ht.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(ht.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ju=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(o){this.nodesAndGroups=o}},e_=class{rootHandlers;participants;constructor(o,e){this.rootHandlers=o,this.participants=e}},t_=class{fNodeIds;constructor(o){this.fNodeIds=o}},I_="move-node",E_="drag-node";function qB(t){return t.getEvent().kind===E_||t.getEvent().fEventType===I_}var pi=(()=>{class t extends Ft{type=I_;kind=E_;data(){return new t_(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 i=n.getLastRect();e=e?te.union([e,i]):i}return e??te.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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ep=class{_limits;_quantizeStep;constructor(o,e=.5){this._limits=o,this._quantizeStep=e}applyInto(o,e){let{min:n,max:i}=this._limits,r=this._clamp(o.x,n.x,i.x),a=this._clamp(o.y,n.y,i.y),s=o.x-r,c=o.y-a,u=this._quantizeSigned(s,this._quantizeStep),h=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=h<0,e.edges.bottom=h>0,e.overflow.x=Math.abs(u),e.overflow.y=Math.abs(h)}_quantizeSigned(o,e){if(e<=0||o===0)return 0;let n=o/e;return(o>0?Math.ceil(n):Math.floor(n))*e}_clamp(o,e,n){return Math.min(Math.max(o,e),n)}},n_=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(o,e){this._pointerDown=e,this._vCellSize=o.vCellSize(),this._hCellSize=o.hCellSize(),this._snapWhileDragging=o.fCellSizeWhileDragging()}snap(o,e){let n=e||this._snapWhileDragging;return this._strategies[+n](o)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(o){return{x:this._snapToGrid(this._pointerDown.x+o.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+o.y,this._vCellSize)-this._pointerDown.y}}_noSnap(o){return o}_snapToGrid(o,e){return Math.round(o/e)*e}};function _y(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var i_=class{_snapper;_hardClamp;_hardResult=_y();_softClamps=[];_softResults=[];constructor(o,e,n){let i=o.get(L).fDraggable;this._snapper=new n_(i,e),this._hardClamp=new ep(n.hard,.5);for(let r of n.soft)this._softClamps.push(new ep(r.limits,.5)),this._softResults.push(_y())}apply(o,e=!1){let n=this._snapper.snap(o,e);this._hardClamp.applyInto(n,this._hardResult);let i={x:this._hardResult.value.x,y:this._hardResult.value.y};for(let r=0;r<this._softClamps.length;r++)this._softClamps[r].applyInto(i,this._softResults[r]);return{hardDelta:i,soft:this._softResults}}finalize(o){return this.apply(o,!0)}};function gy(t,o,e){let{x:n,y:i,width:r,height:a}=t;return e.right&&o.x>0&&(r+=o.x),e.left&&o.x>0&&(n-=o.x,r+=o.x),e.bottom&&o.y>0&&(a+=o.y),e.top&&o.y>0&&(i-=o.y,a+=o.y),te.initialize(n,i,r,a)}var o_=class extends Ft{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=I_;kind=E_;_startPosition=U.initialize();_startRect=te.initialize();_applyConstraints=o=>o;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=U.initialize();_softParentConnectionHandlers=[];_mediator;constructor(o,e,n=[],i=[],r=[]){super(),this._injector=o,this.nodeOrGroup=e,this.children=n,this.sourceConnectionHandlers=i,this.targetConnectionHandlers=r,this._mediator=o.get(V),this._startRect=this._mediator.execute(new it(e.hostElement)),this._startPosition=ge({},e._position)}setConstraints(o){this._constraints=o,this._deltaConstraints=new i_(this._injector,this._startPosition,o),this._applyConstraints=e=>{let n=this._deltaConstraints.apply(e);return this._applySoftExpansions(n.soft),n.hardDelta}}setSoftParentConnectionHandlers(o){this._softParentConnectionHandlers=o}finalizeConstraints(){this._applyConstraints=o=>{let e=this._deltaConstraints.finalize(o);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return te.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let o of this.children)o.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(ht.DRAG_AND_DROP.DRAGGING)}onPointerMove(o){let e=this._applyConstraints(o);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 o of this.children)o.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(ht.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(o){return U.sum(this._startPosition,o)}_redraw(o){this._lastPosition=o,this.nodeOrGroup.updatePosition(o),this._mediator.execute(new Vi(this.nodeOrGroup.fId(),te.initialize(o.x,o.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(o){this._lastSoftResults=o;for(let e=0;e<o.length;e++){let n=o[e],i=this._constraints.soft[e],r=gy(i.boundingRect,n.overflow,n.edges);this._commitParentRect(i.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(o,e){let n=o._position.x!==e.x||o._position.y!==e.y||o._size?.width!==e.width||o._size?.height!==e.height;return o.updateSize({width:e.width,height:e.height}),o.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new Vi(o.fId(),e)),o.redraw(),n}_updateParentConnectionHandlers(o){let e=this._softParentConnectionHandlers[o];if(!e)return;let n=new Map;for(let i of e.source){let r=this._readConnectorRect(i.connector,n);i.handler.setSourceDelta(this._buildDelta(i.baselineRect,r))}for(let i of e.target){let r=this._readConnectorRect(i.connector,n);i.handler.setTargetDelta(this._buildDelta(i.baselineRect,r))}}_readConnectorRect(o,e){let n=`${o.kind}::${o.fId()}`,i=e.get(n);if(i)return i;let r=this._mediator.execute(new Kt(o)).rect;return e.set(n,r),r}_buildDelta(o,e){return U.initialize(e.x-o.x,e.y-o.y)}_emitExpandedEvent(){for(let o=0;o<this._lastSoftResults.length;o++){let e=this._lastSoftResults[o];if(!e.overflow.x&&!e.overflow.y)continue;let n=this._constraints.soft[o],i=gy(n.boundingRect,e.overflow,e.edges);n.nodeOrGroup.sizeChange.emit(i)}}destroy(){for(let o of this.children)o.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=o=>o,this._softParentConnectionHandlers=[]}},GB=(()=>{let t=class Ql{_injector=p(dt);handle({nodesAndGroups:e}){let n=this._createHandlerByNodeId(e),i=this._linkParentsAndCollectRoots(e,n);return new e_(i,Array.from(n.values()))}_createHandlerByNodeId(e){let n=new Map;for(let i of e)n.set(i.fId(),new o_(this._injector,i));return n}_linkParentsAndCollectRoots(e,n){let i=[];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):i.push(a)}return i}static \u0275fac=function(n){return new(n||Ql)};static \u0275prov=y({token:Ql,factory:Ql.\u0275fac})};return t=P([R(Ju)],t),t})(),tp=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(o){this.nodeOrGroup=o}},Hr=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(o,e){this.nodeOrGroup=o,this.childrenPaddings=e}},r_=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(o,e,n,i){this.nodeOrGroup=o,this.boundingRect=e,this.innerRect=n,this.paddings=i}},jB=(()=>{let t=class Jl{_mediator=p(V);handle({nodeOrGroup:e,childrenPaddings:n}){let i=this._readBoundingRect(e),r=this._readOwnPaddings(e,i),a=[r[0]+n[0],r[1]+n[1],r[2]+n[2],r[3]+n[3]],s=te.initialize(i.x+a[0],i.y+a[1],i.width-a[0]-a[2],i.height-a[1]-a[3]);return new r_(e,i,s,a)}_readBoundingRect(e){return this._mediator.execute(new it(e.hostElement))}_readOwnPaddings(e,n){return this._mediator.execute(new Gi(e,n))}static \u0275fac=function(n){return new(n||Jl)};static \u0275prov=y({token:Jl,factory:Jl.\u0275fac})};return t=P([R(Hr)],t),t})(),UB=(()=>{let t=class ec{_mediator=p(V);handle({nodeOrGroup:e}){let n=this._readCurrentRect(e),i=this._readParentsChain(e);return this._buildConstraints(i,n)}_readCurrentRect(e){return this._mediator.execute(new it(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Ao(e))??[]}_buildConstraints(e,n){let i=[],r=Ky(),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))i.push(this._makeSoftLimit(s,c.boundingRect,u));else{r=u;break}}return{soft:i,hard:r}}_readParentBounds(e,n){return this._mediator.execute(new Hr(e,n))}_calculateDifference(e,n){return{min:this._calculateMinimumDifference(e,n),max:this._calculateMaximumDifference(e,n)}}_calculateMinimumDifference(e,n){return U.initialize(e.x-n.x,e.y-n.y)}_calculateMaximumDifference(e,n){return U.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,i){return{nodeOrGroup:e,boundingRect:n,initialSize:e._size,limits:i}}static \u0275fac=function(n){return new(n||ec)};static \u0275prov=y({token:ec,factory:ec.\u0275fac})};return t=P([R(tp)],t),t})(),np=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(o,e){this.rootHandlers=o,this.participants=e}},ip=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.constraints=e,this.handlerPool=n}},qr=class{_mediator=p(V);_store=p(L);_behaviour=p(Ho);_source;_target;_sourceRef;_targetRef;_sourceDelta=U.initialize();_targetDelta=U.initialize();connection;initialize(o){this.connection=o,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(o){this._sourceDelta=o,this._mediator.execute(new Bi(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,o)))}setTargetDelta(o){this._targetDelta=o,this._mediator.execute(new Bi(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,o)))}redraw(){let o=this._buildLine();this.connection.setLine(o),this.connection.redraw()}_buildLine(){let o=rt.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=rt.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new vn(o,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(o){return this._mediator.execute(new Kt(o))}_withDelta(o,e){return rt.fromRoundedRect(o).addPoint(e)}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Gr=(()=>{class t extends qr{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),jr=(()=>{class t extends qr{_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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ur=(()=>{class t extends qr{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),$B=(()=>{let t=class tc{_store=p(L);_mediator=p(V);_dragInjector=p(Ct);handle({dragHandler:e,constraints:n,handlerPool:i}){let r=n.soft.map(a=>this._buildParentConnectionHandlers(a.nodeOrGroup,i));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,n){let i=this._store.outputs.getAll().filter(h=>h.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(h=>h.fNodeId===e.fId());if(!i.length&&!r.length)return{source:[],target:[]};let a=new Set(i.map(h=>h.fId())),s=new Set(r.map(h=>h.fId())),c=new Map,u={source:[],target:[]};for(let h of this._store.connections.getAll()){let g=a.has(h.fOutputId()),C=s.has(h.fInputId());if(!g&&!C)continue;let k=this._getExistingConnectionHandler(n,h);if(k||(k=this._createConnectionHandler(h,g,C),n.push(k)),g){let I=this._store.outputs.require(h.fOutputId());u.source.push({handler:k,connector:I,baselineRect:this._readConnectorRect(I,c)})}if(C){let I=this._store.inputs.require(h.fInputId());u.target.push({handler:k,connector:I,baselineRect:this._readConnectorRect(I,c)})}}return u}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n,i){let r;return n&&i?r=this._dragInjector.createInstance(jr):n?r=this._dragInjector.createInstance(Gr):r=this._dragInjector.createInstance(Ur),r.initialize(e),r}_readConnectorRect(e,n){let i=`${e.kind}::${e.fId()}`,r=n.get(i);if(r)return r;let a=this._mediator.execute(new Kt(e)).rect;return n.set(i,a),a}static \u0275fac=function(n){return new(n||tc)};static \u0275prov=y({token:tc,factory:tc.\u0275fac})};return t=P([R(ip)],t),t})(),WB=(()=>{let t=class nc{_dragInjector=p(Ct);_mediator=p(V);handle({rootHandlers:e,participants:n}){let i=this._collectConnectionHandlers(n);this._applyConstraintsToRoots(e,i);let r=this._dragInjector.createInstance(pi);return r.initialize(n,e),r}_applyConstraintsToRoots(e,n){for(let i of e){let r=this._calculateConstraints(i.nodeOrGroup);i.setConstraints(r),this._attachSoftParentConnectionHandlers(i,r,n)}}_collectConnectionHandlers(e){let n=new Map;for(let i of e){for(let r of i.sourceConnectionHandlers)n.set(r.connection.fId(),r);for(let r of i.targetConnectionHandlers)n.set(r.connection.fId(),r)}return Array.from(n.values())}_attachSoftParentConnectionHandlers(e,n,i){this._mediator.execute(new ip(e,n,i))}_calculateConstraints(e){return this._mediator.execute(new tp(e))}static \u0275fac=function(n){return new(n||nc)};static \u0275prov=y({token:nc,factory:nc.\u0275fac})};return t=P([R(np)],t),t})(),op=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.sourceIds=e,this.handlerPool=n}},KB=(()=>{let t=class ic{_store=p(L);_dragInjector=p(Ct);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(i=>n.has(i.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let i=this._getExistingConnectionHandler(n.handlerPool,e);i||(i=this._createConnectionHandler(n.sourceIds,e),n.handlerPool.push(i)),n.dragHandler.targetConnectionHandlers.push(i)}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n){let i;return e.includes(n.fOutputId())?i=this._dragInjector.createInstance(jr):i=this._dragInjector.createInstance(Ur),i.initialize(n),i}static \u0275fac=function(n){return new(n||ic)};static \u0275prov=y({token:ic,factory:ic.\u0275fac})};return t=P([R(op)],t),t})(),rp=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.targetIds=e,this.handlerPool=n}},YB=(()=>{let t=class oc{_store=p(L);_dragInjector=p(Ct);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(i=>n.has(i.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let i=this._getExistingConnectionHandler(n.handlerPool,e);i||(i=this._createConnectionHandler(n.targetIds,e),n.handlerPool.push(i)),n.dragHandler.sourceConnectionHandlers.push(i)}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n){let i;return e.includes(n.fInputId())?i=this._dragInjector.createInstance(jr):i=this._dragInjector.createInstance(Gr),i.initialize(n),i}static \u0275fac=function(n){return new(n||oc)};static \u0275prov=y({token:oc,factory:oc.\u0275fac})};return t=P([R(rp)],t),t})(),ap=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(o){this.nodeOrGroup=o}},XB=(()=>{let t=class rc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({nodeOrGroup:e}){let n=this._collectSelected(e),i=this._withDeepChildren(n),r=this._mediator.execute(new Ju(i)),a=this._collectSourceConnectorIds(i),s=this._collectTargetConnectorIds(i);return this._attachConnectionHandlers(r.participants,a,s),this._mediator.execute(new np(r.rootHandlers,r.participants))}_collectSelected(e){let n=[];for(let i of this._dragSession.selectedItems){let r=this._findNodeByHost(i.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 i of e){n.push(i);let r=this._mediator.execute(new zo(i.fId()));n.push(...r)}return n}_collectSourceConnectorIds(e){return om(e,n=>this._store.outputs.getAll().filter(i=>i.fNodeId===n.fId()).map(i=>i.fId()))}_collectTargetConnectorIds(e){return om(e,n=>this._store.inputs.getAll().filter(i=>i.fNodeId===n.fId()).map(i=>i.fId()))}_attachConnectionHandlers(e,n,i){let r=[];for(let a of e)this._mediator.execute(new rp(a,i,r)),this._mediator.execute(new op(a,n,r))}static \u0275fac=function(n){return new(n||rc)};static \u0275prov=y({token:rc,factory:rc.\u0275fac})};return t=P([R(ap)],t),t})(),ZB=[GB,UB,WB,KB,YB,$B,jB,XB];function QB(t,o,e=10){let n=o.x,i=o.y,r=n+o.width,a=i+o.height,s=o.gravityCenter.x,c=o.gravityCenter.y,u,h,g=1/0,C,k,I=1/0,N=(Y,ee)=>{let ce=ee<0?-ee:ee;ce<=e&&ce<g&&(g=ce,u=Y,h=ee)},q=(Y,ee)=>{let ce=ee<0?-ee:ee;ce<=e&&ce<I&&(I=ce,C=Y,k=ee)};for(let Y=0;Y<t.length;Y++){let ee=t[Y],ce=ee.x,Oe=ee.y,De=ce+ee.width,Ge=Oe+ee.height,Ht=ee.gravityCenter.x,ct=ee.gravityCenter.y;N(ce,n-ce),N(De,n-De),N(Ht,s-Ht),N(ce,r-ce),N(De,r-De),q(Oe,i-Oe),q(Ge,i-Ge),q(ct,c-ct),q(Oe,a-Oe),q(Ge,a-Ge)}return{x:{guide:u,delta:h},y:{guide:C,delta:k}}}var by=["left","top","width","height"],sp=class{_element;constructor(o,e,n="f-line"){this._element=o.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(o){for(let e of by){let n=o[e];n!=null&&(this._element.style[e]=`${n}px`)}}clearRect(){for(let o of by)this._element.style.removeProperty(o)}destroy(){this._element.remove()}},a_=class{_horizontal;_vertical;constructor(o,e){this._horizontal=new sp(o,e),this._vertical=new sp(o,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(o,e,n){this._vertical.show(),this._vertical.render({left:o*n.scale+n.position.x+n.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(o,e,n){this._horizontal.show(),this._horizontal.render({left:0,top:o*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()}},lp=class{static fToken=Symbol("MagneticLinesPreparationRequest")},JB=(()=>{let t=class ac{_mediator=p(V);_store=p(L);_browser=p(at);_injector=p(dt);_dragSession=p(he);_renderer;handle(e){let n=this._store.instances.get(Xe.MAGNETIC_LINES);if(!n)return;let i=this._dragSession.draggableItems.find(r=>r instanceof pi);i&&i.setMagneticLines(new s_(this._injector,this._renderer??this._createRenderer(n),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(i.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new a_(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 it(r.hostElement)))}static \u0275fac=function(n){return new(n||ac)};static \u0275prov=y({token:ac,factory:ac.\u0275fac})};return t=P([R(lp)],t),t})(),s_=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(o,e,n,i){this._renderer=e,this._size=n,this._rects=i;let r=o.get(L);this._alignThreshold=r.instances.require(Xe.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(o){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(o)),15)}_renderGuides(o){this._renderVertical(o),this._renderHorizontal(o)}_renderVertical(o){o.x.guide!==void 0?this._renderer.drawVerticalLine(o.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(o){o.y.guide!==void 0?this._renderer.drawHorizontalLine(o.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(o){return QB(this._rects,o,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},vy=["top","center","bottom"],yy=["left","center","right"];function e9(t,o,e=10,n=10){let i=o.x,r=o.y,a=i+o.width,s=r+o.height,c=o.gravityCenter.x,u=o.gravityCenter.y,h=t9(t,o,i,r,a,s,c,u,e,n),g=n9(t,o,i,r,a,s,c,u,e,n);return h&&(!g||h.absDelta<=g.absDelta)?{axis:"x",delta:h.delta,gap:h.gap,rects:h.rects,alignMode:h.alignMode,crossDelta:h.crossDelta}:g?{axis:"y",delta:g.delta,gap:g.gap,rects:g.rects,alignMode:g.alignMode,crossDelta:g.crossDelta}:{rects:[]}}function t9(t,o,e,n,i,r,a,s,c,u){let h=1/0,g,C=0,k,I=[],N=0,q=[],Y=[],ee=[];for(let ce=0;ce<vy.length;ce++){let Oe=ce===0?n:ce===1?s:r;q.length=0,Y.length=0,ee.length=0;let De=1/0,Ge=-1/0,Ht=0,ct=1/0,vt=1/0;for(let qe=0;qe<t.length;qe++){let Fe=t[qe],rr=ce===0?Fe.y:ce===1?Fe.gravityCenter.y:Fe.y+Fe.height,xf=Oe-rr,An=So(xf);if(An>c)continue;q.push(qe),Y.push(Fe.x),ee.push(Fe.x+Fe.width);let ar=Fe.y,sr=Fe.y+Fe.height;ar<De&&(De=ar),sr>Ge&&(Ge=sr),(An<ct||An===ct&&qe<vt)&&(ct=An,Ht=rr,vt=qe)}let tt=q.length;if(tt<2)continue;rC(q,Y,ee);let st=0;for(;st<tt&&Y[st]<=a;)st++;let Ti=st>0&&st<tt,Mt,qt;Ti?(Mt=st-1,qt=st):st<=0?(Mt=0,qt=1):(Mt=tt-2,qt=tt-1);let Gt=Y[qt]-ee[Mt];if(Gt<0)continue;let ft;if(Ti){ft=ee[Mt]+Gt;let qe=ft+o.width,Fe=Y[qt]-qe;if(So(Fe-Gt)>u)continue}else st<=0?ft=Y[0]-Gt-o.width:ft=ee[tt-1]+Gt;let or=e-ft,Si=So(or);if(Si>u||Si>=h)continue;let dn=i9(q,Y,ee,De,Ge);if(Ti){let qe=ft,Fe=ft+o.width;dn.push({left:ee[Mt],top:De,width:qe-ee[Mt],height:Ge-De}),dn.push({left:Fe,top:De,width:Y[qt]-Fe,height:Ge-De})}else if(st<=0){let qe=ft+o.width;dn.push({left:qe,top:De,width:Y[0]-qe,height:Ge-De})}else dn.push({left:ee[tt-1],top:De,width:ft-ee[tt-1],height:Ge-De});let Cf=Oe-Ht;h=Si,g=or,C=Gt,k=vy[ce],I=dn,N=Cf}if(!(g===void 0||k===void 0))return{delta:g,absDelta:h,gap:C,rects:I,alignMode:k,crossDelta:N}}function n9(t,o,e,n,i,r,a,s,c,u){let h=1/0,g,C=0,k,I=[],N=0,q=[],Y=[],ee=[];for(let ce=0;ce<yy.length;ce++){let Oe=ce===0?e:ce===1?a:i;q.length=0,Y.length=0,ee.length=0;let De=1/0,Ge=-1/0,Ht=0,ct=1/0,vt=1/0;for(let qe=0;qe<t.length;qe++){let Fe=t[qe],rr=ce===0?Fe.x:ce===1?Fe.gravityCenter.x:Fe.x+Fe.width,xf=Oe-rr,An=So(xf);if(An>c)continue;q.push(qe),Y.push(Fe.y),ee.push(Fe.y+Fe.height);let ar=Fe.x,sr=Fe.x+Fe.width;ar<De&&(De=ar),sr>Ge&&(Ge=sr),(An<ct||An===ct&&qe<vt)&&(ct=An,Ht=rr,vt=qe)}let tt=q.length;if(tt<2)continue;rC(q,Y,ee);let st=0;for(;st<tt&&Y[st]<=s;)st++;let Ti=st>0&&st<tt,Mt,qt;Ti?(Mt=st-1,qt=st):st<=0?(Mt=0,qt=1):(Mt=tt-2,qt=tt-1);let Gt=Y[qt]-ee[Mt];if(Gt<0)continue;let ft;if(Ti){ft=ee[Mt]+Gt;let qe=ft+o.height,Fe=Y[qt]-qe;if(So(Fe-Gt)>u)continue}else st<=0?ft=Y[0]-Gt-o.height:ft=ee[tt-1]+Gt;let or=n-ft,Si=So(or);if(Si>u||Si>=h)continue;let dn=o9(q,Y,ee,De,Ge);if(Ti){let qe=ft,Fe=ft+o.height;dn.push({left:De,top:ee[Mt],width:Ge-De,height:qe-ee[Mt]}),dn.push({left:De,top:Fe,width:Ge-De,height:Y[qt]-Fe})}else if(st<=0){let qe=ft+o.height;dn.push({left:De,top:qe,width:Ge-De,height:Y[0]-qe})}else dn.push({left:De,top:ee[tt-1],width:Ge-De,height:ft-ee[tt-1]});let Cf=Oe-Ht;h=Si,g=or,C=Gt,k=yy[ce],I=dn,N=Cf}if(!(g===void 0||k===void 0))return{delta:g,absDelta:h,gap:C,rects:I,alignMode:k,crossDelta:N}}function i9(t,o,e,n,i){let r=[],a=i-n;for(let s=0;s<t.length-1;s++){let c=o[s+1]-e[s];c<0||r.push({left:e[s],top:n,width:c,height:a})}return r}function o9(t,o,e,n,i){let r=[],a=i-n;for(let s=0;s<t.length-1;s++){let c=o[s+1]-e[s];c<0||r.push({left:n,top:e[s],width:a,height:c})}return r}function rC(t,o,e){for(let n=1;n<o.length;n++){let i=o[n],r=e[n],a=t[n],s=n-1;for(;s>=0;){let c=o[s],u=t[s];if(c<i||c===i&&u<a)break;o[s+1]=c,e[s+1]=e[s],t[s+1]=u,s--}o[s+1]=i,e[s+1]=r,t[s+1]=a}}function So(t){return t<0?-t:t}var l_=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(o,e,n="f-rect"){this._element=o.document.createElement("div"),this._element.classList.add(n);let i=this._element.style;i.position="absolute",i.display="none",i.boxSizing="border-box",i.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(o,e,n,i){let r=this._element.style;o!==this._left&&(this._left=o,r.left=o+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),n!==this._width&&(this._width=n,r.width=n+"px"),i!==this._height&&(this._height=i,r.height=i+"px")}clearRect(){this._left=Number.NaN,this._top=Number.NaN,this._width=Number.NaN,this._height=Number.NaN;let o=this._element.style;o.removeProperty("left"),o.removeProperty("top"),o.removeProperty("width"),o.removeProperty("height")}destroy(){this._element.remove()}},c_=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(o,e,n="f-rect"){this._browser=o,this._hostElement=e,this._className=n}draw(o,e){let n=e.scale,i=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let a=0;a<o.length;a++){let s=this._getOrCreate(a),c=o[a];s.show(),s.render(c.left*n+i,c.top*n+r,c.width*n,c.height*n)}for(let a=o.length;a<this._activeCount;a++)this._pool[a].hide();this._activeCount=o.length}hideAll(){for(let o=0;o<this._activeCount;o++)this._pool[o].hide();this._activeCount=0}destroy(){for(let o of this._pool)o.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(o){if(o<this._pool.length)return this._pool[o];let e=new l_(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},cp=class{static fToken=Symbol("MagneticRectsPreparationRequest")},r9=(()=>{let t=class sc{_mediator=p(V);_store=p(L);_browser=p(at);_injector=p(dt);_dragSession=p(he);_renderer;handle(e){let n=this._store.instances.get(Xe.MAGNETIC_RECTS);if(!n)return;let i=this._dragSession.draggableItems.find(r=>r instanceof pi);i&&i.setMagneticRects(new d_(this._injector,this._getRenderer(n),this._notDraggedRects(this._draggedNodes(i.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new c_(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 it(r.hostElement)))}static \u0275fac=function(n){return new(n||sc)};static \u0275prov=y({token:sc,factory:sc.\u0275fac})};return t=P([R(cp)],t),t})(),d_=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(o,e,n){this._renderer=e,this._rects=n;let i=o.get(L),r=i.instances.require(Xe.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=i.transform}scheduleRender(o){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(o)),15)}_renderRects(o){if(o.axis!==void 0&&o.delta!==void 0&&o.rects.length>0){this._renderer.draw(o.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(o){return e9(this._rects,o,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},dp=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(o){this.event=o}},u_=class{nodes;fNodes;constructor(o){this.nodes=o,this.fNodes=o}},a9=(()=>{let t=class lc{_mediator=p(V);_store=p(L);_dragSession=p(he);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let n=this._buildDragDelta(e.getPosition()),i=this._dragHandler.calculateMagneticSnaps(n),r=this._applySnapToDelta(n,i.lines,i.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(qB)}_buildDragDelta(e){return pe.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,n,i){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(i)&&(i.axis==="x"?(r=e.x-i.delta,a=e.y-(i.crossDelta??0)):(a=e.y-i.delta,r=e.x-(i.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 i of e.roots)i.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 u_(a)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let n=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Fu(n)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(n){return new(n||lc)};static \u0275prov=y({token:lc,factory:lc.\u0275fac})};return t=P([R(dp)],t),t})(),up=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(o,e){this.event=o,this.trigger=e}},s9=(()=>{let t=class cc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({event:e,trigger:n}){if(!this._canStartDrag(e,n))return;let i=this._findDraggableNode(e.targetElement);i&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(i)],this._mediator.execute(new lp),this._mediator.execute(new cp))}_canStartDrag(e,n){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&an(e.originalEvent,n)}_isDragHandle(e){return xr(e,".f-drag-handle")}_findDraggableNode(e){let n=this._store.nodes.getAll();for(let i of n)if(!i.fDraggingDisabled()&&i.isContains(e))return i}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Vo(e))}),this._mediator.execute(new ap(e))}static \u0275fac=function(n){return new(n||cc)};static \u0275prov=y({token:cc,factory:cc.\u0275fac})};return t=P([R(up)],t),t})(),l9=[...ZB,JB,r9,a9,s9],p_=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(o,e,n){this.targetGroupId=o,this.nodeIds=e,this.dropPosition=n,this.fTargetNode=o,this.fNodes=e,this.fDropPosition=n}},c9=(()=>{let t=class dc{_dragSession=p(he);_store=p(L);handle({event:e}){let n=this._findDropHandler();if(!n)return;let i=n.activeTarget?.node;i&&this._emitDropToGroupEvent(i.fId(),e),n.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof zr)}_emitDropToGroupEvent(e,n){this._store.fDraggable?.fDropToGroup.emit(new p_(e,this._getTopLevelDraggedIds(),n.getPosition()))}_getTopLevelDraggedIds(){let n=this._getMoveSummaryHandler().items.map(a=>a.nodeOrGroup),i=new Set(n.map(a=>a.fId())),r=[];for(let a of n){let s=a.fParentId();(!s||!i.has(s))&&r.push(a.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof pi);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(n){return new(n||dc)};static \u0275prov=y({token:dc,factory:dc.\u0275fac})};return t=P([R(Qu)],t),t})(),pp=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(o){this.event=o}},hp=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(o){this.candidates=o}},d9=(()=>{let t=class uc{handle({candidates:e}){let n=e.map((i,r)=>({candidate:i,index:r}));return n.sort((i,r)=>{let a=this._compareDomOrder(i.candidate.node.hostElement,r.candidate.node.hostElement);return a!==0?-a:i.index-r.index}),n.map(i=>i.candidate)}_compareDomOrder(e,n){if(e===n)return 0;let i=e.compareDocumentPosition(n);if((i&Node.DOCUMENT_POSITION_FOLLOWING)!==0)return-1;if((i&Node.DOCUMENT_POSITION_PRECEDING)!==0)return 1;if(i&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||uc)};static \u0275prov=y({token:uc,factory:uc.\u0275fac})};return t=P([R(hp)],t),t})(),h_=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(o,e,n){this._onPointerDown=e,this._limit=n;let i=o.get(L);this._vCellSize=i.fDraggable.vCellSize(),this._hCellSize=i.fDraggable.hCellSize(),this._adjustCellSize=i.fDraggable.fCellSizeWhileDragging()}limit(o){let{min:e,max:n}=this._limit,{x:i,y:r}=this._cellSizeStrategies[+this._adjustCellSize](o);return{x:this._clamp(i,e.x,n.x),y:this._clamp(r,e.y,n.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(o){return{x:this._snapToGrid(this._onPointerDown.x+o.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+o.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(o){return o}_clamp(o,e,n){return Math.min(Math.max(o,e),n)}_snapToGrid(o,e){return Math.round(o/e)*e}},fp=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(o){this.externalItem=o}},u9=(()=>{let t=class pc{_browser=p(at);_containerRef=p(Ka);handle({externalItem:e}){let{hostElement:n,placeholder:i}=e,r=i(),a=r?this._fromTemplate(r):this._fromHost(n);return a.classList.add("f-external-item-placeholder"),a.style.pointerEvents="none",a}_fromTemplate(e){return sm(this._createViewRef(e),this._browser.document)}_fromHost(e){return rm(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}static \u0275fac=function(n){return new(n||pc)};static \u0275prov=y({token:pc,factory:pc.\u0275fac})};return t=P([R(fp)],t),t})(),mp=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(o){this.externalItem=o}},p9=(()=>{let t=class hc{_browser=p(at);_containerRef=p(Ka);handle({externalItem:e}){let{hostElement:n,preview:i}=e,r=i(),a=r?this._fromTemplate(r):this._fromHost(n);return this._setPreviewStyles(a),Jv(a),a.classList.add("f-external-item-preview"),a}_fromTemplate(e){return sm(this._createViewRef(e),this._browser.document)}_fromHost(e){return rm(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}_setPreviewStyles(e){am(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||hc)};static \u0275prov=y({token:hc,factory:hc.\u0275fac})};return t=P([R(mp)],t),t})(),_p=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(o){this.event=o}},f_=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(o,e,n,i){this.externalItemRect=o,this.data=e,this.targetContainerId=n,this.dropPosition=i,this.rect=o,this.fTargetNode=n,this.fDropPosition=i}},h9="external-item",f9="drag-external-item";function m9(t){return t.getEvent().kind===f9||t.getEvent().fEventType===h9}var _9=(()=>{let t=class fc{_result=p(hi);_mediator=p(V);_store=p(L);_dragSession=p(he);_browser=p(at);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let n=this._findExternalItemHandler();if(!n)return;let i=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),i,e.event.getPosition()),n.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>m9(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 zr);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,i){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new f_(this._getPreviewRect(),this._result.getData().externalItem.data(),n,n?i:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new it(this._result.getData().preview))}static \u0275fac=function(n){return new(n||fc)};static \u0275prov=y({token:fc,factory:fc.\u0275fac})};return t=P([R(_p)],t),t})(),m_=class{data;constructor(o){this.data=o}},gp=class extends Ft{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new m_(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=te.initialize();_pointerDownRect=te.initialize();_absoluteOffsetFromFlow=U.initialize();_grabOffsetFromPointer=U.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=o=>o;constructor(o,e,n){super(),this._externalItem=e,this._pointerDownClientPosition=n,this._store=o.get(L),this._result=o.get(hi),this._mediator=o.get(V),this._browser=o.get(at),this._originalDisplay=this._host.style.display,this._initConstraints(o)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(o){this._startRect=this._getStartRect();let e=new h_(o,this._startRect,Ky());this._applyConstraints=n=>e.limit(n)}_getStartRect(){return this._mediator.execute(new it(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=pe.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 o=this._host.parentNode;if(!o){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=o,this._originalNextSibling=this._host.nextSibling}_createPreview(){let o=this._mediator.execute(new mp(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(o,this._pointerDownRect),o.style.transform=Cy(this._pointerDownRect),o}_createPlaceholder(){return this._mediator.execute(new fp(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let o=this._originalParent,e=this._placeholderEl;if(!o||!e)return;let n=o.replaceChild(e,this._host);this._overlayRoot.appendChild(n),this._host.style.display="none"}onPointerMove(o,e){if(!this._previewEl)return;let n=this._resolveDeltaFromPointer(o,e),i=this._applyConstraints(n),r=pe.fromPoint(this._startRect).add(i),a=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=Cy(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 o=this._originalParent,e=this._placeholderEl;if(!(!o||!e)){if(e.parentNode===o){o.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===o?o.insertBefore(this._host,this._originalNextSibling):o.appendChild(this._host)}}_matchSize(o,e){o.style.width=`${e.width}px`,o.style.height=`${e.height}px`}_readAbsoluteRect(o){let e=o.getBoundingClientRect(),n=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return te.initialize(e.left+i,e.top+n,e.width,e.height)}_toAbsolutePoint(o){let e=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition);return pe.fromPoint(o).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(o,e){let n=e?.getPosition();if(!n)return o;let i=this._clientToAbsolute(n).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(i);return pe.fromPoint(r).sub(this._startRect)}_toFlowPoint(o){let e=this._getFlowHostAbsolutePosition(),n=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition);return pe.fromPoint(o).sub(e).sub(n).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let o=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 U.initialize(o.left+n,o.top+e)}_clientToAbsolute(o){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return pe.fromPoint(o).add(U.initialize(n,e))}};function Cy({x:t,y:o}){return`translate3d(${Math.round(t)}px, ${Math.round(o)}px, 0)`}var bp=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}};function g9(t){return!!t.closest?.("[fExternalItem]")}function b9(t){return t.closest("[fExternalItem]")}var v9=(()=>{class t{_byHost=new Map;_items=X([]);items=E(()=>this._items());getByElement(e){let n=b9(e);return n?this._byHost.get(n):void 0}getByHost(e){return this._byHost.get(e)}register(e){let n=e.hostElement,i=this._byHost.get(n);i!==e&&(i&&i!==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 y9=(()=>{let t=class mc{_apiService=p(v9);_dragSession=p(he);_store=p(L);_injector=p(dt);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!an(e.originalEvent,n))return;let i=this._resolveExternalItem(e.targetElement);if(!i||i.disabled())return;let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new gp(this._injector,i,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(n){return new(n||mc)};static \u0275prov=y({token:mc,factory:mc.\u0275fac})};return t=P([R(bp)],t),t})(),vp=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(o){this.event=o}},C9=(()=>{let t=class _c{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let n=this._isExternalItem(e.target),i=this._isExternalItem(e.target.parentNode);return n||i}_isExternalItem(e){let n=!1;try{n=g9(e)}catch{}return n}static \u0275fac=function(n){return new(n||_c)};static \u0275prov=y({token:_c,factory:_c.\u0275fac})};return t=P([R(vp)],t),t})(),x9=[u9,p9,_9,y9,C9],w9=(()=>{let t=class gc{_mediator=p(V);_dragContext=p(he);_store=p(L);_dragInjector=p(Ct);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 i=this._sortedTargetsForDrop();if(n){let a=n.fParentId(),s=this._mediator.execute(new Yp(a));s.length&&(i=i.filter(c=>s.includes(c.node.fId())))}let r=this._dragInjector.get(zr);r.initialize(i),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof pi)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof gp)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),n=e.some(s=>s instanceof Km),i=this._withParents(e),a=this._eligibleTargets(i,n).map(s=>{let c=this._mediator.execute(new it(s.hostElement));return{node:s,rect:c}});return this._mediator.execute(new hp(a))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(n=>n instanceof pi);return e?e.items.map(n=>n.nodeOrGroup):[]}_withParents(e){return e.reduce((n,i)=>{n.push(i);let r=this._mediator.execute(new Ao(i));return n.push(...r),n},[])}_eligibleTargets(e,n){let i=this._allNodes.filter(r=>!e.includes(r));return n?i.filter(r=>r instanceof Km):i}static \u0275fac=function(n){return new(n||gc)};static \u0275prov=y({token:gc,factory:gc.\u0275fac})};return t=P([R(pp)],t),t})(),T9=[d9,w9,c9],yp=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(o){this.event=o}},S9=.5,Cp=(()=>{class t extends Ft{type="pinch-to-zoom";kind="pinch-to-zoom";_store=p(L);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(Xe.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=xy(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 i=xy(n.touches),r=k9(n.touches);if(i==null||r==null){this._reset();return}if(Math.abs(i-this._startDistance)<S9)return;n.preventDefault();let a=i/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 pe.fromPoint(e).elementTransform(this._flowHost)}_reset(){this._startScale=null,this._startDistance=null}onPointerUp(){this._reset(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function k9(t){if(t.length!==2)return null;let o=t[0],e=t[1];return U.initialize((o.clientX+e.clientX)/2,(o.clientY+e.clientY)/2)}function xy(t){if(t.length!==2)return null;let o=t[0],e=t[1];return Math.hypot(e.clientX-o.clientX,e.clientY-o.clientY)}var I9=(()=>{let t=class bc{_dragSession=p(he);handle(e){if(this._hasPinchZoomHandler())for(let n of this._dragSession.draggableItems)n.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Cp)}static \u0275fac=function(n){return new(n||bc)};static \u0275prov=y({token:bc,factory:bc.\u0275fac})};return t=P([R(yp)],t),t})(),xp=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(o){this.event=o}},E9=(()=>{let t=class vc{_dragInjector=p(Ct);_store=p(L);_dragSession=p(he);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new pe,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(Xe.ZOOM)}_getHandler(e){let n=this._dragInjector.get(Cp);return n.initialize(e.touches),n}static \u0275fac=function(n){return new(n||vc)};static \u0275prov=y({token:vc,factory:vc.\u0275fac})};return t=P([R(xp)],t),t})(),M9=[E9,I9],wp=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(o){this.event=o}},D9=(()=>{let t=class yc{_dragSession=p(he);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||yc)};static \u0275prov=y({token:yc,factory:yc.\u0275fac})};return t=P([R(wp)],t),t})(),__=(()=>{class t extends Ft{type="selection-area";kind="selection-area";_store=p(L);_dragSession=p(he);_mediator=p(V);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return pe.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(Xe.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new lh),this._show(),this._draw(te.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let n=pe.fromPoint(e).add(this._dragSession.onPointerDownPosition),i=this._getMinimumPoint(this._dragSession.onPointerDownPosition,n),r=Math.abs(e.x),a=Math.abs(e.y),s=te.initialize(i.x,i.y,r,a);this._draw(s),this._selectedByMove=[],this._canBeSelected.forEach(c=>{c.element.unmarkAsSelected();let u=te.addPoint(te.mult(c.fRect,this._transform.scale),this._canvasPosition);te.intersectionWithRect(u,s)&&(c.element.markAsSelected(),this._selectedByMove.push(c.element))}),this._mediator.execute(new si)}_getMinimumPoint(e,n){return U.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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Tp=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(o){this.event=o}},P9=(()=>{let t=class Cc{_store=p(L);_dragSession=p(he);_dragInjector=p(Ct);get _instance(){return this._store.instances.get(Xe.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(__)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&an(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(n){return new(n||Cc)};static \u0275prov=y({token:Cc,factory:Cc.\u0275fac})};return t=P([R(Tp)],t),t})(),R9=[P9,D9],Sp=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(o,e){this.rect=o,this.childrenBounds=e}},O9=(()=>{let t=class xc{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 i=e.x-n.x;i>0&&(e.x-=i,e.width+=i)}_restrictTop(e,n){let i=e.y-n.y;i>0&&(e.y-=i,e.height+=i)}_restrictRight(e,n){let i=n.x+n.width;e.x+e.width<=i&&(e.width=i-e.x)}_restrictBottom(e,n){let i=n.y+n.height;e.y+e.height<=i&&(e.height=i-e.y)}static \u0275fac=function(n){return new(n||xc)};static \u0275prov=y({token:xc,factory:xc.\u0275fac})};return t=P([R(Sp)],t),t})(),kp=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(o,e){this.rect=o,this.limits=e}},F9=(()=>{let t=class wc{_mediator=p(V);handle({rect:e,limits:n}){this._applyResizeConstraints(e,n)}_applyResizeConstraints(e,n){if(!n)return;let i=this._clampedCopyForCalculation(e,n);this._applySoftParentExpansions(i,n.softLimits),n.hardLimit&&this._clampRectToInner(e,n.hardLimit.innerRect)}_clampedCopyForCalculation(e,n){let i=ge({},e);return n.hardLimit&&this._clampRectToInner(i,n.hardLimit.innerRect),i}_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 i=n.x+n.width;e.x+e.width>i&&(e.width=i-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 i of n)this._expandParentFromOriginalIfOverflow(e,i)}_expandParentFromOriginalIfOverflow(e,n){let i=n.innerRect,r=n.boundingRect,a=this._computeOverflow(i,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 i=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:i,top:r,right:a,bottom:s}}_buildExpandedParentRect(e,n){let i=ge({},e);return n.left&&(i.x=e.x-n.left,i.width=e.width+n.left),n.top&&(i.y=e.y-n.top,i.height=e.height+n.top),n.right&&(i.width=(i.width??e.width)+n.right),n.bottom&&(i.height=(i.height??e.height)+n.bottom),i}_applyParentRect(e,n){e.nodeOrGroup.updatePosition(n),e.nodeOrGroup.updateSize(n),this._mediator.execute(new Vi(e.nodeOrGroup.fId(),n)),e.nodeOrGroup.redraw()}static \u0275fac=function(n){return new(n||wc)};static \u0275prov=y({token:wc,factory:wc.\u0275fac})};return t=P([R(kp)],t),t})(),Ip=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(o,e,n,i){this.originalRect=o,this.difference=e,this.handleType=n,this.minimumSize=i}},wy={[In.LEFT]:{x:-1,y:0},[In.LEFT_TOP]:{x:-1,y:-1},[In.TOP]:{x:0,y:-1},[In.RIGHT_TOP]:{x:1,y:-1},[In.RIGHT]:{x:1,y:0},[In.RIGHT_BOTTOM]:{x:1,y:1},[In.BOTTOM]:{x:0,y:1},[In.LEFT_BOTTOM]:{x:-1,y:1}},N9=(()=>{let t=class Tc{handle({originalRect:e,difference:n,handleType:i,minimumSize:r}){let a=this._changeSizeInRect(e,n,wy[i],r);return this._changePosition(e,n,wy[i],a)}_changeSizeInRect(e,n,i,r){let a=e.width+i.x*n.x,s=e.height+i.y*n.y,c=0,u=0;return a<0&&(c=a,a=Math.abs(a)),a<r.width&&(i.x===-1&&(c+=a-r.width),a=r.width),s<0&&(u=s,s=Math.abs(s)),s<r.height&&(i.y===-1&&(u+=s-r.height),s=r.height),te.initialize(c,u,a,s)}_changePosition(e,n,i,r){let a=e.x+(i.x===-1?n.x:0)+r.x,s=e.y+(i.y===-1?n.y:0)+r.y;return te.initialize(a,s,r.width,r.height)}static \u0275fac=function(n){return new(n||Tc)};static \u0275prov=y({token:Tc,factory:Tc.\u0275fac})};return t=P([R(Ip)],t),t})(),Ep=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(o,e){this.nodeOrGroup=o,this.paddings=e}},A9=(()=>{let t=class Sc{_mediator=p(V);_store=p(L);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:n}){let i=te.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return i?this._concatRectWithParentPadding(i,n):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(n=>n.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new it(e.hostElement))}_concatRectWithParentPadding(e,n){return te.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||Sc)};static \u0275prov=y({token:Sc,factory:Sc.\u0275fac})};return t=P([R(Ep)],t),t})(),$r=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(o,e){this.nodeOrGroup=o,this.rect=e}},L9=(()=>{let t=class kc{_mediator=p(V);handle({nodeOrGroup:e,rect:n}){let i=this._getParentsChain(e),r=this._calculateNodePaddings(e,n);return{limits:this._buildSoftHardLimits(i),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:Ot.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,n){return this._mediator.execute(new Gi(e,n))}_getNormalizedChildrenBounds(e,n){return this._mediator.execute(new Ep(e,n))}_getParentsChain(e){return this._mediator.execute(new Ao(e))??[]}_buildSoftHardLimits(e){let n=[],i,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{i=this._makeLimit(a,s);break}}return{softLimits:n,hardLimit:i}}_getParentInfo(e,n){return this._mediator.execute(new Hr(e,n))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:n,innerRect:i}){return{nodeOrGroup:e,boundingRect:n,innerRect:i}}static \u0275fac=function(n){return new(n||kc)};static \u0275prov=y({token:kc,factory:kc.\u0275fac})};return t=P([R($r)],t),t})(),Mp=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(o){this.event=o}},aC="node-resize",sC="resize-node";function B9(t){return t.getEvent().kind===sC||t.getEvent().fEventType===aC}var V9=(()=>{let t=class Ic{_dragSession=p(he);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(n=>n.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>B9(e))}static \u0275fac=function(n){return new(n||Ic)};static \u0275prov=y({token:Ic,factory:Ic.\u0275fac})};return t=P([R(Mp)],t),t})(),g_=class{fNodeId;constructor(o){this.fNodeId=o}},b_=(()=>{class t extends Ft{type=aC;kind=sC;data(){return new g_(this._nodeOrGroup.fId())}_mediator=p(V);_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 i of this._softParentConnections)this._applyConnectionHandlers(i);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 it(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new $r(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new Ip(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Sp(e,this._constraints.childrenBounds)),this._mediator.execute(new kp(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 Vi(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return te.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 i of e.source){let r=this._readConnectorRect(i.connector,n);i.handler.setSourceRect(r)}for(let i of e.target){let r=this._readConnectorRect(i.connector,n);i.handler.setTargetRect(r)}}_readConnectorRect(e,n){let i=`${e.kind}::${e.fId()}`,r=n.get(i);if(r)return r;let a=this._mediator.execute(new di(e.hostElement,!1));return n.set(i,a),a}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Wr=class{_mediator=p(V);_store=p(L);_behaviour=p(Ho);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(o){this.connection=o,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=rt.fromRoundedRect(this._sourceRef.rect),this._targetRect=rt.fromRoundedRect(this._targetRef.rect)}setSourceRect(o){this._sourceRect=rt.fromRoundedRect(o),this._mediator.execute(new Bi(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(o){this._targetRect=rt.fromRoundedRect(o),this._mediator.execute(new Bi(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let o=this._buildLine();this.connection.setLine(o),this.connection.redraw()}_buildLine(){let o=rt.fromRoundedRect(this._sourceRect),e=rt.fromRoundedRect(this._targetRect);return this._behaviour.handle(new vn(o,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(o){return{connector:o,rect:this._mediator.execute(new di(o.hostElement,!1))}}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},z9=(()=>{class t extends Wr{_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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),H9=(()=>{class t extends Wr{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),q9=(()=>{class t extends Wr{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Dp=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},Pp=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(o,e){this.handler=o,this.nodeOrGroup=e}},G9=(()=>{let t=class Ec{_store=p(L);_mediator=p(V);_dragInjector=p(Ct);handle({handler:e,nodeOrGroup:n}){let i=this._readSoftParents(n),r=[n,...i],a=this._collectSourceConnectorIds(r),s=this._collectTargetConnectorIds(r),c=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(n,a,s,c)),e.setSoftParentConnectionHandlers(i.map(u=>this._buildConnectionHandlersForNode(u,a,s,c)))}_readSoftParents(e){let n=this._mediator.execute(new it(e.hostElement));return this._mediator.execute(new $r(e,n)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let n=new Set(e.map(i=>i.fId()));return new Set(this._store.outputs.getAll().filter(i=>n.has(i.fNodeId)).map(i=>i.fId()))}_collectTargetConnectorIds(e){let n=new Set(e.map(i=>i.fId()));return new Set(this._store.inputs.getAll().filter(i=>n.has(i.fNodeId)).map(i=>i.fId()))}_buildConnectionHandlersForNode(e,n,i,r){let a=this._store.outputs.getAll().filter(g=>g.fNodeId===e.fId()),s=this._store.inputs.getAll().filter(g=>g.fNodeId===e.fId());if(!a.length&&!s.length)return{source:[],target:[]};let c=new Set(a.map(g=>g.fId())),u=new Set(s.map(g=>g.fId())),h={source:[],target:[]};for(let g of this._store.connections.getAll()){let C=c.has(g.fOutputId()),k=u.has(g.fInputId());if(!C&&!k)continue;let I=r.get(g.fId())??this._createConnectionHandler(g,n,i);if(r.set(g.fId(),I),C){let N=this._store.outputs.require(g.fOutputId());h.source.push({handler:I,connector:N})}if(k){let N=this._store.inputs.require(g.fInputId());h.target.push({handler:I,connector:N})}}return h}_createConnectionHandler(e,n,i){let r=n.has(e.fOutputId()),a=i.has(e.fInputId()),s=r&&a?this._dragInjector.createInstance(z9):r?this._dragInjector.createInstance(H9):this._dragInjector.createInstance(q9);return s.initialize(e),s}static \u0275fac=function(n){return new(n||Ec)};static \u0275prov=y({token:Ec,factory:Ec.\u0275fac})};return t=P([R(Pp)],t),t})(),j9=(()=>{let t=class Mc{_mediator=p(V);_store=p(L);_dragSession=p(he);_dragInjector=p(Ct);get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!an(e.originalEvent,n))return;let i=this._findResizableNode(e.targetElement);if(!i)return;this._selectBeforeResize(i);let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let a=this._dragInjector.createInstance(b_);a.initialize(i,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new Pp(a,i)),this._dragSession.draggableItems=[a]}_isResizeHandle(e){return xr(e,".f-resize-handle")}_findResizableNode(e){let n=this._store.nodes.getAll().find(i=>i.isContains(e));if(n)return n.fDraggingDisabled()?void 0:n}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Vo(e))})}_readResizeHandleType(e){let n=ey(e,"fResizeHandleType",".f-resize-handle");return In[n]}static \u0275fac=function(n){return new(n||Mc)};static \u0275prov=y({token:Mc,factory:Mc.\u0275fac})};return t=P([R(Dp)],t),t})(),U9=[O9,F9,N9,A9,L9,G9,V9,j9],Rp=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(o){this.event=o}},lC="node-rotate",cC="rotate-node";function $9(t){return t.getEvent().kind===cC||t.getEvent().fEventType===lC}var W9=(()=>{let t=class Dc{_dragSession=p(he);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>$9(e))}static \u0275fac=function(n){return new(n||Dc)};static \u0275prov=y({token:Dc,factory:Dc.\u0275fac})};return t=P([R(Rp)],t),t})(),Op=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},v_=class{fNodeId;constructor(o){this.fNodeId=o}};function K9(t,o,e){let{x:n,y:i}=Y9(t,o,e),r=n-t.x,a=i-t.y;return{x:r,y:a}}function Y9(t,o,e){let n=t.x-e.x,i=t.y-e.y,r=o*Math.PI/180,a=Math.cos(r),s=Math.sin(r),c=n*a-i*s,u=n*s+i*a,h=c+e.x,g=u+e.y;return{x:h,y:g}}var y_=(()=>{class t extends Ft{type=lC;kind=cC;data(){return new v_(this._nodeOrGroup.fId())}_store=p(L);_mediator=p(V);_dragSession=p(he);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,n,i){this._nodeOrGroup=e,this._sourceConnections=n,this._targetConnections=i,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=U.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 it(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return U.sub(this._dragSession.onPointerDownPosition,U.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 K9(e,n,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),X9=(()=>{let t=class Pc{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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 i=this._transform.scale;this._dragContext.onPointerDownScale=i,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(i);let r=this._dragInjector.createInstance(y_);r.initialize(n,this._buildOutputConnectionHandlers(n),this._buildInputConnectionHandlers(n)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:n}){return this._dragContext.isEmpty()&&vB(e.targetElement)&&an(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 Vo(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new Vp(e)).map(n=>{let i=this._store.inputs.require(n.fInputId()),r=this._mediator.execute(new Kt(i)),a=this._dragInjector.get(Ur);return a.initialize(n),{connection:a,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new Kp(e)).map(n=>{let i=this._store.outputs.require(n.fOutputId()),r=this._mediator.execute(new Kt(i)),a=this._dragInjector.get(Gr);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=P([R(Op)],t),t})(),Z9=[W9,X9],Kr=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(o,e,n,i){this.flowRect=o,this.canvasPosition=e,this.eventPoint=n,this.minimap=i}},Q9=(()=>{let t=class Rc{_store=p(L);get _canvasScale(){return this._store.transform.scale||1}handle(e){return U.sub(e.canvasPosition,U.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return pe.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,n){let i=this.normalizeEventPoint(e,n);return U.sum(i,te.mult(n.viewBox,this._canvasScale))}normalizeEventPoint(e,n){return this._getEventPointInMinimap(e,n).mult(n.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,n){return pe.fromPoint(e).elementTransform(n.element)}static \u0275fac=function(n){return new(n||Rc)};static \u0275prov=y({token:Rc,factory:Rc.\u0275fac})};return t=P([R(Kr)],t),t})(),Fp=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(o){this.event=o}},J9=(()=>{let t=class Oc{_dragSession=p(he);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(eV)}static \u0275fac=function(n){return new(n||Oc)};static \u0275prov=y({token:Oc,factory:Oc.\u0275fac})};return t=P([R(Fp)],t),t})(),dC="minimap",uC="minimap";function eV(t){return t.getEvent().kind===uC||t.getEvent().fEventType===dC}var C_=(()=>{class t extends Ft{type=dC;kind=uC;_store=p(L);_mediator=p(V);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,n,i,r){this._flowRect=e,this._startCanvasPosition=n,this._eventPoint=i,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(pe.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 Kr(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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Np=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(o){this.event=o}},tV=(()=>{let t=class Fc{_store=p(L);_mediator=p(V);_dragSession=p(he);_dragInjector=p(Ct);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(Xe.MINIMAP).state,i=e.getPosition(),r=pe.fromPoint(this._store.transform.position),a=te.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(a,i,n)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=pe.fromPoint(i).elementTransform(this._flowHost);let s=this._dragInjector.createInstance(C_);s.initialize(a,r,i,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(Xe.MINIMAP))}_calculateCanvasPosition(e,n,i){return this._mediator.execute(new Kr(e,pe.fromPoint(this._canvas.transform.position),n,i))}static \u0275fac=function(n){return new(n||Fc)};static \u0275prov=y({token:Fc,factory:Fc.\u0275fac})};return t=P([R(Np)],t),t})(),nV=[Q9,J9,tV];function iV(t){return!!t&&typeof t.destroy=="function"}var Ct=(()=>{class t{_injector=p(dt);_dragInjector=null;_created=[];create(){this._dragInjector=dt.create({providers:[{provide:Ap,useClass:Ap},{provide:Xu,useClass:Xu},{provide:Hu,useClass:Hu},{provide:Jm,useClass:Jm},{provide:zr,useClass:zr},{provide:Gr,useClass:Gr},{provide:Ur,useClass:Ur},{provide:jr,useClass:jr},{provide:pi,useClass:pi},{provide:Cp,useClass:Cp},{provide:__,useClass:__},{provide:b_,useClass:b_},{provide:y_,useClass:y_},{provide:C_,useClass:C_}],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=C0(this._dragInjector,()=>new e);return this._created.push(n),n}destroy(){for(let e of this._created)iV(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})(),hi=(()=>{class t{_data;setData(e){this._data=ge(ge({},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})(),Ty="f-canvas-dragging",Sy="canvas-dragging",Ap=(()=>{class t extends Ft{type="canvas-move";kind="drag-canvas";_store=p(L);_onPointerDownPosition=U.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(Ty,Sy)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(pe.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(Ty,Sy)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),oV=(()=>{let t=class Nc{_dragContext=p(he);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(n=>n.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Ap)}static \u0275fac=function(n){return new(n||Nc)};static \u0275prov=y({token:Nc,factory:Nc.\u0275fac})};return t=P([R(Au)],t),t})(),Lp=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},rV=(()=>{let t=class Ac{_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);handle({event:e,fTrigger:n}){!this._isValid(e)||!this._isValidTrigger(e,n)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Ap)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(Xe.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let n=this._store.nodes.getAll().find(i=>i.isContains(e));return n&&n.fDraggingDisabled()&&(n=void 0),n}_isValidTrigger(e,n){return an(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Ac)};static \u0275prov=y({token:Ac,factory:Ac.\u0275fac})};return t=P([R(Lp)],t),t})(),aV=[oV,rV],Bp=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(o,e){this.event=o,this.trigger=e}},sV=(()=>{let t=class Lc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({event:e,trigger:n}){if(!this._isSelectionAllowed(e))return;let i=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(i),an(e.originalEvent,n)?this._applyToggleSelect(i):this._applySingleSelect(i)}_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 ji(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||Lc)};static \u0275prov=y({token:Lc,factory:Lc.\u0275fac})};return t=P([R(Bp)],t),t})(),lV=[sV];var x_=class extends qm{hostElement=p(Qe).nativeElement};function cV(t){return xr(t,".f-drag-blocker")}var pC=(()=>{class t extends x_{_result=p(hi);_mediator=p(V);_platform=p(im);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===ii.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=gn;fCreateConnectionTrigger=gn;fConnectionWaypointsTrigger=B(gn);fMoveControlPointTrigger=gn;fNodeResizeTrigger=gn;fNodeRotateTrigger=gn;fNodeMoveTrigger=gn;fCanvasMoveTrigger=gn;fExternalItemTrigger=gn;fSelectionChange=new ne;fNodeIntersectedWithConnections=new ne;fNodeConnectionsIntersection=Ke();fEmitOnNodeIntersect=!1;fCreateNode=new ne;fMoveNodes=new ne;fReassignConnection=new ne;fCreateConnection=new ne;fConnectionWaypointsChanged=Ke();fDropToGroup=new ne;vCellSize=B(1,{transform:e=>xe(e,1)});hCellSize=B(1,{transform:e=>xe(e,1)});fCellSizeWhileDragging=B(!1,{transform:e=>j(e)});fDragStarted=new ne;fDragEnded=new ne;_dragHandlerInjector=p(Ct);ngOnInit(){this._mediator.execute(new qp(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(cV(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new jp),this._mediator.execute(new Tp(e)),this._mediator.execute(new Np(e)),this._mediator.execute(new xp(e)),this._mediator.execute(new Bp(e,this.fMultiSelectTrigger)),this._mediator.execute(new $u(e,this.fReassignConnectionTrigger)),this._mediator.execute(new ju(e,this.fCreateConnectionTrigger)),this._mediator.execute(new Zu(e,this.fConnectionWaypointsTrigger()));let n=e.isMouseLeftButton();return n||this.finalizeDragSequence(),n}prepareDragSequence(e){this._mediator.execute(new Dp(e,this.fNodeResizeTrigger)),this._mediator.execute(new Op(e,this.fNodeRotateTrigger)),this._mediator.execute(new up(e,this.fNodeMoveTrigger)),this._mediator.execute(new bp(e,this.fExternalItemTrigger)),this._mediator.execute(new pp(e)),this._mediator.execute(new Lp(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Up)}onSelect(e){this._mediator.execute(new vp(e))}onPointerMove(e){this._mediator.execute(new Gp(e))}onPointerUp(e){this._mediator.execute(new Fp(e)),this._mediator.execute(new wp(e)),this._mediator.execute(new Uu(e)),this._mediator.execute(new zu(e)),this._mediator.execute(new Mp(e)),this._mediator.execute(new Rp(e)),this._mediator.execute(new dp(e)),this._mediator.execute(new _p(e)),this._mediator.execute(new Qu(e)),this._mediator.execute(new Au(e)),this._mediator.execute(new yp(e)),this._mediator.execute(new Ku(e)),this._mediator.execute(new Du)}finalizeDragSequence(){this._mediator.execute(new ui),this._mediator.execute(new Ar),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new ui),this._mediator.execute(new $p),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",j],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",j],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:[ke([hi,Ct]),Z]})}return t})(),dV=[...aV,...zB,...lB,...lV,...x9,..._B,...nV,...l9,...T9,...U9,...Z9,...R9,...M9],uV=(()=>{let t=class Bc{_store=p(L);handle({waypointIndex:e,connectionId:n}){let i=this._store.connections.require(n),r=i.fWaypoints()?.waypoints().slice();if(!r)throw new Error("Connection waypoints not found");r.splice(e,1),i.fWaypoints()?.waypoints.set(r),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._changeEvent(i))}_changeEvent(e){return new Yu(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(n){return new(n||Bc)};static \u0275prov=y({token:Bc,factory:Bc.\u0275fac})};return t=P([R(Bm)],t),t})(),w_=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},pV=(()=>{let t=class Vc{_store=p(L);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(n){return new(n||Vc)};static \u0275prov=y({token:Vc,factory:Vc.\u0275fac})};return t=P([R(w_)],t),t})(),hV=[Th,Ui,a6,s6,l6,c6,t7,P7,a7,S7,V7,B7,D7,H7,G7,q7,M7,A7,s7,W7,E7,I7,k7,y7,T7,C7,x7,z7,F7,j7,U7,L7,N7,$7,K7,Y7,X7,pV,uV],Yr=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(o){this.instance=o}},fV=(()=>{let t=class zc{_store=p(L);_mediator=p(V);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 du(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(n){return new(n||zc)};static \u0275prov=y({token:zc,factory:zc.\u0275fac})};return t=P([R(Yr)],t),t})(),qi=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(o,e){this.position=o,this.connectorRefs=e}},mV=(()=>{let t=class Hc{handle({position:e,connectorRefs:n}){let i,r=1/0;for(let a of n){let s=this._distanceToRect(e,a.rect);s<r&&(r=s,i=a)}return i?Dt(ge({},i),{distance:r}):void 0}_distanceToRect(e,{x:n,y:i,width:r,height:a}){let s=this._clamp(e.x,n,n+r),c=this._clamp(e.y,i,i+a),u=e.x-s,h=e.y-c;return Math.sqrt(u*u+h*h)}_clamp(e,n,i){return Math.max(n,Math.min(i,e))}static \u0275fac=function(n){return new(n||Hc)};static \u0275prov=y({token:Hc,factory:Hc.\u0275fac})};return t=P([R(qi)],t),t})(),Xr=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(o,e){this.pointerPosition=o,this.connectableConnectors=e}},_V=(()=>{let t=class qc{_mediator=p(V);_store=p(L);_browser=p(at);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 i=this._isSnapConnectionEnabledAndHasClosestConnector(e);i&&n.unshift(i.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&n.push(r),n}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(n=>te.isIncludePoint(n.rect,this._calculatePointerInFlow(e.pointerPosition))).map(n=>n.connector)}_calculatePointerInFlow(e){return qo(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let n=this._mediator.execute(new qi(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(i=>i.connector.fNodeId===n.fId())?.connector}static \u0275fac=function(n){return new(n||qc)};static \u0275prov=y({token:qc,factory:qc.\u0275fac})};return t=P([R(Xr)],t),t})(),Zr=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(o,e){this.source=o,this.pointer=e}},Kt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(o){this.connector=o}},gV=(()=>{let t=class Gc{_mediator=p(V);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new di(e.hostElement))}static \u0275fac=function(n){return new(n||Gc)};static \u0275prov=y({token:Gc,factory:Gc.\u0275fac})};return t=P([R(Kt)],t),t})(),Qr=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(o){this.nodeOrGroup=o}},bV=(()=>{let t=class jc{_store=p(L);_mediator=p(V);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new uu(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||jc)};static \u0275prov=y({token:jc,factory:jc.\u0275fac})};return t=P([R(Qr)],t),t})(),Vp=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(o){this.nodeOrGroup=o}},vV=(()=>{let t=class Uc{_store=p(L);handle({nodeOrGroup:e}){let n=this._collectInputIds(e);return this._collectConnections(n)}_collectInputIds(e){let n=new Set,i=this._store.inputs.getAll();for(let r of i)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],i=this._store.connections.getAll();for(let r of i)e.has(r.fInputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||Uc)};static \u0275prov=y({token:Uc,factory:Uc.\u0275fac})};return t=P([R(Vp)],t),t})(),Oo=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(o,e){this.connector=o,this.pointerPosition=e}},ky=2,Et=(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})(Et||{});function yV(t,o,e,n,i){let r=CV(i),a=e-t,s=n-o,c=xV(a,s);return wV(c,r)?c:TV(a,s,r,c)}function CV(t){if(!t||t.length===0)return Et.ALL;let o=Et.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case K.LEFT:o|=Et.LEFT;break;case K.RIGHT:o|=Et.RIGHT;break;case K.TOP:o|=Et.TOP;break;case K.BOTTOM:o|=Et.BOTTOM;break}return o||Et.ALL}function xV(t,o){let e=t<0?-t:t,n=o<0?-o:o;return e-n>ky?t<0?K.LEFT:K.RIGHT:(n-e>ky,o<0?K.TOP:K.BOTTOM)}function wV(t,o){switch(t){case K.LEFT:return(o&Et.LEFT)!==0;case K.RIGHT:return(o&Et.RIGHT)!==0;case K.TOP:return(o&Et.TOP)!==0;case K.BOTTOM:return(o&Et.BOTTOM)!==0;default:return!0}}function TV(t,o,e,n){let i=n,r=-1/0;if(e&Et.RIGHT){let a=t;a>r&&(r=a,i=K.RIGHT)}if(e&Et.LEFT){let a=-t;a>r&&(r=a,i=K.LEFT)}if(e&Et.BOTTOM){let a=o;a>r&&(r=a,i=K.BOTTOM)}if(e&Et.TOP){let a=-o;a>r&&(r=a,i=K.TOP)}return i}function zp(t){return t===K.CALCULATE||t===K.CALCULATE_HORIZONTAL||t===K.CALCULATE_VERTICAL}var SV={[K.CALCULATE]:[K.TOP,K.BOTTOM,K.LEFT,K.RIGHT],[K.CALCULATE_HORIZONTAL]:[K.LEFT,K.RIGHT],[K.CALCULATE_VERTICAL]:[K.TOP,K.BOTTOM]},kV=(()=>{let t=class $c{_mediator=p(V);handle({connector:e,pointerPosition:n}){let i=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 yV(r.x,r.y,s,c,SV[i])}_accumulateConnectedCenters(e,n,i){let r=i?.x||0,a=i?.y||0,s=i?1:0;if(n&&n.length)for(let c=0;c<n.length;c++){let u=n[c].hostElement;if(u===e)continue;let h=this._getConnectorRect(u).gravityCenter;r+=h.x,a+=h.y,s++}return{sumX:r,sumY:a,count:s}}_getConnectorRect(e){return this._mediator.execute(new it(e))}static \u0275fac=function(n){return new(n||$c)};static \u0275prov=y({token:$c,factory:$c.\u0275fac})};return t=P([R(Oo)],t),t})(),Hp=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(o){this.connector=o}},qp=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(o){this.fComponent=o}},IV=(()=>{let t=class Wc{_store=p(L);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(n){return new(n||Wc)};static \u0275prov=y({token:Wc,factory:Wc.\u0275fac})};return t=P([R(qp)],t),t})(),Gp=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(o){this.event=o}},EV=(()=>{let t=class Kc{_mediator=p(V);_store=p(L);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=p(he);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new Lr)}_setDifferenceToDraggableItems(e,n){this._dragContext.draggableItems.forEach(i=>{i.onPointerMove(ge({},e),n)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return pe.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(n){return new(n||Kc)};static \u0275prov=y({token:Kc,factory:Kc.\u0275fac})};return t=P([R(Gp)],t),t})(),jp=class{static fToken=Symbol("InitializeDragSequenceRequest")},MV=(()=>{let t=class Yc{_dragContext=p(he);handle(e){this._dragContext.reset()}static \u0275fac=function(n){return new(n||Yc)};static \u0275prov=y({token:Yc,factory:Yc.\u0275fac})};return t=P([R(jp)],t),t})(),fi=class{static fToken=Symbol("IsDragStartedRequest")},DV=(()=>{let t=class Xc{_store=p(L);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(n){return new(n||Xc)};static \u0275prov=y({token:Xc,factory:Xc.\u0275fac})};return t=P([R(fi)],t),t})(),Up=class{static fToken=Symbol("PrepareDragSequenceRequest")},PV=(()=>{let t=class Zc{_mediator=p(V);_dragContext=p(he);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new Pu)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(n){return new(n||Zc)};static \u0275prov=y({token:Zc,factory:Zc.\u0275fac})};return t=P([R(Up)],t),t})(),$p=class{static fToken=Symbol("RemoveDndFromStoreRequest")},RV=(()=>{let t=class Qc{_store=p(L);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(n){return new(n||Qc)};static \u0275prov=y({token:Qc,factory:Qc.\u0275fac})};return t=P([R($p)],t),t})(),OV=[IV,EV,MV,PV,DV,RV],FV=new be("CONNECTABLE_SIDE_EPSILON"),NV=(()=>{let t=class Jc{_mediator=p(V);_lastSide=new WeakMap;_epsilon=Math.max(0,p(FV,{optional:!0})??2);handle({connector:e}){if(this._isDragging()){let i=this._lastSide.get(e);if(i!==void 0)return i;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,i){let r=te.fromElement(e),a=n.getBoundingClientRect(),s=r.gravityCenter.x,c=r.gravityCenter.y,u=s-a.left,h=a.right-s,g=c-a.top,C=a.bottom-c,k=0,I=u,N=[u,h,g,C];for(let ee=1;ee<4;ee++){let ce=N[ee];ce<I&&(I=ce,k=ee)}let q=k===0?K.LEFT:k===1?K.RIGHT:k===2?K.TOP:K.BOTTOM,Y=this._lastSide.get(i);if(Y!==void 0&&Y!==q){let ee=Y===K.LEFT?0:Y===K.RIGHT?1:Y===K.TOP?2:3;(ee===0?u:ee===1?h:ee===2?g:C)-I<=this._epsilon&&(q=Y)}return q}_isDragging(){return this._mediator.execute(new fi)}static \u0275fac=function(n){return new(n||Jc)};static \u0275prov=y({token:Jc,factory:Jc.\u0275fac})};return t=P([R(Hp)],t),t})(),Fo=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(o){this.nodeOrGroup=o}},AV=(()=>{let t=class ed{_mediator=p(V);handle({nodeOrGroup:e}){let n=e.connectors,i=n.length;for(let a=0;a<i;a++){let s=n[a];s.fConnectableSide=this._resolveSideForConnectorFast(s)}let r=new Set;for(let a=0;a<i;a++){let c=n[a].toConnector;if(c&&c.length)for(let u=0,h=c.length;u<h;u++){let g=c[u],C=g.userFConnectableSide;zp(C)&&r.add(g)}}r.size>0&&r.forEach(a=>{a.fConnectableSide=this._calculateByConnectedPositions(a)})}_resolveSideForConnectorFast(e){let n=e.userFConnectableSide;return n===K.AUTO?this._mediator.execute(new Hp(e)):zp(n)?this._calculateByConnectedPositions(e):n}_calculateByConnectedPositions(e){return this._mediator.execute(new Oo(e))}static \u0275fac=function(n){return new(n||ed)};static \u0275prov=y({token:ed,factory:ed.\u0275fac})};return t=P([R(Fo)],t),t})(),No=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},LV=(()=>{let t=class td{_store=p(L);handle(e){return te.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>te.fromElement(e.hostElement))}static \u0275fac=function(n){return new(n||td)};static \u0275prov=y({token:td,factory:td.\u0275fac})};return t=P([R(No)],t),t})(),Wp=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(o){this.fNodes=o}},BV=(()=>{let t=class nd{_store=p(L);_mediator=p(V);handle(e){return te.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 Po(e.hostElement));if(n)return this._getElementRect(e,n);let i=this._mediator.execute(new it(e.hostElement));return this._getElementRect(e,i)}_getElementRect(e,n){return te.initialize(e._position.x,e._position.y,n.width,n.height)}static \u0275fac=function(n){return new(n||nd)};static \u0275prov=y({token:nd,factory:nd.\u0275fac})};return t=P([R(Wp)],t),t})(),Kp=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(o){this.nodeOrGroup=o}},VV=(()=>{let t=class id{_store=p(L);handle({nodeOrGroup:e}){let n=this._collectOutputIds(e);return this._collectConnections(n)}_collectOutputIds(e){let n=new Set,i=this._store.outputs.getAll();for(let r of i)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],i=this._store.connections.getAll();for(let r of i)e.has(r.fOutputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||id)};static \u0275prov=y({token:id,factory:id.\u0275fac})};return t=P([R(Kp)],t),t})(),Jr=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(o){this.nodeOrGroup=o}},Gi=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(o,e){this.fNode=o,this.rect=e}},zV=(()=>{let t=class od{_browser=p(at);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,n){let i=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(i.paddingLeft,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingTop,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingRight,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingBottom,n.width,n.height,i.fontSize)]}static \u0275fac=function(n){return new(n||od)};static \u0275prov=y({token:od,factory:od.\u0275fac})};return t=P([R(Gi)],t),t})(),HV=(()=>{let t=class rd{_mediator=p(V);_store=p(L);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 i=this._nodes.find(r=>r.fId()===n);i&&this._mediator.execute(new Jr(i))}_calculateDirectChildren(e){return this._nodes.filter(n=>n.fParentId()===e.fId())}_unionRect(e){return te.union(e.map(n=>this._boundingRect(n)))||te.initialize()}_boundingRect(e){return this._mediator.execute(new it(e.hostElement))}_paddings(e,n){return this._mediator.execute(new Gi(e,n))}_calculateChildrenBounding(e,[n,i,r,a]){let s=this._unionRect(e);return s=te.initialize(s.x-n,s.y-i,s.width+n+r,s.height+i+a),s}static \u0275fac=function(n){return new(n||rd)};static \u0275prov=y({token:rd,factory:rd.\u0275fac})};return t=P([R(Jr)],t),t})(),Yp=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(o){this.id=o}},qV=(()=>{let t=class ad{_store=p(L);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let n=new Set,i=[];return this._collectDescendants(e.id,i,n),i}_collectDescendants(e,n,i){if(i.has(e))throw new Error(`Circular reference detected in the node hierarchy. Node id: ${e}`);i.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,i)}static \u0275fac=function(n){return new(n||ad)};static \u0275prov=y({token:ad,factory:ad.\u0275fac})};return t=P([R(Yp)],t),t})(),Ao=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(o){this.nodeOrGroup=o}},GV=(()=>{let t=class sd{_store=p(L);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,n,i){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?(i.push(r),this._getParentNodes(r,n,i)):i}static \u0275fac=function(n){return new(n||sd)};static \u0275prov=y({token:sd,factory:sd.\u0275fac})};return t=P([R(Ao)],t),t})(),ea=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(o,e){this.nodeOrGroup=o,this.destroyRef=e}},jV=(()=>{let t=class ld{_mediator=p(V);handle({nodeOrGroup:e,destroyRef:n}){let{hostElement:i,stateChanges:r}=e;new En(new gm(i),r).listen(n,()=>{this._mediator.execute(new Ai),this._isDragging()||(this._mediator.execute(new Do(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new Fo(e)),this._mediator.execute(new Jr(e)))})}_isDragging(){return this._mediator.execute(new fi)}static \u0275fac=function(n){return new(n||ld)};static \u0275prov=y({token:ld,factory:ld.\u0275fac})};return t=P([R(ea)],t),t})(),ta=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(o){this.instance=o}},UV=(()=>{let t=class cd{_store=p(L);_mediator=p(V);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new pu(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||cd)};static \u0275prov=y({token:cd,factory:cd.\u0275fac})};return t=P([R(ta)],t),t})(),$V=[bV,kV,NV,vV,AV,LV,BV,VV,HV,qV,zV,GV,jV,UV],WV=(()=>{let t=class dd{_mediator=p(V);_store=p(L);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:n}){let i=this._getConnectableTargets(e),r=[];for(let a of i)r.push(this._mediator.execute(new Kt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(i=>e.canConnectTo(i));let n=this._targets.filter(i=>i.canBeConnected);return e.isSelfConnectable||(n=n.filter(i=>i.fNodeId!==e.fNodeId)),n}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:i}of e)zp(i.userFConnectableSide)&&(i.fConnectableSide=this._calculateByConnectedPositions(i,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Oo(e,n))}static \u0275fac=function(n){return new(n||dd)};static \u0275prov=y({token:dd,factory:dd.\u0275fac})};return t=P([R(Zr)],t),t})(),Xp=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(o,e){this.target=o,this.pointer=e}},KV=(()=>{let t=class ud{_mediator=p(V);_store=p(L);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:n}){let i=this._getConnectableSources(e),r=[];for(let a of i)r.push(this._mediator.execute(new Kt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableSources(e){return this._sources.filter(n=>{let i=n.canBeConnected;return i&&n.hasConnectionLimits&&(i=n.canConnectTo(e)),i})}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:i}of e)zp(i.userFConnectableSide)&&(i.fConnectableSide=this._calculateByConnectedPositions(i,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Oo(e,n))}static \u0275fac=function(n){return new(n||ud)};static \u0275prov=y({token:ud,factory:ud.\u0275fac})};return t=P([R(Xp)],t),t})(),Lo=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(o){this.connectors=o}},ht={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"}},YV=(()=>{let t=class pd{_store=p(L);handle({connectors:e}){this._store.flowHost.classList.add(ht.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._markConnector(n))}_markConnector({hostElement:e}){e.classList.add(ht.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||pd)};static \u0275prov=y({token:pd,factory:pd.\u0275fac})};return t=P([R(Lo)],t),t})(),na=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(o){this.instance=o}},XV=(()=>{let t=class hd{_store=p(L);_mediator=p(V);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 Ir(e.fId(),e.kind))}static \u0275fac=function(n){return new(n||hd)};static \u0275prov=y({token:hd,factory:hd.\u0275fac})};return t=P([R(na)],t),t})(),Bo=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(o){this.connectors=o}},ZV=(()=>{let t=class fd{_store=p(L);handle({connectors:e}){this._store.flowHost.classList.remove(ht.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._unmarkConnector(n))}_unmarkConnector({hostElement:e}){e.classList.remove(ht.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||fd)};static \u0275prov=y({token:fd,factory:fd.\u0275fac})};return t=P([R(Bo)],t),t})(),QV=[fV,XV,mV,_V,KV,WV,gV,YV,ZV],Zp=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(o){this.instance=o}},$i=(function(t){return t.TOP_BOTTOM="TOP_BOTTOM",t.BOTTOM_TOP="BOTTOM_TOP",t.LEFT_RIGHT="LEFT_RIGHT",t.RIGHT_LEFT="RIGHT_LEFT",t})($i||{}),oi=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(oi||{});function JV(t){let o=[...t.nodes.map(Iy),...t.groups.map(Iy)],e=new Set(t.nodes.map(s=>s.id)),n=new Set(t.groups.map(s=>s.id)),i=new Map,r=new Map;for(let s of[...t.nodes,...t.groups]){for(let c of s.fOutputs)i.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=i.get(c.fOutputId),h=r.get(c.fInputId);return!u||!h||s.push({source:u,target:h}),s},[]);return{nodes:o,connections:a,nodeIds:e,groupIds:n}}function Iy(t){return{id:t.id,size:t.measuredSize?ge({},t.measuredSize):t.size?ge({},t.size):void 0}}var e8=1,Ih=(()=>{class t{_destroyRef=p(xt);_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 i=e.fId();this.unregisterFlow(i);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(i)),n.connectionsChanges$.listen(()=>this._handleConnectionsChanges(i))),this._flows.set(i,r),this._engine?.getMode()===oi.AUTO&&this._scheduleRelayout(i)}unregisterFlow(e){let n=this._flows.get(e);n&&(n.unsubs.forEach(i=>i()),this._clearScheduledWork(n),this._flows.delete(e))}handleModeChanged(e){if(e===oi.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,i]of this._flows.entries())await this._relayoutRegisteredFlow(n,i)}}_handleNodesChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let i=this._buildNodeSignature(n.store);i!==n.nodeSignature&&(n.nodeSignature=i,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let i=this._buildConnectionSignature(n.store);i!==n.connectionSignature&&(n.connectionSignature=i,this._scheduleRelayout(e))}_scheduleRelayout(e){let n=this._flows.get(e);!n||!this._engine||this._engine.getMode()!==oi.AUTO||(n.timeoutId!==null&&clearTimeout(n.timeoutId),this._cancelAnimationFrames(n),n.timeoutId=setTimeout(()=>{n.timeoutId=null,this._runAfterNextPaint(n,()=>{this._relayoutFlowIfReady(e)})},e8))}async _relayoutFlowIfReady(e){let n=this._flows.get(e);if(!(!n||!this._engine||this._engine.getMode()!==oi.AUTO)){if(n.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,n)}}async _relayoutRegisteredFlow(e,n){if(!this._engine)return;let i=JV(n.flow.getState({measuredSize:!0})),r=++n.runId,a=await this._engine.calculate(i.nodes,i.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,i.nodeIds,i.groupIds)}finally{queueMicrotask(()=>{let u=this._flows.get(e);u&&(u.isApplying=!1)})}}}_emitWriteback(e,n,i,r){let a=this._engine?.getWriteback();a&&a({flowId:e,nodes:n.filter(s=>i.has(s.id)),groups:n.filter(s=>r.has(s.id))})}_applyPositions(e,n){return n.filter(i=>{let r=e.nodes.get(i.id);return!r||U.isEqual(r._position,i.position)?!1:(r.position.set(ge({},i.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})(),hC=new be("F_LAYOUT_OPTIONS");function fC(t,o){return t.reduce((e,n)=>{let i=o.get(n.id);return i&&e.push({id:n.id,position:i}),e},[])}var t8=new be("F_LAYOUT"),Qp=class{_controller=p(Ih);_config=p(hC,{optional:!0})??{};_interactiveOptions;_mode;_writeback;_defaultOptions;interactiveOptions;constructor(o){this._mode=this._config.mode??oi.MANUAL,this._writeback=this._config.writeback??null,this._defaultOptions=this.mergeOptions(o,this._config.options),this._interactiveOptions=X(this.mergeOptions(this._defaultOptions,{})),this.interactiveOptions=E(()=>this.mergeOptions(this._interactiveOptions(),{})),this._controller.attachEngine(this)}setMode(o){this._mode=o,this._controller.handleModeChanged(o)}getMode(){return this._mode}setWriteback(o){this._writeback=o}getWriteback(){return this._writeback}setInteractiveOptions(o){this._interactiveOptions.set(this.mergeOptions(this._interactiveOptions(),o))}relayout(o){return this._controller.relayout(o)}getProviderConfig(){return ge({},this._config)}resolveLayoutOptions(o){let e=ge({},o??{});return delete e.flowId,delete e.mode,this.mergeOptions(this._interactiveOptions(),e)}};function mC(t,o){return[Ih,t,{provide:t8,useExisting:t},{provide:hC,useValue:o??{}}]}var n8=(()=>{let t=class md{_store=p(L);_layoutController=p(Ih,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(n){return new(n||md)};static \u0275prov=y({token:md,factory:md.\u0275fac})};return t=P([R(Zp)],t),t})(),Jp=class{static fToken=Symbol("GetFlowRequest")},i8=(()=>{let t=class _d{_store=p(L);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||_d)};static \u0275prov=y({token:_d,factory:_d.\u0275fac})};return t=P([R(Jp)],t),t})(),eh=class{static fToken=Symbol("CalculateConnectionsStateRequest")},o8=(()=>{let t=class gd{_store=p(L);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||gd)};static \u0275prov=y({token:gd,factory:gd.\u0275fac})};return t=P([R(eh)],t),t})(),ia=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(o,e=!1){this.component=o,this.measuredSize=e}},r8=(()=>{let t=class bd{_store=p(L);_mediator=p(V);handle({component:e,measuredSize:n}){return this._store.nodes.getAll().filter(i=>i instanceof e).map(i=>{let r=n?this._mediator.execute(new it(i.hostElement)):null;return{id:i.fId(),parentId:i.fParentId()??void 0,position:ge({},i._position),size:i._size?ge({},i._size):void 0,measuredSize:r?{width:r.width,height:r.height}:void 0,rotate:i._rotate,fOutputs:this._getOutputs(i.hostElement),fInputs:this._getInputs(i.hostElement),isSelected:i.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||bd)};static \u0275prov=y({token:bd,factory:bd.\u0275fac})};return t=P([R(ia)],t),t})(),th=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(o=!1){this.measuredSize=o}},a8=(()=>{let t=class vd{_mediator=p(V);_store=p(L);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return U.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new ia(kh,e)),groups:this._mediator.execute(new ia(Km,e)),connections:this._mediator.execute(new eh)}}static \u0275fac=function(n){return new(n||vd)};static \u0275prov=y({token:vd,factory:vd.\u0275fac})};return t=P([R(th)],t),t})(),s8=[a8,r8,o8],nh=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(o){this.instance=o}},l8=(()=>{let t=class yd{_store=p(L);_layoutController=p(Ih,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(n){return new(n||yd)};static \u0275prov=y({token:yd,factory:yd.\u0275fac})};return t=P([R(nh)],t),t})(),Eh=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ih=class{static fToken=Symbol("NotifyNodesRenderedRequest")},M_=new be("F_FLOW"),T_=class{},c8=(()=>{let t=class Cd{_state=p(Eh);_fFlow=p(M_);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||Cd)};static \u0275prov=y({token:Cd,factory:Cd.\u0275fac})};return t=P([R(ih)],t),t})(),oh=class{static fToken=Symbol("NotifyFullRenderedRequest")},d8=(()=>{let t=class xd{_state=p(Eh);_fFlow=p(M_);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||xd)};static \u0275prov=y({token:xd,factory:xd.\u0275fac})};return t=P([R(oh)],t),t})(),oa=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(o,e,n,i){this.targetConnectionsRevision=o,this.targetNodesRevision=e,this.callback=n,this.destroyRef=i}},u8=(()=>{let t=class wd{_store=p(L);handle({targetConnectionsRevision:e,targetNodesRevision:n,callback:i,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=n){i();return}let a=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<n||(a(),i())});r.onDestroy(a)}static \u0275fac=function(n){return new(n||wd)};static \u0275prov=y({token:wd,factory:wd.\u0275fac})};return t=P([R(oa)],t),t})(),rh=class{static fToken=Symbol("ResetRenderLifecycleRequest")},p8=(()=>{let t=class Td{_state=p(Eh);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(n){return new(n||Td)};static \u0275prov=y({token:Td,factory:Td.\u0275fac})};return t=P([R(rh)],t),t})(),ah=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(o){this.destroyRef=o}},_C=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),h8=(()=>{let t=class Sd{_state=p(_C);_store=p(L);_mediator=p(V);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 i=this._state.pendingRedraw;n(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,i&&this._mediator.execute(new Or)});e.destroyRef.onDestroy(n)}static \u0275fac=function(n){return new(n||Sd)};static \u0275prov=y({token:Sd,factory:Sd.\u0275fac})};return t=P([R(ah)],t),t})(),f8=[n8,i8,...s8,l8,Eh,c8,d8,u8,p8,_C,h8],sh=class{static fToken=Symbol("ClearSelectionRequest")},m8=(()=>{let t=class kd{_dragContext=p(he);handle(e){this._dragContext.selectedItems.forEach(n=>n.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||kd)};static \u0275prov=y({token:kd,factory:kd.\u0275fac})};return t=P([R(sh)],t),t})(),lh=class{static fToken=Symbol("CalculateSelectableItemsRequest")},_8=(()=>{let t=class Id{_mediator=p(V);_store=p(L);_dragContext=p(he);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 it(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new it(e.boundingElement))}))}static \u0275fac=function(n){return new(n||Id)};static \u0275prov=y({token:Id,factory:Id.\u0275fac})};return t=P([R(lh)],t),t})(),ra=class{static fToken=Symbol("GetCurrentSelectionRequest")},g8=(()=>{let t=class Ed{_dragContext=p(he);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||Ed)};static \u0275prov=y({token:Ed,factory:Ed.\u0275fac})};return t=P([R(ra)],t),t})(),ch=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(o,e,n=!0){this.nodes=o,this.connections=e,this.isSelectedChanged=n}},b8=(()=>{let t=class Md{_dragContext=p(he);_store=p(L);handle(e){this._dragContext.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(n=>{let i=this._store.nodes.get(n);i&&(i.markAsSelected(),this._dragContext.selectedItems.push(i))}),e.connections.forEach(n=>{let i=this._store.connections.get(n);i&&(i.markAsSelected(),this._dragContext.selectedItems.push(i))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(n){return new(n||Md)};static \u0275prov=y({token:Md,factory:Md.\u0275fac})};return t=P([R(ch)],t),t})(),dh=class{static fToken=Symbol("SelectAllRequest")},v8=(()=>{let t=class Dd{_dragSession=p(he);_store=p(L);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||Dd)};static \u0275prov=y({token:Dd,factory:Dd.\u0275fac})};return t=P([R(dh)],t),t})(),Vo=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(o){this.nodeOrGroup=o}},uh=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(o,e,n,i){this.fItemsContainer=o,this.allElements=e,this.elementsThatShouldBeInFront=n,this.targetIndex=i}},y8=(()=>{let t=class Pd{handle(e){let n=[];for(let i=e.targetIndex+1;i<e.allElements.length;i++){let r=e.allElements[i];e.elementsThatShouldBeInFront.includes(r)||n.push(r)}n.forEach(i=>{e.fItemsContainer.removeChild(i),e.fItemsContainer.insertBefore(i,e.allElements[e.targetIndex])})}static \u0275fac=function(n){return new(n||Pd)};static \u0275prov=y({token:Pd,factory:Pd.\u0275fac})};return t=P([R(uh)],t),t})(),ji=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(o,e){this.item=o,this.itemContainer=e}},zo=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(o){this.nodeOrGroupId=o}},C8=(()=>{let t=class Rd{_store=p(L);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 i=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return i.reduce((r,a)=>r.concat(this._getChildrenNodes(a.fId(),n)),i)}static \u0275fac=function(n){return new(n||Rd)};static \u0275prov=y({token:Rd,factory:Rd.\u0275fac})};return t=P([R(zo)],t),t})(),x8=(()=>{let t=class Od{_store=p(L);_mediator=p(V);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()),i=this._getChildrenGroups(n);this._updateLayers(this._groupsContainer,e.item.hostElement,i);let r=this._getChildrenNodes(n);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),i=this._getChildrenNodes(n);this._updateLayers(e.itemContainer,e.item.hostElement,i)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,n,i){let r=Array.from(e.children),a=r.findIndex(s=>s===n);this._isAnythingNeedToBeMoved(r,a,i)&&this._mediator.execute(new uh(e,r,i,a))}_isAnythingNeedToBeMoved(e,n,i){for(let r=n+1;r<e.length;r++)if(!i.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let n=Array.from(this._groupsContainer.children);return e.filter(i=>this._groupsContainer.contains(i)).sort((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodes(e){let n=Array.from(this._nodesContainer.children);return e.filter(i=>this._nodesContainer.contains(i)).sort((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new zo(e)).map(n=>n.hostElement)}static \u0275fac=function(n){return new(n||Od)};static \u0275prov=y({token:Od,factory:Od.\u0275fac})};return t=P([R(ji)],t),t})(),w8=(()=>{let t=class Fd{_dragSession=p(he);_mediator=p(V);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new ji(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||Fd)};static \u0275prov=y({token:Fd,factory:Fd.\u0275fac})};return t=P([R(Vo)],t),t})(),T8=[m8,_8,g8,b8,v8,w8],ph=class{static fToken=Symbol("ResetZoomRequest")},S8=(()=>{let t=class Nd{_store=p(L);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(n){return new(n||Nd)};static \u0275prov=y({token:Nd,factory:Nd.\u0275fac})};return t=P([R(ph)],t),t})(),hh=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(o,e,n,i=!1){this.position=o,this.step=e,this.direction=n,this.animate=i}},k8=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),I8=new Set(["drag-canvas","selection-area"]),E8=(()=>{let t=class Ad{_mediator=p(V);_store=p(L);_dragContext=p(he,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(Xe.ZOOM)}get _isDragStarted(){return this._mediator.execute(new fi)}handle(e){if(!this._zoomComponent)return;let n=this._canvas.transform.scale,i=this._clamp(n+e.step*e.direction);if(i===n)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let a=this._getDragZoomMode();if(a==="blocked")return;a==="rebase"&&this._rebaseDragContext(r,i)}this._canvas.setScale(i,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 pe.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let n of this._dragContext?.draggableItems??[]){let i=n.getEvent().kind;if(k8.has(i)){e=!0;continue}if(!I8.has(i))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,n){if(!this._dragContext)return;let i=this._dragContext.onPointerDownScale;if(!i||i===n){this._dragContext.onPointerDownScale=n;return}let r=1/n-1/i;this._dragContext.onPointerDownPosition=pe.fromPoint(this._dragContext.onPointerDownPosition).add(pe.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=n}static \u0275fac=function(n){return new(n||Ad)};static \u0275prov=y({token:Ad,factory:Ad.\u0275fac})};return t=P([R(hh)],t),t})(),M8=[S8,E8],fh=class{static fToken=Symbol("MinimapDrawNodesRequest")},D8=(()=>{let t=class Ld{_browser=p(at);_store=p(L);handle(e){let n=this._store.fFlow,i=this._store.fCanvas;return!n||!i?[]:this._store.nodes.getAll().map(a=>this._renderNode(a,n,i))}_renderNode(e,n,i){let r=ko("rect",this._browser);em(this._nodeRect(e,n,i),r);let a=e instanceof kh;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,i){let r=te.elementTransform(te.fromElement(e.hostElement),n.hostElement);return te.div(r,i.transform.scale)}_minimapClasses(e){let n=e.fMinimapClass();return Array.isArray(n)?n:[n]}static \u0275fac=function(n){return new(n||Ld)};static \u0275prov=y({token:Ld,factory:Ld.\u0275fac})};return t=P([R(fh)],t),t})(),mh=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(o,e){this.svg=o,this.minSize=e}},P8=(()=>{let t=class Bd{_mediator=p(V);_store=p(L);handle({svg:e,minSize:n}){let i=this._store.fFlow,r=this._store.fCanvas;if(!i||!r)return{scale:1,viewBox:te.initialize(0,0,0,0)};let a=this._contentRectInMinimapSpace(i,r,n),s=this._minimapRectInFlowSpace(e,i),c=this._viewportScale(a,s),u=this._viewportViewBox(a,s,c);return{scale:c,viewBox:u}}_contentRectInMinimapSpace(e,n,i){let r=this._nodesBoundingBox(),a=te.elementTransform(r,e.hostElement),s=te.div(a,n.transform.scale);return Kv(s,i)}_nodesBoundingBox(){return this._mediator.execute(new No)??te.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,n){return te.elementTransform(te.fromElement(e),n.hostElement)}_viewportScale(e,n){let i=n.width||1,r=n.height||1;return Math.max(e.width/i,e.height/r)}_viewportViewBox(e,n,i){let r=this._viewportSize(n,i),a=e.x-(r.width-e.width)/2,s=e.y-(r.height-e.height)/2;return te.initialize(a,s,r.width,r.height)}_viewportSize(e,n){return Ot.initialize(e.width*n||0,e.height*n||0)}static \u0275fac=function(n){return new(n||Bd)};static \u0275prov=y({token:Bd,factory:Bd.\u0275fac})};return t=P([R(mh)],t),t})(),_h=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},R8=(()=>{let t=class Vd{_store=p(L);handle(e){let n=this._store.fFlow,i=this._store.fCanvas;if(!n||!i)return te.initialize();let r=te.div(te.fromElement(n.hostElement),i.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(n){return new(n||Vd)};static \u0275prov=y({token:Vd,factory:Vd.\u0275fac})};return t=P([R(_h)],t),t})(),gh=class{element;scale;viewBox;constructor(o,e=1,n=te.initialize(0,0,0,0)){this.element=o,this.scale=e,this.viewBox=n}},O8=[D8,P8,R8],bh=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(o){this.position=o}},F8=(()=>{let t=class zd{_store=p(L);handle({position:e}){return qo(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(n){return new(n||zd)};static \u0275prov=y({token:zd,factory:zd.\u0275fac})};return t=P([R(bh)],t),t})(),vh=class{static fToken=Symbol("SortNodeLayersRequest")},N8=(()=>{let t=class Hd{_store=p(L);_mediator=p(V);_browser=p(at);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((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new zo(e)).filter(n=>this._nodesContainer.contains(n.hostElement)).map(n=>n.hostElement)}_moveChildrenNodes(e){let n=this._browser.document.createDocumentFragment();e.forEach(i=>{n.appendChild(i)}),this._nodesContainer.appendChild(n)}static \u0275fac=function(n){return new(n||Hd)};static \u0275prov=y({token:Hd,factory:Hd.\u0275fac})};return t=P([R(vh)],t),t})(),aa=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(o){this.itemsContainer=o}},A8=(()=>{let t=class qd{_store=p(L);_browser=p(at);handle({itemsContainer:e}){let n=Array.from(e.children);if(n.length<2)return;let i=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,i,c,a,s);u.length&&this._moveBeforeNextSibling(e,u,c.hostElement.nextElementSibling)}}_buildPositions(e){let n=new Map;for(let i=0;i<e.length;i++)n.set(e[i],i);return n}_getSortedChildrenBeforeParent(e,n,i,r,a){let s=n.get(i.hostElement);if(s===void 0)return[];let c=this._getDeepChildren(i.fId(),r,a);if(!c.length)return[];let u=[];for(let h of c){let g=h.hostElement;if(!e.contains(g))continue;let C=n.get(g);C===void 0||C>=s||u.push(g)}return u.sort((h,g)=>(n.get(h)??0)-(n.get(g)??0)),u}_buildChildrenByParentId(e){let n=new Map;for(let i of e){let r=i.fParentId();if(!r)continue;let a=n.get(r)??[];a.push(i),n.set(r,a)}return n}_getDeepChildren(e,n,i){let r=i.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 h=u.fId();if(c.has(h))continue;c.add(h),a.push(u);let g=n.get(h);g?.length&&s.push(...g)}return i.set(e,a),a}_moveBeforeNextSibling(e,n,i){let r=this._browser.document.createDocumentFragment();for(let a of n)r.appendChild(a);e.insertBefore(r,i)}static \u0275fac=function(n){return new(n||qd)};static \u0275prov=y({token:qd,factory:qd.\u0275fac})};return t=P([R(aa)],t),t})(),yh=class{static fToken=Symbol("SortItemLayersRequest")},L8=(()=>{let t=class Gd{_store=p(L);_mediator=p(V);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let n=this._store.nodes.getAll();n.length<2||!n.some(i=>!!i.fParentId())||(this._mediator.execute(new aa(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new vh),this._mediator.execute(new aa(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(n){return new(n||Gd)};static \u0275prov=y({token:Gd,factory:Gd.\u0275fac})};return t=P([R(yh)],t),t})();function ko(t,o){return o.document.createElementNS("http://www.w3.org/2000/svg",t)}function an(t,o){return o(t)}function gn(t){return!0}function B8(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var V8=[...r6,...hV,...KL,...QV,...OV,...f8,...$V,...T8,...M8,...O8,...b7,C8,v7,w7,F8,L8,A8,N8,x8,y8],z8=0,gC=(()=>{class t{_destroyRef=p(xt);_elementReference=p(Qe);_fBrowser=p(at);_stateChanges=new rn;get hostElement(){return this._elementReference.nativeElement}id=B(`f-pattern-${z8++}`);vColor=B("rgba(0,0,0,0.1)");hColor=B("rgba(0,0,0,0.1)");vSize=B(20,{transform:xe});hSize=B(20,{transform:xe});_transform=ni.default();_position=U.initialize();_size=Ot.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=ko("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=ko("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=ko("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new En(this._stateChanges).pipe(Ch()).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=Ot.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,i,r,a,s){e.setAttribute("stroke",`${n}`),e.setAttribute("x1",`${i}`),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=z({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(n,i){n&2&&O("id",i.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[ke([{provide:pm,useExisting:t}]),ro],decls:0,vars:0,template:function(n,i){},encapsulation:2,changeDetection:0})}return t})();var H8=new be("F_BACKGROUND"),q8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),bC=(()=>{class t extends q8{_mediator=p(V);fBackgroundPattern=Qa(pm);ngOnInit(){this._mediator.execute(new li(Xe.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new jd(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new ci(Xe.BACKGROUND))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-background"]],contentQueries:function(n,i,r){n&1&&Tf(r,i.fBackgroundPattern,pm,5),n&2&&jt()},hostAttrs:[1,"f-component","f-background"],features:[ke([{provide:H8,useExisting:t}]),Z],ngContentSelectors:CL,decls:2,vars:0,template:function(n,i){n&1&&(pn(),W(),se(0,"svg"),$e(1),fe())},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 S_=class{position;scale;constructor(o,e){this.position=o,this.scale=e}},G8=new be("F_CANVAS"),j8=(()=>{class t{transform=ni.default();_fCanvasChange=new rn;destroyRef=p(xt);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new En(this._fCanvasChange).pipe(Ud(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new S_(U.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),sa=(()=>{class t extends j8{_mediator=p(V);_componentsStore=p(L);_elementReference=p(Qe);_injector=p(dt);_flowId;fCanvasChange=Ke();position=B(U.initialize(),{transform:U.castToPoint});scale=B(1,{transform:xe});debounceTime=B(0,{transform:xe});debounce=E(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=nt.required("fGroupsContainer");fNodesContainer=nt.required("fNodesContainer");fConnectionsContainer=nt.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new Jp).fId(),this._mediator.execute(new Wd(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){de(()=>{this._mediator.execute(new Xd(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){de(()=>{this._mediator.execute(new Zd(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new Sr(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=ni.toString(this.transform),this._mediator.execute(new si)}redrawWithAnimation(){this._mediator.execute(new Sr(this.transform)),this.hostElement.style.transition=`transform ${B8()?80:150}ms ease-in-out`,this.hostElement.style.transform=ni.toString(this.transform),Ey(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,n=!0){this._afterRedraw(()=>{this._mediator.execute(new Kd(e,n))})}fitToScreen(e=U.initialize(),n=!0){this._afterRedraw(()=>{this._mediator.execute(new Yd(e,n))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new eu(e))})}getScale(){return this.transform.scale||1}setScale(e,n=U.initialize()){this._mediator.execute(new tu(e,n))}resetScale(){this._mediator.execute(new Jd)}ngOnDestroy(){this._mediator.execute(new Qd)}_afterRedraw(e){this._mediator.execute(new oa(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>ao(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-canvas"]],viewQuery:function(n,i){n&1&&hn(i.fGroupsContainer,xL,5)(i.fNodesContainer,wL,5)(i.fConnectionsContainer,TL,5),n&2&&jt(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[ke([{provide:G8,useExisting:t}]),Z],ngContentSelectors:kL,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(n,i){n&1&&(pn(SL),Ya(0),se(1,"div",null,0),$e(3),fe(),se(4,"div",3,1),$e(6,1),$e(7,2),$e(8,3),fe(),se(9,"div",null,2),$e(11,4),fe(),Xa())},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 U8=0,vC=(()=>{class t extends e7{fId=B(`f-connection-${U8++}`,{alias:"fConnectionId"});fOutputId=B("",{transform:e=>Ro(e)||""});fInputId=B("",{transform:e=>Ro(e)||""});fRadius=8;fOffset=12;fBehavior=ri.FIXED;fType=wo.STRAIGHT;fSelectionDisabled=B(!1,{transform:j});fReassignableStart=B(!1,{transform:j});fDraggingDisabled=B(!1,{alias:"fReassignDisabled",transform:j});fInputSide=B(Ye.DEFAULT,{transform:e=>xo(e,"fInputSide",Ye)});fOutputSide=B(Ye.DEFAULT,{transform:e=>xo(e,"fOutputSide",Ye)});get boundingElement(){return this.fPath().hostElement}_mediator=p(V);ngOnInit(){this._mediator.execute(new iu(this))}ngOnChanges(){this._mediator.execute(new Ai)}ngOnDestroy(){this._mediator.execute(new Eu(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(n,i){n&2&&(O("id",i.fId()),ue("f-connection-selection-disabled",i.fSelectionDisabled())("f-connection-reassign-disabled",i.fDraggingDisabled()))},inputs:{fId:[1,"fConnectionId","fId"],fOutputId:[1,"fOutputId"],fInputId:[1,"fInputId"],fRadius:[2,"fRadius","fRadius",xe],fOffset:[2,"fOffset","fOffset",xe],fBehavior:[2,"fBehavior","fBehavior",e=>xo(e,"fBehavior",ri)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[ke([{provide:xh,useExisting:t}]),Z,ro],ngContentSelectors:EL,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,i){if(n&1&&(pn(IL),W(),f(0,"svg",1),F(1,"defs",null,0),$e(3),f(4,"g",2),M(5,ML,1,1,":svg:linearGradient",3),F(6,"path",4),f(7,"g"),F(8,"path",5),M(9,DL,1,0,":svg:circle",6),F(10,"circle",7),_()()(),$e(11,1),$e(12,2),$e(13,3),M(14,PL,1,0)),n&2){let r;l(5),D((r=i.fGradient())?5:-1,r),l(),O("d",i.path),l(2),m("useGradient",!!i.fGradient()),O("d",i.path),l(),D(i.fReassignableStart()?9:-1),l(5),D(i.fContents().length?14:-1)}},dependencies:[Em,X6,Z6,j6,Y6],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 $8=new be("F_MAGNETIC_LINES"),W8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})();var yC=(()=>{class t extends W8{threshold=B(10,{transform:xe,alias:"fAlignThreshold"});_mediator=p(V);ngOnInit(){this._mediator.execute(new li(Xe.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new ci(Xe.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[ke([{provide:$8,useExisting:t}]),Z],decls:0,vars:0,template:function(n,i){},styles:[RL]})}return t})();var cm=(()=>{class t{fMinSize=B(1e3);_mediator=p(V);hostElement=p(Qe).nativeElement;model=new gh(this.hostElement);redraw(){let{scale:e,viewBox:n}=this._mediator.execute(new mh(this.hostElement,this.fMinSize()));this.model=new gh(this.hostElement,e,n),Yv(n,this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),dm=(()=>{class t{_mediator=p(V);_elementRef=p(Qe);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new fh).forEach(n=>{e.appendChild(n)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),um=(()=>{class t{_mediator=p(V);hostElement=p(Qe).nativeElement;redraw(){em(this._mediator.execute(new _h),this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),K8=new be("F_MINIMAP_BASE"),Y8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),CC=(()=>{class t extends Y8{_destroyRef=p(xt);_mediator=p(V);_browser=p(at);_store=p(L);_canvas=nt.required(dm);_flow=nt.required(cm);_minimapView=nt.required(um);fMinSize=B(1e3);fNodeRenderLimit=B(1500,{transform:xe});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new li(Xe.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new $d).pipe(Ch(),AL()).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 ci(Xe.MINIMAP))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-minimap"]],viewQuery:function(n,i){n&1&&hn(i._canvas,dm,5)(i._flow,cm,5)(i._minimapView,um,5),n&2&&jt(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[ke([{provide:K8,useExisting:t}]),Z],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,i){n&1&&(W(),f(0,"svg",0),F(1,"g",1)(2,"rect",2),_()),n&2&&m("fMinSize",i.fMinSize())},dependencies:[cm,dm,um],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var X8=(()=>{class t{hostElement=p(Qe).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),xC=(()=>{class t extends X8{_mediator=p(V);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new li(Xe.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new ci(Xe.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[Z],decls:0,vars:0,template:function(n,i){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var Z8=0,Q8=120,la=(()=>{class t extends T_{_destroyRef=p(xt);_mediator=p(V);_browser=p(at);_componentsStore=p(L);_cache=p(Mn);_injector=p(dt);fId=B(`f-flow-${Z8++}`,{alias:"fFlowId"});fCache=B(!1,{transform:j});hostElement=p(Qe).nativeElement;fNodesRendered=Ke();fFullRendered=Ke();fLoaded=Ke();ngOnInit(){this._mediator.execute(new Zp(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){de(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new En(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(Ch(),Ud(Q8),NL()).listen(this._destroyRef,()=>{this._mediator.execute(new fi)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new yh),this._mediator.execute(new ih),this._mediator.execute(new oa(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new oh),this._destroyRef)),this._mediator.execute(new Ai))})}_listenConnectionsChanges(){this._mediator.execute(new To).listen(this._destroyRef,()=>{if(!this._mediator.execute(new fi)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new ah(this._destroyRef));return}this._mediator.execute(new Or)}})}redraw(){this._mediator.execute(new Ai)}reset(){this._mediator.execute(new rh)}getNodesBoundingBox(){return this._mediator.execute(new Wp)}getSelection(){return this._mediator.execute(new ra)}getPositionInFlow(e){return this._mediator.execute(new bh(e))}getState(e){return this._mediator.execute(new th(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new To).pipe(ty()).listen(this._destroyRef,()=>{this._mediator.execute(new dh)})}select(e,n,i=!0){this._mediator.execute(new To).pipe(ty()).listen(this._destroyRef,()=>{this._mediator.execute(new ch(e,n,i))})}clearSelection(){this._mediator.execute(new sh)}ngOnDestroy(){this._mediator.execute(new nh(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(n,i){n&2&&O("id",i.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[ke([V,...jL,zy,Ho,...V8,he,...dV,{provide:M_,useExisting:t}]),Z],ngContentSelectors:FL,decls:7,vars:0,template:function(n,i){n&1&&(pn(OL),Ya(0),$e(1),$e(2,1),$e(3,2),$e(4,3),$e(5,4),$e(6,5),Xa())},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 wC=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=p(Ka);_tpl=p(x0);_zone=p(Jt);_componentsStore=p(L,{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 i=()=>{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(i);return}this._rafId=null,this._finishProgressiveRender()};this._rafId=requestAnimationFrame(i)})}_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=je({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[ro]})}return t})();var bn=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(bn||{}),J8=new be("F_ZOOM"),k_=class{},ez=.1,tz=1,nz=.5,iz=60,oz=.5;function rz(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function az(t,o,e){return sz(t)?cz(o,e):lz(o,e)}function sz(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function lz(t,o){let e=Math.abs(t)/100,n=TC(e,ez,tz);return o*n}function cz(t,o){if(Math.abs(t)<nz)return 0;let e=Math.abs(t)/iz,n=TC(e,0,oz);return o*n}function TC(t,o,e){return Math.max(o,Math.min(e,t))}var ca=(()=>{class t extends k_{_mediator=p(V);_injector=p(dt);_store=p(L);_triggersListener=He.emptyListener();isEnabled=B(!1,{alias:"fZoom",transform:j});fWheelTrigger=gn;fDblClickTrigger=gn;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 li(Xe.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){de(()=>{this.isEnabled(),tn(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,He.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,He.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!an(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let i=rz(e);if(i===0)return;let r=this._normalizeWheelStep(e,i);r!==0&&this.setZoom(U.initialize(e.clientX,e.clientY),r,this._calculateDirection(i),!1)};_normalizeWheelStep(e,n){return az(e,n,this.step)}_calculateDirection(e){return e>0?bn.ZOOM_OUT:bn.ZOOM_IN}_onDoubleClick=e=>{if(!an(e,this.fDblClickTrigger))return;e.preventDefault();let n=e.target;TB(n)||n?.closest("[fLockedContext]")||this.setZoom(U.initialize(e.clientX,e.clientY),this.dblClickStep,bn.ZOOM_IN,!0)};_getToCenterPosition(e,n){return U.initialize(e?.x||n.gravityCenter.x,e?.y||n.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(bn.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(bn.ZOOM_OUT,e)}_onZoomToCenter(e,n){this.setZoom(this._getToCenterPosition(n,te.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,n,i,r){this._mediator.execute(new hh(e,n,i,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new ph)}_disposeListeners(){this._triggersListener(),this._triggersListener=He.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new ci(Xe.ZOOM))}_listen(e,n,i){this._flowHost.addEventListener(e,n,i)}_unlisten(e,n,i){this._flowHost.removeEventListener(e,n,i)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({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",xe],maximum:[2,"fZoomMaximum","maximum",xe],step:[2,"fZoomStep","step",xe],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",xe]},features:[ke([{provide:J8,useExisting:t}]),Z]})}return t})();var SC=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=_t({type:t});static \u0275inj=mt({imports:[gt]})}return t})();var sf=a3(xD(),1);var Ba=(function(t){return t.NETWORK_SIMPLEX="network-simplex",t.TIGHT_TREE="tight-tree",t.LONGEST_PATH="longest-path",t})(Ba||{}),Tre={direction:$i.TOP_BOTTOM,nodeGap:48,layerGap:64,algorithm:Ba.NETWORK_SIMPLEX,defaultNodeSize:Ot.initialize(120,72)},i0=(()=>{class t extends Qp{constructor(){super(Tre)}mergeOptions(e,n={}){return Dt(ge(ge({},e),n),{defaultNodeSize:n.defaultNodeSize?Ot.initialize(n.defaultNodeSize.width,n.defaultNodeSize.height):Ot.initialize(e.defaultNodeSize.width,e.defaultNodeSize.height)})}async calculate(e,n,i){let r=this.resolveLayoutOptions(i),a=this._buildGraph(e,n,r),s=new Map;return sf.layout(a),a.nodes().forEach(c=>{let u=a.node(c),h=e.find(C=>C.id===c);if(!u||!h)return;let g=h.size??r.defaultNodeSize;s.set(c,U.initialize(u.x-g.width/2,u.y-g.height/2))}),{nodes:fC(e,s)}}_buildGraph(e,n,i){let r=new sf.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:this._mapDirection(i.direction),nodesep:i.nodeGap,ranksep:i.layerGap,ranker:this._mapAlgorithm(i.algorithm)}),e.forEach(a=>{let s=a.size??i.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 Ba.TIGHT_TREE:return"tight-tree";case Ba.LONGEST_PATH:return"longest-path";case Ba.NETWORK_SIMPLEX:default:return"network-simplex"}}_mapDirection(e){switch(e){case $i.BOTTOM_TOP:return"BT";case $i.LEFT_RIGHT:return"LR";case $i.RIGHT_LEFT:return"RL";case $i.TOP_BOTTOM:default:return"TB"}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var wi={loading:"Loading collection",errorTitle:"Failed to load",emptyTitle:"No nodes match the current filters.",resetFilters:"Reset filters",curationEmptyTitle:"Nothing from your map selection is visible right now.",showAllOnMap:"Show all on map",a11y:{toolbar:"Map controls",panel:"Selected node details"},toolbar:{zoomIn:"Zoom in",zoomOut:"Zoom out",fitToScreen:"Fit to screen",resetLayoutLabel:"Re-arrange layout",resetLayoutTooltip:"Re-arrange the visible nodes",showAllLabel:"Show all",showAllTooltip:"Clear the map selection and show every node again",showAllAria:"Show all nodes on the map",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:"Re-arrange layout?",message:"This replaces every saved node position with a fresh automatic layout.",messageVisible:"This re-arranges the visible nodes and replaces their saved positions.",accept:"Re-arrange",reject:"Cancel"}};var lf={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0}};var Sre="adaptive-curve",a0=["segment","straight","bezier","adaptive-curve"],wD="sm.graph.connection-type",TD="sm.graph.layout-algorithm",SD="sm.graph.layout-direction",cf=(()=>{class t{_connectionType=X(o0(wD,kre,Sre));_layoutAlgorithm=X(o0(TD,yb,gb));_layoutDirection=X(o0(SD,Cb,bb));_layoutSpacing=X(vb);connectionType=this._connectionType.asReadonly();layoutAlgorithm=this._layoutAlgorithm.asReadonly();layoutDirection=this._layoutDirection.asReadonly();layoutSpacing=this._layoutSpacing.asReadonly();setConnectionType(e){this._connectionType()!==e&&(this._connectionType.set(e),r0(wD,e))}setLayoutAlgorithm(e){this._layoutAlgorithm()!==e&&(this._layoutAlgorithm.set(e),r0(TD,e))}setLayoutDirection(e){this._layoutDirection()!==e&&(this._layoutDirection.set(e),r0(SD,e))}static toFoblexEnum(e){return e}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function o0(t,o,e){let n=null;try{n=localStorage.getItem(t)}catch{return e}return n&&o(n)?n:e}function r0(t,o){try{localStorage.setItem(t,o)}catch{}}function kre(t){return typeof t=="string"&&a0.includes(t)}function kD(t,o){let e=new Set([o]);for(let n of t.get(o)??[])e.add(n);return e}var Ire={TOP_BOTTOM:{output:Ye.BOTTOM,input:Ye.TOP},BOTTOM_TOP:{output:Ye.TOP,input:Ye.BOTTOM},LEFT_RIGHT:{output:Ye.RIGHT,input:Ye.LEFT},RIGHT_LEFT:{output:Ye.LEFT,input:Ye.RIGHT}};function ID(t,o){return ds(t)?Ire[o]:{input:Ye.CALCULATE,output:Ye.CALCULATE}}var ED=`
|
|
2138
|
+
`.trim();function Uy(t){return!!$y(t)}function $y(t){let o=t,e=o?.Blob,n=o?.Worker,i=o?.URL;return!e||!n||typeof i?.createObjectURL!="function"||typeof i.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:n,urlApi:i}}function r7(t){let o=new t.blobCtor([o7],{type:"text/javascript"});return t.urlApi.createObjectURL(o)}function Wy(t,o){if(!t)return;let e=o??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var Ui=(()=>{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,Wy(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})(),lu=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(o,e){this.connection=o,this.line=e}},a7=(()=>{let t=class $s{_mediator=p(V);_renderCache=new WeakMap;handle({connection:e,line:n}){!this._mediator.execute(new Mo(e))&&!this._shouldRender(e,n)||(e.setLine(n),e.initialize())}_shouldRender(e,n){let i=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,n),a=this._renderCache.get(e);return a?.signature===r&&a.pathElement===i?!1:(this._renderCache.set(e,{signature:r,pathElement:i}),!0)}_createConnectionRenderSignature(e,n){let{sourceSide:i,targetSide:r}=e.getResolvedSides();return[e.fBehavior,e.fType,e.fRadius,e.fOffset,e.fReassignableStart(),this._serializeContents([...e.fContents()||[]]),i,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||$s)};static \u0275prov=y({token:$s,factory:$s.\u0275fac})};return t=P([R(lu)],t),t})(),cu=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(o,e){this.source=o,this.target=e}},s7=(()=>{let t=class Ws{_state=p(Th);handle({source:e,target:n}){e.setConnected(n),n.setConnected(e),this._state.trackConnectedConnectors(e,n)}static \u0275fac=function(n){return new(n||Ws)};static \u0275prov=y({token:Ws,factory:Ws.\u0275fac})};return t=P([R(cu)],t),t})(),di=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(o,e=!0){this.element=o,this.cache=e}},l7={enabled:!1},Mn=new be("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>ge({},l7)});var du=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(o,e,n,i){this.id=o,this.nodeId=e,this.kind=n,this.element=i}},Dn=(()=>{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})(),Nm=class{key;id;kind;nodeId;element;rect;constructor(o,e,n,i,r,a){this.key=o,this.id=e,this.kind=n,this.nodeId=i,this.element=r,this.rect=a}},kr=class{static build(o,e){return`${o}:${e}`}},Am=class{id;element;reference;rect;constructor(o,e,n,i){this.id=o,this.element=e,this.reference=n,this.rect=i}},Do=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(o,e="manual"){this.nodeId=o,this.reason=e}},c7=(()=>{let t=class Ks{_store=p(Dn);_options=p(Mn);handle({nodeId:e,reason:n}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;i.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||Ks)};static \u0275prov=y({token:Ks,factory:Ks.\u0275fac})};return t=P([R(Do)],t),t})(),uu=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(o,e,n){this.id=o,this.element=e,this.reference=n}},d7=(()=>{let t=class Ys{_store=p(Dn);_options=p(Mn);handle({id:e,element:n,reference:i}){if(!this._options.enabled)return;let r=new Am(e,n,i);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||Ys)};static \u0275prov=y({token:Ys,factory:Ys.\u0275fac})};return t=P([R(uu)],t),t})(),pu=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(o){this.id=o}},u7=(()=>{let t=class Xs{_store=p(Dn);_mediator=p(V);_options=p(Mn);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 i=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of i){let a=this._store.connectorEntries.get(r);a&&this._mediator.execute(new Ir(a.id,a.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(n){return new(n||Xs)};static \u0275prov=y({token:Xs,factory:Xs.\u0275fac})};return t=P([R(pu)],t),t})(),p7=(()=>{let t=class Zs{_store=p(Dn);_mediator=p(V);_options=p(Mn);handle({id:e,nodeId:n,kind:i,element:r}){if(!this._options.enabled)return;let a=kr.build(e,i),s=this._store.connectorEntries.get(a);s&&(this._detachConnectorFromNode(s.key,s.nodeId),this._store.connectorKeyByElement.delete(s.element));let c=new Nm(a,e,i,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 Do(n,"connector-registered"))}_detachConnectorFromNode(e,n){let i=this._store.connectorKeysByNodeId.get(n);i&&(i.delete(e),i.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Zs)};static \u0275prov=y({token:Zs,factory:Zs.\u0275fac})};return t=P([R(du)],t),t})(),Ir=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(o,e){this.connectorId=o,this.kind=e}},h7=(()=>{let t=class Qs{_store=p(Dn);_mediator=p(V);_options=p(Mn);handle({connectorId:e,kind:n}){if(!this._options.enabled)return;let i=kr.build(e,n),r=this._store.connectorEntries.get(i);r&&(this._store.connectorEntries.delete(i),this._store.connectorKeyByElement.delete(r.element),this._detachConnectorFromNode(i,r.nodeId),this._store.nodeEntries.has(r.nodeId)&&this._mediator.execute(new Do(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,n){let i=this._store.connectorKeysByNodeId.get(n);i&&(i.delete(e),i.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||Qs)};static \u0275prov=y({token:Qs,factory:Qs.\u0275fac})};return t=P([R(Ir)],t),t})(),Po=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(o){this.element=o}},f7=(()=>{let t=class Js{_store=p(Dn);_options=p(Mn);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 i=this._store.connectorKeyByElement.get(e);if(i)return this._store.connectorEntries.get(i)?.rect??void 0}static \u0275fac=function(n){return new(n||Js)};static \u0275prov=y({token:Js,factory:Js.\u0275fac})};return t=P([R(Po)],t),t})(),Bi=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(o,e,n){this.connectorId=o,this.kind=e,this.rect=n}},m7=(()=>{let t=class el{_store=p(Dn);_options=p(Mn);handle({connectorId:e,kind:n,rect:i}){if(!this._options.enabled)return;let r=kr.build(e,n),a=this._store.connectorEntries.get(r);a&&(a.rect=rt.fromRoundedRect(i))}static \u0275fac=function(n){return new(n||el)};static \u0275prov=y({token:el,factory:el.\u0275fac})};return t=P([R(Bi)],t),t})(),Vi=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(o,e){this.nodeId=o,this.rect=e}},_7=(()=>{let t=class tl{_store=p(Dn);_options=p(Mn);handle({nodeId:e,rect:n}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;let r=i.rect;i.rect=te.initialize(n.x,n.y,n.width,n.height),r&&this._updateConnectorRectsByNodeRect(e,r,i.rect)}_updateConnectorRectsByNodeRect(e,n,i){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let a=i.x-n.x,s=i.y-n.y,c=n.width!==0,u=n.height!==0,h=c?i.width/n.width:1,g=u?i.height/n.height:1;for(let C of r){let k=this._store.connectorEntries.get(C);if(!k?.rect)continue;let I=k.rect,N=I.gravityCenter,q=c?i.x+(N.x-n.x)*h:N.x+a,Y=u?i.y+(N.y-n.y)*g:N.y+s;k.rect=new rt(q-I.width/2,Y-I.height/2,I.width,I.height,I.radius1,I.radius2,I.radius3,I.radius4)}}static \u0275fac=function(n){return new(n||tl)};static \u0275prov=y({token:tl,factory:tl.\u0275fac})};return t=P([R(Vi)],t),t})(),Er=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(o,e){this.element=o,this.rect=e}},g7=(()=>{let t=class nl{_store=p(Dn);_options=p(Mn);handle({element:e,rect:n}){if(!this._options.enabled)return;let i=this._store.nodeIdByElement.get(e);if(i){let s=this._store.nodeEntries.get(i);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||nl)};static \u0275prov=y({token:nl,factory:nl.\u0275fac})};return t=P([R(Er)],t),t})(),b7=[Dn,d7,u7,c7,p7,h7,f7,_7,m7,g7];function qo(t,o,e){return o?pe.fromPoint(t).elementTransform(o).sub(e.scaledPosition).sub(e.position).div(e.scale):pe.fromPoint(t)}function Ky(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function Ro(t){return t?`${t}`:void 0}var v7=(()=>{let t=class il{_store=p(L);_mediator=p(V);_browser=p(at);get _transform(){return this._store.transform}handle({element:e,cache:n}){let i=this._mediator.execute(new Po(e));if(i&&n)return i;let r=this._getElementRoundedRect(e),a=this._normalizePosition(r),s=this._unscaleSize(r),c=this._getUnscaledRect(a,s,r),u=this._getOffsetSize(e,s),h=rt.fromCenter(c,u.width,u.height);return this._mediator.execute(new Er(e,h)),h}_getElementRoundedRect(e){return this._getRoundedRect(te.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,n,i){let[r,a,s,c]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(i.borderTopLeftRadius,n,i.fontSize),this._getSystemRadius(i.borderTopRightRadius,n,i.fontSize),this._getSystemRadius(i.borderBottomRightRadius,n,i.fontSize),this._getSystemRadius(i.borderBottomLeftRadius,n,i.fontSize)]);return new rt(e.x,e.y,e.width,e.height,r,a,s,c)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,n,i){return this._browser.toPixels(e,n.clientWidth,n.clientHeight,i)||0}_getSystemRadius(e,n,i){return this._toPixels(e,n,i)*this._transform.scale}_normalizeCircularBorderRadii(e,n,i){let[r,a,s,c]=i.map(h=>Math.max(0,h)),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 qo(e,this._store.flowHost,this._transform)}_unscaleSize(e){return Ot.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n,i){return new rt(e.x,e.y,n.width,n.height,this._unscaleRadius(i.radius1),this._unscaleRadius(i.radius2),this._unscaleRadius(i.radius3),this._unscaleRadius(i.radius4))}_unscaleRadius(e){return e/this._transform.scale}_getOffsetSize(e,n){return Ot.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||il)};static \u0275prov=y({token:il,factory:il.\u0275fac})};return t=P([R(di)],t),t})(),hu=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(o,e){this.connector=o,this.cache=e}},y7=(()=>{let t=class ol{_mediator=p(V);handle({connector:e,cache:n}){let i=this._buildCacheKey(e),r=n.get(i)??this._calculateRect(e);return n.set(i,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new di(e.hostElement))}static \u0275fac=function(n){return new(n||ol)};static \u0275prov=y({token:ol,factory:ol.\u0275fac})};return t=P([R(hu)],t),t})(),fu=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(o){this.connection=o}},C7=(()=>{let t=class rl{_store=p(L);handle({connection:e}){let n=this._store.outputs.get(e.fOutputId()),i=this._store.inputs.get(e.fInputId());return!n||!i?null:{source:n,target:i}}static \u0275fac=function(n){return new(n||rl)};static \u0275prov=y({token:rl,factory:rl.\u0275fac})};return t=P([R(fu)],t),t})(),Mr=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(o,e){this.connection=o,this.cache=e}},x7=(()=>{let t=class al{_mediator=p(V);handle({connection:e,cache:n}){let i=this._resolveConnectionEndpoints(e);return i?Dt(ge({},i),{sourceRect:this._resolveEndpointRect(i.source,n),targetRect:this._resolveEndpointRect(i.target,n)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new fu(e))}_resolveEndpointRect(e,n){return this._mediator.execute(new hu(e,n))}static \u0275fac=function(n){return new(n||al)};static \u0275prov=y({token:al,factory:al.\u0275fac})};return t=P([R(Mr)],t),t})(),it=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(o){this.element=o}},w7=(()=>{let t=class sl{_store=p(L);_mediator=p(V);get _transform(){return this._store.transform}handle({element:e}){let n=this._mediator.execute(new Po(e));if(n)return n;let i=te.fromElement(e),r=this._normalizePosition(i),a=this._unscaleSize(i),s=this._getUnscaledRect(r,a),c=this._getOffsetSize(e,a),u=this._fromCenter(s,c.width,c.height);return this._mediator.execute(new Er(e,u)),u}_fromCenter(e,n,i){return te.initialize(e.gravityCenter.x-n/2,e.gravityCenter.y-i/2,n,i)}_normalizePosition(e){return qo(e,this._store.flowHost,this._transform)}_unscaleSize(e){return Ot.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n){return new rt(e.x,e.y,n.width,n.height)}_getOffsetSize(e,n){return Ot.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||sl)};static \u0275prov=y({token:sl,factory:sl.\u0275fac})};return t=P([R(it)],t),t})(),zn=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(o){this.connector=o}},T7=(()=>{let t=class ll{_store=p(L);_mediator=p(V);handle({connector:e}){if(!e)return;let n=this._store.nodes.get(e.fNodeId);if(!n||!n._rotate)return;let i=this._mediator.execute(new it(n.hostElement));return{rotationDeg:n._rotate,pivot:i.gravityCenter}}static \u0275fac=function(n){return new(n||ll)};static \u0275prov=y({token:ll,factory:ll.\u0275fac})};return t=P([R(zn)],t),t})(),mu=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(o,e){this.connection=o,this.geometry=e}},S7=(()=>{let t=class cl{_mediator=p(V);_connectionBehaviour=p(Ho);handle({connection:e,geometry:n}){return this._connectionBehaviour.handle(new vn(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 zn(e))}static \u0275fac=function(n){return new(n||cl)};static \u0275prov=y({token:cl,factory:cl.\u0275fac})};return t=P([R(mu)],t),t})(),Dr=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(o,e,n,i){this.connection=o,this.source=e,this.target=n,this.line=i}},k7=(()=>{let t=class dl{_mediator=p(V);handle({connection:e,source:n,target:i,line:r}){this._mediator.execute(new cu(n,i)),this._mediator.execute(new lu(e,r))}static \u0275fac=function(n){return new(n||dl)};static \u0275prov=y({token:dl,factory:dl.\u0275fac})};return t=P([R(Dr)],t),t})(),Pr=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(o,e){this.connection=o,this.geometry=e}},I7=(()=>{let t=class ul{_mediator=p(V);handle({connection:e,geometry:n}){let i=this._mediator.execute(new mu(e,n));this._mediator.execute(new Dr(e,n.source,n.target,i))}static \u0275fac=function(n){return new(n||ul)};static \u0275prov=y({token:ul,factory:ul.\u0275fac})};return t=P([R(Pr)],t),t})(),_u=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(o,e){this.connection=o,this.cache=e}},E7=(()=>{let t=class pl{_mediator=p(V);handle({connection:e,cache:n}){let i=this._mediator.execute(new Mr(e,n));i&&this._mediator.execute(new Pr(e,i))}static \u0275fac=function(n){return new(n||pl)};static \u0275prov=y({token:pl,factory:pl.\u0275fac})};return t=P([R(_u)],t),t})(),zi=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(o){this.session=o}},M7=(()=>{let t=class hl{_store=p(L);_state=p(Th);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(n){return new(n||hl)};static \u0275prov=y({token:hl,factory:hl.\u0275fac})};return t=P([R(zi)],t),t})(),Rr=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(o){this.session=o}},D7=(()=>{let t=class fl{_mediator=p(V);_store=p(L);handle({session:e}){this._mediator.execute(new zi(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(n){return new(n||fl)};static \u0275prov=y({token:fl,factory:fl.\u0275fac})};return t=P([R(Rr)],t),t})(),gu=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(o,e){this.batchItem=o,this.result=e}},P7=(()=>{let t=class ml{_mediator=p(V);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 Dr(e.connection,e.geometry.source,e.geometry.target,n.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new Pr(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(n){return new(n||ml)};static \u0275prov=y({token:ml,factory:ml.\u0275fac})};return t=P([R(gu)],t),t})(),ai=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(o,e,n,i,r,a){this.connections=o,this.cache=e,this.startIndex=n,this.session=i,this.batchItems=r,this.workerResults=a}},R7=500,O7=6,F7=(()=>{let t=class _l{_mediator=p(V);_browser=p(at);handle({connections:e,cache:n,startIndex:i,session:r,batchItems:a,workerResults:s}){if(!this._isCurrent(r))return;let c=this._now(),u=i,h=0;for(;u<e.length&&h<R7&&this._isWithinSliceBudget(c);){let g=e[u];if(a?this._mediator.execute(new gu(a[u]??null,s?.[u])):this._mediator.execute(new _u(g,n)),u++,h++,!this._isCurrent(r))return}if(u>=e.length){this._mediator.execute(new Rr(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new ai(e,n,u,r,a,s)))}_isCurrent(e){return this._mediator.execute(new zi(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<O7:!0}static \u0275fac=function(n){return new(n||_l)};static \u0275prov=y({token:_l,factory:_l.\u0275fac})};return t=P([R(ai)],t),t})(),bu=class{static fToken=Symbol("StartConnectionRedrawRequest")},N7=(()=>{let t=class gl{_store=p(L);_state=p(Th);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||gl)};static \u0275prov=y({token:gl,factory:gl.\u0275fac})};return t=P([R(bu)],t),t})(),Or=class{static fToken=Symbol("RedrawConnectionsRequest")},vu=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(o){this.connectionCount=o}},Fr=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},A7=(()=>{let t=class bl{_browser=p(at);_state=p(Ui);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let n=this._browser.document.defaultView;return Uy(n)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(n){return new(n||bl)};static \u0275prov=y({token:bl,factory:bl.\u0275fac})};return t=P([R(Fr)],t),t})(),L7=(()=>{let t=class vl{_mediator=p(V);handle({connectionCount:e}){return e>0&&this._mediator.execute(new Fr)}static \u0275fac=function(n){return new(n||vl)};static \u0275prov=y({token:vl,factory:vl.\u0275fac})};return t=P([R(vu)],t),t})(),yu=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(o,e,n){this.connection=o,this.geometry=e,this.originalIndex=n}},B7=(()=>{let t=class yl{_store=p(L);handle({connection:e,geometry:n,originalIndex:i}){let{source:r,target:a,sourceRect:s,targetRect:c}=n;return{originalIndex:i,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||yl)};static \u0275prov=y({token:yl,factory:yl.\u0275fac})};return t=P([R(yu)],t),t})(),Cu=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(o,e){this.connections=o,this.cache=e}},V7=(()=>{let t=class Cl{_mediator=p(V);handle({connections:e,cache:n}){let i=new Array(e.length),r=[];for(let a=0;a<e.length;a++){let s=this._buildBatchItem(e[a],n,a);i[a]=s,s&&r.push(s.payload)}return{items:i,payload:r}}_buildBatchItem(e,n,i){let r=this._mediator.execute(new Mr(e,n));return r?{connection:e,geometry:r,payload:this._mediator.execute(new yu(e,r,i))}:null}static \u0275fac=function(n){return new(n||Cl)};static \u0275prov=y({token:Cl,factory:Cl.\u0275fac})};return t=P([R(Cu)],t),t})(),xu=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(o){this.error=o}},Nr=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(o){this.error=o}},z7=(()=>{let t=class xl{_state=p(Ui);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(n){return new(n||xl)};static \u0275prov=y({token:xl,factory:xl.\u0275fac})};return t=P([R(Nr)],t),t})(),H7=(()=>{let t=class wl{_state=p(Ui);_mediator=p(V);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new Nr(e))}static \u0275fac=function(n){return new(n||wl)};static \u0275prov=y({token:wl,factory:wl.\u0275fac})};return t=P([R(xu)],t),t})(),wu=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(o){this.message=o}},q7=(()=>{let t=class Tl{_state=p(Ui);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||Tl)};static \u0275prov=y({token:Tl,factory:Tl.\u0275fac})};return t=P([R(wu)],t),t})(),Tu=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},G7=(()=>{let t=class Sl{_browser=p(at);_state=p(Ui);_mediator=p(V);handle(e){if(this._state.worker)return this._state.worker;let n=this._browser.document.defaultView;if(!Uy(n))return null;let i=$y(n);if(!i)return null;let r=r7(i);try{let a=new i.workerCtor(r,{name:"f-flow-connection-worker"});return a.onmessage=s=>{this._mediator.execute(new wu(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 Wy(r,i.urlApi),this._disableWorker(a instanceof Error?a:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new xu(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new Nr(e))}static \u0275fac=function(n){return new(n||Sl)};static \u0275prov=y({token:Sl,factory:Sl.\u0275fac})};return t=P([R(Tu)],t),t})(),Su=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(o){this.payload=o}},j7=(()=>{let t=class kl{_state=p(Ui);_mediator=p(V);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new Fr))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let n=this._mediator.execute(new Tu);if(!n)return Promise.reject(new Error("Unable to initialize connection worker."));let i=++this._state.nextRequestId;return new Promise((r,a)=>{this._state.pending.set(i,{resolve:r,reject:a});try{n.postMessage({requestId:i,items:e})}catch(s){this._state.pending.delete(i),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||kl)};static \u0275prov=y({token:kl,factory:kl.\u0275fac})};return t=P([R(Su)],t),t})(),ku=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(o){this.batch=o}},U7=(()=>{let t=class Il{_mediator=p(V);handle({batch:e}){return e.payload.length?this._mediator.execute(new Su(e.payload)):Promise.resolve([])}static \u0275fac=function(n){return new(n||Il)};static \u0275prov=y({token:Il,factory:Il.\u0275fac})};return t=P([R(ku)],t),t})(),Iu=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(o,e,n){this.connections=o,this.cache=e,this.session=n}},$7=(()=>{let t=class El{_mediator=p(V);handle({connections:e,cache:n,session:i}){let r=this._mediator.execute(new Cu(e,n));if(!r.payload.length){this._mediator.execute(new ai(e,n,0,i,r.items));return}this._mediator.execute(new ku(r)).then(a=>{this._mediator.execute(new zi(i))&&this._mediator.execute(new ai(e,n,0,i,r.items,this._alignWorkerResults(a,e.length)))}).catch(()=>{this._mediator.execute(new zi(i))&&this._mediator.execute(new ai(e,n,0,i,r.items))})}_alignWorkerResults(e,n){let i=new Array(n);for(let r of e){let a=r.originalIndex;a<0||a>=n||(i[a]=r)}return i}static \u0275fac=function(n){return new(n||El)};static \u0275prov=y({token:El,factory:El.\u0275fac})};return t=P([R(Iu)],t),t})(),W7=(()=>{let t=class Ml{_mediator=p(V);_store=p(L);handle(e){let n=this._mediator.execute(new bu);this._createMarkersForCreate(),this._createMarkersForSnap();let i=[...this._store.connections.getAll()],r=new Map;if(!i.length){this._mediator.execute(new Rr(n));return}this._shouldUseConnectionWorker(i.length)?this._redrawUsingWorker(i,r,n):this._redrawWithoutWorker(i,r,n)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new Mo(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new Mo(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new vu(e))}_redrawUsingWorker(e,n,i){this._mediator.execute(new Iu(e,n,i))}_redrawWithoutWorker(e,n,i){this._mediator.execute(new ai(e,n,0,i))}static \u0275fac=function(n){return new(n||Ml)};static \u0275prov=y({token:Ml,factory:Ml.\u0275fac})};return t=P([R(Or)],t),t})(),Lm=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},K7=(()=>{let t=class Dl{_store=p(L);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(n){return new(n||Dl)};static \u0275prov=y({token:Dl,factory:Dl.\u0275fac})};return t=P([R(Lm)],t),t})(),Eu=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(o){this.connection=o}},Y7=(()=>{let t=class Pl{_store=p(L);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Pl)};static \u0275prov=y({token:Pl,factory:Pl.\u0275fac})};return t=P([R(Eu)],t),t})(),Mu=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(o){this.instance=o}},X7=(()=>{let t=class Rl{_store=p(L);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Rl)};static \u0275prov=y({token:Rl,factory:Rl.\u0275fac})};return t=P([R(Mu)],t),t})(),Bm=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(o,e){this.waypointIndex=o,this.connectionId=e}},Du=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},Z7=(()=>{let t=class Ol{_store=p(L);_dragSession=p(he);handle(e){this._store.flowHost.classList.remove(ht.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(n){return new(n||Ol)};static \u0275prov=y({token:Ol,factory:Ol.\u0275fac})};return t=P([R(Du)],t),t})(),Pu=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},Q7=(()=>{let t=class Fl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(ht.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new Ar),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Lu(e.kind,e.data?ge({},e.data):void 0,e.fEventType))}static \u0275fac=function(n){return new(n||Fl)};static \u0275prov=y({token:Fl,factory:Fl.\u0275fac})};return t=P([R(Pu)],t),t})(),Ar=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},Hi=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(o,e){this._event=o,this._target=e}setTarget(o){this._target=o}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},Ru=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},Vm=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){let o=this.originalEvent;return o.pointerType==="mouse"&&o.button===0||o.pointerType==="touch"}isMouseRightButton(){let o=this.originalEvent;return o.pointerType==="mouse"&&o.button===2||o.pointerType==="touch"}getPosition(){let o=this.originalEvent;return{x:o.clientX,y:o.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},zm=class extends Hi{constructor(o){super(o)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let o=this.originalEvent.touches;return{x:o[0].clientX,y:o[0].clientY}}},Hm=class extends Hi{constructor(o,e){super(o,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let o=this.originalEvent.targetTouches[0];return{x:o.clientX,y:o.clientY}}},He=(()=>{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})(),J7=800,qm=class{_document=p(Ua);_ngZone=p(Jt,{optional:!0});_mouseListeners=He.emptyListener();_touchListeners=He.emptyListener();_startListeners=He.emptyListener();isSyntheticEvent(o){return!!this._lastTouchEventTime&&this._lastTouchEventTime+J7>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=o=>{let e=this.isSyntheticEvent(o),n=tB(o),i=new Ru(o);if(e||n||this.disabled||this.isDragStarted)return;this._pointerDownElement=i.targetElement,this.onPointerDown(i)&&(this._dragStartTime=Date.now(),this._dragStartPosition=i.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,He.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,He.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,He.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,He.activeCaptureListener())})};_onTouchDown=o=>{let e=nB(o),n=new zm(o);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,He.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,He.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,He.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,He.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,He.activeCaptureListener())})};_onSelectStart=o=>{this.onSelect(o)};_onMouseMove=o=>{this._moveHandler(new Ru(o))};_onTouchMove=o=>{this._moveHandler(new Hm(o))};_checkDragSequenceToStart(o){let e=o.getPosition();if(!this.isDragStarted&&this._pointerDownElement){o.setTarget(this._pointerDownElement);let n=Math.abs(e.x-this._dragStartPosition.x),i=Math.abs(e.y-this._dragStartPosition.y);if(n+i>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}o.preventDefault(),this.prepareDragSequence(o),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,eB(o.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=o=>{this.isDragStarted&&this.onPointerUp(new Vm(o)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=He.emptyListener(),this._touchListeners(),this._touchListeners=He.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,He.activeListener()),this._listen("touchstart",this._onTouchDown,He.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,He.activeListener()),this._unlisten("touchstart",this._onTouchDown,He.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=He.emptyListener(),this._touchListeners(),this._touchListeners=He.emptyListener(),this._mouseListeners(),this._mouseListeners=He.emptyListener()}_listen(o,e,n){this._document.addEventListener(o,e,n)}_unlisten(o,e,n){this._document.removeEventListener(o,e,n)}_preventDuringDrag=o=>{this.isDragStarted&&o.preventDefault()}};function eB(t){return t.type[0]==="t"}function tB(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function nB(t){let o=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!o&&o.identifier===-1&&(o.radiusX==null||o.radiusX===1)&&(o.radiusY==null||o.radiusY===1)}var Gm=class extends Hi{_position;_isMouseLeftButton;_isMouseRightButton;constructor(o){super(o.originalEvent,o.targetElement),this._position=o.getPosition(),this._isMouseLeftButton=o.isMouseLeftButton(),this._isMouseRightButton=o.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return ge({},this._position)}};function iB(t){return new Gm(t)}var he=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new pe(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 pe(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=iB(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})(),jm=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(o,e,n){this.nodeIds=o,this.groupIds=e,this.connectionIds=n}},oB=(()=>{let t=class Nl{_mediator=p(V);_store=p(L);_dragSession=p(he);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new si))}_getSelection(){return this._mediator.execute(new ra)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new jm(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(n){return new(n||Nl)};static \u0275prov=y({token:Nl,factory:Nl.\u0275fac})};return t=P([R(Ar)],t),t})(),Um=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(o){this.nodeOrGroup=o}},rB=(()=>{let t=class Al{_store=p(L);_mediator=p(V);handle({nodeOrGroup:e}){let n=te.initialize(-1/0,-1/0,1/0,1/0),i=this._getNode(e.fParentId());return i&&(n=this._getParentRect(i)),n}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let n=this._getNodeRect(e),i=this._getNodePadding(e,n);return te.initialize(n.x+i[0],n.y+i[1],n.width-i[0]-i[2],n.height-i[1]-i[3])}_getNodeRect(e){return this._mediator.execute(new it(e.hostElement))}_getNodePadding(e,n){return this._mediator.execute(new Gi(e,n))}static \u0275fac=function(n){return new(n||Al)};static \u0275prov=y({token:Al,factory:Al.\u0275fac})};return t=P([R(Um)],t),t})(),$m=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(o,e){this.fParentNodes=o,this.fDraggedNodes=e}},aB=(()=>{let t=class Ll{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(i=>e.includes(i.fId()))}static \u0275fac=function(n){return new(n||Ll)};static \u0275prov=y({token:Ll,factory:Ll.\u0275fac})};return t=P([R($m)],t),t})(),Wm=class{fNodeId;fConnectionIds;constructor(o,e){this.fNodeId=o,this.fConnectionIds=e}},Ou=class extends Wm{nodeId;connectionIds;constructor(o,e){super(o,e),this.nodeId=o,this.connectionIds=e}},Fu=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(o){this.nodeOrGroup=o}},sB=(()=>{let t=class Bl{_mediator=p(V);_store=p(L);handle({nodeOrGroup:e}){let n=this._collectConnectableConnectorIds(e,"source"),i=this._collectConnectableConnectorIds(e,"target");if(!n.size||!i.size)return;let r=this._collectAttachedConnectionIds(n,i),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 Ou(e.fId(),s)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Ou(e.fId(),s)))}_collectConnectableConnectorIds(e,n){let i=n==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let a of i)a.canBeConnected&&e.isContains(a.hostElement)&&r.add(a.fId());return r}_collectAttachedConnectionIds(e,n){let i=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||n.has(r.fInputId()))&&i.add(r.fId());return i}_collectConnectionsUnderNode(e){let n=this._mediator.execute(new di(e.hostElement,!1)),i=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,n)&&i.push(r);return i}_hasIntersection(e,n){return Co.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,n).length>0}static \u0275fac=function(n){return new(n||Bl)};static \u0275prov=y({token:Bl,factory:Bl.\u0275fac})};return t=P([R(Fu)],t),t})(),lB=[Q7,Z7,oB,rB,aB,sB],cB=new Set(["create-connection","reassign-connection","drag-node"]),dB=new Set(["selection-area"]),uB=new Set(["assign-to-container"]);function Yy(t){let o=null;for(let e of t){if(uB.has(e))continue;let n=cB.has(e)?"rebase":dB.has(e)?"direct":null;if(!n)return null;if(!o){o=n;continue}if(o!==n)return null}return o}function Xy(t,o,e,n,i){return U.initialize(dy(t.x,o.left,o.right,e,n,i),dy(t.y,o.top,o.bottom,e,n,i))}function dy(t,o,e,n,i,r){let a=Math.max(0,n),s=Math.max(0,i);if(!a||!s)return 0;if(t<=o+a){let c=py((o+a-t)/a,0,1);return uy(c,s,r)}if(t>=e-a){let c=py((t-(e-a))/a,0,1);return-uy(c,s,r)}return 0}function pB(t,o,e){let n=e||1;return pe.fromPoint(t).add(pe.fromPoint(o).div(n))}function uy(t,o,e){return e?o*t:o}function py(t,o,e){return Math.max(o,Math.min(e,t))}var Nu=class{static fToken=Symbol("RunAutoPanFrameRequest")},ui=class{static fToken=Symbol("StopAutoPanRequest")},hB=(()=>{let t=class Vl{_store=p(L);_dragContext=p(he);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||Vl)};static \u0275prov=y({token:Vl,factory:Vl.\u0275fac})};return t=P([R(ui)],t),t})(),Lr=class{static fToken=Symbol("SyncAutoPanRequest")},fB=(()=>{let t=class zl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new ui);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new Nu)}))}_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?U.initialize():Xy(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return Yy(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(Xe.AUTO_PAN)}static \u0275fac=function(n){return new(n||zl)};static \u0275prov=y({token:zl,factory:zl.\u0275fac})};return t=P([R(Lr)],t),t})(),mB=(()=>{let t=class Hl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle(e){let n=this._getAutoPanMode();if(!this._canAutoPan(n)){this._mediator.execute(new ui);return}let i=this._getAutoPanDelta();if(!i.x&&!i.y){this._mediator.execute(new ui);return}this._applyCanvasDelta(i,n),this._replayLastPointerMove(),this._mediator.execute(new Lr)}_applyCanvasDelta(e,n){let i=this._store.transform;n==="rebase"&&(this._dragContext.onPointerDownPosition=pB(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||i.scale||1)),i.position=pe.fromPoint(i.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(i=>{i.onPointerMove(ge({},n),e)})}_getPointerPositionInCanvas(e){return pe.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 Yy(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?U.initialize():Xy(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(Xe.AUTO_PAN)}static \u0275fac=function(n){return new(n||Hl)};static \u0275prov=y({token:Hl,factory:Hl.\u0275fac})};return t=P([R(Nu)],t),t})(),_B=[fB,mB,hB],Au=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(o){this.event=o}},Lu=class{kind;data;fEventType;get fData(){return this.data}constructor(o,e,n){this.kind=o,this.data=e,this.fEventType=n??o}},Ft=class{data(){}_features=[];getEvent(){return new Lu(this.kind,this.data(),this.type)}attachFeature(o){this._features.push(o)}featuresPrepare(o){for(let e of this._features)e.onPrepare?.(o)}featuresMove(o,e){for(let n of this._features)n.onMove?.(o,e)}featuresFinalize(o,e){for(let n of this._features)n.onFinalize?.(o,e)}featuresEnd(o){for(let e of this._features)e.onEnd?.(o)}},Bu=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=K.AUTO;userFConnectableSide=K.AUTO;isContains(o){return this.hostElement.contains(o)}setConnected(o){this._isConnected=!0,this.toConnector.push(o)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},gB=new be("F_NODE_INPUT"),bB=(()=>{class t extends Bu{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})(),In=(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})(In||{});function vB(t){return xr(t,".f-rotate-handle")}var Zy=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Sh=new be("F_NODE"),yB=qy(class{hostElement;constructor(t){this.hostElement=t}}),Vu=class extends yB{_injector=p(dt);renderer=p(w0);browser=p(at);stateChanges=new rn;_position=U.initialize();_rotate=0;_size;connectors=[];positionChanges(){de(()=>{let o=this.position();tn(()=>{U.isEqual(this._position,o)||(this._position=o,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){de(()=>{let o=this.size();tn(()=>{this._isSizeEqual(o)||(this._size=o,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){de(()=>{let o=this.rotate();tn(()=>{this._rotate!==o&&(this._rotate=o,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){de(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),tn(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(o){return this._size?.width===o?.width&&this._size?.height===o?.height}isContains(o){return this.hostElement.contains(o)}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(o){this._position=o}updateRotate(o){this._rotate=o}updateSize(o){this._size=o}setClass(o){this.hostElement.classList.add(o)}removeClass(o){this.hostElement.classList.remove(o)}addConnector(o){this.connectors.push(o),this.refresh()}removeConnector(o){let e=this.connectors.indexOf(o);e!==-1&&this.connectors.splice(e,1),this.refresh()}},CB=0,xB=3,Km=(()=>{class t extends Vu{_debounceTimer=null;_destroyRef=p(xt);_mediator=p(V);fId=B(`f-group-${CB++}`,{alias:"fGroupId"});fParentId=B(null,{alias:"fGroupParentId"});position=Ei(U.initialize(),{alias:"fGroupPosition"});size=B(void 0,{alias:"fGroupSize"});sizeChange=Ke({alias:"fGroupSizeChange"});rotate=Ei(0,{alias:"fGroupRotate"});fConnectOnNode=B(!0,{transform:j});fMinimapClass=B([]);fDraggingDisabled=B(!1,{alias:"fGroupDraggingDisabled",transform:j});fSelectionDisabled=B(!1,{alias:"fGroupSelectionDisabled",transform:j});fIncludePadding=B(!0,{transform:j});fAutoExpandOnChildHit=B(!1,{transform:j});fAutoSizeToFitChildren=B(!1,{transform:j});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qr(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 si),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),xB))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Fo(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new ea(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ta(this))}static \u0275fac=function(n){return new(n||t)(un(Qe))};static \u0275dir=je({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-group-id",i.fId()),ue("f-group-dragging-disabled",i.fDraggingDisabled())("f-group-selection-disabled",i.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:[ke([{provide:Sh,useExisting:t}]),Z]})}return t})(),hy=0,wB=3,kh=(()=>{class t extends Vu{_debounceTimer=null;_destroyRef=p(xt);_mediator=p(V);fId=B(`f-node-${hy++}`,{alias:"fNodeId",transform:e=>Ro(e)||`f-node-${hy++}`});fParentId=B(null,{alias:"fNodeParentId"});position=Ei(U.initialize(),{alias:"fNodePosition"});size=B(void 0,{alias:"fNodeSize"});sizeChange=Ke({alias:"fNodeSizeChange"});rotate=Ei(0,{alias:"fNodeRotate"});fConnectOnNode=B(!0,{transform:j});fMinimapClass=B([]);fDraggingDisabled=B(!1,{alias:"fNodeDraggingDisabled",transform:j});fSelectionDisabled=B(!1,{alias:"fNodeSelectionDisabled",transform:j});fIncludePadding=B(!0,{transform:j});fAutoExpandOnChildHit=B(!1,{transform:j});fAutoSizeToFitChildren=B(!1,{transform:j});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Qr(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 si),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),wB))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Fo(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new ea(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new ta(this))}static \u0275fac=function(n){return new(n||t)(un(Qe))};static \u0275dir=je({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-node-id",i.fId()),ue("f-node-dragging-disabled",i.fDraggingDisabled())("f-node-selection-disabled",i.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:[ke([{provide:Sh,useExisting:t}]),Z]})}return t})();function TB(t){return!!t.closest("[fNode]")}var fy=0,Qy=(()=>{class t extends bB{hostElement=p(Qe).nativeElement;_mediator=p(V);_node=p(Sh);fId=B(`f-node-input-${fy++}`,{alias:"fInputId",transform:e=>Ro(e)||`f-node-input-${fy++}`});category=B(void 0,{alias:"fInputCategory",transform:Ro});multiple=B(!0,{alias:"fInputMultiple",transform:j});disabled=B(!1,{alias:"fInputDisabled",transform:j});userFConnectableSide=K.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yr(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(ht.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new na(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(n,i){n&2&&(O("data-f-input-id",i.fId()),ue("f-node-input-multiple",i.multiple)("f-node-input-disabled",i.disabled()))},inputs:{fId:[1,"fInputId","fId"],category:[1,"fInputCategory","category"],multiple:[1,"fInputMultiple","multiple"],disabled:[1,"fInputDisabled","disabled"],userFConnectableSide:[2,"fInputConnectableSide","userFConnectableSide",e=>xo(e,"fInputConnectableSide",K)]},exportAs:["fNodeInput"],standalone:!1,features:[ke([{provide:gB,useExisting:t}]),Z,ro]})}return t})(),SB=(()=>{class t extends Bu{get hasConnectionLimits(){return!!this.canBeConnectedInputs&&this.canBeConnectedInputs.length>0}canConnectTo(e){return[e.fId(),e.category()].some(i=>i&&this.canBeConnectedInputs?.includes(i))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})();function Jy(t){return!!t.closest("[fNodeOutlet]")}var kB=new be("F_NODE_OUTPUT"),IB=(()=>{class t extends SB{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,standalone:!1,features:[Z]})}return t})();function eC(t){return!!t.closest("[fNodeOutput]")}var my=0,tC=(()=>{class t extends IB{hostElement=p(Qe).nativeElement;_mediator=p(V);_node=p(Sh);fId=B(`f-node-output-${my++}`,{alias:"fOutputId",transform:e=>Ro(e)||`f-node-output-${my++}`});multiple=B(!1,{alias:"fOutputMultiple",transform:j});disabled=B(!1,{alias:"fOutputDisabled",transform:j});userFConnectableSide=K.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new Yr(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(ht.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new na(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(n,i){n&2&&(O("data-f-output-id",i.fId()),ue("f-node-output-multiple",i.multiple)("f-node-output-disabled",i.disabled())("f-node-output-self-connectable",i.isSelfConnectable))},inputs:{fId:[1,"fOutputId","fId"],multiple:[1,"fOutputMultiple","multiple"],disabled:[1,"fOutputDisabled","disabled"],userFConnectableSide:[2,"fOutputConnectableSide","userFConnectableSide",e=>xo(e,"fOutputConnectableSide",K)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[ke([{provide:kB,useExisting:t}]),Z,ro]})}return t})();var zu=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(o){this.event=o}},Br=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(o){this.outlet=o}},EB=(()=>{let t=class ql{_store=p(L);handle({outlet:e}){let n=this._findOwnerNode(e);if(!n)throw new Error("The fOutlet must belong to an fNode");let i=this._findFirstConnectableOutputInNode(n);if(!i)throw new Error("Outlet requires at least one connectable output in the same node.");return i}_findOwnerNode(e){let n=e.hostElement;return this._store.nodes.getAll().find(i=>i.isContains(n))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(n=>e.isContains(n.hostElement)&&n.canBeConnected)}static \u0275fac=function(n){return new(n||ql)};static \u0275prov=y({token:ql,factory:ql.\u0275fac})};return t=P([R(Br)],t),t})(),Ym=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(o,e,n){this.sourceId=o,this.targetId=e,this.dropPosition=n,this.fOutputId=o,this.fInputId=e,this.fDropPosition=n}},Hu=(()=>{class t extends Ft{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=p(hi);_mediator=p(V);_connectionBehaviour=p(Ho);_store=p(L);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new rt;initialize(e,n){this._sourceRef=this._mediator.execute(new Kt(e)),this._pointerDown=rt.fromRect(te.initialize(n.x,n.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(U.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Zr(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new Lo(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),i=this._findClosestTarget(n),r=i?.connector.fConnectableSide||K.TOP;this._drawCreateConnection(n,r);let a=this._snapConnection;if(!a)return;let s=i&&i.distance<a.fSnapThreshold?i:void 0;this._drawSnapConnection(s)}_findClosestTarget(e){return this._mediator.execute(new qi(e,this._targets))}_drawCreateConnection(e,n){let i=this._connectionBehaviour.handle(new vn(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,n,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(i),this._connection.redraw()}_drawSnapConnection(e){let n=this._snapConnection;if(!n)return;if(!e){n.hide();return}let i=this._connectionBehaviour.handle(new vn(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(i),n.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new Bo(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new zn(e))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),MB=(()=>{let t=class Gl{_result=p(hi);_mediator=p(V);_store=p(L);_dragContext=p(he);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 Hu)}_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 Jy(e.hostElement)?this._mediator.execute(new Br(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 Ym(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Xr(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(n){return new(n||Gl)};static \u0275prov=y({token:Gl,factory:Gl.\u0275fac})};return t=P([R(zu)],t),t})(),Vr=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(o,e){this.eventPosition=o,this.source=e}},DB=(()=>{let t=class jl{_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);get _transform(){return this._store.transform}handle({source:e,eventPosition:n}){this._dragContext.onPointerDownScale=this._transform.scale;let i=this._toFlowSpace(n);this._dragContext.onPointerDownPosition=i;let r=this._toCanvasSpace(i),a=this._dragInjector.get(Hu);a.initialize(e,r),this._dragContext.draggableItems=[a]}_toFlowSpace(e){return pe.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return pe.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||jl)};static \u0275prov=y({token:jl,factory:jl.\u0275fac})};return t=P([R(Vr)],t),t})(),qu=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(o,e){this.event=o,this.node=e}},PB=(()=>{let t=class Ul{_mediator=p(V);_store=p(L);handle({event:e,node:n}){let i=this._findOutlet(n);if(!i||(i.setOutputs(this._getOutputs(n)),!i.canBeConnected))return;let r=i.isConnectionFromOutlet?i:this._resolveOutput(i);!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 Br(e))}_startDrag(e,n){this._mediator.execute(new Vr(e,n))}static \u0275fac=function(n){return new(n||Ul)};static \u0275prov=y({token:Ul,factory:Ul.\u0275fac})};return t=P([R(qu)],t),t})(),Gu=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(o,e){this.event=o,this.node=e}},RB=(()=>{let t=class $l{_mediator=p(V);_store=p(L);handle({event:e,node:n}){if(!eC(e.targetElement)||this._hasOutlet(n))return;let i=this._findOutput(e.targetElement);!i||!i.canBeConnected||this._startDrag(e.getPosition(),i)}_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 Vr(e,n))}static \u0275fac=function(n){return new(n||$l)};static \u0275prov=y({token:$l,factory:$l.\u0275fac})};return t=P([R(Gu)],t),t})(),ju=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},OB=(()=>{let t=class Wl{_mediator=p(V);_store=p(L);_dragContext=p(he);handle({event:e,fTrigger:n}){if(!this._isValidConditions()||!this._isValidTrigger(e,n))return;let i=Jy(e.targetElement),r=!i&&eC(e.targetElement);if(!i&&!r)return;let a=this._findOwnerNode(e.targetElement);a&&(i?this._mediator.execute(new qu(e,a)):this._mediator.execute(new Gu(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 an(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Wl)};static \u0275prov=y({token:Wl,factory:Wl.\u0275fac})};return t=P([R(ju)],t),t})(),Uu=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(o){this.event=o}},Xm=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(o,e,n,i,r,a,s){this.connectionId=o,this.endpoint=e,this.previousSourceId=n,this.nextSourceId=i,this.previousTargetId=r,this.nextTargetId=a,this.dropPosition=s,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=n,this.newSourceId=i,this.oldTargetId=r,this.newTargetId=a,this.dropPoint=s}},FB=(()=>{let t=class Kl{_dragResult=p(hi);_mediator=p(V);_store=p(L);_dragContext=p(he);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(),i=this._findConnectableConnector(e,n.candidates);i&&!this._isReassignedToDifferentConnector(n,i)||this._dragDirective.fReassignConnection.emit(this._buildEvent(n,e,i))}_findConnectableConnector(e,n){return this._mediator.execute(new Xr(e.getPosition(),n))}_isReassignedToDifferentConnector(e,n){let i=e.connection;return e.draggedEnd==="target"?i.fInputId()!==n.fId():i.fOutputId()!==n.fId()}_buildEvent(e,n,i){let r=e.connection;return new Xm(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?i?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?i?.fId():void 0,n.getPosition())}static \u0275fac=function(n){return new(n||Kl)};static \u0275prov=y({token:Kl,factory:Kl.\u0275fac})};return t=P([R(Uu)],t),t})(),$u=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}};function NB(t,o){return nC(t,o)||AB(t,o)}function nC(t,o){return t.fDragHandleEnd()?.point&&iC(o,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function AB(t,o){return!!t.fDragHandleStart()?.point&&iC(o,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function iC(t,o){return(t.x-o.x)**2+(t.y-o.y)**2<=8**2}function oC(t,o){return t&&t.distance<o.fSnapThreshold?t:void 0}function Wu(t){return rt.fromRect(te.initialize(t.x,t.y))}var Zm=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(o,e,n,i,r){this._mediator=o,this._behaviour=e,this._connection=n,this._sourceRef=i,this._targetRef=r,this._anchorRect=Wu(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Xp(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(o=>o.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new Lo(this._candidates.map(o=>o.connector)))}setSnapConnection(o){this._snap=o,o&&(o.fInputId.set(this._connection.fInputId()),o.initialize())}onPointerMove(o){let e=this._anchorRect.addPoint(o),n=this._findClosest(e.gravityCenter),i=n?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,i);let r=this._snap;r&&this._drawSnap(oC(n,r))}_findClosest(o){return this._mediator.execute(new qi(o,this._candidates))}_draw(o,e){let n=this._behaviour.handle(new vn(o,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(o){let e=this._snap;if(!e)return;if(!o){e.hide();return}let n=this._behaviour.handle(new vn(o.rect,this._targetRef.rect,e,o.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(o.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 Bo(this._candidates.map(o=>o.connector)))}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Qm=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(o,e,n,i,r){this._mediator=o,this._behaviour=e,this._connection=n,this._sourceRef=i,this._targetRef=r,this._anchorRect=Wu(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Zr(this._source,this._sourceRef.rect.gravityCenter));let o=this._connection.fInputId();o&&!this._candidates.some(e=>e.connector.fId()===o)&&this._candidates.push(this._targetRef),this._mediator.execute(new Lo(this._candidates.map(e=>e.connector)))}setSnapConnection(o){this._snap=o,o&&(o.fOutputId.set(this._connection.fOutputId()),o.initialize())}onPointerMove(o){let e=this._anchorRect.addPoint(o),n=this._findClosest(e.gravityCenter),i=n?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,i);let r=this._snap;r&&this._drawSnap(oC(n,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Bo(this._candidates.map(o=>o.connector)))}_findClosest(o){return this._mediator.execute(new qi(o,this._candidates))}_draw(o,e){let n=this._behaviour.handle(new vn(this._sourceRef.rect,o,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(n),this._connection.redraw()}_drawSnap(o){let e=this._snap;if(!e)return;if(!o){e.hide();return}let n=this._behaviour.handle(new vn(this._sourceRef.rect,o.rect,e,this._source.fConnectableSide,o.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(o.connector)));e.show(),e.setLine(n),e.redraw()}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Jm=(()=>{class t extends Ft{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=p(hi);_mediator=p(V);_connectionBehaviour=p(Ho);_store=p(L);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 Kt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new Kt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new Zm(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Qm(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:Wu(this._connection.line.point1),targetAnchorRect:Wu(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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),LB=(()=>{let t=class Yl{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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=qo(e.event.getPosition(),this._store.flowHost,this._transform),i=this._findConnectionAt(n);i&&(this._capturePointerDown(e),this._startDrag(i,n),queueMicrotask(()=>this._bringToFront(i)))}_findConnectionAt(e){return this._connections.find(n=>NB(n,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,n){let i=this._dragInjector.get(Jm);i.initialize(e,nC(e,n)),this._dragContext.draggableItems=[i]}_isValidTrigger(e){return an(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new ji(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Yl)};static \u0275prov=y({token:Yl,factory:Yl.\u0275fac})};return t=P([R($u)],t),t})(),Ku=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(o){this.event=o}},Yu=class{connectionId;waypoints;constructor(o,e){this.connectionId=o,this.waypoints=e}},Xu=(()=>{class t extends Ft{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=p(L);_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=ge({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=ge({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(U.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 Yu(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),BB=(()=>{let t=class Xl{_dragContext=p(he);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof Xu)}static \u0275fac=function(n){return new(n||Xl)};static \u0275prov=y({token:Xl,factory:Xl.\u0275fac})};return t=P([R(Ku)],t),t})(),Zu=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},VB=(()=>{let t=class Zl{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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=qo(e.event.getPosition(),this._flowHost,this._transform),i=this._pickControlPoint(n);if(!i||!this._isValidTrigger(e))return;let r=this._dragInjector.get(Xu);r.setPick(i),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._flowHost).div(this._transform.scale),this._dragContext.draggableItems=[r],queueMicrotask(()=>this._updateConnectionLayer(i.connection))}_pickControlPoint(e){if(this._dragContext.isEmpty())return p6(this._connections,e)}_isValidTrigger(e){return an(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new ji(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||Zl)};static \u0275prov=y({token:Zl,factory:Zl.\u0275fac})};return t=P([R(Zu)],t),t})(),zB=[MB,DB,PB,EB,RB,OB,FB,LB,VB,BB],Qu=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(o){this.event=o}},HB=1,zr=(()=>{class t extends Ft{type="move-node-to-parent";kind="assign-to-container";_store=p(L);_dragSession=p(he);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(ht.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),HB)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(ht.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let n=this._getPointerInFlow(e),i=this._findTargetUnderPointer(n);i?this._setActiveTarget(i):this._clearActiveTarget()}_getPointerInFlow(e){let n=pe.fromPoint(this._dragSession.onPointerDownPosition).add(e),i=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return n.sub(i)}_findTargetUnderPointer(e){return this._candidateGroups.find(n=>te.isIncludePoint(n.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(ht.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(ht.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ju=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(o){this.nodesAndGroups=o}},e_=class{rootHandlers;participants;constructor(o,e){this.rootHandlers=o,this.participants=e}},t_=class{fNodeIds;constructor(o){this.fNodeIds=o}},I_="move-node",E_="drag-node";function qB(t){return t.getEvent().kind===E_||t.getEvent().fEventType===I_}var pi=(()=>{class t extends Ft{type=I_;kind=E_;data(){return new t_(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 i=n.getLastRect();e=e?te.union([e,i]):i}return e??te.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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ep=class{_limits;_quantizeStep;constructor(o,e=.5){this._limits=o,this._quantizeStep=e}applyInto(o,e){let{min:n,max:i}=this._limits,r=this._clamp(o.x,n.x,i.x),a=this._clamp(o.y,n.y,i.y),s=o.x-r,c=o.y-a,u=this._quantizeSigned(s,this._quantizeStep),h=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=h<0,e.edges.bottom=h>0,e.overflow.x=Math.abs(u),e.overflow.y=Math.abs(h)}_quantizeSigned(o,e){if(e<=0||o===0)return 0;let n=o/e;return(o>0?Math.ceil(n):Math.floor(n))*e}_clamp(o,e,n){return Math.min(Math.max(o,e),n)}},n_=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(o,e){this._pointerDown=e,this._vCellSize=o.vCellSize(),this._hCellSize=o.hCellSize(),this._snapWhileDragging=o.fCellSizeWhileDragging()}snap(o,e){let n=e||this._snapWhileDragging;return this._strategies[+n](o)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(o){return{x:this._snapToGrid(this._pointerDown.x+o.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+o.y,this._vCellSize)-this._pointerDown.y}}_noSnap(o){return o}_snapToGrid(o,e){return Math.round(o/e)*e}};function _y(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var i_=class{_snapper;_hardClamp;_hardResult=_y();_softClamps=[];_softResults=[];constructor(o,e,n){let i=o.get(L).fDraggable;this._snapper=new n_(i,e),this._hardClamp=new ep(n.hard,.5);for(let r of n.soft)this._softClamps.push(new ep(r.limits,.5)),this._softResults.push(_y())}apply(o,e=!1){let n=this._snapper.snap(o,e);this._hardClamp.applyInto(n,this._hardResult);let i={x:this._hardResult.value.x,y:this._hardResult.value.y};for(let r=0;r<this._softClamps.length;r++)this._softClamps[r].applyInto(i,this._softResults[r]);return{hardDelta:i,soft:this._softResults}}finalize(o){return this.apply(o,!0)}};function gy(t,o,e){let{x:n,y:i,width:r,height:a}=t;return e.right&&o.x>0&&(r+=o.x),e.left&&o.x>0&&(n-=o.x,r+=o.x),e.bottom&&o.y>0&&(a+=o.y),e.top&&o.y>0&&(i-=o.y,a+=o.y),te.initialize(n,i,r,a)}var o_=class extends Ft{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=I_;kind=E_;_startPosition=U.initialize();_startRect=te.initialize();_applyConstraints=o=>o;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=U.initialize();_softParentConnectionHandlers=[];_mediator;constructor(o,e,n=[],i=[],r=[]){super(),this._injector=o,this.nodeOrGroup=e,this.children=n,this.sourceConnectionHandlers=i,this.targetConnectionHandlers=r,this._mediator=o.get(V),this._startRect=this._mediator.execute(new it(e.hostElement)),this._startPosition=ge({},e._position)}setConstraints(o){this._constraints=o,this._deltaConstraints=new i_(this._injector,this._startPosition,o),this._applyConstraints=e=>{let n=this._deltaConstraints.apply(e);return this._applySoftExpansions(n.soft),n.hardDelta}}setSoftParentConnectionHandlers(o){this._softParentConnectionHandlers=o}finalizeConstraints(){this._applyConstraints=o=>{let e=this._deltaConstraints.finalize(o);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return te.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let o of this.children)o.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(ht.DRAG_AND_DROP.DRAGGING)}onPointerMove(o){let e=this._applyConstraints(o);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 o of this.children)o.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(ht.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(o){return U.sum(this._startPosition,o)}_redraw(o){this._lastPosition=o,this.nodeOrGroup.updatePosition(o),this._mediator.execute(new Vi(this.nodeOrGroup.fId(),te.initialize(o.x,o.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(o){this._lastSoftResults=o;for(let e=0;e<o.length;e++){let n=o[e],i=this._constraints.soft[e],r=gy(i.boundingRect,n.overflow,n.edges);this._commitParentRect(i.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(o,e){let n=o._position.x!==e.x||o._position.y!==e.y||o._size?.width!==e.width||o._size?.height!==e.height;return o.updateSize({width:e.width,height:e.height}),o.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new Vi(o.fId(),e)),o.redraw(),n}_updateParentConnectionHandlers(o){let e=this._softParentConnectionHandlers[o];if(!e)return;let n=new Map;for(let i of e.source){let r=this._readConnectorRect(i.connector,n);i.handler.setSourceDelta(this._buildDelta(i.baselineRect,r))}for(let i of e.target){let r=this._readConnectorRect(i.connector,n);i.handler.setTargetDelta(this._buildDelta(i.baselineRect,r))}}_readConnectorRect(o,e){let n=`${o.kind}::${o.fId()}`,i=e.get(n);if(i)return i;let r=this._mediator.execute(new Kt(o)).rect;return e.set(n,r),r}_buildDelta(o,e){return U.initialize(e.x-o.x,e.y-o.y)}_emitExpandedEvent(){for(let o=0;o<this._lastSoftResults.length;o++){let e=this._lastSoftResults[o];if(!e.overflow.x&&!e.overflow.y)continue;let n=this._constraints.soft[o],i=gy(n.boundingRect,e.overflow,e.edges);n.nodeOrGroup.sizeChange.emit(i)}}destroy(){for(let o of this.children)o.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=o=>o,this._softParentConnectionHandlers=[]}},GB=(()=>{let t=class Ql{_injector=p(dt);handle({nodesAndGroups:e}){let n=this._createHandlerByNodeId(e),i=this._linkParentsAndCollectRoots(e,n);return new e_(i,Array.from(n.values()))}_createHandlerByNodeId(e){let n=new Map;for(let i of e)n.set(i.fId(),new o_(this._injector,i));return n}_linkParentsAndCollectRoots(e,n){let i=[];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):i.push(a)}return i}static \u0275fac=function(n){return new(n||Ql)};static \u0275prov=y({token:Ql,factory:Ql.\u0275fac})};return t=P([R(Ju)],t),t})(),tp=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(o){this.nodeOrGroup=o}},Hr=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(o,e){this.nodeOrGroup=o,this.childrenPaddings=e}},r_=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(o,e,n,i){this.nodeOrGroup=o,this.boundingRect=e,this.innerRect=n,this.paddings=i}},jB=(()=>{let t=class Jl{_mediator=p(V);handle({nodeOrGroup:e,childrenPaddings:n}){let i=this._readBoundingRect(e),r=this._readOwnPaddings(e,i),a=[r[0]+n[0],r[1]+n[1],r[2]+n[2],r[3]+n[3]],s=te.initialize(i.x+a[0],i.y+a[1],i.width-a[0]-a[2],i.height-a[1]-a[3]);return new r_(e,i,s,a)}_readBoundingRect(e){return this._mediator.execute(new it(e.hostElement))}_readOwnPaddings(e,n){return this._mediator.execute(new Gi(e,n))}static \u0275fac=function(n){return new(n||Jl)};static \u0275prov=y({token:Jl,factory:Jl.\u0275fac})};return t=P([R(Hr)],t),t})(),UB=(()=>{let t=class ec{_mediator=p(V);handle({nodeOrGroup:e}){let n=this._readCurrentRect(e),i=this._readParentsChain(e);return this._buildConstraints(i,n)}_readCurrentRect(e){return this._mediator.execute(new it(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Ao(e))??[]}_buildConstraints(e,n){let i=[],r=Ky(),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))i.push(this._makeSoftLimit(s,c.boundingRect,u));else{r=u;break}}return{soft:i,hard:r}}_readParentBounds(e,n){return this._mediator.execute(new Hr(e,n))}_calculateDifference(e,n){return{min:this._calculateMinimumDifference(e,n),max:this._calculateMaximumDifference(e,n)}}_calculateMinimumDifference(e,n){return U.initialize(e.x-n.x,e.y-n.y)}_calculateMaximumDifference(e,n){return U.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,i){return{nodeOrGroup:e,boundingRect:n,initialSize:e._size,limits:i}}static \u0275fac=function(n){return new(n||ec)};static \u0275prov=y({token:ec,factory:ec.\u0275fac})};return t=P([R(tp)],t),t})(),np=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(o,e){this.rootHandlers=o,this.participants=e}},ip=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.constraints=e,this.handlerPool=n}},qr=class{_mediator=p(V);_store=p(L);_behaviour=p(Ho);_source;_target;_sourceRef;_targetRef;_sourceDelta=U.initialize();_targetDelta=U.initialize();connection;initialize(o){this.connection=o,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(o){this._sourceDelta=o,this._mediator.execute(new Bi(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,o)))}setTargetDelta(o){this._targetDelta=o,this._mediator.execute(new Bi(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,o)))}redraw(){let o=this._buildLine();this.connection.setLine(o),this.connection.redraw()}_buildLine(){let o=rt.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=rt.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new vn(o,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(o){return this._mediator.execute(new Kt(o))}_withDelta(o,e){return rt.fromRoundedRect(o).addPoint(e)}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},Gr=(()=>{class t extends qr{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),jr=(()=>{class t extends qr{_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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Ur=(()=>{class t extends qr{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),$B=(()=>{let t=class tc{_store=p(L);_mediator=p(V);_dragInjector=p(Ct);handle({dragHandler:e,constraints:n,handlerPool:i}){let r=n.soft.map(a=>this._buildParentConnectionHandlers(a.nodeOrGroup,i));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,n){let i=this._store.outputs.getAll().filter(h=>h.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(h=>h.fNodeId===e.fId());if(!i.length&&!r.length)return{source:[],target:[]};let a=new Set(i.map(h=>h.fId())),s=new Set(r.map(h=>h.fId())),c=new Map,u={source:[],target:[]};for(let h of this._store.connections.getAll()){let g=a.has(h.fOutputId()),C=s.has(h.fInputId());if(!g&&!C)continue;let k=this._getExistingConnectionHandler(n,h);if(k||(k=this._createConnectionHandler(h,g,C),n.push(k)),g){let I=this._store.outputs.require(h.fOutputId());u.source.push({handler:k,connector:I,baselineRect:this._readConnectorRect(I,c)})}if(C){let I=this._store.inputs.require(h.fInputId());u.target.push({handler:k,connector:I,baselineRect:this._readConnectorRect(I,c)})}}return u}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n,i){let r;return n&&i?r=this._dragInjector.createInstance(jr):n?r=this._dragInjector.createInstance(Gr):r=this._dragInjector.createInstance(Ur),r.initialize(e),r}_readConnectorRect(e,n){let i=`${e.kind}::${e.fId()}`,r=n.get(i);if(r)return r;let a=this._mediator.execute(new Kt(e)).rect;return n.set(i,a),a}static \u0275fac=function(n){return new(n||tc)};static \u0275prov=y({token:tc,factory:tc.\u0275fac})};return t=P([R(ip)],t),t})(),WB=(()=>{let t=class nc{_dragInjector=p(Ct);_mediator=p(V);handle({rootHandlers:e,participants:n}){let i=this._collectConnectionHandlers(n);this._applyConstraintsToRoots(e,i);let r=this._dragInjector.createInstance(pi);return r.initialize(n,e),r}_applyConstraintsToRoots(e,n){for(let i of e){let r=this._calculateConstraints(i.nodeOrGroup);i.setConstraints(r),this._attachSoftParentConnectionHandlers(i,r,n)}}_collectConnectionHandlers(e){let n=new Map;for(let i of e){for(let r of i.sourceConnectionHandlers)n.set(r.connection.fId(),r);for(let r of i.targetConnectionHandlers)n.set(r.connection.fId(),r)}return Array.from(n.values())}_attachSoftParentConnectionHandlers(e,n,i){this._mediator.execute(new ip(e,n,i))}_calculateConstraints(e){return this._mediator.execute(new tp(e))}static \u0275fac=function(n){return new(n||nc)};static \u0275prov=y({token:nc,factory:nc.\u0275fac})};return t=P([R(np)],t),t})(),op=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.sourceIds=e,this.handlerPool=n}},KB=(()=>{let t=class ic{_store=p(L);_dragInjector=p(Ct);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(i=>n.has(i.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let i=this._getExistingConnectionHandler(n.handlerPool,e);i||(i=this._createConnectionHandler(n.sourceIds,e),n.handlerPool.push(i)),n.dragHandler.targetConnectionHandlers.push(i)}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n){let i;return e.includes(n.fOutputId())?i=this._dragInjector.createInstance(jr):i=this._dragInjector.createInstance(Ur),i.initialize(n),i}static \u0275fac=function(n){return new(n||ic)};static \u0275prov=y({token:ic,factory:ic.\u0275fac})};return t=P([R(op)],t),t})(),rp=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(o,e,n){this.dragHandler=o,this.targetIds=e,this.handlerPool=n}},YB=(()=>{let t=class oc{_store=p(L);_dragInjector=p(Ct);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(i=>n.has(i.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let i=this._getExistingConnectionHandler(n.handlerPool,e);i||(i=this._createConnectionHandler(n.targetIds,e),n.handlerPool.push(i)),n.dragHandler.sourceConnectionHandlers.push(i)}_getExistingConnectionHandler(e,n){return e.find(i=>i.connection.fId()===n.fId())}_createConnectionHandler(e,n){let i;return e.includes(n.fInputId())?i=this._dragInjector.createInstance(jr):i=this._dragInjector.createInstance(Gr),i.initialize(n),i}static \u0275fac=function(n){return new(n||oc)};static \u0275prov=y({token:oc,factory:oc.\u0275fac})};return t=P([R(rp)],t),t})(),ap=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(o){this.nodeOrGroup=o}},XB=(()=>{let t=class rc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({nodeOrGroup:e}){let n=this._collectSelected(e),i=this._withDeepChildren(n),r=this._mediator.execute(new Ju(i)),a=this._collectSourceConnectorIds(i),s=this._collectTargetConnectorIds(i);return this._attachConnectionHandlers(r.participants,a,s),this._mediator.execute(new np(r.rootHandlers,r.participants))}_collectSelected(e){let n=[];for(let i of this._dragSession.selectedItems){let r=this._findNodeByHost(i.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 i of e){n.push(i);let r=this._mediator.execute(new zo(i.fId()));n.push(...r)}return n}_collectSourceConnectorIds(e){return om(e,n=>this._store.outputs.getAll().filter(i=>i.fNodeId===n.fId()).map(i=>i.fId()))}_collectTargetConnectorIds(e){return om(e,n=>this._store.inputs.getAll().filter(i=>i.fNodeId===n.fId()).map(i=>i.fId()))}_attachConnectionHandlers(e,n,i){let r=[];for(let a of e)this._mediator.execute(new rp(a,i,r)),this._mediator.execute(new op(a,n,r))}static \u0275fac=function(n){return new(n||rc)};static \u0275prov=y({token:rc,factory:rc.\u0275fac})};return t=P([R(ap)],t),t})(),ZB=[GB,UB,WB,KB,YB,$B,jB,XB];function QB(t,o,e=10){let n=o.x,i=o.y,r=n+o.width,a=i+o.height,s=o.gravityCenter.x,c=o.gravityCenter.y,u,h,g=1/0,C,k,I=1/0,N=(Y,ee)=>{let ce=ee<0?-ee:ee;ce<=e&&ce<g&&(g=ce,u=Y,h=ee)},q=(Y,ee)=>{let ce=ee<0?-ee:ee;ce<=e&&ce<I&&(I=ce,C=Y,k=ee)};for(let Y=0;Y<t.length;Y++){let ee=t[Y],ce=ee.x,Oe=ee.y,De=ce+ee.width,Ge=Oe+ee.height,Ht=ee.gravityCenter.x,ct=ee.gravityCenter.y;N(ce,n-ce),N(De,n-De),N(Ht,s-Ht),N(ce,r-ce),N(De,r-De),q(Oe,i-Oe),q(Ge,i-Ge),q(ct,c-ct),q(Oe,a-Oe),q(Ge,a-Ge)}return{x:{guide:u,delta:h},y:{guide:C,delta:k}}}var by=["left","top","width","height"],sp=class{_element;constructor(o,e,n="f-line"){this._element=o.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(o){for(let e of by){let n=o[e];n!=null&&(this._element.style[e]=`${n}px`)}}clearRect(){for(let o of by)this._element.style.removeProperty(o)}destroy(){this._element.remove()}},a_=class{_horizontal;_vertical;constructor(o,e){this._horizontal=new sp(o,e),this._vertical=new sp(o,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(o,e,n){this._vertical.show(),this._vertical.render({left:o*n.scale+n.position.x+n.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(o,e,n){this._horizontal.show(),this._horizontal.render({left:0,top:o*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()}},lp=class{static fToken=Symbol("MagneticLinesPreparationRequest")},JB=(()=>{let t=class ac{_mediator=p(V);_store=p(L);_browser=p(at);_injector=p(dt);_dragSession=p(he);_renderer;handle(e){let n=this._store.instances.get(Xe.MAGNETIC_LINES);if(!n)return;let i=this._dragSession.draggableItems.find(r=>r instanceof pi);i&&i.setMagneticLines(new s_(this._injector,this._renderer??this._createRenderer(n),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(i.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new a_(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 it(r.hostElement)))}static \u0275fac=function(n){return new(n||ac)};static \u0275prov=y({token:ac,factory:ac.\u0275fac})};return t=P([R(lp)],t),t})(),s_=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(o,e,n,i){this._renderer=e,this._size=n,this._rects=i;let r=o.get(L);this._alignThreshold=r.instances.require(Xe.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(o){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(o)),15)}_renderGuides(o){this._renderVertical(o),this._renderHorizontal(o)}_renderVertical(o){o.x.guide!==void 0?this._renderer.drawVerticalLine(o.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(o){o.y.guide!==void 0?this._renderer.drawHorizontalLine(o.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(o){return QB(this._rects,o,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},vy=["top","center","bottom"],yy=["left","center","right"];function e9(t,o,e=10,n=10){let i=o.x,r=o.y,a=i+o.width,s=r+o.height,c=o.gravityCenter.x,u=o.gravityCenter.y,h=t9(t,o,i,r,a,s,c,u,e,n),g=n9(t,o,i,r,a,s,c,u,e,n);return h&&(!g||h.absDelta<=g.absDelta)?{axis:"x",delta:h.delta,gap:h.gap,rects:h.rects,alignMode:h.alignMode,crossDelta:h.crossDelta}:g?{axis:"y",delta:g.delta,gap:g.gap,rects:g.rects,alignMode:g.alignMode,crossDelta:g.crossDelta}:{rects:[]}}function t9(t,o,e,n,i,r,a,s,c,u){let h=1/0,g,C=0,k,I=[],N=0,q=[],Y=[],ee=[];for(let ce=0;ce<vy.length;ce++){let Oe=ce===0?n:ce===1?s:r;q.length=0,Y.length=0,ee.length=0;let De=1/0,Ge=-1/0,Ht=0,ct=1/0,vt=1/0;for(let qe=0;qe<t.length;qe++){let Fe=t[qe],rr=ce===0?Fe.y:ce===1?Fe.gravityCenter.y:Fe.y+Fe.height,xf=Oe-rr,An=So(xf);if(An>c)continue;q.push(qe),Y.push(Fe.x),ee.push(Fe.x+Fe.width);let ar=Fe.y,sr=Fe.y+Fe.height;ar<De&&(De=ar),sr>Ge&&(Ge=sr),(An<ct||An===ct&&qe<vt)&&(ct=An,Ht=rr,vt=qe)}let tt=q.length;if(tt<2)continue;rC(q,Y,ee);let st=0;for(;st<tt&&Y[st]<=a;)st++;let Ti=st>0&&st<tt,Mt,qt;Ti?(Mt=st-1,qt=st):st<=0?(Mt=0,qt=1):(Mt=tt-2,qt=tt-1);let Gt=Y[qt]-ee[Mt];if(Gt<0)continue;let ft;if(Ti){ft=ee[Mt]+Gt;let qe=ft+o.width,Fe=Y[qt]-qe;if(So(Fe-Gt)>u)continue}else st<=0?ft=Y[0]-Gt-o.width:ft=ee[tt-1]+Gt;let or=e-ft,Si=So(or);if(Si>u||Si>=h)continue;let dn=i9(q,Y,ee,De,Ge);if(Ti){let qe=ft,Fe=ft+o.width;dn.push({left:ee[Mt],top:De,width:qe-ee[Mt],height:Ge-De}),dn.push({left:Fe,top:De,width:Y[qt]-Fe,height:Ge-De})}else if(st<=0){let qe=ft+o.width;dn.push({left:qe,top:De,width:Y[0]-qe,height:Ge-De})}else dn.push({left:ee[tt-1],top:De,width:ft-ee[tt-1],height:Ge-De});let Cf=Oe-Ht;h=Si,g=or,C=Gt,k=vy[ce],I=dn,N=Cf}if(!(g===void 0||k===void 0))return{delta:g,absDelta:h,gap:C,rects:I,alignMode:k,crossDelta:N}}function n9(t,o,e,n,i,r,a,s,c,u){let h=1/0,g,C=0,k,I=[],N=0,q=[],Y=[],ee=[];for(let ce=0;ce<yy.length;ce++){let Oe=ce===0?e:ce===1?a:i;q.length=0,Y.length=0,ee.length=0;let De=1/0,Ge=-1/0,Ht=0,ct=1/0,vt=1/0;for(let qe=0;qe<t.length;qe++){let Fe=t[qe],rr=ce===0?Fe.x:ce===1?Fe.gravityCenter.x:Fe.x+Fe.width,xf=Oe-rr,An=So(xf);if(An>c)continue;q.push(qe),Y.push(Fe.y),ee.push(Fe.y+Fe.height);let ar=Fe.x,sr=Fe.x+Fe.width;ar<De&&(De=ar),sr>Ge&&(Ge=sr),(An<ct||An===ct&&qe<vt)&&(ct=An,Ht=rr,vt=qe)}let tt=q.length;if(tt<2)continue;rC(q,Y,ee);let st=0;for(;st<tt&&Y[st]<=s;)st++;let Ti=st>0&&st<tt,Mt,qt;Ti?(Mt=st-1,qt=st):st<=0?(Mt=0,qt=1):(Mt=tt-2,qt=tt-1);let Gt=Y[qt]-ee[Mt];if(Gt<0)continue;let ft;if(Ti){ft=ee[Mt]+Gt;let qe=ft+o.height,Fe=Y[qt]-qe;if(So(Fe-Gt)>u)continue}else st<=0?ft=Y[0]-Gt-o.height:ft=ee[tt-1]+Gt;let or=n-ft,Si=So(or);if(Si>u||Si>=h)continue;let dn=o9(q,Y,ee,De,Ge);if(Ti){let qe=ft,Fe=ft+o.height;dn.push({left:De,top:ee[Mt],width:Ge-De,height:qe-ee[Mt]}),dn.push({left:De,top:Fe,width:Ge-De,height:Y[qt]-Fe})}else if(st<=0){let qe=ft+o.height;dn.push({left:De,top:qe,width:Ge-De,height:Y[0]-qe})}else dn.push({left:De,top:ee[tt-1],width:Ge-De,height:ft-ee[tt-1]});let Cf=Oe-Ht;h=Si,g=or,C=Gt,k=yy[ce],I=dn,N=Cf}if(!(g===void 0||k===void 0))return{delta:g,absDelta:h,gap:C,rects:I,alignMode:k,crossDelta:N}}function i9(t,o,e,n,i){let r=[],a=i-n;for(let s=0;s<t.length-1;s++){let c=o[s+1]-e[s];c<0||r.push({left:e[s],top:n,width:c,height:a})}return r}function o9(t,o,e,n,i){let r=[],a=i-n;for(let s=0;s<t.length-1;s++){let c=o[s+1]-e[s];c<0||r.push({left:n,top:e[s],width:a,height:c})}return r}function rC(t,o,e){for(let n=1;n<o.length;n++){let i=o[n],r=e[n],a=t[n],s=n-1;for(;s>=0;){let c=o[s],u=t[s];if(c<i||c===i&&u<a)break;o[s+1]=c,e[s+1]=e[s],t[s+1]=u,s--}o[s+1]=i,e[s+1]=r,t[s+1]=a}}function So(t){return t<0?-t:t}var l_=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(o,e,n="f-rect"){this._element=o.document.createElement("div"),this._element.classList.add(n);let i=this._element.style;i.position="absolute",i.display="none",i.boxSizing="border-box",i.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(o,e,n,i){let r=this._element.style;o!==this._left&&(this._left=o,r.left=o+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),n!==this._width&&(this._width=n,r.width=n+"px"),i!==this._height&&(this._height=i,r.height=i+"px")}clearRect(){this._left=Number.NaN,this._top=Number.NaN,this._width=Number.NaN,this._height=Number.NaN;let o=this._element.style;o.removeProperty("left"),o.removeProperty("top"),o.removeProperty("width"),o.removeProperty("height")}destroy(){this._element.remove()}},c_=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(o,e,n="f-rect"){this._browser=o,this._hostElement=e,this._className=n}draw(o,e){let n=e.scale,i=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let a=0;a<o.length;a++){let s=this._getOrCreate(a),c=o[a];s.show(),s.render(c.left*n+i,c.top*n+r,c.width*n,c.height*n)}for(let a=o.length;a<this._activeCount;a++)this._pool[a].hide();this._activeCount=o.length}hideAll(){for(let o=0;o<this._activeCount;o++)this._pool[o].hide();this._activeCount=0}destroy(){for(let o of this._pool)o.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(o){if(o<this._pool.length)return this._pool[o];let e=new l_(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},cp=class{static fToken=Symbol("MagneticRectsPreparationRequest")},r9=(()=>{let t=class sc{_mediator=p(V);_store=p(L);_browser=p(at);_injector=p(dt);_dragSession=p(he);_renderer;handle(e){let n=this._store.instances.get(Xe.MAGNETIC_RECTS);if(!n)return;let i=this._dragSession.draggableItems.find(r=>r instanceof pi);i&&i.setMagneticRects(new d_(this._injector,this._getRenderer(n),this._notDraggedRects(this._draggedNodes(i.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new c_(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 it(r.hostElement)))}static \u0275fac=function(n){return new(n||sc)};static \u0275prov=y({token:sc,factory:sc.\u0275fac})};return t=P([R(cp)],t),t})(),d_=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(o,e,n){this._renderer=e,this._rects=n;let i=o.get(L),r=i.instances.require(Xe.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=i.transform}scheduleRender(o){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(o)),15)}_renderRects(o){if(o.axis!==void 0&&o.delta!==void 0&&o.rects.length>0){this._renderer.draw(o.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(o){return e9(this._rects,o,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},dp=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(o){this.event=o}},u_=class{nodes;fNodes;constructor(o){this.nodes=o,this.fNodes=o}},a9=(()=>{let t=class lc{_mediator=p(V);_store=p(L);_dragSession=p(he);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let n=this._buildDragDelta(e.getPosition()),i=this._dragHandler.calculateMagneticSnaps(n),r=this._applySnapToDelta(n,i.lines,i.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(qB)}_buildDragDelta(e){return pe.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,n,i){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(i)&&(i.axis==="x"?(r=e.x-i.delta,a=e.y-(i.crossDelta??0)):(a=e.y-i.delta,r=e.x-(i.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 i of e.roots)i.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 u_(a)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let n=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Fu(n)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(n){return new(n||lc)};static \u0275prov=y({token:lc,factory:lc.\u0275fac})};return t=P([R(dp)],t),t})(),up=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(o,e){this.event=o,this.trigger=e}},s9=(()=>{let t=class cc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({event:e,trigger:n}){if(!this._canStartDrag(e,n))return;let i=this._findDraggableNode(e.targetElement);i&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(i)],this._mediator.execute(new lp),this._mediator.execute(new cp))}_canStartDrag(e,n){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&an(e.originalEvent,n)}_isDragHandle(e){return xr(e,".f-drag-handle")}_findDraggableNode(e){let n=this._store.nodes.getAll();for(let i of n)if(!i.fDraggingDisabled()&&i.isContains(e))return i}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Vo(e))}),this._mediator.execute(new ap(e))}static \u0275fac=function(n){return new(n||cc)};static \u0275prov=y({token:cc,factory:cc.\u0275fac})};return t=P([R(up)],t),t})(),l9=[...ZB,JB,r9,a9,s9],p_=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(o,e,n){this.targetGroupId=o,this.nodeIds=e,this.dropPosition=n,this.fTargetNode=o,this.fNodes=e,this.fDropPosition=n}},c9=(()=>{let t=class dc{_dragSession=p(he);_store=p(L);handle({event:e}){let n=this._findDropHandler();if(!n)return;let i=n.activeTarget?.node;i&&this._emitDropToGroupEvent(i.fId(),e),n.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof zr)}_emitDropToGroupEvent(e,n){this._store.fDraggable?.fDropToGroup.emit(new p_(e,this._getTopLevelDraggedIds(),n.getPosition()))}_getTopLevelDraggedIds(){let n=this._getMoveSummaryHandler().items.map(a=>a.nodeOrGroup),i=new Set(n.map(a=>a.fId())),r=[];for(let a of n){let s=a.fParentId();(!s||!i.has(s))&&r.push(a.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof pi);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(n){return new(n||dc)};static \u0275prov=y({token:dc,factory:dc.\u0275fac})};return t=P([R(Qu)],t),t})(),pp=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(o){this.event=o}},hp=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(o){this.candidates=o}},d9=(()=>{let t=class uc{handle({candidates:e}){let n=e.map((i,r)=>({candidate:i,index:r}));return n.sort((i,r)=>{let a=this._compareDomOrder(i.candidate.node.hostElement,r.candidate.node.hostElement);return a!==0?-a:i.index-r.index}),n.map(i=>i.candidate)}_compareDomOrder(e,n){if(e===n)return 0;let i=e.compareDocumentPosition(n);if((i&Node.DOCUMENT_POSITION_FOLLOWING)!==0)return-1;if((i&Node.DOCUMENT_POSITION_PRECEDING)!==0)return 1;if(i&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||uc)};static \u0275prov=y({token:uc,factory:uc.\u0275fac})};return t=P([R(hp)],t),t})(),h_=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(o,e,n){this._onPointerDown=e,this._limit=n;let i=o.get(L);this._vCellSize=i.fDraggable.vCellSize(),this._hCellSize=i.fDraggable.hCellSize(),this._adjustCellSize=i.fDraggable.fCellSizeWhileDragging()}limit(o){let{min:e,max:n}=this._limit,{x:i,y:r}=this._cellSizeStrategies[+this._adjustCellSize](o);return{x:this._clamp(i,e.x,n.x),y:this._clamp(r,e.y,n.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(o){return{x:this._snapToGrid(this._onPointerDown.x+o.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+o.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(o){return o}_clamp(o,e,n){return Math.min(Math.max(o,e),n)}_snapToGrid(o,e){return Math.round(o/e)*e}},fp=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(o){this.externalItem=o}},u9=(()=>{let t=class pc{_browser=p(at);_containerRef=p(Ka);handle({externalItem:e}){let{hostElement:n,placeholder:i}=e,r=i(),a=r?this._fromTemplate(r):this._fromHost(n);return a.classList.add("f-external-item-placeholder"),a.style.pointerEvents="none",a}_fromTemplate(e){return sm(this._createViewRef(e),this._browser.document)}_fromHost(e){return rm(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}static \u0275fac=function(n){return new(n||pc)};static \u0275prov=y({token:pc,factory:pc.\u0275fac})};return t=P([R(fp)],t),t})(),mp=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(o){this.externalItem=o}},p9=(()=>{let t=class hc{_browser=p(at);_containerRef=p(Ka);handle({externalItem:e}){let{hostElement:n,preview:i}=e,r=i(),a=r?this._fromTemplate(r):this._fromHost(n);return this._setPreviewStyles(a),Jv(a),a.classList.add("f-external-item-preview"),a}_fromTemplate(e){return sm(this._createViewRef(e),this._browser.document)}_fromHost(e){return rm(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}_setPreviewStyles(e){am(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||hc)};static \u0275prov=y({token:hc,factory:hc.\u0275fac})};return t=P([R(mp)],t),t})(),_p=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(o){this.event=o}},f_=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(o,e,n,i){this.externalItemRect=o,this.data=e,this.targetContainerId=n,this.dropPosition=i,this.rect=o,this.fTargetNode=n,this.fDropPosition=i}},h9="external-item",f9="drag-external-item";function m9(t){return t.getEvent().kind===f9||t.getEvent().fEventType===h9}var _9=(()=>{let t=class fc{_result=p(hi);_mediator=p(V);_store=p(L);_dragSession=p(he);_browser=p(at);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let n=this._findExternalItemHandler();if(!n)return;let i=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),i,e.event.getPosition()),n.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>m9(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 zr);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,i){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new f_(this._getPreviewRect(),this._result.getData().externalItem.data(),n,n?i:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new it(this._result.getData().preview))}static \u0275fac=function(n){return new(n||fc)};static \u0275prov=y({token:fc,factory:fc.\u0275fac})};return t=P([R(_p)],t),t})(),m_=class{data;constructor(o){this.data=o}},gp=class extends Ft{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new m_(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=te.initialize();_pointerDownRect=te.initialize();_absoluteOffsetFromFlow=U.initialize();_grabOffsetFromPointer=U.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=o=>o;constructor(o,e,n){super(),this._externalItem=e,this._pointerDownClientPosition=n,this._store=o.get(L),this._result=o.get(hi),this._mediator=o.get(V),this._browser=o.get(at),this._originalDisplay=this._host.style.display,this._initConstraints(o)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(o){this._startRect=this._getStartRect();let e=new h_(o,this._startRect,Ky());this._applyConstraints=n=>e.limit(n)}_getStartRect(){return this._mediator.execute(new it(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=pe.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 o=this._host.parentNode;if(!o){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=o,this._originalNextSibling=this._host.nextSibling}_createPreview(){let o=this._mediator.execute(new mp(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(o,this._pointerDownRect),o.style.transform=Cy(this._pointerDownRect),o}_createPlaceholder(){return this._mediator.execute(new fp(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let o=this._originalParent,e=this._placeholderEl;if(!o||!e)return;let n=o.replaceChild(e,this._host);this._overlayRoot.appendChild(n),this._host.style.display="none"}onPointerMove(o,e){if(!this._previewEl)return;let n=this._resolveDeltaFromPointer(o,e),i=this._applyConstraints(n),r=pe.fromPoint(this._startRect).add(i),a=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=Cy(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 o=this._originalParent,e=this._placeholderEl;if(!(!o||!e)){if(e.parentNode===o){o.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===o?o.insertBefore(this._host,this._originalNextSibling):o.appendChild(this._host)}}_matchSize(o,e){o.style.width=`${e.width}px`,o.style.height=`${e.height}px`}_readAbsoluteRect(o){let e=o.getBoundingClientRect(),n=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return te.initialize(e.left+i,e.top+n,e.width,e.height)}_toAbsolutePoint(o){let e=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition);return pe.fromPoint(o).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(o,e){let n=e?.getPosition();if(!n)return o;let i=this._clientToAbsolute(n).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(i);return pe.fromPoint(r).sub(this._startRect)}_toFlowPoint(o){let e=this._getFlowHostAbsolutePosition(),n=pe.fromPoint(this._transform.position).add(this._transform.scaledPosition);return pe.fromPoint(o).sub(e).sub(n).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let o=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 U.initialize(o.left+n,o.top+e)}_clientToAbsolute(o){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return pe.fromPoint(o).add(U.initialize(n,e))}};function Cy({x:t,y:o}){return`translate3d(${Math.round(t)}px, ${Math.round(o)}px, 0)`}var bp=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}};function g9(t){return!!t.closest?.("[fExternalItem]")}function b9(t){return t.closest("[fExternalItem]")}var v9=(()=>{class t{_byHost=new Map;_items=X([]);items=E(()=>this._items());getByElement(e){let n=b9(e);return n?this._byHost.get(n):void 0}getByHost(e){return this._byHost.get(e)}register(e){let n=e.hostElement,i=this._byHost.get(n);i!==e&&(i&&i!==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 y9=(()=>{let t=class mc{_apiService=p(v9);_dragSession=p(he);_store=p(L);_injector=p(dt);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!an(e.originalEvent,n))return;let i=this._resolveExternalItem(e.targetElement);if(!i||i.disabled())return;let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new gp(this._injector,i,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(n){return new(n||mc)};static \u0275prov=y({token:mc,factory:mc.\u0275fac})};return t=P([R(bp)],t),t})(),vp=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(o){this.event=o}},C9=(()=>{let t=class _c{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let n=this._isExternalItem(e.target),i=this._isExternalItem(e.target.parentNode);return n||i}_isExternalItem(e){let n=!1;try{n=g9(e)}catch{}return n}static \u0275fac=function(n){return new(n||_c)};static \u0275prov=y({token:_c,factory:_c.\u0275fac})};return t=P([R(vp)],t),t})(),x9=[u9,p9,_9,y9,C9],w9=(()=>{let t=class gc{_mediator=p(V);_dragContext=p(he);_store=p(L);_dragInjector=p(Ct);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 i=this._sortedTargetsForDrop();if(n){let a=n.fParentId(),s=this._mediator.execute(new Yp(a));s.length&&(i=i.filter(c=>s.includes(c.node.fId())))}let r=this._dragInjector.get(zr);r.initialize(i),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof pi)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof gp)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),n=e.some(s=>s instanceof Km),i=this._withParents(e),a=this._eligibleTargets(i,n).map(s=>{let c=this._mediator.execute(new it(s.hostElement));return{node:s,rect:c}});return this._mediator.execute(new hp(a))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(n=>n instanceof pi);return e?e.items.map(n=>n.nodeOrGroup):[]}_withParents(e){return e.reduce((n,i)=>{n.push(i);let r=this._mediator.execute(new Ao(i));return n.push(...r),n},[])}_eligibleTargets(e,n){let i=this._allNodes.filter(r=>!e.includes(r));return n?i.filter(r=>r instanceof Km):i}static \u0275fac=function(n){return new(n||gc)};static \u0275prov=y({token:gc,factory:gc.\u0275fac})};return t=P([R(pp)],t),t})(),T9=[d9,w9,c9],yp=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(o){this.event=o}},S9=.5,Cp=(()=>{class t extends Ft{type="pinch-to-zoom";kind="pinch-to-zoom";_store=p(L);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(Xe.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=xy(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 i=xy(n.touches),r=k9(n.touches);if(i==null||r==null){this._reset();return}if(Math.abs(i-this._startDistance)<S9)return;n.preventDefault();let a=i/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 pe.fromPoint(e).elementTransform(this._flowHost)}_reset(){this._startScale=null,this._startDistance=null}onPointerUp(){this._reset(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function k9(t){if(t.length!==2)return null;let o=t[0],e=t[1];return U.initialize((o.clientX+e.clientX)/2,(o.clientY+e.clientY)/2)}function xy(t){if(t.length!==2)return null;let o=t[0],e=t[1];return Math.hypot(e.clientX-o.clientX,e.clientY-o.clientY)}var I9=(()=>{let t=class bc{_dragSession=p(he);handle(e){if(this._hasPinchZoomHandler())for(let n of this._dragSession.draggableItems)n.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Cp)}static \u0275fac=function(n){return new(n||bc)};static \u0275prov=y({token:bc,factory:bc.\u0275fac})};return t=P([R(yp)],t),t})(),xp=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(o){this.event=o}},E9=(()=>{let t=class vc{_dragInjector=p(Ct);_store=p(L);_dragSession=p(he);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new pe,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(Xe.ZOOM)}_getHandler(e){let n=this._dragInjector.get(Cp);return n.initialize(e.touches),n}static \u0275fac=function(n){return new(n||vc)};static \u0275prov=y({token:vc,factory:vc.\u0275fac})};return t=P([R(xp)],t),t})(),M9=[E9,I9],wp=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(o){this.event=o}},D9=(()=>{let t=class yc{_dragSession=p(he);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||yc)};static \u0275prov=y({token:yc,factory:yc.\u0275fac})};return t=P([R(wp)],t),t})(),__=(()=>{class t extends Ft{type="selection-area";kind="selection-area";_store=p(L);_dragSession=p(he);_mediator=p(V);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return pe.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(Xe.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new lh),this._show(),this._draw(te.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let n=pe.fromPoint(e).add(this._dragSession.onPointerDownPosition),i=this._getMinimumPoint(this._dragSession.onPointerDownPosition,n),r=Math.abs(e.x),a=Math.abs(e.y),s=te.initialize(i.x,i.y,r,a);this._draw(s),this._selectedByMove=[],this._canBeSelected.forEach(c=>{c.element.unmarkAsSelected();let u=te.addPoint(te.mult(c.fRect,this._transform.scale),this._canvasPosition);te.intersectionWithRect(u,s)&&(c.element.markAsSelected(),this._selectedByMove.push(c.element))}),this._mediator.execute(new si)}_getMinimumPoint(e,n){return U.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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Tp=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(o){this.event=o}},P9=(()=>{let t=class Cc{_store=p(L);_dragSession=p(he);_dragInjector=p(Ct);get _instance(){return this._store.instances.get(Xe.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(__)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&an(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(n){return new(n||Cc)};static \u0275prov=y({token:Cc,factory:Cc.\u0275fac})};return t=P([R(Tp)],t),t})(),R9=[P9,D9],Sp=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(o,e){this.rect=o,this.childrenBounds=e}},O9=(()=>{let t=class xc{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 i=e.x-n.x;i>0&&(e.x-=i,e.width+=i)}_restrictTop(e,n){let i=e.y-n.y;i>0&&(e.y-=i,e.height+=i)}_restrictRight(e,n){let i=n.x+n.width;e.x+e.width<=i&&(e.width=i-e.x)}_restrictBottom(e,n){let i=n.y+n.height;e.y+e.height<=i&&(e.height=i-e.y)}static \u0275fac=function(n){return new(n||xc)};static \u0275prov=y({token:xc,factory:xc.\u0275fac})};return t=P([R(Sp)],t),t})(),kp=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(o,e){this.rect=o,this.limits=e}},F9=(()=>{let t=class wc{_mediator=p(V);handle({rect:e,limits:n}){this._applyResizeConstraints(e,n)}_applyResizeConstraints(e,n){if(!n)return;let i=this._clampedCopyForCalculation(e,n);this._applySoftParentExpansions(i,n.softLimits),n.hardLimit&&this._clampRectToInner(e,n.hardLimit.innerRect)}_clampedCopyForCalculation(e,n){let i=ge({},e);return n.hardLimit&&this._clampRectToInner(i,n.hardLimit.innerRect),i}_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 i=n.x+n.width;e.x+e.width>i&&(e.width=i-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 i of n)this._expandParentFromOriginalIfOverflow(e,i)}_expandParentFromOriginalIfOverflow(e,n){let i=n.innerRect,r=n.boundingRect,a=this._computeOverflow(i,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 i=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:i,top:r,right:a,bottom:s}}_buildExpandedParentRect(e,n){let i=ge({},e);return n.left&&(i.x=e.x-n.left,i.width=e.width+n.left),n.top&&(i.y=e.y-n.top,i.height=e.height+n.top),n.right&&(i.width=(i.width??e.width)+n.right),n.bottom&&(i.height=(i.height??e.height)+n.bottom),i}_applyParentRect(e,n){e.nodeOrGroup.updatePosition(n),e.nodeOrGroup.updateSize(n),this._mediator.execute(new Vi(e.nodeOrGroup.fId(),n)),e.nodeOrGroup.redraw()}static \u0275fac=function(n){return new(n||wc)};static \u0275prov=y({token:wc,factory:wc.\u0275fac})};return t=P([R(kp)],t),t})(),Ip=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(o,e,n,i){this.originalRect=o,this.difference=e,this.handleType=n,this.minimumSize=i}},wy={[In.LEFT]:{x:-1,y:0},[In.LEFT_TOP]:{x:-1,y:-1},[In.TOP]:{x:0,y:-1},[In.RIGHT_TOP]:{x:1,y:-1},[In.RIGHT]:{x:1,y:0},[In.RIGHT_BOTTOM]:{x:1,y:1},[In.BOTTOM]:{x:0,y:1},[In.LEFT_BOTTOM]:{x:-1,y:1}},N9=(()=>{let t=class Tc{handle({originalRect:e,difference:n,handleType:i,minimumSize:r}){let a=this._changeSizeInRect(e,n,wy[i],r);return this._changePosition(e,n,wy[i],a)}_changeSizeInRect(e,n,i,r){let a=e.width+i.x*n.x,s=e.height+i.y*n.y,c=0,u=0;return a<0&&(c=a,a=Math.abs(a)),a<r.width&&(i.x===-1&&(c+=a-r.width),a=r.width),s<0&&(u=s,s=Math.abs(s)),s<r.height&&(i.y===-1&&(u+=s-r.height),s=r.height),te.initialize(c,u,a,s)}_changePosition(e,n,i,r){let a=e.x+(i.x===-1?n.x:0)+r.x,s=e.y+(i.y===-1?n.y:0)+r.y;return te.initialize(a,s,r.width,r.height)}static \u0275fac=function(n){return new(n||Tc)};static \u0275prov=y({token:Tc,factory:Tc.\u0275fac})};return t=P([R(Ip)],t),t})(),Ep=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(o,e){this.nodeOrGroup=o,this.paddings=e}},A9=(()=>{let t=class Sc{_mediator=p(V);_store=p(L);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:n}){let i=te.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return i?this._concatRectWithParentPadding(i,n):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(n=>n.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new it(e.hostElement))}_concatRectWithParentPadding(e,n){return te.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||Sc)};static \u0275prov=y({token:Sc,factory:Sc.\u0275fac})};return t=P([R(Ep)],t),t})(),$r=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(o,e){this.nodeOrGroup=o,this.rect=e}},L9=(()=>{let t=class kc{_mediator=p(V);handle({nodeOrGroup:e,rect:n}){let i=this._getParentsChain(e),r=this._calculateNodePaddings(e,n);return{limits:this._buildSoftHardLimits(i),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:Ot.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,n){return this._mediator.execute(new Gi(e,n))}_getNormalizedChildrenBounds(e,n){return this._mediator.execute(new Ep(e,n))}_getParentsChain(e){return this._mediator.execute(new Ao(e))??[]}_buildSoftHardLimits(e){let n=[],i,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{i=this._makeLimit(a,s);break}}return{softLimits:n,hardLimit:i}}_getParentInfo(e,n){return this._mediator.execute(new Hr(e,n))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:n,innerRect:i}){return{nodeOrGroup:e,boundingRect:n,innerRect:i}}static \u0275fac=function(n){return new(n||kc)};static \u0275prov=y({token:kc,factory:kc.\u0275fac})};return t=P([R($r)],t),t})(),Mp=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(o){this.event=o}},aC="node-resize",sC="resize-node";function B9(t){return t.getEvent().kind===sC||t.getEvent().fEventType===aC}var V9=(()=>{let t=class Ic{_dragSession=p(he);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(n=>n.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>B9(e))}static \u0275fac=function(n){return new(n||Ic)};static \u0275prov=y({token:Ic,factory:Ic.\u0275fac})};return t=P([R(Mp)],t),t})(),g_=class{fNodeId;constructor(o){this.fNodeId=o}},b_=(()=>{class t extends Ft{type=aC;kind=sC;data(){return new g_(this._nodeOrGroup.fId())}_mediator=p(V);_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 i of this._softParentConnections)this._applyConnectionHandlers(i);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 it(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new $r(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new Ip(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Sp(e,this._constraints.childrenBounds)),this._mediator.execute(new kp(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 Vi(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return te.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 i of e.source){let r=this._readConnectorRect(i.connector,n);i.handler.setSourceRect(r)}for(let i of e.target){let r=this._readConnectorRect(i.connector,n);i.handler.setTargetRect(r)}}_readConnectorRect(e,n){let i=`${e.kind}::${e.fId()}`,r=n.get(i);if(r)return r;let a=this._mediator.execute(new di(e.hostElement,!1));return n.set(i,a),a}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Wr=class{_mediator=p(V);_store=p(L);_behaviour=p(Ho);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(o){this.connection=o,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=rt.fromRoundedRect(this._sourceRef.rect),this._targetRect=rt.fromRoundedRect(this._targetRef.rect)}setSourceRect(o){this._sourceRect=rt.fromRoundedRect(o),this._mediator.execute(new Bi(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(o){this._targetRect=rt.fromRoundedRect(o),this._mediator.execute(new Bi(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let o=this._buildLine();this.connection.setLine(o),this.connection.redraw()}_buildLine(){let o=rt.fromRoundedRect(this._sourceRect),e=rt.fromRoundedRect(this._targetRect);return this._behaviour.handle(new vn(o,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(o){return{connector:o,rect:this._mediator.execute(new di(o.hostElement,!1))}}_resolveRotationContext(o){return this._mediator.execute(new zn(o))}},z9=(()=>{class t extends Wr{_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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),H9=(()=>{class t extends Wr{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),q9=(()=>{class t extends Wr{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Dp=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},Pp=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(o,e){this.handler=o,this.nodeOrGroup=e}},G9=(()=>{let t=class Ec{_store=p(L);_mediator=p(V);_dragInjector=p(Ct);handle({handler:e,nodeOrGroup:n}){let i=this._readSoftParents(n),r=[n,...i],a=this._collectSourceConnectorIds(r),s=this._collectTargetConnectorIds(r),c=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(n,a,s,c)),e.setSoftParentConnectionHandlers(i.map(u=>this._buildConnectionHandlersForNode(u,a,s,c)))}_readSoftParents(e){let n=this._mediator.execute(new it(e.hostElement));return this._mediator.execute(new $r(e,n)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let n=new Set(e.map(i=>i.fId()));return new Set(this._store.outputs.getAll().filter(i=>n.has(i.fNodeId)).map(i=>i.fId()))}_collectTargetConnectorIds(e){let n=new Set(e.map(i=>i.fId()));return new Set(this._store.inputs.getAll().filter(i=>n.has(i.fNodeId)).map(i=>i.fId()))}_buildConnectionHandlersForNode(e,n,i,r){let a=this._store.outputs.getAll().filter(g=>g.fNodeId===e.fId()),s=this._store.inputs.getAll().filter(g=>g.fNodeId===e.fId());if(!a.length&&!s.length)return{source:[],target:[]};let c=new Set(a.map(g=>g.fId())),u=new Set(s.map(g=>g.fId())),h={source:[],target:[]};for(let g of this._store.connections.getAll()){let C=c.has(g.fOutputId()),k=u.has(g.fInputId());if(!C&&!k)continue;let I=r.get(g.fId())??this._createConnectionHandler(g,n,i);if(r.set(g.fId(),I),C){let N=this._store.outputs.require(g.fOutputId());h.source.push({handler:I,connector:N})}if(k){let N=this._store.inputs.require(g.fInputId());h.target.push({handler:I,connector:N})}}return h}_createConnectionHandler(e,n,i){let r=n.has(e.fOutputId()),a=i.has(e.fInputId()),s=r&&a?this._dragInjector.createInstance(z9):r?this._dragInjector.createInstance(H9):this._dragInjector.createInstance(q9);return s.initialize(e),s}static \u0275fac=function(n){return new(n||Ec)};static \u0275prov=y({token:Ec,factory:Ec.\u0275fac})};return t=P([R(Pp)],t),t})(),j9=(()=>{let t=class Mc{_mediator=p(V);_store=p(L);_dragSession=p(he);_dragInjector=p(Ct);get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!an(e.originalEvent,n))return;let i=this._findResizableNode(e.targetElement);if(!i)return;this._selectBeforeResize(i);let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let a=this._dragInjector.createInstance(b_);a.initialize(i,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new Pp(a,i)),this._dragSession.draggableItems=[a]}_isResizeHandle(e){return xr(e,".f-resize-handle")}_findResizableNode(e){let n=this._store.nodes.getAll().find(i=>i.isContains(e));if(n)return n.fDraggingDisabled()?void 0:n}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Vo(e))})}_readResizeHandleType(e){let n=ey(e,"fResizeHandleType",".f-resize-handle");return In[n]}static \u0275fac=function(n){return new(n||Mc)};static \u0275prov=y({token:Mc,factory:Mc.\u0275fac})};return t=P([R(Dp)],t),t})(),U9=[O9,F9,N9,A9,L9,G9,V9,j9],Rp=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(o){this.event=o}},lC="node-rotate",cC="rotate-node";function $9(t){return t.getEvent().kind===cC||t.getEvent().fEventType===lC}var W9=(()=>{let t=class Dc{_dragSession=p(he);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>$9(e))}static \u0275fac=function(n){return new(n||Dc)};static \u0275prov=y({token:Dc,factory:Dc.\u0275fac})};return t=P([R(Rp)],t),t})(),Op=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},v_=class{fNodeId;constructor(o){this.fNodeId=o}};function K9(t,o,e){let{x:n,y:i}=Y9(t,o,e),r=n-t.x,a=i-t.y;return{x:r,y:a}}function Y9(t,o,e){let n=t.x-e.x,i=t.y-e.y,r=o*Math.PI/180,a=Math.cos(r),s=Math.sin(r),c=n*a-i*s,u=n*s+i*a,h=c+e.x,g=u+e.y;return{x:h,y:g}}var y_=(()=>{class t extends Ft{type=lC;kind=cC;data(){return new v_(this._nodeOrGroup.fId())}_store=p(L);_mediator=p(V);_dragSession=p(he);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,n,i){this._nodeOrGroup=e,this._sourceConnections=n,this._targetConnections=i,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=U.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 it(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return U.sub(this._dragSession.onPointerDownPosition,U.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 K9(e,n,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),X9=(()=>{let t=class Pc{_mediator=p(V);_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);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 i=this._transform.scale;this._dragContext.onPointerDownScale=i,this._dragContext.onPointerDownPosition=pe.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(i);let r=this._dragInjector.createInstance(y_);r.initialize(n,this._buildOutputConnectionHandlers(n),this._buildInputConnectionHandlers(n)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:n}){return this._dragContext.isEmpty()&&vB(e.targetElement)&&an(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 Vo(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new Vp(e)).map(n=>{let i=this._store.inputs.require(n.fInputId()),r=this._mediator.execute(new Kt(i)),a=this._dragInjector.get(Ur);return a.initialize(n),{connection:a,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new Kp(e)).map(n=>{let i=this._store.outputs.require(n.fOutputId()),r=this._mediator.execute(new Kt(i)),a=this._dragInjector.get(Gr);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=P([R(Op)],t),t})(),Z9=[W9,X9],Kr=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(o,e,n,i){this.flowRect=o,this.canvasPosition=e,this.eventPoint=n,this.minimap=i}},Q9=(()=>{let t=class Rc{_store=p(L);get _canvasScale(){return this._store.transform.scale||1}handle(e){return U.sub(e.canvasPosition,U.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return pe.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,n){let i=this.normalizeEventPoint(e,n);return U.sum(i,te.mult(n.viewBox,this._canvasScale))}normalizeEventPoint(e,n){return this._getEventPointInMinimap(e,n).mult(n.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,n){return pe.fromPoint(e).elementTransform(n.element)}static \u0275fac=function(n){return new(n||Rc)};static \u0275prov=y({token:Rc,factory:Rc.\u0275fac})};return t=P([R(Kr)],t),t})(),Fp=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(o){this.event=o}},J9=(()=>{let t=class Oc{_dragSession=p(he);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(eV)}static \u0275fac=function(n){return new(n||Oc)};static \u0275prov=y({token:Oc,factory:Oc.\u0275fac})};return t=P([R(Fp)],t),t})(),dC="minimap",uC="minimap";function eV(t){return t.getEvent().kind===uC||t.getEvent().fEventType===dC}var C_=(()=>{class t extends Ft{type=dC;kind=uC;_store=p(L);_mediator=p(V);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,n,i,r){this._flowRect=e,this._startCanvasPosition=n,this._eventPoint=i,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(pe.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 Kr(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(i){return(e||(e=G(t)))(i||t)}})();static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),Np=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(o){this.event=o}},tV=(()=>{let t=class Fc{_store=p(L);_mediator=p(V);_dragSession=p(he);_dragInjector=p(Ct);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(Xe.MINIMAP).state,i=e.getPosition(),r=pe.fromPoint(this._store.transform.position),a=te.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(a,i,n)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=pe.fromPoint(i).elementTransform(this._flowHost);let s=this._dragInjector.createInstance(C_);s.initialize(a,r,i,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(Xe.MINIMAP))}_calculateCanvasPosition(e,n,i){return this._mediator.execute(new Kr(e,pe.fromPoint(this._canvas.transform.position),n,i))}static \u0275fac=function(n){return new(n||Fc)};static \u0275prov=y({token:Fc,factory:Fc.\u0275fac})};return t=P([R(Np)],t),t})(),nV=[Q9,J9,tV];function iV(t){return!!t&&typeof t.destroy=="function"}var Ct=(()=>{class t{_injector=p(dt);_dragInjector=null;_created=[];create(){this._dragInjector=dt.create({providers:[{provide:Ap,useClass:Ap},{provide:Xu,useClass:Xu},{provide:Hu,useClass:Hu},{provide:Jm,useClass:Jm},{provide:zr,useClass:zr},{provide:Gr,useClass:Gr},{provide:Ur,useClass:Ur},{provide:jr,useClass:jr},{provide:pi,useClass:pi},{provide:Cp,useClass:Cp},{provide:__,useClass:__},{provide:b_,useClass:b_},{provide:y_,useClass:y_},{provide:C_,useClass:C_}],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=C0(this._dragInjector,()=>new e);return this._created.push(n),n}destroy(){for(let e of this._created)iV(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})(),hi=(()=>{class t{_data;setData(e){this._data=ge(ge({},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})(),Ty="f-canvas-dragging",Sy="canvas-dragging",Ap=(()=>{class t extends Ft{type="canvas-move";kind="drag-canvas";_store=p(L);_onPointerDownPosition=U.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(Ty,Sy)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(pe.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(Ty,Sy)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),oV=(()=>{let t=class Nc{_dragContext=p(he);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(n=>n.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Ap)}static \u0275fac=function(n){return new(n||Nc)};static \u0275prov=y({token:Nc,factory:Nc.\u0275fac})};return t=P([R(Au)],t),t})(),Lp=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(o,e){this.event=o,this.fTrigger=e}},rV=(()=>{let t=class Ac{_store=p(L);_dragContext=p(he);_dragInjector=p(Ct);handle({event:e,fTrigger:n}){!this._isValid(e)||!this._isValidTrigger(e,n)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=pe.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Ap)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(Xe.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let n=this._store.nodes.getAll().find(i=>i.isContains(e));return n&&n.fDraggingDisabled()&&(n=void 0),n}_isValidTrigger(e,n){return an(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Ac)};static \u0275prov=y({token:Ac,factory:Ac.\u0275fac})};return t=P([R(Lp)],t),t})(),aV=[oV,rV],Bp=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(o,e){this.event=o,this.trigger=e}},sV=(()=>{let t=class Lc{_mediator=p(V);_store=p(L);_dragSession=p(he);handle({event:e,trigger:n}){if(!this._isSelectionAllowed(e))return;let i=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(i),an(e.originalEvent,n)?this._applyToggleSelect(i):this._applySingleSelect(i)}_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 ji(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||Lc)};static \u0275prov=y({token:Lc,factory:Lc.\u0275fac})};return t=P([R(Bp)],t),t})(),lV=[sV];var x_=class extends qm{hostElement=p(Qe).nativeElement};function cV(t){return xr(t,".f-drag-blocker")}var pC=(()=>{class t extends x_{_result=p(hi);_mediator=p(V);_platform=p(im);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===ii.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=gn;fCreateConnectionTrigger=gn;fConnectionWaypointsTrigger=B(gn);fMoveControlPointTrigger=gn;fNodeResizeTrigger=gn;fNodeRotateTrigger=gn;fNodeMoveTrigger=gn;fCanvasMoveTrigger=gn;fExternalItemTrigger=gn;fSelectionChange=new ne;fNodeIntersectedWithConnections=new ne;fNodeConnectionsIntersection=Ke();fEmitOnNodeIntersect=!1;fCreateNode=new ne;fMoveNodes=new ne;fReassignConnection=new ne;fCreateConnection=new ne;fConnectionWaypointsChanged=Ke();fDropToGroup=new ne;vCellSize=B(1,{transform:e=>xe(e,1)});hCellSize=B(1,{transform:e=>xe(e,1)});fCellSizeWhileDragging=B(!1,{transform:e=>j(e)});fDragStarted=new ne;fDragEnded=new ne;_dragHandlerInjector=p(Ct);ngOnInit(){this._mediator.execute(new qp(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(cV(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new jp),this._mediator.execute(new Tp(e)),this._mediator.execute(new Np(e)),this._mediator.execute(new xp(e)),this._mediator.execute(new Bp(e,this.fMultiSelectTrigger)),this._mediator.execute(new $u(e,this.fReassignConnectionTrigger)),this._mediator.execute(new ju(e,this.fCreateConnectionTrigger)),this._mediator.execute(new Zu(e,this.fConnectionWaypointsTrigger()));let n=e.isMouseLeftButton();return n||this.finalizeDragSequence(),n}prepareDragSequence(e){this._mediator.execute(new Dp(e,this.fNodeResizeTrigger)),this._mediator.execute(new Op(e,this.fNodeRotateTrigger)),this._mediator.execute(new up(e,this.fNodeMoveTrigger)),this._mediator.execute(new bp(e,this.fExternalItemTrigger)),this._mediator.execute(new pp(e)),this._mediator.execute(new Lp(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Up)}onSelect(e){this._mediator.execute(new vp(e))}onPointerMove(e){this._mediator.execute(new Gp(e))}onPointerUp(e){this._mediator.execute(new Fp(e)),this._mediator.execute(new wp(e)),this._mediator.execute(new Uu(e)),this._mediator.execute(new zu(e)),this._mediator.execute(new Mp(e)),this._mediator.execute(new Rp(e)),this._mediator.execute(new dp(e)),this._mediator.execute(new _p(e)),this._mediator.execute(new Qu(e)),this._mediator.execute(new Au(e)),this._mediator.execute(new yp(e)),this._mediator.execute(new Ku(e)),this._mediator.execute(new Du)}finalizeDragSequence(){this._mediator.execute(new ui),this._mediator.execute(new Ar),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new ui),this._mediator.execute(new $p),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",j],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",j],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:[ke([hi,Ct]),Z]})}return t})(),dV=[...aV,...zB,...lB,...lV,...x9,..._B,...nV,...l9,...T9,...U9,...Z9,...R9,...M9],uV=(()=>{let t=class Bc{_store=p(L);handle({waypointIndex:e,connectionId:n}){let i=this._store.connections.require(n),r=i.fWaypoints()?.waypoints().slice();if(!r)throw new Error("Connection waypoints not found");r.splice(e,1),i.fWaypoints()?.waypoints.set(r),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._changeEvent(i))}_changeEvent(e){return new Yu(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(n){return new(n||Bc)};static \u0275prov=y({token:Bc,factory:Bc.\u0275fac})};return t=P([R(Bm)],t),t})(),w_=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},pV=(()=>{let t=class Vc{_store=p(L);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(n){return new(n||Vc)};static \u0275prov=y({token:Vc,factory:Vc.\u0275fac})};return t=P([R(w_)],t),t})(),hV=[Th,Ui,a6,s6,l6,c6,t7,P7,a7,S7,V7,B7,D7,H7,G7,q7,M7,A7,s7,W7,E7,I7,k7,y7,T7,C7,x7,z7,F7,j7,U7,L7,N7,$7,K7,Y7,X7,pV,uV],Yr=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(o){this.instance=o}},fV=(()=>{let t=class zc{_store=p(L);_mediator=p(V);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 du(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(n){return new(n||zc)};static \u0275prov=y({token:zc,factory:zc.\u0275fac})};return t=P([R(Yr)],t),t})(),qi=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(o,e){this.position=o,this.connectorRefs=e}},mV=(()=>{let t=class Hc{handle({position:e,connectorRefs:n}){let i,r=1/0;for(let a of n){let s=this._distanceToRect(e,a.rect);s<r&&(r=s,i=a)}return i?Dt(ge({},i),{distance:r}):void 0}_distanceToRect(e,{x:n,y:i,width:r,height:a}){let s=this._clamp(e.x,n,n+r),c=this._clamp(e.y,i,i+a),u=e.x-s,h=e.y-c;return Math.sqrt(u*u+h*h)}_clamp(e,n,i){return Math.max(n,Math.min(i,e))}static \u0275fac=function(n){return new(n||Hc)};static \u0275prov=y({token:Hc,factory:Hc.\u0275fac})};return t=P([R(qi)],t),t})(),Xr=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(o,e){this.pointerPosition=o,this.connectableConnectors=e}},_V=(()=>{let t=class qc{_mediator=p(V);_store=p(L);_browser=p(at);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 i=this._isSnapConnectionEnabledAndHasClosestConnector(e);i&&n.unshift(i.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&n.push(r),n}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(n=>te.isIncludePoint(n.rect,this._calculatePointerInFlow(e.pointerPosition))).map(n=>n.connector)}_calculatePointerInFlow(e){return qo(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let n=this._mediator.execute(new qi(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(i=>i.connector.fNodeId===n.fId())?.connector}static \u0275fac=function(n){return new(n||qc)};static \u0275prov=y({token:qc,factory:qc.\u0275fac})};return t=P([R(Xr)],t),t})(),Zr=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(o,e){this.source=o,this.pointer=e}},Kt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(o){this.connector=o}},gV=(()=>{let t=class Gc{_mediator=p(V);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new di(e.hostElement))}static \u0275fac=function(n){return new(n||Gc)};static \u0275prov=y({token:Gc,factory:Gc.\u0275fac})};return t=P([R(Kt)],t),t})(),Qr=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(o){this.nodeOrGroup=o}},bV=(()=>{let t=class jc{_store=p(L);_mediator=p(V);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new uu(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||jc)};static \u0275prov=y({token:jc,factory:jc.\u0275fac})};return t=P([R(Qr)],t),t})(),Vp=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(o){this.nodeOrGroup=o}},vV=(()=>{let t=class Uc{_store=p(L);handle({nodeOrGroup:e}){let n=this._collectInputIds(e);return this._collectConnections(n)}_collectInputIds(e){let n=new Set,i=this._store.inputs.getAll();for(let r of i)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],i=this._store.connections.getAll();for(let r of i)e.has(r.fInputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||Uc)};static \u0275prov=y({token:Uc,factory:Uc.\u0275fac})};return t=P([R(Vp)],t),t})(),Oo=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(o,e){this.connector=o,this.pointerPosition=e}},ky=2,Et=(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})(Et||{});function yV(t,o,e,n,i){let r=CV(i),a=e-t,s=n-o,c=xV(a,s);return wV(c,r)?c:TV(a,s,r,c)}function CV(t){if(!t||t.length===0)return Et.ALL;let o=Et.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case K.LEFT:o|=Et.LEFT;break;case K.RIGHT:o|=Et.RIGHT;break;case K.TOP:o|=Et.TOP;break;case K.BOTTOM:o|=Et.BOTTOM;break}return o||Et.ALL}function xV(t,o){let e=t<0?-t:t,n=o<0?-o:o;return e-n>ky?t<0?K.LEFT:K.RIGHT:(n-e>ky,o<0?K.TOP:K.BOTTOM)}function wV(t,o){switch(t){case K.LEFT:return(o&Et.LEFT)!==0;case K.RIGHT:return(o&Et.RIGHT)!==0;case K.TOP:return(o&Et.TOP)!==0;case K.BOTTOM:return(o&Et.BOTTOM)!==0;default:return!0}}function TV(t,o,e,n){let i=n,r=-1/0;if(e&Et.RIGHT){let a=t;a>r&&(r=a,i=K.RIGHT)}if(e&Et.LEFT){let a=-t;a>r&&(r=a,i=K.LEFT)}if(e&Et.BOTTOM){let a=o;a>r&&(r=a,i=K.BOTTOM)}if(e&Et.TOP){let a=-o;a>r&&(r=a,i=K.TOP)}return i}function zp(t){return t===K.CALCULATE||t===K.CALCULATE_HORIZONTAL||t===K.CALCULATE_VERTICAL}var SV={[K.CALCULATE]:[K.TOP,K.BOTTOM,K.LEFT,K.RIGHT],[K.CALCULATE_HORIZONTAL]:[K.LEFT,K.RIGHT],[K.CALCULATE_VERTICAL]:[K.TOP,K.BOTTOM]},kV=(()=>{let t=class $c{_mediator=p(V);handle({connector:e,pointerPosition:n}){let i=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 yV(r.x,r.y,s,c,SV[i])}_accumulateConnectedCenters(e,n,i){let r=i?.x||0,a=i?.y||0,s=i?1:0;if(n&&n.length)for(let c=0;c<n.length;c++){let u=n[c].hostElement;if(u===e)continue;let h=this._getConnectorRect(u).gravityCenter;r+=h.x,a+=h.y,s++}return{sumX:r,sumY:a,count:s}}_getConnectorRect(e){return this._mediator.execute(new it(e))}static \u0275fac=function(n){return new(n||$c)};static \u0275prov=y({token:$c,factory:$c.\u0275fac})};return t=P([R(Oo)],t),t})(),Hp=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(o){this.connector=o}},qp=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(o){this.fComponent=o}},IV=(()=>{let t=class Wc{_store=p(L);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(n){return new(n||Wc)};static \u0275prov=y({token:Wc,factory:Wc.\u0275fac})};return t=P([R(qp)],t),t})(),Gp=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(o){this.event=o}},EV=(()=>{let t=class Kc{_mediator=p(V);_store=p(L);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=p(he);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new Lr)}_setDifferenceToDraggableItems(e,n){this._dragContext.draggableItems.forEach(i=>{i.onPointerMove(ge({},e),n)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return pe.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(n){return new(n||Kc)};static \u0275prov=y({token:Kc,factory:Kc.\u0275fac})};return t=P([R(Gp)],t),t})(),jp=class{static fToken=Symbol("InitializeDragSequenceRequest")},MV=(()=>{let t=class Yc{_dragContext=p(he);handle(e){this._dragContext.reset()}static \u0275fac=function(n){return new(n||Yc)};static \u0275prov=y({token:Yc,factory:Yc.\u0275fac})};return t=P([R(jp)],t),t})(),fi=class{static fToken=Symbol("IsDragStartedRequest")},DV=(()=>{let t=class Xc{_store=p(L);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(n){return new(n||Xc)};static \u0275prov=y({token:Xc,factory:Xc.\u0275fac})};return t=P([R(fi)],t),t})(),Up=class{static fToken=Symbol("PrepareDragSequenceRequest")},PV=(()=>{let t=class Zc{_mediator=p(V);_dragContext=p(he);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new Pu)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(n){return new(n||Zc)};static \u0275prov=y({token:Zc,factory:Zc.\u0275fac})};return t=P([R(Up)],t),t})(),$p=class{static fToken=Symbol("RemoveDndFromStoreRequest")},RV=(()=>{let t=class Qc{_store=p(L);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(n){return new(n||Qc)};static \u0275prov=y({token:Qc,factory:Qc.\u0275fac})};return t=P([R($p)],t),t})(),OV=[IV,EV,MV,PV,DV,RV],FV=new be("CONNECTABLE_SIDE_EPSILON"),NV=(()=>{let t=class Jc{_mediator=p(V);_lastSide=new WeakMap;_epsilon=Math.max(0,p(FV,{optional:!0})??2);handle({connector:e}){if(this._isDragging()){let i=this._lastSide.get(e);if(i!==void 0)return i;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,i){let r=te.fromElement(e),a=n.getBoundingClientRect(),s=r.gravityCenter.x,c=r.gravityCenter.y,u=s-a.left,h=a.right-s,g=c-a.top,C=a.bottom-c,k=0,I=u,N=[u,h,g,C];for(let ee=1;ee<4;ee++){let ce=N[ee];ce<I&&(I=ce,k=ee)}let q=k===0?K.LEFT:k===1?K.RIGHT:k===2?K.TOP:K.BOTTOM,Y=this._lastSide.get(i);if(Y!==void 0&&Y!==q){let ee=Y===K.LEFT?0:Y===K.RIGHT?1:Y===K.TOP?2:3;(ee===0?u:ee===1?h:ee===2?g:C)-I<=this._epsilon&&(q=Y)}return q}_isDragging(){return this._mediator.execute(new fi)}static \u0275fac=function(n){return new(n||Jc)};static \u0275prov=y({token:Jc,factory:Jc.\u0275fac})};return t=P([R(Hp)],t),t})(),Fo=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(o){this.nodeOrGroup=o}},AV=(()=>{let t=class ed{_mediator=p(V);handle({nodeOrGroup:e}){let n=e.connectors,i=n.length;for(let a=0;a<i;a++){let s=n[a];s.fConnectableSide=this._resolveSideForConnectorFast(s)}let r=new Set;for(let a=0;a<i;a++){let c=n[a].toConnector;if(c&&c.length)for(let u=0,h=c.length;u<h;u++){let g=c[u],C=g.userFConnectableSide;zp(C)&&r.add(g)}}r.size>0&&r.forEach(a=>{a.fConnectableSide=this._calculateByConnectedPositions(a)})}_resolveSideForConnectorFast(e){let n=e.userFConnectableSide;return n===K.AUTO?this._mediator.execute(new Hp(e)):zp(n)?this._calculateByConnectedPositions(e):n}_calculateByConnectedPositions(e){return this._mediator.execute(new Oo(e))}static \u0275fac=function(n){return new(n||ed)};static \u0275prov=y({token:ed,factory:ed.\u0275fac})};return t=P([R(Fo)],t),t})(),No=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},LV=(()=>{let t=class td{_store=p(L);handle(e){return te.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>te.fromElement(e.hostElement))}static \u0275fac=function(n){return new(n||td)};static \u0275prov=y({token:td,factory:td.\u0275fac})};return t=P([R(No)],t),t})(),Wp=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(o){this.fNodes=o}},BV=(()=>{let t=class nd{_store=p(L);_mediator=p(V);handle(e){return te.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 Po(e.hostElement));if(n)return this._getElementRect(e,n);let i=this._mediator.execute(new it(e.hostElement));return this._getElementRect(e,i)}_getElementRect(e,n){return te.initialize(e._position.x,e._position.y,n.width,n.height)}static \u0275fac=function(n){return new(n||nd)};static \u0275prov=y({token:nd,factory:nd.\u0275fac})};return t=P([R(Wp)],t),t})(),Kp=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(o){this.nodeOrGroup=o}},VV=(()=>{let t=class id{_store=p(L);handle({nodeOrGroup:e}){let n=this._collectOutputIds(e);return this._collectConnections(n)}_collectOutputIds(e){let n=new Set,i=this._store.outputs.getAll();for(let r of i)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],i=this._store.connections.getAll();for(let r of i)e.has(r.fOutputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||id)};static \u0275prov=y({token:id,factory:id.\u0275fac})};return t=P([R(Kp)],t),t})(),Jr=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(o){this.nodeOrGroup=o}},Gi=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(o,e){this.fNode=o,this.rect=e}},zV=(()=>{let t=class od{_browser=p(at);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,n){let i=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(i.paddingLeft,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingTop,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingRight,n.width,n.height,i.fontSize),this._browser.toPixels(i.paddingBottom,n.width,n.height,i.fontSize)]}static \u0275fac=function(n){return new(n||od)};static \u0275prov=y({token:od,factory:od.\u0275fac})};return t=P([R(Gi)],t),t})(),HV=(()=>{let t=class rd{_mediator=p(V);_store=p(L);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 i=this._nodes.find(r=>r.fId()===n);i&&this._mediator.execute(new Jr(i))}_calculateDirectChildren(e){return this._nodes.filter(n=>n.fParentId()===e.fId())}_unionRect(e){return te.union(e.map(n=>this._boundingRect(n)))||te.initialize()}_boundingRect(e){return this._mediator.execute(new it(e.hostElement))}_paddings(e,n){return this._mediator.execute(new Gi(e,n))}_calculateChildrenBounding(e,[n,i,r,a]){let s=this._unionRect(e);return s=te.initialize(s.x-n,s.y-i,s.width+n+r,s.height+i+a),s}static \u0275fac=function(n){return new(n||rd)};static \u0275prov=y({token:rd,factory:rd.\u0275fac})};return t=P([R(Jr)],t),t})(),Yp=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(o){this.id=o}},qV=(()=>{let t=class ad{_store=p(L);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let n=new Set,i=[];return this._collectDescendants(e.id,i,n),i}_collectDescendants(e,n,i){if(i.has(e))throw new Error(`Circular reference detected in the node hierarchy. Node id: ${e}`);i.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,i)}static \u0275fac=function(n){return new(n||ad)};static \u0275prov=y({token:ad,factory:ad.\u0275fac})};return t=P([R(Yp)],t),t})(),Ao=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(o){this.nodeOrGroup=o}},GV=(()=>{let t=class sd{_store=p(L);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,n,i){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?(i.push(r),this._getParentNodes(r,n,i)):i}static \u0275fac=function(n){return new(n||sd)};static \u0275prov=y({token:sd,factory:sd.\u0275fac})};return t=P([R(Ao)],t),t})(),ea=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(o,e){this.nodeOrGroup=o,this.destroyRef=e}},jV=(()=>{let t=class ld{_mediator=p(V);handle({nodeOrGroup:e,destroyRef:n}){let{hostElement:i,stateChanges:r}=e;new En(new gm(i),r).listen(n,()=>{this._mediator.execute(new Ai),this._isDragging()||(this._mediator.execute(new Do(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new Fo(e)),this._mediator.execute(new Jr(e)))})}_isDragging(){return this._mediator.execute(new fi)}static \u0275fac=function(n){return new(n||ld)};static \u0275prov=y({token:ld,factory:ld.\u0275fac})};return t=P([R(ea)],t),t})(),ta=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(o){this.instance=o}},UV=(()=>{let t=class cd{_store=p(L);_mediator=p(V);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new pu(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||cd)};static \u0275prov=y({token:cd,factory:cd.\u0275fac})};return t=P([R(ta)],t),t})(),$V=[bV,kV,NV,vV,AV,LV,BV,VV,HV,qV,zV,GV,jV,UV],WV=(()=>{let t=class dd{_mediator=p(V);_store=p(L);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:n}){let i=this._getConnectableTargets(e),r=[];for(let a of i)r.push(this._mediator.execute(new Kt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(i=>e.canConnectTo(i));let n=this._targets.filter(i=>i.canBeConnected);return e.isSelfConnectable||(n=n.filter(i=>i.fNodeId!==e.fNodeId)),n}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:i}of e)zp(i.userFConnectableSide)&&(i.fConnectableSide=this._calculateByConnectedPositions(i,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Oo(e,n))}static \u0275fac=function(n){return new(n||dd)};static \u0275prov=y({token:dd,factory:dd.\u0275fac})};return t=P([R(Zr)],t),t})(),Xp=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(o,e){this.target=o,this.pointer=e}},KV=(()=>{let t=class ud{_mediator=p(V);_store=p(L);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:n}){let i=this._getConnectableSources(e),r=[];for(let a of i)r.push(this._mediator.execute(new Kt(a)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableSources(e){return this._sources.filter(n=>{let i=n.canBeConnected;return i&&n.hasConnectionLimits&&(i=n.canConnectTo(e)),i})}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:i}of e)zp(i.userFConnectableSide)&&(i.fConnectableSide=this._calculateByConnectedPositions(i,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Oo(e,n))}static \u0275fac=function(n){return new(n||ud)};static \u0275prov=y({token:ud,factory:ud.\u0275fac})};return t=P([R(Xp)],t),t})(),Lo=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(o){this.connectors=o}},ht={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"}},YV=(()=>{let t=class pd{_store=p(L);handle({connectors:e}){this._store.flowHost.classList.add(ht.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._markConnector(n))}_markConnector({hostElement:e}){e.classList.add(ht.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||pd)};static \u0275prov=y({token:pd,factory:pd.\u0275fac})};return t=P([R(Lo)],t),t})(),na=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(o){this.instance=o}},XV=(()=>{let t=class hd{_store=p(L);_mediator=p(V);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 Ir(e.fId(),e.kind))}static \u0275fac=function(n){return new(n||hd)};static \u0275prov=y({token:hd,factory:hd.\u0275fac})};return t=P([R(na)],t),t})(),Bo=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(o){this.connectors=o}},ZV=(()=>{let t=class fd{_store=p(L);handle({connectors:e}){this._store.flowHost.classList.remove(ht.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._unmarkConnector(n))}_unmarkConnector({hostElement:e}){e.classList.remove(ht.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||fd)};static \u0275prov=y({token:fd,factory:fd.\u0275fac})};return t=P([R(Bo)],t),t})(),QV=[fV,XV,mV,_V,KV,WV,gV,YV,ZV],Zp=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(o){this.instance=o}},$i=(function(t){return t.TOP_BOTTOM="TOP_BOTTOM",t.BOTTOM_TOP="BOTTOM_TOP",t.LEFT_RIGHT="LEFT_RIGHT",t.RIGHT_LEFT="RIGHT_LEFT",t})($i||{}),oi=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(oi||{});function JV(t){let o=[...t.nodes.map(Iy),...t.groups.map(Iy)],e=new Set(t.nodes.map(s=>s.id)),n=new Set(t.groups.map(s=>s.id)),i=new Map,r=new Map;for(let s of[...t.nodes,...t.groups]){for(let c of s.fOutputs)i.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=i.get(c.fOutputId),h=r.get(c.fInputId);return!u||!h||s.push({source:u,target:h}),s},[]);return{nodes:o,connections:a,nodeIds:e,groupIds:n}}function Iy(t){return{id:t.id,size:t.measuredSize?ge({},t.measuredSize):t.size?ge({},t.size):void 0}}var e8=1,Ih=(()=>{class t{_destroyRef=p(xt);_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 i=e.fId();this.unregisterFlow(i);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(i)),n.connectionsChanges$.listen(()=>this._handleConnectionsChanges(i))),this._flows.set(i,r),this._engine?.getMode()===oi.AUTO&&this._scheduleRelayout(i)}unregisterFlow(e){let n=this._flows.get(e);n&&(n.unsubs.forEach(i=>i()),this._clearScheduledWork(n),this._flows.delete(e))}handleModeChanged(e){if(e===oi.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,i]of this._flows.entries())await this._relayoutRegisteredFlow(n,i)}}_handleNodesChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let i=this._buildNodeSignature(n.store);i!==n.nodeSignature&&(n.nodeSignature=i,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let i=this._buildConnectionSignature(n.store);i!==n.connectionSignature&&(n.connectionSignature=i,this._scheduleRelayout(e))}_scheduleRelayout(e){let n=this._flows.get(e);!n||!this._engine||this._engine.getMode()!==oi.AUTO||(n.timeoutId!==null&&clearTimeout(n.timeoutId),this._cancelAnimationFrames(n),n.timeoutId=setTimeout(()=>{n.timeoutId=null,this._runAfterNextPaint(n,()=>{this._relayoutFlowIfReady(e)})},e8))}async _relayoutFlowIfReady(e){let n=this._flows.get(e);if(!(!n||!this._engine||this._engine.getMode()!==oi.AUTO)){if(n.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,n)}}async _relayoutRegisteredFlow(e,n){if(!this._engine)return;let i=JV(n.flow.getState({measuredSize:!0})),r=++n.runId,a=await this._engine.calculate(i.nodes,i.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,i.nodeIds,i.groupIds)}finally{queueMicrotask(()=>{let u=this._flows.get(e);u&&(u.isApplying=!1)})}}}_emitWriteback(e,n,i,r){let a=this._engine?.getWriteback();a&&a({flowId:e,nodes:n.filter(s=>i.has(s.id)),groups:n.filter(s=>r.has(s.id))})}_applyPositions(e,n){return n.filter(i=>{let r=e.nodes.get(i.id);return!r||U.isEqual(r._position,i.position)?!1:(r.position.set(ge({},i.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})(),hC=new be("F_LAYOUT_OPTIONS");function fC(t,o){return t.reduce((e,n)=>{let i=o.get(n.id);return i&&e.push({id:n.id,position:i}),e},[])}var t8=new be("F_LAYOUT"),Qp=class{_controller=p(Ih);_config=p(hC,{optional:!0})??{};_interactiveOptions;_mode;_writeback;_defaultOptions;interactiveOptions;constructor(o){this._mode=this._config.mode??oi.MANUAL,this._writeback=this._config.writeback??null,this._defaultOptions=this.mergeOptions(o,this._config.options),this._interactiveOptions=X(this.mergeOptions(this._defaultOptions,{})),this.interactiveOptions=E(()=>this.mergeOptions(this._interactiveOptions(),{})),this._controller.attachEngine(this)}setMode(o){this._mode=o,this._controller.handleModeChanged(o)}getMode(){return this._mode}setWriteback(o){this._writeback=o}getWriteback(){return this._writeback}setInteractiveOptions(o){this._interactiveOptions.set(this.mergeOptions(this._interactiveOptions(),o))}relayout(o){return this._controller.relayout(o)}getProviderConfig(){return ge({},this._config)}resolveLayoutOptions(o){let e=ge({},o??{});return delete e.flowId,delete e.mode,this.mergeOptions(this._interactiveOptions(),e)}};function mC(t,o){return[Ih,t,{provide:t8,useExisting:t},{provide:hC,useValue:o??{}}]}var n8=(()=>{let t=class md{_store=p(L);_layoutController=p(Ih,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(n){return new(n||md)};static \u0275prov=y({token:md,factory:md.\u0275fac})};return t=P([R(Zp)],t),t})(),Jp=class{static fToken=Symbol("GetFlowRequest")},i8=(()=>{let t=class _d{_store=p(L);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||_d)};static \u0275prov=y({token:_d,factory:_d.\u0275fac})};return t=P([R(Jp)],t),t})(),eh=class{static fToken=Symbol("CalculateConnectionsStateRequest")},o8=(()=>{let t=class gd{_store=p(L);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||gd)};static \u0275prov=y({token:gd,factory:gd.\u0275fac})};return t=P([R(eh)],t),t})(),ia=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(o,e=!1){this.component=o,this.measuredSize=e}},r8=(()=>{let t=class bd{_store=p(L);_mediator=p(V);handle({component:e,measuredSize:n}){return this._store.nodes.getAll().filter(i=>i instanceof e).map(i=>{let r=n?this._mediator.execute(new it(i.hostElement)):null;return{id:i.fId(),parentId:i.fParentId()??void 0,position:ge({},i._position),size:i._size?ge({},i._size):void 0,measuredSize:r?{width:r.width,height:r.height}:void 0,rotate:i._rotate,fOutputs:this._getOutputs(i.hostElement),fInputs:this._getInputs(i.hostElement),isSelected:i.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||bd)};static \u0275prov=y({token:bd,factory:bd.\u0275fac})};return t=P([R(ia)],t),t})(),th=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(o=!1){this.measuredSize=o}},a8=(()=>{let t=class vd{_mediator=p(V);_store=p(L);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return U.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new ia(kh,e)),groups:this._mediator.execute(new ia(Km,e)),connections:this._mediator.execute(new eh)}}static \u0275fac=function(n){return new(n||vd)};static \u0275prov=y({token:vd,factory:vd.\u0275fac})};return t=P([R(th)],t),t})(),s8=[a8,r8,o8],nh=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(o){this.instance=o}},l8=(()=>{let t=class yd{_store=p(L);_layoutController=p(Ih,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(n){return new(n||yd)};static \u0275prov=y({token:yd,factory:yd.\u0275fac})};return t=P([R(nh)],t),t})(),Eh=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),ih=class{static fToken=Symbol("NotifyNodesRenderedRequest")},M_=new be("F_FLOW"),T_=class{},c8=(()=>{let t=class Cd{_state=p(Eh);_fFlow=p(M_);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||Cd)};static \u0275prov=y({token:Cd,factory:Cd.\u0275fac})};return t=P([R(ih)],t),t})(),oh=class{static fToken=Symbol("NotifyFullRenderedRequest")},d8=(()=>{let t=class xd{_state=p(Eh);_fFlow=p(M_);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||xd)};static \u0275prov=y({token:xd,factory:xd.\u0275fac})};return t=P([R(oh)],t),t})(),oa=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(o,e,n,i){this.targetConnectionsRevision=o,this.targetNodesRevision=e,this.callback=n,this.destroyRef=i}},u8=(()=>{let t=class wd{_store=p(L);handle({targetConnectionsRevision:e,targetNodesRevision:n,callback:i,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=n){i();return}let a=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<n||(a(),i())});r.onDestroy(a)}static \u0275fac=function(n){return new(n||wd)};static \u0275prov=y({token:wd,factory:wd.\u0275fac})};return t=P([R(oa)],t),t})(),rh=class{static fToken=Symbol("ResetRenderLifecycleRequest")},p8=(()=>{let t=class Td{_state=p(Eh);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(n){return new(n||Td)};static \u0275prov=y({token:Td,factory:Td.\u0275fac})};return t=P([R(rh)],t),t})(),ah=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(o){this.destroyRef=o}},_C=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})(),h8=(()=>{let t=class Sd{_state=p(_C);_store=p(L);_mediator=p(V);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 i=this._state.pendingRedraw;n(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,i&&this._mediator.execute(new Or)});e.destroyRef.onDestroy(n)}static \u0275fac=function(n){return new(n||Sd)};static \u0275prov=y({token:Sd,factory:Sd.\u0275fac})};return t=P([R(ah)],t),t})(),f8=[n8,i8,...s8,l8,Eh,c8,d8,u8,p8,_C,h8],sh=class{static fToken=Symbol("ClearSelectionRequest")},m8=(()=>{let t=class kd{_dragContext=p(he);handle(e){this._dragContext.selectedItems.forEach(n=>n.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||kd)};static \u0275prov=y({token:kd,factory:kd.\u0275fac})};return t=P([R(sh)],t),t})(),lh=class{static fToken=Symbol("CalculateSelectableItemsRequest")},_8=(()=>{let t=class Id{_mediator=p(V);_store=p(L);_dragContext=p(he);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 it(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new it(e.boundingElement))}))}static \u0275fac=function(n){return new(n||Id)};static \u0275prov=y({token:Id,factory:Id.\u0275fac})};return t=P([R(lh)],t),t})(),ra=class{static fToken=Symbol("GetCurrentSelectionRequest")},g8=(()=>{let t=class Ed{_dragContext=p(he);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||Ed)};static \u0275prov=y({token:Ed,factory:Ed.\u0275fac})};return t=P([R(ra)],t),t})(),ch=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(o,e,n=!0){this.nodes=o,this.connections=e,this.isSelectedChanged=n}},b8=(()=>{let t=class Md{_dragContext=p(he);_store=p(L);handle(e){this._dragContext.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(n=>{let i=this._store.nodes.get(n);i&&(i.markAsSelected(),this._dragContext.selectedItems.push(i))}),e.connections.forEach(n=>{let i=this._store.connections.get(n);i&&(i.markAsSelected(),this._dragContext.selectedItems.push(i))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(n){return new(n||Md)};static \u0275prov=y({token:Md,factory:Md.\u0275fac})};return t=P([R(ch)],t),t})(),dh=class{static fToken=Symbol("SelectAllRequest")},v8=(()=>{let t=class Dd{_dragSession=p(he);_store=p(L);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||Dd)};static \u0275prov=y({token:Dd,factory:Dd.\u0275fac})};return t=P([R(dh)],t),t})(),Vo=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(o){this.nodeOrGroup=o}},uh=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(o,e,n,i){this.fItemsContainer=o,this.allElements=e,this.elementsThatShouldBeInFront=n,this.targetIndex=i}},y8=(()=>{let t=class Pd{handle(e){let n=[];for(let i=e.targetIndex+1;i<e.allElements.length;i++){let r=e.allElements[i];e.elementsThatShouldBeInFront.includes(r)||n.push(r)}n.forEach(i=>{e.fItemsContainer.removeChild(i),e.fItemsContainer.insertBefore(i,e.allElements[e.targetIndex])})}static \u0275fac=function(n){return new(n||Pd)};static \u0275prov=y({token:Pd,factory:Pd.\u0275fac})};return t=P([R(uh)],t),t})(),ji=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(o,e){this.item=o,this.itemContainer=e}},zo=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(o){this.nodeOrGroupId=o}},C8=(()=>{let t=class Rd{_store=p(L);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 i=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return i.reduce((r,a)=>r.concat(this._getChildrenNodes(a.fId(),n)),i)}static \u0275fac=function(n){return new(n||Rd)};static \u0275prov=y({token:Rd,factory:Rd.\u0275fac})};return t=P([R(zo)],t),t})(),x8=(()=>{let t=class Od{_store=p(L);_mediator=p(V);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()),i=this._getChildrenGroups(n);this._updateLayers(this._groupsContainer,e.item.hostElement,i);let r=this._getChildrenNodes(n);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),i=this._getChildrenNodes(n);this._updateLayers(e.itemContainer,e.item.hostElement,i)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,n,i){let r=Array.from(e.children),a=r.findIndex(s=>s===n);this._isAnythingNeedToBeMoved(r,a,i)&&this._mediator.execute(new uh(e,r,i,a))}_isAnythingNeedToBeMoved(e,n,i){for(let r=n+1;r<e.length;r++)if(!i.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let n=Array.from(this._groupsContainer.children);return e.filter(i=>this._groupsContainer.contains(i)).sort((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodes(e){let n=Array.from(this._nodesContainer.children);return e.filter(i=>this._nodesContainer.contains(i)).sort((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new zo(e)).map(n=>n.hostElement)}static \u0275fac=function(n){return new(n||Od)};static \u0275prov=y({token:Od,factory:Od.\u0275fac})};return t=P([R(ji)],t),t})(),w8=(()=>{let t=class Fd{_dragSession=p(he);_mediator=p(V);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new ji(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||Fd)};static \u0275prov=y({token:Fd,factory:Fd.\u0275fac})};return t=P([R(Vo)],t),t})(),T8=[m8,_8,g8,b8,v8,w8],ph=class{static fToken=Symbol("ResetZoomRequest")},S8=(()=>{let t=class Nd{_store=p(L);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(n){return new(n||Nd)};static \u0275prov=y({token:Nd,factory:Nd.\u0275fac})};return t=P([R(ph)],t),t})(),hh=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(o,e,n,i=!1){this.position=o,this.step=e,this.direction=n,this.animate=i}},k8=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),I8=new Set(["drag-canvas","selection-area"]),E8=(()=>{let t=class Ad{_mediator=p(V);_store=p(L);_dragContext=p(he,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(Xe.ZOOM)}get _isDragStarted(){return this._mediator.execute(new fi)}handle(e){if(!this._zoomComponent)return;let n=this._canvas.transform.scale,i=this._clamp(n+e.step*e.direction);if(i===n)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let a=this._getDragZoomMode();if(a==="blocked")return;a==="rebase"&&this._rebaseDragContext(r,i)}this._canvas.setScale(i,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 pe.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let n of this._dragContext?.draggableItems??[]){let i=n.getEvent().kind;if(k8.has(i)){e=!0;continue}if(!I8.has(i))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,n){if(!this._dragContext)return;let i=this._dragContext.onPointerDownScale;if(!i||i===n){this._dragContext.onPointerDownScale=n;return}let r=1/n-1/i;this._dragContext.onPointerDownPosition=pe.fromPoint(this._dragContext.onPointerDownPosition).add(pe.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=n}static \u0275fac=function(n){return new(n||Ad)};static \u0275prov=y({token:Ad,factory:Ad.\u0275fac})};return t=P([R(hh)],t),t})(),M8=[S8,E8],fh=class{static fToken=Symbol("MinimapDrawNodesRequest")},D8=(()=>{let t=class Ld{_browser=p(at);_store=p(L);handle(e){let n=this._store.fFlow,i=this._store.fCanvas;return!n||!i?[]:this._store.nodes.getAll().map(a=>this._renderNode(a,n,i))}_renderNode(e,n,i){let r=ko("rect",this._browser);em(this._nodeRect(e,n,i),r);let a=e instanceof kh;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,i){let r=te.elementTransform(te.fromElement(e.hostElement),n.hostElement);return te.div(r,i.transform.scale)}_minimapClasses(e){let n=e.fMinimapClass();return Array.isArray(n)?n:[n]}static \u0275fac=function(n){return new(n||Ld)};static \u0275prov=y({token:Ld,factory:Ld.\u0275fac})};return t=P([R(fh)],t),t})(),mh=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(o,e){this.svg=o,this.minSize=e}},P8=(()=>{let t=class Bd{_mediator=p(V);_store=p(L);handle({svg:e,minSize:n}){let i=this._store.fFlow,r=this._store.fCanvas;if(!i||!r)return{scale:1,viewBox:te.initialize(0,0,0,0)};let a=this._contentRectInMinimapSpace(i,r,n),s=this._minimapRectInFlowSpace(e,i),c=this._viewportScale(a,s),u=this._viewportViewBox(a,s,c);return{scale:c,viewBox:u}}_contentRectInMinimapSpace(e,n,i){let r=this._nodesBoundingBox(),a=te.elementTransform(r,e.hostElement),s=te.div(a,n.transform.scale);return Kv(s,i)}_nodesBoundingBox(){return this._mediator.execute(new No)??te.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,n){return te.elementTransform(te.fromElement(e),n.hostElement)}_viewportScale(e,n){let i=n.width||1,r=n.height||1;return Math.max(e.width/i,e.height/r)}_viewportViewBox(e,n,i){let r=this._viewportSize(n,i),a=e.x-(r.width-e.width)/2,s=e.y-(r.height-e.height)/2;return te.initialize(a,s,r.width,r.height)}_viewportSize(e,n){return Ot.initialize(e.width*n||0,e.height*n||0)}static \u0275fac=function(n){return new(n||Bd)};static \u0275prov=y({token:Bd,factory:Bd.\u0275fac})};return t=P([R(mh)],t),t})(),_h=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},R8=(()=>{let t=class Vd{_store=p(L);handle(e){let n=this._store.fFlow,i=this._store.fCanvas;if(!n||!i)return te.initialize();let r=te.div(te.fromElement(n.hostElement),i.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(n){return new(n||Vd)};static \u0275prov=y({token:Vd,factory:Vd.\u0275fac})};return t=P([R(_h)],t),t})(),gh=class{element;scale;viewBox;constructor(o,e=1,n=te.initialize(0,0,0,0)){this.element=o,this.scale=e,this.viewBox=n}},O8=[D8,P8,R8],bh=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(o){this.position=o}},F8=(()=>{let t=class zd{_store=p(L);handle({position:e}){return qo(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(n){return new(n||zd)};static \u0275prov=y({token:zd,factory:zd.\u0275fac})};return t=P([R(bh)],t),t})(),vh=class{static fToken=Symbol("SortNodeLayersRequest")},N8=(()=>{let t=class Hd{_store=p(L);_mediator=p(V);_browser=p(at);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((i,r)=>n.indexOf(i)-n.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new zo(e)).filter(n=>this._nodesContainer.contains(n.hostElement)).map(n=>n.hostElement)}_moveChildrenNodes(e){let n=this._browser.document.createDocumentFragment();e.forEach(i=>{n.appendChild(i)}),this._nodesContainer.appendChild(n)}static \u0275fac=function(n){return new(n||Hd)};static \u0275prov=y({token:Hd,factory:Hd.\u0275fac})};return t=P([R(vh)],t),t})(),aa=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(o){this.itemsContainer=o}},A8=(()=>{let t=class qd{_store=p(L);_browser=p(at);handle({itemsContainer:e}){let n=Array.from(e.children);if(n.length<2)return;let i=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,i,c,a,s);u.length&&this._moveBeforeNextSibling(e,u,c.hostElement.nextElementSibling)}}_buildPositions(e){let n=new Map;for(let i=0;i<e.length;i++)n.set(e[i],i);return n}_getSortedChildrenBeforeParent(e,n,i,r,a){let s=n.get(i.hostElement);if(s===void 0)return[];let c=this._getDeepChildren(i.fId(),r,a);if(!c.length)return[];let u=[];for(let h of c){let g=h.hostElement;if(!e.contains(g))continue;let C=n.get(g);C===void 0||C>=s||u.push(g)}return u.sort((h,g)=>(n.get(h)??0)-(n.get(g)??0)),u}_buildChildrenByParentId(e){let n=new Map;for(let i of e){let r=i.fParentId();if(!r)continue;let a=n.get(r)??[];a.push(i),n.set(r,a)}return n}_getDeepChildren(e,n,i){let r=i.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 h=u.fId();if(c.has(h))continue;c.add(h),a.push(u);let g=n.get(h);g?.length&&s.push(...g)}return i.set(e,a),a}_moveBeforeNextSibling(e,n,i){let r=this._browser.document.createDocumentFragment();for(let a of n)r.appendChild(a);e.insertBefore(r,i)}static \u0275fac=function(n){return new(n||qd)};static \u0275prov=y({token:qd,factory:qd.\u0275fac})};return t=P([R(aa)],t),t})(),yh=class{static fToken=Symbol("SortItemLayersRequest")},L8=(()=>{let t=class Gd{_store=p(L);_mediator=p(V);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let n=this._store.nodes.getAll();n.length<2||!n.some(i=>!!i.fParentId())||(this._mediator.execute(new aa(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new vh),this._mediator.execute(new aa(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(n){return new(n||Gd)};static \u0275prov=y({token:Gd,factory:Gd.\u0275fac})};return t=P([R(yh)],t),t})();function ko(t,o){return o.document.createElementNS("http://www.w3.org/2000/svg",t)}function an(t,o){return o(t)}function gn(t){return!0}function B8(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var V8=[...r6,...hV,...KL,...QV,...OV,...f8,...$V,...T8,...M8,...O8,...b7,C8,v7,w7,F8,L8,A8,N8,x8,y8],z8=0,gC=(()=>{class t{_destroyRef=p(xt);_elementReference=p(Qe);_fBrowser=p(at);_stateChanges=new rn;get hostElement(){return this._elementReference.nativeElement}id=B(`f-pattern-${z8++}`);vColor=B("rgba(0,0,0,0.1)");hColor=B("rgba(0,0,0,0.1)");vSize=B(20,{transform:xe});hSize=B(20,{transform:xe});_transform=ni.default();_position=U.initialize();_size=Ot.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=ko("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=ko("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=ko("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new En(this._stateChanges).pipe(Ch()).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=Ot.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,i,r,a,s){e.setAttribute("stroke",`${n}`),e.setAttribute("x1",`${i}`),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=z({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(n,i){n&2&&O("id",i.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[ke([{provide:pm,useExisting:t}]),ro],decls:0,vars:0,template:function(n,i){},encapsulation:2,changeDetection:0})}return t})();var H8=new be("F_BACKGROUND"),q8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),bC=(()=>{class t extends q8{_mediator=p(V);fBackgroundPattern=Qa(pm);ngOnInit(){this._mediator.execute(new li(Xe.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new jd(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new ci(Xe.BACKGROUND))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-background"]],contentQueries:function(n,i,r){n&1&&Tf(r,i.fBackgroundPattern,pm,5),n&2&&jt()},hostAttrs:[1,"f-component","f-background"],features:[ke([{provide:H8,useExisting:t}]),Z],ngContentSelectors:CL,decls:2,vars:0,template:function(n,i){n&1&&(pn(),W(),se(0,"svg"),$e(1),fe())},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 S_=class{position;scale;constructor(o,e){this.position=o,this.scale=e}},G8=new be("F_CANVAS"),j8=(()=>{class t{transform=ni.default();_fCanvasChange=new rn;destroyRef=p(xt);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new En(this._fCanvasChange).pipe(Ud(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new S_(U.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),sa=(()=>{class t extends j8{_mediator=p(V);_componentsStore=p(L);_elementReference=p(Qe);_injector=p(dt);_flowId;fCanvasChange=Ke();position=B(U.initialize(),{transform:U.castToPoint});scale=B(1,{transform:xe});debounceTime=B(0,{transform:xe});debounce=E(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=nt.required("fGroupsContainer");fNodesContainer=nt.required("fNodesContainer");fConnectionsContainer=nt.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new Jp).fId(),this._mediator.execute(new Wd(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){de(()=>{this._mediator.execute(new Xd(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){de(()=>{this._mediator.execute(new Zd(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new Sr(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=ni.toString(this.transform),this._mediator.execute(new si)}redrawWithAnimation(){this._mediator.execute(new Sr(this.transform)),this.hostElement.style.transition=`transform ${B8()?80:150}ms ease-in-out`,this.hostElement.style.transform=ni.toString(this.transform),Ey(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,n=!0){this._afterRedraw(()=>{this._mediator.execute(new Kd(e,n))})}fitToScreen(e=U.initialize(),n=!0){this._afterRedraw(()=>{this._mediator.execute(new Yd(e,n))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new eu(e))})}getScale(){return this.transform.scale||1}setScale(e,n=U.initialize()){this._mediator.execute(new tu(e,n))}resetScale(){this._mediator.execute(new Jd)}ngOnDestroy(){this._mediator.execute(new Qd)}_afterRedraw(e){this._mediator.execute(new oa(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>ao(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-canvas"]],viewQuery:function(n,i){n&1&&hn(i.fGroupsContainer,xL,5)(i.fNodesContainer,wL,5)(i.fConnectionsContainer,TL,5),n&2&&jt(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[ke([{provide:G8,useExisting:t}]),Z],ngContentSelectors:kL,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(n,i){n&1&&(pn(SL),Ya(0),se(1,"div",null,0),$e(3),fe(),se(4,"div",3,1),$e(6,1),$e(7,2),$e(8,3),fe(),se(9,"div",null,2),$e(11,4),fe(),Xa())},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 U8=0,vC=(()=>{class t extends e7{fId=B(`f-connection-${U8++}`,{alias:"fConnectionId"});fOutputId=B("",{transform:e=>Ro(e)||""});fInputId=B("",{transform:e=>Ro(e)||""});fRadius=8;fOffset=12;fBehavior=ri.FIXED;fType=wo.STRAIGHT;fSelectionDisabled=B(!1,{transform:j});fReassignableStart=B(!1,{transform:j});fDraggingDisabled=B(!1,{alias:"fReassignDisabled",transform:j});fInputSide=B(Ye.DEFAULT,{transform:e=>xo(e,"fInputSide",Ye)});fOutputSide=B(Ye.DEFAULT,{transform:e=>xo(e,"fOutputSide",Ye)});get boundingElement(){return this.fPath().hostElement}_mediator=p(V);ngOnInit(){this._mediator.execute(new iu(this))}ngOnChanges(){this._mediator.execute(new Ai)}ngOnDestroy(){this._mediator.execute(new Eu(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(n,i){n&2&&(O("id",i.fId()),ue("f-connection-selection-disabled",i.fSelectionDisabled())("f-connection-reassign-disabled",i.fDraggingDisabled()))},inputs:{fId:[1,"fConnectionId","fId"],fOutputId:[1,"fOutputId"],fInputId:[1,"fInputId"],fRadius:[2,"fRadius","fRadius",xe],fOffset:[2,"fOffset","fOffset",xe],fBehavior:[2,"fBehavior","fBehavior",e=>xo(e,"fBehavior",ri)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[ke([{provide:xh,useExisting:t}]),Z,ro],ngContentSelectors:EL,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,i){if(n&1&&(pn(IL),W(),f(0,"svg",1),F(1,"defs",null,0),$e(3),f(4,"g",2),M(5,ML,1,1,":svg:linearGradient",3),F(6,"path",4),f(7,"g"),F(8,"path",5),M(9,DL,1,0,":svg:circle",6),F(10,"circle",7),_()()(),$e(11,1),$e(12,2),$e(13,3),M(14,PL,1,0)),n&2){let r;l(5),D((r=i.fGradient())?5:-1,r),l(),O("d",i.path),l(2),m("useGradient",!!i.fGradient()),O("d",i.path),l(),D(i.fReassignableStart()?9:-1),l(5),D(i.fContents().length?14:-1)}},dependencies:[Em,X6,Z6,j6,Y6],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 $8=new be("F_MAGNETIC_LINES"),W8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})();var yC=(()=>{class t extends W8{threshold=B(10,{transform:xe,alias:"fAlignThreshold"});_mediator=p(V);ngOnInit(){this._mediator.execute(new li(Xe.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new ci(Xe.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[ke([{provide:$8,useExisting:t}]),Z],decls:0,vars:0,template:function(n,i){},styles:[RL]})}return t})();var cm=(()=>{class t{fMinSize=B(1e3);_mediator=p(V);hostElement=p(Qe).nativeElement;model=new gh(this.hostElement);redraw(){let{scale:e,viewBox:n}=this._mediator.execute(new mh(this.hostElement,this.fMinSize()));this.model=new gh(this.hostElement,e,n),Yv(n,this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),dm=(()=>{class t{_mediator=p(V);_elementRef=p(Qe);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new fh).forEach(n=>{e.appendChild(n)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),um=(()=>{class t{_mediator=p(V);hostElement=p(Qe).nativeElement;redraw(){em(this._mediator.execute(new _h),this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),K8=new be("F_MINIMAP_BASE"),Y8=(()=>{class t{hostElement=p(Qe).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),CC=(()=>{class t extends Y8{_destroyRef=p(xt);_mediator=p(V);_browser=p(at);_store=p(L);_canvas=nt.required(dm);_flow=nt.required(cm);_minimapView=nt.required(um);fMinSize=B(1e3);fNodeRenderLimit=B(1500,{transform:xe});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new li(Xe.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new $d).pipe(Ch(),AL()).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 ci(Xe.MINIMAP))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-minimap"]],viewQuery:function(n,i){n&1&&hn(i._canvas,dm,5)(i._flow,cm,5)(i._minimapView,um,5),n&2&&jt(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[ke([{provide:K8,useExisting:t}]),Z],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,i){n&1&&(W(),f(0,"svg",0),F(1,"g",1)(2,"rect",2),_()),n&2&&m("fMinSize",i.fMinSize())},dependencies:[cm,dm,um],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var X8=(()=>{class t{hostElement=p(Qe).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(n){return new(n||t)};static \u0275dir=je({type:t,standalone:!1})}return t})(),xC=(()=>{class t extends X8{_mediator=p(V);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new li(Xe.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new ci(Xe.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[Z],decls:0,vars:0,template:function(n,i){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var Z8=0,Q8=120,la=(()=>{class t extends T_{_destroyRef=p(xt);_mediator=p(V);_browser=p(at);_componentsStore=p(L);_cache=p(Mn);_injector=p(dt);fId=B(`f-flow-${Z8++}`,{alias:"fFlowId"});fCache=B(!1,{transform:j});hostElement=p(Qe).nativeElement;fNodesRendered=Ke();fFullRendered=Ke();fLoaded=Ke();ngOnInit(){this._mediator.execute(new Zp(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){de(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new En(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(Ch(),Ud(Q8),NL()).listen(this._destroyRef,()=>{this._mediator.execute(new fi)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new yh),this._mediator.execute(new ih),this._mediator.execute(new oa(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new oh),this._destroyRef)),this._mediator.execute(new Ai))})}_listenConnectionsChanges(){this._mediator.execute(new To).listen(this._destroyRef,()=>{if(!this._mediator.execute(new fi)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new ah(this._destroyRef));return}this._mediator.execute(new Or)}})}redraw(){this._mediator.execute(new Ai)}reset(){this._mediator.execute(new rh)}getNodesBoundingBox(){return this._mediator.execute(new Wp)}getSelection(){return this._mediator.execute(new ra)}getPositionInFlow(e){return this._mediator.execute(new bh(e))}getState(e){return this._mediator.execute(new th(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new To).pipe(ty()).listen(this._destroyRef,()=>{this._mediator.execute(new dh)})}select(e,n,i=!0){this._mediator.execute(new To).pipe(ty()).listen(this._destroyRef,()=>{this._mediator.execute(new ch(e,n,i))})}clearSelection(){this._mediator.execute(new sh)}ngOnDestroy(){this._mediator.execute(new nh(this))}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275cmp=z({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(n,i){n&2&&O("id",i.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[ke([V,...jL,zy,Ho,...V8,he,...dV,{provide:M_,useExisting:t}]),Z],ngContentSelectors:FL,decls:7,vars:0,template:function(n,i){n&1&&(pn(OL),Ya(0),$e(1),$e(2,1),$e(3,2),$e(4,3),$e(5,4),$e(6,5),Xa())},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 wC=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=p(Ka);_tpl=p(x0);_zone=p(Jt);_componentsStore=p(L,{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 i=()=>{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(i);return}this._rafId=null,this._finishProgressiveRender()};this._rafId=requestAnimationFrame(i)})}_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=je({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[ro]})}return t})();var bn=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(bn||{}),J8=new be("F_ZOOM"),k_=class{},ez=.1,tz=1,nz=.5,iz=60,oz=.5;function rz(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function az(t,o,e){return sz(t)?cz(o,e):lz(o,e)}function sz(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function lz(t,o){let e=Math.abs(t)/100,n=TC(e,ez,tz);return o*n}function cz(t,o){if(Math.abs(t)<nz)return 0;let e=Math.abs(t)/iz,n=TC(e,0,oz);return o*n}function TC(t,o,e){return Math.max(o,Math.min(e,t))}var ca=(()=>{class t extends k_{_mediator=p(V);_injector=p(dt);_store=p(L);_triggersListener=He.emptyListener();isEnabled=B(!1,{alias:"fZoom",transform:j});fWheelTrigger=gn;fDblClickTrigger=gn;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 li(Xe.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){de(()=>{this.isEnabled(),tn(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,He.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,He.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!an(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let i=rz(e);if(i===0)return;let r=this._normalizeWheelStep(e,i);r!==0&&this.setZoom(U.initialize(e.clientX,e.clientY),r,this._calculateDirection(i),!1)};_normalizeWheelStep(e,n){return az(e,n,this.step)}_calculateDirection(e){return e>0?bn.ZOOM_OUT:bn.ZOOM_IN}_onDoubleClick=e=>{if(!an(e,this.fDblClickTrigger))return;e.preventDefault();let n=e.target;TB(n)||n?.closest("[fLockedContext]")||this.setZoom(U.initialize(e.clientX,e.clientY),this.dblClickStep,bn.ZOOM_IN,!0)};_getToCenterPosition(e,n){return U.initialize(e?.x||n.gravityCenter.x,e?.y||n.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(bn.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(bn.ZOOM_OUT,e)}_onZoomToCenter(e,n){this.setZoom(this._getToCenterPosition(n,te.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,n,i,r){this._mediator.execute(new hh(e,n,i,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new ph)}_disposeListeners(){this._triggersListener(),this._triggersListener=He.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new ci(Xe.ZOOM))}_listen(e,n,i){this._flowHost.addEventListener(e,n,i)}_unlisten(e,n,i){this._flowHost.removeEventListener(e,n,i)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=G(t)))(i||t)}})();static \u0275dir=je({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",xe],maximum:[2,"fZoomMaximum","maximum",xe],step:[2,"fZoomStep","step",xe],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",xe]},features:[ke([{provide:J8,useExisting:t}]),Z]})}return t})();var SC=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=_t({type:t});static \u0275inj=mt({imports:[gt]})}return t})();var sf=a3(xD(),1);var Ba=(function(t){return t.NETWORK_SIMPLEX="network-simplex",t.TIGHT_TREE="tight-tree",t.LONGEST_PATH="longest-path",t})(Ba||{}),Tre={direction:$i.TOP_BOTTOM,nodeGap:48,layerGap:64,algorithm:Ba.NETWORK_SIMPLEX,defaultNodeSize:Ot.initialize(120,72)},i0=(()=>{class t extends Qp{constructor(){super(Tre)}mergeOptions(e,n={}){return Dt(ge(ge({},e),n),{defaultNodeSize:n.defaultNodeSize?Ot.initialize(n.defaultNodeSize.width,n.defaultNodeSize.height):Ot.initialize(e.defaultNodeSize.width,e.defaultNodeSize.height)})}async calculate(e,n,i){let r=this.resolveLayoutOptions(i),a=this._buildGraph(e,n,r),s=new Map;return sf.layout(a),a.nodes().forEach(c=>{let u=a.node(c),h=e.find(C=>C.id===c);if(!u||!h)return;let g=h.size??r.defaultNodeSize;s.set(c,U.initialize(u.x-g.width/2,u.y-g.height/2))}),{nodes:fC(e,s)}}_buildGraph(e,n,i){let r=new sf.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:this._mapDirection(i.direction),nodesep:i.nodeGap,ranksep:i.layerGap,ranker:this._mapAlgorithm(i.algorithm)}),e.forEach(a=>{let s=a.size??i.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 Ba.TIGHT_TREE:return"tight-tree";case Ba.LONGEST_PATH:return"longest-path";case Ba.NETWORK_SIMPLEX:default:return"network-simplex"}}_mapDirection(e){switch(e){case $i.BOTTOM_TOP:return"BT";case $i.LEFT_RIGHT:return"LR";case $i.RIGHT_LEFT:return"RL";case $i.TOP_BOTTOM:default:return"TB"}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();var wi={loading:"Loading collection",errorTitle:"Failed to load",emptyTitle:"No nodes match the current filters.",resetFilters:"Reset filters",curationEmptyTitle:"Nothing from your map selection is visible right now.",showAllOnMap:"Show all on map",a11y:{toolbar:"Map controls",panel:"Selected node details"},toolbar:{zoomIn:"Zoom in",zoomOut:"Zoom out",fitToScreen:"Fit to screen",resetLayoutLabel:"Re-arrange layout",resetLayoutTooltip:"Re-arrange the visible nodes",showAllLabel:"Show all",showAllTooltip:"Clear the map selection and show every node again",showAllAria:"Show all nodes on the map",layoutAlgorithmLabel:"Layout algorithm",layoutAlgorithmTooltip:"Layout algorithm",layoutDirectionLabel:"Layout direction",layoutDirectionTooltip:"Layout direction",layoutDirectionUnavailableTooltip:"Direction does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",layoutSpacingLabel:"Layout spacing",layoutSpacingTooltip:"Layout spacing",layoutSpacingUnavailableTooltip:"Spacing does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",connectionTypeLabel:"Connector style",connectionTypeTooltip:"Connector style"},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:"Re-arrange layout?",message:"This replaces every saved node position with a fresh automatic layout.",messageVisible:"This re-arranges the visible nodes and replaces their saved positions.",accept:"Re-arrange",reject:"Cancel"}};var lf={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0}};var Sre="adaptive-curve",a0=["segment","straight","bezier","adaptive-curve"],wD="sm.graph.connection-type",TD="sm.graph.layout-algorithm",SD="sm.graph.layout-direction",cf=(()=>{class t{_connectionType=X(o0(wD,kre,Sre));_layoutAlgorithm=X(o0(TD,yb,gb));_layoutDirection=X(o0(SD,Cb,bb));_layoutSpacing=X(vb);connectionType=this._connectionType.asReadonly();layoutAlgorithm=this._layoutAlgorithm.asReadonly();layoutDirection=this._layoutDirection.asReadonly();layoutSpacing=this._layoutSpacing.asReadonly();setConnectionType(e){this._connectionType()!==e&&(this._connectionType.set(e),r0(wD,e))}setLayoutAlgorithm(e){this._layoutAlgorithm()!==e&&(this._layoutAlgorithm.set(e),r0(TD,e))}setLayoutDirection(e){this._layoutDirection()!==e&&(this._layoutDirection.set(e),r0(SD,e))}static toFoblexEnum(e){return e}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function o0(t,o,e){let n=null;try{n=localStorage.getItem(t)}catch{return e}return n&&o(n)?n:e}function r0(t,o){try{localStorage.setItem(t,o)}catch{}}function kre(t){return typeof t=="string"&&a0.includes(t)}function kD(t,o){let e=new Set([o]);for(let n of t.get(o)??[])e.add(n);return e}var Ire={TOP_BOTTOM:{output:Ye.BOTTOM,input:Ye.TOP},BOTTOM_TOP:{output:Ye.TOP,input:Ye.BOTTOM},LEFT_RIGHT:{output:Ye.RIGHT,input:Ye.LEFT},RIGHT_LEFT:{output:Ye.LEFT,input:Ye.RIGHT}};function ID(t,o){return ds(t)?Ire[o]:{input:Ye.CALCULATE,output:Ye.CALCULATE}}var ED=`
|
|
2139
2139
|
.p-popover {
|
|
2140
2140
|
margin-block-start: dt('popover.gutter');
|
|
2141
2141
|
background: dt('popover.background');
|
|
@@ -2201,4 +2201,4 @@ function getSidePoint(rect, side) {
|
|
|
2201
2201
|
"/skill-command"`,references:`References:
|
|
2202
2202
|
"[link](./link.md)"`,mentions:`Mention:
|
|
2203
2203
|
"@agent.md"`,supersedes:`Supersedes:
|
|
2204
|
-
.sm annotation`}};var Xre=()=>({class:"link-kind-palette__content"}),Zre=t=>({content:t}),Qre=(t,o)=>o.kind;function Jre(t,o){if(t&1&&b(0),t&2){let e=d(2).$implicit;Se(" ",e.text," ")}}function eae(t,o){if(t&1&&F(0,"i"),t&2){let e=d(2).$implicit;H(e.icon)}}function tae(t,o){if(t&1&&(f(0,"span",4),M(1,Jre,1,1)(2,eae,1,2,"i",5),_()),t&2){let e=d().$implicit;l(),D(e.text?1:e.icon?2:-1)}}function nae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",3),A("ngModelChange",function(){let i=w(e).$implicit,r=d(2);return T(r.toggle(i.kind))}),S(1,tae,3,1,"ng-template",null,0,We),_()}if(t&2){let e=o.$implicit,n=d(2);m("ngModel",n.isActive(e.kind))("pTooltip",e.tooltip)("ariaLabel",e.label)("styleClass","link-kind-palette__btn link-kind-palette__btn--"+e.kind)("pt",Re(7,Zre,At(6,Xre))),O("data-testid","link-kind-palette-"+e.kind)}}function iae(t,o){if(t&1&&(f(0,"div",1),re(1,nae,3,9,"p-togglebutton",2,Qre),_()),t&2){let e=d();O("aria-label",e.texts.a11y.toolbarLabel),l(),ae(e.entries())}}var BD=[{kind:"invokes",label:Nn.kinds.invokes,tooltip:Nn.tooltips.invokes,text:"/"},{kind:"references",label:Nn.kinds.references,tooltip:Nn.tooltips.references,icon:"pi pi-link"},{kind:"mentions",label:Nn.kinds.mentions,tooltip:Nn.tooltips.mentions,text:"@"},{kind:"supersedes",label:Nn.kinds.supersedes,tooltip:Nn.tooltips.supersedes,icon:"pi pi-angle-double-right"}];for(let t of BD)if(!Q0.includes(t.kind))throw new Error(`link-kind-palette: unknown link kind "${t.kind}"`);var VD=(()=>{class t{loader=p(Vt);filters=p(on);texts=Nn;counts=E(()=>{let e=this.loader.scan(),n=new Map;if(!e)return n;for(let i of e.links)n.set(i.kind,(n.get(i.kind)??0)+1);return n});entries=E(()=>{let e=this.counts(),n=this.filters.selectedLinkKinds(),i=new Set(n);return BD.filter(r=>(e.get(r.kind)??0)>0||i.has(r.kind))});constructor(){de(()=>{let e=this.counts(),n=this.filters.selectedLinkKinds(),i=n.filter(r=>(e.get(r)??0)>0);i.length!==n.length&&this.filters.setLinkKinds(i)})}isActive(e){return this.filters.isLinkKindActive(e)}toggle(e){this.filters.toggleLinkKind(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,iae,3,1,"div",1),n&2&&D(i.entries().length>0?0:-1)},dependencies:[kt,Lt,Bt,Zn,Xn,ze,Ve],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:var(--sm-radius-xl);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})}return t})();var zD={a11y:{toolbarLabel:"Toggle severity filters"},error:{label:"Errors",tooltip:"Only nodes with errors"},warn:{label:"Warnings",tooltip:"Only nodes with warnings"}};var qD=()=>({class:"severity-palette__content"}),GD=t=>({content:t});function oae(t,o){if(t&1&&(f(0,"span",5),F(1,"i",6),_(),f(2,"span",7),b(3),_()),t&2){let e=d(3);l(3),x(e.errorCount())}}function rae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",4),A("ngModelChange",function(){w(e);let i=d(2);return T(i.toggle("error"))}),S(1,oae,4,1,"ng-template",null,0,We),_()}if(t&2){let e=d(2);m("ngModel",e.isActive("error"))("pTooltip",e.texts.error.tooltip)("ariaLabel",e.texts.error.label)("pt",Re(5,GD,At(4,qD)))}}function aae(t,o){if(t&1&&(f(0,"span",5),F(1,"i",9),_(),f(2,"span",7),b(3),_()),t&2){let e=d(3);l(3),x(e.warnCount())}}function sae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",8),A("ngModelChange",function(){w(e);let i=d(2);return T(i.toggle("warn"))}),S(1,aae,4,1,"ng-template",null,0,We),_()}if(t&2){let e=d(2);m("ngModel",e.isActive("warn"))("pTooltip",e.texts.warn.tooltip)("ariaLabel",e.texts.warn.label)("pt",Re(5,GD,At(4,qD)))}}function lae(t,o){if(t&1&&(f(0,"div",1),M(1,rae,3,7,"p-togglebutton",2),M(2,sae,3,7,"p-togglebutton",3),_()),t&2){let e=d();O("aria-label",e.texts.a11y.toolbarLabel),l(),D(e.showError()?1:-1),l(),D(e.showWarn()?2:-1)}}var jD=(()=>{class t{loader=p(Vt);filters=p(on);issuePaths=p(yo);mapVisibility=p(ei);texts=zD;visibleSet=E(()=>{let e=this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()),n=new Set;for(let i of e)this.mapVisibility.inScope(i.path)&&n.add(i.path);return n});rawErrorCount=E(()=>this.issuePaths.bySeverity().errors.size);rawWarnCount=E(()=>this.issuePaths.bySeverity().warns.size);errorCount=E(()=>HD(this.issuePaths.bySeverity().errors,this.visibleSet()));warnCount=E(()=>HD(this.issuePaths.bySeverity().warns,this.visibleSet()));showError=E(()=>this.rawErrorCount()>0||this.filters.severityErrorActive());showWarn=E(()=>this.rawWarnCount()>0||this.filters.severityWarnActive());hasAny=E(()=>this.showError()||this.showWarn());constructor(){de(()=>{this.rawErrorCount()===0&&this.filters.severityErrorActive()&&this.filters.toggleSeverity("error"),this.rawWarnCount()===0&&this.filters.severityWarnActive()&&this.filters.toggleSeverity("warn")})}isActive(e){return this.filters.isSeverityActive(e)}toggle(e){this.filters.toggleSeverity(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,lae,3,3,"div",1),n&2&&D(i.hasAny()?0:-1)},dependencies:[kt,Lt,Bt,Zn,Xn,ze,Ve],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:var(--sm-radius-xl);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})}return t})();function HD(t,o){let[e,n]=t.size<=o.size?[t,o]:[o,t],i=0;for(let r of e)n.has(r)&&i++;return i}function UD(t,o){let e=X(null),n=0;return de(()=>{let i=t().trim(),r=++n;e.set(null),i&&o(i).then(a=>{r===n&&e.set(a)}).catch(()=>{r===n&&e.set(null)})}),e.asReadonly()}function Va(t,o){return Ln(Va),UD(t,e=>o.renderInline(e))}function c0(t,o){return Ln(c0),UD(t,e=>o.render(e))}var cae=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,dae=/^[a-z]+$/i;function df(t){if(typeof t!="string")return null;let o=t.trim();return o.length===0?null:cae.test(o)||dae.test(o)?o:null}var uae=(t,o)=>o.step;function pae(t,o){t&1&&(f(0,"span",8),b(1),_()),t&2&&(l(),x(o))}function hae(t,o){if(t&1&&(f(0,"span",12)(1,"span",28),b(2,"T"),_(),b(3),_()),t&2){let e=d(),n=Ce(0);m("pTooltip",e.texts.stats.tokens(n.tokensTotal)),l(3),x(e.tokensShort())}}function fae(t,o){if(t&1&&(f(0,"span",13)(1,"span",28),b(2,"B"),_(),b(3),_()),t&2){let e=d(),n=Ce(0);m("pTooltip",e.texts.stats.bytes(n.bytesTotal)),l(3),x(e.bytesShort())}}function mae(t,o){if(t&1&&(f(0,"span",29),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function _ae(t,o){if(t&1&&(f(0,"span",30),b(1),_()),t&2){let e=d(2),n=Ce(2);l(),x(e.texts.tagOverflow(n))}}function gae(t,o){if(t&1&&(f(0,"div",17),re(1,mae,2,1,"span",29,Ue),M(3,_ae,2,1,"span",30),_()),t&2){d();let e=Ce(1),n=Ce(2);l(),ae(e),l(2),D(n>0?3:-1)}}function bae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function vae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,bae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.topics.tooltip),l(),x(n.texts.llm.topics.label),l(2),ae(e.topics)}}function yae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Cae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,yae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.facts.tooltip),l(),x(n.texts.llm.facts.label),l(2),ae(e.keyFacts)}}function xae(t,o){if(t&1&&(M(0,vae,6,2,"div",31),M(1,Cae,6,2,"div",31)),t&2){let e=o;D(e.topics!=null&&e.topics.length?0:-1),l(),D(e.keyFacts!=null&&e.keyFacts.length?1:-1)}}function wae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.when.tooltip),l(),x(n.texts.llm.when.label),l(2),x(e.whenToUse)}}function Tae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.style.tooltip),l(),x(n.texts.llm.style.label),l(2),x(e.interactionStyle)}}function Sae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function kae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Sae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.does.tooltip),l(),x(n.texts.llm.does.label),l(2),ae(e.capabilities)}}function Iae(t,o){if(t&1&&(M(0,wae,5,3,"div",31),M(1,Tae,5,3,"div",31),M(2,kae,6,2,"div",31)),t&2){let e=o;D(e.whenToUse?0:-1),l(),D(e.interactionStyle?1:-1),l(),D(e.capabilities!=null&&e.capabilities.length?2:-1)}}function Eae(t,o){if(t&1&&b(0),t&2){let e=o.$implicit,n=o.$index,i=o.$count;I0("",e.step,". ",e.description,"",n===i-1?"":" \xB7 ")}}function Mae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),re(4,Eae,1,3,null,null,uae),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.steps.tooltip),l(),x(n.texts.llm.steps.label),l(2),ae(e.recipe)}}function Dae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Pae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Dae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.pre.tooltip),l(),x(n.texts.llm.pre.label),l(2),ae(e.preconditions)}}function Rae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Oae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Rae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.out.tooltip),l(),x(n.texts.llm.out.label),l(2),ae(e.outputs)}}function Fae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Nae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Fae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.fx.tooltip),l(),x(n.texts.llm.fx.label),l(2),ae(e.sideEffects)}}function Aae(t,o){if(t&1&&(M(0,Mae,6,2,"div",31),M(1,Pae,6,2,"div",31),M(2,Oae,6,2,"div",31),M(3,Nae,6,2,"div",31)),t&2){let e=o;D(e.recipe!=null&&e.recipe.length?0:-1),l(),D(e.preconditions!=null&&e.preconditions.length?1:-1),l(),D(e.outputs!=null&&e.outputs.length?2:-1),l(),D(e.sideEffects!=null&&e.sideEffects.length?3:-1)}}function Lae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"code",35),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.eg.tooltip),l(),x(n.texts.llm.eg.label),l(2),x(e.invocationExample)}}function Bae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Vae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Bae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.fx.tooltip),l(),x(n.texts.llm.fx.label),l(2),ae(e.sideEffects)}}function zae(t,o){if(t&1&&(M(0,Lae,5,3,"div",31),M(1,Vae,6,2,"div",31)),t&2){let e=o;D(e.invocationExample?0:-1),l(),D(e.sideEffects!=null&&e.sideEffects.length?1:-1)}}function Hae(t,o){if(t&1&&(f(0,"div",22),M(1,xae,2,2),M(2,Iae,3,3),M(3,Aae,4,4),M(4,zae,2,2),_()),t&2){let e,n,i,r,a=d();l(),D((e=a.summaryMarkdown())?1:-1,e),l(),D((n=a.summaryAgent())?2:-1,n),l(),D((i=a.summarySkill())?3:-1,i),l(),D((r=a.summaryCommand())?4:-1,r)}}function qae(t,o){if(t&1&&F(0,"div",23),t&2){let e=d();m("innerHTML",e.descriptionHtml(),ki)}}function Gae(t,o){if(t&1&&(f(0,"div",36)(1,"div",37)(2,"span",38),b(3),_(),f(4,"span",39),b(5),_()()()),t&2){let e=d(),n=d();l(3),x(n.texts.meta.model),l(2),x(e.model)}}function jae(t,o){t&1&&M(0,Gae,6,2,"div",36),t&2&&D(o.model?0:-1)}var Uae={selected:!1,highlighted:!1,dimmed:!1},$D=(()=>{class t{node=B.required();stats=B({linksIn:0,linksOut:0});summary=B(null);selection=B(Uae);isFavorite=B(!1);favoriteToggle=Ke();texts=ti;expanded=Ei(!1);fmAgent=E(()=>{let e=this.node();return e.kind==="agent"?e.frontmatter:null});summaryAgent=E(()=>{let e=this.summary();return e?.kind==="agent"?e:null});summarySkill=E(()=>{let e=this.summary();return e?.kind==="skill"?e:null});summaryCommand=E(()=>{let e=this.summary();return e?.kind==="command"?e:null});summaryMarkdown=E(()=>{let e=this.summary();return e?.kind==="markdown"?e:null});hasLlmCluster=E(()=>{let e=this.summary();return e!==null&&this.hasLlmContent(e)});hasLlmContent(e){switch(e.kind){case"markdown":return(e.topics?.length??0)>0||(e.keyFacts?.length??0)>0;case"agent":return!!e.whenToUse||!!e.interactionStyle||(e.capabilities?.length??0)>0;case"skill":return(e.recipe?.length??0)>0||(e.preconditions?.length??0)>0||(e.outputs?.length??0)>0||(e.sideEffects?.length??0)>0;case"command":return!!e.invocationExample||(e.sideEffects?.length??0)>0;default:return!1}}nodeColor=E(()=>{let e=this.node();if(e.kind!=="agent")return null;let n=e.frontmatter;return df(n.color)});markdown=p(bo);bytesShort=E(()=>{let e=this.stats().bytesTotal;return e===void 0?null:vr(e)});tokensShort=E(()=>{let e=this.stats().tokensTotal;return e===void 0?null:vr(e)});version=E(()=>is(this.node()));stability=E(()=>po(this.node()));tagChips=E(()=>ho(this.node()));visibleTagChips=E(()=>this.tagChips().slice(0,3));moreTagsCount=E(()=>Math.max(0,this.tagChips().length-3));displayName=E(()=>{let e=this.node().frontmatter;return e.name?e.name:cs(this.node().path)});description=E(()=>this.node().frontmatter.description??"");descriptionHtml=Va(this.description,this.markdown);toggleExpanded(e){e.stopPropagation(),this.expanded.update(n=>!n)}toggleFavorite(e){e.stopPropagation();let n=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:n})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:15,hostBindings:function(n,i){n&2&&(O("data-kind",i.node().kind),Ne("--node-color",i.nodeColor()),ue("sm-gnode--with-color",!!i.nodeColor())("sm-gnode--deprecated",i.stability()==="deprecated")("sm-gnode--expanded",i.expanded())("sm-gnode--selected",i.selection().selected)("sm-gnode--highlighted",i.selection().highlighted)("sm-gnode--dimmed",i.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",3,"innerHTML"],[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"],["data-testid","node-card-tags-more",1,"sm-gnode__tag-more"],[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(n,i){if(n&1&&(Ut(0)(1)(2),f(3,"div",0)(4,"div",1),F(5,"sm-kind-icon",2),_(),f(6,"div",3)(7,"div",4)(8,"span",5),b(9),_(),F(10,"sm-view-contributions-host",6),_()(),f(11,"div",7),M(12,pae,2,1,"span",8),f(13,"button",9),A("click",function(a){return i.toggleExpanded(a)}),F(14,"i",10),_()(),f(15,"div",11),M(16,hae,4,2,"span",12),M(17,fae,4,2,"span",13),f(18,"button",14),A("click",function(a){return i.toggleFavorite(a)}),F(19,"i",15),_(),F(20,"sm-view-contributions-host",16),_()(),M(21,gae,4,1,"div",17),f(22,"div",18)(23,"div",19),F(24,"i",20),f(25,"span",21),b(26),_()(),M(27,Hae,5,4,"div",22),M(28,qae,1,1,"div",23),M(29,jae,1,1),_(),f(30,"div",24),F(31,"sm-view-contributions-host",25),f(32,"div",26),F(33,"sm-view-contributions-host",27),_()()),n&2){let r,a,s=i.node();Tt(i.stats()),l();let c=Tt(i.visibleTagChips());l(),Tt(i.moreTagsCount()),l(3),m("kind",s.kind)("provider",s.provider)("size",18),l(3),m("pTooltip",i.displayName()),l(),x(i.displayName()),l(),m("node",i.node()),l(2),D((r=i.version())?12:-1,r),l(),O("aria-label",i.texts.ariaExpand),l(3),D(i.tokensShort()!==null?16:-1),l(),D(i.bytesShort()!==null?17:-1),l(),ue("sm-gnode__favorite--on",i.isFavorite()),m("pTooltip",i.isFavorite()?i.texts.favoriteRemoveTooltip:i.texts.favoriteAddTooltip),O("aria-label",i.isFavorite()?i.texts.ariaFavoriteRemove:i.texts.ariaFavoriteAdd),l(),ue("pi-star-fill",i.isFavorite())("pi-star",!i.isFavorite()),l(),m("node",i.node()),l(),D(c.length?21:-1),l(2),m("pTooltip",s.path),l(3),x(s.path),l(),D(i.hasLlmCluster()?27:-1),l(),D(i.description()?28:-1),l(),D((a=i.fmAgent())?29:-1,a),l(2),m("node",i.node()),l(2),m("node",i.node())}},dependencies:[nr,ze,Ve,Jn],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:var(--sm-radius-lg);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:var(--sm-radius-lg);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)}[_nghost-%COMP%] .sm-gnode__desc code{background:var(--sm-bg-hover);padding:.02rem .25rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .sm-gnode__desc a{color:var(--p-primary-color);text-decoration:underline}.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-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})}return t})();var WD={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,o)=>`${t}/${o} nodes`,links:t=>`${t} links`}};var $ae=["sparkline"],Wae=()=>({class:"perf-hud__content"}),Kae=t=>({content:t});function Yae(t,o){if(t&1&&(f(0,"span",9),b(1),_()),t&2){let e=d(2);l(),x(e.texts.units.mb(e.heapMb()))}}function Xae(t,o){if(t&1&&(f(0,"div",3)(1,"span",4),b(2),_()(),f(3,"div",5)(4,"div",6)(5,"div",7),F(6,"canvas",8,1),f(8,"span",9),b(9),_()(),f(10,"div",10)(11,"div",11),M(12,Yae,2,1,"span",9),f(13,"span",9),b(14),_(),f(15,"span",9),b(16),_()()(),f(17,"div",10)(18,"div",11)(19,"span",9),b(20),_(),f(21,"span",9),b(22),_()()()()()),t&2){let e=d();l(2),x(e.texts.units.fps(e.fps())),l(),O("aria-hidden",!e.expanded()),l(6),x(e.texts.units.ms(e.frameTimeMs())),l(3),D(e.hasHeap()?12:-1),l(2),x(e.texts.units.domNodes(e.domNodes())),l(2),x(e.texts.units.longTasks(e.longTasks())),l(4),x(e.texts.units.nodes(e.visible(),e.total())),l(2),x(e.texts.units.links(e.edges()))}}var Zae=30,d0=60,uf=14,KD=(()=>{class t{visible=B(0);total=B(0);edges=B(0);texts=WD;destroyRef=p(xt);zone=p(Jt);fps=X(0);frameTimeMs=X(0);fpsSamples=X([]);sparklineCanvas=nt("sparkline");heapMb=X(null);longTasks=X(0);domNodes=X(0);expanded=X(Qae());hasHeap=E(()=>this.heapMb()!==null);constructor(){let e=0,n=0,i=performance.now(),r=i,a=0,s=u=>{let h=u-i;if(i=u,e+=1,n+=h,u-r>=1e3){let g=(u-r)/1e3,C=Math.round(e/g);this.fps.set(C),this.frameTimeMs.set(Math.round(n/Math.max(e,1))),this.heapMb.set(ese()),this.domNodes.set(document.querySelectorAll("*").length),this.fpsSamples.update(k=>{let I=k.length>=Zae?k.slice(1):k.slice();return I.push(C),I}),e=0,n=0,r=u}a=requestAnimationFrame(s)};this.zone.runOutsideAngular(()=>{a=requestAnimationFrame(s)});let c=null;if(typeof PerformanceObserver<"u")try{c=new PerformanceObserver(u=>{this.longTasks.update(h=>h+u.getEntries().length)}),c.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(a),c?.disconnect()}),de(()=>{let u=this.sparklineCanvas(),h=this.fpsSamples();u&&tse(u.nativeElement,h)})}setExpanded(e){this.expanded.set(e),Jae(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-perf-hud"]],viewQuery:function(n,i){n&1&&hn(i.sparklineCanvas,$ae,5),n&2&&jt()},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(n,i){n&1&&(f(0,"p-togglebutton",2),A("ngModelChange",function(a){return i.setExpanded(a)}),S(1,Xae,23,8,"ng-template",null,0,We),_()),n&2&&m("ngModel",i.expanded())("ariaLabel",i.expanded()?i.texts.a11y.collapse:i.texts.a11y.expand)("styleClass",i.expanded()?"perf-hud perf-hud--expanded":"perf-hud")("pt",Re(5,Kae,At(4,Wae)))},dependencies:[kt,Lt,Bt,Zn,Xn],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})}return t})(),YD="sm.perf-hud.expanded";function Qae(){try{return localStorage.getItem(YD)==="1"}catch{return!1}}function Jae(t){try{localStorage.setItem(YD,t?"1":"0")}catch{}}function ese(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function tse(t,o){let e=window.devicePixelRatio||1,n=d0*e,i=uf*e;(t.width!==n||t.height!==i)&&(t.width=n,t.height=i);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,d0,uf),o.length<2))return;let a=Math.max(60,...o),s=d0/(o.length-1);r.beginPath();for(let c=0;c<o.length;c+=1){let u=c*s,h=uf-o[c]/a*uf;c===0?r.moveTo(u,h):r.lineTo(u,h)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var nse="debug-fps",XD=(()=>{class t{visible=X(this.resolveInitial());resolveInitial(){let n=new URLSearchParams(window.location.search).get(nse);return n!==null&&n!=="0"&&n!=="false"?!0:n==="0"||n==="false"?!1:lf.graph.perfHud}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ir={emptyNoSelection:{title:"No node selected",desc:"Select a node to inspect it."},emptyNotFound:{title:"Node not found",descSuffix:" This node is no longer in the scan."},header:{invalidFrontmatter:"invalid frontmatter",invalidFrontmatterTooltip:"The YAML frontmatter could not be parsed, so name, description and other metadata are unavailable. Check the Findings section for the parser error.",tagFilterAriaLabel:t=>`Select every node tagged ${t} on the map`},sections:{annotations:"Annotations",connections:"Connections",findings:"Findings",metadata:"Metadata",plugins:"Plugin contributions",body:"Body"},body:{loading:"Loading body\u2026"},findingHintLabel:"Hint:",actionErrorDismissAriaLabel:"Dismiss",audit:{headerEmpty:"never bumped",fields:{lastBumpedAt:"Last bumped",lastBumpedBy:"by",createdAt:"Created",createdBy:"by"}},supersededByBanner:t=>`Superseded by ${t}`};var ZD={cardHeader:"Annotations",emptyOverlay:"No sidecar (.sm) file present for this node.",emptyAnnotations:"Sidecar present but no annotations are declared yet.",sections:{supersession:"Supersession",provenance:"Authors",repository:"Repository",docs:"Docs"},fields:{supersedes:"Supersedes",supersededBy:"Superseded by",authors:"Authors",license:"License",source:"Source",sourceVersion:"Source version",docsUrl:"Docs URL"},brokenRefTooltip:"This path does not resolve to a node in the current scan scope."};function za(t){if(typeof t!="string"||t.length===0)return null;try{let o=new URL(t);return o.protocol==="http:"||o.protocol==="https:"?t:null}catch{return null}}function ise(t,o){if(t&1&&(f(0,"p",1),b(1),_()),t&2){let e=d(2);l(),x(e.texts.emptyOverlay)}}function ose(t,o){if(t&1&&(f(0,"p",2),b(1),_()),t&2){let e=d(2);l(),x(e.texts.emptyAnnotations)}}function rse(t,o){if(t&1&&M(0,ise,2,1,"p",1)(1,ose,2,1,"p",2),t&2){let e,n=d();D((e=n.overlay())!=null&&e.present?1:0)}}function ase(t,o){if(t&1&&(f(0,"span",4),F(1,"i",5),f(2,"span"),b(3),_()()),t&2){let e=o.$implicit;l(3),x(e)}}function sse(t,o){if(t&1&&re(0,ase,4,1,"span",4,Ue),t&2){d();let e=Ce(0);ae(e.authors)}}function lse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",6),f(2,"span"),b(3),_()()),t&2){d();let e=Ce(0);l(3),x(e.license)}}function cse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",3),M(4,sse,2,0),M(5,lse,4,1,"span",4),_()),t&2){let e=d(2),n=Tt(e.provenance());l(2),x(e.texts.sections.provenance),l(2),D(n.authors.length?4:-1),l(),D(n.license!==null?5:-1)}}function dse(t,o){if(t&1){let e=$();f(0,"a",11),A("click",function(){w(e),d(2);let i=Ce(0),r=d(2);return T(r.onOpenPath(i.supersededBy))})("keydown.enter",function(){w(e),d(2);let i=Ce(0),r=d(2);return T(r.onOpenPath(i.supersededBy))})("keydown.space",function(i){w(e),d(2);let r=Ce(0);return d(2).onOpenPath(r.supersededBy),T(i.preventDefault())}),b(1),_()}if(t&2){d(2);let e=Ce(0);l(),Se(" ",e.supersededBy," ")}}function use(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){d(2);let e=Ce(0),n=d(2);m("pTooltip",n.texts.brokenRefTooltip),l(),x(e.supersededBy)}}function pse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",8),f(2,"span"),b(3),_()(),M(4,dse,2,1,"a",9)(5,use,2,2,"span",10)),t&2){d();let e=Ce(0),n=d(2);l(3),x(n.texts.fields.supersededBy),l(),D(n.isBroken(e.supersededBy)?5:4)}}function hse(t,o){if(t&1){let e=$();f(0,"a",11),A("click",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpenPath(i))})("keydown.enter",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpenPath(i))})("keydown.space",function(i){w(e);let r=d().$implicit;return d(4).onOpenPath(r),T(i.preventDefault())}),b(1),_()}if(t&2){let e=d().$implicit;l(),Se(" ",e," ")}}function fse(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){let e=d().$implicit,n=d(4);m("pTooltip",n.texts.brokenRefTooltip),l(),x(e)}}function mse(t,o){if(t&1&&M(0,hse,2,1,"a",9)(1,fse,2,2,"span",10),t&2){let e=o.$implicit,n=d(4);D(n.isBroken(e)?1:0)}}function _se(t,o){if(t&1&&(f(0,"span",4),F(1,"i",12),f(2,"span"),b(3),_()(),re(4,mse,2,1,null,null,Ue)),t&2){d();let e=Ce(0),n=d(2);l(3),x(n.texts.fields.supersedes),l(),ae(e.supersedes)}}function gse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",7),M(4,pse,6,2),M(5,_se,6,1),_()),t&2){let e=d(2),n=Tt(e.supersession());l(2),x(e.texts.sections.supersession),l(2),D(n.supersededBy!==null?4:-1),l(),D(n.supersedes.length?5:-1)}}function bse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",14),f(2,"a",15),b(3),_()()),t&2){d();let e=Ce(0);l(2),m("href",e.source,lr),l(),x(e.source)}}function vse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",16),f(2,"code"),b(3),_()()),t&2){d();let e=Ce(0);l(3),x(e.sourceVersion)}}function yse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",13),M(4,bse,4,2,"span",4),M(5,vse,4,1,"span",4),_()),t&2){let e=d(2),n=Tt(e.repository());l(2),x(e.texts.sections.repository),l(2),D(n.source!==null?4:-1),l(),D(n.sourceVersion!==null?5:-1)}}function Cse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",18),f(2,"a",15),b(3),_()()),t&2){d();let e=Ce(0);l(2),m("href",e.docsUrl,lr),l(),x(e.docsUrl)}}function xse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",17),M(4,Cse,4,2,"span",4),_()),t&2){let e=d(2),n=Tt(e.docs());l(2),x(e.texts.sections.docs),l(2),D(n.docsUrl!==null?4:-1)}}function wse(t,o){if(t&1&&(f(0,"dl",0),M(1,cse,6,4),M(2,gse,6,4),M(3,yse,6,4),M(4,xse,5,3),_()),t&2){let e=d();l(),D(e.hasProvenance()?1:-1),l(),D(e.hasSupersession()?2:-1),l(),D(e.hasRepository()?3:-1),l(),D(e.hasDocs()?4:-1)}}var JD=(()=>{class t{overlay=B(void 0);knownPaths=B(null);openPath=Ke();texts=ZD;annotations=E(()=>{let e=this.overlay();return!e||!e.present?null:e.annotations??null});hasAnnotations=E(()=>{let e=this.annotations();return e!==null&&Object.keys(e).length>0});hasAnyContent=E(()=>this.hasSupersession()||this.hasProvenance()||this.hasRepository()||this.hasDocs());supersession=E(()=>{let e=this.annotations()??{};return{supersedes:QD(e.supersedes),supersededBy:u0(e.supersededBy)}});hasSupersession=E(()=>pf(this.supersession()));provenance=E(()=>{let e=this.annotations()??{};return{authors:QD(e.authors),license:u0(e.license)}});hasProvenance=E(()=>pf(this.provenance()));repository=E(()=>{let e=this.annotations()??{};return{source:za(e.source),sourceVersion:u0(e.sourceVersion)}});hasRepository=E(()=>pf(this.repository()));docs=E(()=>{let e=this.annotations()??{};return{docsUrl:za(e.docsUrl)}});hasDocs=E(()=>pf(this.docs()));isBroken(e){let n=this.knownPaths();return n?!n.has(e):!1}onOpenPath(e){this.isBroken(e)||this.openPath.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-annotations-panel"]],inputs:{overlay:[1,"overlay"],knownPaths:[1,"knownPaths"]},outputs:{openPath:"openPath"},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-provenance",1,"sm-block__inline"],[1,"sm-block__meta"],["aria-hidden","true",1,"pi","pi-user"],["aria-hidden","true",1,"pi","pi-shield"],["data-testid","annotations-section-supersession",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-arrow-down"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known"],[1,"sm-node-link",3,"pTooltip"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known",3,"click","keydown.enter","keydown.space"],["aria-hidden","true",1,"pi","pi-arrow-up"],["data-testid","annotations-section-repository",1,"sm-block__inline"],["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-docs",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-external-link"]],template:function(n,i){n&1&&M(0,rse,2,1)(1,wse,5,4,"dl",0),n&2&&D(i.hasAnyContent()?1:0)},dependencies:[ze,Ve],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}"],changeDetection:0})}return t})();function u0(t){return typeof t=="string"&&t.length>0?t:null}function QD(t){return Array.isArray(t)?t.filter(o=>typeof o=="string"&&o.length>0):[]}function pf(t){for(let o of Object.values(t))if(o!=null){if(Array.isArray(o)){if(o.length>0)return!0;continue}if(typeof o=="string"){if(o.length>0)return!0;continue}return!0}return!1}var eP={outgoingHeader:"Outgoing",incomingHeader:"Incoming",loading:"Loading links\u2026",error:"Failed to load links.",confidence:{high:"high",medium:"medium",low:"low"},confidenceTooltip:t=>`confidence: ${t}`,issueOnTargetTooltip:"Target has an issue: ",issueOnSourceTooltip:"Source has an issue: ",externalRefsHeader:"External"};var nP=(t,o)=>o.source+"|"+o.target+"|"+o.kind+"|"+((o.trigger==null?null:o.trigger.normalizedTrigger)??""),Tse=(t,o)=>o.url+"|"+(o.line??-1);function Sse(t,o){if(t&1&&(f(0,"p",1),b(1),_()),t&2){let e=d(2);l(),x(e.texts.loading)}}function kse(t,o){if(t&1&&(f(0,"p",2),b(1),_()),t&2){let e=d(2);l(),x(e.texts.error)}}function Ise(t,o){if(t&1&&(f(0,"span",12),b(1),_()),t&2){let e=d().$implicit;O("data-testid","linked-nodes-outgoing-link-"+e.target),l(),x(e.target)}}function Ese(t,o){if(t&1){let e=$();f(0,"button",17),A("click",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpen(i.resolvedTarget??i.target))}),b(1),_()}if(t&2){let e=d().$implicit;O("data-testid","linked-nodes-outgoing-link-"+e.target),l(),x(e.target)}}function Mse(t,o){if(t&1&&(f(0,"span",16),b(1),_()),t&2){let e=o,n=d().$implicit;m("pTooltip",e.message),O("data-severity",e.severity)("data-testid","linked-nodes-outgoing-issue-"+n.target),l(),x(e.analyzerId)}}function Dse(t,o){if(t&1&&(f(0,"li",11),M(1,Ise,2,2,"span",12)(2,Ese,2,2,"button",13),f(3,"span",14),b(4),_(),f(5,"span",15),b(6),_(),M(7,Mse,2,4,"span",16),_()),t&2){let e,n=o.$implicit,i=d(4);O("data-testid","linked-nodes-outgoing-row-"+n.target),l(),D(i.outgoingBroken(n)?1:2),l(2),Ne("color",i.confidenceColor(n.confidence))("border-color",i.confidenceColor(n.confidence)),m("pTooltip",i.confidenceTooltip(n.confidence)),l(),x(i.confidenceValue(n.confidence)),l(),O("data-kind",n.kind),l(),x(n.kind),l(),D((e=i.issueForOutgoing(n))?7:-1,e)}}function Pse(t,o){if(t&1&&(f(0,"section",3)(1,"h4",6),F(2,"sm-icon",7),f(3,"span",8),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",10),re(8,Dse,8,11,"li",11,nP),_()()),t&2){let e=d(3);l(4),x(e.outgoing().length),l(2),x(e.texts.outgoingHeader),l(2),ae(e.outgoing())}}function Rse(t,o){if(t&1){let e=$();f(0,"li",11)(1,"button",17),A("click",function(){let i=w(e).$implicit,r=d(4);return T(r.onOpen(i.source))}),b(2),_(),f(3,"span",14),b(4),_(),f(5,"span",15),b(6),_()()}if(t&2){let e=o.$implicit,n=d(4);O("data-testid","linked-nodes-incoming-row-"+e.source),l(),O("data-testid","linked-nodes-incoming-link-"+e.source),l(),x(e.source),l(),Ne("color",n.confidenceColor(e.confidence))("border-color",n.confidenceColor(e.confidence)),m("pTooltip",n.confidenceTooltip(e.confidence)),l(),x(n.confidenceValue(e.confidence)),l(),O("data-kind",e.kind),l(),x(e.kind)}}function Ose(t,o){if(t&1&&(f(0,"section",4)(1,"h4",6),F(2,"sm-icon",18),f(3,"span",19),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",10),re(8,Rse,7,11,"li",11,nP),_()()),t&2){let e=d(3);l(4),x(e.incoming().length),l(2),x(e.texts.incomingHeader),l(2),ae(e.incoming())}}function Fse(t,o){if(t&1&&(f(0,"li",23)(1,"a",24),b(2),_()()),t&2){let e=o.$implicit;O("data-testid","linked-nodes-external-ref-"+e.url),l(),m("href",e.url,lr)("pTooltip",e.url),l(),x(e.url)}}function Nse(t,o){if(t&1&&(f(0,"section",5)(1,"h4",6),F(2,"sm-icon",20),f(3,"span",21),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",22),re(8,Fse,3,4,"li",23,Tse),_()()),t&2){let e=d(3);l(4),x(e.externalRefs().length),l(2),x(e.texts.externalRefsHeader),l(2),ae(e.externalRefs())}}function Ase(t,o){if(t&1&&(M(0,Pse,10,2,"section",3),M(1,Ose,10,2,"section",4),M(2,Nse,10,2,"section",5)),t&2){let e=d(2);D(e.outgoing().length>0?0:-1),l(),D(e.incoming().length>0?1:-1),l(),D(e.externalRefs().length>0?2:-1)}}function Lse(t,o){if(t&1&&(f(0,"div",0),M(1,Sse,2,1,"p",1)(2,kse,2,1,"p",2)(3,Ase,3,3),_()),t&2){let e,n=d();l(),D((e=n.state())==="loading"?1:e==="error"?2:e==="ready"?3:-1)}}var iP=(()=>{class t{dataSource=p(go);wsEvents=p(ls);destroyRef=p(xt);texts=eP;path=B(null);openPath=Ke();state=X("idle");outgoingRaw=X([]);incomingRaw=X([]);outgoing=E(()=>this.outgoingRaw().filter(e=>!tP(e)));incoming=E(()=>this.incomingRaw().filter(e=>!tP(e)));issues=X([]);externalRefsRaw=X([]);externalRefs=E(()=>this.externalRefsRaw().filter(e=>za(e.url)!==null));fetchToken=0;hasResults=E(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));constructor(){this.wsEvents.scanCompleted$.pipe(Qn(this.destroyRef)).subscribe(()=>{let e=this.path();e&&this.fetch(e)}),de(()=>{let e=this.path();if(!e){this.fetchToken++,this.state.set("idle"),this.outgoingRaw.set([]),this.incomingRaw.set([]);return}this.fetch(e)})}onOpen(e){this.openPath.emit(e)}confidenceTooltip(e){return this.texts.confidenceTooltip(this.texts.confidence[Nv(e)])}confidenceValue(e){return e.toFixed(2)}confidenceColor(e){let n=Math.max(0,Math.min(1,e));return`hsl(${Math.round(n*120)}, 60%, 50%)`}outgoingBroken(e){return this.issueForOutgoing(e)?.severity==="error"}issueForOutgoing(e){let n=this.path();if(!n)return null;let i=[e.target,e.resolvedTarget].filter(r=>typeof r=="string");return this.issues().find(r=>{if(!r.nodeIds.includes(n))return!1;let a=r.data?.target;return typeof a!="string"?!1:i.includes(a)})??null}async fetch(e){let n=++this.fetchToken;this.state.set("loading");try{let[i,r,a]=await Promise.allSettled([this.dataSource.listLinks({from:e}),this.dataSource.listLinks({to:e}),this.dataSource.getNode(e)]);if(n!==this.fetchToken)return;if(i.status!=="fulfilled"||r.status!=="fulfilled"){this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}let s=i.value.items,c=r.value.items,u=Bse(e,s,c),h;try{let g=await this.dataSource.listIssues({nodes:u});if(n!==this.fetchToken)return;h=g.items}catch{if(n!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}this.outgoingRaw.set(s),this.incomingRaw.set(c),this.issues.set(h),this.externalRefsRaw.set(a.status==="fulfilled"?a.value?.item?.externalRefs??[]:[]),this.state.set("ready")}catch{if(n!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error")}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-linked-nodes-panel"]],inputs:{path:[1,"path"]},outputs:{openPath:"openPath"},decls:1,vars:1,consts:[["data-testid","linked-nodes-panel",1,"linked-nodes-panel"],["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"],["data-testid","linked-nodes-outgoing",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-incoming",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-external-refs",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["icon","pi-upload",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-outgoing-count",1,"linked-nodes-panel__section-count"],[1,"linked-nodes-panel__section-label"],[1,"linked-nodes-panel__table"],[1,"linked-nodes-panel__row"],[1,"linked-nodes-panel__path","linked-nodes-panel__path--broken"],["type","button",1,"linked-nodes-panel__path"],[1,"linked-nodes-panel__chip",3,"pTooltip"],[1,"linked-nodes-panel__chip","linked-nodes-panel__chip--kind"],[1,"linked-nodes-panel__chip","linked-nodes-panel__chip--issue",3,"pTooltip"],["type","button",1,"linked-nodes-panel__path",3,"click"],["icon","pi-download",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-incoming-count",1,"linked-nodes-panel__section-count"],["icon","pi-link",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-external-count",1,"linked-nodes-panel__section-count"],[1,"linked-nodes-panel__table","linked-nodes-panel__table--external"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--external-ref"],["tooltipPosition","top","target","_blank","rel","noopener noreferrer",1,"linked-nodes-panel__external-ref-url",3,"href","pTooltip"]],template:function(n,i){n&1&&M(0,Lse,4,1,"div",0),n&2&&D(i.path()?0:-1)},dependencies:[ze,Ve,wb],styles:["[_nghost-%COMP%]{display:block}.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%]{display:flex;align-items:center;gap:.4rem;margin:0 0 .4rem;font-size:.8rem}.linked-nodes-panel__section-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;font-size:.85rem;color:var(--p-text-color)}.linked-nodes-panel__section-count[_ngcontent-%COMP%]{font-weight:700;font-size:.9rem;line-height:1;color:var(--p-text-color)}.linked-nodes-panel__section-label[_ngcontent-%COMP%]{font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__table[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.linked-nodes-panel__row[_ngcontent-%COMP%]{display:flex;flex-flow:row wrap;align-items:center;gap:.4rem;padding:.4rem .25rem;min-width:0}.linked-nodes-panel__row[_ngcontent-%COMP%] + .linked-nodes-panel__row[_ngcontent-%COMP%]{border-top:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{margin:0;padding:0;border:none;background:none;font:inherit;font-size:.8rem;font-weight:400;text-align:left;line-height:1.35;min-width:0;overflow-wrap:anywhere;color:var(--p-primary-color);cursor:pointer}button.linked-nodes-panel__path[_ngcontent-%COMP%]:hover, button.linked-nodes-panel__path[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}.linked-nodes-panel__path--broken[_ngcontent-%COMP%]{color:var(--p-text-color);cursor:default}.linked-nodes-panel__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.02rem .4rem;border:1px solid var(--p-content-border-color);border-radius:999px;font-size:.72rem;line-height:1.5;color:var(--p-text-muted-color);white-space:nowrap}.linked-nodes-panel__chip--kind[_ngcontent-%COMP%]{border-color:var(--sm-edge-neutral);color:var(--sm-edge-neutral)}.linked-nodes-panel__chip--kind[data-kind=invokes][_ngcontent-%COMP%]{border-color:var(--sm-edge-invokes);color:var(--sm-edge-invokes)}.linked-nodes-panel__chip--kind[data-kind=references][_ngcontent-%COMP%]{border-color:var(--sm-edge-references);color:var(--sm-edge-references)}.linked-nodes-panel__chip--kind[data-kind=mentions][_ngcontent-%COMP%]{border-color:var(--sm-edge-mentions);color:var(--sm-edge-mentions)}.linked-nodes-panel__chip--kind[data-kind=supersedes][_ngcontent-%COMP%]{border-color:var(--sm-edge-supersedes-active);color:var(--sm-edge-supersedes-active)}.linked-nodes-panel__chip--issue[data-severity=error][_ngcontent-%COMP%]{border-color:var(--sm-severity-error);color:var(--sm-severity-error)}.linked-nodes-panel__chip--issue[data-severity=warn][_ngcontent-%COMP%]{border-color:var(--sm-severity-warn);color:var(--sm-severity-warn)}.linked-nodes-panel__chip--issue[data-severity=info][_ngcontent-%COMP%]{border-color:var(--sm-severity-info);color:var(--sm-severity-info)}.linked-nodes-panel__row--external-ref[_ngcontent-%COMP%]{font-size:.85rem}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--p-primary-color);text-decoration:none}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})}return t})();function Bse(t,o,e){let n=new Set([t]);for(let i of o)i.resolvedTarget&&n.add(i.resolvedTarget),i.target&&n.add(i.target);for(let i of e)i.source&&n.add(i.source);return[...n]}function tP(t){return!!(t.source===t.target||t.resolvedTarget&&t.source===t.resolvedTarget)}var oP={sections:{definition:"Definition",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",color:"Color",mcpServers:"MCP servers",hooks:"Hooks"},skillBaseFields:{whenToUse:"When to use",argumentHint:"Argument hint",arguments:"Arguments",allowedTools:"Allowed tools",disallowedTools:"Disallowed tools",model:"Model",effort:"Effort",context:"Context",agent:"Agent",shell:"Shell",paths:"Paths",disableModelInvocation:"Model invocation",userInvocable:"User invocable"},unknownFieldTooltip:"Unknown field, not part of the documented frontmatter for this provider.",skillUnresolvedTooltip:"Skill not found in this scan."};var rP=(t,o)=>o.key,Vse=(t,o)=>o.name,zse=(t,o)=>o.event;function Hse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.model),l(3),x(o)}}function qse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.effort),l(3),x(o)}}function Gse(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function jse(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,Gse,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Use(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,jse,3,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.tools),l(2),ae(e.tools())}}function $se(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Wse(t,o){if(t&1&&(f(0,"span",8),F(1,"i",9),f(2,"code"),b(3),_()(),M(4,$se,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(3),x(e),l(),D(n!==i-1?4:-1)}}function Kse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Wse,5,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.disallowedTools),l(2),ae(e.disallowedTools())}}function Yse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.permissionMode),l(3),x(o)}}function Xse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",10),F(3,"span",11),f(4,"code"),b(5),_()()),t&2){let e=o,n=d(5);l(),x(n.texts.fields.color),l(2),Ne("background",e),l(2),x(e)}}function Zse(t,o){if(t&1){let e=$();f(0,"a",14),A("click",function(){let i=w(e),r=d(7);return T(r.openSkill(i))})("keydown.enter",function(){let i=w(e),r=d(7);return T(r.openSkill(i))})("keydown.space",function(i){let r=w(e);return d(7).openSkill(r),T(i.preventDefault())}),F(1,"i",15),b(2),_()}if(t&2){let e=d().$implicit;l(2),Se(" ",e," ")}}function Qse(t,o){if(t&1&&(f(0,"span",13),b(1),_()),t&2){let e=d().$implicit,n=d(6);m("pTooltip",n.texts.skillUnresolvedTooltip),l(),x(e)}}function Jse(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function ele(t,o){if(t&1&&(M(0,Zse,3,1,"a",12)(1,Qse,2,2,"span",13),M(2,Jse,2,0,"span",7)),t&2){let e,n=o.$implicit,i=o.$index,r=o.$count,a=d(6);D((e=a.skillPath(n))?0:1,e),l(2),D(i!==r-1?2:-1)}}function tle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,ele,3,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.skills),l(2),ae(e.skills())}}function nle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.maxTurns),l(3),x(e.maxTurns())}}function ile(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.memory),l(3),x(o)}}function ole(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.background),l(3),x(e.background())}}function rle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.isolation),l(3),x(o)}}function ale(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function sle(t,o){if(t&1&&(f(0,"code",16),b(1),_(),M(2,ale,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;m("pTooltip",e.command??""),l(),x(e.name),l(),D(n!==i-1?2:-1)}}function lle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,sle,3,3,null,null,Vse),_()),t&2){let e=d(5);l(),x(e.texts.fields.mcpServers),l(2),ae(e.mcpServers())}}function cle(t,o){if(t&1&&(f(0,"span",18),b(1,"\u2192"),_(),f(2,"code"),b(3),_()),t&2){let e=d().$implicit;l(3),x(e.keys[0])}}function dle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function ule(t,o){if(t&1&&(f(0,"span",17)(1,"code"),b(2),_(),M(3,cle,4,1),_(),M(4,dle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(2),x(e.event),l(),D(e.keys.length?3:-1),l(),D(n!==i-1?4:-1)}}function ple(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,ule,5,3,null,null,zse),_()),t&2){let e=d(5);l(),x(e.texts.fields.hooks),l(2),ae(e.hooks())}}function hle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",19),F(3,"i",20),f(4,"code"),b(5),_()()),t&2){let e=o.$implicit,n=d(5);l(),x(e.key),l(2),m("pTooltip",n.texts.unknownFieldTooltip),O("aria-label",n.texts.unknownFieldTooltip),l(2),x(e.value)}}function fle(t,o){if(t&1&&(f(0,"dl",5),M(1,Hse,5,2),M(2,qse,5,2),M(3,Use,5,1),M(4,Kse,5,1),M(5,Yse,5,2),M(6,Xse,6,4),M(7,tle,5,1),M(8,nle,5,2),M(9,ile,5,2),M(10,ole,5,2),M(11,rle,5,2),M(12,lle,5,1),M(13,ple,5,1),re(14,hle,6,4,null,null,rP),_()),t&2){let e,n,i,r,a,s,c=d(4);l(),D((e=c.model())?1:-1,e),l(),D((n=c.effort())?2:-1,n),l(),D(c.tools().length?3:-1),l(),D(c.disallowedTools().length?4:-1),l(),D((i=c.permissionMode())?5:-1,i),l(),D((r=c.color())?6:-1,r),l(),D(c.skills().length?7:-1),l(),D(c.maxTurns()!==null?8:-1),l(),D((a=c.memory())?9:-1,a),l(),D(c.background()!==null?10:-1),l(),D((s=c.isolation())?11:-1,s),l(),D(c.mcpServers().length?12:-1),l(),D(c.hooks().length?13:-1),l(),ae(c.extraFields())}}function mle(t,o){if(t&1&&M(0,fle,16,13,"dl",5),t&2){let e=d(3);D(e.hasBehavior()||e.hasCapabilities()||e.extraFields().length?0:-1)}}function _le(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.model),l(3),x(e.model)}}function gle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.effort),l(3),x(e.effort)}}function ble(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd"),b(3),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.whenToUse),l(2),x(e.when_to_use)}}function vle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.argumentHint),l(3),x(e.argumentHint)}}function yle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Cle(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,yle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function xle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Cle,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.arguments),l(2),ae(e.arguments)}}function wle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Tle(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,wle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Sle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Tle,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.allowedTools),l(2),ae(e.allowedTools)}}function kle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Ile(t,o){if(t&1&&(f(0,"span",8),F(1,"i",9),f(2,"code"),b(3),_()(),M(4,kle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(3),x(e),l(),D(n!==i-1?4:-1)}}function Ele(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Ile,5,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.disallowedTools),l(2),ae(e.disallowedTools)}}function Mle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.context),l(3),x(e.context)}}function Dle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.agent),l(3),x(e.agent)}}function Ple(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.shell),l(3),x(e.shell)}}function Rle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Ole(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,Rle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Fle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Ole,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.paths),l(2),ae(e.paths)}}function Nle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4,"disabled"),_()()),t&2){let e=d(5);l(),x(e.texts.skillBaseFields.disableModelInvocation)}}function Ale(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.userInvocable),l(3),x(e.userInvocable)}}function Lle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",19),F(3,"i",20),f(4,"code"),b(5),_()()),t&2){let e=o.$implicit,n=d(5);l(),x(e.key),l(2),m("pTooltip",n.texts.unknownFieldTooltip),O("aria-label",n.texts.unknownFieldTooltip),l(2),x(e.value)}}function Ble(t,o){if(t&1&&(Ut(0),f(1,"dl",21),M(2,_le,5,2),M(3,gle,5,2),M(4,ble,4,2),M(5,vle,5,2),M(6,xle,5,1),M(7,Sle,5,1),M(8,Ele,5,1),M(9,Mle,5,2),M(10,Dle,5,2),M(11,Ple,5,2),M(12,Fle,5,1),M(13,Nle,5,1),M(14,Ale,5,2),re(15,Lle,6,4,null,null,rP),_()),t&2){let e=d(4),n=Tt(e.skillBase());l(2),D(n.model!==null?2:-1),l(),D(n.effort!==null?3:-1),l(),D(n.when_to_use!==null?4:-1),l(),D(n.argumentHint!==null?5:-1),l(),D(n.arguments.length?6:-1),l(),D(n.allowedTools.length?7:-1),l(),D(n.disallowedTools.length?8:-1),l(),D(n.context!==null?9:-1),l(),D(n.agent!==null?10:-1),l(),D(n.shell!==null?11:-1),l(),D(n.paths.length?12:-1),l(),D(n.disableModelInvocation?13:-1),l(),D(n.userInvocable!==null?14:-1),l(),ae(e.extraFields())}}function Vle(t,o){if(t&1&&M(0,Ble,17,14,"dl",21),t&2){let e=d(3);D(e.hasCapabilities()||e.extraFields().length?0:-1)}}function zle(t,o){if(t&1&&(f(0,"p",22),b(1),_(),F(2,"blockquote",23)),t&2){let e=d(3);l(),x(e.texts.sections.initialPrompt),l(),m("innerHTML",e.initialPromptHtml(),ki)}}function Hle(t,o){if(t&1&&(M(0,mle,1,1)(1,Vle,1,1),M(2,zle,3,2)),t&2){let e=d(2);D(e.isAgent()?0:e.isSkillOrCommand()?1:-1),l(2),D(e.hasInitialPrompt()?2:-1)}}function qle(t,o){if(t&1){let e=$();f(0,"div",0)(1,"section",1)(2,"button",2),A("click",function(){w(e);let i=d();return T(i.toggle.emit())}),f(3,"span",3),b(4),_(),F(5,"i",4),_(),M(6,Hle,3,2),_()()}if(t&2){let e=d();l(2),O("aria-expanded",e.expanded()),l(2),x(e.texts.sections.definition),l(),ue("pi-chevron-right",!e.expanded())("pi-chevron-down",e.expanded()),l(),D(e.expanded()?6:-1)}}var Gle=new Set(["name","description","metadata","model","effort","permissionMode","maxTurns","memory","background","isolation","color","tools","disallowedTools","skills","mcpServers","hooks","initialPrompt"]),jle=new Set(["name","description","metadata","when_to_use","argument-hint","arguments","disable-model-invocation","user-invocable","allowed-tools","disallowed-tools","model","effort","context","agent","hooks","paths","shell"]),aP=(()=>{class t{frontmatter=B.required();kind=B.required();provider=B(void 0);skillPathByName=B(null);onSkillClick=B(null);expanded=B(!0);toggle=Ke();texts=oP;markdown=p(bo);hasVendorSurface=E(()=>{let e=this.kind();return e==="agent"||e==="skill"||e==="command"});isAgent=E(()=>this.kind()==="agent");isSkillOrCommand=E(()=>{let e=this.kind();return e==="skill"||e==="command"});tools=E(()=>ff(this.fm().tools));model=E(()=>Qt(this.fm().model));skills=E(()=>ff(this.fm().skills));disallowedTools=E(()=>ff(this.fm().disallowedTools));initialPrompt=E(()=>Qt(this.fm().initialPrompt));permissionMode=E(()=>Qt(this.fm().permissionMode));maxTurns=E(()=>Ule(this.fm().maxTurns));memory=E(()=>Qt(this.fm().memory));background=E(()=>typeof this.fm().background=="boolean"?this.fm().background:null);effort=E(()=>Qt(this.fm().effort));isolation=E(()=>Qt(this.fm().isolation));color=E(()=>df(this.fm().color));mcpServers=E(()=>{let e=this.fm().mcpServers;return Array.isArray(e)?e.filter(n=>typeof n=="object"&&n!==null).map((n,i)=>{let r=n.args,a=Array.isArray(r)?r.length:0;return{name:typeof n.name=="string"&&n.name.length>0?n.name:`mcpServer[${i}]`,command:typeof n.command=="string"?n.command:null,argsCount:a}}):[]});hooks=E(()=>{let e=this.fm().hooks;if(typeof e!="object"||e===null)return[];let n=[];for(let[i,r]of Object.entries(e)){let a=typeof r=="object"&&r!==null?Object.keys(r):[];n.push({event:i,keys:a})}return n});skillBase=E(()=>{let e=this.fm();return{when_to_use:Qt(e.when_to_use),argumentHint:Qt(e["argument-hint"]),arguments:hf(e.arguments),disableModelInvocation:e["disable-model-invocation"]===!0,userInvocable:typeof e["user-invocable"]=="boolean"?e["user-invocable"]:null,allowedTools:hf(e["allowed-tools"]),disallowedTools:hf(e["disallowed-tools"]),model:Qt(e.model),effort:Qt(e.effort),context:Qt(e.context),agent:Qt(e.agent),paths:hf(e.paths),shell:Qt(e.shell)}});hasBehavior=E(()=>this.isAgent()?this.model()!==null||this.permissionMode()!==null||this.maxTurns()!==null||this.memory()!==null||this.background()!==null||this.effort()!==null||this.isolation()!==null||this.color()!==null:!1);hasCapabilities=E(()=>{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 e=this.skillBase();return e.when_to_use!==null||e.argumentHint!==null||e.arguments.length>0||e.allowedTools.length>0||e.disallowedTools.length>0||e.model!==null||e.effort!==null||e.context!==null||e.agent!==null||e.shell!==null||e.paths.length>0||e.disableModelInvocation||e.userInvocable!==null}return!1});hasInitialPrompt=E(()=>this.isAgent()&&this.initialPrompt()!==null);initialPromptHtml=c0(()=>this.initialPrompt()??"",this.markdown);extraFields=E(()=>{let e=this.isAgent()?Gle:this.isSkillOrCommand()?jle:null;if(!e)return[];let n=this.fm(),i=[];for(let r of Object.keys(n)){if(e.has(r))continue;let a=n[r];if(a==null)continue;let s=typeof a=="string"?a:typeof a=="number"||typeof a=="boolean"?String(a):JSON.stringify(a);i.push({key:r,value:s})}return i});hasAnyContent=E(()=>this.hasVendorSurface()&&(this.hasBehavior()||this.hasCapabilities()||this.hasInitialPrompt()||this.extraFields().length>0));skillPath(e){return this.skillPathByName()?.get(e)??null}openSkill(e){let n=this.onSkillClick();n&&n(e)}fm(){return this.frontmatter()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-vendor-frontmatter"]],inputs:{frontmatter:[1,"frontmatter"],kind:[1,"kind"],provider:[1,"provider"],skillPathByName:[1,"skillPathByName"],onSkillClick:[1,"onSkillClick"],expanded:[1,"expanded"]},outputs:{toggle:"toggle"},decls:1,vars:1,consts:[["data-testid","vendor-frontmatter",1,"vfm"],["data-testid","vendor-frontmatter-definition",1,"sm-block","sm-block--collapsible"],["type","button","data-testid","vendor-frontmatter-toggle",1,"sm-block__row","sm-block__row--toggle",3,"click"],[1,"sm-block__title"],["aria-hidden","true",1,"pi","sm-block__chevron"],[1,"sm-block__kv"],[1,"vfm__inline"],["aria-hidden","true",1,"vfm__sep"],[1,"vfm__danger"],["aria-hidden","true",1,"pi","pi-ban"],[1,"vfm__color"],["aria-hidden","true",1,"vfm__swatch"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known"],[1,"sm-node-link",3,"pTooltip"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known",3,"click","keydown.enter","keydown.space"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],[3,"pTooltip"],[1,"vfm__hook"],["aria-hidden","true",1,"vfm__sep-arrow"],[1,"vfm__unknown-dd"],["role","img",1,"pi","pi-exclamation-circle","vfm__unknown",3,"pTooltip"],["data-testid","vendor-frontmatter-skill-base",1,"sm-block__kv"],[1,"sm-block__sub"],["data-testid","vendor-frontmatter-initial-prompt-quote",1,"vfm__quote",3,"innerHTML"]],template:function(n,i){n&1&&M(0,qle,7,7,"div",0),n&2&&D(i.hasAnyContent()?0:-1)},dependencies:[ze,Ve],styles:["[_nghost-%COMP%]{display:block}.vfm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.85rem}.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__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__unknown-dd[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem}.vfm__unknown[_ngcontent-%COMP%]{font-size:.72rem;color:var(--p-text-muted-color);cursor:help;line-height:1}.vfm__color[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.vfm__swatch[_ngcontent-%COMP%]{width:.7rem;height:.7rem;border-radius:50%;flex:none;border:1px solid var(--sm-border)}.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-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-sm) var(--sm-radius-sm) 0}[_nghost-%COMP%] .vfm__quote>:first-child{margin-top:0}[_nghost-%COMP%] .vfm__quote>:last-child{margin-bottom:0}[_nghost-%COMP%] .vfm__quote code{background:var(--sm-bg-content);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.82rem;font-family:var(--sm-font-mono)}[_nghost-%COMP%] .vfm__quote a{color:var(--p-primary-color);text-decoration:underline}"],changeDetection:0})}return t})();function Qt(t){return typeof t=="string"&&t.length>0?t:null}function Ule(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function ff(t){return Array.isArray(t)?t.filter(o=>typeof o=="string"&&o.length>0):[]}function hf(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?ff(t):[]}var sP={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 dP=(t,o)=>o.key,$le=(t,o)=>o.pluginId;function Wle(t,o){if(t&1&&(f(0,"p",0),b(1),_()),t&2){let e=d();l(),x(e.texts.empty)}}function Kle(t,o){if(t&1&&(f(0,"span",5),b(1),_()),t&2){let e=d().$implicit,n=d(3);l(),x(n.texts.rootContribBadge(e.pluginId))}}function Yle(t,o){if(t&1&&(f(0,"div",3)(1,"code",4),b(2),_(),M(3,Kle,2,1,"span",5),f(4,"pre",6),b(5),_()()),t&2){let e=o.$implicit;l(2),x(e.key),l(),D(e.pluginId!==null?3:-1),l(2),x(e.value)}}function Xle(t,o){if(t&1&&(f(0,"div",1),re(1,Yle,6,3,"div",3,dP),_()),t&2){let e=d(2);l(),ae(e.rootContributions())}}function Zle(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){let e=d(4);l(),x(e.texts.unregisteredBadge)}}function Qle(t,o){if(t&1&&(f(0,"dt",12),b(1),_(),f(2,"dd")(3,"pre"),b(4),_()()),t&2){let e=o.$implicit;m("pTooltip",e.description??""),l(),x(e.key),l(3),x(e.value)}}function Jle(t,o){if(t&1&&(f(0,"section",7)(1,"h5",8)(2,"span",9),b(3),_(),M(4,Zle,2,1,"span",10),_(),f(5,"dl",11),re(6,Qle,5,3,null,null,dP),_()()),t&2){let e=o.$implicit;O("data-testid","plugin-contributions-ns-"+e.pluginId),l(3),x(e.pluginId),l(),D(e.registered?-1:4),l(2),ae(e.rows)}}function ece(t,o){if(t&1&&(f(0,"div",2),re(1,Jle,8,3,"section",7,$le),_()),t&2){let e=d(2);l(),ae(e.namespaces())}}function tce(t,o){if(t&1&&(M(0,Xle,3,0,"div",1),M(1,ece,3,0,"div",2)),t&2){let e=d();D(e.rootContributions().length?0:-1),l(),D(e.namespaces().length?1:-1)}}var lP=new Set(["identity","annotations","settings","audit"]),uP=(()=>{class t{dataSource=p(go);sidecarRoot=B(void 0);texts=sP;catalog=X(null);constructor(){this.fetchCatalog()}namespaces=E(()=>{let e=this.sidecarRoot();if(!e)return[];let n=this.catalog(),i=new Map;if(n)for(let a of n){if(a.location!=="namespaced")continue;let s=i.get(a.pluginId);s?s.push(a):i.set(a.pluginId,[a])}let r=[];for(let[a,s]of Object.entries(e)){if(lP.has(a)||this.isRegisteredRootKey(a))continue;let u=typeof s=="object"&&s!==null&&!Array.isArray(s)?s:{value:s},h=i.has(a),g=i.get(a)??[],C=Object.entries(u).map(([k,I])=>({key:k,value:cP(I),description:h?nce(g,k):null}));r.push({pluginId:a,registered:h,rows:C})}return r});rootContributions=E(()=>{let e=this.sidecarRoot();if(!e)return[];let n=this.catalog();if(!n)return[];let i=new Map;for(let a of n)a.location==="root"&&i.set(a.key,a);let r=[];for(let[a,s]of Object.entries(e)){if(lP.has(a))continue;let c=i.get(a);c&&r.push({key:a,pluginId:c.pluginId,value:cP(s)})}return r});count=E(()=>this.namespaces().length+this.rootContributions().length);isEmpty=E(()=>this.count()===0);isRegisteredRootKey(e){let n=this.catalog();return n?n.some(i=>i.location==="root"&&i.key===e):!1}async fetchCatalog(){try{let e=await this.dataSource.getRegisteredAnnotations();this.catalog.set(e)}catch{this.catalog.set([])}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,Wle,2,1,"p",0)(1,tce,2,2),n&2&&D(i.isEmpty()?0:1)},dependencies:[ze,Ve],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})}return t})();function cP(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 nce(t,o){for(let e of t)if(e.key===o){let n=e.schema.description;return typeof n=="string"&&n.length>0?n:null}return null}var ice=[[["","smSectionTitleExtra",""]],"*"],oce=["[smSectionTitleExtra]","*"],mf=(()=>{class t{title=B.required();expanded=B.required();toggleTestid=B();toggleAriaLabel=B();toggleTooltip=B();toggle=Ke();static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-collapsible-section"]],hostAttrs:[1,"sm-block","sm-block--collapsible"],inputs:{title:[1,"title"],expanded:[1,"expanded"],toggleTestid:[1,"toggleTestid"],toggleAriaLabel:[1,"toggleAriaLabel"],toggleTooltip:[1,"toggleTooltip"]},outputs:{toggle:"toggle"},ngContentSelectors:oce,decls:6,vars:9,consts:[["type","button",1,"sm-block__row","sm-block__row--toggle",3,"click","pTooltip"],[1,"sm-block__title"],["aria-hidden","true",1,"pi","sm-block__chevron"]],template:function(n,i){n&1&&(pn(ice),f(0,"button",0),A("click",function(){return i.toggle.emit()}),f(1,"span",1),b(2),$e(3),_(),F(4,"i",2),_(),$e(5,1)),n&2&&(m("pTooltip",i.toggleTooltip()??""),O("aria-expanded",i.expanded())("aria-label",i.toggleAriaLabel()??null)("data-testid",i.toggleTestid()??null),l(2),Se(" ",i.title()," "),l(2),ue("pi-chevron-right",!i.expanded())("pi-chevron-down",i.expanded()))},dependencies:[ze,Ve],encapsulation:2,changeDetection:0})}return t})();var rce=t=>({inputs:t}),ace=(t,o)=>o.pluginId,sce=(t,o)=>o.qualifiedId;function lce(t,o){t&1&&le(0)}function cce(t,o){if(t&1&&(f(0,"div",3),S(1,lce,1,0,"ng-container",4),_()),t&2){let e=o.$implicit,n=d(3);O("data-testid","contribution-"+e.qualifiedId.replaceAll("/","-")),l(),m("ngComponentOutlet",n.rendererFor(e.slot))("ngComponentOutletInputs",Re(3,rce,e.rendererInputs))}}function dce(t,o){if(t&1&&(f(0,"div",2),re(1,cce,2,5,"div",3,sce),_()),t&2){let e=d().$implicit;l(),ae(e.bricks)}}function uce(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",1),A("toggle",function(){let i=w(e).$implicit,r=d();return T(r.toggle(i.pluginId))}),M(1,dce,3,0,"div",2),_()}if(t&2){let e=o.$implicit,n=d();m("title",e.pluginId)("expanded",n.expanded(e.pluginId))("toggleTestid","inspector-plugin-section-toggle-"+e.pluginId),O("data-testid","inspector-plugin-section-"+e.pluginId),l(),D(n.expanded(e.pluginId)?1:-1)}}var pP="skill-map.ui.inspector.plugin-sections",p0=100,hP=(()=>{class t{node=B(null);registry=p(xb);collapseState=X(pce());groups=E(()=>{let e=this.node();if(!e)return[];let n=(e.contributions??[]).filter(a=>kb(a.slot)&&Ib.has(a.slot));if(n.length===0)return[];let i=new Map;for(let a of n){let s=i.get(a.pluginId);s?s.push(a):i.set(a.pluginId,[a])}let r=[];for(let[a,s]of i){let c=p0,u=s.map(h=>{let g=`${h.pluginId}/${h.extensionId}/${h.contributionId}`,C=this.registry.get(g);return typeof C?.pluginOrder=="number"&&(c=C.pluginOrder),{c:h,qualifiedId:g,extensionOrder:C?.extensionOrder??p0,priority:C?.priority??p0,inputs:Eb(h,h.slot,e.path,C)}}).sort((h,g)=>h.extensionOrder!==g.extensionOrder?h.extensionOrder-g.extensionOrder:h.priority!==g.priority?h.priority-g.priority:h.qualifiedId<g.qualifiedId?-1:h.qualifiedId>g.qualifiedId?1:0);r.push({pluginId:a,pluginOrder:c,bricks:u.map(h=>({qualifiedId:h.qualifiedId,slot:h.c.slot,rendererInputs:h.inputs}))})}return r.sort((a,s)=>a.pluginOrder!==s.pluginOrder?a.pluginOrder-s.pluginOrder:a.pluginId<s.pluginId?-1:a.pluginId>s.pluginId?1:0),r});expanded(e){return this.collapseState()[e]??!1}toggle(e){this.collapseState.update(n=>Dt(ge({},n),{[e]:!(n[e]??!1)})),hce(this.collapseState())}rendererFor(e){return Sb[e]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-plugin-sections"]],inputs:{node:[1,"node"]},decls:2,vars:0,consts:[[3,"title","expanded","toggleTestid"],[3,"toggle","title","expanded","toggleTestid"],[1,"ips__bricks"],[1,"ips__brick"],[4,"ngComponentOutlet","ngComponentOutletInputs"]],template:function(n,i){n&1&&re(0,uce,2,5,"sm-collapsible-section",0,ace),n&2&&ae(i.groups())},dependencies:[M0,mf],styles:["[_nghost-%COMP%]{display:contents}.ips__bricks[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.ips__brick[_ngcontent-%COMP%]{display:block}"],changeDetection:0})}return t})();function pce(){try{let t=localStorage.getItem(pP);if(!t)return{};let o=JSON.parse(t);return typeof o=="object"&&o!==null?o:{}}catch{return{}}}function hce(t){try{localStorage.setItem(pP,JSON.stringify(t))}catch{}}var fP={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"},diffMarker:"!=",absentMarker:"(absent)",notSetMarker:"(not set)",copiedLabel:"Copied",copyA11y:t=>`Copy ${t} to clipboard`};var fce=(t,o,e)=>({key:"body-stored",label:t,value:o,drift:e}),mce=(t,o,e)=>({key:"body-live",label:t,value:o,drift:e}),_ce=(t,o,e)=>({key:"fm-stored",label:t,value:o,drift:e}),gce=(t,o,e)=>({key:"fm-live",label:t,value:o,drift:e});function bce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function vce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function yce(t,o){t&1&&le(0)}function Cce(t,o){if(t&1&&S(0,yce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,fce,e.texts.fields.bodyHashStored,o,e.bodyHashDrift()))}}function xce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function wce(t,o){t&1&&le(0)}function Tce(t,o){if(t&1&&S(0,wce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,mce,e.texts.fields.bodyHashLive,o,e.bodyHashDrift()))}}function Sce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function kce(t,o){t&1&&le(0)}function Ice(t,o){if(t&1&&S(0,kce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,_ce,e.texts.fields.frontmatterHashStored,o,e.frontmatterHashDrift()))}}function Ece(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Mce(t,o){t&1&&le(0)}function Dce(t,o){if(t&1&&S(0,Mce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,gce,e.texts.fields.frontmatterHashLive,o,e.frontmatterHashDrift()))}}function Pce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Rce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Oce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.notSetMarker)}}function Fce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Nce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.notSetMarker)}}function Ace(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Lce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Bce(t,o){if(t&1&&(f(0,"span",13),b(1),_()),t&2){let e=d(2);l(),x(e.texts.copiedLabel)}}function Vce(t,o){if(t&1){let e=$();f(0,"button",12),A("click",function(){let i=w(e),r=i.key,a=i.value,s=d();return T(s.copyHash(r,a))}),f(1,"code"),b(2),_(),M(3,Bce,2,1,"span",13),_()}if(t&2){let e=o.key,n=o.label,i=o.value,r=o.drift,a=d();O("title",i)("aria-label",a.texts.copyA11y(n)),l(),ue("dbg__diff",r),l(),x(a.truncateHash(i)),l(),D(a.copiedKey()===e?3:-1)}}var mP=(()=>{class t{node=B.required();sidecarRoot=B(null);overlay=B(void 0);texts=fP;copiedKey=X(null);identityBlock=E(()=>{let e=this.sidecarRoot(),n={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!e)return n;let i=e.identity;if(typeof i!="object"||i===null)return n;let r=i,a=typeof r.resolvedAs=="object"&&r.resolvedAs!==null?r.resolvedAs:null;return{path:typeof r.path=="string"?r.path:null,bodyHash:typeof r.bodyHash=="string"?r.bodyHash:null,frontmatterHash:typeof r.frontmatterHash=="string"?r.frontmatterHash:null,resolvedProvider:a&&typeof a.provider=="string"?a.provider:null,resolvedKind:a&&typeof a.kind=="string"?a.kind:null}});bodyHashLive=E(()=>this.node().bodyHash??null);frontmatterHashLive=E(()=>this.node().frontmatterHash??null);bodyHashDrift=E(()=>{let e=this.identityBlock().bodyHash,n=this.bodyHashLive();return e!==null&&n!==null&&e!==n});frontmatterHashDrift=E(()=>{let e=this.identityBlock().frontmatterHash,n=this.frontmatterHashLive();return e!==null&&n!==null&&e!==n});sidecarStatusLiteral=E(()=>{let e=this.overlay();if(!e)return null;let n=e.status??null;return n===null?null:String(n)});async copyHash(e,n){try{await navigator.clipboard.writeText(n),this.copiedKey.set(e),setTimeout(()=>{this.copiedKey()===e&&this.copiedKey.set(null)},2e3)}catch{}}truncateHash(e){return e.length>20?`${e.slice(0,20)}...`:e}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-debug-panel"]],inputs:{node:[1,"node"],sidecarRoot:[1,"sidecarRoot"],overlay:[1,"overlay"]},decls:43,vars:16,consts:[["hashCell",""],["data-testid","inspector-debug-panel",1,"sm-block__kv","dbg__kv"],["data-testid","dbg-for-path"],[1,"dbg__absent"],["data-testid","dbg-body-hash-stored"],["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"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["type","button",1,"dbg__copy",3,"click"],["role","status",1,"dbg__copied"]],template:function(n,i){if(n&1&&(f(0,"dl",1)(1,"dt"),b(2),_(),f(3,"dd",2),M(4,bce,2,1,"code")(5,vce,2,1,"span",3),_(),f(6,"dt"),b(7),_(),f(8,"dd",4),M(9,Cce,1,6,"ng-container")(10,xce,2,1,"span",3),_(),f(11,"dt"),b(12),_(),f(13,"dd",5),M(14,Tce,1,6,"ng-container")(15,Sce,2,1,"span",3),_(),f(16,"dt"),b(17),_(),f(18,"dd",6),M(19,Ice,1,6,"ng-container")(20,Ece,2,1,"span",3),_(),f(21,"dt"),b(22),_(),f(23,"dd",7),M(24,Dce,1,6,"ng-container")(25,Pce,2,1,"span",3),_(),f(26,"dt"),b(27),_(),f(28,"dd",8),M(29,Rce,2,1,"code")(30,Oce,2,1,"span",3),_(),f(31,"dt"),b(32),_(),f(33,"dd",9),M(34,Fce,2,1,"code")(35,Nce,2,1,"span",3),_(),f(36,"dt"),b(37),_(),f(38,"dd",10),M(39,Ace,2,1,"code")(40,Lce,2,1,"span",3),_()(),S(41,Vce,4,6,"ng-template",null,0,We)),n&2){let r,a,s,c,u,h,g,C;l(2),x(i.texts.fields.forPath),l(2),D((r=i.identityBlock().path)?4:5,r),l(3),x(i.texts.fields.bodyHashStored),l(2),D((a=i.identityBlock().bodyHash)?9:10,a),l(3),x(i.texts.fields.bodyHashLive),l(2),D((s=i.bodyHashLive())?14:15,s),l(3),x(i.texts.fields.frontmatterHashStored),l(2),D((c=i.identityBlock().frontmatterHash)?19:20,c),l(3),x(i.texts.fields.frontmatterHashLive),l(2),D((u=i.frontmatterHashLive())?24:25,u),l(3),x(i.texts.fields.resolvedProvider),l(2),D((h=i.identityBlock().resolvedProvider)?29:30,h),l(3),x(i.texts.fields.resolvedKind),l(2),D((g=i.identityBlock().resolvedKind)?34:35,g),l(3),x(i.texts.fields.sidecarStatus),l(2),D((C=i.sidecarStatusLiteral())?39:40,C)}},dependencies:[Rt],styles:["[_nghost-%COMP%]{display:block}.dbg__kv[_ngcontent-%COMP%] .dbg__diff[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.dbg__kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{word-break:break-all}.dbg__absent[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted);font-style:italic}.dbg__copy[_ngcontent-%COMP%]{display:inline-flex;align-items:baseline;gap:.4rem;padding:0;border:none;background:none;font:inherit;color:inherit;text-align:left;cursor:pointer}.dbg__copy[_ngcontent-%COMP%]:hover code[_ngcontent-%COMP%]{text-decoration:underline dotted;text-underline-offset:2px}.dbg__copy[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px;border-radius:var(--sm-radius-sm)}.dbg__copied[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.72rem;font-style:italic;color:var(--sm-severity-success)}"],changeDetection:0})}return t})();function zce(t,o){if(t&1&&(se(0,"span",3),ie(1,"i",6),se(2,"span"),b(3),se(4,"code"),b(5),fe()()()),t&2){d(2);let e=Ce(0),n=d();l(3),Se("",n.texts.fields.lastBumpedBy," "),l(2),x(e.lastBumpedBy)}}function Hce(t,o){if(t&1&&(se(0,"dt"),b(1),fe(),se(2,"dd",2)(3,"span",3),ie(4,"i",4),se(5,"span",5),b(6),fe()(),M(7,zce,6,2,"span",3),fe()),t&2){d();let e=Ce(0),n=d();l(),x(n.texts.fields.lastBumpedAt),l(4),ot("title",e.lastBumpedAt),l(),x(n.lastBumpedRel()),l(),D(e.lastBumpedBy!==null?7:-1)}}function qce(t,o){if(t&1&&(se(0,"span",3),ie(1,"i",6),se(2,"span"),b(3),se(4,"code"),b(5),fe()()()),t&2){d(2);let e=Ce(0),n=d();l(3),Se("",n.texts.fields.createdBy," "),l(2),x(e.createdBy)}}function Gce(t,o){if(t&1&&(se(0,"dt"),b(1),fe(),se(2,"dd",7)(3,"span",3),ie(4,"i",8),se(5,"span",5),b(6),fe()(),M(7,qce,6,2,"span",3),fe()),t&2){d();let e=Ce(0),n=d();l(),x(n.texts.fields.createdAt),l(4),ot("title",e.createdAt),l(),x(n.createdRel()),l(),D(e.createdBy!==null?7:-1)}}function jce(t,o){if(t&1&&(Ut(0),se(1,"dl",0),M(2,Hce,8,4),M(3,Gce,8,4),fe()),t&2){let e=Tt(d().audit());l(2),D(e.lastBumpedAt!==null?2:-1),l(),D(e.createdAt!==null?3:-1)}}function Uce(t,o){if(t&1&&(se(0,"p",1),b(1),fe()),t&2){let e=d();l(),x(e.texts.headerEmpty)}}var _P=(()=>{class t{sidecarRoot=B(null);texts=ir.audit;audit=E(()=>{let e=this.sidecarRoot(),n={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!e)return n;let i=e.audit;if(typeof i!="object"||i===null)return n;let r=i;return{lastBumpedAt:_f(r.lastBumpedAt),lastBumpedBy:_f(r.lastBumpedBy),createdAt:_f(r.createdAt),createdBy:_f(r.createdBy)}});hasContent=E(()=>{let e=this.audit();return e.lastBumpedAt!==null||e.lastBumpedBy!==null||e.createdAt!==null||e.createdBy!==null});lastBumpedRel=E(()=>{let e=this.audit().lastBumpedAt;return e===null?null:Rf(e)});createdRel=E(()=>{let e=this.audit().createdAt;return e===null?null:Rf(e)});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-audit-panel"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","inspector-audit-panel",1,"sm-block__kv"],["data-testid","inspector-audit-panel-empty",1,"audit__empty"],["data-testid","inspector-audit-last-bumped",1,"sm-block__inline"],[1,"sm-block__meta"],["aria-hidden","true",1,"pi","pi-history"],[3,"title"],["aria-hidden","true",1,"pi","pi-user"],["data-testid","inspector-audit-created",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-calendar-plus"]],template:function(n,i){n&1&&M(0,jce,4,3,"dl",0)(1,Uce,2,1,"p",1),n&2&&D(i.hasContent()?0:1)},styles:["[_nghost-%COMP%]{display:block}.audit__empty[_ngcontent-%COMP%]{margin:0;font-style:italic;color:var(--sm-text-muted);font-size:.85rem}"],changeDetection:0})}return t})();function _f(t){return typeof t=="string"&&t.length>0?t:null}function $ce(t,o){if(t&1&&(f(0,"span",7),F(1,"i",16),b(2),_()),t&2){let e=d();m("pTooltip",e.texts.header.invalidFrontmatterTooltip),l(2),Se(" ",e.texts.header.invalidFrontmatter," ")}}function Wce(t,o){t&1&&(f(0,"span",8),b(1),_()),t&2&&(l(),x(o))}function Kce(t,o){if(t&1&&(f(0,"span",9)(1,"span",17),b(2,"\u25CF"),_(),b(3),_()),t&2){let e=o,n=d();m("pTooltip",e==="experimental"?n.cardTexts.stability.experimental:e==="deprecated"?n.cardTexts.stability.deprecated:""),O("data-stability",e),l(3),Se(" ",e," ")}}function Yce(t,o){if(t&1){let e=$();f(0,"button",19),A("click",function(){let i=w(e).$implicit,r=d(2);return T(r.tagClick.emit(i))}),F(1,"i",20),b(2),_()}if(t&2){let e=o.$implicit,n=d(2);ue("inspector__tag--active",n.isActiveTag(e)),O("aria-pressed",n.isActiveTag(e))("aria-label",n.texts.header.tagFilterAriaLabel(e)),l(2),Se(" ",e," ")}}function Xce(t,o){if(t&1&&(f(0,"div",15),re(1,Yce,3,5,"button",18,Ue),_()),t&2){let e=d();l(),ae(e.headerTags())}}var Zce=new Set(["red","orange","yellow","green","cyan","blue","purple","pink"]),gP=(()=>{class t{node=B.required();frontmatterInvalid=B(!1);activeTag=B(null);favoriteToggle=Ke();tagClick=Ke();texts=ir;cardTexts=ti;headerName=E(()=>{let e=this.node(),n=e.frontmatter.name;return typeof n=="string"&&n.trim().length>0?n:e.path.split("/").pop()??e.path});headerVersion=E(()=>is(this.node()));headerStability=E(()=>po(this.node()));headerTitleColor=E(()=>{let e=this.node(),i=e.frontmatter.color;return typeof i=="string"&&Zce.has(i)?i:`var(--sm-kind-${e.kind})`});headerTags=E(()=>ho(this.node()));isActiveTag(e){return this.activeTag()===e}onFavoriteClick(e){e.stopPropagation(),this.favoriteToggle.emit(this.node().path)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-header"]],inputs:{node:[1,"node"],frontmatterInvalid:[1,"frontmatterInvalid"],activeTag:[1,"activeTag"]},outputs:{favoriteToggle:"favoriteToggle",tagClick:"tagClick"},decls:19,vars:19,consts:[["data-testid","inspector-title",1,"inspector__header"],["data-testid","inspector-kind-chip",1,"inspector__kind-eyebrow"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","provider","size"],[1,"inspector__content"],[1,"inspector__name-row"],["data-testid","inspector-title-text",1,"inspector__name"],["data-testid","inspector-fm-invalid",1,"inspector__fm-invalid",3,"pTooltip"],["data-testid","inspector-version",1,"inspector__name-version"],["data-testid","inspector-stability-tag",1,"inspector__stability",3,"pTooltip"],["data-testid","inspector-path",1,"inspector__path-code"],[1,"inspector__actions-cluster"],["type","button","data-testid","inspector-favorite",1,"inspector__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["slot","inspector.header.badge",3,"node"],["data-testid","inspector-header-tags",1,"inspector__tags"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["aria-hidden","true",1,"inspector__stability-dot"],["type","button","data-testid","inspector-header-tag",1,"inspector__tag",3,"inspector__tag--active"],["type","button","data-testid","inspector-header-tag",1,"inspector__tag",3,"click"],["aria-hidden","true",1,"pi","pi-tag"]],template:function(n,i){if(n&1&&(f(0,"header",0)(1,"span",1),b(2),_(),f(3,"div",2),F(4,"sm-kind-icon",3),_(),f(5,"div",4)(6,"div",5)(7,"h2",6),b(8),_(),M(9,$ce,3,2,"span",7),M(10,Wce,2,1,"span",8),M(11,Kce,4,3,"span",9),_(),f(12,"code",10),b(13),_()(),f(14,"div",11)(15,"button",12),A("click",function(a){return i.onFavoriteClick(a)}),F(16,"i",13),_(),F(17,"sm-view-contributions-host",14),_(),M(18,Xce,3,0,"div",15),_()),n&2){let r,a,s=i.node();l(2),x(s.kind),l(2),m("kind",s.kind)("provider",s.provider)("size",18),l(4),x(i.headerName()),l(),D(i.frontmatterInvalid()?9:-1),l(),D((r=i.headerVersion())?10:-1,r),l(),D((a=i.headerStability())?11:-1,a),l(2),x(s.path),l(2),ue("inspector__favorite--on",s.isFavorite===!0),m("pTooltip",s.isFavorite===!0?i.cardTexts.favoriteRemoveTooltip:i.cardTexts.favoriteAddTooltip),O("aria-label",s.isFavorite===!0?i.cardTexts.ariaFavoriteRemove:i.cardTexts.ariaFavoriteAdd),l(),ue("pi-star-fill",s.isFavorite===!0)("pi-star",s.isFavorite!==!0),l(),m("node",s),l(),D(i.headerTags().length>0?18:-1)}},dependencies:[ze,Ve,nr,Jn],styles:["[_nghost-%COMP%]{display:block}.inspector__header[_ngcontent-%COMP%]{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.3rem;align-items:start;padding:0 .85rem .85rem;background:color-mix(in srgb,var(--accent) 10%,transparent);color:var(--p-text-color);border-left:3px solid var(--accent);border-bottom:1px solid var(--sm-border)}.inspector__kind-eyebrow[_ngcontent-%COMP%]{grid-column:1 / -1;grid-row:1;font-size:.78rem;font-weight:600;color:var(--accent);text-transform:lowercase;line-height:1.2}.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-column:1;grid-row:2;align-self:start}.inspector__content[_ngcontent-%COMP%]{min-width:0;width:100%;display:flex;flex-direction:column;gap:.18rem}.inspector__name-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem;min-width:0}.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__fm-invalid[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.7rem;font-weight:500;text-transform:lowercase;white-space:nowrap;cursor:help;color:var(--sm-severity-warn);background:color-mix(in srgb,var(--sm-severity-warn) 12%,transparent);border:1px solid color-mix(in srgb,var(--sm-severity-warn) 35%,transparent)}.inspector__fm-invalid[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.68rem}.inspector__stability[_ngcontent-%COMP%]{font-size:.78rem;font-weight:500;text-transform:lowercase;cursor:help;white-space:nowrap}.inspector__stability-dot[_ngcontent-%COMP%]{margin-right:.25rem;font-size:.55rem;vertical-align:middle}.inspector__stability[data-stability=stable][_ngcontent-%COMP%]{color:var(--sm-severity-success)}.inspector__stability[data-stability=experimental][_ngcontent-%COMP%]{color:var(--sm-severity-info)}.inspector__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__actions-cluster[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.3rem;align-self:start}.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__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__tags[_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__tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.1rem .5rem;border:1px solid transparent;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--p-text-color);font-size:.72rem;font-weight:500;line-height:1.35;cursor:pointer;transition:background .12s ease-out,color .12s ease-out,border-color .12s ease-out}.inspector__tag[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.62rem;opacity:.7}.inspector__tag[_ngcontent-%COMP%]:not(.inspector__tag--active):hover{border-color:var(--sm-border);color:var(--p-primary-color)}.inspector__tag[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.inspector__tag--active[_ngcontent-%COMP%]{background:var(--p-primary-color);color:var(--p-primary-contrast-color);border-color:var(--p-primary-color)}.inspector__tag--active[_ngcontent-%COMP%]:hover{filter:brightness(1.08)}.inspector__tag--active[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return t})();var bP={header:"Allow skill-map to create files in this project?",body:"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.",alwaysLabel:"Always allow editing .sm files in this project",alwaysHint:"When off, we ask again on the next write. When on, the choice is remembered for this project on this machine.",accept:"Allow",reject:"Not now",ariaLabel:"Sidecar write consent"};var Qce=()=>({width:"32rem"}),vP=(()=>{class t{texts=bP;open=B(!1);decision=Ke();always=X(!1);alwaysChecked=E(()=>this.always());resetOnOpen=de(()=>{this.open()&&this.always.set(!1)});accept(){this.decision.emit({accepted:!0,always:this.always()})}decline(){this.decision.emit({accepted:!1,always:!1})}onVisibleChange(e){e||this.decline()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-sidecar-consent-dialog"]],inputs:{open:[1,"open"]},outputs:{decision:"decision"},decls:13,vars:19,consts:[["data-testid","sidecar-consent-dialog",3,"visibleChange","visible","modal","closable","draggable","resizable","dismissableMask","header"],["data-testid","sidecar-consent-body",1,"consent__body"],["data-testid","sidecar-consent-always-row",1,"consent__always"],["inputId","sidecar-consent-always","data-testid","sidecar-consent-always",3,"ngModelChange","ngModel","binary"],[1,"consent__always-text"],[1,"consent__always-label"],[1,"consent__always-hint"],[1,"consent__actions"],["severity","secondary","data-testid","sidecar-consent-reject",3,"onClick","label","text"],["severity","primary","data-testid","sidecar-consent-accept",3,"onClick","label"]],template:function(n,i){n&1&&(f(0,"p-dialog",0),A("visibleChange",function(a){return i.onVisibleChange(a)}),f(1,"p",1),b(2),_(),f(3,"label",2)(4,"p-checkbox",3),ur("ngModelChange",function(a){return dr(i.always,a)||(i.always=a),a}),_(),f(5,"span",4)(6,"span",5),b(7),_(),f(8,"span",6),b(9),_()()(),f(10,"div",7)(11,"p-button",8),A("onClick",function(){return i.decline()}),_(),f(12,"p-button",9),A("onClick",function(){return i.accept()}),_()()()),n&2&&(Pt(At(18,Qce)),m("visible",i.open())("modal",!0)("closable",!0)("draggable",!1)("resizable",!1)("dismissableMask",!0)("header",i.texts.header),O("aria-label",i.texts.ariaLabel),l(2),x(i.texts.body),l(2),cr("ngModel",i.always),m("binary",!0),l(3),x(i.texts.alwaysLabel),l(2),x(i.texts.alwaysHint),l(2),m("label",i.texts.reject)("text",!0),l(),m("label",i.texts.accept))},dependencies:[kt,Lt,Bt,kn,_n,fs,hs,pb,ub],styles:[".consent__body[_ngcontent-%COMP%]{margin:0 0 1rem;line-height:1.5;color:var(--p-text-color)}.consent__always[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.6rem;cursor:pointer;margin-bottom:1.25rem}.consent__always-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.2rem}.consent__always-label[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color)}.consent__always-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--p-text-muted-color);line-height:1.4}.consent__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem}"],changeDetection:0})}return t})();function h0(t){Ln(h0);let{path:o,dataSource:e,markdown:n}=t,i=X("idle"),r=X(null),a=0,s=async(c,u)=>{try{let h=await e.getNode(c,{includeBody:!0});if(u!==a)return;if(h===null){i.set("unavailable");return}let g=h.item.body;if(g===null){i.set("unavailable");return}if(g===void 0||g.trim().length===0){i.set("empty");return}let C=await n.render(g);if(u!==a)return;r.set(C),i.set("ready")}catch{if(u!==a)return;i.set("error")}};return de(()=>{let c=o(),u=++a;if(r.set(null),!c){i.set("idle");return}i.set("loading"),s(c,u)}),t.scanCompleted$?.pipe(Qn()).subscribe(()=>{let c=o();c&&s(c,++a)}),{bodyState:i.asReadonly(),bodyHtml:r.asReadonly()}}function f0(t){Ln(f0);let{path:o,pathSet:e,dataSource:n}=t,i=X(new Set),r=X(new Set),a=X(new Set);return de(()=>{o(),i.set(new Set),r.set(new Set),a.set(new Set)}),{linkStatus:h=>e().has(h)||i().has(h)?"live":r().has(h)?"dead-confirmed":"dead-heuristic",isVerifying:h=>a().has(h),verifyDeadLink:async h=>{if(!(i().has(h)||r().has(h))&&!a().has(h)){a.update(g=>new Set(g).add(h));try{await n.getNode(h)===null?r.update(C=>new Set(C).add(h)):i.update(C=>new Set(C).add(h))}catch{}finally{a.update(g=>{let C=new Set(g);return C.delete(h),C})}}}}}var CP="skill-map.ui.inspector.sections",Jce={body:!0,findings:!0};function yP(t){return Jce[t]??!1}function m0(){Ln(m0);let t=X(ede());return de(()=>{tde(t())}),{expanded:o=>t()[o]??yP(o),toggle:o=>t.update(e=>Dt(ge({},e),{[o]:!(e[o]??yP(o))}))}}function ede(){try{let t=localStorage.getItem(CP);if(!t)return{};let o=JSON.parse(t);if(o===null||typeof o!="object"||Array.isArray(o))return{};let e={};for(let[n,i]of Object.entries(o))typeof i=="boolean"&&(e[n]=i);return e}catch{return{}}}function tde(t){try{localStorage.setItem(CP,JSON.stringify(t))}catch{}}var nde=new Set(["identity","annotations","settings","audit"]),ide=new Set(["agent","skill","command"]);function xP(t){let{node:o}=t,e=E(()=>{let s=o()?.sidecar;if(!s||!s.present)return null;if(s.root)return s.root;let c={};return s.annotations&&(c.annotations=s.annotations),c}),n=E(()=>{let s=o()?.kind;return s!==void 0&&ide.has(s)}),i=E(()=>{let s=o();return s?(s.linksOutCount??0)+(s.linksInCount??0)+(s.externalRefsCount??0)>0:!1}),r=E(()=>{let s=e();if(!s)return!1;for(let c of Object.keys(s))if(!nde.has(c))return!0;return!1}),a=E(()=>e()!==null);return{sidecarRoot:e,hasVendorFrontmatter:n,hasConnections:i,hasPluginContributions:r,hasMetadata:a}}function ode(t,o){if(t&1&&(f(0,"section",0)(1,"div",2),F(2,"span",3),f(3,"p",4),b(4),_(),f(5,"p",5),b(6),_()()()),t&2){let e=d();l(4),x(e.texts.emptyNoSelection.title),l(2),x(e.texts.emptyNoSelection.desc)}}function rde(t,o){if(t&1&&(f(0,"section",0)(1,"div",6),F(2,"span",7),f(3,"p",4),b(4),_(),f(5,"p",5)(6,"code"),b(7),_(),f(8,"span"),b(9),_()()()()),t&2){let e=d();l(4),x(e.texts.emptyNotFound.title),l(3),x(e.path()),l(2),x(e.texts.emptyNotFound.descSuffix)}}function ade(t,o){if(t&1&&F(0,"p",9),t&2){let e=d(2);m("innerHTML",e.descriptionHtml(),ki)}}function sde(t,o){if(t&1&&(f(0,"div",10),F(1,"i",23),f(2,"span"),b(3),_()()),t&2){let e=d(2);l(3),x(e.texts.supersededByBanner(o))}}function lde(t,o){if(t&1){let e=$();f(0,"div",11),F(1,"i",24),f(2,"span"),b(3),_(),f(4,"button",25),A("click",function(){w(e);let i=d(2);return T(i.dismissActionError())}),F(5,"i",26),_()()}if(t&2){let e=d(2);l(3),x(o),l(),O("aria-label",e.texts.actionErrorDismissAriaLabel)}}function cde(t,o){if(t&1&&(f(0,"p",35)(1,"strong"),b(2),_(),b(3),_()),t&2){let e=d(5);l(2),x(e.texts.findingHintLabel),l(),Se(" ",o," ")}}function dde(t,o){if(t&1&&(f(0,"li",30)(1,"div",31)(2,"span",32),b(3),_(),f(4,"code",33),b(5),_()(),f(6,"p",34),b(7),_(),M(8,cde,4,2,"p",35),_()),t&2){let e,n=o.$implicit;O("data-severity",n.severity),l(2),O("data-severity",n.severity),l(),x(n.severity),l(2),x(n.analyzerId),l(2),x(n.message),l(),D((e=n.fix==null?null:n.fix.summary)?8:-1,e)}}function ude(t,o){if(t&1&&(f(0,"ul",29),re(1,dde,9,6,"li",30,wf),_()),t&2){let e=d(3);l(),ae(e.sortedIssues())}}function pde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",27),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("findings"))}),f(1,"span",28),b(2),_(),M(3,ude,3,0,"ul",29),_()}if(t&2){let e=d(2);m("title",e.texts.sections.findings)("expanded",e.expanded("findings")),l(2),Se("(",e.issues().length,")"),l(),D(e.expanded("findings")?3:-1)}}function hde(t,o){if(t&1){let e=$();f(0,"sm-linked-nodes-panel",38),A("openPath",function(i){w(e);let r=d(3);return T(r.openPath(i))}),_()}if(t&2){d(2);let e=Ce(0);m("path",e.path)}}function fde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",36),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("connections"))}),M(1,hde,1,1,"sm-linked-nodes-panel",37),_()}if(t&2){let e=d(2);m("title",e.texts.sections.connections)("expanded",e.expanded("connections")),l(),D(e.expanded("connections")?1:-1)}}function mde(t,o){if(t&1){let e=$();f(0,"div",16)(1,"sm-vendor-frontmatter",39),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("definition"))}),_()()}if(t&2){d();let e=Ce(0),n=Ce(1),i=d();l(),m("frontmatter",n)("kind",e.kind)("provider",e.provider)("skillPathByName",i.skillPathByName())("onSkillClick",i.onSkillChip)("expanded",i.expanded("definition"))}}function _de(t,o){t&1&&(f(0,"code",41),b(1),_()),t&2&&(l(),Se("(",o,")"))}function gde(t,o){if(t&1){let e=$();f(0,"sm-annotations-panel",43),A("openPath",function(i){w(e);let r=d(3);return T(r.openPath(i))}),_()}if(t&2){d(2);let e=Ce(0),n=d();m("overlay",e.sidecar)("knownPaths",n.pathSet())}}function bde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",40),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("annotations"))}),M(1,_de,2,1,"code",41),M(2,gde,1,2,"sm-annotations-panel",42),_()}if(t&2){let e,n=d(2);m("title",n.texts.sections.annotations)("expanded",n.expanded("annotations")),l(),D((e=n.sidecarFileName())?1:-1,e),l(),D(n.expanded("annotations")?2:-1)}}function vde(t,o){if(t&1&&(f(0,"p",45),b(1),_()),t&2){let e=d(4);l(),x(e.texts.body.loading)}}function yde(t,o){if(t&1&&F(0,"div",46),t&2){let e=d(4);m("innerHTML",e.bodyHtml(),ki)}}function Cde(t,o){if(t&1&&M(0,vde,2,1,"p",45)(1,yde,1,1,"div",46),t&2){let e,n=d(3);D((e=n.bodyState())==="loading"?0:e==="ready"?1:-1)}}function xde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",44),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("body"))}),M(1,Cde,2,1),_()}if(t&2){let e=d(2);m("title",e.texts.sections.body)("expanded",e.expanded("body")),l(),D(e.expanded("body")?1:-1)}}function wde(t,o){if(t&1&&F(0,"sm-plugin-contributions",48),t&2){let e=d(3);m("sidecarRoot",e.sidecarRoot())}}function Tde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",47),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("plugins"))}),M(1,wde,1,1,"sm-plugin-contributions",48),_()}if(t&2){let e=d(2);m("title",e.texts.sections.plugins)("expanded",e.expanded("plugins")),l(),D(e.expanded("plugins")?1:-1)}}function Sde(t,o){if(t&1&&(f(0,"div",50),F(1,"sm-inspector-audit-panel",48)(2,"sm-inspector-debug-panel",51),_()),t&2){d(2);let e=Ce(0),n=d();l(),m("sidecarRoot",n.sidecarRoot()),l(),m("node",e)("sidecarRoot",n.sidecarRoot())("overlay",e.sidecar)}}function kde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",49),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("metadata"))}),M(1,Sde,3,4,"div",50),_()}if(t&2){let e=d(2);m("title",e.texts.sections.metadata)("expanded",e.expanded("metadata")),l(),D(e.expanded("metadata")?1:-1)}}function Ide(t,o){if(t&1){let e=$();Ut(0)(1),f(2,"section",0)(3,"sm-inspector-header",8),A("favoriteToggle",function(i){w(e);let r=d();return T(r.onHeaderFavoriteToggle(i))})("tagClick",function(i){w(e);let r=d();return T(r.tagSelect.emit(i))}),_(),M(4,ade,1,1,"p",9),M(5,sde,4,1,"div",10),M(6,lde,6,2,"div",11),f(7,"div",12),F(8,"sm-view-contributions-host",13),_(),M(9,pde,4,4,"sm-collapsible-section",14),M(10,fde,2,3,"sm-collapsible-section",15),M(11,mde,2,6,"div",16),M(12,bde,3,4,"sm-collapsible-section",17),M(13,xde,2,3,"sm-collapsible-section",18),M(14,Tde,2,3,"sm-collapsible-section",19),F(15,"sm-inspector-plugin-sections",20),M(16,kde,2,3,"sm-collapsible-section",21),f(17,"sm-sidecar-consent-dialog",22),A("decision",function(i){w(e);let r=d();return T(r.onConsentDecision(i))}),_()()}if(t&2){let e,n,i=d(),r=Tt(i.node());l();let a=Tt(r.frontmatter);l(),Ne("--accent","var(--sm-kind-"+r.kind+", var(--sm-kind-markdown))"),l(),m("node",r)("frontmatterInvalid",i.frontmatterInvalid())("activeTag",i.activeTag()),l(),D(a.description?4:-1),l(),D((e=i.headerSupersededBy())?5:-1,e),l(),D((n=i.actionError())?6:-1,n),l(2),m("node",r),l(),D(i.issues().length>0?9:-1),l(),D(i.hasConnections()?10:-1),l(),D(i.hasVendorFrontmatter()?11:-1),l(),D(r.sidecar!=null&&r.sidecar.present?12:-1),l(),D(i.showBody()?13:-1),l(),D(i.hasPluginContributions()?14:-1),l(),m("node",i.node()),l(),D(i.hasMetadata()?16:-1),l(),m("open",i.consentOpen())}}var wP=(()=>{class t{loader=p(Vt);nodeOpenIntent=p(fo);dataSource=p(go);markdown=p(bo);wsEvents=p(ls);actionDispatch=p(Tb);texts=ir;cardTexts=ti;path=B(void 0);activeTag=B(null);tagSelect=Ke();node=E(()=>{let e=this.path();return e?this.loader.nodes().find(n=>n.path===e)??null:null});pathSet=E(()=>{let e=new Set;for(let n of this.loader.nodes())e.add(n.path);return e});skillPathByName=E(()=>{let e=new Map;for(let n of this.loader.nodes()){if(n.kind!=="skill")continue;let i=n.frontmatter?.name;typeof i=="string"&&i.length>0&&e.set(i,n.path)}return e});headerSupersededBy=E(()=>X0(this.node()));sidecarFileName=E(()=>{let e=this.node()?.path;return e?(e.split("/").pop()??e).replace(/\.md$/,".sm"):null});bodyHandle=h0({path:this.path,dataSource:this.dataSource,markdown:this.markdown,scanCompleted$:this.wsEvents.scanCompleted$});bodyState=this.bodyHandle.bodyState;bodyHtml=this.bodyHandle.bodyHtml;showBody=E(()=>{let e=this.bodyState();return e==="loading"||e==="ready"});descriptionHtml=Va(()=>this.node()?.frontmatter.description??"",this.markdown);deadLink=f0({path:this.path,pathSet:this.pathSet,dataSource:this.dataSource});sectionCollapse=m0();expanded(e){return this.sectionCollapse.expanded(e)}toggleSection(e){this.sectionCollapse.toggle(e)}derivations=xP({node:this.node});sidecarRoot=this.derivations.sidecarRoot;hasVendorFrontmatter=this.derivations.hasVendorFrontmatter;hasConnections=this.derivations.hasConnections;hasPluginContributions=this.derivations.hasPluginContributions;hasMetadata=this.derivations.hasMetadata;issues=X([]);issuesPath=void 0;issuesLoaderEffect=de(e=>{let n=this.node(),i=n?.path;if(i!==this.issuesPath&&(this.issues.set([]),this.issuesPath=i),!n||!i)return;let r=!1;e(()=>{r=!0}),this.dataSource.listIssues({node:i}).then(a=>{!r&&this.issuesPath===i&&this.issues.set(a.items)}).catch(()=>{!r&&this.issuesPath===i&&this.issues.set([])})});sortedIssues=E(()=>{let e={error:0,warn:1,info:2};return[...this.issues()].sort((n,i)=>e[n.severity]-e[i.severity])});frontmatterInvalid=E(()=>this.issues().some(e=>e.analyzerId==="frontmatter-parse-error"));ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}openPath(e){this.nodeOpenIntent.open(e)}onSkillChip=e=>{this.openPath(e)};pathExists(e){return this.pathSet().has(e)}linkStatus(e){return this.deadLink.linkStatus(e)}isVerifying(e){return this.deadLink.isVerifying(e)}verifyDeadLink(e){return this.deadLink.verifyDeadLink(e)}onHeaderFavoriteToggle(e){let n=this.node();!n||n.path!==e||this.loader.toggleFavorite(e,!n.isFavorite)}consentOpen=this.actionDispatch.consentOpen;actionError=this.actionDispatch.error;onConsentDecision(e){this.actionDispatch.resolveConsent(e)}dismissActionError(){this.actionDispatch.dismissError()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-view"]],inputs:{path:[1,"path"],activeTag:[1,"activeTag"]},outputs:{tagSelect:"tagSelect"},decls:3,vars:1,consts:[["data-testid","inspector-view",1,"inspector"],["data-testid","inspector-view",1,"inspector",3,"--accent"],["data-testid","inspector-empty-no-selection",1,"empty-state"],[1,"empty-state__icon","pi","pi-eye"],[1,"empty-state__title"],[1,"empty-state__desc"],["data-testid","inspector-empty-not-found",1,"empty-state"],[1,"empty-state__icon","empty-state__icon--warn","pi","pi-question-circle"],[3,"favoriteToggle","tagClick","node","frontmatterInvalid","activeTag"],["data-testid","inspector-description",1,"inspector__desc",3,"innerHTML"],["data-testid","inspector-superseded-banner",1,"inspector__banner","inspector__banner--warn"],["data-testid","inspector-action-error",1,"inspector__banner","inspector__banner--error"],[1,"inspector__toolbar"],["slot","inspector.action.button",3,"node"],["toggleTestid","inspector-findings-toggle","data-testid","inspector-findings",3,"title","expanded"],["toggleTestid","inspector-connections-toggle","data-testid","inspector-card-linked-nodes",3,"title","expanded"],["data-testid","inspector-card-vendor-frontmatter",1,"inspector__vendor"],["toggleTestid","inspector-annotations-toggle","data-testid","inspector-card-annotations",3,"title","expanded"],["toggleTestid","inspector-body-toggle","data-testid","inspector-card-body",1,"inspector__body-section",3,"title","expanded"],["toggleTestid","inspector-plugins-toggle","data-testid","inspector-card-plugins",3,"title","expanded"],[3,"node"],["toggleTestid","inspector-metadata-toggle","data-testid","inspector-card-metadata",3,"title","expanded"],[3,"decision","open"],["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"],["toggleTestid","inspector-findings-toggle","data-testid","inspector-findings",3,"toggle","title","expanded"],["smSectionTitleExtra","",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"],["toggleTestid","inspector-connections-toggle","data-testid","inspector-card-linked-nodes",3,"toggle","title","expanded"],[3,"path"],[3,"openPath","path"],[3,"toggle","frontmatter","kind","provider","skillPathByName","onSkillClick","expanded"],["toggleTestid","inspector-annotations-toggle","data-testid","inspector-card-annotations",3,"toggle","title","expanded"],["smSectionTitleExtra","","data-testid","inspector-sidecar-file",1,"inspector__sidecar-file"],[3,"overlay","knownPaths"],[3,"openPath","overlay","knownPaths"],["toggleTestid","inspector-body-toggle","data-testid","inspector-card-body",1,"inspector__body-section",3,"toggle","title","expanded"],["data-testid","inspector-body-loading",1,"inspector__body-status"],["data-testid","inspector-body-rendered",1,"inspector__body-rendered",3,"innerHTML"],["toggleTestid","inspector-plugins-toggle","data-testid","inspector-card-plugins",3,"toggle","title","expanded"],[3,"sidecarRoot"],["toggleTestid","inspector-metadata-toggle","data-testid","inspector-card-metadata",3,"toggle","title","expanded"],["data-testid","inspector-metadata-section",1,"inspector__metadata"],[3,"node","sidecarRoot","overlay"]],template:function(n,i){n&1&&M(0,ode,7,2,"section",0)(1,rde,10,3,"section",0)(2,Ide,18,20,"section",1),n&2&&D(i.path()?i.node()?2:1:0)},dependencies:[iP,JD,aP,uP,hP,mP,_P,gP,mf,Jn,vP],styles:["[_nghost-%COMP%]{display:block}.inspector[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown);display:flex;flex-direction:column;gap:.75rem;padding:1rem 1.1rem 1.25rem;background:var(--sm-bg-content);color:var(--p-text-color)}.inspector--empty[_ngcontent-%COMP%]{padding:2rem;color:var(--p-text-muted-color)}.inspector__desc[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);font-size:.88rem;line-height:1.5;max-width:none}.inspector__sidecar-file[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;font-weight:400;color:var(--p-text-muted-color)}[_nghost-%COMP%] .inspector__desc code{background:var(--sm-bg-hover);padding:.05rem .3rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .inspector__desc a{color:var(--p-primary-color);text-decoration:underline}.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:.45rem;padding-left:.7rem;border-left:2px solid color-mix(in srgb,var(--accent) 70%,transparent);transition:border-color .14s ease}[_nghost-%COMP%] .sm-block--collapsible:hover{border-left-color:var(--accent)}[_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+*{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(--accent)}[_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)}[_nghost-%COMP%] .sm-block__inline{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .65rem;row-gap:.35rem}[_nghost-%COMP%] .sm-block__meta{display:inline-flex;align-items:center;gap:.3rem;font-size:.83rem;color:var(--p-text-color)}[_nghost-%COMP%] .sm-block__meta .pi{color:var(--p-text-muted-color);font-size:.85rem}[_nghost-%COMP%] .sm-block__meta a{color:var(--p-primary-color);word-break:break-all}[_nghost-%COMP%] .sm-block__meta code{background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);font-size:.78rem}.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}[_nghost-%COMP%] .inspector__body-rendered{font-size:.9rem;line-height:1.6;max-height:480px;overflow:auto;padding:.25rem 0 0;--code-border: color-mix(in srgb, var(--sm-border) 70%, var(--p-text-muted-color))}[_nghost-%COMP%] .inspector__body-rendered :first-child{margin-top:0}[_nghost-%COMP%] .inspector__body-rendered :last-child{margin-bottom:0}[_nghost-%COMP%] .inspector__body-rendered h1, [_nghost-%COMP%] .inspector__body-rendered h2, [_nghost-%COMP%] .inspector__body-rendered h3, [_nghost-%COMP%] .inspector__body-rendered h4, [_nghost-%COMP%] .inspector__body-rendered h5, [_nghost-%COMP%] .inspector__body-rendered h6{margin:1.2rem 0 .6rem;font-weight:600;line-height:1.3}[_nghost-%COMP%] .inspector__body-rendered h1{font-size:1.35rem}[_nghost-%COMP%] .inspector__body-rendered h2{font-size:1.18rem}[_nghost-%COMP%] .inspector__body-rendered h3{font-size:1.05rem}[_nghost-%COMP%] .inspector__body-rendered h4{font-size:.95rem}[_nghost-%COMP%] .inspector__body-rendered h5, [_nghost-%COMP%] .inspector__body-rendered h6{font-size:.9rem;color:var(--p-text-muted-color)}[_nghost-%COMP%] .inspector__body-rendered h1, [_nghost-%COMP%] .inspector__body-rendered h2{padding-bottom:.3rem;border-bottom:1px solid var(--sm-border)}[_nghost-%COMP%] .inspector__body-rendered p{margin:.6rem 0}[_nghost-%COMP%] .inspector__body-rendered a{color:var(--p-primary-color);text-decoration:underline;text-underline-offset:2px}[_nghost-%COMP%] .inspector__body-rendered ul, [_nghost-%COMP%] .inspector__body-rendered ol{margin:.6rem 0;padding-left:1.4rem}[_nghost-%COMP%] .inspector__body-rendered li{margin:.2rem 0}[_nghost-%COMP%] .inspector__body-rendered li>ul, [_nghost-%COMP%] .inspector__body-rendered li>ol{margin:.2rem 0}[_nghost-%COMP%] .inspector__body-rendered blockquote{margin:.75rem 0;padding:.7rem .95rem;border-left:2px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);font-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-sm) var(--sm-radius-sm) 0}[_nghost-%COMP%] .inspector__body-rendered blockquote :first-child{margin-top:0}[_nghost-%COMP%] .inspector__body-rendered blockquote :last-child{margin-bottom:0}[_nghost-%COMP%] .inspector__body-rendered hr{margin:1.2rem 0;border:0;border-top:1px solid var(--sm-border)}[_nghost-%COMP%] .inspector__body-rendered img{max-width:100%;height:auto;border-radius:var(--sm-radius-sm)}[_nghost-%COMP%] .inspector__body-rendered table{border-collapse:collapse;width:100%;margin:.75rem 0;font-size:.85rem}[_nghost-%COMP%] .inspector__body-rendered th, [_nghost-%COMP%] .inspector__body-rendered td{border:1px solid var(--sm-border);padding:.35rem .55rem;text-align:left}[_nghost-%COMP%] .inspector__body-rendered th{background:var(--sm-bg-hover);font-weight:600}[_nghost-%COMP%] .inspector__body-rendered tbody tr:nth-child(2n){background:var(--sm-bg-hover)}[_nghost-%COMP%] .inspector__body-rendered pre{background:var(--sm-bg-hover);border:1px solid var(--code-border);border-radius:var(--sm-radius-md);padding:.75rem .85rem;margin:.75rem 0;white-space:pre;font-family:var(--sm-font-mono);font-size:.82rem;line-height:1.5;overflow-x:auto}[_nghost-%COMP%] .inspector__body-rendered code{background:var(--sm-bg-hover);border:1px solid var(--code-border);padding:.05rem .34rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .inspector__body-rendered pre code{background:transparent;border:0;padding:0;border-radius:0;font-size:inherit}.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__metadata[_ngcontent-%COMP%]{display:flex;flex-direction:column}.inspector__metadata[_ngcontent-%COMP%] > sm-inspector-debug-panel[_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)}[_nghost-%COMP%] .ann-panel__chip--user{padding:.1rem .55rem}"],changeDetection:0})}return t})();var TP=(()=>{class t{smMiddleMousePan=B.required();origin=null;rafId=null;pendingPosition=null;onMouseDown(e){if(e.button!==1)return;let n=this.smMiddleMousePan();if(!n)return;e.preventDefault();let i=n.getPosition()??{x:0,y:0};this.origin={mouseX:e.clientX,mouseY:e.clientY,canvasX:i.x,canvasY:i.y},document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd)}ngOnDestroy(){this.onEnd()}onMove=e=>{this.origin&&(this.pendingPosition={x:this.origin.canvasX+(e.clientX-this.origin.mouseX),y:this.origin.canvasY+(e.clientY-this.origin.mouseY)},this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let n=this.smMiddleMousePan();!n||!this.pendingPosition||(n.setPosition(this.pendingPosition),n.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(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["","smMiddleMousePan",""]],hostBindings:function(n,i){n&1&&A("mousedown",function(a){return i.onMouseDown(a)})},inputs:{smMiddleMousePan:[1,"smMiddleMousePan"]}})}return t})();function SP(t,o){if(t.size===0)return{next:t,dirty:!1};let e=!1,n=new Set;for(let i of t)o.has(i)?n.add(i):e=!0;return{next:e?n:t,dirty:e}}function kP(t){let{nodes:o,current:e,layout:n}=t,i=new Set(o.map(c=>c.path)),r=!1,a=new Map(e);for(let c of a.keys())i.has(c)||(a.delete(c),r=!0);let s=!1;for(let c of i)if(!a.has(c)){s=!0;break}for(let c of i){let u=n.positions.get(c);if(!u)continue;let h=a.get(c);if(!h){a.set(c,{x:u.x,y:u.y}),r=!0;continue}h.manual!==!0&&s&&(h.x===u.x&&h.y===u.y||(a.set(c,{x:u.x,y:u.y}),r=!0))}return{next:a,dirty:r}}function IP(t){let{selectedPath:o,setSelectedNodeId:e,readSelectedNodeId:n,graphNodes:i,onDeepLinkSelect:r,router:a,route:s}=t,c=db(s.queryParamMap.pipe(y0(u=>u.get("path"))),{initialValue:s.snapshot.queryParamMap.get("path")});de(()=>{let u=c(),h=i();if(h.length===0||!u)return;let g=tn(()=>n());if(g!==null&&h.find(I=>I.id===g)?.view.path===u)return;let C=h.find(k=>k.view.path===u);C&&(e(C.id),r?.(C.id))}),de(()=>{let u=o(),h=tn(()=>c());(u??null)!==(h??null)&&a.navigate([],{relativeTo:s,queryParams:{path:u??null},queryParamsHandling:"merge",replaceUrl:!0})})}function EP(t,o){return ho(t).includes(o)}function MP(t){if(typeof t!="object"||t===null)return!1;let o=t;return typeof o.x=="number"&&typeof o.y=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)}function DP(t){if(typeof t!="object"||t===null)return!1;let o=t;return typeof o.x=="number"&&typeof o.y=="number"&&typeof o.scale=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)&&Number.isFinite(o.scale)&&o.scale>0}function PP(t){return t.querySelector(".p-overlay-mask, .p-dialog, .p-overlay")!==null}var RP="sm.graph.viewport",OP="sm.graph.node-positions",FP="sm.graph.node-expanded",NP="sm.graph.panel-width";function AP(){let t=null;try{t=localStorage.getItem(RP)}catch{return null}if(!t)return null;let o;try{o=JSON.parse(t)}catch{return null}return DP(o)?o:null}function LP(t){try{localStorage.setItem(RP,JSON.stringify(t))}catch{}}function BP(){let t=new Map,o=null;try{o=localStorage.getItem(OP)}catch{return t}if(!o)return t;let e;try{e=JSON.parse(o)}catch{return t}if(typeof e!="object"||e===null)return t;for(let[n,i]of Object.entries(e)){if(!MP(i))continue;let r=i,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 Ha(t){try{let o={};for(let[e,n]of t)o[e]=n.manual?{x:n.x,y:n.y,manual:!0}:{x:n.x,y:n.y};localStorage.setItem(OP,JSON.stringify(o))}catch{}}function VP(){let t=null;try{t=localStorage.getItem(FP)}catch{return new Set}if(!t)return new Set;let o;try{o=JSON.parse(t)}catch{return new Set}if(!Array.isArray(o))return new Set;let e=new Set;for(let n of o)typeof n=="string"&&n.length>0&&e.add(n);return e}function gf(t){try{localStorage.setItem(FP,JSON.stringify([...t]))}catch{}}function zP(){let t=null;try{t=localStorage.getItem(NP)}catch{return null}if(!t)return null;let o=Number(t);return!Number.isFinite(o)||o<=0?null:o}function HP(t){try{localStorage.setItem(NP,String(Math.round(t)))}catch{}}var vf=500,bf=400,qP=80;function GP(t){let o=X(t.initialWidth),e=X(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&Ga(window,"resize").pipe(Qn(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let n=E(()=>{let g=Math.max(bf,e()-qP),C=o();return C>g||C<bf?Math.min(vf,g):C}),i=null,r=null,a=null,s=()=>{a=null,r!==null&&(o.set(r),r=null)},c=g=>{if(!i)return;let C=g.clientX-i.mouseX,k=i.widthAtStart-C,I=Math.max(bf,e()-qP);r=Math.min(I,Math.max(bf,k)),a===null&&typeof window<"u"&&(a=window.requestAnimationFrame(s))},u=()=>{i&&(i=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),a!==null&&typeof window<"u"&&(window.cancelAnimationFrame(a),a=null),r!==null&&(o.set(r),r=null),t.onCommit(o()))};return{clampedPanelWidth:n,onPanelResizeStart:g=>{g.button===0&&(g.preventDefault(),g.stopPropagation(),i={mouseX:g.clientX,widthAtStart:n()},document.addEventListener("mousemove",c),document.addEventListener("mouseup",u))}}}function jP(t){let o=X(null),e=null,n=()=>{if(e===null)return;let r=e;e=null,t.mapVisibility.setOnly(r)};return{activeTagSelection:o,onTagSelect:r=>{if(o()===r){o.set(null),n();return}let a=t.nodes().filter(s=>EP(s,r)).map(s=>s.path);if(a.length===0){o.set(null),n();return}e===null&&(e=new Set(t.mapVisibility.paths())),t.mapVisibility.setOnly(a),o.set(r)}}}var _0=.05,g0=2;function UP(t){let o=X(t.savedViewport?{x:t.savedViewport.x,y:t.savedViewport.y}:{x:0,y:0}),e=X(t.savedViewport?.scale??1),n=E(()=>e()<g0-1e-6),i=E(()=>e()>_0+1e-6);return{viewportPosition:o,viewportScale:e,canZoomIn:n,canZoomOut:i,onCanvasChange:a=>{let s=o();(s.x!==a.position.x||s.y!==a.position.y)&&o.set({x:a.position.x,y:a.position.y}),e()!==a.scale&&e.set(a.scale),t.hasCompletedInitialLayout()&&LP({x:a.position.x,y:a.position.y,scale:a.scale})}}}var Ede=.15,Mde=.25,Dde=.75,Pde=.6;function $P(t){let o=E(()=>{let u=new Map;for(let h of t.graph().edges)u.has(h.from)||u.set(h.from,new Set),u.has(h.to)||u.set(h.to,new Set),u.get(h.from).add(h.to),u.get(h.to).add(h.from);return u}),e=u=>t.selectedNodeId()===u,n=u=>{let h=t.selectedNodeId();return h===null||h===u?!1:o().get(h)?.has(u)??!1},i=u=>{if(t.activeTagSelection()!==null)return!1;let h=t.selectedNodeId();return h===null||h===u?!1:!(o().get(h)?.has(u)??!1)},r=u=>{let h=t.selectedNodeId();return h!==null&&(u.from===h||u.to===h)},a=u=>{if(t.activeTagSelection()!==null)return!1;let h=t.selectedNodeId();return h===null?!1:u.from!==h&&u.to!==h},s=E(()=>{let u=t.selectedNodeId(),h=t.activeTagSelection()!==null,g=u!==null?o().get(u)??null:null,C=new Map;for(let k of t.graph().nodes){let I=k.id,N=u===I,q=!N&&u!==null&&(g?.has(I)??!1),Y=!h&&u!==null&&!N&&!(g?.has(I)??!1);C.set(I,{selected:N,highlighted:q,dimmed:Y})}return C}),c=E(()=>{let u=t.selectedNodeId(),h=t.activeTagSelection()!==null,g=new Map;for(let C of t.graph().edges){let k=u!==null&&(C.from===u||C.to===u),I=!h&&u!==null&&!k,N=typeof C.confidence=="number"?C.confidence:Pde,q=I?Ede:Mde+Dde*N;g.set(C.id,{highlighted:k,dimmed:I,opacity:q})}return g});return{isSelected:e,isHighlighted:n,isDimmed:i,isEdgeHighlighted:r,isEdgeDimmed:a,selectionView:s,edgeSelectionView:c}}function WP(t){let o=t.onCommit??Ha,e=null,n=!1,i=null,r=()=>{queueMicrotask(()=>{if(!n){i=null;return}n=!1,i&&(t.nodePositions.set(i),i=null),o(t.nodePositions())})},a=(u,h)=>{i||(i=new Map(t.nodePositions())),i.set(u,{x:h.x,y:h.y,manual:!0}),n=!0},s=u=>{e={x:u.clientX,y:u.clientY},document.addEventListener("mouseup",r,{once:!0})},c=u=>{let h=e;if(e=null,!h)return!0;let g=u.clientX-h.x,C=u.clientY-h.y;return Math.hypot(g,C)<=4};return t.destroyRef.onDestroy(()=>{document.removeEventListener("mouseup",r)}),{onNodePositionChange:a,onNodePointerDown:s,isClickWithoutDrag:c}}function KP(t){let o=X(VP());return de(()=>{let r=new Set(t.nodes().map(s=>s.path));if(r.size===0)return;let a=SP(o(),r);a.dirty&&(o.set(a.next),gf(a.next))}),{isExpanded:r=>o().has(r),setExpanded:(r,a)=>{let s=o();if(s.has(r)===a)return;let c=new Set(s);a?c.add(r):c.delete(r),o.set(c),gf(c)},resetAll:()=>{o.set(new Set),gf(new Set)},expandedNodeIds:o}}function YP(t){let o=X(!1),e=!1,n=null;return de(()=>{let i=t.visibleNodes();e||i.length!==0&&queueMicrotask(()=>{e=!0,o.set(!0),t.savedViewport||t.fit()})}),de(()=>{let i=t.pathsFingerprint();if(!e){n=i;return}n!==i&&(n=i,(t.animatedFit??t.fit)())}),{hasCompletedInitialLayout:()=>o()}}function XP(t){let{points:o,wrap:e,panelW:n,zoomMin:i}=t;if(o.length===0)return null;let r=1/0,a=1/0,s=-1/0,c=-1/0;for(let Oe of o)Oe.x<r&&(r=Oe.x),Oe.y<a&&(a=Oe.y),Oe.x+260>s&&(s=Oe.x+260),Oe.y+120>c&&(c=Oe.y+120);let u=Math.max(1,e.width-n),h=Math.max(1,s-r),g=Math.max(1,c-a),C=Math.max(1,u-160),k=Math.max(1,e.height-160),I=Math.min(C/h,k/g),N=Math.min(1,Math.max(i,I)),q=(r+s)/2,Y=(a+c)/2,ee=u/2-q*N,ce=e.height/2-Y*N;return{position:{x:ee,y:ce},scale:N}}function ZP(t){let{point:o,wrap:e,panelW:n,scale:i}=t,r=o.x+260/2,a=o.y+120/2,c=Math.max(1,e.width-n)/2-r*i,u=e.height/2-a*i;return{position:{x:c,y:u},scale:i}}function b0(t,o,e){if(typeof requestAnimationFrame>"u"||e<=0){t.writePosition(o.position),t.writeScale(o.scale);return}let n=t.readPosition(),i=t.readScale(),r=performance.now(),a=s=>{if(t.isStaleToken())return;let c=Math.min(1,(s-r)/e),u=Rde(c);t.writePosition({x:n.x+(o.position.x-n.x)*u,y:n.y+(o.position.y-n.y)*u}),t.writeScale(i+(o.scale-i)*u),c<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}function Rde(t){return 1-Math.pow(1-t,3)}var Ode=["canvasWrap"],t3=(t,o)=>o.id;function Fde(t,o){if(t&1&&(f(0,"div",2),F(1,"span",8),f(2,"p",9),b(3),_()()),t&2){let e=d();l(3),x(e.texts.loading)}}function Nde(t,o){if(t&1&&(f(0,"div",3),F(1,"span",10),f(2,"p",9),b(3),_(),f(4,"p",11),b(5),_()()),t&2){let e=d();l(3),x(e.texts.errorTitle),l(2),x(e.error())}}function Ade(t,o){if(t&1){let e=$();f(0,"div",4),F(1,"i",12),f(2,"p",13),b(3),_(),f(4,"p-button",14),A("onClick",function(){w(e);let i=d();return T(i.resetFilters())}),_()()}if(t&2){let e=d();l(3),x(e.texts.emptyTitle),l(),m("label",e.texts.resetFilters)("text",!0)}}function Lde(t,o){if(t&1){let e=$();f(0,"div",5),F(1,"i",15),f(2,"p",9),b(3),_(),f(4,"p-button",16),A("onClick",function(){w(e);let i=d();return T(i.mapVisibility.clear())}),_()()}if(t&2){let e=d();l(3),x(e.texts.curationEmptyTitle),l(),m("label",e.texts.showAllOnMap)("text",!0)}}function Bde(t,o){if(t&1&&(f(0,"f-connection",36),W(),f(1,"svg",37),F(2,"circle",38),_(),ja(),F(3,"f-connection-marker-arrow",39),_()),t&2){let e=o.$implicit,n=d(2),i=n.edgeSelectionFor(e.id);H("f-conn--"+e.kind),Ne("opacity",i.opacity),ue("f-conn--highlighted",i.highlighted)("f-conn--dimmed",i.dimmed),m("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fOutputSide",n.outputSide())("fInputSide",n.inputSide())("fType",n.connectionType())("fBehavior",n.connectionBehavior)("fReassignDisabled",!0),l(),m("type",n.markerStart)("width",9)("height",9)("refX",4.5)("refY",4.5),l(2),m("type",n.markerEnd)}}function Vde(t,o){if(t&1){let e=$();me(0,23),f(1,"div",41),A("fNodePositionChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.onNodePositionChange(r.id,i))})("pointerdown",function(i){w(e);let r=d(3);return T(r.onNodePointerDown(i))})("click",function(i){let r=w(e).$implicit,a=d(3);return T(a.selectNode(r,i))})("dblclick",function(){let i=w(e).$implicit,r=d(3);return T(r.openNode(i))}),f(2,"sm-node-card",42),A("expandedChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.setExpanded(r.id,i))})("favoriteToggle",function(i){w(e);let r=d(3);return T(r.onFavoriteToggle(i))}),_(),f(3,"div",43),F(4,"sm-view-contributions-host",44),_()(),_e()}if(t&2){let e=o.$implicit,n=d(3);l(),m("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide())("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide()),O("data-testid","graph-node-"+e.id),l(),m("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),m("node",e.view)}}function zde(t,o){if(t&1&&S(0,Vde,5,14,"ng-container",40),t&2){let e=d(2);m("fVirtualForOf",e.graph().nodes)}}function Hde(t,o){if(t&1){let e=$();f(0,"div",46),A("fNodePositionChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.onNodePositionChange(r.id,i))})("pointerdown",function(i){w(e);let r=d(3);return T(r.onNodePointerDown(i))})("click",function(i){let r=w(e).$implicit,a=d(3);return T(a.selectNode(r,i))})("dblclick",function(){let i=w(e).$implicit,r=d(3);return T(r.openNode(i))}),f(1,"sm-node-card",42),A("expandedChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.setExpanded(r.id,i))})("favoriteToggle",function(i){w(e);let r=d(3);return T(r.onFavoriteToggle(i))}),_(),f(2,"div",43),F(3,"sm-view-contributions-host",44),_()()}if(t&2){let e=o.$implicit,n=d(3);m("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fOutputId",e.id+"-out"),O("data-testid","graph-node-"+e.id),l(),m("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),m("node",e.view)}}function qde(t,o){if(t&1&&(me(0,23),re(1,Hde,4,12,"div",45,t3),_e()),t&2){let e=d(2);l(),ae(e.graph().nodes)}}function Gde(t,o){if(t&1&&F(0,"sm-perf-hud",29),t&2){let e=d(2);m("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())}}function jde(t,o){if(t&1){let e=$();F(0,"span",34),f(1,"p-button",47),A("onClick",function(){w(e);let i=d(2);return T(i.mapVisibility.clear())}),_()}if(t&2){let e=d(2);l(),m("label",e.texts.toolbar.showAllLabel)("ariaLabel",e.texts.toolbar.showAllAria)("pTooltip",e.texts.toolbar.showAllTooltip)("text",!0)}}function Ude(t,o){if(t&1){let e=$();f(0,"div",17,0),A("click",function(i){w(e);let r=d();return T(r.onCanvasClick(i))}),f(2,"f-flow",18),A("fLoaded",function(){w(e);let i=d();return T(i.onLoaded())}),F(3,"f-selection-area"),f(4,"f-background"),F(5,"f-rect-pattern"),_(),F(6,"f-line-alignment",19),f(7,"f-canvas",20),A("fCanvasChange",function(i){w(e);let r=d();return T(r.onCanvasChange(i))}),me(8,21),re(9,Bde,4,21,"f-connection",22,t3),_e(),M(11,zde,1,1,"ng-container",23)(12,qde,3,0,"ng-container",23),_(),F(13,"f-minimap"),_(),f(14,"div",24),F(15,"sm-kind-palette")(16,"sm-severity-palette")(17,"sm-link-kind-palette"),_(),f(18,"aside",25)(19,"div",26),A("mousedown",function(i){w(e);let r=d();return T(r.onPanelResizeStart(i))}),_(),f(20,"div",27)(21,"sm-inspector-view",28),A("tagSelect",function(i){w(e);let r=d();return T(r.onTagSelect(i))}),_()()(),M(22,Gde,1,3,"sm-perf-hud",29),f(23,"div",30)(24,"p-button",31),A("onClick",function(){w(e);let i=d();return T(i.zoomIn())}),_(),f(25,"p-button",32),A("onClick",function(){w(e);let i=d();return T(i.zoomOut())}),_(),f(26,"p-button",33),A("onClick",function(){w(e);let i=d();return T(i.fitToScreen())}),_(),F(27,"span",34)(28,"sm-graph-layout-toolbar")(29,"span",34),f(30,"p-button",35),A("onClick",function(){w(e);let i=d();return T(i.resetLayout())}),_(),M(31,jde,2,4),_()()}if(t&2){let e=d();m("smMiddleMousePan",e.canvas()),l(2),m("fCache",e.perf.cache),l(4),m("fAlignThreshold",20),l(),m("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("fZoomMinimum",e.zoomMin)("fZoomMaximum",e.zoomMax)("debounceTime",150),l(2),ae(e.graph().edges),l(2),D(e.perf.virtualization?11:12),l(7),Ne("width",e.clampedPanelWidth(),"px"),ue("is-open",e.selectedNodeId()!==null),O("aria-label",e.texts.a11y.panel),l(),O("aria-label",e.texts.panel.resizeLabel),l(2),m("path",e.selectedPath())("activeTag",e.activeTagSelection()),l(),D(e.perfHud()?22:-1),l(),O("aria-label",e.texts.a11y.toolbar),l(),m("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),l(),m("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),l(),m("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),l(4),m("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0),l(),D(e.mapVisibility.isActive()?31:-1)}}var JP=.2,e3=420,$de={selected:!1,highlighted:!1,dimmed:!1},Wde={highlighted:!1,dimmed:!1,opacity:1},yf=(()=>{class t{loader=p(Vt);filters=p(on);issuePaths=p(yo);mapVisibility=p(ei);graphPreferences=p(cf);router=p(es);route=p(Ja);confirmationService=p(Df);destroyRef=p(xt);dagreLayout=p(i0);injector=p(dt);usageTracker=p(Mb);flow=nt(la);canvas=nt(sa);zoom=nt(ca);canvasWrap=nt("canvasWrap");connectionType=this.graphPreferences.connectionType;connectionBehavior=ri.FIXED;markerStart=Be.START_ALL_STATES;markerEnd=Be.END_ALL_STATES;perf=lf.graph.perf;perfHud=p(XD).visible;savedViewport=AP();viewportStore=UP({savedViewport:this.savedViewport,hasCompletedInitialLayout:()=>this.layoutFit.hasCompletedInitialLayout()});viewportPosition=this.viewportStore.viewportPosition;viewportScale=this.viewportStore.viewportScale;canZoomIn=this.viewportStore.canZoomIn;canZoomOut=this.viewportStore.canZoomOut;zoomMin=_0;zoomMax=g0;texts=wi;nodePositions=X(BP());nodeDrag=WP({destroyRef:this.destroyRef,nodePositions:this.nodePositions});expansion=KP({nodes:this.loader.nodes});panelResize=GP({destroyRef:this.destroyRef,initialWidth:zP()??vf,onCommit:e=>HP(e)});clampedPanelWidth=this.panelResize.clampedPanelWidth;loading=this.loader.loading;error=this.loader.error;visibleNodes=E(()=>this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()));topology=E(()=>Pb(this.loader.nodes(),this.loader.scan()));layoutPositions=X(new Map);layoutComputedAtSignal=X(0);fullLayout=E(()=>Dt(ge({},this.topology()),{positions:this.layoutPositions(),computedAt:this.layoutComputedAtSignal()}));mapVisiblePaths=E(()=>{let e=this.visibleNodes().map(i=>i.path),n=this.mapVisibility.paths();return n.size===0?new Set(e):new Set(e.filter(i=>n.has(i)))});graph=E(()=>{let e=this.mapVisiblePaths(),n=this.filters.selectedLinkKinds(),i=n.length>0?new Set(n):null;return Rb(this.fullLayout(),e,this.nodePositions(),i)});fullAdjacency=E(()=>{let e=new Map,n=(i,r)=>{let a=e.get(i);a||(a=new Set,e.set(i,a)),a.add(r)};for(let i of this.fullLayout().edges)n(i.from,i.to),n(i.to,i.from);return e});hasData=E(()=>this.graph().nodes.length>0);showEmptyState=E(()=>!this.hasData()&&!this.mapVisibility.isActive()&&!this.filters.kindToggleExplicitEmpty()&&this.filters.searchText().trim().length===0);showCurationEmptyState=E(()=>!this.hasData()&&this.mapVisibility.isActive());visibleCount=E(()=>this.graph().nodes.length);totalCount=E(()=>this.loader.nodes().length);edgeCount=E(()=>this.graph().edges.length);layoutComputedAt=E(()=>this.layoutComputedAtSignal());connectionSides=E(()=>ID(this.graphPreferences.layoutAlgorithm(),this.graphPreferences.layoutDirection()));inputSide=E(()=>this.connectionSides().input);outputSide=E(()=>this.connectionSides().output);selectedNodeId=X(null);selectedPath=E(()=>{let e=this.selectedNodeId();return e?this.graph().nodes.find(i=>i.id===e)?.view.path:void 0});selectionGuard=de(()=>{let e=this.selectedNodeId();if(e===null)return;this.graph().nodes.some(i=>i.id===e)||this.selectedNodeId.set(null)});pathsFingerprint=E(()=>this.loader.nodes().map(e=>e.path).sort().join("|"));layoutFit=YP({visibleNodes:this.visibleNodes,pathsFingerprint:this.pathsFingerprint,savedViewport:this.savedViewport,fit:()=>this.fitToScreenClamped(),animatedFit:()=>this.animatedFitToScreen()});constructor(){let e=E(()=>this.loader.nodes().map(r=>({id:r.path,view:{path:r.path}})),{equal:(r,a)=>{if(r.length!==a.length)return!1;for(let s=0;s<r.length;s++)if(r[s]?.id!==a[s]?.id)return!1;return!0}});IP({selectedPath:this.selectedPath,setSelectedNodeId:r=>this.selectedNodeId.set(r),readSelectedNodeId:()=>this.selectedNodeId(),graphNodes:e,onDeepLinkSelect:r=>{this.pendingCenterNodeId.set(r)},router:this.router,route:this.route}),de(()=>{let r=this.loader.nodes();if(r.length===0)return;let a=this.fullLayout();if(a.positions.size===0)return;let s=kP({nodes:r,current:this.nodePositions(),layout:a});s.dirty&&(this.nodePositions.set(s.next),Ha(s.next))}),de(()=>{this.layoutComputedAt(),this.autoFitPending&&(this.autoFitPending=!1,this.runAnimatedFit())}),de(()=>{this.layoutComputedAt();let r=this.layoutFit.hasCompletedInitialLayout(),a=this.pendingCenterNodeId();a===null||!r||this.fullLayout().positions.size!==0&&(this.pendingCenterNodeId.set(null),ao(()=>this.centerOnNode(a),{injector:this.injector}))}),de(()=>{this.mapVisibility.paths(),tn(()=>this.layoutFit.hasCompletedInitialLayout())&&(this.mapFitDebounce!==null&&clearTimeout(this.mapFitDebounce),this.mapFitDebounce=setTimeout(()=>{ao(()=>this.runAnimatedFit(),{injector:this.injector})},180))}),this.destroyRef.onDestroy(()=>{this.mapFitDebounce!==null&&clearTimeout(this.mapFitDebounce)}),de(()=>{let r=this.loader.nodes();r.length!==0&&this.mapVisibility.prune(new Set(r.map(a=>a.path)))});let n="",i="";de(()=>{let r=this.loader.nodes(),a=this.topology(),s={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()};if(r.length===0)return;let c=Db(r,a.edges),u=`${s.algorithm}|${s.direction}|${s.spacing}`,h=`${c}|${u}`;if(h===n)return;let g=i!==""&&i!==u;n=h,i=u,(s.algorithm==="force"?Promise.resolve(Af(r,a.edges)):Promise.resolve().then(()=>Nf(this.dagreLayout,r,a.edges,s))).then(k=>{this.layoutPositions.set(k),this.layoutComputedAtSignal.set(performance.now()),g&&(this.nodePositions.set(new Map),this.fitToScreenClamped())}).catch(k=>{console.error("[graph-view] layout failed:",k)})})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange=this.viewportStore.onCanvasChange;fitToScreenClamped(){let e=this.canvas(),n=this.zoom();e&&(e.fitToScreen({x:40,y:40},!1),ao(()=>{let i=e.transform.scale;if(i<=1&&i>=this.zoomMin)return;let r=Math.max(this.zoomMin,Math.min(i,1)),a=Math.abs(i-r),s=i>r?bn.ZOOM_OUT:bn.ZOOM_IN;n?.setZoom(this.getViewportCenter(),a,s,!1)},{injector:this.injector}))}autoFitAnimToken=0;autoFitPending=!1;mapFitDebounce=null;pendingCenterNodeId=X(null);animatedFitToScreen(){this.autoFitPending=!0}runAnimatedFit(){let e=this.canvasWrap()?.nativeElement;if(!e)return;let n={width:e.clientWidth,height:e.clientHeight},i=this.fullLayout().positions;if(i.size===0)return;let r=this.nodePositions(),a=[];for(let u of this.mapVisiblePaths()){let h=r.get(u)??i.get(u);h&&a.push({x:h.x,y:h.y})}if(a.length===0)return;let s=XP({points:a,wrap:n,panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,zoomMin:this.zoomMin});if(!s)return;let c=++this.autoFitAnimToken;b0({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:u=>this.viewportPosition.set(u),writeScale:u=>this.viewportScale.set(u),isStaleToken:()=>c!==this.autoFitAnimToken},s,e3)}centerOnNode(e){if(!this.mapVisiblePaths().has(e))return;let n=this.canvasWrap()?.nativeElement;if(!n)return;let i=this.nodePositions().get(e)??this.fullLayout().positions.get(e);if(!i)return;let r=ZP({point:i,wrap:{width:n.clientWidth,height:n.clientHeight},panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,scale:this.viewportScale()}),a=++this.autoFitAnimToken;b0({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:s=>this.viewportPosition.set(s),writeScale:s=>this.viewportScale.set(s),isStaleToken:()=>a!==this.autoFitAnimToken},r,e3)}isolateNeighborhood(e){this.mapVisibility.setOnly(kD(this.fullAdjacency(),e)),this.selectedNodeId.set(e)}onNodePositionChange(e,n){this.nodeDrag.onNodePositionChange(e,n)}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),JP,bn.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),JP,bn.ZOOM_OUT,!0)}fitToScreen(){this.fitToScreenClamped()}resetLayout(){let e=this.mapVisiblePaths(),n=e.size>=this.loader.nodes().length;if(![...this.nodePositions().values()].some(a=>a.manual===!0)){this.applyResetLayout(e,n);return}let r=wi.resetLayoutConfirm;this.confirmationService.confirm({header:r.header,message:n?r.message:r.messageVisible,icon:"pi pi-info-circle",acceptButtonProps:{label:r.accept},rejectButtonProps:{label:r.reject,severity:"secondary",outlined:!0},accept:()=>this.applyResetLayout(e,n)})}applyResetLayout(e,n){if(this.expansion.resetAll(),n){this.nodePositions.set(new Map),this.fitToScreenClamped();return}this.relayoutVisibleSubset(e).then(()=>this.fitToScreenClamped()).catch(()=>{})}async relayoutVisibleSubset(e){let n=this.loader.nodes().filter(c=>e.has(c.path));if(n.length===0)return;let i=this.topology().edges.filter(c=>e.has(c.from)&&e.has(c.to)),r={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()},a=await Promise.resolve(r.algorithm==="force"?Af(n,i):Nf(this.dagreLayout,n,i,r)),s=new Map(this.nodePositions());for(let[c,u]of a)s.set(c,{x:u.x,y:u.y,manual:!0});this.nodePositions.set(s),Ha(s)}getViewportCenter(){let e=this.canvasWrap()?.nativeElement;if(!e)return{x:0,y:0};let n=e.getBoundingClientRect();return{x:n.width/2,y:n.height/2}}onNodePointerDown(e){this.nodeDrag.onNodePointerDown(e)}selectNode(e,n){this.nodeDrag.isClickWithoutDrag(n)&&(this.selectedNodeId.set(e.id),this.usageTracker.trackFeature("inspector"))}tagSelection=jP({nodes:this.loader.nodes,mapVisibility:this.mapVisibility});activeTagSelection=this.tagSelection.activeTagSelection;selectionState=$P({graph:this.graph,selectedNodeId:this.selectedNodeId,activeTagSelection:this.activeTagSelection});onTagSelect(e){this.tagSelection.onTagSelect(e)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&(typeof document<"u"&&PP(document)||this.closePanel())}resetFilters(){this.filters.reset()}onPanelResizeStart(e){this.panelResize.onPanelResizeStart(e)}openNode(e){this.selectedNodeId.set(e.id)}onCanvasClick(e){let n=e.target;n?.closest(".sm-gnode")||n?.closest(".graph__toolbar")||n?.closest(".perf-hud")||n?.closest(".kind-palette")||n?.closest(".graph__panel")||this.selectedNodeId.set(null)}isSelected(e){return this.selectionState.isSelected(e)}isHighlighted(e){return this.selectionState.isHighlighted(e)}isDimmed(e){return this.selectionState.isDimmed(e)}selectionFor(e){return this.selectionState.selectionView().get(e)??$de}isExpanded(e){return this.expansion.isExpanded(e)}setExpanded(e,n){this.expansion.setExpanded(e,n)}onFavoriteToggle(e){this.loader.toggleFavorite(e.path,e.value)}edgeSelectionFor(e){return this.selectionState.edgeSelectionView().get(e)??Wde}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-graph-view"]],viewQuery:function(n,i){n&1&&hn(i.flow,la,5)(i.canvas,sa,5)(i.zoom,ca,5)(i.canvasWrap,Ode,5),n&2&&jt(4)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Wa)},features:[ke([Df,mC(i0,{mode:oi.MANUAL})])],decls:7,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-curation-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"],["aria-hidden","true",1,"pi","pi-eye-slash","empty-state__icon"],["size","small","data-testid","graph-show-all-on-map",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"],[3,"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"],["icon","pi pi-eye","severity","secondary","size","small","data-testid","graph-show-all-toolbar",3,"onClick","label","ariaLabel","pTooltip","text"]],template:function(n,i){n&1&&(f(0,"section",1),M(1,Fde,4,1,"div",2)(2,Nde,6,2,"div",3)(3,Ade,5,3,"div",4)(4,Lde,5,3,"div",5)(5,Ude,32,40,"div",6),F(6,"p-confirmdialog",7),_()),n&2&&(l(),D(i.loading()&&!i.hasData()?1:i.error()&&!i.hasData()?2:i.showEmptyState()?3:i.showCurationEmptyState()?4:5),l(5),m("ariaLabel",i.texts.resetLayoutConfirm.header))},dependencies:[SC,la,sa,bC,gC,ca,xC,Ry,Oy,vC,Qy,tC,yC,CC,kh,Zy,wC,pC,OD,LD,VD,jD,$D,KD,wP,kn,_n,fb,hb,ze,Ve,Jn,TP],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:var(--sm-shadow-panel);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:-3px;bottom:0;width:6px;cursor:ew-resize;z-index:2}.graph__panel-resize[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:4px;background:transparent;transition:background .12s ease}.graph__panel-resize[_ngcontent-%COMP%]:hover:after, .graph__panel-resize[_ngcontent-%COMP%]:active:after{background:var(--p-primary-color)}.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})}return t})();var qa=440,v0=280,Kde=480;function n3(t){let o=X(t.initialWidth),e=X(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&Ga(window,"resize").pipe(Qn(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let n=()=>Math.max(v0,e()-Kde),i=E(()=>{let C=n(),k=o();return k>C||k<v0?Math.min(qa,C):k}),r=null,a=null,s=null,c=()=>{s=null,a!==null&&(o.set(a),a=null)},u=C=>{if(!r)return;let k=C.clientX-r.mouseX,I=r.widthAtStart+k,N=n();a=Math.min(N,Math.max(v0,I)),s===null&&typeof window<"u"&&(s=window.requestAnimationFrame(c))},h=()=>{r&&(r=null,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h),s!==null&&typeof window<"u"&&(window.cancelAnimationFrame(s),s=null),a!==null&&(o.set(a),a=null),t.onCommit(o()))};return{clampedRailWidth:i,onRailResizeStart:C=>{C.button===0&&(C.preventDefault(),C.stopPropagation(),r={mouseX:C.clientX,widthAtStart:i()},document.addEventListener("mousemove",u),document.addEventListener("mouseup",h))}}}var i3=(()=>{class t{router=p(es);route=p(Ja);open(e){this.router.navigate([],{relativeTo:this.route,queryParams:{path:e},queryParamsHandling:"merge"})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function Yde(t,o){if(t&1){let e=$();f(0,"p-iconfield",3),F(1,"p-inputicon",7),f(2,"input",8),A("ngModelChange",function(i){w(e);let r=d();return T(r.onSearchChange(i))}),_()()}if(t&2){let e=d();l(2),m("placeholder",e.texts.rail.searchPlaceholder)("ngModel",e.searchText()),O("aria-label",e.texts.rail.searchAriaLabel)}}function Xde(t,o){if(t&1){let e=$();f(0,"div",9),F(1,"sm-files-view"),_(),f(2,"div",10),A("mousedown",function(i){w(e);let r=d();return T(r.onRailResizeStart(i))}),_()}if(t&2){let e=d();l(2),O("aria-label",e.texts.rail.resize)}}var o3="sm.workspace.rail-width",r3="sm.workspace.rail-collapsed",KSe=(()=>{class t{store=p(on);destroyRef=p(xt);texts=Ob;railCollapsed=X(this.readStoredCollapsed());railAnimating=X(!1);railAnimTimer=null;searchText=this.store.searchText;graphView=nt(yf);isolate(e){this.graphView()?.isolateNeighborhood(e)}resize=n3({destroyRef:this.destroyRef,initialWidth:this.readStoredWidth(),onCommit:e=>this.writeStoredWidth(e)});clampedRailWidth=this.resize.clampedRailWidth;onRailResizeStart=this.resize.onRailResizeStart;toggleRail(){this.railCollapsed.update(e=>!e),this.writeStoredCollapsed(this.railCollapsed()),this.railAnimating.set(!0),this.railAnimTimer!==null&&clearTimeout(this.railAnimTimer),this.railAnimTimer=setTimeout(()=>this.railAnimating.set(!1),220)}onSearchChange(e){this.store.setSearchText(e)}readStoredWidth(){if(typeof localStorage>"u")return qa;let e=Number(localStorage.getItem(o3));return Number.isFinite(e)&&e>0?e:qa}writeStoredWidth(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(o3,String(e))}catch{}}readStoredCollapsed(){if(typeof localStorage>"u")return!0;let e=localStorage.getItem(r3);return e===null?!0:e==="1"}writeStoredCollapsed(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(r3,e?"1":"0")}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-workspace-view"]],viewQuery:function(n,i){n&1&&hn(i.graphView,yf,5),n&2&&jt()},features:[ke([{provide:fo,useClass:i3},{provide:ps,useExisting:Cn(()=>t)}])],decls:9,vars:15,consts:[["data-testid","workspace-view",1,"workspace"],["data-testid","workspace-rail",1,"workspace__rail"],[1,"workspace__rail-bar"],["iconPosition","left",1,"workspace__search"],["type","button","tooltipPosition","bottom","data-testid","workspace-rail-toggle",1,"workspace__rail-btn",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],[1,"workspace__map"],["styleClass","pi pi-search"],["pInputText","","pSize","small","type","text","data-testid","workspace-search",3,"ngModelChange","placeholder","ngModel"],[1,"workspace__rail-body"],["role","separator","aria-orientation","vertical","data-testid","workspace-rail-resize",1,"workspace__rail-resize",3,"mousedown"]],template:function(n,i){n&1&&(f(0,"div",0)(1,"aside",1)(2,"div",2),M(3,Yde,3,3,"p-iconfield",3),f(4,"button",4),A("click",function(){return i.toggleRail()}),F(5,"i",5),_()(),M(6,Xde,3,1),_(),f(7,"div",6),F(8,"sm-graph-view"),_()()),n&2&&(l(),Ne("width",i.railCollapsed()?null:i.clampedRailWidth(),"px"),ue("is-collapsed",i.railCollapsed())("is-animating",i.railAnimating()),O("aria-label",i.texts.rail.label),l(2),D(i.railCollapsed()?-1:3),l(),m("pTooltip",i.railCollapsed()?i.texts.rail.expand:i.texts.rail.collapse),O("aria-label",i.railCollapsed()?i.texts.rail.expand:i.texts.rail.collapse),l(),ue("pi-times",!i.railCollapsed())("pi-angle-right",i.railCollapsed()),l(),D(i.railCollapsed()?-1:6))},dependencies:[Wv,yf,kt,H0,Lt,Bt,G0,q0,U0,j0,ns,uo,ze,Ve],styles:['.workspace[_ngcontent-%COMP%]{display:flex;height:100%;min-height:0}.workspace__rail[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;flex:0 0 auto;width:440px;min-width:0;min-height:0;background:var(--sm-bg-content);border-right:1px solid var(--sm-border)}.workspace__rail.is-collapsed[_ngcontent-%COMP%]{width:44px}.workspace__rail.is-animating[_ngcontent-%COMP%]{transition:width .18s ease}.workspace__rail-bar[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;align-items:center;gap:.4rem;padding:.35rem .4rem;border-bottom:1px solid var(--sm-border)}.workspace__rail.is-collapsed[_ngcontent-%COMP%] .workspace__rail-bar[_ngcontent-%COMP%]{justify-content:center}.workspace__search[_ngcontent-%COMP%]{flex:1;min-width:0;display:block}.workspace__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.workspace__rail-btn[_ngcontent-%COMP%]{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:var(--sm-radius-lg);background:transparent;color:var(--p-text-muted-color);cursor:pointer}.workspace__rail-btn[_ngcontent-%COMP%]:hover{background:var(--p-content-hover-background);color:var(--p-text-color)}.workspace__rail-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.workspace__rail-body[_ngcontent-%COMP%] sm-files-view[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;max-width:none;margin:0;padding:.5rem}.workspace__rail-resize[_ngcontent-%COMP%]{position:absolute;top:0;right:-3px;bottom:0;width:6px;cursor:ew-resize;z-index:5}.workspace__rail-resize[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;right:3px;width:4px;background:transparent;transition:background .12s ease}.workspace__rail-resize[_ngcontent-%COMP%]:hover:after, .workspace__rail-resize[_ngcontent-%COMP%]:active:after{background:var(--p-primary-color)}.workspace__map[_ngcontent-%COMP%]{position:relative;flex:1;min-width:0;min-height:0}.workspace__map[_ngcontent-%COMP%] sm-graph-view[_ngcontent-%COMP%]{display:block;height:100%}'],changeDetection:0})}return t})();export{KSe as WorkspaceView};
|
|
2204
|
+
.sm annotation`}};var Xre=()=>({class:"link-kind-palette__content"}),Zre=t=>({content:t}),Qre=(t,o)=>o.kind;function Jre(t,o){if(t&1&&b(0),t&2){let e=d(2).$implicit;Se(" ",e.text," ")}}function eae(t,o){if(t&1&&F(0,"i"),t&2){let e=d(2).$implicit;H(e.icon)}}function tae(t,o){if(t&1&&(f(0,"span",4),M(1,Jre,1,1)(2,eae,1,2,"i",5),_()),t&2){let e=d().$implicit;l(),D(e.text?1:e.icon?2:-1)}}function nae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",3),A("ngModelChange",function(){let i=w(e).$implicit,r=d(2);return T(r.toggle(i.kind))}),S(1,tae,3,1,"ng-template",null,0,We),_()}if(t&2){let e=o.$implicit,n=d(2);m("ngModel",n.isActive(e.kind))("pTooltip",e.tooltip)("ariaLabel",e.label)("styleClass","link-kind-palette__btn link-kind-palette__btn--"+e.kind)("pt",Re(7,Zre,At(6,Xre))),O("data-testid","link-kind-palette-"+e.kind)}}function iae(t,o){if(t&1&&(f(0,"div",1),re(1,nae,3,9,"p-togglebutton",2,Qre),_()),t&2){let e=d();O("aria-label",e.texts.a11y.toolbarLabel),l(),ae(e.entries())}}var BD=[{kind:"invokes",label:Nn.kinds.invokes,tooltip:Nn.tooltips.invokes,text:"/"},{kind:"references",label:Nn.kinds.references,tooltip:Nn.tooltips.references,icon:"pi pi-link"},{kind:"mentions",label:Nn.kinds.mentions,tooltip:Nn.tooltips.mentions,text:"@"},{kind:"supersedes",label:Nn.kinds.supersedes,tooltip:Nn.tooltips.supersedes,icon:"pi pi-angle-double-right"}];for(let t of BD)if(!Q0.includes(t.kind))throw new Error(`link-kind-palette: unknown link kind "${t.kind}"`);var VD=(()=>{class t{loader=p(Vt);filters=p(on);texts=Nn;counts=E(()=>{let e=this.loader.scan(),n=new Map;if(!e)return n;for(let i of e.links)n.set(i.kind,(n.get(i.kind)??0)+1);return n});entries=E(()=>{let e=this.counts(),n=this.filters.selectedLinkKinds(),i=new Set(n);return BD.filter(r=>(e.get(r.kind)??0)>0||i.has(r.kind))});constructor(){de(()=>{let e=this.counts(),n=this.filters.selectedLinkKinds(),i=n.filter(r=>(e.get(r)??0)>0);i.length!==n.length&&this.filters.setLinkKinds(i)})}isActive(e){return this.filters.isLinkKindActive(e)}toggle(e){this.filters.toggleLinkKind(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,iae,3,1,"div",1),n&2&&D(i.entries().length>0?0:-1)},dependencies:[kt,Lt,Bt,Zn,Xn,ze,Ve],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:var(--sm-radius-xl);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})}return t})();var zD={a11y:{toolbarLabel:"Toggle severity filters"},error:{label:"Errors",tooltip:"Only nodes with errors"},warn:{label:"Warnings",tooltip:"Only nodes with warnings"}};var qD=()=>({class:"severity-palette__content"}),GD=t=>({content:t});function oae(t,o){if(t&1&&(f(0,"span",5),F(1,"i",6),_(),f(2,"span",7),b(3),_()),t&2){let e=d(3);l(3),x(e.errorCount())}}function rae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",4),A("ngModelChange",function(){w(e);let i=d(2);return T(i.toggle("error"))}),S(1,oae,4,1,"ng-template",null,0,We),_()}if(t&2){let e=d(2);m("ngModel",e.isActive("error"))("pTooltip",e.texts.error.tooltip)("ariaLabel",e.texts.error.label)("pt",Re(5,GD,At(4,qD)))}}function aae(t,o){if(t&1&&(f(0,"span",5),F(1,"i",9),_(),f(2,"span",7),b(3),_()),t&2){let e=d(3);l(3),x(e.warnCount())}}function sae(t,o){if(t&1){let e=$();f(0,"p-togglebutton",8),A("ngModelChange",function(){w(e);let i=d(2);return T(i.toggle("warn"))}),S(1,aae,4,1,"ng-template",null,0,We),_()}if(t&2){let e=d(2);m("ngModel",e.isActive("warn"))("pTooltip",e.texts.warn.tooltip)("ariaLabel",e.texts.warn.label)("pt",Re(5,GD,At(4,qD)))}}function lae(t,o){if(t&1&&(f(0,"div",1),M(1,rae,3,7,"p-togglebutton",2),M(2,sae,3,7,"p-togglebutton",3),_()),t&2){let e=d();O("aria-label",e.texts.a11y.toolbarLabel),l(),D(e.showError()?1:-1),l(),D(e.showWarn()?2:-1)}}var jD=(()=>{class t{loader=p(Vt);filters=p(on);issuePaths=p(yo);mapVisibility=p(ei);texts=zD;visibleSet=E(()=>{let e=this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()),n=new Set;for(let i of e)this.mapVisibility.inScope(i.path)&&n.add(i.path);return n});rawErrorCount=E(()=>this.issuePaths.bySeverity().errors.size);rawWarnCount=E(()=>this.issuePaths.bySeverity().warns.size);errorCount=E(()=>HD(this.issuePaths.bySeverity().errors,this.visibleSet()));warnCount=E(()=>HD(this.issuePaths.bySeverity().warns,this.visibleSet()));showError=E(()=>this.rawErrorCount()>0||this.filters.severityErrorActive());showWarn=E(()=>this.rawWarnCount()>0||this.filters.severityWarnActive());hasAny=E(()=>this.showError()||this.showWarn());constructor(){de(()=>{this.rawErrorCount()===0&&this.filters.severityErrorActive()&&this.filters.toggleSeverity("error"),this.rawWarnCount()===0&&this.filters.severityWarnActive()&&this.filters.toggleSeverity("warn")})}isActive(e){return this.filters.isSeverityActive(e)}toggle(e){this.filters.toggleSeverity(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,lae,3,3,"div",1),n&2&&D(i.hasAny()?0:-1)},dependencies:[kt,Lt,Bt,Zn,Xn,ze,Ve],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:var(--sm-radius-xl);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})}return t})();function HD(t,o){let[e,n]=t.size<=o.size?[t,o]:[o,t],i=0;for(let r of e)n.has(r)&&i++;return i}function UD(t,o){let e=X(null),n=0;return de(()=>{let i=t().trim(),r=++n;e.set(null),i&&o(i).then(a=>{r===n&&e.set(a)}).catch(()=>{r===n&&e.set(null)})}),e.asReadonly()}function Va(t,o){return Ln(Va),UD(t,e=>o.renderInline(e))}function c0(t,o){return Ln(c0),UD(t,e=>o.render(e))}var cae=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,dae=/^[a-z]+$/i;function df(t){if(typeof t!="string")return null;let o=t.trim();return o.length===0?null:cae.test(o)||dae.test(o)?o:null}var uae=(t,o)=>o.step;function pae(t,o){t&1&&(f(0,"span",8),b(1),_()),t&2&&(l(),x(o))}function hae(t,o){if(t&1&&(f(0,"span",12)(1,"span",28),b(2,"T"),_(),b(3),_()),t&2){let e=d(),n=Ce(0);m("pTooltip",e.texts.stats.tokens(n.tokensTotal)),l(3),x(e.tokensShort())}}function fae(t,o){if(t&1&&(f(0,"span",13)(1,"span",28),b(2,"B"),_(),b(3),_()),t&2){let e=d(),n=Ce(0);m("pTooltip",e.texts.stats.bytes(n.bytesTotal)),l(3),x(e.bytesShort())}}function mae(t,o){if(t&1&&(f(0,"span",29),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function _ae(t,o){if(t&1&&(f(0,"span",30),b(1),_()),t&2){let e=d(2),n=Ce(2);l(),x(e.texts.tagOverflow(n))}}function gae(t,o){if(t&1&&(f(0,"div",17),re(1,mae,2,1,"span",29,Ue),M(3,_ae,2,1,"span",30),_()),t&2){d();let e=Ce(1),n=Ce(2);l(),ae(e),l(2),D(n>0?3:-1)}}function bae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function vae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,bae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.topics.tooltip),l(),x(n.texts.llm.topics.label),l(2),ae(e.topics)}}function yae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Cae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,yae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.facts.tooltip),l(),x(n.texts.llm.facts.label),l(2),ae(e.keyFacts)}}function xae(t,o){if(t&1&&(M(0,vae,6,2,"div",31),M(1,Cae,6,2,"div",31)),t&2){let e=o;D(e.topics!=null&&e.topics.length?0:-1),l(),D(e.keyFacts!=null&&e.keyFacts.length?1:-1)}}function wae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.when.tooltip),l(),x(n.texts.llm.when.label),l(2),x(e.whenToUse)}}function Tae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.style.tooltip),l(),x(n.texts.llm.style.label),l(2),x(e.interactionStyle)}}function Sae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function kae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Sae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.does.tooltip),l(),x(n.texts.llm.does.label),l(2),ae(e.capabilities)}}function Iae(t,o){if(t&1&&(M(0,wae,5,3,"div",31),M(1,Tae,5,3,"div",31),M(2,kae,6,2,"div",31)),t&2){let e=o;D(e.whenToUse?0:-1),l(),D(e.interactionStyle?1:-1),l(),D(e.capabilities!=null&&e.capabilities.length?2:-1)}}function Eae(t,o){if(t&1&&b(0),t&2){let e=o.$implicit,n=o.$index,i=o.$count;I0("",e.step,". ",e.description,"",n===i-1?"":" \xB7 ")}}function Mae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"span"),re(4,Eae,1,3,null,null,uae),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.steps.tooltip),l(),x(n.texts.llm.steps.label),l(2),ae(e.recipe)}}function Dae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Pae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Dae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.pre.tooltip),l(),x(n.texts.llm.pre.label),l(2),ae(e.preconditions)}}function Rae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Oae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Rae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.out.tooltip),l(),x(n.texts.llm.out.label),l(2),ae(e.outputs)}}function Fae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Nae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Fae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.fx.tooltip),l(),x(n.texts.llm.fx.label),l(2),ae(e.sideEffects)}}function Aae(t,o){if(t&1&&(M(0,Mae,6,2,"div",31),M(1,Pae,6,2,"div",31),M(2,Oae,6,2,"div",31),M(3,Nae,6,2,"div",31)),t&2){let e=o;D(e.recipe!=null&&e.recipe.length?0:-1),l(),D(e.preconditions!=null&&e.preconditions.length?1:-1),l(),D(e.outputs!=null&&e.outputs.length?2:-1),l(),D(e.sideEffects!=null&&e.sideEffects.length?3:-1)}}function Lae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"code",35),b(4),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.eg.tooltip),l(),x(n.texts.llm.eg.label),l(2),x(e.invocationExample)}}function Bae(t,o){if(t&1&&(f(0,"span",34),b(1),_()),t&2){let e=o.$implicit;l(),x(e)}}function Vae(t,o){if(t&1&&(f(0,"div",31)(1,"span",32),b(2),_(),f(3,"div",33),re(4,Bae,2,1,"span",34,Ue),_()()),t&2){let e=d(),n=d(2);l(),m("pTooltip",n.texts.llm.fx.tooltip),l(),x(n.texts.llm.fx.label),l(2),ae(e.sideEffects)}}function zae(t,o){if(t&1&&(M(0,Lae,5,3,"div",31),M(1,Vae,6,2,"div",31)),t&2){let e=o;D(e.invocationExample?0:-1),l(),D(e.sideEffects!=null&&e.sideEffects.length?1:-1)}}function Hae(t,o){if(t&1&&(f(0,"div",22),M(1,xae,2,2),M(2,Iae,3,3),M(3,Aae,4,4),M(4,zae,2,2),_()),t&2){let e,n,i,r,a=d();l(),D((e=a.summaryMarkdown())?1:-1,e),l(),D((n=a.summaryAgent())?2:-1,n),l(),D((i=a.summarySkill())?3:-1,i),l(),D((r=a.summaryCommand())?4:-1,r)}}function qae(t,o){if(t&1&&F(0,"div",23),t&2){let e=d();m("innerHTML",e.descriptionHtml(),ki)}}function Gae(t,o){if(t&1&&(f(0,"div",36)(1,"div",37)(2,"span",38),b(3),_(),f(4,"span",39),b(5),_()()()),t&2){let e=d(),n=d();l(3),x(n.texts.meta.model),l(2),x(e.model)}}function jae(t,o){t&1&&M(0,Gae,6,2,"div",36),t&2&&D(o.model?0:-1)}var Uae={selected:!1,highlighted:!1,dimmed:!1},$D=(()=>{class t{node=B.required();stats=B({linksIn:0,linksOut:0});summary=B(null);selection=B(Uae);isFavorite=B(!1);favoriteToggle=Ke();texts=ti;expanded=Ei(!1);fmAgent=E(()=>{let e=this.node();return e.kind==="agent"?e.frontmatter:null});summaryAgent=E(()=>{let e=this.summary();return e?.kind==="agent"?e:null});summarySkill=E(()=>{let e=this.summary();return e?.kind==="skill"?e:null});summaryCommand=E(()=>{let e=this.summary();return e?.kind==="command"?e:null});summaryMarkdown=E(()=>{let e=this.summary();return e?.kind==="markdown"?e:null});hasLlmCluster=E(()=>{let e=this.summary();return e!==null&&this.hasLlmContent(e)});hasLlmContent(e){switch(e.kind){case"markdown":return(e.topics?.length??0)>0||(e.keyFacts?.length??0)>0;case"agent":return!!e.whenToUse||!!e.interactionStyle||(e.capabilities?.length??0)>0;case"skill":return(e.recipe?.length??0)>0||(e.preconditions?.length??0)>0||(e.outputs?.length??0)>0||(e.sideEffects?.length??0)>0;case"command":return!!e.invocationExample||(e.sideEffects?.length??0)>0;default:return!1}}nodeColor=E(()=>{let e=this.node();if(e.kind!=="agent")return null;let n=e.frontmatter;return df(n.color)});markdown=p(bo);bytesShort=E(()=>{let e=this.stats().bytesTotal;return e===void 0?null:vr(e)});tokensShort=E(()=>{let e=this.stats().tokensTotal;return e===void 0?null:vr(e)});version=E(()=>is(this.node()));stability=E(()=>po(this.node()));tagChips=E(()=>ho(this.node()));visibleTagChips=E(()=>this.tagChips().slice(0,3));moreTagsCount=E(()=>Math.max(0,this.tagChips().length-3));displayName=E(()=>{let e=this.node().frontmatter;return e.name?e.name:cs(this.node().path)});description=E(()=>this.node().frontmatter.description??"");descriptionHtml=Va(this.description,this.markdown);toggleExpanded(e){e.stopPropagation(),this.expanded.update(n=>!n)}toggleFavorite(e){e.stopPropagation();let n=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:n})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:15,hostBindings:function(n,i){n&2&&(O("data-kind",i.node().kind),Ne("--node-color",i.nodeColor()),ue("sm-gnode--with-color",!!i.nodeColor())("sm-gnode--deprecated",i.stability()==="deprecated")("sm-gnode--expanded",i.expanded())("sm-gnode--selected",i.selection().selected)("sm-gnode--highlighted",i.selection().highlighted)("sm-gnode--dimmed",i.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",3,"innerHTML"],[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"],["data-testid","node-card-tags-more",1,"sm-gnode__tag-more"],[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(n,i){if(n&1&&(Ut(0)(1)(2),f(3,"div",0)(4,"div",1),F(5,"sm-kind-icon",2),_(),f(6,"div",3)(7,"div",4)(8,"span",5),b(9),_(),F(10,"sm-view-contributions-host",6),_()(),f(11,"div",7),M(12,pae,2,1,"span",8),f(13,"button",9),A("click",function(a){return i.toggleExpanded(a)}),F(14,"i",10),_()(),f(15,"div",11),M(16,hae,4,2,"span",12),M(17,fae,4,2,"span",13),f(18,"button",14),A("click",function(a){return i.toggleFavorite(a)}),F(19,"i",15),_(),F(20,"sm-view-contributions-host",16),_()(),M(21,gae,4,1,"div",17),f(22,"div",18)(23,"div",19),F(24,"i",20),f(25,"span",21),b(26),_()(),M(27,Hae,5,4,"div",22),M(28,qae,1,1,"div",23),M(29,jae,1,1),_(),f(30,"div",24),F(31,"sm-view-contributions-host",25),f(32,"div",26),F(33,"sm-view-contributions-host",27),_()()),n&2){let r,a,s=i.node();Tt(i.stats()),l();let c=Tt(i.visibleTagChips());l(),Tt(i.moreTagsCount()),l(3),m("kind",s.kind)("provider",s.provider)("size",18),l(3),m("pTooltip",i.displayName()),l(),x(i.displayName()),l(),m("node",i.node()),l(2),D((r=i.version())?12:-1,r),l(),O("aria-label",i.texts.ariaExpand),l(3),D(i.tokensShort()!==null?16:-1),l(),D(i.bytesShort()!==null?17:-1),l(),ue("sm-gnode__favorite--on",i.isFavorite()),m("pTooltip",i.isFavorite()?i.texts.favoriteRemoveTooltip:i.texts.favoriteAddTooltip),O("aria-label",i.isFavorite()?i.texts.ariaFavoriteRemove:i.texts.ariaFavoriteAdd),l(),ue("pi-star-fill",i.isFavorite())("pi-star",!i.isFavorite()),l(),m("node",i.node()),l(),D(c.length?21:-1),l(2),m("pTooltip",s.path),l(3),x(s.path),l(),D(i.hasLlmCluster()?27:-1),l(),D(i.description()?28:-1),l(),D((a=i.fmAgent())?29:-1,a),l(2),m("node",i.node()),l(2),m("node",i.node())}},dependencies:[nr,ze,Ve,Jn],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:var(--sm-radius-lg);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:var(--sm-radius-lg);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)}[_nghost-%COMP%] .sm-gnode__desc code{background:var(--sm-bg-hover);padding:.02rem .25rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .sm-gnode__desc a{color:var(--p-primary-color);text-decoration:underline}.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-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})}return t})();var WD={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,o)=>`${t}/${o} nodes`,links:t=>`${t} links`}};var $ae=["sparkline"],Wae=()=>({class:"perf-hud__content"}),Kae=t=>({content:t});function Yae(t,o){if(t&1&&(f(0,"span",9),b(1),_()),t&2){let e=d(2);l(),x(e.texts.units.mb(e.heapMb()))}}function Xae(t,o){if(t&1&&(f(0,"div",3)(1,"span",4),b(2),_()(),f(3,"div",5)(4,"div",6)(5,"div",7),F(6,"canvas",8,1),f(8,"span",9),b(9),_()(),f(10,"div",10)(11,"div",11),M(12,Yae,2,1,"span",9),f(13,"span",9),b(14),_(),f(15,"span",9),b(16),_()()(),f(17,"div",10)(18,"div",11)(19,"span",9),b(20),_(),f(21,"span",9),b(22),_()()()()()),t&2){let e=d();l(2),x(e.texts.units.fps(e.fps())),l(),O("aria-hidden",!e.expanded()),l(6),x(e.texts.units.ms(e.frameTimeMs())),l(3),D(e.hasHeap()?12:-1),l(2),x(e.texts.units.domNodes(e.domNodes())),l(2),x(e.texts.units.longTasks(e.longTasks())),l(4),x(e.texts.units.nodes(e.visible(),e.total())),l(2),x(e.texts.units.links(e.edges()))}}var Zae=30,d0=60,uf=14,KD=(()=>{class t{visible=B(0);total=B(0);edges=B(0);texts=WD;destroyRef=p(xt);zone=p(Jt);fps=X(0);frameTimeMs=X(0);fpsSamples=X([]);sparklineCanvas=nt("sparkline");heapMb=X(null);longTasks=X(0);domNodes=X(0);expanded=X(Qae());hasHeap=E(()=>this.heapMb()!==null);constructor(){let e=0,n=0,i=performance.now(),r=i,a=0,s=u=>{let h=u-i;if(i=u,e+=1,n+=h,u-r>=1e3){let g=(u-r)/1e3,C=Math.round(e/g);this.fps.set(C),this.frameTimeMs.set(Math.round(n/Math.max(e,1))),this.heapMb.set(ese()),this.domNodes.set(document.querySelectorAll("*").length),this.fpsSamples.update(k=>{let I=k.length>=Zae?k.slice(1):k.slice();return I.push(C),I}),e=0,n=0,r=u}a=requestAnimationFrame(s)};this.zone.runOutsideAngular(()=>{a=requestAnimationFrame(s)});let c=null;if(typeof PerformanceObserver<"u")try{c=new PerformanceObserver(u=>{this.longTasks.update(h=>h+u.getEntries().length)}),c.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(a),c?.disconnect()}),de(()=>{let u=this.sparklineCanvas(),h=this.fpsSamples();u&&tse(u.nativeElement,h)})}setExpanded(e){this.expanded.set(e),Jae(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-perf-hud"]],viewQuery:function(n,i){n&1&&hn(i.sparklineCanvas,$ae,5),n&2&&jt()},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(n,i){n&1&&(f(0,"p-togglebutton",2),A("ngModelChange",function(a){return i.setExpanded(a)}),S(1,Xae,23,8,"ng-template",null,0,We),_()),n&2&&m("ngModel",i.expanded())("ariaLabel",i.expanded()?i.texts.a11y.collapse:i.texts.a11y.expand)("styleClass",i.expanded()?"perf-hud perf-hud--expanded":"perf-hud")("pt",Re(5,Kae,At(4,Wae)))},dependencies:[kt,Lt,Bt,Zn,Xn],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})}return t})(),YD="sm.perf-hud.expanded";function Qae(){try{return localStorage.getItem(YD)==="1"}catch{return!1}}function Jae(t){try{localStorage.setItem(YD,t?"1":"0")}catch{}}function ese(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function tse(t,o){let e=window.devicePixelRatio||1,n=d0*e,i=uf*e;(t.width!==n||t.height!==i)&&(t.width=n,t.height=i);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,d0,uf),o.length<2))return;let a=Math.max(60,...o),s=d0/(o.length-1);r.beginPath();for(let c=0;c<o.length;c+=1){let u=c*s,h=uf-o[c]/a*uf;c===0?r.moveTo(u,h):r.lineTo(u,h)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var nse="debug-fps",XD=(()=>{class t{visible=X(this.resolveInitial());resolveInitial(){let n=new URLSearchParams(window.location.search).get(nse);return n!==null&&n!=="0"&&n!=="false"?!0:n==="0"||n==="false"?!1:lf.graph.perfHud}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ir={emptyNoSelection:{title:"No node selected",desc:"Select a node to inspect it."},emptyNotFound:{title:"Node not found",descSuffix:" This node is no longer in the scan."},header:{invalidFrontmatter:"invalid frontmatter",invalidFrontmatterTooltip:"The YAML frontmatter could not be parsed, so name, description and other metadata are unavailable. Check the Findings section for the parser error.",tagFilterAriaLabel:t=>`Select every node tagged ${t} on the map`},sections:{annotations:"Annotations",connections:"Connections",findings:"Findings",metadata:"Metadata",plugins:"Plugin contributions",body:"Body"},body:{loading:"Loading body\u2026"},findingHintLabel:"Hint:",actionErrorDismissAriaLabel:"Dismiss",audit:{headerEmpty:"never bumped",fields:{lastBumpedAt:"Last bumped",lastBumpedBy:"by",createdAt:"Created",createdBy:"by"}},supersededByBanner:t=>`Superseded by ${t}`};var ZD={cardHeader:"Annotations",emptyOverlay:"No sidecar (.sm) file present for this node.",emptyAnnotations:"Sidecar present but no annotations are declared yet.",sections:{supersession:"Supersession",provenance:"Authors",repository:"Repository",docs:"Docs"},fields:{supersedes:"Supersedes",supersededBy:"Superseded by",authors:"Authors",license:"License",source:"Source",sourceVersion:"Source version",docsUrl:"Docs URL"},brokenRefTooltip:"This path does not resolve to a node in the current scan scope."};function za(t){if(typeof t!="string"||t.length===0)return null;try{let o=new URL(t);return o.protocol==="http:"||o.protocol==="https:"?t:null}catch{return null}}function ise(t,o){if(t&1&&(f(0,"p",1),b(1),_()),t&2){let e=d(2);l(),x(e.texts.emptyOverlay)}}function ose(t,o){if(t&1&&(f(0,"p",2),b(1),_()),t&2){let e=d(2);l(),x(e.texts.emptyAnnotations)}}function rse(t,o){if(t&1&&M(0,ise,2,1,"p",1)(1,ose,2,1,"p",2),t&2){let e,n=d();D((e=n.overlay())!=null&&e.present?1:0)}}function ase(t,o){if(t&1&&(f(0,"span",4),F(1,"i",5),f(2,"span"),b(3),_()()),t&2){let e=o.$implicit;l(3),x(e)}}function sse(t,o){if(t&1&&re(0,ase,4,1,"span",4,Ue),t&2){d();let e=Ce(0);ae(e.authors)}}function lse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",6),f(2,"span"),b(3),_()()),t&2){d();let e=Ce(0);l(3),x(e.license)}}function cse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",3),M(4,sse,2,0),M(5,lse,4,1,"span",4),_()),t&2){let e=d(2),n=Tt(e.provenance());l(2),x(e.texts.sections.provenance),l(2),D(n.authors.length?4:-1),l(),D(n.license!==null?5:-1)}}function dse(t,o){if(t&1){let e=$();f(0,"a",11),A("click",function(){w(e),d(2);let i=Ce(0),r=d(2);return T(r.onOpenPath(i.supersededBy))})("keydown.enter",function(){w(e),d(2);let i=Ce(0),r=d(2);return T(r.onOpenPath(i.supersededBy))})("keydown.space",function(i){w(e),d(2);let r=Ce(0);return d(2).onOpenPath(r.supersededBy),T(i.preventDefault())}),b(1),_()}if(t&2){d(2);let e=Ce(0);l(),Se(" ",e.supersededBy," ")}}function use(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){d(2);let e=Ce(0),n=d(2);m("pTooltip",n.texts.brokenRefTooltip),l(),x(e.supersededBy)}}function pse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",8),f(2,"span"),b(3),_()(),M(4,dse,2,1,"a",9)(5,use,2,2,"span",10)),t&2){d();let e=Ce(0),n=d(2);l(3),x(n.texts.fields.supersededBy),l(),D(n.isBroken(e.supersededBy)?5:4)}}function hse(t,o){if(t&1){let e=$();f(0,"a",11),A("click",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpenPath(i))})("keydown.enter",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpenPath(i))})("keydown.space",function(i){w(e);let r=d().$implicit;return d(4).onOpenPath(r),T(i.preventDefault())}),b(1),_()}if(t&2){let e=d().$implicit;l(),Se(" ",e," ")}}function fse(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){let e=d().$implicit,n=d(4);m("pTooltip",n.texts.brokenRefTooltip),l(),x(e)}}function mse(t,o){if(t&1&&M(0,hse,2,1,"a",9)(1,fse,2,2,"span",10),t&2){let e=o.$implicit,n=d(4);D(n.isBroken(e)?1:0)}}function _se(t,o){if(t&1&&(f(0,"span",4),F(1,"i",12),f(2,"span"),b(3),_()(),re(4,mse,2,1,null,null,Ue)),t&2){d();let e=Ce(0),n=d(2);l(3),x(n.texts.fields.supersedes),l(),ae(e.supersedes)}}function gse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",7),M(4,pse,6,2),M(5,_se,6,1),_()),t&2){let e=d(2),n=Tt(e.supersession());l(2),x(e.texts.sections.supersession),l(2),D(n.supersededBy!==null?4:-1),l(),D(n.supersedes.length?5:-1)}}function bse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",14),f(2,"a",15),b(3),_()()),t&2){d();let e=Ce(0);l(2),m("href",e.source,lr),l(),x(e.source)}}function vse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",16),f(2,"code"),b(3),_()()),t&2){d();let e=Ce(0);l(3),x(e.sourceVersion)}}function yse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",13),M(4,bse,4,2,"span",4),M(5,vse,4,1,"span",4),_()),t&2){let e=d(2),n=Tt(e.repository());l(2),x(e.texts.sections.repository),l(2),D(n.source!==null?4:-1),l(),D(n.sourceVersion!==null?5:-1)}}function Cse(t,o){if(t&1&&(f(0,"span",4),F(1,"i",18),f(2,"a",15),b(3),_()()),t&2){d();let e=Ce(0);l(2),m("href",e.docsUrl,lr),l(),x(e.docsUrl)}}function xse(t,o){if(t&1&&(Ut(0),f(1,"dt"),b(2),_(),f(3,"dd",17),M(4,Cse,4,2,"span",4),_()),t&2){let e=d(2),n=Tt(e.docs());l(2),x(e.texts.sections.docs),l(2),D(n.docsUrl!==null?4:-1)}}function wse(t,o){if(t&1&&(f(0,"dl",0),M(1,cse,6,4),M(2,gse,6,4),M(3,yse,6,4),M(4,xse,5,3),_()),t&2){let e=d();l(),D(e.hasProvenance()?1:-1),l(),D(e.hasSupersession()?2:-1),l(),D(e.hasRepository()?3:-1),l(),D(e.hasDocs()?4:-1)}}var JD=(()=>{class t{overlay=B(void 0);knownPaths=B(null);openPath=Ke();texts=ZD;annotations=E(()=>{let e=this.overlay();return!e||!e.present?null:e.annotations??null});hasAnnotations=E(()=>{let e=this.annotations();return e!==null&&Object.keys(e).length>0});hasAnyContent=E(()=>this.hasSupersession()||this.hasProvenance()||this.hasRepository()||this.hasDocs());supersession=E(()=>{let e=this.annotations()??{};return{supersedes:QD(e.supersedes),supersededBy:u0(e.supersededBy)}});hasSupersession=E(()=>pf(this.supersession()));provenance=E(()=>{let e=this.annotations()??{};return{authors:QD(e.authors),license:u0(e.license)}});hasProvenance=E(()=>pf(this.provenance()));repository=E(()=>{let e=this.annotations()??{};return{source:za(e.source),sourceVersion:u0(e.sourceVersion)}});hasRepository=E(()=>pf(this.repository()));docs=E(()=>{let e=this.annotations()??{};return{docsUrl:za(e.docsUrl)}});hasDocs=E(()=>pf(this.docs()));isBroken(e){let n=this.knownPaths();return n?!n.has(e):!1}onOpenPath(e){this.isBroken(e)||this.openPath.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-annotations-panel"]],inputs:{overlay:[1,"overlay"],knownPaths:[1,"knownPaths"]},outputs:{openPath:"openPath"},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-provenance",1,"sm-block__inline"],[1,"sm-block__meta"],["aria-hidden","true",1,"pi","pi-user"],["aria-hidden","true",1,"pi","pi-shield"],["data-testid","annotations-section-supersession",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-arrow-down"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known"],[1,"sm-node-link",3,"pTooltip"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known",3,"click","keydown.enter","keydown.space"],["aria-hidden","true",1,"pi","pi-arrow-up"],["data-testid","annotations-section-repository",1,"sm-block__inline"],["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-docs",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-external-link"]],template:function(n,i){n&1&&M(0,rse,2,1)(1,wse,5,4,"dl",0),n&2&&D(i.hasAnyContent()?1:0)},dependencies:[ze,Ve],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}"],changeDetection:0})}return t})();function u0(t){return typeof t=="string"&&t.length>0?t:null}function QD(t){return Array.isArray(t)?t.filter(o=>typeof o=="string"&&o.length>0):[]}function pf(t){for(let o of Object.values(t))if(o!=null){if(Array.isArray(o)){if(o.length>0)return!0;continue}if(typeof o=="string"){if(o.length>0)return!0;continue}return!0}return!1}var eP={outgoingHeader:"Outgoing",incomingHeader:"Incoming",loading:"Loading links\u2026",error:"Failed to load links.",confidence:{high:"high",medium:"medium",low:"low"},confidenceTooltip:t=>`confidence: ${t}`,issueOnTargetTooltip:"Target has an issue: ",issueOnSourceTooltip:"Source has an issue: ",externalRefsHeader:"External"};var nP=(t,o)=>o.source+"|"+o.target+"|"+o.kind+"|"+((o.trigger==null?null:o.trigger.normalizedTrigger)??""),Tse=(t,o)=>o.url+"|"+(o.line??-1);function Sse(t,o){if(t&1&&(f(0,"p",1),b(1),_()),t&2){let e=d(2);l(),x(e.texts.loading)}}function kse(t,o){if(t&1&&(f(0,"p",2),b(1),_()),t&2){let e=d(2);l(),x(e.texts.error)}}function Ise(t,o){if(t&1&&(f(0,"span",12),b(1),_()),t&2){let e=d().$implicit;O("data-testid","linked-nodes-outgoing-link-"+e.target),l(),x(e.target)}}function Ese(t,o){if(t&1){let e=$();f(0,"button",17),A("click",function(){w(e);let i=d().$implicit,r=d(4);return T(r.onOpen(i.resolvedTarget??i.target))}),b(1),_()}if(t&2){let e=d().$implicit;O("data-testid","linked-nodes-outgoing-link-"+e.target),l(),x(e.target)}}function Mse(t,o){if(t&1&&(f(0,"span",16),b(1),_()),t&2){let e=o,n=d().$implicit;m("pTooltip",e.message),O("data-severity",e.severity)("data-testid","linked-nodes-outgoing-issue-"+n.target),l(),x(e.analyzerId)}}function Dse(t,o){if(t&1&&(f(0,"li",11),M(1,Ise,2,2,"span",12)(2,Ese,2,2,"button",13),f(3,"span",14),b(4),_(),f(5,"span",15),b(6),_(),M(7,Mse,2,4,"span",16),_()),t&2){let e,n=o.$implicit,i=d(4);O("data-testid","linked-nodes-outgoing-row-"+n.target),l(),D(i.outgoingBroken(n)?1:2),l(2),Ne("color",i.confidenceColor(n.confidence))("border-color",i.confidenceColor(n.confidence)),m("pTooltip",i.confidenceTooltip(n.confidence)),l(),x(i.confidenceValue(n.confidence)),l(),O("data-kind",n.kind),l(),x(n.kind),l(),D((e=i.issueForOutgoing(n))?7:-1,e)}}function Pse(t,o){if(t&1&&(f(0,"section",3)(1,"h4",6),F(2,"sm-icon",7),f(3,"span",8),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",10),re(8,Dse,8,11,"li",11,nP),_()()),t&2){let e=d(3);l(4),x(e.outgoing().length),l(2),x(e.texts.outgoingHeader),l(2),ae(e.outgoing())}}function Rse(t,o){if(t&1){let e=$();f(0,"li",11)(1,"button",17),A("click",function(){let i=w(e).$implicit,r=d(4);return T(r.onOpen(i.source))}),b(2),_(),f(3,"span",14),b(4),_(),f(5,"span",15),b(6),_()()}if(t&2){let e=o.$implicit,n=d(4);O("data-testid","linked-nodes-incoming-row-"+e.source),l(),O("data-testid","linked-nodes-incoming-link-"+e.source),l(),x(e.source),l(),Ne("color",n.confidenceColor(e.confidence))("border-color",n.confidenceColor(e.confidence)),m("pTooltip",n.confidenceTooltip(e.confidence)),l(),x(n.confidenceValue(e.confidence)),l(),O("data-kind",e.kind),l(),x(e.kind)}}function Ose(t,o){if(t&1&&(f(0,"section",4)(1,"h4",6),F(2,"sm-icon",18),f(3,"span",19),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",10),re(8,Rse,7,11,"li",11,nP),_()()),t&2){let e=d(3);l(4),x(e.incoming().length),l(2),x(e.texts.incomingHeader),l(2),ae(e.incoming())}}function Fse(t,o){if(t&1&&(f(0,"li",23)(1,"a",24),b(2),_()()),t&2){let e=o.$implicit;O("data-testid","linked-nodes-external-ref-"+e.url),l(),m("href",e.url,lr)("pTooltip",e.url),l(),x(e.url)}}function Nse(t,o){if(t&1&&(f(0,"section",5)(1,"h4",6),F(2,"sm-icon",20),f(3,"span",21),b(4),_(),f(5,"span",9),b(6),_()(),f(7,"ul",22),re(8,Fse,3,4,"li",23,Tse),_()()),t&2){let e=d(3);l(4),x(e.externalRefs().length),l(2),x(e.texts.externalRefsHeader),l(2),ae(e.externalRefs())}}function Ase(t,o){if(t&1&&(M(0,Pse,10,2,"section",3),M(1,Ose,10,2,"section",4),M(2,Nse,10,2,"section",5)),t&2){let e=d(2);D(e.outgoing().length>0?0:-1),l(),D(e.incoming().length>0?1:-1),l(),D(e.externalRefs().length>0?2:-1)}}function Lse(t,o){if(t&1&&(f(0,"div",0),M(1,Sse,2,1,"p",1)(2,kse,2,1,"p",2)(3,Ase,3,3),_()),t&2){let e,n=d();l(),D((e=n.state())==="loading"?1:e==="error"?2:e==="ready"?3:-1)}}var iP=(()=>{class t{dataSource=p(go);wsEvents=p(ls);destroyRef=p(xt);texts=eP;path=B(null);openPath=Ke();state=X("idle");outgoingRaw=X([]);incomingRaw=X([]);outgoing=E(()=>this.outgoingRaw().filter(e=>!tP(e)));incoming=E(()=>this.incomingRaw().filter(e=>!tP(e)));issues=X([]);externalRefsRaw=X([]);externalRefs=E(()=>this.externalRefsRaw().filter(e=>za(e.url)!==null));fetchToken=0;hasResults=E(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));constructor(){this.wsEvents.scanCompleted$.pipe(Qn(this.destroyRef)).subscribe(()=>{let e=this.path();e&&this.fetch(e)}),de(()=>{let e=this.path();if(!e){this.fetchToken++,this.state.set("idle"),this.outgoingRaw.set([]),this.incomingRaw.set([]);return}this.fetch(e)})}onOpen(e){this.openPath.emit(e)}confidenceTooltip(e){return this.texts.confidenceTooltip(this.texts.confidence[Nv(e)])}confidenceValue(e){return e.toFixed(2)}confidenceColor(e){let n=Math.max(0,Math.min(1,e));return`hsl(${Math.round(n*120)}, 60%, 50%)`}outgoingBroken(e){return this.issueForOutgoing(e)?.severity==="error"}issueForOutgoing(e){let n=this.path();if(!n)return null;let i=[e.target,e.resolvedTarget].filter(r=>typeof r=="string");return this.issues().find(r=>{if(!r.nodeIds.includes(n))return!1;let a=r.data?.target;return typeof a!="string"?!1:i.includes(a)})??null}async fetch(e){let n=++this.fetchToken;this.state.set("loading");try{let[i,r,a]=await Promise.allSettled([this.dataSource.listLinks({from:e}),this.dataSource.listLinks({to:e}),this.dataSource.getNode(e)]);if(n!==this.fetchToken)return;if(i.status!=="fulfilled"||r.status!=="fulfilled"){this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}let s=i.value.items,c=r.value.items,u=Bse(e,s,c),h;try{let g=await this.dataSource.listIssues({nodes:u});if(n!==this.fetchToken)return;h=g.items}catch{if(n!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error");return}this.outgoingRaw.set(s),this.incomingRaw.set(c),this.issues.set(h),this.externalRefsRaw.set(a.status==="fulfilled"?a.value?.item?.externalRefs??[]:[]),this.state.set("ready")}catch{if(n!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefsRaw.set([]),this.state.set("error")}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-linked-nodes-panel"]],inputs:{path:[1,"path"]},outputs:{openPath:"openPath"},decls:1,vars:1,consts:[["data-testid","linked-nodes-panel",1,"linked-nodes-panel"],["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"],["data-testid","linked-nodes-outgoing",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-incoming",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-external-refs",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["icon","pi-upload",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-outgoing-count",1,"linked-nodes-panel__section-count"],[1,"linked-nodes-panel__section-label"],[1,"linked-nodes-panel__table"],[1,"linked-nodes-panel__row"],[1,"linked-nodes-panel__path","linked-nodes-panel__path--broken"],["type","button",1,"linked-nodes-panel__path"],[1,"linked-nodes-panel__chip",3,"pTooltip"],[1,"linked-nodes-panel__chip","linked-nodes-panel__chip--kind"],[1,"linked-nodes-panel__chip","linked-nodes-panel__chip--issue",3,"pTooltip"],["type","button",1,"linked-nodes-panel__path",3,"click"],["icon","pi-download",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-incoming-count",1,"linked-nodes-panel__section-count"],["icon","pi-link",1,"linked-nodes-panel__section-icon"],["data-testid","linked-nodes-external-count",1,"linked-nodes-panel__section-count"],[1,"linked-nodes-panel__table","linked-nodes-panel__table--external"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--external-ref"],["tooltipPosition","top","target","_blank","rel","noopener noreferrer",1,"linked-nodes-panel__external-ref-url",3,"href","pTooltip"]],template:function(n,i){n&1&&M(0,Lse,4,1,"div",0),n&2&&D(i.path()?0:-1)},dependencies:[ze,Ve,wb],styles:["[_nghost-%COMP%]{display:block}.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%]{display:flex;align-items:center;gap:.4rem;margin:0 0 .4rem;font-size:.8rem}.linked-nodes-panel__section-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;font-size:.85rem;color:var(--p-text-color)}.linked-nodes-panel__section-count[_ngcontent-%COMP%]{font-weight:700;font-size:.9rem;line-height:1;color:var(--p-text-color)}.linked-nodes-panel__section-label[_ngcontent-%COMP%]{font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__table[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.linked-nodes-panel__row[_ngcontent-%COMP%]{display:flex;flex-flow:row wrap;align-items:center;gap:.4rem;padding:.4rem .25rem;min-width:0}.linked-nodes-panel__row[_ngcontent-%COMP%] + .linked-nodes-panel__row[_ngcontent-%COMP%]{border-top:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{margin:0;padding:0;border:none;background:none;font:inherit;font-size:.8rem;font-weight:400;text-align:left;line-height:1.35;min-width:0;overflow-wrap:anywhere;color:var(--p-primary-color);cursor:pointer}button.linked-nodes-panel__path[_ngcontent-%COMP%]:hover, button.linked-nodes-panel__path[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}.linked-nodes-panel__path--broken[_ngcontent-%COMP%]{color:var(--p-text-color);cursor:default}.linked-nodes-panel__chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.02rem .4rem;border:1px solid var(--p-content-border-color);border-radius:999px;font-size:.72rem;line-height:1.5;color:var(--p-text-muted-color);white-space:nowrap}.linked-nodes-panel__chip--kind[_ngcontent-%COMP%]{border-color:var(--sm-edge-neutral);color:var(--sm-edge-neutral)}.linked-nodes-panel__chip--kind[data-kind=invokes][_ngcontent-%COMP%]{border-color:var(--sm-edge-invokes);color:var(--sm-edge-invokes)}.linked-nodes-panel__chip--kind[data-kind=references][_ngcontent-%COMP%]{border-color:var(--sm-edge-references);color:var(--sm-edge-references)}.linked-nodes-panel__chip--kind[data-kind=mentions][_ngcontent-%COMP%]{border-color:var(--sm-edge-mentions);color:var(--sm-edge-mentions)}.linked-nodes-panel__chip--kind[data-kind=supersedes][_ngcontent-%COMP%]{border-color:var(--sm-edge-supersedes-active);color:var(--sm-edge-supersedes-active)}.linked-nodes-panel__chip--issue[data-severity=error][_ngcontent-%COMP%]{border-color:var(--sm-severity-error);color:var(--sm-severity-error)}.linked-nodes-panel__chip--issue[data-severity=warn][_ngcontent-%COMP%]{border-color:var(--sm-severity-warn);color:var(--sm-severity-warn)}.linked-nodes-panel__chip--issue[data-severity=info][_ngcontent-%COMP%]{border-color:var(--sm-severity-info);color:var(--sm-severity-info)}.linked-nodes-panel__row--external-ref[_ngcontent-%COMP%]{font-size:.85rem}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--p-primary-color);text-decoration:none}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})}return t})();function Bse(t,o,e){let n=new Set([t]);for(let i of o)i.resolvedTarget&&n.add(i.resolvedTarget),i.target&&n.add(i.target);for(let i of e)i.source&&n.add(i.source);return[...n]}function tP(t){return!!(t.source===t.target||t.resolvedTarget&&t.source===t.resolvedTarget)}var oP={sections:{definition:"Definition",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",color:"Color",mcpServers:"MCP servers",hooks:"Hooks"},skillBaseFields:{whenToUse:"When to use",argumentHint:"Argument hint",arguments:"Arguments",allowedTools:"Allowed tools",disallowedTools:"Disallowed tools",model:"Model",effort:"Effort",context:"Context",agent:"Agent",shell:"Shell",paths:"Paths",disableModelInvocation:"Model invocation",userInvocable:"User invocable"},unknownFieldTooltip:"Unknown field, not part of the documented frontmatter for this provider.",skillUnresolvedTooltip:"Skill not found in this scan."};var rP=(t,o)=>o.key,Vse=(t,o)=>o.name,zse=(t,o)=>o.event;function Hse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.model),l(3),x(o)}}function qse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.effort),l(3),x(o)}}function Gse(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function jse(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,Gse,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Use(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,jse,3,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.tools),l(2),ae(e.tools())}}function $se(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Wse(t,o){if(t&1&&(f(0,"span",8),F(1,"i",9),f(2,"code"),b(3),_()(),M(4,$se,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(3),x(e),l(),D(n!==i-1?4:-1)}}function Kse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Wse,5,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.disallowedTools),l(2),ae(e.disallowedTools())}}function Yse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.permissionMode),l(3),x(o)}}function Xse(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",10),F(3,"span",11),f(4,"code"),b(5),_()()),t&2){let e=o,n=d(5);l(),x(n.texts.fields.color),l(2),Ne("background",e),l(2),x(e)}}function Zse(t,o){if(t&1){let e=$();f(0,"a",14),A("click",function(){let i=w(e),r=d(7);return T(r.openSkill(i))})("keydown.enter",function(){let i=w(e),r=d(7);return T(r.openSkill(i))})("keydown.space",function(i){let r=w(e);return d(7).openSkill(r),T(i.preventDefault())}),F(1,"i",15),b(2),_()}if(t&2){let e=d().$implicit;l(2),Se(" ",e," ")}}function Qse(t,o){if(t&1&&(f(0,"span",13),b(1),_()),t&2){let e=d().$implicit,n=d(6);m("pTooltip",n.texts.skillUnresolvedTooltip),l(),x(e)}}function Jse(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function ele(t,o){if(t&1&&(M(0,Zse,3,1,"a",12)(1,Qse,2,2,"span",13),M(2,Jse,2,0,"span",7)),t&2){let e,n=o.$implicit,i=o.$index,r=o.$count,a=d(6);D((e=a.skillPath(n))?0:1,e),l(2),D(i!==r-1?2:-1)}}function tle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,ele,3,2,null,null,Ue),_()),t&2){let e=d(5);l(),x(e.texts.fields.skills),l(2),ae(e.skills())}}function nle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.maxTurns),l(3),x(e.maxTurns())}}function ile(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.memory),l(3),x(o)}}function ole(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.background),l(3),x(e.background())}}function rle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){let e=d(5);l(),x(e.texts.fields.isolation),l(3),x(o)}}function ale(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function sle(t,o){if(t&1&&(f(0,"code",16),b(1),_(),M(2,ale,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;m("pTooltip",e.command??""),l(),x(e.name),l(),D(n!==i-1?2:-1)}}function lle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,sle,3,3,null,null,Vse),_()),t&2){let e=d(5);l(),x(e.texts.fields.mcpServers),l(2),ae(e.mcpServers())}}function cle(t,o){if(t&1&&(f(0,"span",18),b(1,"\u2192"),_(),f(2,"code"),b(3),_()),t&2){let e=d().$implicit;l(3),x(e.keys[0])}}function dle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function ule(t,o){if(t&1&&(f(0,"span",17)(1,"code"),b(2),_(),M(3,cle,4,1),_(),M(4,dle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(2),x(e.event),l(),D(e.keys.length?3:-1),l(),D(n!==i-1?4:-1)}}function ple(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,ule,5,3,null,null,zse),_()),t&2){let e=d(5);l(),x(e.texts.fields.hooks),l(2),ae(e.hooks())}}function hle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",19),F(3,"i",20),f(4,"code"),b(5),_()()),t&2){let e=o.$implicit,n=d(5);l(),x(e.key),l(2),m("pTooltip",n.texts.unknownFieldTooltip),O("aria-label",n.texts.unknownFieldTooltip),l(2),x(e.value)}}function fle(t,o){if(t&1&&(f(0,"dl",5),M(1,Hse,5,2),M(2,qse,5,2),M(3,Use,5,1),M(4,Kse,5,1),M(5,Yse,5,2),M(6,Xse,6,4),M(7,tle,5,1),M(8,nle,5,2),M(9,ile,5,2),M(10,ole,5,2),M(11,rle,5,2),M(12,lle,5,1),M(13,ple,5,1),re(14,hle,6,4,null,null,rP),_()),t&2){let e,n,i,r,a,s,c=d(4);l(),D((e=c.model())?1:-1,e),l(),D((n=c.effort())?2:-1,n),l(),D(c.tools().length?3:-1),l(),D(c.disallowedTools().length?4:-1),l(),D((i=c.permissionMode())?5:-1,i),l(),D((r=c.color())?6:-1,r),l(),D(c.skills().length?7:-1),l(),D(c.maxTurns()!==null?8:-1),l(),D((a=c.memory())?9:-1,a),l(),D(c.background()!==null?10:-1),l(),D((s=c.isolation())?11:-1,s),l(),D(c.mcpServers().length?12:-1),l(),D(c.hooks().length?13:-1),l(),ae(c.extraFields())}}function mle(t,o){if(t&1&&M(0,fle,16,13,"dl",5),t&2){let e=d(3);D(e.hasBehavior()||e.hasCapabilities()||e.extraFields().length?0:-1)}}function _le(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.model),l(3),x(e.model)}}function gle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.effort),l(3),x(e.effort)}}function ble(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd"),b(3),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.whenToUse),l(2),x(e.when_to_use)}}function vle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.argumentHint),l(3),x(e.argumentHint)}}function yle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Cle(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,yle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function xle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Cle,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.arguments),l(2),ae(e.arguments)}}function wle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Tle(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,wle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Sle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Tle,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.allowedTools),l(2),ae(e.allowedTools)}}function kle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Ile(t,o){if(t&1&&(f(0,"span",8),F(1,"i",9),f(2,"code"),b(3),_()(),M(4,kle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(3),x(e),l(),D(n!==i-1?4:-1)}}function Ele(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Ile,5,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.disallowedTools),l(2),ae(e.disallowedTools)}}function Mle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.context),l(3),x(e.context)}}function Dle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.agent),l(3),x(e.agent)}}function Ple(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.shell),l(3),x(e.shell)}}function Rle(t,o){t&1&&(f(0,"span",7),b(1,"\xB7"),_())}function Ole(t,o){if(t&1&&(f(0,"code"),b(1),_(),M(2,Rle,2,0,"span",7)),t&2){let e=o.$implicit,n=o.$index,i=o.$count;l(),x(e),l(),D(n!==i-1?2:-1)}}function Fle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",6),re(3,Ole,3,2,null,null,Ue),_()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.paths),l(2),ae(e.paths)}}function Nle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4,"disabled"),_()()),t&2){let e=d(5);l(),x(e.texts.skillBaseFields.disableModelInvocation)}}function Ale(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd")(3,"code"),b(4),_()()),t&2){d();let e=Ce(0),n=d(4);l(),x(n.texts.skillBaseFields.userInvocable),l(3),x(e.userInvocable)}}function Lle(t,o){if(t&1&&(f(0,"dt"),b(1),_(),f(2,"dd",19),F(3,"i",20),f(4,"code"),b(5),_()()),t&2){let e=o.$implicit,n=d(5);l(),x(e.key),l(2),m("pTooltip",n.texts.unknownFieldTooltip),O("aria-label",n.texts.unknownFieldTooltip),l(2),x(e.value)}}function Ble(t,o){if(t&1&&(Ut(0),f(1,"dl",21),M(2,_le,5,2),M(3,gle,5,2),M(4,ble,4,2),M(5,vle,5,2),M(6,xle,5,1),M(7,Sle,5,1),M(8,Ele,5,1),M(9,Mle,5,2),M(10,Dle,5,2),M(11,Ple,5,2),M(12,Fle,5,1),M(13,Nle,5,1),M(14,Ale,5,2),re(15,Lle,6,4,null,null,rP),_()),t&2){let e=d(4),n=Tt(e.skillBase());l(2),D(n.model!==null?2:-1),l(),D(n.effort!==null?3:-1),l(),D(n.when_to_use!==null?4:-1),l(),D(n.argumentHint!==null?5:-1),l(),D(n.arguments.length?6:-1),l(),D(n.allowedTools.length?7:-1),l(),D(n.disallowedTools.length?8:-1),l(),D(n.context!==null?9:-1),l(),D(n.agent!==null?10:-1),l(),D(n.shell!==null?11:-1),l(),D(n.paths.length?12:-1),l(),D(n.disableModelInvocation?13:-1),l(),D(n.userInvocable!==null?14:-1),l(),ae(e.extraFields())}}function Vle(t,o){if(t&1&&M(0,Ble,17,14,"dl",21),t&2){let e=d(3);D(e.hasCapabilities()||e.extraFields().length?0:-1)}}function zle(t,o){if(t&1&&(f(0,"p",22),b(1),_(),F(2,"blockquote",23)),t&2){let e=d(3);l(),x(e.texts.sections.initialPrompt),l(),m("innerHTML",e.initialPromptHtml(),ki)}}function Hle(t,o){if(t&1&&(M(0,mle,1,1)(1,Vle,1,1),M(2,zle,3,2)),t&2){let e=d(2);D(e.isAgent()?0:e.isSkillOrCommand()?1:-1),l(2),D(e.hasInitialPrompt()?2:-1)}}function qle(t,o){if(t&1){let e=$();f(0,"div",0)(1,"section",1)(2,"button",2),A("click",function(){w(e);let i=d();return T(i.toggle.emit())}),f(3,"span",3),b(4),_(),F(5,"i",4),_(),M(6,Hle,3,2),_()()}if(t&2){let e=d();l(2),O("aria-expanded",e.expanded()),l(2),x(e.texts.sections.definition),l(),ue("pi-chevron-right",!e.expanded())("pi-chevron-down",e.expanded()),l(),D(e.expanded()?6:-1)}}var Gle=new Set(["name","description","metadata","model","effort","permissionMode","maxTurns","memory","background","isolation","color","tools","disallowedTools","skills","mcpServers","hooks","initialPrompt"]),jle=new Set(["name","description","metadata","when_to_use","argument-hint","arguments","disable-model-invocation","user-invocable","allowed-tools","disallowed-tools","model","effort","context","agent","hooks","paths","shell"]),aP=(()=>{class t{frontmatter=B.required();kind=B.required();provider=B(void 0);skillPathByName=B(null);onSkillClick=B(null);expanded=B(!0);toggle=Ke();texts=oP;markdown=p(bo);hasVendorSurface=E(()=>{let e=this.kind();return e==="agent"||e==="skill"||e==="command"});isAgent=E(()=>this.kind()==="agent");isSkillOrCommand=E(()=>{let e=this.kind();return e==="skill"||e==="command"});tools=E(()=>ff(this.fm().tools));model=E(()=>Qt(this.fm().model));skills=E(()=>ff(this.fm().skills));disallowedTools=E(()=>ff(this.fm().disallowedTools));initialPrompt=E(()=>Qt(this.fm().initialPrompt));permissionMode=E(()=>Qt(this.fm().permissionMode));maxTurns=E(()=>Ule(this.fm().maxTurns));memory=E(()=>Qt(this.fm().memory));background=E(()=>typeof this.fm().background=="boolean"?this.fm().background:null);effort=E(()=>Qt(this.fm().effort));isolation=E(()=>Qt(this.fm().isolation));color=E(()=>df(this.fm().color));mcpServers=E(()=>{let e=this.fm().mcpServers;return Array.isArray(e)?e.filter(n=>typeof n=="object"&&n!==null).map((n,i)=>{let r=n.args,a=Array.isArray(r)?r.length:0;return{name:typeof n.name=="string"&&n.name.length>0?n.name:`mcpServer[${i}]`,command:typeof n.command=="string"?n.command:null,argsCount:a}}):[]});hooks=E(()=>{let e=this.fm().hooks;if(typeof e!="object"||e===null)return[];let n=[];for(let[i,r]of Object.entries(e)){let a=typeof r=="object"&&r!==null?Object.keys(r):[];n.push({event:i,keys:a})}return n});skillBase=E(()=>{let e=this.fm();return{when_to_use:Qt(e.when_to_use),argumentHint:Qt(e["argument-hint"]),arguments:hf(e.arguments),disableModelInvocation:e["disable-model-invocation"]===!0,userInvocable:typeof e["user-invocable"]=="boolean"?e["user-invocable"]:null,allowedTools:hf(e["allowed-tools"]),disallowedTools:hf(e["disallowed-tools"]),model:Qt(e.model),effort:Qt(e.effort),context:Qt(e.context),agent:Qt(e.agent),paths:hf(e.paths),shell:Qt(e.shell)}});hasBehavior=E(()=>this.isAgent()?this.model()!==null||this.permissionMode()!==null||this.maxTurns()!==null||this.memory()!==null||this.background()!==null||this.effort()!==null||this.isolation()!==null||this.color()!==null:!1);hasCapabilities=E(()=>{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 e=this.skillBase();return e.when_to_use!==null||e.argumentHint!==null||e.arguments.length>0||e.allowedTools.length>0||e.disallowedTools.length>0||e.model!==null||e.effort!==null||e.context!==null||e.agent!==null||e.shell!==null||e.paths.length>0||e.disableModelInvocation||e.userInvocable!==null}return!1});hasInitialPrompt=E(()=>this.isAgent()&&this.initialPrompt()!==null);initialPromptHtml=c0(()=>this.initialPrompt()??"",this.markdown);extraFields=E(()=>{let e=this.isAgent()?Gle:this.isSkillOrCommand()?jle:null;if(!e)return[];let n=this.fm(),i=[];for(let r of Object.keys(n)){if(e.has(r))continue;let a=n[r];if(a==null)continue;let s=typeof a=="string"?a:typeof a=="number"||typeof a=="boolean"?String(a):JSON.stringify(a);i.push({key:r,value:s})}return i});hasAnyContent=E(()=>this.hasVendorSurface()&&(this.hasBehavior()||this.hasCapabilities()||this.hasInitialPrompt()||this.extraFields().length>0));skillPath(e){return this.skillPathByName()?.get(e)??null}openSkill(e){let n=this.onSkillClick();n&&n(e)}fm(){return this.frontmatter()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-vendor-frontmatter"]],inputs:{frontmatter:[1,"frontmatter"],kind:[1,"kind"],provider:[1,"provider"],skillPathByName:[1,"skillPathByName"],onSkillClick:[1,"onSkillClick"],expanded:[1,"expanded"]},outputs:{toggle:"toggle"},decls:1,vars:1,consts:[["data-testid","vendor-frontmatter",1,"vfm"],["data-testid","vendor-frontmatter-definition",1,"sm-block","sm-block--collapsible"],["type","button","data-testid","vendor-frontmatter-toggle",1,"sm-block__row","sm-block__row--toggle",3,"click"],[1,"sm-block__title"],["aria-hidden","true",1,"pi","sm-block__chevron"],[1,"sm-block__kv"],[1,"vfm__inline"],["aria-hidden","true",1,"vfm__sep"],[1,"vfm__danger"],["aria-hidden","true",1,"pi","pi-ban"],[1,"vfm__color"],["aria-hidden","true",1,"vfm__swatch"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known"],[1,"sm-node-link",3,"pTooltip"],["role","button","tabindex","0",1,"sm-node-link","sm-node-link--known",3,"click","keydown.enter","keydown.space"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],[3,"pTooltip"],[1,"vfm__hook"],["aria-hidden","true",1,"vfm__sep-arrow"],[1,"vfm__unknown-dd"],["role","img",1,"pi","pi-exclamation-circle","vfm__unknown",3,"pTooltip"],["data-testid","vendor-frontmatter-skill-base",1,"sm-block__kv"],[1,"sm-block__sub"],["data-testid","vendor-frontmatter-initial-prompt-quote",1,"vfm__quote",3,"innerHTML"]],template:function(n,i){n&1&&M(0,qle,7,7,"div",0),n&2&&D(i.hasAnyContent()?0:-1)},dependencies:[ze,Ve],styles:["[_nghost-%COMP%]{display:block}.vfm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.85rem}.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__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__unknown-dd[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem}.vfm__unknown[_ngcontent-%COMP%]{font-size:.72rem;color:var(--p-text-muted-color);cursor:help;line-height:1}.vfm__color[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.vfm__swatch[_ngcontent-%COMP%]{width:.7rem;height:.7rem;border-radius:50%;flex:none;border:1px solid var(--sm-border)}.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-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-sm) var(--sm-radius-sm) 0}[_nghost-%COMP%] .vfm__quote>:first-child{margin-top:0}[_nghost-%COMP%] .vfm__quote>:last-child{margin-bottom:0}[_nghost-%COMP%] .vfm__quote code{background:var(--sm-bg-content);padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.82rem;font-family:var(--sm-font-mono)}[_nghost-%COMP%] .vfm__quote a{color:var(--p-primary-color);text-decoration:underline}"],changeDetection:0})}return t})();function Qt(t){return typeof t=="string"&&t.length>0?t:null}function Ule(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function ff(t){return Array.isArray(t)?t.filter(o=>typeof o=="string"&&o.length>0):[]}function hf(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?ff(t):[]}var sP={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 dP=(t,o)=>o.key,$le=(t,o)=>o.pluginId;function Wle(t,o){if(t&1&&(f(0,"p",0),b(1),_()),t&2){let e=d();l(),x(e.texts.empty)}}function Kle(t,o){if(t&1&&(f(0,"span",5),b(1),_()),t&2){let e=d().$implicit,n=d(3);l(),x(n.texts.rootContribBadge(e.pluginId))}}function Yle(t,o){if(t&1&&(f(0,"div",3)(1,"code",4),b(2),_(),M(3,Kle,2,1,"span",5),f(4,"pre",6),b(5),_()()),t&2){let e=o.$implicit;l(2),x(e.key),l(),D(e.pluginId!==null?3:-1),l(2),x(e.value)}}function Xle(t,o){if(t&1&&(f(0,"div",1),re(1,Yle,6,3,"div",3,dP),_()),t&2){let e=d(2);l(),ae(e.rootContributions())}}function Zle(t,o){if(t&1&&(f(0,"span",10),b(1),_()),t&2){let e=d(4);l(),x(e.texts.unregisteredBadge)}}function Qle(t,o){if(t&1&&(f(0,"dt",12),b(1),_(),f(2,"dd")(3,"pre"),b(4),_()()),t&2){let e=o.$implicit;m("pTooltip",e.description??""),l(),x(e.key),l(3),x(e.value)}}function Jle(t,o){if(t&1&&(f(0,"section",7)(1,"h5",8)(2,"span",9),b(3),_(),M(4,Zle,2,1,"span",10),_(),f(5,"dl",11),re(6,Qle,5,3,null,null,dP),_()()),t&2){let e=o.$implicit;O("data-testid","plugin-contributions-ns-"+e.pluginId),l(3),x(e.pluginId),l(),D(e.registered?-1:4),l(2),ae(e.rows)}}function ece(t,o){if(t&1&&(f(0,"div",2),re(1,Jle,8,3,"section",7,$le),_()),t&2){let e=d(2);l(),ae(e.namespaces())}}function tce(t,o){if(t&1&&(M(0,Xle,3,0,"div",1),M(1,ece,3,0,"div",2)),t&2){let e=d();D(e.rootContributions().length?0:-1),l(),D(e.namespaces().length?1:-1)}}var lP=new Set(["identity","annotations","settings","audit"]),uP=(()=>{class t{dataSource=p(go);sidecarRoot=B(void 0);texts=sP;catalog=X(null);constructor(){this.fetchCatalog()}namespaces=E(()=>{let e=this.sidecarRoot();if(!e)return[];let n=this.catalog(),i=new Map;if(n)for(let a of n){if(a.location!=="namespaced")continue;let s=i.get(a.pluginId);s?s.push(a):i.set(a.pluginId,[a])}let r=[];for(let[a,s]of Object.entries(e)){if(lP.has(a)||this.isRegisteredRootKey(a))continue;let u=typeof s=="object"&&s!==null&&!Array.isArray(s)?s:{value:s},h=i.has(a),g=i.get(a)??[],C=Object.entries(u).map(([k,I])=>({key:k,value:cP(I),description:h?nce(g,k):null}));r.push({pluginId:a,registered:h,rows:C})}return r});rootContributions=E(()=>{let e=this.sidecarRoot();if(!e)return[];let n=this.catalog();if(!n)return[];let i=new Map;for(let a of n)a.location==="root"&&i.set(a.key,a);let r=[];for(let[a,s]of Object.entries(e)){if(lP.has(a))continue;let c=i.get(a);c&&r.push({key:a,pluginId:c.pluginId,value:cP(s)})}return r});count=E(()=>this.namespaces().length+this.rootContributions().length);isEmpty=E(()=>this.count()===0);isRegisteredRootKey(e){let n=this.catalog();return n?n.some(i=>i.location==="root"&&i.key===e):!1}async fetchCatalog(){try{let e=await this.dataSource.getRegisteredAnnotations();this.catalog.set(e)}catch{this.catalog.set([])}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({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(n,i){n&1&&M(0,Wle,2,1,"p",0)(1,tce,2,2),n&2&&D(i.isEmpty()?0:1)},dependencies:[ze,Ve],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})}return t})();function cP(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 nce(t,o){for(let e of t)if(e.key===o){let n=e.schema.description;return typeof n=="string"&&n.length>0?n:null}return null}var ice=[[["","smSectionTitleExtra",""]],"*"],oce=["[smSectionTitleExtra]","*"],mf=(()=>{class t{title=B.required();expanded=B.required();toggleTestid=B();toggleAriaLabel=B();toggleTooltip=B();toggle=Ke();static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-collapsible-section"]],hostAttrs:[1,"sm-block","sm-block--collapsible"],inputs:{title:[1,"title"],expanded:[1,"expanded"],toggleTestid:[1,"toggleTestid"],toggleAriaLabel:[1,"toggleAriaLabel"],toggleTooltip:[1,"toggleTooltip"]},outputs:{toggle:"toggle"},ngContentSelectors:oce,decls:6,vars:9,consts:[["type","button",1,"sm-block__row","sm-block__row--toggle",3,"click","pTooltip"],[1,"sm-block__title"],["aria-hidden","true",1,"pi","sm-block__chevron"]],template:function(n,i){n&1&&(pn(ice),f(0,"button",0),A("click",function(){return i.toggle.emit()}),f(1,"span",1),b(2),$e(3),_(),F(4,"i",2),_(),$e(5,1)),n&2&&(m("pTooltip",i.toggleTooltip()??""),O("aria-expanded",i.expanded())("aria-label",i.toggleAriaLabel()??null)("data-testid",i.toggleTestid()??null),l(2),Se(" ",i.title()," "),l(2),ue("pi-chevron-right",!i.expanded())("pi-chevron-down",i.expanded()))},dependencies:[ze,Ve],encapsulation:2,changeDetection:0})}return t})();var rce=t=>({inputs:t}),ace=(t,o)=>o.pluginId,sce=(t,o)=>o.qualifiedId;function lce(t,o){t&1&&le(0)}function cce(t,o){if(t&1&&(f(0,"div",3),S(1,lce,1,0,"ng-container",4),_()),t&2){let e=o.$implicit,n=d(3);O("data-testid","contribution-"+e.qualifiedId.replaceAll("/","-")),l(),m("ngComponentOutlet",n.rendererFor(e.slot))("ngComponentOutletInputs",Re(3,rce,e.rendererInputs))}}function dce(t,o){if(t&1&&(f(0,"div",2),re(1,cce,2,5,"div",3,sce),_()),t&2){let e=d().$implicit;l(),ae(e.bricks)}}function uce(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",1),A("toggle",function(){let i=w(e).$implicit,r=d();return T(r.toggle(i.pluginId))}),M(1,dce,3,0,"div",2),_()}if(t&2){let e=o.$implicit,n=d();m("title",e.pluginId)("expanded",n.expanded(e.pluginId))("toggleTestid","inspector-plugin-section-toggle-"+e.pluginId),O("data-testid","inspector-plugin-section-"+e.pluginId),l(),D(n.expanded(e.pluginId)?1:-1)}}var pP="skill-map.ui.inspector.plugin-sections",p0=100,hP=(()=>{class t{node=B(null);registry=p(xb);collapseState=X(pce());groups=E(()=>{let e=this.node();if(!e)return[];let n=(e.contributions??[]).filter(a=>kb(a.slot)&&Ib.has(a.slot));if(n.length===0)return[];let i=new Map;for(let a of n){let s=i.get(a.pluginId);s?s.push(a):i.set(a.pluginId,[a])}let r=[];for(let[a,s]of i){let c=p0,u=s.map(h=>{let g=`${h.pluginId}/${h.extensionId}/${h.contributionId}`,C=this.registry.get(g);return typeof C?.pluginOrder=="number"&&(c=C.pluginOrder),{c:h,qualifiedId:g,extensionOrder:C?.extensionOrder??p0,priority:C?.priority??p0,inputs:Eb(h,h.slot,e.path,C)}}).sort((h,g)=>h.extensionOrder!==g.extensionOrder?h.extensionOrder-g.extensionOrder:h.priority!==g.priority?h.priority-g.priority:h.qualifiedId<g.qualifiedId?-1:h.qualifiedId>g.qualifiedId?1:0);r.push({pluginId:a,pluginOrder:c,bricks:u.map(h=>({qualifiedId:h.qualifiedId,slot:h.c.slot,rendererInputs:h.inputs}))})}return r.sort((a,s)=>a.pluginOrder!==s.pluginOrder?a.pluginOrder-s.pluginOrder:a.pluginId<s.pluginId?-1:a.pluginId>s.pluginId?1:0),r});expanded(e){return this.collapseState()[e]??!1}toggle(e){this.collapseState.update(n=>Dt(ge({},n),{[e]:!(n[e]??!1)})),hce(this.collapseState())}rendererFor(e){return Sb[e]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-plugin-sections"]],inputs:{node:[1,"node"]},decls:2,vars:0,consts:[[3,"title","expanded","toggleTestid"],[3,"toggle","title","expanded","toggleTestid"],[1,"ips__bricks"],[1,"ips__brick"],[4,"ngComponentOutlet","ngComponentOutletInputs"]],template:function(n,i){n&1&&re(0,uce,2,5,"sm-collapsible-section",0,ace),n&2&&ae(i.groups())},dependencies:[M0,mf],styles:["[_nghost-%COMP%]{display:contents}.ips__bricks[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.ips__brick[_ngcontent-%COMP%]{display:block}"],changeDetection:0})}return t})();function pce(){try{let t=localStorage.getItem(pP);if(!t)return{};let o=JSON.parse(t);return typeof o=="object"&&o!==null?o:{}}catch{return{}}}function hce(t){try{localStorage.setItem(pP,JSON.stringify(t))}catch{}}var fP={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"},diffMarker:"!=",absentMarker:"(absent)",notSetMarker:"(not set)",copiedLabel:"Copied",copyA11y:t=>`Copy ${t} to clipboard`};var fce=(t,o,e)=>({key:"body-stored",label:t,value:o,drift:e}),mce=(t,o,e)=>({key:"body-live",label:t,value:o,drift:e}),_ce=(t,o,e)=>({key:"fm-stored",label:t,value:o,drift:e}),gce=(t,o,e)=>({key:"fm-live",label:t,value:o,drift:e});function bce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function vce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function yce(t,o){t&1&&le(0)}function Cce(t,o){if(t&1&&S(0,yce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,fce,e.texts.fields.bodyHashStored,o,e.bodyHashDrift()))}}function xce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function wce(t,o){t&1&&le(0)}function Tce(t,o){if(t&1&&S(0,wce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,mce,e.texts.fields.bodyHashLive,o,e.bodyHashDrift()))}}function Sce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function kce(t,o){t&1&&le(0)}function Ice(t,o){if(t&1&&S(0,kce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,_ce,e.texts.fields.frontmatterHashStored,o,e.frontmatterHashDrift()))}}function Ece(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Mce(t,o){t&1&&le(0)}function Dce(t,o){if(t&1&&S(0,Mce,1,0,"ng-container",11),t&2){let e=d(),n=yt(42);m("ngTemplateOutlet",n)("ngTemplateOutletContext",Ii(2,gce,e.texts.fields.frontmatterHashLive,o,e.frontmatterHashDrift()))}}function Pce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Rce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Oce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.notSetMarker)}}function Fce(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Nce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.notSetMarker)}}function Ace(t,o){t&1&&(f(0,"code"),b(1),_()),t&2&&(l(),x(o))}function Lce(t,o){if(t&1&&(f(0,"span",3),b(1),_()),t&2){let e=d();l(),x(e.texts.absentMarker)}}function Bce(t,o){if(t&1&&(f(0,"span",13),b(1),_()),t&2){let e=d(2);l(),x(e.texts.copiedLabel)}}function Vce(t,o){if(t&1){let e=$();f(0,"button",12),A("click",function(){let i=w(e),r=i.key,a=i.value,s=d();return T(s.copyHash(r,a))}),f(1,"code"),b(2),_(),M(3,Bce,2,1,"span",13),_()}if(t&2){let e=o.key,n=o.label,i=o.value,r=o.drift,a=d();O("title",i)("aria-label",a.texts.copyA11y(n)),l(),ue("dbg__diff",r),l(),x(a.truncateHash(i)),l(),D(a.copiedKey()===e?3:-1)}}var mP=(()=>{class t{node=B.required();sidecarRoot=B(null);overlay=B(void 0);texts=fP;copiedKey=X(null);identityBlock=E(()=>{let e=this.sidecarRoot(),n={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!e)return n;let i=e.identity;if(typeof i!="object"||i===null)return n;let r=i,a=typeof r.resolvedAs=="object"&&r.resolvedAs!==null?r.resolvedAs:null;return{path:typeof r.path=="string"?r.path:null,bodyHash:typeof r.bodyHash=="string"?r.bodyHash:null,frontmatterHash:typeof r.frontmatterHash=="string"?r.frontmatterHash:null,resolvedProvider:a&&typeof a.provider=="string"?a.provider:null,resolvedKind:a&&typeof a.kind=="string"?a.kind:null}});bodyHashLive=E(()=>this.node().bodyHash??null);frontmatterHashLive=E(()=>this.node().frontmatterHash??null);bodyHashDrift=E(()=>{let e=this.identityBlock().bodyHash,n=this.bodyHashLive();return e!==null&&n!==null&&e!==n});frontmatterHashDrift=E(()=>{let e=this.identityBlock().frontmatterHash,n=this.frontmatterHashLive();return e!==null&&n!==null&&e!==n});sidecarStatusLiteral=E(()=>{let e=this.overlay();if(!e)return null;let n=e.status??null;return n===null?null:String(n)});async copyHash(e,n){try{await navigator.clipboard.writeText(n),this.copiedKey.set(e),setTimeout(()=>{this.copiedKey()===e&&this.copiedKey.set(null)},2e3)}catch{}}truncateHash(e){return e.length>20?`${e.slice(0,20)}...`:e}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-debug-panel"]],inputs:{node:[1,"node"],sidecarRoot:[1,"sidecarRoot"],overlay:[1,"overlay"]},decls:43,vars:16,consts:[["hashCell",""],["data-testid","inspector-debug-panel",1,"sm-block__kv","dbg__kv"],["data-testid","dbg-for-path"],[1,"dbg__absent"],["data-testid","dbg-body-hash-stored"],["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"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["type","button",1,"dbg__copy",3,"click"],["role","status",1,"dbg__copied"]],template:function(n,i){if(n&1&&(f(0,"dl",1)(1,"dt"),b(2),_(),f(3,"dd",2),M(4,bce,2,1,"code")(5,vce,2,1,"span",3),_(),f(6,"dt"),b(7),_(),f(8,"dd",4),M(9,Cce,1,6,"ng-container")(10,xce,2,1,"span",3),_(),f(11,"dt"),b(12),_(),f(13,"dd",5),M(14,Tce,1,6,"ng-container")(15,Sce,2,1,"span",3),_(),f(16,"dt"),b(17),_(),f(18,"dd",6),M(19,Ice,1,6,"ng-container")(20,Ece,2,1,"span",3),_(),f(21,"dt"),b(22),_(),f(23,"dd",7),M(24,Dce,1,6,"ng-container")(25,Pce,2,1,"span",3),_(),f(26,"dt"),b(27),_(),f(28,"dd",8),M(29,Rce,2,1,"code")(30,Oce,2,1,"span",3),_(),f(31,"dt"),b(32),_(),f(33,"dd",9),M(34,Fce,2,1,"code")(35,Nce,2,1,"span",3),_(),f(36,"dt"),b(37),_(),f(38,"dd",10),M(39,Ace,2,1,"code")(40,Lce,2,1,"span",3),_()(),S(41,Vce,4,6,"ng-template",null,0,We)),n&2){let r,a,s,c,u,h,g,C;l(2),x(i.texts.fields.forPath),l(2),D((r=i.identityBlock().path)?4:5,r),l(3),x(i.texts.fields.bodyHashStored),l(2),D((a=i.identityBlock().bodyHash)?9:10,a),l(3),x(i.texts.fields.bodyHashLive),l(2),D((s=i.bodyHashLive())?14:15,s),l(3),x(i.texts.fields.frontmatterHashStored),l(2),D((c=i.identityBlock().frontmatterHash)?19:20,c),l(3),x(i.texts.fields.frontmatterHashLive),l(2),D((u=i.frontmatterHashLive())?24:25,u),l(3),x(i.texts.fields.resolvedProvider),l(2),D((h=i.identityBlock().resolvedProvider)?29:30,h),l(3),x(i.texts.fields.resolvedKind),l(2),D((g=i.identityBlock().resolvedKind)?34:35,g),l(3),x(i.texts.fields.sidecarStatus),l(2),D((C=i.sidecarStatusLiteral())?39:40,C)}},dependencies:[Rt],styles:["[_nghost-%COMP%]{display:block}.dbg__kv[_ngcontent-%COMP%] .dbg__diff[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.dbg__kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{word-break:break-all}.dbg__absent[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted);font-style:italic}.dbg__copy[_ngcontent-%COMP%]{display:inline-flex;align-items:baseline;gap:.4rem;padding:0;border:none;background:none;font:inherit;color:inherit;text-align:left;cursor:pointer}.dbg__copy[_ngcontent-%COMP%]:hover code[_ngcontent-%COMP%]{text-decoration:underline dotted;text-underline-offset:2px}.dbg__copy[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px;border-radius:var(--sm-radius-sm)}.dbg__copied[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.72rem;font-style:italic;color:var(--sm-severity-success)}"],changeDetection:0})}return t})();function zce(t,o){if(t&1&&(se(0,"span",3),ie(1,"i",6),se(2,"span"),b(3),se(4,"code"),b(5),fe()()()),t&2){d(2);let e=Ce(0),n=d();l(3),Se("",n.texts.fields.lastBumpedBy," "),l(2),x(e.lastBumpedBy)}}function Hce(t,o){if(t&1&&(se(0,"dt"),b(1),fe(),se(2,"dd",2)(3,"span",3),ie(4,"i",4),se(5,"span",5),b(6),fe()(),M(7,zce,6,2,"span",3),fe()),t&2){d();let e=Ce(0),n=d();l(),x(n.texts.fields.lastBumpedAt),l(4),ot("title",e.lastBumpedAt),l(),x(n.lastBumpedRel()),l(),D(e.lastBumpedBy!==null?7:-1)}}function qce(t,o){if(t&1&&(se(0,"span",3),ie(1,"i",6),se(2,"span"),b(3),se(4,"code"),b(5),fe()()()),t&2){d(2);let e=Ce(0),n=d();l(3),Se("",n.texts.fields.createdBy," "),l(2),x(e.createdBy)}}function Gce(t,o){if(t&1&&(se(0,"dt"),b(1),fe(),se(2,"dd",7)(3,"span",3),ie(4,"i",8),se(5,"span",5),b(6),fe()(),M(7,qce,6,2,"span",3),fe()),t&2){d();let e=Ce(0),n=d();l(),x(n.texts.fields.createdAt),l(4),ot("title",e.createdAt),l(),x(n.createdRel()),l(),D(e.createdBy!==null?7:-1)}}function jce(t,o){if(t&1&&(Ut(0),se(1,"dl",0),M(2,Hce,8,4),M(3,Gce,8,4),fe()),t&2){let e=Tt(d().audit());l(2),D(e.lastBumpedAt!==null?2:-1),l(),D(e.createdAt!==null?3:-1)}}function Uce(t,o){if(t&1&&(se(0,"p",1),b(1),fe()),t&2){let e=d();l(),x(e.texts.headerEmpty)}}var _P=(()=>{class t{sidecarRoot=B(null);texts=ir.audit;audit=E(()=>{let e=this.sidecarRoot(),n={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!e)return n;let i=e.audit;if(typeof i!="object"||i===null)return n;let r=i;return{lastBumpedAt:_f(r.lastBumpedAt),lastBumpedBy:_f(r.lastBumpedBy),createdAt:_f(r.createdAt),createdBy:_f(r.createdBy)}});hasContent=E(()=>{let e=this.audit();return e.lastBumpedAt!==null||e.lastBumpedBy!==null||e.createdAt!==null||e.createdBy!==null});lastBumpedRel=E(()=>{let e=this.audit().lastBumpedAt;return e===null?null:Rf(e)});createdRel=E(()=>{let e=this.audit().createdAt;return e===null?null:Rf(e)});static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-audit-panel"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","inspector-audit-panel",1,"sm-block__kv"],["data-testid","inspector-audit-panel-empty",1,"audit__empty"],["data-testid","inspector-audit-last-bumped",1,"sm-block__inline"],[1,"sm-block__meta"],["aria-hidden","true",1,"pi","pi-history"],[3,"title"],["aria-hidden","true",1,"pi","pi-user"],["data-testid","inspector-audit-created",1,"sm-block__inline"],["aria-hidden","true",1,"pi","pi-calendar-plus"]],template:function(n,i){n&1&&M(0,jce,4,3,"dl",0)(1,Uce,2,1,"p",1),n&2&&D(i.hasContent()?0:1)},styles:["[_nghost-%COMP%]{display:block}.audit__empty[_ngcontent-%COMP%]{margin:0;font-style:italic;color:var(--sm-text-muted);font-size:.85rem}"],changeDetection:0})}return t})();function _f(t){return typeof t=="string"&&t.length>0?t:null}function $ce(t,o){if(t&1&&(f(0,"span",7),F(1,"i",16),b(2),_()),t&2){let e=d();m("pTooltip",e.texts.header.invalidFrontmatterTooltip),l(2),Se(" ",e.texts.header.invalidFrontmatter," ")}}function Wce(t,o){t&1&&(f(0,"span",8),b(1),_()),t&2&&(l(),x(o))}function Kce(t,o){if(t&1&&(f(0,"span",9)(1,"span",17),b(2,"\u25CF"),_(),b(3),_()),t&2){let e=o,n=d();m("pTooltip",e==="experimental"?n.cardTexts.stability.experimental:e==="deprecated"?n.cardTexts.stability.deprecated:""),O("data-stability",e),l(3),Se(" ",e," ")}}function Yce(t,o){if(t&1){let e=$();f(0,"button",19),A("click",function(){let i=w(e).$implicit,r=d(2);return T(r.tagClick.emit(i))}),F(1,"i",20),b(2),_()}if(t&2){let e=o.$implicit,n=d(2);ue("inspector__tag--active",n.isActiveTag(e)),O("aria-pressed",n.isActiveTag(e))("aria-label",n.texts.header.tagFilterAriaLabel(e)),l(2),Se(" ",e," ")}}function Xce(t,o){if(t&1&&(f(0,"div",15),re(1,Yce,3,5,"button",18,Ue),_()),t&2){let e=d();l(),ae(e.headerTags())}}var Zce=new Set(["red","orange","yellow","green","cyan","blue","purple","pink"]),gP=(()=>{class t{node=B.required();frontmatterInvalid=B(!1);activeTag=B(null);favoriteToggle=Ke();tagClick=Ke();texts=ir;cardTexts=ti;headerName=E(()=>{let e=this.node(),n=e.frontmatter.name;return typeof n=="string"&&n.trim().length>0?n:e.path.split("/").pop()??e.path});headerVersion=E(()=>is(this.node()));headerStability=E(()=>po(this.node()));headerTitleColor=E(()=>{let e=this.node(),i=e.frontmatter.color;return typeof i=="string"&&Zce.has(i)?i:`var(--sm-kind-${e.kind})`});headerTags=E(()=>ho(this.node()));isActiveTag(e){return this.activeTag()===e}onFavoriteClick(e){e.stopPropagation(),this.favoriteToggle.emit(this.node().path)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-header"]],inputs:{node:[1,"node"],frontmatterInvalid:[1,"frontmatterInvalid"],activeTag:[1,"activeTag"]},outputs:{favoriteToggle:"favoriteToggle",tagClick:"tagClick"},decls:19,vars:19,consts:[["data-testid","inspector-title",1,"inspector__header"],["data-testid","inspector-kind-chip",1,"inspector__kind-eyebrow"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","provider","size"],[1,"inspector__content"],[1,"inspector__name-row"],["data-testid","inspector-title-text",1,"inspector__name"],["data-testid","inspector-fm-invalid",1,"inspector__fm-invalid",3,"pTooltip"],["data-testid","inspector-version",1,"inspector__name-version"],["data-testid","inspector-stability-tag",1,"inspector__stability",3,"pTooltip"],["data-testid","inspector-path",1,"inspector__path-code"],[1,"inspector__actions-cluster"],["type","button","data-testid","inspector-favorite",1,"inspector__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["slot","inspector.header.badge",3,"node"],["data-testid","inspector-header-tags",1,"inspector__tags"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["aria-hidden","true",1,"inspector__stability-dot"],["type","button","data-testid","inspector-header-tag",1,"inspector__tag",3,"inspector__tag--active"],["type","button","data-testid","inspector-header-tag",1,"inspector__tag",3,"click"],["aria-hidden","true",1,"pi","pi-tag"]],template:function(n,i){if(n&1&&(f(0,"header",0)(1,"span",1),b(2),_(),f(3,"div",2),F(4,"sm-kind-icon",3),_(),f(5,"div",4)(6,"div",5)(7,"h2",6),b(8),_(),M(9,$ce,3,2,"span",7),M(10,Wce,2,1,"span",8),M(11,Kce,4,3,"span",9),_(),f(12,"code",10),b(13),_()(),f(14,"div",11)(15,"button",12),A("click",function(a){return i.onFavoriteClick(a)}),F(16,"i",13),_(),F(17,"sm-view-contributions-host",14),_(),M(18,Xce,3,0,"div",15),_()),n&2){let r,a,s=i.node();l(2),x(s.kind),l(2),m("kind",s.kind)("provider",s.provider)("size",18),l(4),x(i.headerName()),l(),D(i.frontmatterInvalid()?9:-1),l(),D((r=i.headerVersion())?10:-1,r),l(),D((a=i.headerStability())?11:-1,a),l(2),x(s.path),l(2),ue("inspector__favorite--on",s.isFavorite===!0),m("pTooltip",s.isFavorite===!0?i.cardTexts.favoriteRemoveTooltip:i.cardTexts.favoriteAddTooltip),O("aria-label",s.isFavorite===!0?i.cardTexts.ariaFavoriteRemove:i.cardTexts.ariaFavoriteAdd),l(),ue("pi-star-fill",s.isFavorite===!0)("pi-star",s.isFavorite!==!0),l(),m("node",s),l(),D(i.headerTags().length>0?18:-1)}},dependencies:[ze,Ve,nr,Jn],styles:["[_nghost-%COMP%]{display:block}.inspector__header[_ngcontent-%COMP%]{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.3rem;align-items:start;padding:0 .85rem .85rem;background:color-mix(in srgb,var(--accent) 10%,transparent);color:var(--p-text-color);border-left:3px solid var(--accent);border-bottom:1px solid var(--sm-border)}.inspector__kind-eyebrow[_ngcontent-%COMP%]{grid-column:1 / -1;grid-row:1;font-size:.78rem;font-weight:600;color:var(--accent);text-transform:lowercase;line-height:1.2}.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-column:1;grid-row:2;align-self:start}.inspector__content[_ngcontent-%COMP%]{min-width:0;width:100%;display:flex;flex-direction:column;gap:.18rem}.inspector__name-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem;min-width:0}.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__fm-invalid[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.05rem .4rem;border-radius:var(--sm-radius-sm);font-size:.7rem;font-weight:500;text-transform:lowercase;white-space:nowrap;cursor:help;color:var(--sm-severity-warn);background:color-mix(in srgb,var(--sm-severity-warn) 12%,transparent);border:1px solid color-mix(in srgb,var(--sm-severity-warn) 35%,transparent)}.inspector__fm-invalid[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.68rem}.inspector__stability[_ngcontent-%COMP%]{font-size:.78rem;font-weight:500;text-transform:lowercase;cursor:help;white-space:nowrap}.inspector__stability-dot[_ngcontent-%COMP%]{margin-right:.25rem;font-size:.55rem;vertical-align:middle}.inspector__stability[data-stability=stable][_ngcontent-%COMP%]{color:var(--sm-severity-success)}.inspector__stability[data-stability=experimental][_ngcontent-%COMP%]{color:var(--sm-severity-info)}.inspector__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__actions-cluster[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.3rem;align-self:start}.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__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__tags[_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__tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.1rem .5rem;border:1px solid transparent;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--p-text-color);font-size:.72rem;font-weight:500;line-height:1.35;cursor:pointer;transition:background .12s ease-out,color .12s ease-out,border-color .12s ease-out}.inspector__tag[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.62rem;opacity:.7}.inspector__tag[_ngcontent-%COMP%]:not(.inspector__tag--active):hover{border-color:var(--sm-border);color:var(--p-primary-color)}.inspector__tag[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.inspector__tag--active[_ngcontent-%COMP%]{background:var(--p-primary-color);color:var(--p-primary-contrast-color);border-color:var(--p-primary-color)}.inspector__tag--active[_ngcontent-%COMP%]:hover{filter:brightness(1.08)}.inspector__tag--active[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return t})();var bP={header:"Allow skill-map to create files in this project?",body:"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.",alwaysLabel:"Always allow editing .sm files in this project",alwaysHint:"When off, we ask again on the next write. When on, the choice is remembered for this project on this machine.",accept:"Allow",reject:"Not now",ariaLabel:"Sidecar write consent"};var Qce=()=>({width:"32rem"}),vP=(()=>{class t{texts=bP;open=B(!1);decision=Ke();always=X(!1);alwaysChecked=E(()=>this.always());resetOnOpen=de(()=>{this.open()&&this.always.set(!1)});accept(){this.decision.emit({accepted:!0,always:this.always()})}decline(){this.decision.emit({accepted:!1,always:!1})}onVisibleChange(e){e||this.decline()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-sidecar-consent-dialog"]],inputs:{open:[1,"open"]},outputs:{decision:"decision"},decls:13,vars:19,consts:[["data-testid","sidecar-consent-dialog",3,"visibleChange","visible","modal","closable","draggable","resizable","dismissableMask","header"],["data-testid","sidecar-consent-body",1,"consent__body"],["data-testid","sidecar-consent-always-row",1,"consent__always"],["inputId","sidecar-consent-always","data-testid","sidecar-consent-always",3,"ngModelChange","ngModel","binary"],[1,"consent__always-text"],[1,"consent__always-label"],[1,"consent__always-hint"],[1,"consent__actions"],["severity","secondary","data-testid","sidecar-consent-reject",3,"onClick","label","text"],["severity","primary","data-testid","sidecar-consent-accept",3,"onClick","label"]],template:function(n,i){n&1&&(f(0,"p-dialog",0),A("visibleChange",function(a){return i.onVisibleChange(a)}),f(1,"p",1),b(2),_(),f(3,"label",2)(4,"p-checkbox",3),ur("ngModelChange",function(a){return dr(i.always,a)||(i.always=a),a}),_(),f(5,"span",4)(6,"span",5),b(7),_(),f(8,"span",6),b(9),_()()(),f(10,"div",7)(11,"p-button",8),A("onClick",function(){return i.decline()}),_(),f(12,"p-button",9),A("onClick",function(){return i.accept()}),_()()()),n&2&&(Pt(At(18,Qce)),m("visible",i.open())("modal",!0)("closable",!0)("draggable",!1)("resizable",!1)("dismissableMask",!0)("header",i.texts.header),O("aria-label",i.texts.ariaLabel),l(2),x(i.texts.body),l(2),cr("ngModel",i.always),m("binary",!0),l(3),x(i.texts.alwaysLabel),l(2),x(i.texts.alwaysHint),l(2),m("label",i.texts.reject)("text",!0),l(),m("label",i.texts.accept))},dependencies:[kt,Lt,Bt,kn,_n,fs,hs,pb,ub],styles:[".consent__body[_ngcontent-%COMP%]{margin:0 0 1rem;line-height:1.5;color:var(--p-text-color)}.consent__always[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.6rem;cursor:pointer;margin-bottom:1.25rem}.consent__always-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.2rem}.consent__always-label[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color)}.consent__always-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--p-text-muted-color);line-height:1.4}.consent__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem}"],changeDetection:0})}return t})();function h0(t){Ln(h0);let{path:o,dataSource:e,markdown:n}=t,i=X("idle"),r=X(null),a=0,s=async(c,u)=>{try{let h=await e.getNode(c,{includeBody:!0});if(u!==a)return;if(h===null){i.set("unavailable");return}let g=h.item.body;if(g===null){i.set("unavailable");return}if(g===void 0||g.trim().length===0){i.set("empty");return}let C=await n.render(g);if(u!==a)return;r.set(C),i.set("ready")}catch{if(u!==a)return;i.set("error")}};return de(()=>{let c=o(),u=++a;if(r.set(null),!c){i.set("idle");return}i.set("loading"),s(c,u)}),t.scanCompleted$?.pipe(Qn()).subscribe(()=>{let c=o();c&&s(c,++a)}),{bodyState:i.asReadonly(),bodyHtml:r.asReadonly()}}function f0(t){Ln(f0);let{path:o,pathSet:e,dataSource:n}=t,i=X(new Set),r=X(new Set),a=X(new Set);return de(()=>{o(),i.set(new Set),r.set(new Set),a.set(new Set)}),{linkStatus:h=>e().has(h)||i().has(h)?"live":r().has(h)?"dead-confirmed":"dead-heuristic",isVerifying:h=>a().has(h),verifyDeadLink:async h=>{if(!(i().has(h)||r().has(h))&&!a().has(h)){a.update(g=>new Set(g).add(h));try{await n.getNode(h)===null?r.update(C=>new Set(C).add(h)):i.update(C=>new Set(C).add(h))}catch{}finally{a.update(g=>{let C=new Set(g);return C.delete(h),C})}}}}}var CP="skill-map.ui.inspector.sections",Jce={body:!0,findings:!0};function yP(t){return Jce[t]??!1}function m0(){Ln(m0);let t=X(ede());return de(()=>{tde(t())}),{expanded:o=>t()[o]??yP(o),toggle:o=>t.update(e=>Dt(ge({},e),{[o]:!(e[o]??yP(o))}))}}function ede(){try{let t=localStorage.getItem(CP);if(!t)return{};let o=JSON.parse(t);if(o===null||typeof o!="object"||Array.isArray(o))return{};let e={};for(let[n,i]of Object.entries(o))typeof i=="boolean"&&(e[n]=i);return e}catch{return{}}}function tde(t){try{localStorage.setItem(CP,JSON.stringify(t))}catch{}}var nde=new Set(["identity","annotations","settings","audit"]),ide=new Set(["agent","skill","command"]);function xP(t){let{node:o}=t,e=E(()=>{let s=o()?.sidecar;if(!s||!s.present)return null;if(s.root)return s.root;let c={};return s.annotations&&(c.annotations=s.annotations),c}),n=E(()=>{let s=o()?.kind;return s!==void 0&&ide.has(s)}),i=E(()=>{let s=o();return s?(s.linksOutCount??0)+(s.linksInCount??0)+(s.externalRefsCount??0)>0:!1}),r=E(()=>{let s=e();if(!s)return!1;for(let c of Object.keys(s))if(!nde.has(c))return!0;return!1}),a=E(()=>e()!==null);return{sidecarRoot:e,hasVendorFrontmatter:n,hasConnections:i,hasPluginContributions:r,hasMetadata:a}}function ode(t,o){if(t&1&&(f(0,"section",0)(1,"div",2),F(2,"span",3),f(3,"p",4),b(4),_(),f(5,"p",5),b(6),_()()()),t&2){let e=d();l(4),x(e.texts.emptyNoSelection.title),l(2),x(e.texts.emptyNoSelection.desc)}}function rde(t,o){if(t&1&&(f(0,"section",0)(1,"div",6),F(2,"span",7),f(3,"p",4),b(4),_(),f(5,"p",5)(6,"code"),b(7),_(),f(8,"span"),b(9),_()()()()),t&2){let e=d();l(4),x(e.texts.emptyNotFound.title),l(3),x(e.path()),l(2),x(e.texts.emptyNotFound.descSuffix)}}function ade(t,o){if(t&1&&F(0,"p",9),t&2){let e=d(2);m("innerHTML",e.descriptionHtml(),ki)}}function sde(t,o){if(t&1&&(f(0,"div",10),F(1,"i",23),f(2,"span"),b(3),_()()),t&2){let e=d(2);l(3),x(e.texts.supersededByBanner(o))}}function lde(t,o){if(t&1){let e=$();f(0,"div",11),F(1,"i",24),f(2,"span"),b(3),_(),f(4,"button",25),A("click",function(){w(e);let i=d(2);return T(i.dismissActionError())}),F(5,"i",26),_()()}if(t&2){let e=d(2);l(3),x(o),l(),O("aria-label",e.texts.actionErrorDismissAriaLabel)}}function cde(t,o){if(t&1&&(f(0,"p",35)(1,"strong"),b(2),_(),b(3),_()),t&2){let e=d(5);l(2),x(e.texts.findingHintLabel),l(),Se(" ",o," ")}}function dde(t,o){if(t&1&&(f(0,"li",30)(1,"div",31)(2,"span",32),b(3),_(),f(4,"code",33),b(5),_()(),f(6,"p",34),b(7),_(),M(8,cde,4,2,"p",35),_()),t&2){let e,n=o.$implicit;O("data-severity",n.severity),l(2),O("data-severity",n.severity),l(),x(n.severity),l(2),x(n.analyzerId),l(2),x(n.message),l(),D((e=n.fix==null?null:n.fix.summary)?8:-1,e)}}function ude(t,o){if(t&1&&(f(0,"ul",29),re(1,dde,9,6,"li",30,wf),_()),t&2){let e=d(3);l(),ae(e.sortedIssues())}}function pde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",27),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("findings"))}),f(1,"span",28),b(2),_(),M(3,ude,3,0,"ul",29),_()}if(t&2){let e=d(2);m("title",e.texts.sections.findings)("expanded",e.expanded("findings")),l(2),Se("(",e.issues().length,")"),l(),D(e.expanded("findings")?3:-1)}}function hde(t,o){if(t&1){let e=$();f(0,"sm-linked-nodes-panel",38),A("openPath",function(i){w(e);let r=d(3);return T(r.openPath(i))}),_()}if(t&2){d(2);let e=Ce(0);m("path",e.path)}}function fde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",36),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("connections"))}),M(1,hde,1,1,"sm-linked-nodes-panel",37),_()}if(t&2){let e=d(2);m("title",e.texts.sections.connections)("expanded",e.expanded("connections")),l(),D(e.expanded("connections")?1:-1)}}function mde(t,o){if(t&1){let e=$();f(0,"div",16)(1,"sm-vendor-frontmatter",39),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("definition"))}),_()()}if(t&2){d();let e=Ce(0),n=Ce(1),i=d();l(),m("frontmatter",n)("kind",e.kind)("provider",e.provider)("skillPathByName",i.skillPathByName())("onSkillClick",i.onSkillChip)("expanded",i.expanded("definition"))}}function _de(t,o){t&1&&(f(0,"code",41),b(1),_()),t&2&&(l(),Se("(",o,")"))}function gde(t,o){if(t&1){let e=$();f(0,"sm-annotations-panel",43),A("openPath",function(i){w(e);let r=d(3);return T(r.openPath(i))}),_()}if(t&2){d(2);let e=Ce(0),n=d();m("overlay",e.sidecar)("knownPaths",n.pathSet())}}function bde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",40),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("annotations"))}),M(1,_de,2,1,"code",41),M(2,gde,1,2,"sm-annotations-panel",42),_()}if(t&2){let e,n=d(2);m("title",n.texts.sections.annotations)("expanded",n.expanded("annotations")),l(),D((e=n.sidecarFileName())?1:-1,e),l(),D(n.expanded("annotations")?2:-1)}}function vde(t,o){if(t&1&&(f(0,"p",45),b(1),_()),t&2){let e=d(4);l(),x(e.texts.body.loading)}}function yde(t,o){if(t&1&&F(0,"div",46),t&2){let e=d(4);m("innerHTML",e.bodyHtml(),ki)}}function Cde(t,o){if(t&1&&M(0,vde,2,1,"p",45)(1,yde,1,1,"div",46),t&2){let e,n=d(3);D((e=n.bodyState())==="loading"?0:e==="ready"?1:-1)}}function xde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",44),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("body"))}),M(1,Cde,2,1),_()}if(t&2){let e=d(2);m("title",e.texts.sections.body)("expanded",e.expanded("body")),l(),D(e.expanded("body")?1:-1)}}function wde(t,o){if(t&1&&F(0,"sm-plugin-contributions",48),t&2){let e=d(3);m("sidecarRoot",e.sidecarRoot())}}function Tde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",47),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("plugins"))}),M(1,wde,1,1,"sm-plugin-contributions",48),_()}if(t&2){let e=d(2);m("title",e.texts.sections.plugins)("expanded",e.expanded("plugins")),l(),D(e.expanded("plugins")?1:-1)}}function Sde(t,o){if(t&1&&(f(0,"div",50),F(1,"sm-inspector-audit-panel",48)(2,"sm-inspector-debug-panel",51),_()),t&2){d(2);let e=Ce(0),n=d();l(),m("sidecarRoot",n.sidecarRoot()),l(),m("node",e)("sidecarRoot",n.sidecarRoot())("overlay",e.sidecar)}}function kde(t,o){if(t&1){let e=$();f(0,"sm-collapsible-section",49),A("toggle",function(){w(e);let i=d(2);return T(i.toggleSection("metadata"))}),M(1,Sde,3,4,"div",50),_()}if(t&2){let e=d(2);m("title",e.texts.sections.metadata)("expanded",e.expanded("metadata")),l(),D(e.expanded("metadata")?1:-1)}}function Ide(t,o){if(t&1){let e=$();Ut(0)(1),f(2,"section",0)(3,"sm-inspector-header",8),A("favoriteToggle",function(i){w(e);let r=d();return T(r.onHeaderFavoriteToggle(i))})("tagClick",function(i){w(e);let r=d();return T(r.tagSelect.emit(i))}),_(),M(4,ade,1,1,"p",9),M(5,sde,4,1,"div",10),M(6,lde,6,2,"div",11),f(7,"div",12),F(8,"sm-view-contributions-host",13),_(),M(9,pde,4,4,"sm-collapsible-section",14),M(10,fde,2,3,"sm-collapsible-section",15),M(11,mde,2,6,"div",16),M(12,bde,3,4,"sm-collapsible-section",17),M(13,xde,2,3,"sm-collapsible-section",18),M(14,Tde,2,3,"sm-collapsible-section",19),F(15,"sm-inspector-plugin-sections",20),M(16,kde,2,3,"sm-collapsible-section",21),f(17,"sm-sidecar-consent-dialog",22),A("decision",function(i){w(e);let r=d();return T(r.onConsentDecision(i))}),_()()}if(t&2){let e,n,i=d(),r=Tt(i.node());l();let a=Tt(r.frontmatter);l(),Ne("--accent","var(--sm-kind-"+r.kind+", var(--sm-kind-markdown))"),l(),m("node",r)("frontmatterInvalid",i.frontmatterInvalid())("activeTag",i.activeTag()),l(),D(a.description?4:-1),l(),D((e=i.headerSupersededBy())?5:-1,e),l(),D((n=i.actionError())?6:-1,n),l(2),m("node",r),l(),D(i.issues().length>0?9:-1),l(),D(i.hasConnections()?10:-1),l(),D(i.hasVendorFrontmatter()?11:-1),l(),D(r.sidecar!=null&&r.sidecar.present?12:-1),l(),D(i.showBody()?13:-1),l(),D(i.hasPluginContributions()?14:-1),l(),m("node",i.node()),l(),D(i.hasMetadata()?16:-1),l(),m("open",i.consentOpen())}}var wP=(()=>{class t{loader=p(Vt);nodeOpenIntent=p(fo);dataSource=p(go);markdown=p(bo);wsEvents=p(ls);actionDispatch=p(Tb);texts=ir;cardTexts=ti;path=B(void 0);activeTag=B(null);tagSelect=Ke();node=E(()=>{let e=this.path();return e?this.loader.nodes().find(n=>n.path===e)??null:null});pathSet=E(()=>{let e=new Set;for(let n of this.loader.nodes())e.add(n.path);return e});skillPathByName=E(()=>{let e=new Map;for(let n of this.loader.nodes()){if(n.kind!=="skill")continue;let i=n.frontmatter?.name;typeof i=="string"&&i.length>0&&e.set(i,n.path)}return e});headerSupersededBy=E(()=>X0(this.node()));sidecarFileName=E(()=>{let e=this.node()?.path;return e?(e.split("/").pop()??e).replace(/\.md$/,".sm"):null});bodyHandle=h0({path:this.path,dataSource:this.dataSource,markdown:this.markdown,scanCompleted$:this.wsEvents.scanCompleted$});bodyState=this.bodyHandle.bodyState;bodyHtml=this.bodyHandle.bodyHtml;showBody=E(()=>{let e=this.bodyState();return e==="loading"||e==="ready"});descriptionHtml=Va(()=>this.node()?.frontmatter.description??"",this.markdown);deadLink=f0({path:this.path,pathSet:this.pathSet,dataSource:this.dataSource});sectionCollapse=m0();expanded(e){return this.sectionCollapse.expanded(e)}toggleSection(e){this.sectionCollapse.toggle(e)}derivations=xP({node:this.node});sidecarRoot=this.derivations.sidecarRoot;hasVendorFrontmatter=this.derivations.hasVendorFrontmatter;hasConnections=this.derivations.hasConnections;hasPluginContributions=this.derivations.hasPluginContributions;hasMetadata=this.derivations.hasMetadata;issues=X([]);issuesPath=void 0;issuesLoaderEffect=de(e=>{let n=this.node(),i=n?.path;if(i!==this.issuesPath&&(this.issues.set([]),this.issuesPath=i),!n||!i)return;let r=!1;e(()=>{r=!0}),this.dataSource.listIssues({node:i}).then(a=>{!r&&this.issuesPath===i&&this.issues.set(a.items)}).catch(()=>{!r&&this.issuesPath===i&&this.issues.set([])})});sortedIssues=E(()=>{let e={error:0,warn:1,info:2};return[...this.issues()].sort((n,i)=>e[n.severity]-e[i.severity])});frontmatterInvalid=E(()=>this.issues().some(e=>e.analyzerId==="frontmatter-parse-error"));ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}openPath(e){this.nodeOpenIntent.open(e)}onSkillChip=e=>{this.openPath(e)};pathExists(e){return this.pathSet().has(e)}linkStatus(e){return this.deadLink.linkStatus(e)}isVerifying(e){return this.deadLink.isVerifying(e)}verifyDeadLink(e){return this.deadLink.verifyDeadLink(e)}onHeaderFavoriteToggle(e){let n=this.node();!n||n.path!==e||this.loader.toggleFavorite(e,!n.isFavorite)}consentOpen=this.actionDispatch.consentOpen;actionError=this.actionDispatch.error;onConsentDecision(e){this.actionDispatch.resolveConsent(e)}dismissActionError(){this.actionDispatch.dismissError()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-inspector-view"]],inputs:{path:[1,"path"],activeTag:[1,"activeTag"]},outputs:{tagSelect:"tagSelect"},decls:3,vars:1,consts:[["data-testid","inspector-view",1,"inspector"],["data-testid","inspector-view",1,"inspector",3,"--accent"],["data-testid","inspector-empty-no-selection",1,"empty-state"],[1,"empty-state__icon","pi","pi-eye"],[1,"empty-state__title"],[1,"empty-state__desc"],["data-testid","inspector-empty-not-found",1,"empty-state"],[1,"empty-state__icon","empty-state__icon--warn","pi","pi-question-circle"],[3,"favoriteToggle","tagClick","node","frontmatterInvalid","activeTag"],["data-testid","inspector-description",1,"inspector__desc",3,"innerHTML"],["data-testid","inspector-superseded-banner",1,"inspector__banner","inspector__banner--warn"],["data-testid","inspector-action-error",1,"inspector__banner","inspector__banner--error"],[1,"inspector__toolbar"],["slot","inspector.action.button",3,"node"],["toggleTestid","inspector-findings-toggle","data-testid","inspector-findings",3,"title","expanded"],["toggleTestid","inspector-connections-toggle","data-testid","inspector-card-linked-nodes",3,"title","expanded"],["data-testid","inspector-card-vendor-frontmatter",1,"inspector__vendor"],["toggleTestid","inspector-annotations-toggle","data-testid","inspector-card-annotations",3,"title","expanded"],["toggleTestid","inspector-body-toggle","data-testid","inspector-card-body",1,"inspector__body-section",3,"title","expanded"],["toggleTestid","inspector-plugins-toggle","data-testid","inspector-card-plugins",3,"title","expanded"],[3,"node"],["toggleTestid","inspector-metadata-toggle","data-testid","inspector-card-metadata",3,"title","expanded"],[3,"decision","open"],["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"],["toggleTestid","inspector-findings-toggle","data-testid","inspector-findings",3,"toggle","title","expanded"],["smSectionTitleExtra","",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"],["toggleTestid","inspector-connections-toggle","data-testid","inspector-card-linked-nodes",3,"toggle","title","expanded"],[3,"path"],[3,"openPath","path"],[3,"toggle","frontmatter","kind","provider","skillPathByName","onSkillClick","expanded"],["toggleTestid","inspector-annotations-toggle","data-testid","inspector-card-annotations",3,"toggle","title","expanded"],["smSectionTitleExtra","","data-testid","inspector-sidecar-file",1,"inspector__sidecar-file"],[3,"overlay","knownPaths"],[3,"openPath","overlay","knownPaths"],["toggleTestid","inspector-body-toggle","data-testid","inspector-card-body",1,"inspector__body-section",3,"toggle","title","expanded"],["data-testid","inspector-body-loading",1,"inspector__body-status"],["data-testid","inspector-body-rendered",1,"inspector__body-rendered",3,"innerHTML"],["toggleTestid","inspector-plugins-toggle","data-testid","inspector-card-plugins",3,"toggle","title","expanded"],[3,"sidecarRoot"],["toggleTestid","inspector-metadata-toggle","data-testid","inspector-card-metadata",3,"toggle","title","expanded"],["data-testid","inspector-metadata-section",1,"inspector__metadata"],[3,"node","sidecarRoot","overlay"]],template:function(n,i){n&1&&M(0,ode,7,2,"section",0)(1,rde,10,3,"section",0)(2,Ide,18,20,"section",1),n&2&&D(i.path()?i.node()?2:1:0)},dependencies:[iP,JD,aP,uP,hP,mP,_P,gP,mf,Jn,vP],styles:["[_nghost-%COMP%]{display:block}.inspector[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown);display:flex;flex-direction:column;gap:.75rem;padding:1rem 1.1rem 1.25rem;background:var(--sm-bg-content);color:var(--p-text-color)}.inspector--empty[_ngcontent-%COMP%]{padding:2rem;color:var(--p-text-muted-color)}.inspector__desc[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);font-size:.88rem;line-height:1.5;max-width:none}.inspector__sidecar-file[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;font-weight:400;color:var(--p-text-muted-color)}[_nghost-%COMP%] .inspector__desc code{background:var(--sm-bg-hover);padding:.05rem .3rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .inspector__desc a{color:var(--p-primary-color);text-decoration:underline}.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:.45rem;padding-left:.7rem;border-left:2px solid color-mix(in srgb,var(--accent) 70%,transparent);transition:border-color .14s ease}[_nghost-%COMP%] .sm-block--collapsible:hover{border-left-color:var(--accent)}[_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+*{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(--accent)}[_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)}[_nghost-%COMP%] .sm-block__inline{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .65rem;row-gap:.35rem}[_nghost-%COMP%] .sm-block__meta{display:inline-flex;align-items:center;gap:.3rem;font-size:.83rem;color:var(--p-text-color)}[_nghost-%COMP%] .sm-block__meta .pi{color:var(--p-text-muted-color);font-size:.85rem}[_nghost-%COMP%] .sm-block__meta a{color:var(--p-primary-color);word-break:break-all}[_nghost-%COMP%] .sm-block__meta code{background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);font-size:.78rem}.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}[_nghost-%COMP%] .inspector__body-rendered{font-size:.9rem;line-height:1.6;max-height:480px;overflow:auto;padding:.25rem 0 0;--code-border: color-mix(in srgb, var(--sm-border) 70%, var(--p-text-muted-color))}[_nghost-%COMP%] .inspector__body-rendered :first-child{margin-top:0}[_nghost-%COMP%] .inspector__body-rendered :last-child{margin-bottom:0}[_nghost-%COMP%] .inspector__body-rendered h1, [_nghost-%COMP%] .inspector__body-rendered h2, [_nghost-%COMP%] .inspector__body-rendered h3, [_nghost-%COMP%] .inspector__body-rendered h4, [_nghost-%COMP%] .inspector__body-rendered h5, [_nghost-%COMP%] .inspector__body-rendered h6{margin:1.2rem 0 .6rem;font-weight:600;line-height:1.3}[_nghost-%COMP%] .inspector__body-rendered h1{font-size:1.35rem}[_nghost-%COMP%] .inspector__body-rendered h2{font-size:1.18rem}[_nghost-%COMP%] .inspector__body-rendered h3{font-size:1.05rem}[_nghost-%COMP%] .inspector__body-rendered h4{font-size:.95rem}[_nghost-%COMP%] .inspector__body-rendered h5, [_nghost-%COMP%] .inspector__body-rendered h6{font-size:.9rem;color:var(--p-text-muted-color)}[_nghost-%COMP%] .inspector__body-rendered h1, [_nghost-%COMP%] .inspector__body-rendered h2{padding-bottom:.3rem;border-bottom:1px solid var(--sm-border)}[_nghost-%COMP%] .inspector__body-rendered p{margin:.6rem 0}[_nghost-%COMP%] .inspector__body-rendered a{color:var(--p-primary-color);text-decoration:underline;text-underline-offset:2px}[_nghost-%COMP%] .inspector__body-rendered ul, [_nghost-%COMP%] .inspector__body-rendered ol{margin:.6rem 0;padding-left:1.4rem}[_nghost-%COMP%] .inspector__body-rendered li{margin:.2rem 0}[_nghost-%COMP%] .inspector__body-rendered li>ul, [_nghost-%COMP%] .inspector__body-rendered li>ol{margin:.2rem 0}[_nghost-%COMP%] .inspector__body-rendered blockquote{margin:.75rem 0;padding:.7rem .95rem;border-left:2px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);font-size:.9rem;line-height:1.55;border-radius:0 var(--sm-radius-sm) var(--sm-radius-sm) 0}[_nghost-%COMP%] .inspector__body-rendered blockquote :first-child{margin-top:0}[_nghost-%COMP%] .inspector__body-rendered blockquote :last-child{margin-bottom:0}[_nghost-%COMP%] .inspector__body-rendered hr{margin:1.2rem 0;border:0;border-top:1px solid var(--sm-border)}[_nghost-%COMP%] .inspector__body-rendered img{max-width:100%;height:auto;border-radius:var(--sm-radius-sm)}[_nghost-%COMP%] .inspector__body-rendered table{border-collapse:collapse;width:100%;margin:.75rem 0;font-size:.85rem}[_nghost-%COMP%] .inspector__body-rendered th, [_nghost-%COMP%] .inspector__body-rendered td{border:1px solid var(--sm-border);padding:.35rem .55rem;text-align:left}[_nghost-%COMP%] .inspector__body-rendered th{background:var(--sm-bg-hover);font-weight:600}[_nghost-%COMP%] .inspector__body-rendered tbody tr:nth-child(2n){background:var(--sm-bg-hover)}[_nghost-%COMP%] .inspector__body-rendered pre{background:var(--sm-bg-hover);border:1px solid var(--code-border);border-radius:var(--sm-radius-md);padding:.75rem .85rem;margin:.75rem 0;white-space:pre;font-family:var(--sm-font-mono);font-size:.82rem;line-height:1.5;overflow-x:auto}[_nghost-%COMP%] .inspector__body-rendered code{background:var(--sm-bg-hover);border:1px solid var(--code-border);padding:.05rem .34rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}[_nghost-%COMP%] .inspector__body-rendered pre code{background:transparent;border:0;padding:0;border-radius:0;font-size:inherit}.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__metadata[_ngcontent-%COMP%]{display:flex;flex-direction:column}.inspector__metadata[_ngcontent-%COMP%] > sm-inspector-debug-panel[_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)}[_nghost-%COMP%] .ann-panel__chip--user{padding:.1rem .55rem}"],changeDetection:0})}return t})();var TP=(()=>{class t{smMiddleMousePan=B.required();origin=null;rafId=null;pendingPosition=null;onMouseDown(e){if(e.button!==1)return;let n=this.smMiddleMousePan();if(!n)return;e.preventDefault();let i=n.getPosition()??{x:0,y:0};this.origin={mouseX:e.clientX,mouseY:e.clientY,canvasX:i.x,canvasY:i.y},document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd)}ngOnDestroy(){this.onEnd()}onMove=e=>{this.origin&&(this.pendingPosition={x:this.origin.canvasX+(e.clientX-this.origin.mouseX),y:this.origin.canvasY+(e.clientY-this.origin.mouseY)},this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let n=this.smMiddleMousePan();!n||!this.pendingPosition||(n.setPosition(this.pendingPosition),n.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(n){return new(n||t)};static \u0275dir=je({type:t,selectors:[["","smMiddleMousePan",""]],hostBindings:function(n,i){n&1&&A("mousedown",function(a){return i.onMouseDown(a)})},inputs:{smMiddleMousePan:[1,"smMiddleMousePan"]}})}return t})();function SP(t,o){if(t.size===0)return{next:t,dirty:!1};let e=!1,n=new Set;for(let i of t)o.has(i)?n.add(i):e=!0;return{next:e?n:t,dirty:e}}function kP(t){let{nodes:o,current:e,layout:n}=t,i=new Set(o.map(c=>c.path)),r=!1,a=new Map(e);for(let c of a.keys())i.has(c)||(a.delete(c),r=!0);let s=!1;for(let c of i)if(!a.has(c)){s=!0;break}for(let c of i){let u=n.positions.get(c);if(!u)continue;let h=a.get(c);if(!h){a.set(c,{x:u.x,y:u.y}),r=!0;continue}h.manual!==!0&&s&&(h.x===u.x&&h.y===u.y||(a.set(c,{x:u.x,y:u.y}),r=!0))}return{next:a,dirty:r}}function IP(t){let{selectedPath:o,setSelectedNodeId:e,readSelectedNodeId:n,graphNodes:i,onDeepLinkSelect:r,router:a,route:s}=t,c=db(s.queryParamMap.pipe(y0(u=>u.get("path"))),{initialValue:s.snapshot.queryParamMap.get("path")});de(()=>{let u=c(),h=i();if(h.length===0||!u)return;let g=tn(()=>n());if(g!==null&&h.find(I=>I.id===g)?.view.path===u)return;let C=h.find(k=>k.view.path===u);C&&(e(C.id),r?.(C.id))}),de(()=>{let u=o(),h=tn(()=>c());(u??null)!==(h??null)&&a.navigate([],{relativeTo:s,queryParams:{path:u??null},queryParamsHandling:"merge",replaceUrl:!0})})}function EP(t,o){return ho(t).includes(o)}function MP(t){if(typeof t!="object"||t===null)return!1;let o=t;return typeof o.x=="number"&&typeof o.y=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)}function DP(t){if(typeof t!="object"||t===null)return!1;let o=t;return typeof o.x=="number"&&typeof o.y=="number"&&typeof o.scale=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)&&Number.isFinite(o.scale)&&o.scale>0}function PP(t){return t.querySelector(".p-overlay-mask, .p-dialog, .p-overlay")!==null}var RP="sm.graph.viewport",OP="sm.graph.node-positions",FP="sm.graph.node-expanded",NP="sm.graph.panel-width";function AP(){let t=null;try{t=localStorage.getItem(RP)}catch{return null}if(!t)return null;let o;try{o=JSON.parse(t)}catch{return null}return DP(o)?o:null}function LP(t){try{localStorage.setItem(RP,JSON.stringify(t))}catch{}}function BP(){let t=new Map,o=null;try{o=localStorage.getItem(OP)}catch{return t}if(!o)return t;let e;try{e=JSON.parse(o)}catch{return t}if(typeof e!="object"||e===null)return t;for(let[n,i]of Object.entries(e)){if(!MP(i))continue;let r=i,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 Ha(t){try{let o={};for(let[e,n]of t)o[e]=n.manual?{x:n.x,y:n.y,manual:!0}:{x:n.x,y:n.y};localStorage.setItem(OP,JSON.stringify(o))}catch{}}function VP(){let t=null;try{t=localStorage.getItem(FP)}catch{return new Set}if(!t)return new Set;let o;try{o=JSON.parse(t)}catch{return new Set}if(!Array.isArray(o))return new Set;let e=new Set;for(let n of o)typeof n=="string"&&n.length>0&&e.add(n);return e}function gf(t){try{localStorage.setItem(FP,JSON.stringify([...t]))}catch{}}function zP(){let t=null;try{t=localStorage.getItem(NP)}catch{return null}if(!t)return null;let o=Number(t);return!Number.isFinite(o)||o<=0?null:o}function HP(t){try{localStorage.setItem(NP,String(Math.round(t)))}catch{}}var vf=500,bf=400,qP=80;function GP(t){let o=X(t.initialWidth),e=X(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&Ga(window,"resize").pipe(Qn(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let n=E(()=>{let g=Math.max(bf,e()-qP),C=o();return C>g||C<bf?Math.min(vf,g):C}),i=null,r=null,a=null,s=()=>{a=null,r!==null&&(o.set(r),r=null)},c=g=>{if(!i)return;let C=g.clientX-i.mouseX,k=i.widthAtStart-C,I=Math.max(bf,e()-qP);r=Math.min(I,Math.max(bf,k)),a===null&&typeof window<"u"&&(a=window.requestAnimationFrame(s))},u=()=>{i&&(i=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),a!==null&&typeof window<"u"&&(window.cancelAnimationFrame(a),a=null),r!==null&&(o.set(r),r=null),t.onCommit(o()))};return{clampedPanelWidth:n,onPanelResizeStart:g=>{g.button===0&&(g.preventDefault(),g.stopPropagation(),i={mouseX:g.clientX,widthAtStart:n()},document.addEventListener("mousemove",c),document.addEventListener("mouseup",u))}}}function jP(t){let o=X(null),e=null,n=()=>{if(e===null)return;let r=e;e=null,t.mapVisibility.setOnly(r)};return{activeTagSelection:o,onTagSelect:r=>{if(o()===r){o.set(null),n();return}let a=t.nodes().filter(s=>EP(s,r)).map(s=>s.path);if(a.length===0){o.set(null),n();return}e===null&&(e=new Set(t.mapVisibility.paths())),t.mapVisibility.setOnly(a),o.set(r)}}}var _0=.05,g0=2;function UP(t){let o=X(t.savedViewport?{x:t.savedViewport.x,y:t.savedViewport.y}:{x:0,y:0}),e=X(t.savedViewport?.scale??1),n=E(()=>e()<g0-1e-6),i=E(()=>e()>_0+1e-6);return{viewportPosition:o,viewportScale:e,canZoomIn:n,canZoomOut:i,onCanvasChange:a=>{let s=o();(s.x!==a.position.x||s.y!==a.position.y)&&o.set({x:a.position.x,y:a.position.y}),e()!==a.scale&&e.set(a.scale),t.hasCompletedInitialLayout()&&LP({x:a.position.x,y:a.position.y,scale:a.scale})}}}var Ede=.15,Mde=.25,Dde=.75,Pde=.6;function $P(t){let o=E(()=>{let u=new Map;for(let h of t.graph().edges)u.has(h.from)||u.set(h.from,new Set),u.has(h.to)||u.set(h.to,new Set),u.get(h.from).add(h.to),u.get(h.to).add(h.from);return u}),e=u=>t.selectedNodeId()===u,n=u=>{let h=t.selectedNodeId();return h===null||h===u?!1:o().get(h)?.has(u)??!1},i=u=>{if(t.activeTagSelection()!==null)return!1;let h=t.selectedNodeId();return h===null||h===u?!1:!(o().get(h)?.has(u)??!1)},r=u=>{let h=t.selectedNodeId();return h!==null&&(u.from===h||u.to===h)},a=u=>{if(t.activeTagSelection()!==null)return!1;let h=t.selectedNodeId();return h===null?!1:u.from!==h&&u.to!==h},s=E(()=>{let u=t.selectedNodeId(),h=t.activeTagSelection()!==null,g=u!==null?o().get(u)??null:null,C=new Map;for(let k of t.graph().nodes){let I=k.id,N=u===I,q=!N&&u!==null&&(g?.has(I)??!1),Y=!h&&u!==null&&!N&&!(g?.has(I)??!1);C.set(I,{selected:N,highlighted:q,dimmed:Y})}return C}),c=E(()=>{let u=t.selectedNodeId(),h=t.activeTagSelection()!==null,g=new Map;for(let C of t.graph().edges){let k=u!==null&&(C.from===u||C.to===u),I=!h&&u!==null&&!k,N=typeof C.confidence=="number"?C.confidence:Pde,q=I?Ede:Mde+Dde*N;g.set(C.id,{highlighted:k,dimmed:I,opacity:q})}return g});return{isSelected:e,isHighlighted:n,isDimmed:i,isEdgeHighlighted:r,isEdgeDimmed:a,selectionView:s,edgeSelectionView:c}}function WP(t){let o=t.onCommit??Ha,e=null,n=!1,i=null,r=()=>{queueMicrotask(()=>{if(!n){i=null;return}n=!1,i&&(t.nodePositions.set(i),i=null),o(t.nodePositions())})},a=(u,h)=>{i||(i=new Map(t.nodePositions())),i.set(u,{x:h.x,y:h.y,manual:!0}),n=!0},s=u=>{e={x:u.clientX,y:u.clientY},document.addEventListener("mouseup",r,{once:!0})},c=u=>{let h=e;if(e=null,!h)return!0;let g=u.clientX-h.x,C=u.clientY-h.y;return Math.hypot(g,C)<=4};return t.destroyRef.onDestroy(()=>{document.removeEventListener("mouseup",r)}),{onNodePositionChange:a,onNodePointerDown:s,isClickWithoutDrag:c}}function KP(t){let o=X(VP());return de(()=>{let r=new Set(t.nodes().map(s=>s.path));if(r.size===0)return;let a=SP(o(),r);a.dirty&&(o.set(a.next),gf(a.next))}),{isExpanded:r=>o().has(r),setExpanded:(r,a)=>{let s=o();if(s.has(r)===a)return;let c=new Set(s);a?c.add(r):c.delete(r),o.set(c),gf(c)},resetAll:()=>{o.set(new Set),gf(new Set)},expandedNodeIds:o}}function YP(t){let o=X(!1),e=!1,n=null;return de(()=>{let i=t.visibleNodes();e||i.length!==0&&queueMicrotask(()=>{e=!0,o.set(!0),t.savedViewport||t.fit()})}),de(()=>{let i=t.pathsFingerprint();if(!e){n=i;return}n!==i&&(n=i,(t.animatedFit??t.fit)())}),{hasCompletedInitialLayout:()=>o()}}function XP(t){let{points:o,wrap:e,panelW:n,zoomMin:i}=t;if(o.length===0)return null;let r=1/0,a=1/0,s=-1/0,c=-1/0;for(let Oe of o)Oe.x<r&&(r=Oe.x),Oe.y<a&&(a=Oe.y),Oe.x+260>s&&(s=Oe.x+260),Oe.y+120>c&&(c=Oe.y+120);let u=Math.max(1,e.width-n),h=Math.max(1,s-r),g=Math.max(1,c-a),C=Math.max(1,u-160),k=Math.max(1,e.height-160),I=Math.min(C/h,k/g),N=Math.min(1,Math.max(i,I)),q=(r+s)/2,Y=(a+c)/2,ee=u/2-q*N,ce=e.height/2-Y*N;return{position:{x:ee,y:ce},scale:N}}function ZP(t){let{point:o,wrap:e,panelW:n,scale:i}=t,r=o.x+260/2,a=o.y+120/2,c=Math.max(1,e.width-n)/2-r*i,u=e.height/2-a*i;return{position:{x:c,y:u},scale:i}}function b0(t,o,e){if(typeof requestAnimationFrame>"u"||e<=0){t.writePosition(o.position),t.writeScale(o.scale);return}let n=t.readPosition(),i=t.readScale(),r=performance.now(),a=s=>{if(t.isStaleToken())return;let c=Math.min(1,(s-r)/e),u=Rde(c);t.writePosition({x:n.x+(o.position.x-n.x)*u,y:n.y+(o.position.y-n.y)*u}),t.writeScale(i+(o.scale-i)*u),c<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}function Rde(t){return 1-Math.pow(1-t,3)}var Ode=["canvasWrap"],t3=(t,o)=>o.id;function Fde(t,o){if(t&1&&(f(0,"div",2),F(1,"span",8),f(2,"p",9),b(3),_()()),t&2){let e=d();l(3),x(e.texts.loading)}}function Nde(t,o){if(t&1&&(f(0,"div",3),F(1,"span",10),f(2,"p",9),b(3),_(),f(4,"p",11),b(5),_()()),t&2){let e=d();l(3),x(e.texts.errorTitle),l(2),x(e.error())}}function Ade(t,o){if(t&1){let e=$();f(0,"div",4),F(1,"i",12),f(2,"p",13),b(3),_(),f(4,"p-button",14),A("onClick",function(){w(e);let i=d();return T(i.resetFilters())}),_()()}if(t&2){let e=d();l(3),x(e.texts.emptyTitle),l(),m("label",e.texts.resetFilters)("text",!0)}}function Lde(t,o){if(t&1){let e=$();f(0,"div",5),F(1,"i",15),f(2,"p",9),b(3),_(),f(4,"p-button",16),A("onClick",function(){w(e);let i=d();return T(i.mapVisibility.clear())}),_()()}if(t&2){let e=d();l(3),x(e.texts.curationEmptyTitle),l(),m("label",e.texts.showAllOnMap)("text",!0)}}function Bde(t,o){if(t&1&&(f(0,"f-connection",36),W(),f(1,"svg",37),F(2,"circle",38),_(),ja(),F(3,"f-connection-marker-arrow",39),_()),t&2){let e=o.$implicit,n=d(2),i=n.edgeSelectionFor(e.id);H("f-conn--"+e.kind),Ne("opacity",i.opacity),ue("f-conn--highlighted",i.highlighted)("f-conn--dimmed",i.dimmed),m("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fOutputSide",n.outputSide())("fInputSide",n.inputSide())("fType",n.connectionType())("fBehavior",n.connectionBehavior)("fReassignDisabled",!0),l(),m("type",n.markerStart)("width",9)("height",9)("refX",4.5)("refY",4.5),l(2),m("type",n.markerEnd)}}function Vde(t,o){if(t&1){let e=$();me(0,23),f(1,"div",41),A("fNodePositionChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.onNodePositionChange(r.id,i))})("pointerdown",function(i){w(e);let r=d(3);return T(r.onNodePointerDown(i))})("click",function(i){let r=w(e).$implicit,a=d(3);return T(a.selectNode(r,i))})("dblclick",function(){let i=w(e).$implicit,r=d(3);return T(r.openNode(i))}),f(2,"sm-node-card",42),A("expandedChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.setExpanded(r.id,i))})("favoriteToggle",function(i){w(e);let r=d(3);return T(r.onFavoriteToggle(i))}),_(),f(3,"div",43),F(4,"sm-view-contributions-host",44),_()(),_e()}if(t&2){let e=o.$implicit,n=d(3);l(),m("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide())("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide()),O("data-testid","graph-node-"+e.id),l(),m("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),m("node",e.view)}}function zde(t,o){if(t&1&&S(0,Vde,5,14,"ng-container",40),t&2){let e=d(2);m("fVirtualForOf",e.graph().nodes)}}function Hde(t,o){if(t&1){let e=$();f(0,"div",46),A("fNodePositionChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.onNodePositionChange(r.id,i))})("pointerdown",function(i){w(e);let r=d(3);return T(r.onNodePointerDown(i))})("click",function(i){let r=w(e).$implicit,a=d(3);return T(a.selectNode(r,i))})("dblclick",function(){let i=w(e).$implicit,r=d(3);return T(r.openNode(i))}),f(1,"sm-node-card",42),A("expandedChange",function(i){let r=w(e).$implicit,a=d(3);return T(a.setExpanded(r.id,i))})("favoriteToggle",function(i){w(e);let r=d(3);return T(r.onFavoriteToggle(i))}),_(),f(2,"div",43),F(3,"sm-view-contributions-host",44),_()()}if(t&2){let e=o.$implicit,n=d(3);m("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fOutputId",e.id+"-out"),O("data-testid","graph-node-"+e.id),l(),m("node",e.view)("stats",e.stats)("summary",e.summary)("selection",n.selectionFor(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),m("node",e.view)}}function qde(t,o){if(t&1&&(me(0,23),re(1,Hde,4,12,"div",45,t3),_e()),t&2){let e=d(2);l(),ae(e.graph().nodes)}}function Gde(t,o){if(t&1&&F(0,"sm-perf-hud",29),t&2){let e=d(2);m("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())}}function jde(t,o){if(t&1){let e=$();F(0,"span",34),f(1,"p-button",47),A("onClick",function(){w(e);let i=d(2);return T(i.mapVisibility.clear())}),_()}if(t&2){let e=d(2);l(),m("label",e.texts.toolbar.showAllLabel)("ariaLabel",e.texts.toolbar.showAllAria)("pTooltip",e.texts.toolbar.showAllTooltip)("text",!0)}}function Ude(t,o){if(t&1){let e=$();f(0,"div",17,0),A("click",function(i){w(e);let r=d();return T(r.onCanvasClick(i))}),f(2,"f-flow",18),A("fLoaded",function(){w(e);let i=d();return T(i.onLoaded())}),F(3,"f-selection-area"),f(4,"f-background"),F(5,"f-rect-pattern"),_(),F(6,"f-line-alignment",19),f(7,"f-canvas",20),A("fCanvasChange",function(i){w(e);let r=d();return T(r.onCanvasChange(i))}),me(8,21),re(9,Bde,4,21,"f-connection",22,t3),_e(),M(11,zde,1,1,"ng-container",23)(12,qde,3,0,"ng-container",23),_(),F(13,"f-minimap"),_(),f(14,"div",24),F(15,"sm-kind-palette")(16,"sm-severity-palette")(17,"sm-link-kind-palette"),_(),f(18,"aside",25)(19,"div",26),A("mousedown",function(i){w(e);let r=d();return T(r.onPanelResizeStart(i))}),_(),f(20,"div",27)(21,"sm-inspector-view",28),A("tagSelect",function(i){w(e);let r=d();return T(r.onTagSelect(i))}),_()()(),M(22,Gde,1,3,"sm-perf-hud",29),f(23,"div",30)(24,"p-button",31),A("onClick",function(){w(e);let i=d();return T(i.zoomIn())}),_(),f(25,"p-button",32),A("onClick",function(){w(e);let i=d();return T(i.zoomOut())}),_(),f(26,"p-button",33),A("onClick",function(){w(e);let i=d();return T(i.fitToScreen())}),_(),F(27,"span",34)(28,"sm-graph-layout-toolbar")(29,"span",34),f(30,"p-button",35),A("onClick",function(){w(e);let i=d();return T(i.resetLayout())}),_(),M(31,jde,2,4),_()()}if(t&2){let e=d();m("smMiddleMousePan",e.canvas()),l(2),m("fCache",e.perf.cache),l(4),m("fAlignThreshold",20),l(),m("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("fZoomMinimum",e.zoomMin)("fZoomMaximum",e.zoomMax)("debounceTime",150),l(2),ae(e.graph().edges),l(2),D(e.perf.virtualization?11:12),l(7),Ne("width",e.clampedPanelWidth(),"px"),ue("is-open",e.selectedNodeId()!==null),O("aria-label",e.texts.a11y.panel),l(),O("aria-label",e.texts.panel.resizeLabel),l(2),m("path",e.selectedPath())("activeTag",e.activeTagSelection()),l(),D(e.perfHud()?22:-1),l(),O("aria-label",e.texts.a11y.toolbar),l(),m("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),l(),m("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),l(),m("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),l(4),m("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0),l(),D(e.mapVisibility.isActive()?31:-1)}}var JP=.2,e3=420,$de={selected:!1,highlighted:!1,dimmed:!1},Wde={highlighted:!1,dimmed:!1,opacity:1},yf=(()=>{class t{loader=p(Vt);filters=p(on);issuePaths=p(yo);mapVisibility=p(ei);graphPreferences=p(cf);router=p(es);route=p(Ja);confirmationService=p(Df);destroyRef=p(xt);dagreLayout=p(i0);injector=p(dt);usageTracker=p(Mb);flow=nt(la);canvas=nt(sa);zoom=nt(ca);canvasWrap=nt("canvasWrap");connectionType=this.graphPreferences.connectionType;connectionBehavior=ri.FIXED;markerStart=Be.START_ALL_STATES;markerEnd=Be.END_ALL_STATES;perf=lf.graph.perf;perfHud=p(XD).visible;savedViewport=AP();viewportStore=UP({savedViewport:this.savedViewport,hasCompletedInitialLayout:()=>this.layoutFit.hasCompletedInitialLayout()});viewportPosition=this.viewportStore.viewportPosition;viewportScale=this.viewportStore.viewportScale;canZoomIn=this.viewportStore.canZoomIn;canZoomOut=this.viewportStore.canZoomOut;zoomMin=_0;zoomMax=g0;texts=wi;nodePositions=X(BP());nodeDrag=WP({destroyRef:this.destroyRef,nodePositions:this.nodePositions});expansion=KP({nodes:this.loader.nodes});panelResize=GP({destroyRef:this.destroyRef,initialWidth:zP()??vf,onCommit:e=>HP(e)});clampedPanelWidth=this.panelResize.clampedPanelWidth;loading=this.loader.loading;error=this.loader.error;visibleNodes=E(()=>this.filters.apply(this.loader.nodes(),this.issuePaths.bySeverity()));topology=E(()=>Pb(this.loader.nodes(),this.loader.scan()));layoutPositions=X(new Map);layoutComputedAtSignal=X(0);fullLayout=E(()=>Dt(ge({},this.topology()),{positions:this.layoutPositions(),computedAt:this.layoutComputedAtSignal()}));mapVisiblePaths=E(()=>{let e=this.visibleNodes().map(i=>i.path),n=this.mapVisibility.paths();return n.size===0?new Set(e):new Set(e.filter(i=>n.has(i)))});graph=E(()=>{let e=this.mapVisiblePaths(),n=this.filters.selectedLinkKinds(),i=n.length>0?new Set(n):null;return Rb(this.fullLayout(),e,this.nodePositions(),i)});fullAdjacency=E(()=>{let e=new Map,n=(i,r)=>{let a=e.get(i);a||(a=new Set,e.set(i,a)),a.add(r)};for(let i of this.fullLayout().edges)n(i.from,i.to),n(i.to,i.from);return e});hasData=E(()=>this.graph().nodes.length>0);showEmptyState=E(()=>!this.hasData()&&!this.mapVisibility.isActive()&&!this.filters.kindToggleExplicitEmpty()&&this.filters.searchText().trim().length===0);showCurationEmptyState=E(()=>!this.hasData()&&this.mapVisibility.isActive());visibleCount=E(()=>this.graph().nodes.length);totalCount=E(()=>this.loader.nodes().length);edgeCount=E(()=>this.graph().edges.length);layoutComputedAt=E(()=>this.layoutComputedAtSignal());connectionSides=E(()=>ID(this.graphPreferences.layoutAlgorithm(),this.graphPreferences.layoutDirection()));inputSide=E(()=>this.connectionSides().input);outputSide=E(()=>this.connectionSides().output);selectedNodeId=X(null);selectedPath=E(()=>{let e=this.selectedNodeId();return e?this.graph().nodes.find(i=>i.id===e)?.view.path:void 0});selectionGuard=de(()=>{let e=this.selectedNodeId();if(e===null)return;this.graph().nodes.some(i=>i.id===e)||this.selectedNodeId.set(null)});pathsFingerprint=E(()=>this.loader.nodes().map(e=>e.path).sort().join("|"));layoutFit=YP({visibleNodes:this.visibleNodes,pathsFingerprint:this.pathsFingerprint,savedViewport:this.savedViewport,fit:()=>this.fitToScreenClamped(),animatedFit:()=>this.animatedFitToScreen()});constructor(){let e=E(()=>this.loader.nodes().map(r=>({id:r.path,view:{path:r.path}})),{equal:(r,a)=>{if(r.length!==a.length)return!1;for(let s=0;s<r.length;s++)if(r[s]?.id!==a[s]?.id)return!1;return!0}});IP({selectedPath:this.selectedPath,setSelectedNodeId:r=>this.selectedNodeId.set(r),readSelectedNodeId:()=>this.selectedNodeId(),graphNodes:e,onDeepLinkSelect:r=>{this.pendingCenterNodeId.set(r)},router:this.router,route:this.route}),de(()=>{let r=this.loader.nodes();if(r.length===0)return;let a=this.fullLayout();if(a.positions.size===0)return;let s=kP({nodes:r,current:this.nodePositions(),layout:a});s.dirty&&(this.nodePositions.set(s.next),Ha(s.next))}),de(()=>{this.layoutComputedAt(),this.autoFitPending&&(this.autoFitPending=!1,this.runAnimatedFit())}),de(()=>{this.layoutComputedAt();let r=this.layoutFit.hasCompletedInitialLayout(),a=this.pendingCenterNodeId();a===null||!r||this.fullLayout().positions.size!==0&&(this.pendingCenterNodeId.set(null),ao(()=>this.centerOnNode(a),{injector:this.injector}))}),de(()=>{this.mapVisibility.paths(),tn(()=>this.layoutFit.hasCompletedInitialLayout())&&(this.mapFitDebounce!==null&&clearTimeout(this.mapFitDebounce),this.mapFitDebounce=setTimeout(()=>{ao(()=>this.runAnimatedFit(),{injector:this.injector})},180))}),this.destroyRef.onDestroy(()=>{this.mapFitDebounce!==null&&clearTimeout(this.mapFitDebounce)}),de(()=>{let r=this.loader.nodes();r.length!==0&&this.mapVisibility.prune(new Set(r.map(a=>a.path)))});let n="",i="";de(()=>{let r=this.loader.nodes(),a=this.topology(),s={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()};if(r.length===0)return;let c=Db(r,a.edges),u=`${s.algorithm}|${s.direction}|${s.spacing}`,h=`${c}|${u}`;if(h===n)return;let g=i!==""&&i!==u;n=h,i=u,(s.algorithm==="force"?Promise.resolve(Af(r,a.edges)):Promise.resolve().then(()=>Nf(this.dagreLayout,r,a.edges,s))).then(k=>{this.layoutPositions.set(k),this.layoutComputedAtSignal.set(performance.now()),g&&(this.nodePositions.set(new Map),this.fitToScreenClamped())}).catch(k=>{console.error("[graph-view] layout failed:",k)})})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange=this.viewportStore.onCanvasChange;fitToScreenClamped(){let e=this.canvas(),n=this.zoom();e&&(e.fitToScreen({x:40,y:40},!1),ao(()=>{let i=e.transform.scale;if(i<=1&&i>=this.zoomMin)return;let r=Math.max(this.zoomMin,Math.min(i,1)),a=Math.abs(i-r),s=i>r?bn.ZOOM_OUT:bn.ZOOM_IN;n?.setZoom(this.getViewportCenter(),a,s,!1)},{injector:this.injector}))}autoFitAnimToken=0;autoFitPending=!1;mapFitDebounce=null;pendingCenterNodeId=X(null);animatedFitToScreen(){this.autoFitPending=!0}runAnimatedFit(){let e=this.canvasWrap()?.nativeElement;if(!e)return;let n={width:e.clientWidth,height:e.clientHeight},i=this.fullLayout().positions;if(i.size===0)return;let r=this.nodePositions(),a=[];for(let u of this.mapVisiblePaths()){let h=r.get(u)??i.get(u);h&&a.push({x:h.x,y:h.y})}if(a.length===0)return;let s=XP({points:a,wrap:n,panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,zoomMin:this.zoomMin});if(!s)return;let c=++this.autoFitAnimToken;b0({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:u=>this.viewportPosition.set(u),writeScale:u=>this.viewportScale.set(u),isStaleToken:()=>c!==this.autoFitAnimToken},s,e3)}centerOnNode(e){if(!this.mapVisiblePaths().has(e))return;let n=this.canvasWrap()?.nativeElement;if(!n)return;let i=this.nodePositions().get(e)??this.fullLayout().positions.get(e);if(!i)return;let r=ZP({point:i,wrap:{width:n.clientWidth,height:n.clientHeight},panelW:this.selectedNodeId()!==null?this.clampedPanelWidth():0,scale:this.viewportScale()}),a=++this.autoFitAnimToken;b0({readPosition:()=>this.viewportPosition(),readScale:()=>this.viewportScale(),writePosition:s=>this.viewportPosition.set(s),writeScale:s=>this.viewportScale.set(s),isStaleToken:()=>a!==this.autoFitAnimToken},r,e3)}isolateNeighborhood(e){this.mapVisibility.setOnly(kD(this.fullAdjacency(),e)),this.selectedNodeId.set(e)}onNodePositionChange(e,n){this.nodeDrag.onNodePositionChange(e,n)}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),JP,bn.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),JP,bn.ZOOM_OUT,!0)}fitToScreen(){this.fitToScreenClamped()}resetLayout(){let e=this.mapVisiblePaths(),n=e.size>=this.loader.nodes().length;if(![...this.nodePositions().values()].some(a=>a.manual===!0)){this.applyResetLayout(e,n);return}let r=wi.resetLayoutConfirm;this.confirmationService.confirm({header:r.header,message:n?r.message:r.messageVisible,icon:"pi pi-info-circle",acceptButtonProps:{label:r.accept},rejectButtonProps:{label:r.reject,severity:"secondary",outlined:!0},accept:()=>this.applyResetLayout(e,n)})}applyResetLayout(e,n){if(this.expansion.resetAll(),n){this.nodePositions.set(new Map),this.fitToScreenClamped();return}this.relayoutVisibleSubset(e).then(()=>this.fitToScreenClamped()).catch(()=>{})}async relayoutVisibleSubset(e){let n=this.loader.nodes().filter(c=>e.has(c.path));if(n.length===0)return;let i=this.topology().edges.filter(c=>e.has(c.from)&&e.has(c.to)),r={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()},a=await Promise.resolve(r.algorithm==="force"?Af(n,i):Nf(this.dagreLayout,n,i,r)),s=new Map(this.nodePositions());for(let[c,u]of a)s.set(c,{x:u.x,y:u.y,manual:!0});this.nodePositions.set(s),Ha(s)}getViewportCenter(){let e=this.canvasWrap()?.nativeElement;if(!e)return{x:0,y:0};let n=e.getBoundingClientRect();return{x:n.width/2,y:n.height/2}}onNodePointerDown(e){this.nodeDrag.onNodePointerDown(e)}selectNode(e,n){this.nodeDrag.isClickWithoutDrag(n)&&(this.selectedNodeId.set(e.id),this.usageTracker.trackFeature("inspector"))}tagSelection=jP({nodes:this.loader.nodes,mapVisibility:this.mapVisibility});activeTagSelection=this.tagSelection.activeTagSelection;selectionState=$P({graph:this.graph,selectedNodeId:this.selectedNodeId,activeTagSelection:this.activeTagSelection});onTagSelect(e){this.tagSelection.onTagSelect(e)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&(typeof document<"u"&&PP(document)||this.closePanel())}resetFilters(){this.filters.reset()}onPanelResizeStart(e){this.panelResize.onPanelResizeStart(e)}openNode(e){this.selectedNodeId.set(e.id)}onCanvasClick(e){let n=e.target;n?.closest(".sm-gnode")||n?.closest(".graph__toolbar")||n?.closest(".perf-hud")||n?.closest(".kind-palette")||n?.closest(".graph__panel")||this.selectedNodeId.set(null)}isSelected(e){return this.selectionState.isSelected(e)}isHighlighted(e){return this.selectionState.isHighlighted(e)}isDimmed(e){return this.selectionState.isDimmed(e)}selectionFor(e){return this.selectionState.selectionView().get(e)??$de}isExpanded(e){return this.expansion.isExpanded(e)}setExpanded(e,n){this.expansion.setExpanded(e,n)}onFavoriteToggle(e){this.loader.toggleFavorite(e.path,e.value)}edgeSelectionFor(e){return this.selectionState.edgeSelectionView().get(e)??Wde}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-graph-view"]],viewQuery:function(n,i){n&1&&hn(i.flow,la,5)(i.canvas,sa,5)(i.zoom,ca,5)(i.canvasWrap,Ode,5),n&2&&jt(4)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Wa)},features:[ke([Df,mC(i0,{mode:oi.MANUAL})])],decls:7,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-curation-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"],["aria-hidden","true",1,"pi","pi-eye-slash","empty-state__icon"],["size","small","data-testid","graph-show-all-on-map",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"],[3,"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"],["icon","pi pi-eye","severity","secondary","size","small","data-testid","graph-show-all-toolbar",3,"onClick","label","ariaLabel","pTooltip","text"]],template:function(n,i){n&1&&(f(0,"section",1),M(1,Fde,4,1,"div",2)(2,Nde,6,2,"div",3)(3,Ade,5,3,"div",4)(4,Lde,5,3,"div",5)(5,Ude,32,40,"div",6),F(6,"p-confirmdialog",7),_()),n&2&&(l(),D(i.loading()&&!i.hasData()?1:i.error()&&!i.hasData()?2:i.showEmptyState()?3:i.showCurationEmptyState()?4:5),l(5),m("ariaLabel",i.texts.resetLayoutConfirm.header))},dependencies:[SC,la,sa,bC,gC,ca,xC,Ry,Oy,vC,Qy,tC,yC,CC,kh,Zy,wC,pC,OD,LD,VD,jD,$D,KD,wP,kn,_n,fb,hb,ze,Ve,Jn,TP],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:var(--sm-shadow-panel);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:-3px;bottom:0;width:6px;cursor:ew-resize;z-index:2}.graph__panel-resize[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:4px;background:transparent;transition:background .12s ease}.graph__panel-resize[_ngcontent-%COMP%]:hover:after, .graph__panel-resize[_ngcontent-%COMP%]:active:after{background:var(--p-primary-color)}.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})}return t})();var qa=440,v0=280,Kde=480;function n3(t){let o=X(t.initialWidth),e=X(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&Ga(window,"resize").pipe(Qn(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let n=()=>Math.max(v0,e()-Kde),i=E(()=>{let C=n(),k=o();return k>C||k<v0?Math.min(qa,C):k}),r=null,a=null,s=null,c=()=>{s=null,a!==null&&(o.set(a),a=null)},u=C=>{if(!r)return;let k=C.clientX-r.mouseX,I=r.widthAtStart+k,N=n();a=Math.min(N,Math.max(v0,I)),s===null&&typeof window<"u"&&(s=window.requestAnimationFrame(c))},h=()=>{r&&(r=null,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h),s!==null&&typeof window<"u"&&(window.cancelAnimationFrame(s),s=null),a!==null&&(o.set(a),a=null),t.onCommit(o()))};return{clampedRailWidth:i,onRailResizeStart:C=>{C.button===0&&(C.preventDefault(),C.stopPropagation(),r={mouseX:C.clientX,widthAtStart:i()},document.addEventListener("mousemove",u),document.addEventListener("mouseup",h))}}}var i3=(()=>{class t{router=p(es);route=p(Ja);open(e){this.router.navigate([],{relativeTo:this.route,queryParams:{path:e},queryParamsHandling:"merge"})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=y({token:t,factory:t.\u0275fac})}return t})();function Yde(t,o){if(t&1){let e=$();f(0,"p-iconfield",3),F(1,"p-inputicon",7),f(2,"input",8),A("ngModelChange",function(i){w(e);let r=d();return T(r.onSearchChange(i))}),_()()}if(t&2){let e=d();l(2),m("placeholder",e.texts.rail.searchPlaceholder)("ngModel",e.searchText()),O("aria-label",e.texts.rail.searchAriaLabel)}}function Xde(t,o){if(t&1){let e=$();f(0,"div",9),F(1,"sm-files-view"),_(),f(2,"div",10),A("mousedown",function(i){w(e);let r=d();return T(r.onRailResizeStart(i))}),_()}if(t&2){let e=d();l(2),O("aria-label",e.texts.rail.resize)}}var o3="sm.workspace.rail-width",r3="sm.workspace.rail-collapsed",KSe=(()=>{class t{store=p(on);destroyRef=p(xt);texts=Ob;railCollapsed=X(this.readStoredCollapsed());railAnimating=X(!1);railAnimTimer=null;searchText=this.store.searchText;graphView=nt(yf);isolate(e){this.graphView()?.isolateNeighborhood(e)}resize=n3({destroyRef:this.destroyRef,initialWidth:this.readStoredWidth(),onCommit:e=>this.writeStoredWidth(e)});clampedRailWidth=this.resize.clampedRailWidth;onRailResizeStart=this.resize.onRailResizeStart;toggleRail(){this.railCollapsed.update(e=>!e),this.writeStoredCollapsed(this.railCollapsed()),this.railAnimating.set(!0),this.railAnimTimer!==null&&clearTimeout(this.railAnimTimer),this.railAnimTimer=setTimeout(()=>this.railAnimating.set(!1),220)}onSearchChange(e){this.store.setSearchText(e)}readStoredWidth(){if(typeof localStorage>"u")return qa;let e=Number(localStorage.getItem(o3));return Number.isFinite(e)&&e>0?e:qa}writeStoredWidth(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(o3,String(e))}catch{}}readStoredCollapsed(){if(typeof localStorage>"u")return!0;let e=localStorage.getItem(r3);return e===null?!0:e==="1"}writeStoredCollapsed(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(r3,e?"1":"0")}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=z({type:t,selectors:[["sm-workspace-view"]],viewQuery:function(n,i){n&1&&hn(i.graphView,yf,5),n&2&&jt()},features:[ke([{provide:fo,useClass:i3},{provide:ps,useExisting:Cn(()=>t)}])],decls:9,vars:15,consts:[["data-testid","workspace-view",1,"workspace"],["data-testid","workspace-rail",1,"workspace__rail"],[1,"workspace__rail-bar"],["iconPosition","left",1,"workspace__search"],["type","button","tooltipPosition","bottom","data-testid","workspace-rail-toggle",1,"workspace__rail-btn",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],[1,"workspace__map"],["styleClass","pi pi-search"],["pInputText","","pSize","small","type","text","data-testid","workspace-search",3,"ngModelChange","placeholder","ngModel"],[1,"workspace__rail-body"],["role","separator","aria-orientation","vertical","data-testid","workspace-rail-resize",1,"workspace__rail-resize",3,"mousedown"]],template:function(n,i){n&1&&(f(0,"div",0)(1,"aside",1)(2,"div",2),M(3,Yde,3,3,"p-iconfield",3),f(4,"button",4),A("click",function(){return i.toggleRail()}),F(5,"i",5),_()(),M(6,Xde,3,1),_(),f(7,"div",6),F(8,"sm-graph-view"),_()()),n&2&&(l(),Ne("width",i.railCollapsed()?null:i.clampedRailWidth(),"px"),ue("is-collapsed",i.railCollapsed())("is-animating",i.railAnimating()),O("aria-label",i.texts.rail.label),l(2),D(i.railCollapsed()?-1:3),l(),m("pTooltip",i.railCollapsed()?i.texts.rail.expand:i.texts.rail.collapse),O("aria-label",i.railCollapsed()?i.texts.rail.expand:i.texts.rail.collapse),l(),ue("pi-angle-left",!i.railCollapsed())("pi-angle-right",i.railCollapsed()),l(),D(i.railCollapsed()?-1:6))},dependencies:[Wv,yf,kt,H0,Lt,Bt,G0,q0,U0,j0,ns,uo,ze,Ve],styles:['.workspace[_ngcontent-%COMP%]{display:flex;height:100%;min-height:0}.workspace__rail[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;flex:0 0 auto;width:440px;min-width:0;min-height:0;background:var(--sm-bg-content);border-right:1px solid var(--sm-border)}.workspace__rail.is-collapsed[_ngcontent-%COMP%]{width:44px}.workspace__rail.is-animating[_ngcontent-%COMP%]{transition:width .18s ease}.workspace__rail-bar[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;align-items:center;gap:.4rem;padding:.35rem .4rem;border-bottom:1px solid var(--sm-border)}.workspace__rail.is-collapsed[_ngcontent-%COMP%] .workspace__rail-bar[_ngcontent-%COMP%]{justify-content:center}.workspace__search[_ngcontent-%COMP%]{flex:1;min-width:0;display:block}.workspace__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.workspace__rail-btn[_ngcontent-%COMP%]{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:var(--sm-radius-lg);background:transparent;color:var(--p-text-muted-color);cursor:pointer}.workspace__rail-btn[_ngcontent-%COMP%]:hover{background:var(--p-content-hover-background);color:var(--p-text-color)}.workspace__rail-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.workspace__rail-body[_ngcontent-%COMP%] sm-files-view[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;max-width:none;margin:0;padding:.5rem}.workspace__rail-resize[_ngcontent-%COMP%]{position:absolute;top:0;right:-3px;bottom:0;width:6px;cursor:ew-resize;z-index:5}.workspace__rail-resize[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;right:3px;width:4px;background:transparent;transition:background .12s ease}.workspace__rail-resize[_ngcontent-%COMP%]:hover:after, .workspace__rail-resize[_ngcontent-%COMP%]:active:after{background:var(--p-primary-color)}.workspace__map[_ngcontent-%COMP%]{position:relative;flex:1;min-width:0;min-height:0}.workspace__map[_ngcontent-%COMP%] sm-graph-view[_ngcontent-%COMP%]{display:block;height:100%}'],changeDetection:0})}return t})();export{KSe as WorkspaceView};
|