@reltio/remotes 1.4.1600 → 1.4.1601

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.
Files changed (91) hide show
  1. package/1039.js +1 -1
  2. package/1146.js +1 -1
  3. package/1148.js +1 -1
  4. package/1334.js +1 -1
  5. package/1425.js +1 -1
  6. package/{7056.js → 1572.js} +2 -2
  7. package/1572.js.map +1 -0
  8. package/1584.js +1 -1
  9. package/1664.js +1 -1
  10. package/1707.js +1 -1
  11. package/1790.js +1 -1
  12. package/1840.js +1 -1
  13. package/1946.js +1 -1
  14. package/2066.js +1 -1
  15. package/2201.js +1 -1
  16. package/2400.js +1 -1
  17. package/2463.js +1 -1
  18. package/2579.js +1 -1
  19. package/2641.js +1 -1
  20. package/2775.js +1 -1
  21. package/3096.js +1 -1
  22. package/3123.js +1 -1
  23. package/3348.js +1 -1
  24. package/3358.js +1 -1
  25. package/3383.js +1 -1
  26. package/3424.js +1 -1
  27. package/3463.js +1 -1
  28. package/3469.js +1 -1
  29. package/3538.js +1 -1
  30. package/356.js +1 -1
  31. package/3603.js +1 -1
  32. package/3875.js +1 -1
  33. package/3879.js +1 -1
  34. package/3902.js +1 -1
  35. package/3926.js +1 -1
  36. package/4212.js +1 -1
  37. package/4390.js +1 -1
  38. package/4426.js +1 -1
  39. package/4703.js +1 -1
  40. package/4806.js +1 -1
  41. package/4826.js +1 -1
  42. package/50.js +1 -1
  43. package/5108.js +1 -1
  44. package/5171.js +1 -1
  45. package/527.js +1 -1
  46. package/5617.js +1 -1
  47. package/584.js +1 -1
  48. package/6020.js +1 -1
  49. package/6287.js +1 -1
  50. package/6606.js +1 -1
  51. package/673.js +1 -1
  52. package/6799.js +1 -1
  53. package/68.js +1 -1
  54. package/6844.js +1 -1
  55. package/6853.js +1 -1
  56. package/6860.js +1 -1
  57. package/6903.js +1 -1
  58. package/7293.js +1 -1
  59. package/735.js +1 -1
  60. package/7422.js +1 -1
  61. package/7436.js +1 -1
  62. package/764.js +1 -1
  63. package/7829.js +1 -1
  64. package/7896.js +1 -1
  65. package/8075.js +1 -1
  66. package/820.js +1 -1
  67. package/8207.js +1 -1
  68. package/8322.js +1 -1
  69. package/8360.js +1 -1
  70. package/8565.js +1 -1
  71. package/8741.js +1 -1
  72. package/9016.js +1 -1
  73. package/9251.js +1 -1
  74. package/9283.js +1 -1
  75. package/9309.js +1 -1
  76. package/9328.js +1 -1
  77. package/9383.js +1 -1
  78. package/9397.js +1 -1
  79. package/9470.js +1 -1
  80. package/9622.js +1 -1
  81. package/9719.js +1 -1
  82. package/9736.js +1 -1
  83. package/9854.js +1 -1
  84. package/9861.js +1 -1
  85. package/987.js +1 -1
  86. package/9960.js +1 -1
  87. package/main.js +1 -1
  88. package/package.json +1 -1
  89. package/remoteEntry.js +1 -1
  90. package/remoteEntry.js.map +1 -1
  91. package/7056.js.map +0 -1
package/9383.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1330e4d9-2502-4c2e-8e78-4ed96a9f9721",e._sentryDebugIdIdentifier="sentry-dbid-1330e4d9-2502-4c2e-8e78-4ed96a9f9721")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1601"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9383],{6391:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Hs,IL3:()=>pT,PY2:()=>vt,Ng6:()=>Me,YJ7:()=>Ne,NlI:()=>Ee,XYV:()=>ge,Xt7:()=>Ce,wfT:()=>sr,EMD:()=>Qt,HAc:()=>Le,PEf:()=>Pt,oA3:()=>Kt,$XE:()=>et,eWf:()=>At,q7e:()=>je,KVe:()=>lr,WVQ:()=>Ti,oZZ:()=>Tr,bNA:()=>Er,Rjq:()=>mr,G39:()=>St,W0P:()=>ut,X1H:()=>ot,hdG:()=>dt,ws7:()=>yt,VI$:()=>pt,yn8:()=>Qe,N0y:()=>Ke,dZX:()=>tt,bQt:()=>br,oS0:()=>Et,KfU:()=>De,bZE:()=>Oe,Nsj:()=>Se,psV:()=>Ae,xPW:()=>gt,pyR:()=>rr,p8l:()=>zt,Wkf:()=>Ue,zHr:()=>Ie,NIO:()=>we,$26:()=>E_,s9T:()=>He,MEy:()=>ju,j5E:()=>Te,vAw:()=>Jt,NMQ:()=>Ht,eVu:()=>ec,YGb:()=>lt,Y1q:()=>Th,RgZ:()=>Zt,Qy0:()=>hr,Q26:()=>Re,pYu:()=>Wt,wIJ:()=>N_,GFH:()=>$e,Ury:()=>wt,S91:()=>It,wSh:()=>te,BDP:()=>ji,pGS:()=>tr,ARY:()=>mt,XGc:()=>or,fO_:()=>jt,wwy:()=>We,h_8:()=>Ct,_XL:()=>Pe,j2V:()=>ur,dMV:()=>ir,xYD:()=>ft,OXy:()=>ht,BXd:()=>Xe,KM9:()=>Fe,lXI:()=>it,C68:()=>Rt,Yj_:()=>Ye,D25:()=>Ge,ZIY:()=>rt,Tl4:()=>C_,lwr:()=>Nt,NkU:()=>cr,Rtp:()=>ar,YGx:()=>ze,uTS:()=>nr,MCv:()=>ke,IYE:()=>Xt,PiC:()=>fr,MVv:()=>ct,Q_m:()=>vr,h_m:()=>at,DUe:()=>ve,tJI:()=>xe,fDt:()=>Ve,cNQ:()=>pr,SwE:()=>Yt,ZHR:()=>yr,PYu:()=>st,lD1:()=>Ut,lVm:()=>Ze,vnX:()=>$g,$x5:()=>Vg,_R1:()=>Mg,wUm:()=>xg,dC6:()=>Je,MBD:()=>Be,GmF:()=>ya,cKm:()=>nt,iP_:()=>_t,NVC:()=>qe,tPT:()=>vl,tZe:()=>ST,kRE:()=>em,psB:()=>tm,X0$:()=>Ol,$vY:()=>bl,zE1:()=>Ul,Wm5:()=>ul,vyX:()=>Fc,wLZ:()=>gl,W4V:()=>ue,EtK:()=>Ss,ayi:()=>hl,asT:()=>jN,kGs:()=>Wh,RLE:()=>Dv,ewt:()=>Nd,O_f:()=>Ru,sOy:()=>sn,kP7:()=>Cv,Tde:()=>Hn,LMI:()=>bc,skb:()=>vA,sPt:()=>cc,sH1:()=>pc,lPZ:()=>Jy,bG8:()=>Hy,_LJ:()=>Ky,RPM:()=>Xd,h27:()=>Ic,Uqd:()=>kc,xG:()=>LA,Z2f:()=>zv,fgW:()=>tA,I69:()=>PA,ZxB:()=>SA,dwd:()=>qy,F$g:()=>Yy,mdt:()=>ob,Qbq:()=>Sh,rny:()=>Qi,UEY:()=>La,Q0T:()=>Da,Lyr:()=>Va,sBn:()=>Ca,itK:()=>Sa,H9$:()=>Ua,KPc:()=>Ia,zos:()=>wa,ELQ:()=>Ga,dZs:()=>ha,Cz4:()=>ma,z_L:()=>xa,fGe:()=>Ea,iuF:()=>Pa,Wib:()=>Ra,Hn0:()=>$a,obS:()=>Ba,E$L:()=>ba,XUh:()=>Na,Qp_:()=>_a,_jk:()=>Oa,sKE:()=>va,WmG:()=>Aa,QKx:()=>Fa,Oik:()=>ka,s0A:()=>ga,o9m:()=>ja,MCd:()=>Ma,RsS:()=>Uc,tGK:()=>Zl,lIv:()=>Cl,Vg3:()=>na,mkC:()=>Wi,xv5:()=>aa,a14:()=>qi,yv0:()=>ia,Zm0:()=>Yi,Nxd:()=>Bi,$mM:()=>ra,ifj:()=>mi,NWi:()=>Og,xr3:()=>bg,wNf:()=>du,iJH:()=>vg,KB$:()=>NN,d89:()=>$i,Edd:()=>Vi,Z5t:()=>Gi,uGe:()=>Fi,UoR:()=>ki,xvW:()=>hg,$qe:()=>mg,yPM:()=>Ta,$cp:()=>Il,vKJ:()=>Sl,VtG:()=>Of,AID:()=>eh,B1H:()=>gN,b7X:()=>Nh,$uE:()=>Hh,keo:()=>Rh,C_p:()=>Fy,G27:()=>pO,O8b:()=>zy,JA0:()=>BE,b3T:()=>Bh,oC6:()=>Vh,_Zs:()=>Gh,epC:()=>Kh,YYG:()=>Jh,f_2:()=>YE,w3l:()=>iN,QHB:()=>cO,Jso:()=>pN,RXH:()=>Kb,Vr9:()=>OO,lMm:()=>hv,BlA:()=>qN,fmQ:()=>Os,yRD:()=>YA,NcL:()=>By,QK6:()=>Pr,ymd:()=>cT,JV_:()=>hm,XiW:()=>Jp,Yrx:()=>IE,BiY:()=>wp,GPx:()=>ml,gjI:()=>El,vlo:()=>Bd,E_P:()=>eb,aAL:()=>Xf,NBq:()=>vs,wp9:()=>ab,DsR:()=>Yf,MPc:()=>Lp,gWE:()=>jp,DT_:()=>kp,ipn:()=>Mp,ORg:()=>Ui,_wz:()=>Fp,RYR:()=>cd,PP2:()=>jE,wS7:()=>lg,cBQ:()=>wf,pBq:()=>Mm,DsO:()=>re,X78:()=>Om,xZs:()=>fm,YFy:()=>CE,Gmt:()=>am,K$w:()=>im,DSj:()=>zf,Mfr:()=>DE,k9j:()=>Uf,EjS:()=>Z,ww$:()=>_l,WVU:()=>nm,hxF:()=>pl,n6p:()=>Ip,E7G:()=>Pp,nwO:()=>XN,Mzk:()=>_f,aFF:()=>Lh,HRH:()=>Mu,EZK:()=>Kc,Kxm:()=>Yc,Z9i:()=>Ty,CrF:()=>QE,DNd:()=>Ya,vUy:()=>$N,lJh:()=>Gu,zHo:()=>Bu,UO$:()=>Wm,zeJ:()=>Zn,dLR:()=>Cs,JQy:()=>Ws,XtP:()=>Is,Ug0:()=>_i,A1W:()=>Ph,sw:()=>Jc,nv3:()=>wg,JgD:()=>Sg,SkP:()=>Ys,SAs:()=>$m,i5L:()=>qs,PWK:()=>Yo,IM5:()=>Us,Aup:()=>bO,Mfk:()=>vv,HQx:()=>as,oN$:()=>is,mB6:()=>tg,p6d:()=>U,o0x:()=>D,ufS:()=>Gv,k7L:()=>Bv,ped:()=>PN,mrB:()=>C,OuZ:()=>Qc,ncP:()=>en,FQ2:()=>Xc,W$R:()=>zc,JOV:()=>Jr,Zmi:()=>Kr,hm5:()=>Xr,ECL:()=>ru,vPL:()=>Zc,qmL:()=>fh,hPi:()=>km,hXd:()=>zi,OCS:()=>Zi,p2l:()=>Ks,qF1:()=>dT,_X$:()=>yT,bzh:()=>ub,k66:()=>ts,kiP:()=>Eo,pSg:()=>de,kz_:()=>xE,H_U:()=>ns,t9e:()=>za,j2$:()=>wT,PFL:()=>kn,aJ3:()=>s_,To9:()=>Jn,wpo:()=>bp,ADq:()=>cy,UUb:()=>ly,tQX:()=>uy,xy8:()=>$n,EUG:()=>ei,AFK:()=>yn,X3M:()=>zn,WN0:()=>rs,kDl:()=>Ds,uDV:()=>yh,IhQ:()=>xs,pfb:()=>Vs,R$r:()=>Zh,w80:()=>Co,Pfu:()=>Qa,Gtj:()=>Wl,fyF:()=>Bl,kkq:()=>es,u5q:()=>tn,O$n:()=>mp,ptG:()=>hp,f4_:()=>hb,uap:()=>mb,d7q:()=>wE,liG:()=>kE,$oF:()=>SE,avf:()=>Dd,DiQ:()=>Cd,cfX:()=>Ud,vD3:()=>jd,Qrb:()=>Id,EJQ:()=>Ld,HWy:()=>wd,gjS:()=>yd,y6v:()=>Sd,JUW:()=>qE,GtP:()=>Ub,_kX:()=>Ha,u1e:()=>Ja,sJj:()=>Uh,CJp:()=>wb,uKF:()=>Ih,wo0:()=>ZE,s5:()=>Jo,cwx:()=>Ho,Y6b:()=>hE,TTx:()=>cm,UtR:()=>bE,HaQ:()=>pm,E6I:()=>KE,Won:()=>vE,vTU:()=>EE,Nsy:()=>sp,KMQ:()=>Dh,Do$:()=>pp,CSV:()=>zs,TMe:()=>OE,l1V:()=>Yu,RHh:()=>Zu,VQ1:()=>Xu,cGG:()=>Qu,z7d:()=>Wd,Xaq:()=>ls,Sj8:()=>WN,PJj:()=>Ql,k3T:()=>Ni,PjQ:()=>Di,s7l:()=>ff,jLA:()=>Cb,BoX:()=>ti,GGR:()=>xd,j5q:()=>Fd,DnY:()=>pf,RY5:()=>sh,Px$:()=>pd,KPC:()=>bN,NIY:()=>vf,HvW:()=>Ef,Fof:()=>Za,BXy:()=>mf,fX:()=>Db,BTI:()=>yp,uie:()=>rp,q27:()=>vp,vrC:()=>DO,fAQ:()=>Am,XkT:()=>cf,lrH:()=>Nm,nt9:()=>hi,XH8:()=>Ep,XH2:()=>Ai,jFi:()=>Tp,qhs:()=>Uo,GBJ:()=>Af,wwR:()=>dp,Uk3:()=>fn,$Rg:()=>gn,ev7:()=>_N,RB9:()=>GE,iFp:()=>Zd,e$p:()=>ty,PcX:()=>ry,SpP:()=>ey,R6_:()=>u_,CY1:()=>m_,Ajk:()=>af,Yiz:()=>nf,FK9:()=>Xy,UOo:()=>Wv,aTW:()=>lm,uug:()=>pu,P$2:()=>O_,XS2:()=>nu,Hyb:()=>_u,d3Y:()=>Vc,Klp:()=>Bc,WxZ:()=>v_,Gzu:()=>Wu,ZOr:()=>uf,uqV:()=>yE,Pm4:()=>ie,hWO:()=>cn,nHA:()=>vb,nVD:()=>uh,_tF:()=>nc,dED:()=>PE,P2h:()=>NE,jrr:()=>po,mmY:()=>fo,T6O:()=>os,h6J:()=>NT,hM2:()=>fN,XR6:()=>ee,jmz:()=>dh,IHt:()=>ph,NZI:()=>fy,wdF:()=>gm,YNv:()=>Ah,IFm:()=>_h,o_F:()=>mh,kgP:()=>_m,ZYI:()=>oT,QXK:()=>xl,efz:()=>$l,Q5d:()=>Ml,Ysv:()=>Vl,UWq:()=>Hd,ocC:()=>qd,io3:()=>vi,Sbt:()=>Lo,roS:()=>Do,Ww1:()=>jo,QaS:()=>Nf,wsP:()=>Ir,ERZ:()=>rN,CL1:()=>TN,idV:()=>Hc,nIW:()=>un,x7Y:()=>A,fjE:()=>c_,sG0:()=>Hv,tV7:()=>Xl,g8o:()=>I_,Qy:()=>w_,t2P:()=>o_,KbW:()=>vo,wId:()=>_o,TAC:()=>AN,LS0:()=>Ao,bFH:()=>eE,Rgl:()=>rE,fW1:()=>cb,GFW:()=>dm,Ywp:()=>Lg,pg:()=>kT,WSA:()=>nE,ffJ:()=>jv,gEI:()=>Fv,fed:()=>dN,tT_:()=>$s,BgZ:()=>Gs,xIV:()=>Bs,KbL:()=>yf,JBA:()=>hn,aNC:()=>Rg,RFJ:()=>aT,Zeh:()=>Bm,OT5:()=>Dg,mC3:()=>Ll,kR6:()=>YN,gFw:()=>bb,NVY:()=>nb,k6v:()=>fT,FEC:()=>TT,L5S:()=>tb,Ob5:()=>gp,KUV:()=>_p,dvH:()=>rb,V3i:()=>_O,VD3:()=>gi,mm2:()=>Ku,rou:()=>Cm,izH:()=>Ka,DK$:()=>Xa,KMp:()=>Qf,c31:()=>Nn,mbo:()=>dy,gT8:()=>Sn,CZ8:()=>hs,uGi:()=>As,Poc:()=>_n,_9k:()=>Rs,ZTM:()=>gs,bwT:()=>Ns,tF$:()=>Rn,o96:()=>bs,M4S:()=>Ps,_vs:()=>Bf,xF8:()=>fd,PUO:()=>jh,ATu:()=>py,j1S:()=>wi,V3K:()=>Ri,Lmx:()=>Si,oSN:()=>Li,ZaZ:()=>An,n_1:()=>TE,N6e:()=>Hf,SxO:()=>yo,w3p:()=>ib,xU7:()=>Ar,hAq:()=>_r,Y_p:()=>Mo,$k6:()=>Fo,Gdl:()=>Kv,U6P:()=>Jv,OwB:()=>l_,hTh:()=>ch,xqc:()=>Ko,JvE:()=>Qo,i29:()=>Nc,dzT:()=>Ji,uPS:()=>Sf,cZV:()=>Rf,n3B:()=>lA,e6O:()=>rA,s7j:()=>A_,j$Q:()=>HE,PeS:()=>Py,kW2:()=>Ib,tH7:()=>qo,Yxg:()=>nl,bOT:()=>kv,MaZ:()=>Md,nqN:()=>kd,jWj:()=>Kd,o_J:()=>us,yW4:()=>PT,uT0:()=>_T,C82:()=>AT,bsH:()=>Ob,u9Z:()=>Um,LCU:()=>ym,J$m:()=>fE,j_Q:()=>Zy,OaI:()=>ef,wB1:()=>vN,SP6:()=>jT,ZYr:()=>hN,IMU:()=>iT,FoU:()=>WE,DVz:()=>eg,mxe:()=>oA,FHr:()=>Vm,D1g:()=>Dm,VO3:()=>Yg,de5:()=>Wg,Uw1:()=>wr,J6q:()=>yy,XCe:()=>lo,fbl:()=>jg,Ir:()=>bo,XQO:()=>Oo,QXb:()=>HT,zXF:()=>Eh,P8_:()=>Em,iiD:()=>Kf,MOC:()=>JT,WF:()=>qT,xE1:()=>Ci,idW:()=>DN,QWZ:()=>Nv,YL3:()=>gf,NW9:()=>Vv,D_E:()=>Nr,Fn9:()=>T,j2U:()=>Js,MpE:()=>Un,kQw:()=>Mn,mfm:()=>Au,vZp:()=>Tn,Wah:()=>my,E8K:()=>wN,VSb:()=>Es,vr_:()=>Fn,Vmh:()=>xN,FgW:()=>gO,oDv:()=>ps,fGG:()=>Pv,kuw:()=>ys,eHk:()=>Jd,Tt2:()=>cs,pQZ:()=>fs,oZ7:()=>Rv,T6Y:()=>ci,VRd:()=>On,_26:()=>Ou,YkM:()=>qn,J6y:()=>ou,njU:()=>fu,TBP:()=>ds,IT0:()=>Ey,x_:()=>Ch,FP6:()=>vn,biM:()=>up,TMl:()=>cp,Vkd:()=>mu,WiY:()=>f_,_zi:()=>hu,RZp:()=>Wy,J6D:()=>Ju,Lt4:()=>ii,QEi:()=>Qn,whI:()=>Ft,KIu:()=>xt,JhM:()=>le,C_0:()=>yi,lzc:()=>Np,qIF:()=>uA,O27:()=>E,aBi:()=>Op,xOX:()=>ll,EdS:()=>an,WgC:()=>nn,eEv:()=>Ln,A4t:()=>Tu,YOQ:()=>mn,Wos:()=>li,jWr:()=>Wa,Or$:()=>Yn,lhE:()=>Oi,CwH:()=>Kn,pzC:()=>al,ymH:()=>yu,QZu:()=>Bn,rYH:()=>y_,FVt:()=>si,Kn2:()=>pe,jgw:()=>Nu,Qgr:()=>Hu,OXP:()=>Ts,nsY:()=>ay,vyG:()=>ny,lS4:()=>Xn,g5f:()=>T_,fp6:()=>uu,Uty:()=>la,YkG:()=>Wn,xdS:()=>wn,kMF:()=>xp,$NE:()=>on,bC9:()=>rn,Ian:()=>Ii,KVV:()=>wh,q9e:()=>ko,iIf:()=>Qv,ian:()=>dl,m6e:()=>fi,OFd:()=>ol,kqr:()=>xn,fnZ:()=>kt,VFZ:()=>yl,ZiX:()=>zr,j5n:()=>ai,zkt:()=>N,Pcm:()=>ON,QDV:()=>il,M5u:()=>d_,laD:()=>sA,mtq:()=>Dn,CtB:()=>Xv,CBv:()=>se,I0t:()=>di,u1G:()=>Gd,gk1:()=>iA,Bgb:()=>nA,uzs:()=>Mt,v0l:()=>sc,Zqp:()=>gE,j0k:()=>Bo,l22:()=>KN,tCm:()=>dn,gmx:()=>iu,mOr:()=>ku,TwZ:()=>U_,GyU:()=>Ig,zGm:()=>xT,bMg:()=>sE,EyD:()=>Tg,FQA:()=>Eg,fZN:()=>cE,xsF:()=>yg,Lxg:()=>fg,O3l:()=>Df,Wni:()=>Cf,wRx:()=>_g,OxG:()=>XT,Jwg:()=>KT,uJQ:()=>QT,qWg:()=>Zv,i96:()=>FT,NPd:()=>Vu,MrZ:()=>Wo,zhn:()=>gg,G8q:()=>Or,Jct:()=>ad,A9Y:()=>ne,Y5F:()=>JA,gxP:()=>ce,c$P:()=>au,M7o:()=>jc,BBN:()=>co,fS6:()=>Ad,ZBU:()=>z,UkJ:()=>No,xkv:()=>Tm,z$M:()=>LN,KAm:()=>VE,lCl:()=>th,rkF:()=>My,IU6:()=>LT,RGr:()=>h,aYu:()=>m,ije:()=>Jl,Buf:()=>Jf,YLu:()=>Hl,ct9:()=>$o,XkY:()=>lE,T5R:()=>$T,uQS:()=>pE,wcJ:()=>xo,d$I:()=>Al,rSp:()=>lp,Sx:()=>bf,Ilm:()=>Dl,Ki6:()=>cl,VGk:()=>Wf,sFD:()=>Qb,eWN:()=>kN,dWE:()=>__,Lkd:()=>Kp,aDL:()=>Ym,yaA:()=>dE,lOh:()=>jm,DBr:()=>n_,hK$:()=>zl,uKH:()=>Lv,TZ_:()=>DT,CMB:()=>cA,FU8:()=>hf,J$p:()=>Km,b5s:()=>Jm,h2W:()=>pn,SL_:()=>Sm,oUH:()=>OT,ck9:()=>VT,RAb:()=>rc,nL:()=>qv,k$p:()=>zb,Xs0:()=>ql,u7I:()=>Lm,rxg:()=>wu,bji:()=>Iu,oCZ:()=>Dy,MjG:()=>Bg,FuV:()=>bT,$ju:()=>gT,t6d:()=>vT,m5F:()=>Sr,sx:()=>FN,rSc:()=>rg,U10:()=>tf,L8n:()=>rm,R9X:()=>mE,rj2:()=>bm,_C4:()=>IT,tCj:()=>mm,uAg:()=>UE,wx9:()=>Pd,KF3:()=>UT,ax9:()=>CT,HH7:()=>qf,ufV:()=>LE,_6y:()=>If,XTh:()=>Fg,AJo:()=>Pf,Ixr:()=>JE,oss:()=>QN,P6Y:()=>zN,q5j:()=>Ry,Bd_:()=>wy,xkB:()=>Sy,W41:()=>Im,WkI:()=>wm,sSE:()=>Ny,GMd:()=>Oc,jtL:()=>vc,Bxm:()=>Uy,FVh:()=>Oy,inb:()=>Cg,U_T:()=>iE,FTe:()=>oe,VGB:()=>ae,tM8:()=>Uu,Wfe:()=>$u,Ls5:()=>xu,$bd:()=>Du});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>_,durationToTimestamp:()=>Z,formatDate:()=>U,formatDateTime:()=>D,formatTime:()=>C,getEndOfDay:()=>I,getLocaleFormat:()=>A,getMomentFormatFromDateMask:()=>J,getMomentFormatFromDateTimeMask:()=>X,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>w,isDateInRange:()=>v,isToday:()=>N,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>g,parseTimestamp:()=>z,toLocalDate:()=>P,toUtcDate:()=>R});var a={};r.r(a),r.d(a,{addAttribute:()=>Lr,editAttribute:()=>jr,editEndDate:()=>Vr,editRoles:()=>Mr,editStartDate:()=>$r,editTags:()=>xr,removeAttribute:()=>Fr});var o={};r.r(o),r.d(o,{EventType:()=>Fh,applyCrosswalks:()=>Wh,collectCrosswalksFromAttributes:()=>Hh,compareActivenessAttributes:()=>Bh,compareAttributes:()=>Vh,compareImages:()=>Gh,compareRoles:()=>Kh,compareTags:()=>Jh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>zh});var l=r(50914);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=(e,t)=>r=>!!(0,l.isNil)(r)||f()(r).isBetween(e,t,"days","[]"),g=e=>e&&e.toDate(),_=e=>(e&&e.setHours(0,0,0,0),e),A=()=>`${f().localeData().longDateFormat("L")} ${f().localeData().longDateFormat("LTS")}`,N=e=>f()(e).isSame(Date.now(),"day"),P=e=>{const t=new Date(e),r=new Date("2023-01-05");return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},R=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},S=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),w=S("startOf"),I=S("endOf"),U=e=>f()(e).format(f().localeData().longDateFormat("L")),C=e=>f()(e).format(f().localeData().longDateFormat("LTS")),D=e=>`${U(e)} ${C(e)}`,L=(0,l.equals)("9"),j=(0,l.equals)("99"),k=(0,l.equals)("9999"),F=(0,l.test)(/^[az][az][az]$/),M=(0,l.test)(/^[az][az][az][az]$/),x=(0,l.test)(/^9+$/),$=(0,l.test)(/^[9az]+$/),V=(0,l.cond)([[L,(0,l.always)("M")],[j,(0,l.always)("MM")],[F,(0,l.always)("MMM")],[M,(0,l.always)("MMMM")],[$,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),G=(0,l.cond)([[L,(0,l.always)("D")],[j,(0,l.always)("DD")],[$,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),B=(0,l.cond)([[L,(0,l.always)("y")],[j,(0,l.always)("YY")],[k,(0,l.always)("YYYY")],[x,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),W=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),L),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),j),(0,l.always)("hh")],[L,(0,l.always)("H")],[j,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),Y=(0,l.cond)([[L,(0,l.always)("m")],[j,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),q=(0,l.cond)([[L,(0,l.always)("s")],[j,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),H=/([9az]+)([^9az]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[V(e),r,G(n),i,B(a),o])}return e},K=/(9+)([^9]+)*/g,Q=e=>{const t=[...e.toLowerCase().matchAll(K)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[W(e,s),r,Y(n),i,a?q(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},X=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${J(t)} ${Q(r)}`},z=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Z=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},ee=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt(0))).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class te{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?te.None():te.Some(e(this.value))}static Some(e){return new te(e)}static None(){return new te(null)}static fromFalsy(e){return e?te.Some(e):te.None()}static fromNull(e){return(e=>null==e)(e)?te.None():te.Some(e)}static fromUndefined(e){return void 0===e?te.None():te.Some(e)}static fromEmpty(e){return E(e)?te.None():te.Some(e)}}const re=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},ne=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ie=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ae=e=>Array.isArray(e)?e:[e],oe=e=>[e],se=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),le=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),ue=e=>le(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ce=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),pe=e=>null!=e&&["object","function"].includes(typeof e),de=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),pe(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var ye=r(2507),fe=r.n(ye);const Te={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},Ee={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},me={[Te.EQUALS]:"equals",[Te.NOT_EQUALS]:"not",[Te.STARTS_WITH]:"starts with",[Te.MISSING_VALUE]:"missing value",[Te.IN_RANGE]:"in range",[Te.HAS_ALL]:"has all",[Te.FULL_TEXT]:"full text",[Te.EXISTS]:"exists",[Te.COUNT_EQUALS]:"count equals",[Te.COUNT_NOT_EQUALS]:"count not equal",[Te.COUNT_LT]:"count less",[Te.COUNT_LTE]:"count less or equal",[Te.COUNT_GT]:"count greater",[Te.COUNT_GTE]:"count greater or equal",[Te.COUNT_RANGE]:"count in range",[Te.LT]:"less than",[Te.LTE]:"less than or equal",[Te.GT]:"greater than",[Te.GTE]:"greater than or equal",[Te.IN_FILE]:"in file",[Te.NOT_IN_FILE]:"not in file",[Te.CONTAINS]:"contains",[Te.ON]:"on",[Te.BEFORE]:"before",[Te.AFTER]:"after",[Te.WITHIN]:"within"};var he;!function(e){e.IN="in",e.NOT_IN="notIn",e.NOT_IN_RANGE="not range"}(he||(he={}));const be=e=>({[he.IN]:Te.EQUALS,[he.NOT_IN]:Te.NOT_EQUALS}[e]||e);var Oe,ve;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(Oe||(Oe={})),function(e){e.LAST_3DAYS="last3Days"}(ve||(ve={}));const ge=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Oe[t]||ve[t],e)),{}),_e={[Oe.LAST_DAY]:"Last 24 hours",[ve.LAST_3DAYS]:"Last 3 days",[Oe.LAST_WEEK]:"Last 7 days",[Oe.LAST_MONTH]:"Last month",[Oe.LAST_6MONTHS]:"Last 6 months",[Oe.LAST_YEAR]:"Last year",[Oe.PICK_DATE]:"Pick date"},Ae={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Ne={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Pe="<No label>",Re="__number";var Se;let we,Ie,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ve,Ge,Be,We,Ye,qe,He,Je,Ke,Qe,Xe,ze,Ze,et,tt,rt,nt,it,at,ot,st,lt,ut,ct,pt,dt,yt,ft;var Tt;!function(e){e.IN="in",e.OUT="out"}(Se||(Se={})),function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(we||(we={})),function(e){e.local="local",e.validationService="validationService"}(Ie||(Ie={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Ue||(Ue={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Ce||(Ce={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(De||(De={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Le||(Le={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(je||(je={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(ke||(ke={})),function(e){e.asc="asc",e.desc="desc"}(Fe||(Fe={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Me||(Me={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(xe||(xe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}($e||($e={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Ve||(Ve={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ge||(Ge={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Be||(Be={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(We||(We={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ye||(Ye={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(qe||(qe={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(He||(He={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Je||(Je={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Ke||(Ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Qe||(Qe={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Xe||(Xe={})),function(e){e.IN="in",e.OUT="out"}(ze||(ze={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ze||(Ze={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(et||(et={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(tt||(tt={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(rt||(rt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(nt||(nt={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting",e.DCRReview="DCRReview"}(it||(it={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(at||(at={})),function(e){e.NEW="new",e.CLASSIC="classic"}(ot||(ot={})),function(e){e.ASC_BY_NAME="ascByName"}(st||(st={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(lt||(lt={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(ut||(ut={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(ct||(ct={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(pt||(pt={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(dt||(dt={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(yt||(yt={})),function(e){e.percent="percent"}(ft||(ft={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Tt||(Tt={}));const Et=Tt;let mt,ht;function bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ot(e,t,r[t])}))}return e}function Ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(mt||(mt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(ht||(ht={}));const vt={startDate:{type:Et.TYPE_ACTIVENESS_DATE,get label(){return fe().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Et.TYPE_ACTIVENESS_DATE,get label(){return fe().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},gt=bt({id:{type:Et.TYPE_ENTITY_ID,get label(){return fe().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},vt,{roles:{type:Et.TYPE_STRING,get label(){return fe().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Et.TYPE_STRING,get label(){return fe().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),_t={workflow:{type:Et.TYPE_STRING,get label(){return fe().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Et.TYPE_STRING,get label(){return fe().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Et.TYPE_STRING,get label(){return fe().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},At={commenter:{type:Et.TYPE_STRING,get label(){return fe().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Nt={notResolved:{type:Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return fe().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Pt={createdBy:{type:Et.TYPE_STRING,get label(){return fe().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Et.TYPE_STRING,get label(){return fe().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Rt={matches:{type:Et.TYPE_COUNT,get label(){return fe().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Et.TYPE_COUNT,get label(){return fe().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0},relevanceScore:{type:Et.TYPE_FLOAT,get label(){return fe().text("Relevance scores")},uri:"relevanceScore",name:"relevanceScores.relevance",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchAction:{type:Et.TYPE_STRING,get label(){return fe().text("Match action")},uri:"matchAction",name:"relevanceScores.actionLabel",singleValue:!0,hideForDataTenant:!0,faceted:!0}},St={sourceSystems:{type:Et.TYPE_STRING,get label(){return fe().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Et.TYPE_STRING,get label(){return fe().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Et.TYPE_INT,get label(){return fe().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Et.TYPE_STRING,get label(){return fe().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let wt;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(wt||(wt={}));const It={[wt.matchRules]:{type:Et.TYPE_STRING,get label(){return fe().text("Match Rules")},uri:wt.matchRules,name:wt.matchRules,faceted:!0,hideForDataTenant:!0},[wt.MLRecommendedMatch]:{type:Et.TYPE_STRING,get label(){return fe().text("Match IQ")},uri:wt.MLRecommendedMatch,name:wt.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Ut=bt({},gt,_t,At,Nt,Pt,Rt,St,It,{type:{type:Et.TYPE_STRING,get label(){return fe().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Ct="NOT_MATCH";var Dt=r(13980),Lt=r.n(Dt);const jt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},kt=(0,l.equals)(jt.SUGGESTING),Ft=(0,l.equals)(jt.EDITING),Mt=(0,l.equals)(jt.VIEWING),xt=(0,l.either)(Ft,kt);function $t(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vt(e,t,r[t])}))}return e}function Vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=Lt().oneOf(["mobile","tablet","desktop"]),Bt=Lt().shape({deviceTypes:Lt().oneOfType([Gt,Lt().arrayOf(Gt)]),roles:Lt().arrayOf(Lt().string)}),Wt=Lt().shape({value:Lt().string,lookupCode:Lt().string}),Yt=Lt().shape({displayName:Lt().string,parent:Lt().string}),qt=Lt().oneOfType([Lt().string,Lt().number,Lt().bool,Wt]),Ht=Lt().oneOfType([qt,Lt().arrayOf(qt)]),Jt=Lt().shape({fieldName:Lt().string,values:Lt().arrayOf(Ht),filter:Lt().string,type:Lt().string}),Kt=Lt().shape({minValue:Lt().number,maxValue:Lt().number}),Qt=Lt().shape({label:Lt().string,name:Lt().string,description:Lt().string,type:Lt().string,hidden:Lt().bool,faceted:Lt().bool,searchable:Lt().bool,uri:Lt().string,access:Lt().arrayOf(Lt().string),cardinality:Kt}),Xt=Lt().shape({label:Lt().string,uri:Lt().string,typeColor:Lt().string,direction:Lt().string,startObject:Lt().object,endObject:Lt().object}),zt=Lt().shape({typeColor:Lt().string,typeIcon:Lt().string,typeImage:Lt().string,label:Lt().string,uri:Lt().string,attributes:Lt().arrayOf(Qt)}),Zt=Lt().shape({uri:Lt().string,label:Lt().string,memberTypes:Lt().array,extendsTypeUri:Lt().string,attributes:Lt().arrayOf(Qt)}),er=Lt().shape({uri:Lt().string,label:Lt().string,extendsTypeUri:Lt().string,relationshipTypeURIs:Lt().arrayOf(Lt().string)}),tr=Lt().shape({uri:Lt().string,description:Lt().string,label:Lt().string,schemaVersion:Lt().string,entityTypes:Lt().arrayOf(zt),roles:Lt().arrayOf(Lt().object),groupTypes:Lt().arrayOf(Lt().object),relationTypes:Lt().arrayOf(Xt),graphTypes:Lt().arrayOf(er),interactionTypes:Lt().arrayOf(Zt),sources:Lt().arrayOf(Lt().object)}),rr=Lt().shape({uri:Lt().string,type:Lt().string}),nr=Lt().shape({uri:Lt().string,type:Lt().string}),ir=Lt().shape({value:Lt().object,ov:Lt().bool,type:Lt().string,uri:Lt().string}),ar=Lt().shape({refEntity:Lt().oneOfType([Lt().array,Lt().object]),refRelation:Lt().oneOfType([Lt().array,Lt().object]),value:Lt().object,ov:Lt().bool,type:Lt().string,uri:Lt().string}),or=Lt().oneOf((0,l.values)(jt)),sr=Lt().shape({type:Lt().oneOf(Object.values(we)).isRequired,attributeTypeUri:Lt().string.isRequired,parentUri:Lt().string.isRequired,uri:Lt().string,message:Lt().string}),lr={attributeType:Qt,showEmptyEditors:Lt().bool,lazy:Lt().bool,mode:or,metadata:tr,ownError:sr,errors:Lt().arrayOf(sr),crosswalks:Lt().array,onAddAttributes:Lt().func,onAddOneMore:Lt().func,onDeleteAttribute:Lt().func,onChangeAttribute:Lt().func,additionalControlsRenderer:Lt().func,hideDeleteButton:Lt().bool,showNonOv:Lt().bool,state:Lt().oneOf(["deleted","edited"]),expanded:Lt().bool},ur=$t({attributeValue:ir},lr),cr=$t({attributeValue:ar},lr),pr=Lt().shape({value:Lt().oneOfType([Lt().string,Lt().bool,Lt().number]),ov:Lt().bool,type:Lt().string,uri:Lt().string,lookupCode:Lt().string,lookupRawValue:Lt().string}),dr=Lt().shape({inRelations:Lt().arrayOf(Lt().oneOfType([Lt().object,Lt().string])),outRelations:Lt().arrayOf(Lt().oneOfType([Lt().object,Lt().string])),groups:Lt().arrayOf(Lt().string),entityTypes:Lt().arrayOf(Lt().string),nextEntry:Lt().object}),yr=Lt().oneOf(["asc","desc"]),fr=Lt().shape({id:Lt().string,content:dr,allowOnlyCreateNew:Lt().bool,sortColumn:Lt().string,sortOrder:yr,"text-empty":Lt().string,max:Lt().number,icon:Lt().string,caption:Lt().string,canCreate:Bt,canRead:Bt,canUpdate:Bt,canDelete:Bt,editingEnabled:Lt().bool}),Tr=Lt().shape({entityUri:Lt().string,entityType:Lt().string,entityLabel:Lt().string,object:rr}),Er=Lt().shape({relationUri:Lt().string,relationType:Lt().string,relationLabel:Lt().string,direction:Lt().string,object:nr}),mr=Lt().shape({entity:Tr,relation:Er}),hr=Lt().shape({value:Lt().string,isRawFilter:Lt().bool}),br=Lt().shape({id:Lt().string,label:Lt().string,name:Lt().string,availableEntityTypes:Lt().array}),Or=[{label:fe().text("And"),value:"and"},{label:fe().text("Or"),value:"or"},{label:fe().text("And not"),value:"and not"},{label:fe().text("Or not"),value:"or not"}],vr="___!status_code!___",gr=(0,l.when)((0,l.is)(Object),JSON.stringify),_r=e=>{var t;return(null==e?void 0:e[vr])||(null==e||null===(t=e.originalResponse)||void 0===t?void 0:t.status)},Ar=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return fe().text("Bad Request");case 403:return fe().text("Forbidden");case 404:return fe().text("Not Found");case 405:return fe().text("Method Not Allowed");case 408:return fe().text("Request Timeout");case 500:return fe().text("Internal Server Error");case 502:return fe().text("Bad Gateway");case 503:return fe().text("Service Unavailable");case 504:return fe().text("Gateway Timeout");default:return t||fe().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),gr)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,gr]])(e)},Nr=e=>"AbortError"===e.name,Pr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},Rr=/[\n\r%#()<>?[\\\]^`{}|]/g,Sr=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Rr,encodeURIComponent)}`,wr=e=>`data:image/gif;base64,${e}`,Ir=e=>{switch(e){case"minutes":return fe().text("minutes");case"hours":return fe().text("hours");case"days":return fe().text("days");case"weeks":return fe().text("weeks");case"months":return fe().text("months");case"years":return fe().text("years");default:return""}};var Ur=r(76665);function Cr(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${pe(n)?JSON.stringify(n):n}\n `;console.error(i)}const i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Dr(e,t){const r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[];for(let i=0;i<r.length;i+=2)n.push(Cr(r[i],r[i+1],e,t));return n}function Lr(e,t,r,n,i,a,o){void 0===a&&(a=0);const s=Dr(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren)return e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]),Lr(e[s.name].find((function(e){return e.uri===s.valueUri})).value,t,r,n,i,a+1,o);{if(e[s.name]||(e[s.name]=[]),null==n)return;const a=e[t.name],l=n,u=n;let c={value:n.refEntity||pe(l.value)&&!Array.isArray(l.value)?l.value:n,uri:r,type:t.uri};if(n.lookupCode){const e=c,t=n;e.value=t.value,e.lookupCode=t.lookupCode,c=e}if(u.refEntity){const e=c;e.refEntity=u.refEntity,e.label=u.label,c=e}if(u.refRelation){const e=c;e.refRelation=u.refRelation,c=e}return i&&(c.crosswalks=i),a.splice(o||0,0,c),n}}function jr(e,t,r,n,i,a){void 0===a&&(a=0);const o=Dr(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){const o=e[t.name];let s,l=o&&o.find((function(e){return e.uri===r}));if(l){if("[object Object]"!==l.value.toString())kr(n,l),i&&(l.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&o.filter((function(e){return!1===e.ov})).forEach(kr.bind(null,n));else if(function(e){return void 0!==e.refEntity}(n)){const e=l;e.refRelation=n.refRelation,e.refEntity=n.refEntity,e.value=n.value,e.label=n.label,l=e}else null!==n.value&&void 0!==n.value&&null!==l.value&&"object"==typeof l.value&&(l.value=n.value,l.label=n.label);s=l.value}else s=Lr(e,t,r,n,i,a);return s}{const s=jr(e,o,o.valueUri,{},i,a);jr(s,t,r,n,i,a+1)}}function kr(e,t){!function(e){return pe(e)}(e)?(t.value=e,t.lookupCode&&(t.lookupCode=e)):(t.value=e.value,t.lookupCode=e.lookupCode)}function Fr(e,t,r,n){void 0===n&&(n=0);const i=Dr(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){const a=(e[i.name]||[]).find((function(e){return e.uri===i.valueUri}));a&&Fr(a.value,t,r,n+1)}else{const n=e[t.name];n&&(n.forEach((function(e,t){e.uri===r&&n.splice(t,1)})),0===n.length&&delete e[t.name])}}function Mr(e,t){e.roles=t||[]}function xr(e,t){e.tags=t||[]}function $r(e,t){e.startDate=t}function Vr(e,t){e.endDate=t}var Gr=r(37164);const Br="1Tempo4rary",Wr="1Tepmo4Rel",Yr=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),qr=(0,Gr.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Hr=()=>`${qr()}${Date.now()}`,Jr=()=>`1Tempo4DCR${Hr()}`,Kr=e=>`${e}/uri$$${Hr()}`,Qr=e=>()=>Kr(e),Xr=(e,t)=>{const r=Yr(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Kr(n)},zr=e=>e&&e.includes("uri$$"),Zr=Qr("entities"),en=Qr("relations"),tn=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),rn=(0,l.startsWith)("relations/"),nn=(0,l.startsWith)("entities/"),an=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),on=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),sn=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),ln=(0,l.pipe)((0,l.split)("/"),l.head),un=(0,l.pipe)((0,l.split)("/"),l.last),cn=e=>e.split(".").slice(0,2).join("."),pn=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},dn=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),yn=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},fn=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Tn=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),En=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},mn=e=>5===e.split("/").length,hn=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},bn=e=>e.replace(/uri\$\$/g,Br),On=e=>null==e?void 0:e.startsWith("changeRequests/"),vn=e=>On(e)&&e.includes("/changes/"),gn=e=>e.split("/changes/")[1],_n=(0,l.prop)("referencedEntityTypeURI"),An=(0,l.prop)("relationshipTypeURI"),Nn=(0,l.prop)("referencedAttributeURIs"),Pn=(0,l.curry)(((e,t)=>(0,l.pipe)(Nn,(0,l.filter)((0,l.startsWith)(e)))(t))),Rn=Pn("configuration/relationTypes"),Sn=Pn("configuration/entityTypes"),wn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),In=(0,l.filter)(wn),Un=(e,t)=>!t||t.some((t=>sn(e.uri,t)));function Cn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dn=e=>(0,l.allPass)([(0,l.propSatisfies)((0,l.anyPass)([l.isNil,xn,an]),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Et.TYPE_STRING)])(e),Ln=(0,l.has)("values"),jn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Et.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Et.TYPE_LOOKUP)],[Ln,(0,l.always)(Et.TYPE_ENUM)],[Dn,(0,l.always)(Et.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Et.TYPE_BOOLEAN),(0,l.always)(Et.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),kn=(0,l.pipe)((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cn(e,t,r[t])}))}return e}({},e,{type:jn(e)})),(0,l.pick)(["type","values","lookupCode","uri","name","dependentLookupCode","singleValue"])),Fn=e=>!!e&&(!!e.autoGenerated&&e.type!==Et.TYPE_NESTED||!!e.parentAutoGenerated),Mn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),xn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),$n=e=>Mn(e)?"analyticsAttributes":"attributes",Vn=(0,l.propEq)("hidden",!0),Gn=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Bn=Gn(Et.TYPE_NESTED),Wn=Gn(Et.TYPE_REFERENCE),Yn=Gn(Et.TYPE_IMAGE),qn=(0,l.either)(Bn,Wn),Hn=(e,t)=>{const r=Mn(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},Jn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Kn=(0,l.pipe)(Jn,Boolean),Qn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Xn=(0,l.both)(Kn,(0,l.pipe)(Jn,("rdm",(0,l.pipe)(ln,(0,l.equals)("rdm")))));const zn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=$n({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||ei(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Zn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=zn(e,t,r);return n.length?(0,l.last)(n):null},ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",Et.TYPE_NESTED),(0,l.propEq)("type",Et.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Et.TYPE_REFERENCE),(0,l.pipe)(Nn,(0,l.map)((t=>Zn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},ti=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=ei(e,t);return r&&Wn(t)?In(r):r},ri=[Et.TYPE_ACTIVENESS_DATE,Et.TYPE_DATE,Et.TYPE_TIMESTAMP,Et.TYPE_LOCAL_DATE],ni=[Et.TYPE_ACTIVENESS_DATE,Et.TYPE_TIMESTAMP,Et.TYPE_LOCAL_DATE],ii=e=>ri.includes(e),ai=e=>ni.includes(e),oi=[Et.TYPE_INT,Et.TYPE_LONG,Et.TYPE_NUMBER,Et.TYPE_FLOAT,Et.TYPE_DOUBLE,Et.TYPE_COUNT],si=e=>oi.includes(e),li=e=>[Et.TYPE_FLOAT,Et.TYPE_DOUBLE].includes(e),ui=[Et.TYPE_BOOLEAN,Et.TYPE_BOOLEAN_RADIO,Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED],ci=e=>ui.includes(e),pi=[Et.TYPE_URL,Et.TYPE_BLOG_URL,Et.TYPE_IMAGE_URL],di=e=>pi.includes(e),yi=Gn(Et.TYPE_EMAIL),fi=e=>Et.TYPE_SSN===e;var Ti,Ei=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Ti||(Ti={}));const mi=(0,l.curry)(((e,t,r)=>{var n;const i=e===Ti.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),hi=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),bi=(0,l.curry)(((e,t)=>(0,l.pipe)(hi(e),(0,l.prop)("extendsTypeURI"))(t))),Oi=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(bi(e,r)));return n(r)})),vi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=bi(e,n);return r})),gi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?gi(e,hi(e,t.extendsTypeURI),r):void 0,_i=(e,t)=>{const r=t.map(vi(e));return(r.length?r.reduce(l.intersection):[])[0]},Ai=(e,t)=>gi(e,"string"==typeof t?hi(e,t):t,"typeImage"),Ni=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Oi(e,t,n.uri)?r.concat(n.uri):r),[]);function Pi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ri=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Si=(0,l.pipe)(Ri,(0,l.propOr)("","label")),wi=(0,l.curry)(((e,t)=>{const r=Ri(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Ii=(0,l.curry)(((e,t,r)=>{const[n,i]=wi(e,r);return Oi(e,n,t)||Oi(e,i,t)})),Ui=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ci=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Se.OUT:Se.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Se.IN),i=r(Se.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Di=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Li=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Li(e,Ri(e,t.extendsTypeURI),r):void 0;var ji;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(ji||(ji={}));const ki=(0,l.curry)(((e,t)=>e.every((e=>Fi(e,t))))),Fi=(0,l.curry)(((e,t)=>{const r=Fn(t);return Mi(e,t)&&(e===ji.READ||!r)})),Mi=(e,t)=>!t||!t.access||t.access.includes(e),xi=(0,l.curry)(((e,t,r)=>Fi(ji.READ,r)&&(kt(t)?Fi(ji.INITIATE_CHANGE_REQUEST,r):Fi(e,r)))),$i=xi(ji.CREATE),Vi=xi(ji.DELETE),Gi=xi(ji.UPDATE),Bi=ki([ji.CREATE,ji.MERGE,ji.READ,ji.UPDATE]),Wi=ki([ji.UPDATE,ji.READ,ji.CREATE]),Yi=ki([ji.UPDATE,ji.READ]),qi=ki([ji.DELETE,ji.UPDATE,ji.READ]),Hi=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),Ji=(e,t,r)=>(0,l.pipe)((0,l.map)(Hi(e,t)),(0,l.filter)(l.identity))(r),Ki=(e,t,r)=>{const n=Ji(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Fi(ji.MERGE,r)},Qi=(0,l.curry)(((e,t,r,n)=>{const i=Ri(e,n),[a,o]=wi(e,n);return i&&Fi(ji.CREATE,i)&&Oi(e,a,t.type)&&Oi(e,o,r.type)})),Xi=(e,t,r,n,i)=>{const a=hi(e,n.type),o=Ji(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(Qi(e,n,i))||a.some(Qi(e,i,n))}))},zi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=hi(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Ki(o,i,a),canAddRelation:Xi(e,o,i,r,n),canMark:Fi(ji.UPDATE,a)&&Fi(ji.READ,a)}},Zi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>zi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),ea=Mn,ta=(0,l.complement)(ea),ra=Fi(ji.READ),na=e=>{let{attributeType:t,mode:r}=e;return ta(t)&&$i(r,t)&&!Vn(t)},ia=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=zr(r.uri),o=Gi(n),s=$i(n);return(0,l.cond)([[ea,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},aa=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=zr(r.uri),s=Gi(n),u=Vi(n),c=sa(ji.UPDATE,n,a,r),p=sa(ji.DELETE,n,a,r);return(0,l.cond)([[ea,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},oa=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&ei(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!Mi(e,n)||!oa(e,t,r[n.name],n)))))})),sa=(0,l.curry)(((e,t,r,n,i)=>kt(t)?oa(ji.INITIATE_CHANGE_REQUEST,r,n,i):oa(e,r,n,i))),la=(0,l.both)((0,l.complement)(Vn),ra),ua="SuperUser",ca="allTenants",pa=[ca,"allCustomers"],da=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===ua})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===ua){const e=r?pa.concat(r.map((e=>`allTenants.${e}`))):pa,n=r&&t[0]===ca?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},ya={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},fa={[ya.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[ya.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[ya.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[ya.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[ya.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ya.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ya.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ya.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ya.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ya.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ya.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ya.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ya.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ya.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ya.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ya.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ya.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ya.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ya.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ya.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ya.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ya.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ya.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ya.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ya.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ya.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ya.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ya.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ya.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Ta=(0,l.curry)(((e,t,r)=>da({allowedPermissionsNames:e,permissionsNames:ya,permissionsConfig:fa}).some((e=>e(t,{params:{tenant:r}}))))),Ea=Ta([ya.CAN_EXPORT]),ma=Ta([ya.CAN_EXPORT_ACTIVITIES]),ha=Ta([ya.CAN_IMPORT_ENTITIES_FROM_DT]),ba=Ta([ya.CAN_READ_ENTITIES_FROM_DT]),Oa=Ta([ya.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),va=Ta([ya.CAN_UPDATE_PROCESS_INSTANCE]),ga=Ta([ya.CAN_VIEW_WORKFLOW_DEFINITION]),_a=Ta([ya.CAN_CONFIG_ENVIRONMENT_REGISTER]),Aa=Ta([ya.CAN_UPDATE_WORKFLOW_DATA_TASK]),Na=Ta([ya.CAN_READ_WORKFLOW_DATA_TASK]),Pa=Ta([ya.CAN_MANAGE_WORKFLOW_DEFINITION]),Ra=Ta([ya.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Sa=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),wa=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ia=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ua=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ca=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS]),Da=Ta([ya.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),La=Ta([ya.CAN_CREATE_CONFIG_JAR]),ja=Ta([ya.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ka=Ta([ya.CAN_VIEW_CONFIG_JAR]),Fa=Ta([ya.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ma=Ta([ya.CAN_VIEW_WORKFLOW_JOBS]),xa=Ta([ya.CAN_MAKE_BULK_UPDATE]),$a=Ta([ya.CAN_OPEN_DATA_LOADER_EXECUTE,ya.CAN_OPEN_DATA_LOADER_READ]),Va=Ta([ya.CAN_BULK_DELETE_PROFILES]),Ga=Ta([ya.CAN_READ_MDM_DATA_ENTITIES]),Ba=Ta([ya.CAN_READ_DVF]),Wa=Ta([ya.IS_FREEMIUM_ADMIN]),Ya=(0,l.reject)(Vn),qa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ya,(0,l.filter)(e))(t),Ha=(0,l.curry)(((e,t)=>qa((t=>na({attributeType:t,mode:e})),t))),Ja=(0,l.curry)(((e,t)=>qa((t=>na({attributeType:t,mode:e})||la(t)),t))),Ka=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(la)),Qa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Qa(e)])))),Xa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(la),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Xa(e)])))),za=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...za(e)])))),Za=(0,l.pipe)(hi,(0,l.converge)(l.concat,[Xa,za]));function eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){to(e,t,r[t])}))}return e}function to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ro=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,ro(e)))},t))),no=e=>{var t;return eo({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},io=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),ao=(0,l.when)(io,(0,l.dissoc)("values")),oo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return eo({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),so=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},lo=(0,Ei.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Qa,t).concat((0,l.chain)(Qa,r)).some(so)})),uo=e=>{let t=!1;const r=ro((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?eo({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},co=e=>{const t=lo(e),r=(0,l.map)((e=>ro((0,l.pipe)(ao,(0,l.when)((0,l.always)(e),oo))))(t)),n=(0,l.map)(no),i=(0,l.map)(uo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},po=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),yo=(0,l.prop)("relationshipTypeURIs"),fo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(To(e,t)))||[]})),To=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Ii(e,t))},Eo=(e,t)=>(0,l.pipe)(po,(0,l.defaultTo)({}),yo,(0,l.defaultTo)([]),(0,l.chain)(wi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(hi(e)))(e,t),mo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),ho=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),bo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ho((0,l.complement)(mo))(e)},Oo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ho(mo)(e)},vo=(0,l.pipe)(hi,(0,l.propOr)([],"matchGroups")),go=(e,t,r)=>(0,l.pipe)(vo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),_o=(0,l.curry)(((e,t,r)=>(0,l.pipe)(go,(0,l.propOr)(r,"label"))(e,t,r))),Ao=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(vo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),No=e=>(0,l.partition)(mo,e),Po=(0,l.includes)(l.__,["and","or","not"]),Ro=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),So=(0,l.includes)(l.__,["equals","notEquals","in"]),wo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Po(t)?wo(r):Ro(t)?r.filter(an):So(t)?r.map((0,l.prop)("uri")).filter(an):[]})),l.uniq),Io=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(wo),l.uniq),Uo=(0,l.pipe)(vo,Io),Co=(0,l.pipe)(Ao,Io),Do=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Lo=(0,l.pipe)(Do,Xa),jo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||Oi(e,n,t)})(e,t))})(e,t)),ko=e=>!!e.required,Fo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=(0,l.cond)([[an,hi(e)],[on,Ri(e)]])(t);return Mo(e,a,r,n,i)},Mo=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&an(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Fn(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===Et.TYPE_REFERENCE){const a=An(t),s=Nn(t);o=Fo(e,a,r,n,[...i,t]).filter((e=>s.some(sn(e.uri))))}else t.attributes&&(o=Mo(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===Et.TYPE_REFERENCE?Fo(e,An(t),r,n,[...i,t]):[]},xo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),ko]),e.attributes||[])},$o=(e,t)=>{const r=Sn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},Vo=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?fe().text(n):n};return r(null,t)})),Go=["label","description","abbreviation","caption","toolTip"],Bo=e=>Vo(Go,e),Wo=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),Yo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=un(t);return r.find((e=>{let{uri:t}=e;return un(t)===n}))})),qo=(0,l.curry)(((e,t)=>{const r=un(t);return(0,l.pipe)(Yo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Ho=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},Jo=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},Ko=(0,l.curry)(((e,t)=>{let{roles:r=[]}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Qo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=hi(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zo(e,t,r[t])}))}return e}function zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return es(i,e,t,r,n)},es=function(e,t,r){var n;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return te.fromNull(e&&e.length?e:null===(n=ei(t,r))||void 0===n?void 0:n.filter((0,l.complement)(Wn))).map((e=>e.map((e=>{const r=Zo(t,e,i,a);return r.length?Xo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(qn),(0,l.prop)("children"))).filter(la).filter(i).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["attributes","analyticsAttributes"])},rs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["attributes"])},ns=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["analyticsAttributes"])},is=e=>e.children?e.children.flatMap(is):e,as=e=>e.children?[e,...e.children.flatMap(as)]:e,os=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),ss=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return un(r)===e})))),ls=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),ss("LUD")),(0,l.defaultTo)(r))(t||[])},us=(e,t)=>{let{survivorshipStrategies:r}=e;return ss(t,r)},cs=(0,l.allPass)([(0,l.complement)(l.isNil),Fi(ji.READ)]),ps=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Fi(ji.READ)]),ds=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([Fi(ji.CREATE),Fi(ji.INITIATE_CHANGE_REQUEST)])]),ys=(0,l.curryN)(2,(0,l.pipe)(hi,ps)),fs=(0,l.curryN)(2,(0,l.pipe)(Ri,cs)),Ts=e=>{let{ov:t}=e;return!1!==t},Es=(e,t)=>((e,t)=>di(e.type)&&se(t))(e,t)||((e,t)=>yi(e.type)&&le(t))(e,t),ms=e=>t=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t),hs=ms("refEntity"),bs=ms("refRelation"),Os=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],vs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},gs=(0,l.prop)("objectURI"),_s=(0,l.prop)("objectURI"),As=(0,l.prop)("type"),Ns=(0,l.pipe)(hs,(0,l.defaultTo)({}),gs),Ps=(0,l.pipe)(bs,(0,l.defaultTo)({}),_s),Rs=(0,l.pipe)(hs,(0,l.defaultTo)({}),As),Ss=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type,uri:e.uri,value:e.value})));return(e||[]).concat(r)},ws=(0,l.evolve)({refEntity:ie,refRelation:ie});function Is(e,t,r,n){const i=zn(e,r),a=hi(e,t.type)||Ri(e,t.type);if(0===i.length)return null;const o=$n(r);let s=[t],u=1;i[0].uri!==t.type&&(u=0);let c=null;const p=n?[]:null;let d=null;for(let e=u;e<i.length;++e){const t=e===i.length-1,r=i[e];let u=[];if(!Un(r,d)){c=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const c=s.value||s[o]||{};let y=[];r.startObject&&r.endObject||(0,l.both)(En,on)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>An(e)===r.uri||_n(e)===r.uri)),d=y.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(y.push(r),d=null),y.forEach((a=>{const o=c[a.name];o&&(u=u.concat(o)),n&&t&&p.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=u),t&&(c=s)}return p||c}const Us=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?Us(a.value,o):a},Cs=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return Us(e[r],i)}));function Ds(e){return(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]])(e)}const Ls=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),js=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),ks=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(ks(e,i)))))(r)})),Fs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Fs(e)),e)(t))),Ms=(e,t)=>(0,l.curry)(((r,n)=>(0,l.pipe)(ks(e,r),Fs(t))(n))),xs=Ms(null,Ds),$s=Ms(Ts,Ds),Vs=Ms(null,Ls),Gs=Ms(Ts,Ls),Bs=Ms(Ts,js),Ws=(e,t,r)=>{var n,i,a;return e.uri===t?null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Cs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ys=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ns,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),qs=(e,t)=>{const r=hn(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ws(e,r,n)},Hs=Object.values(vt),Js=(0,l.includes)(l.__,Hs),Ks=e=>Hs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xs(e,t,r[t])}))}return e}function Xs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zs=(e,t)=>`${e}_${t}`,Zs=[Ut.matches.name,Ut.matchRules.name],el=(0,l.values)(_t).map((e=>e.name)),tl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,el)))),rl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Zs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>zs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),nl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,tl(r),rl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(zs(`dtPotentialMatches.${t.name}`,"")))))(Ut)},il=(0,l.propEq)("uri",Ut.type.uri),al=e=>(0,l.values)(It).some((0,l.propEq)("uri",null==e?void 0:e.uri)),ol=(0,l.propEq)("uri",St.sourceSystems.uri),sl=Object.values(gt),ll=(0,l.includes)(l.__,sl),ul=e=>{let{entity:t,attributeType:r,value:n}=e;return Qs({},t,{[r.uri]:void 0===n?r.defaultValue:n})},cl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},pl=e=>{let{entity:t,attributeType:r,value:n}=e;return Qs({},t,{[r.uri]:n})},dl=(0,l.propEq)("uri",gt.roles.uri),yl=(0,l.propEq)("uri",gt.tags.uri);function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tl(e,t,r[t])}))}return e}function Tl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const El=e=>{let{parentUri:t,attributeType:r}=e;return fl({uri:Xr(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(qn,Yn),(0,l.always)({value:{}})],[Kn,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ii)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},ml=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ha(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Qn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=El({parentUri:r,attributeType:e}),s=ti(n,e);s&&(a.value=ml({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Qn(e))&&(o[t]=[a])}return o},hl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return Fo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=hn(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Is(r,e,a)||[]).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,a)=>{let{parentUri:o,attributes:s}=a;if(!s[i]||0===s[i].length){let i=vl({entity:e,attributeType:t,parentUri:o,index:0});if(qn(t)){const e=ti(r,t);i=bl({attributeType:t,subAttributes:e,metadata:r,mode:n,parentUri:o},i)}return i}return e}),e)}),t)},bl=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a,parentUri:o}=e;const s=Is(i,t,r.uri).find((e=>{let{uri:t}=e;return sn(t,o)})),l=fl({},s,{value:ml({attributeTypes:n,parentUri:s.uri,mode:a,metadata:i})});return _l({entity:t,attributeType:r,uri:s.uri,value:l})})),Ol=(0,l.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,l.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===Et.TYPE_NESTED?fl({},e,{value:Ol({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return fl({},s(t),ml({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),vl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=El({parentUri:n,attributeType:r}),u=Ds(l);return(0,Ur.ZP)(t,(e=>{Lr(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},gl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ur.ZP)(t,(e=>{Lr(e.attributes||e.value,r,n.uri,Ds(n),a,o,i)}))},_l=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ur.ZP)(t,(e=>{jr(e.attributes||e.value,r,n,i,a,o)}))},Al=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ur.ZP)(t,(e=>{Fr(e.attributes||e.value,r,n,i)}))},Nl=e=>""===e,Pl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Nl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Nl,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),Rl=(0,l.reject)(Pl),Sl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>Sl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Rl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},wl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Sl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ws),deleteEmptyComplex:e})},Il=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(wl(e),(0,l.reject)(l.isEmpty))},Ul=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Js(r)?ul({entity:e,attributeType:r}):vl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Cl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Js(r)?pl({entity:e,attributeType:r,value:i}):_l({entity:e,attributeType:r,uri:n,value:i})})),Dl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Js(r)?cl({entity:e,attributeType:r}):Al({entity:e,attributeType:r,uri:n})})),Ll=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},jl="UrlThumbnail",kl="CdnUrlThumbnail",Fl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ts):(0,l.head)(n);return e&&e.value}return null})(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Ml=Fl(["CdnUrl","Url"],!0),xl=Fl(["CdnUrlPreview","UrlPreview"],!0),$l=Fl([kl,jl],!0),Vl=Fl([kl,jl],!1),Gl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[xn,(0,l.always)(t)],[(0,l.both)(Mn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=xn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Js(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ae)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Bl=(e,t,r)=>{const n=Ka(e),i=(0,l.any)(r?l.T:Ts);return Gl(n,t,i)},Wl=(e,t,r,n,i,a)=>{const o=zr(null==r?void 0:r.uri)?Ha(t,e):Ja(t,e);return Gl(o,r,((e,o)=>{const s=na({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ts,e)||xn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Yl;const ql=e=>{Yl=e};function Hl(e,t){return Yl(e,t)}const Jl=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Kl=50,Ql=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Kl,offset:a=0,sortByDisplayName:o=!0,sortOrder:s=Fe.asc}=e;return Hl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a,sortByDisplayName:o,sortOrder:s}),headers:{"Content-Type":"application/json"}})},Xl=(0,l.once)((()=>Hl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),zl=e=>Hl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Zl=(e,t)=>Hl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),eu=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),tu=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),eu),ru=(0,l.pipe)((0,l.reject)(E),tu),nu=e=>te.fromNull(me[e]).map(fe().text).orSome(""),iu=(0,l.curry)(((e,t)=>`${e}_${t}`)),au=(0,l.split)("_"),ou=(0,l.includes)("_"),su=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),lu=(0,l.curry)(((e,t)=>e.some(su(t)))),uu=lu([Te.IN_RANGE,Te.COUNT_RANGE,Te.WITHIN]),cu=lu([Te.EXISTS,Te.MISSING_VALUE]),pu=(0,l.cond)([[cu,(0,l.always)(0)],[uu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),du=(0,l.complement)(cu),yu=lu([Te.HAS_ALL,Te.EQUALS,Te.NOT_EQUALS]),fu=lu([Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE]),Tu=lu([Te.IN_FILE,Te.NOT_IN_FILE]),Eu=e=>{switch(e){case Te.COUNT_EQUALS:return Te.EQUALS;case Te.COUNT_NOT_EQUALS:return Te.NOT_EQUALS;case Te.COUNT_LT:return Te.LT;case Te.COUNT_LTE:return Te.LTE;case Te.COUNT_GT:return Te.GT;case Te.COUNT_GTE:return Te.GTE;case Te.COUNT_RANGE:return Te.IN_RANGE}},mu=lu([Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS]),hu=lu([Te.WITHIN]),bu=[[Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE],[Te.NOT_IN_FILE,Te.IN_FILE],[Te.EQUALS,Te.NOT_EQUALS,Te.HAS_ALL],[Te.LT,Te.LTE,Te.GT,Te.GTE],[Te.MISSING_VALUE,Te.EXISTS],[Te.COUNT_RANGE],[Te.IN_RANGE],[Te.STARTS_WITH,Te.CONTAINS],[Te.FULL_TEXT],[Te.ON,Te.BEFORE,Te.AFTER,Te.NOT_EQUALS],[Te.WITHIN]],Ou=(e,t)=>bu.some((r=>r.includes(e)&&r.includes(t))),vu=(0,l.pipe)(l.omit,l.values),gu={OPTIONS_FOR_STRING:vu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_DATE:[Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS,Te.MISSING_VALUE,Te.EXISTS,Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE,Te.IN_FILE,Te.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:vu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_BLOB:vu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_NUMBER:vu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_LOOKUP:vu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Te),OPTIONS_FOR_ENUM:vu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_ID:[Te.EQUALS,Te.NOT_EQUALS,Te.IN_FILE,Te.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Te.EQUALS,Te.NOT_EQUALS,Te.LT,Te.LTE,Te.GT,Te.GTE,Te.IN_RANGE],OPTIONS_FOR_COMPLEX:[Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE,Te.EXISTS,Te.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Te.EQUALS,Te.NOT_EQUALS,Te.EXISTS,Te.MISSING_VALUE]},_u=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Et.TYPE_TYPEAHEAD:case Et.TYPE_STRING:case Et.TYPE_PASSWORD:case Et.TYPE_TEXT:case Et.TYPE_CIK_ID:case Et.TYPE_URL:case Et.TYPE_BLOG_URL:case Et.TYPE_IMAGE_URL:case Et.TYPE_EMAIL:return gu.OPTIONS_FOR_STRING;case Et.TYPE_LOOKUP:case Et.TYPE_DEPENDENT_LOOKUP:return gu.OPTIONS_FOR_LOOKUP;case Et.TYPE_ENUM:return gu.OPTIONS_FOR_ENUM;case Et.TYPE_DATE:case Et.TYPE_ACTIVENESS_DATE:case Et.TYPE_TIMESTAMP:case Et.TYPE_LOCAL_DATE:return gu.OPTIONS_FOR_DATE;case Et.TYPE_BOOLEAN:case Et.TYPE_BOOLEAN_RADIO:return gu.OPTIONS_FOR_BOOLEAN;case Et.TYPE_BLOB:return gu.OPTIONS_FOR_BLOB;case Et.TYPE_LONG:case Et.TYPE_INT:case Et.TYPE_FLOAT:case Et.TYPE_DOUBLE:case Et.TYPE_NUMBER:return gu.OPTIONS_FOR_NUMBER;case Et.TYPE_ENTITY_ID:return gu.OPTIONS_FOR_ID;case Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Te.EQUALS];case Et.TYPE_COUNT:return gu.OPTIONS_FOR_COUNT;case Et.TYPE_NESTED:case Et.TYPE_REFERENCE:case Et.TYPE_IMAGE:return gu.OPTIONS_FOR_COMPLEX;default:return gu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(fu,n):n},Au=e=>[xe.and,xe.andNot].includes(e),Nu=e=>[xe.or,xe.orNot].includes(e),Pu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Nu)),Ru=(Su=[xe.and],e=>e.slice(0,-1).every((e=>Su.includes(e.operator))));var Su;const wu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Iu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Uu=e=>`(${e})`,Cu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},Du=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[xe.or,xe.orNot],n=t?[xe.and,xe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&Cu(e.slice(1,-1));return!i&&!a||o?e:Uu(e)},Lu="and",ju=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(Lu,n,e),o=(e=>[xe.andNot,xe.orNot].includes(e))(a)?Du(r):r;return i?o:`${t} ${a} ${o}`}),"")}},ku=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Fu=e=>Array.isArray(e)?e.map(Fu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Mu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),xu=e=>`'${e}'`,$u=e=>`"${e}"`,Vu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Gu=(0,l.pipe)(Fu,Mu),Bu=(0,l.pipe)(Gu,xu),Wu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(uu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Yu=(e,t)=>fu(t)?{type:Et.TYPE_INT}:Tu(t)?{type:Et.TYPE_FILE}:mu(t)&&!hu(t)&&ai(e.type)?{type:Et.TYPE_LOCAL_DATE}:e,qu=Object.values(ge),Hu=e=>!Object.values(ge).includes(e),Ju=e=>qu.includes(e),Ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;return fe().text(t[e])},Qu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Oe),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;return e.map((e=>({value:e,get label(){return Ku(e,t)}})))},Xu=e=>{const t=f()().startOf("minute");switch(e){case Oe.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Oe.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Oe.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Oe.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Oe.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case ve.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},zu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xu;return(0,l.is)(String,e)?t(e):zu(e)};let ec;!function(e){e.CurrentUser="currentUser"}(ec||(ec={}));const tc={},rc=(e,t)=>{tc[e]=t},nc=e=>tc[e];function ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ac(e,t,r[t])}))}return e}function ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oc=e=>e.split("{CurrentUser}").join(nc(ec.CurrentUser)||""),sc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),lc=(0,l.curry)(((e,t,r)=>{const n=r.map(uu(e)||t.endsWith(".count")?Gu:Bu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),uc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},cc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=pu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" or "))(n)},pc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Bu).join(",")})`},dc=e=>`*${e}*`,yc=e=>`URL:${e}`,fc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Tc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Te.IN_FILE?r:`not ${r}`},Ec=(e,t)=>[w(e,t),I(e,t)],mc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!hc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Te.ON:return ic({},e,n?{filter:Te.EQUALS}:{filter:Te.IN_RANGE,values:[Ec(i,n)]});case Te.BEFORE:return ic({},e,{filter:Te.LTE,values:[[I(i,n)]]});case Te.AFTER:return ic({},e,{filter:Te.GTE,values:[[w(i,n)]]});case Te.WITHIN:return ic({},e,{filter:Te.IN_RANGE,values:[Xu(i)]})}}return e}),cc),hc=(0,l.propSatisfies)(ai,"type"),bc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),oc)],[(0,l.propEq)("filter",Te.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(cc({filter:Te.EQUALS,fieldName:t,values:[r]}))),new ju).build())),sc(" or "))(r)}),oc)],[(0,l.propEq)("filter",Te.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Fu,dc))})}),oc)],[(0,l.propEq)("filter",Te.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?cc(ic({},e,{values:(0,l.flatten)(r)})):fc(r)?pc(ic({},e,{filter:"listEquals"})):cc(e)}),oc)],[(0,l.propEq)("filter",Te.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=pu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" and "))(n)})(ic({},e,{values:(0,l.flatten)(e.values)})):hc(e)?(e=>{const{values:t}=e,r=!hc(e),[n]=t;return(new ju).addClause(cc(ic({},e,{filter:Te.LT,values:[w(n,r)]}))).addClause(cc(ic({},e,{filter:Te.GT,values:[I(n,r)]}))).orBuild()})(e):fc(t)?pc(ic({},e,{filter:"not listEquals"})):cc(e)}),oc)],[(0,l.propSatisfies)(Tu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:Tc(t,r),values:n.map((0,l.prop)("link")).map(yc)})}],[(0,l.propSatisfies)(fu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:`${r}.count`,values:n,filter:Eu(t)})}],[(0,l.propSatisfies)(mu,"filter"),mc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return lc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return lc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(cc,oc)]],Oc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!du(e)||gc(e,r))},vc=(e,t)=>Array.isArray(t)?gc(e,t):e===Te.WITHIN?Ju(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Fu(t).length>0,gc=(e,t)=>t&&t.length>0&&t.every((t=>vc(e,t)));function _c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ac=["relevanceScores"],Nc=e=>{let{fieldName:t=""}=e;const r=t.split(".");if(Ac.includes(r[0]))return r[0];const n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Pc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Rc=(e,t,r)=>"children"===e?wc(r,[...t][0],!0):r,Sc=(e,t,r)=>"values"===e?[...r,...t]:r,wc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Rc,t),e);if(!r&&yu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Sc,t),e)}return(0,l.append)(t,e)},Ic=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Nc(e),r=e=>e.fieldName===t?e:r({fieldName:Pc(e),children:[e]});return r(e)})(t);return wc(e,r)}),[]),Uc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),Cc=e=>{let[t]=e;return t.children?Cc(t.children):t.operator},Dc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=Cc(t)===xe.andNot,a=n(t,!1),o=i?`not ${Du(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Cc(r)||Lu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&Uc(i)&&!t?r(i):n(i,a)}],...e])(o))),new ju).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Lc=(0,l.pipe)((0,l.propOr)("","filter"),ou),jc=(0,l.map)((0,l.when)(Lc,(e=>{const[t,r]=au(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_c(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),kc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(Oc),jc,Ic,Dc([...e,...bc],t))},Fc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Mc=[Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS,Te.MISSING_VALUE,Te.EXISTS],xc=[Te.EQUALS,Te.NOT_EQUALS,Te.STARTS_WITH,Te.MISSING_VALUE,Te.HAS_ALL,Te.FULL_TEXT,Te.EXISTS],$c=[Te.EQUALS,Te.NOT_EQUALS,Te.LT,Te.LTE,Te.GT,Te.GTE,Te.IN_RANGE],Vc=(e,t)=>{const r=kn(e);return(e=>{switch(e){case vt.startDate.name:case vt.endDate.name:case _t.dueDate.name:case Pt.createdTime.name:case Pt.updatedTime.name:case St.reltioLoadDate.name:case St.createDate.name:case St.updateDate.name:case St.deleteDate.name:case St.publishDate.name:return Mc;case Rt.matches.name:case St.count.name:return $c;case _t.workflow.name:case _t.assignee.name:case _t.step.name:case At.commenter.name:case Pt.createdBy.name:case Pt.updatedBy.name:case St.sourceSystems.name:case St.value.name:return xc;default:return null}})(t)||_u(r)},Gc=[Te.EQUALS,Te.NOT_EQUALS,Te.CONTAINS,Te.STARTS_WITH,Te.MISSING_VALUE,Te.HAS_ALL,Te.IN_RANGE,Te.WITHIN,Te.EXISTS,Te.ON],Bc=(0,l.pipe)(Vc,(0,l.filter)((0,l.includes)(l.__,Gc))),Wc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ts);if(a&&a[0])if(n.length>0&&a[0].value)r=Wc(a[0].value,[n.join(".")])[0].value;else if("label"in a[0]&&"string"==typeof a[0].label)r=a[0].label;else if(Object.prototype.hasOwnProperty.call(a[0],"label"))r="";else{var o;r=null!==(o=a[0].value)&&void 0!==o?o:""}return{key:t,value:r}}),""),Yc=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=Wc(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{var t;o=o.replace("{"+e.key+"}",null!==(t=e.value)&&void 0!==t?t:"")}))),o},qc=/[,\s]*$/,Hc=e=>{const t=fe().text(Pe);if(!e)return t;const r=e.replace(qc,"");return""===r.toString().trim()?t:r},Jc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Kc=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=Jc(e,r.referencedEntityTypeURI);if(n)return Yc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Yc({attributes:t||{}},r.dataLabelPattern);return""},Qc=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Xc=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},zc=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Zc=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),ep=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),$l,(0,l.prop)("value"))),tp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),ep),rp=(e,t,r)=>{const n=tp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Cs(e),ep)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(hi(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Is(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,ep))(r)})(e,r)||Ai(e,r.type);return Zc(t,n)};function np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ip(e,t,r[t])}))}return e}function ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ap="DTSS/",op=(0,l.replace)(new RegExp("^entities/"),""),sp=e=>ap+e.dataTenant+"/"+e.uri,lp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),up=e=>!(!e||!e.dataTenant),cp=(0,l.startsWith)(ap),pp=(0,l.pipe)((0,l.ifElse)(cp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),dp=(0,l.ifElse)(up,sp,(0,l.prop)("uri")),yp=e=>e&&e.uri?e.dataTenant?sp(e):op(e.uri):"",fp=(0,l.curry)(((e,t,r)=>(hi(t,r.type)||{})[e]||"")),Tp=fp("label"),Ep=fp("typeGraphIcon"),mp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=hi(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(Ts)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Kc(e,o,i),uri:a.uri}})).filter(l.identity):[]},hp=(0,l.pipe)(mp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),bp=(0,l.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,l.is)(Object,r.value)){const n=bp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):bp(e.slice(1),r)}})),Op=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,vp=e=>(0,l.propOr)([],"matchRules",e),gp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?np({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},_p=(e,t,r)=>t&&r?r.aEntity:e,Ap=(0,l.evolve)({attributes:Il(!0)}),Np=(0,l.pipe)(Ap,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Pp=e=>(0,l.assoc)("dataTenant",e);function Rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sp(e,t,r[t])}))}return e}function Sp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+eu(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;let T,E=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},Ip=e=>{const t=(t,n)=>i=>{if(!(e=>!pe(e.value))(i)){var a,o;const s=`${n}/${null!==(a=i.refEntity)&&void 0!==a&&a.objectURI?un(i.refEntity.objectURI):Jr()}`;let u;const c=e.objectsInfo[null===(o=i.refEntity)||void 0===o?void 0:o.objectURI];return c&&(u=c.label,c.isExist||(i.refEntity.objectURI=`${e.uri}/changes/${i.refEntity.objectURI}`)),Rp({},i,{label:u,uri:s,value:(0,l.fromPairs)((0,l.map)(r(t,s),(0,l.toPairs)(i.value)))})}return Rp({},i,{uri:`${n}/${Jr()}`})},r=(e,r)=>n=>{let[i,a]=n;return[i,(0,l.map)(t(`${e}/attributes/${i}`,`${r}/${i}`),a)]};return(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",pt.CREATE_ENTITY),(0,l.evolve)({newValue:e=>{const{uri:t,type:n}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(r(n,`${t}/attributes`)),l.fromPairs)},e)}}))))},e)},Up=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dp(e,t,r[t])}))}return e}function Dp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},jp=e=>{let{relationUri:t}=e;return{type:Xe.DELETE_RELATION,parameters:{relationUri:t}}},kp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Fp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Mp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},xp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),$p=e=>e.type===Xe.DELETE_RELATION,Vp=e=>e.type===Xe.CREATE_RELATION,Gp=e=>e.type===Xe.REPOINT_RELATION,Bp=e=>e.type===Xe.UPDATE_RELATION,Wp=async e=>{const t=[];for(const r of e){const e=await r();t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Yp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Yf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Wf(e,a).then(s)};case Xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Kf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return qf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[jp({relationUri:s}),Lp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Hp(n,i)),(0,l.map)(Yp),Wp)(u)}}},qp=e=>t=>()=>e().then(t),Hp=(e,t)=>r=>Cp({dcrProcessor:e,relationUriProcessor:t},r),Jp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=wp({alwaysCreateDCR:e,dcrUri:t}),n=Up();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Hp(r,n)),(0,l.map)(Yp),(0,l.map)(qp(r.getDcrUriAwait)),Wp)(e),dcrProcessor:r,relationUriProcessor:n}},Kp=e=>t=>(0,l.map)((t=>Cp({},t,{parameters:(0,l.evolve)({parentUri:rh(e),entityUri:rh(e),newEntityUri:rh(e)},t.parameters)})),t),Qp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Xp=(e,t)=>{const r=e.filter(Vp).find(xp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Bp(o)&&xp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Gp(o)||!xp(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(Qp({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},zp=(e,t)=>{const r=e.filter(Gp).filter(xp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Bp(i)||!xp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Zp=(e,t)=>{const r=e.filter($p).filter(xp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!xp(t,e)))},ed=(e,t)=>{const r=e.filter(Bp).filter(xp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Bp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Zp,e)},rd=e=>{const t=e.filter(Vp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},nd=e=>{const t=e.filter(Gp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(zp,e)},id=e=>{const t=e.filter(Bp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(ed,e))(t)},ad=e=>(0,l.pipe)(td,rd,nd,id)(e);function od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sd(e,t,r[t])}))}return e}function sd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ld=e=>od({},(0,l.path)(Id(),e),{startDate:(0,l.path)(Ld(),e),endDate:(0,l.path)(jd(),e)}),ud=(e,t)=>(0,l.pipe)((0,l.path)(Dd()),rh(t))(e),cd=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=ud(e,r),i=(0,l.path)(Ud(),e)===ze.IN,a=e.parentEntityUri||n;return Lp({parentUri:i?t:a,relation:ld(e),entityUri:i?a:t})})),...o.map((t=>{const i=ud(t,r),a=(0,l.path)(Ud(),t)===ze.IN,o=i!==(0,l.pipe)((0,l.path)(Id()),a?kd:Fd)(t),s=$d(e,(0,l.path)(Sd(),t)),u=t.parentEntityUri||n,c=rh(r,i);return o?Mp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Id(),t),isReversed:!1}):Fp({oldRelation:(0,l.path)(Id(),s),newRelation:ld(t)})})),...i.map((e=>jp({relationUri:e}))),...s.map((e=>kp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},pd=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return od({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),dd=(0,l.has)("dataTenant"),yd=(0,l.ifElse)(dd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),fd=(e,t)=>(0,l.pipe)(Ri,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Hs),Ya)(e,t);function Td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ed(e,t,r[t])}))}return e}function Ed(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const md=e=>(0,l.prop)("uri",e),hd=e=>md(e)?e.uri:e,bd=e=>t=>hd(t)===e,Od=(0,l.curry)(((e,t)=>{const r=(n,i)=>{var a;let o=hd(i),s=!1;o.startsWith("!")&&(o=o.slice(1),s=!0);const u=e[o]&&Fi(ji.READ,e[o]),c=n.find(bd(o))||!u?n:n.concat(md(i)?Td({},i,{uri:o}):null!==(a=t.find(bd(o)))&&void 0!==a?a:o);return s?c:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==o||t.find(bd(n))?t:r(t,n)),c)};return t.reduce(r,[])})),vd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=hd(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(bd(a))?r:r.concat(a)}),[])};return Td({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),gd=(0,l.indexBy)((0,l.prop)("uri")),_d=(0,l.curry)(((e,t)=>{const r=gd(e.relationTypes),n=gd(e.entityTypes),i=e=>(0,l.evolve)({inRelations:Od(r),outRelations:Od(r),entityTypes:Od(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),vd(r)),i)(t)})),Ad=(e,t)=>(0,l.evolve)({content:_d(e)},t),Nd=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Pd=(e,t,r)=>{const n=Yc(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Rd="relation",Sd=(0,l.always)([Rd,"relationUri"]),wd=(0,l.always)([Rd,"relationType"]),Id=(0,l.always)([Rd,"object"]),Ud=(0,l.always)([Rd,"direction"]),Cd=(0,l.always)([Rd,"object","attributes"]),Dd=(0,l.always)(["entity","entityUri"]),Ld=(0,l.always)([Rd,"startDate"]),jd=(0,l.always)([Rd,"endDate"]),kd=(0,l.path)(["startObject","objectURI"]),Fd=(0,l.path)(["endObject","objectURI"]),Md=(0,l.path)(["startObject","objectTypeURI"]),xd=(0,l.path)(["endObject","objectTypeURI"]),$d=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Sd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=$d(r.connections,t);if(e)return e}}},Vd=(0,l.pipe)($d,(0,l.path)(Id())),Gd=(0,l.allPass)([(0,l.pipe)((0,l.path)(Dd()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(wd()),(0,l.complement)(E))]),Bd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:en()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=qd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Wd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Nd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Wd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Se.IN}:{type:t[0],direction:Se.OUT}:null},Yd=e=>e.uri||e,qd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&$i(i,t)&&Gi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Se.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],hi(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],hi(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Yd,Ri(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Se.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Se.OUT)),(0,l.map)(u))},t)||{}},Hd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ci({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=wi(e,n.uri);return n&&(!t||Oi(e,i,t))&&(!r||Oi(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],hi(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],hi(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(cs,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},Jd=(0,l.curry)(((e,t,r,n,i)=>{const a=Oi(n,l.__,t.type),o=e?xd:Md,s=Oi(n,l.__,r.type),u=e?Md:xd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Kd=(e,t,r)=>{const n=e?xd:Md,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(Oi(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xd=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},zd=e=>!e.deactivated,Zd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},ey=e=>Zd(e)+e.message,ty=(0,l.unless)(l.isNil,(0,l.prop)("message")),ry=(0,l.unless)(l.isNil,(0,l.prop)("type")),ny=(0,l.curry)(((e,t)=>sn(t.parentUri,e))),iy=(0,l.curry)(((e,t)=>t.parentUri===e)),ay=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),sn(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Et.TYPE_REFERENCE),(0,l.pipe)(Nn,(0,l.any)(sn(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),oy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),sy=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),ly=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Ey,zd,ny(e),ay(t),(0,l.complement)(sy(e,t.uri))]))(r)},uy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Ey,zd,iy(e),oy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",we.missed))]))(r);return n&&n.message||""},cy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===we.missed))},py=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Sd(),e))]))(t)},dy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},yy=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([zd,ny(t)]))(r)},fy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Ty=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?yh(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case Le.attributeValue:{const e=a;if(Bn(a))return Yc(o,e.dataLabelPattern);if(Wn(a)){const t=o,i=Ns(t),a=_n(e),s=hi(n,a);return zr(i)?Yc(r[i],s.dataLabelPattern):t.label}return""}case Le.tempEntity:return Yc(o,a.dataLabelPattern);case Le.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=hi(n,null==e?void 0:e.entityType);return`${Hc(i&&zr(i)?Yc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Si(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qd(e,t,r[t])}))}return e}({},e,{label:Hc(t)})}))},Ey=e=>!e.severity||e.severity===Ue.ERROR,my=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),hy=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Et.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(hy(n))}));case Et.TYPE_REFERENCE:return!!hs(t);case Et.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),by=(e,t)=>e.every((0,l.complement)(hy(t))),Oy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Fo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Is(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ts(e.parent))))).forEach((e=>{by(e.attrValues,n)&&r.push(Xd({type:we.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:fe().text("Attribute is required"),source:Ie.local}))})),r}),[])},vy=(0,l.curry)(((e,t,r)=>Is(e,t,r,!1))),gy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),hi(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Vn),(0,l.filter)(Wn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(vy(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ns),(0,l.map)((e=>{let{uri:r}=e;return Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:yn(r,t.type),parentUri:r,message:fe().text("Entity is required"),source:Ie.local})})))(t)},_y=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ns,zr)).flatMap((n=>{const i=Ns(n),a=t[i],o=Zn(e,yn(n.uri,r.type));return Ay(e,t,o,a)})),Ay=(e,t,r,n)=>{const i=Nn(r),a=i.map((t=>Zn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Et.TYPE_REFERENCE))).flatMap(Rn).concat(i);return Ny(e,t,n,(e=>a.some(sn(e.uri))))},Ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Oy(e,r,n),a=gy(e,r),o=_y(e,t,r);return[...i,...a,...o]},Py=(e,t)=>({attributes:{[e.name]:[t]},type:fn(e.uri),uri:fn(t.uri)}),Ry=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Py(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return Ny(e,n,i,a)},Sy=(e,t)=>{const r=(0,l.path)(Id(),t)||{};return Oy(e,r)},wy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Dd()),(0,l.ifElse)(zr,(e=>t[e]),(0,l.always)(null)))(r),i=Sy(e,r),a=(e=>(0,l.path)(Dd(),e)?[]:[Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(wd(),e),parentUri:(0,l.path)(Sd(),e),message:fe().text("Entity is required"),source:Ie.local})])(r),o=((e,t,r)=>r?Ny(e,t,r):[])(e,t,n);return[...i,...a,...o]},Iy=e=>(0,l.path)(["entity","uri"],e)?[]:[Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:fe().text("Entity is required"),source:Ie.local})],Uy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Oy(e,r),i=Iy(t);return[...n,...i]};function Cy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dy=(e,t)=>{var r,n;const i=hi(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||lo(e)},Ly=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),jy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Ly(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},ky=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(Ps,zr,l.not)]),(e=>{const t=(0,l.pipe)(Ps,un)(e);return jy((e=>e.replace(t,t+Wr)))(e)})),(0,l.when)((0,l.pipe)(Ns,zr),(t=>{const r=Ns(t),n=e[r],i=n&&My(n,e);return null!=i&&i.attributes?(0,l.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Fy=(e,t,r,n)=>Wh(Vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Hh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(ky(r,e.type)),(0,l.map)(jy(bn))))})(e))).concat(Zm(e,t)),My=(e,t)=>(0,l.evolve)({attributes:Sl({valueTransformer:(0,l.pipe)(ws,ky(t),Ly(bn)),deleteEmptyComplex:!0}),uri:bn})(e);function xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$y(e,t,r[t])}))}return e}function $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Br,"g"),"uri$$$$").replace(new RegExp(Wr,"g"),""))),Gy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Vy,objectParentUri:Vy}),(e=>{return xy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?we.missed:we.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&hn(e.objectUri),uri:e.objectUri,source:Ie.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),By=(e,t)=>(0,l.map)((0,l.pipe)(Gy,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Ty(t,s),p=null!=c&&c.length?c.slice(0,-1):Ty(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Zn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Le.attributeValue&&(a=e.valueType)}return a})(o,c,e);return xy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&mn(i)){const n=(0,l.last)(a),i=n.valueType;if(Wn(i)&&Sn(i).includes(o)){const i=Ns(n.value),o=i&&zr(i)?t[i]:null;return o?xy({},e,{parentUri:o.uri,path:a.concat({type:Le.tempEntity,value:o,valueType:hi(r,o.type),label:""})}):e}}return e}})(t)))(e),Wy=e=>{if(e.type===De.AGO||e.type===De.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===De.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Yy=e=>`equals(user, '${Mu(e)}')`,qy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Hy=e=>`equals(items.objectType, '${e.uri}')`,Jy=e=>{const{period:t,type:r}=e;if(!Wy(e))return"";switch(r){case De.WITHIN:return`gte(timestamp, ${Z(t)})`;case De.AGO:return`lte(timestamp, ${Z(t)})`;case De.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Ky=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Qy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Xy=e=>{let{query:t,body:r}=e;return t=Qy(t),Hl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},zy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(kc(),Fc(t.globalFilter))(n),activeness:t.activityFilter||Ne.ACTIVE_ONLY,options:t.searchOptions};return(0,l.reject)(E,i)},Zy=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Hl("/entities/_total",{method:"POST",body:JSON.stringify(zy(e,t,r))})},ef=e=>Hl("/entities/_total",{method:"POST",body:JSON.stringify(Object.fromEntries(new URLSearchParams(e).entries()))}),tf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(ps),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Te.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(kc(),Fc(r.globalFilter))([i,a]),s=(0,l.reject)(E,{filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Ne.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return Hl("/entities/_typeAheadSearch",{method:"POST",body:JSON.stringify(s)})},rf=(0,l.pipe)((0,l.reject)(l.isNil),tu),nf=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(kc(),Fc(i))(r),p=rf({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Xy({query:p,body:d})},af=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return nf({fieldName:t,searchParams:i,options:n})};function of(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",lf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i=(0,l.reject)(E,{filter:(0,l.pipe)(kc(),Fc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||sf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null,options:t.searchOptions});return i},uf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=lf(e,t,r);return Hl("/entities/_search",{method:"POST",body:JSON.stringify(n)})},cf=e=>Ef(e,{select:"secondaryLabel"}),pf=(e,t)=>{const{select:r=sf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Hl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},df=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),zr)),yf=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=df(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Hn(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(kc(),Fc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),Hl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},ff=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Tf={options:"sendHidden,addRefAttrUriToCrosswalk"},Ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tf;return Hl(`/${e}${ru(t)}`)},mf=(e,t)=>Ef(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){of(e,t,r[t])}))}return e}({},Tf,{explicitSurvivorshipGroup:t})),hf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return Hl(n,r)},bf=e=>Hl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Of=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Hl(`/${e}/_clone${ru({executeLCA:!1,valuesToCopy:r})}`,n)},vf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Hl(`/entities/_events/_total${tu({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},gf=(e,t)=>Hl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),_f=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Hl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Af=e=>Ef(e,{select:"updatedTime"}),Nf=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return Hl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),tu)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pf=e=>{const t=new FormData;return t.append("file",e),Hl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=Ar(e,fe().text("Can't upload file"));return Promise.reject(t)}))},Rf=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return Hl(`/personal/findSavedSearches${tu({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},Sf=e=>Hl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),wf=e=>Hl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),If=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Hl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Uf=e=>{let{uri:t}=e;return Hl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Cf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),If)(e),Df=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),If)(e);function Lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jf=["max","offset","filter"],kf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:kf(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lf(e,t,r[t])}))}return e}({},t,(0,l.pick)(jf,e)))),Ff=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Me.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Me.ALL,e)))return!1},Mf=(0,l.omit)(["activeness"]),xf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Ff(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(kf(e),(0,l.omit)(jf))(e))),Mf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${ru(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},$f=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Vf=(0,l.reject)(l.isNil),Gf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Bf=e=>Hl(Gf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Wf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Gf);return Hl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Yf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Il()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Vf,ae,JSON.stringify);return Hl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},qf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),Gf,n),o=Vh(i(t),i(r),!1).concat(Bh(t,r));return Hl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Hf=(e,t,r)=>{const{url:n,options:i}=xf(e,t,r);return Hl(n,i).then($f)},Jf=(e,t)=>Hl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Kf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Se.IN?a.inRelations=[n]:a.outRelations=[n],Hl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Qf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Hl(`${t}/recentSearches${ru({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Xf=e=>Hl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),zf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Hl(`/recentSearches${ru({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eT(e,t,r[t])}))}return e}function eT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tT={select:"label,secondaryLabel,name,type,startDate,endDate"},rT=(0,l.reject)(l.isNil),nT=(0,l.pipe)(rT,tu),iT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=Zf({},tT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Hl(`/${t}/_tree${nT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},aT=e=>{let{uri:t,graphUri:r}=e;const n=Zf({},tT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Hl(`/${t}/_parents${nT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},oT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=Zf({},tT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Hl(`/${t}/_hops${nT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function sT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const lT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},uT="/activities",cT=e=>{let{label:t,description:r}=e;return Hl(uT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:lT()}})};var pT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(pT||(pT={}));const dT=e=>{const t=ru(e);return Hl(uT+t,{method:"GET"})},yT=e=>Hl(`/activities/_total${ru(e)}`,{method:"GET"}),fT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return Hl(`/${t}/_activities${ru(r)}`,{method:"GET"})},TT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return Hl(`/${t}/_activities/_total${ru(r)}`,{method:"GET"})};function ET(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mT(e,t,r[t])}))}return e}function mT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},bT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Hl(hT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},OT=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=hT({url:r,workflowPath:t,tenant:n})),Hl(s,{method:i||"GET",body:JSON.stringify(a),headers:ET({"Content-Type":"application/json"},null!=o?o:{})})},vT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=hT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Hl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},gT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=hT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?ET({},l,{comment:o}):l;return Hl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},_T=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=hT({url:`/tasks${s?ru(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(ET({objectURIs:[i]},(0,l.reject)(E,a)))};return Hl(u,ET({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},AT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Hl(hT({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Hl(hT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(ET({max:a,offset:o},i))})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Hl(hT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Hl(hT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Hl(hT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return Hl(hT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},LT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Hl(hT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},jT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Hl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),tu)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},kT=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return Hl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),tu)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},FT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Hl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},MT=(e,t,r)=>Promise.all(t.map((async t=>await Hl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),xT=async(e,t)=>await MT(e,t,"NOT"),$T=async(e,t)=>await MT(e,t,"MATCH"),VT=async(e,t)=>await Promise.all(t.map((async t=>await Hl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function GT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BT(e,t,r[t])}))}return e}function BT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const YT=3e4,qT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Hl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},HT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return dE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},JT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return dE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Hl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},QT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},XT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(up,i);return Promise.all([s.length?FT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},zT=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=WT(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),ZT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),zT),eE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Hl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(ZT)},tE=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},rE=tE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Hl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json",SearchMetadata:"AUTO"},body:JSON.stringify([{uri:a,type:o}])}).then(ZT)})),nE=tE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Hl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),iE=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(l.flatten)}return t(...arguments)}},aE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Hl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},oE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return aE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},sE=oE("NOT"),lE=oE("MATCH"),uE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(up,a);return Promise.all([MT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return aE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},cE=uE("NOT"),pE=uE("MATCH");function dE(e){let{requestProvider:t=Hl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,GT({},WT(s,["headers"]),{headers:GT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const yE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;const s=function(e){const t=lf(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"");return`/entities${ru(t)}`}(t,r,n);return dE({url:s,dataTenant:i,customerTenant:a,dtssPath:o})},fE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return dE({url:"/entities/_total",dataTenant:i,customerTenant:a,dtssPath:o,options:{method:"POST",body:JSON.stringify(zy(t,r,n))}})},TE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=xf(t,r);return dE({url:`entities/_connections/_getConnections${ru({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)($f,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},EE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return dE({url:`${ff(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},mE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Hl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},hE=e=>{let{dtssPath:t,tenant:r}=e;return Hl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:YT})},bE=e=>{let{dtssPath:t,customerTenant:r}=e;return Hl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:YT})},OE=e=>{let{dtssPath:t,tenants:r}=e;return Hl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:YT})},vE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return dE({url:ff(t),dataTenant:r,customerTenant:n,dtssPath:i})},gE=()=>Hl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function _E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){AE(e,t,r[t])}))}return e}function AE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=_E({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return Hl(`${t}/api/${r}/graph/search${ru({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},PE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Hl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:_E({},n,i),headers:{"Content-Type":"application/json"}})},RE=(e,t)=>`${e}/${t}/comments`,SE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Hl(`${RE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},wE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Hl(`${RE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},IE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Hl(RE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},UE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Hl(`${RE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Hl(`${RE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Hl(`${RE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},LE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Hl(`${RE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Hl(`${RE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},kE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=ru({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Hl(`${RE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function FE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ME(e,t,r[t])}))}return e}function ME(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xE=e=>{let{tenant:t,servicesPath:r}=e;return Hl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$E="graphExport",VE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(FE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:FE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:FE({method:"POST"},o)})),s},GE=e=>{let{servicesPath:t,key:r}=e;return Hl(`${t}/settings${ru({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},BE=e=>{let{servicesPath:t}=e;return Hl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},WE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Hl(`${n}/plugins${ru({tenant:t,user:r})}`,{method:"GET"})},YE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Hl(`${n}/configService${ru({tenant:t,environment:r,namespace:a,projection:o})}`,i)},qE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return YE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},HE=e=>{let{servicesPath:t,stateHash:r}=e;return Hl(`${t}/searchLink?key=${r}`,{method:"GET"})},JE=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),Hl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},KE=e=>Hl(`/${e}?showObjectsInfo=true`,{method:"GET"}),QE=e=>{let{exportPath:t,tenant:r,options:n}=e;return Hl(`${t}/${r}/activities${ru(n)}`,{method:"POST"})};function XE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zE(e,t,r[t])}))}return e}function zE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZE=e=>{const{entityUri:t}=e;return Hl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},em=e=>{let{entityUri:t,crosswalk:r}=e;return Hl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},tm=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Hl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[XE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),XE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},rm=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Hl(`/${r}/_${n}${ru({contributorURI:t})}`,{method:"POST"})},nm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Hl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},im=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Hl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},am=e=>{let{entityUri:t,crosswalkId:r}=e;return Hl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function om(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sm(e,t,r[t])}))}return e}function sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lm=e=>{let{entityTypeUri:t}=e;return Hl(`/dataQuality/fillRates${tu({entityType:un(t)})}`,{method:"GET"})},um=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},cm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i,searchByOv:a}=e;const o=om({},n===Qe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),s=tu(om({},n===Qe.ATTRIBUTE_TYPE?{numberOfThreads:um({attributes:r,metrics:i})||1}:{},a?{options:"searchByOv"}:{}));return Hl(`/entityType/${un(t)}/dataQuality/${n}${s}`,{method:"POST",body:JSON.stringify(o)})},pm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Hl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${un(n)}`,{method:"GET",headers:{env:i}})},dm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Qe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u,anomaly:c}=e;const p={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u,anomaly:c};return Hl(`${t}/${r}/entityType/${un(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(p)})},ym=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/permissions/${t}`,{method:"GET"})},fm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Hl(`/${t}${ru({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Tm=e=>{let{attributeUri:t,value:r}=e;return Hl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Em=e=>{let{attributeUri:t,value:r}=e;return Hl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},mm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Hl(`/${t}${ru({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},hm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=ru({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Il()([[{value:a}]]);return Hl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},bm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Hl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Om=e=>{let{entityUri:t,attributeName:r}=e;return Hl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function vm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gm=e=>{let{entityUri:t}=e;return Hl(`/${t}/_historicURIs`,{method:"GET"})},_m=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return Hl(`/${t}/_changesWithTotal${ru(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Am=(e,t)=>Hl(`/${e}/_previousChange${ru({timestamp:t})}`,{method:"GET"}),Nm=(e,t)=>Hl(`/${e}${ru({time:t})}`,{method:"GET"});function Pm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=pe(n)?JSON.stringify(n):n),Hl(t,{method:o,body:s,headers:Pm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},wm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=ru({options:a.join(","),severity:o.join(",")});return Hl(`${t}/validate/${i}/entity/${yp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Im=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Hl(`${t}/validate/${n}/entity${ru({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Um=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/tenants/${t}/name`,{method:"GET"})},Cm=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Dm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Hl(`${a}/preferences${ru({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Lm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return Hl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Hl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},km=e=>{const{servicesPath:t}=e;return Hl(`${t}/getTokenForWorker`,{method:"GET"})};var Fm=r(47485);const Mm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Zr(),s={attributes:ml({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Is(r,e,n.uri)[0];return i&&i.value?_l({entity:e,attributeType:n,uri:i.uri,value:t}):vl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},xm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ns),(0,l.filter)(zr),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),$m=(0,l.curry)(((e,t)=>{const r=xm(e=e||{},t=t||{});return r.concat((0,l.chain)($m(e),r))})),Vm=(0,l.curry)(((e,t)=>(0,l.pipe)(de,(0,l.filter)(e))(t))),Gm=Vm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Bm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),zr)),Wm=e=>(0,l.pipe)(Gm,Bm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Ym=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Gm,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),qm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),zr),(0,l.omit)(["uri","timestamp"])),Hm=(0,l.pipe)(qm,Ap),Jm=async(e,t,r)=>{if(!e)return null;const n=Wm(e);if(n.length>0)for(const r of n)e=Ym(r,t[r],e);const i=await hf(Hm(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Km=async(e,t,r)=>{const n=Xm(e,t),i={};for(const t of n)i[t]=await Jm(e[t],i,r);return i},Qm=(0,l.curry)(((e,t)=>{const r=Fm.Node(t);return Wm(e[t]).forEach((t=>{const n=Qm(e,t);r.addEdge(n)})),r})),Xm=(e,t)=>(0,l.pipe)((0,l.map)(Qm(e)),(0,l.map)(Fm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),zm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(qm))})),Zm=(e,t)=>[...Jh(e.tags||[],t.tags||[]),...Kh(e.roles||[],t.roles||[]),...Gh(e,t),...Bh(e,t)],eh=(e,t,r)=>[...Wh(Vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Hh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...Zm(e,t)],th=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return Ym(r,n,e)}),e))))}),t)}),zm),rh=(0,l.curry)(((e,t)=>(0,l.when)(zr,(0,l.propOr)(l.__,t,e),t)));function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ih(e,t,r[t])}))}return e}function ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ah=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:n,children:i}})},oh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},sh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=xm(t,i),o=ah({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>sh(n.uri,t,[e],r)),o)},lh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Sd(),n),a=t?oh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Dd(),n),s=zr(o)?[o]:[],u=ah({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>sh(t,r,[i],e)),u)}),n)},uh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return lh(r,e,t,sh(e,t))},ch=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return uh(t,r,n);if(rn(e)){const t=$d(n,e);return t&&lh([t],null,r)}return r[e]?sh(e,r):void 0},ph=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>ph(e,t))))},dh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>dh(e,t))))},yh=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=tn(t),u=uh(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const u=t[e],c=t[e+1]||r;if(rn(c)){if(s=$d(i,c),!s)return null;o.push({type:Le.relationConnection,value:s,valueType:Ri(a,(0,l.path)(wd(),s))});continue}if(rn(u)){const e=n[c];if(!e)return null;o.push({type:Le.tempEntity,value:e,valueType:hi(a,e.type)});continue}const p=n[u],d=Ys(p,c),y=n[c];if(!d||!y)return null;o.push({type:Le.attributeValue,value:d,valueType:Zn(a,yn(d.uri,p.type))}),o.push({type:Le.tempEntity,value:y,valueType:hi(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},dh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=rn(s),d=p?Vd(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?Ri(a,d.type):hi(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ei(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:Le.tempEntity,value:T,valueType:hi(a,T.type)}),o.push({type:Le.attributeValue,value:s,valueType:E}),m=s.value;const l=Ns(s);T=l&&zr(l)?n[l]:null}}return o},fh=e=>e.every((e=>{let{type:t}=e;return[Le.attributeValue,Le.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Le.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Th;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Th||(Th={}));const Eh={[Th.insertAttribute]:{color:"#599E0E"},[Th.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Th.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},mh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Th.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Th.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Th.deleteAttribute;default:return""}},hh="/",bh=(0,l.pipe)((0,l.split)(hh),(0,l.propSatisfies)((0,l.lte)(2),"length")),Oh=(0,l.pipe)((0,l.split)(hh),(0,l.slice)(0,-2),(0,l.join)(hh)),vh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>bh(e),vh(Oh(e))]])(t))),gh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+hh))),_h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=vh(e,t);return(0,l.isNil)(r)?gh(e)(t)?"UPDATE_ATTRIBUTE":"":r},Ah=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},Nh=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(Nh(e))}))}))),t},Ph=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Ih,t),(0,l.propOr)([],"crosswalks",e))),e),Rh=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(Rh(e))}))})),r},Sh=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=Sh(e);r>t&&(t=r)}))})),t+1):t},wh=(e,t)=>{if(zr(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Ih=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Uh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ch=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Dh=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,l.pipe)((0,l.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},Lh=(0,l.eqBy)(Ih),jh=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(bs,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function kh(e){return e&&void 0!==e.uri}let Fh;function Mh(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function xh(e){return void 0!==e.refEntity}function $h(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function Vh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...Vh(f.value,T.value,r)):"Reference"===d(f)?$h(f,T)?n.push(...Vh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:Fh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(pe(r)?Object.keys(r).forEach((function(e){const n=a(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function o(e){return[{type:Fh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:Fh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:Fh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),xh(e)&&(e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t)),n}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(pe(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Gh(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:Fh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||kh(n)&&kh(i)&&n.uri===i.uri||r.push({type:Fh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function Bh(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:Fh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:Fh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Wh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Yh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case Fh.INSERT_ATTRIBUTE:c.push(e);break;case Fh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case Fh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:Fh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case Fh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?qh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:Fh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Yh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:Fh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:Fh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==Fh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:Fh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(Fh||(Fh={}));const Yh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),qh=(e,t,r)=>(0,l.pipe)(qs,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return wh(t,r)},e=>{let[t]=e;return!Ts(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Hh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(xh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function Jh(e,t){return Mh(Fh.UPDATE_TAGS).call(this,e,t)}function Kh(e,t){return Mh(Fh.UPDATE_ROLES).call(this,e,t)}function Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xh(e,t,r[t])}))}return e}function Xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zh=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(pe(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:pe(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(pe(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){pe(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Qh({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:Qh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Zh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Zh(t.value):[]];return e.concat(r)}),[])),eb=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,tb=e=>e?[dp(e)]:[],rb=e=>{const t=[...Zh((null==e?void 0:e.attributes)||[]),...Zh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...tb(e),...t]:[]},nb=(e,t)=>[e,...t.map((t=>eb(e,t)))],ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return yd(t)}))},ab=(e,t)=>{switch(e){case je.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case je.ENTITY_ATTRIBUTE:case je.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[fn(t)]})(t);case je.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case je.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,dp({uri:n,dataTenant:i}),r]})(t)}},ob=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),sb=(0,l.curry)(((e,t)=>{const r=Do(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(sb(e,r.extendsTypeURI)):n})),lb=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),ub=(e,t)=>(0,l.pipe)((0,l.prop)("type"),sb(e),lb(t))(t),cb=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var pb,db=r(29504);function yb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(pb||(pb={}));const fb={},Tb={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},Eb=e=>{if(!fb[e]){const t=Tb[e]||Tb.random0;fb[e]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return fb[e]},mb=(0,l.curry)(((e,t)=>{const r=Eb(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),hb=e=>mb(pb.Charts,e),bb=()=>Eb(pb.PotentialMatches).colors,Ob=e=>mb(pb.Random1,e),vb=e=>(0,db.getColor)(e)?"#FFFFFF":"#212121";var gb=r(73116);const _b=Array.from({length:100},((e,t)=>t/100)),Ab=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Nb={},Pb=new gb.Z({hash:Ab,saturation:_b.slice(15,71),lightness:_b.slice(50,90)}),Rb=new gb.Z({hash:Ab,saturation:_b.slice(46,89),lightness:_b.slice(44,58)}),Sb=(0,l.curry)(((e,t,r)=>{t in Nb||(Nb[t]={});const n=Nb[t];r in n||(n[r]=((e,t)=>{const r=String(Ab(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),wb=Sb(Pb,"crosswalks"),Ib=Sb(Pb,"sources"),Ub=Sb(Pb,"contributors"),Cb=Sb(Pb,"dataValidationFunctions"),Db=Sb(Rb,"entities");function Lb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kb=(0,l.has)("items"),Fb=e=>0===e,Mb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},xb=e=>e.reduce(((e,t)=>e+t.width),0),$b=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Vb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Gb=e=>e.reduce(((e,t)=>e+t.height),0),Bb=e=>(0,l.is)(String,e)&&e.includes("%"),Wb=(0,l.has)("spacer"),Yb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),qb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(kb(t)?qb(t):t)),[]),Hb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},Jb=e=>({id:e.layout}),Kb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Jb;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=Bb(r.width)?Yb(i,r.width):u}return Mb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Mb(n,t,r)},o=(e,t)=>kb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,kb(a)?n(a.layout):e(a.view)))),s=Hb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=Fb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(kb(n))return r.concat(p(Lb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Lb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:xb(u),height:$b(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=kb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Fb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(kb(i))return r.concat(p(Lb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Lb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Mb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Mb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Vb(i),height:Gb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>Fb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Lb({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=Hb(e.width,[o,o]),u=Lb({},e,{width:s[0]}),c=Lb({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Lb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Lb({},e,{height:Gb(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Lb({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Lb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Lb({},t,{items:(0,l.reject)(Wb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return qb(f)},Qb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Xb=[tt.FilteredEntitiesViewFacet,tt.ActivitiesViewFacet,tt.ProfileStatsFacet,tt.FilteredSavedSearchesFacet],zb=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Xb.includes(a.component)?8:4;return Lb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eO(e,t,r[t])}))}return e}function eO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tO={BarChart:et.BAR,BarChartGrouped:et.BAR,BarChartHorizontal:et.BAR,LineChart:et.LINE,Map:et.MAP,Pie:et.PIE},rO=(e,t)=>Tn(e)?pn(e,t):e,nO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=tO[r];return Zb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},iO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Zb({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},aO=(e,t,r)=>{const n=(e=>e&&ae(e).map((e=>{const{type:t,value:r}=e;return Zb({},e,{value:[he.IN,he.NOT_IN,Te.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:be(t),fieldName:r,values:n?ae(n):void 0}})))(e);return t&&Tn(t)||!r?n:(n||[]).concat((i=r,{filter:Te.EQUALS,fieldName:"type",values:[i]}));var i},oO=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],sO={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.BAR,component:tt.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.BUBBLE,component:tt.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:tt.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ae(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Zb({id:t,count:o,canRead:u,orderType:s,attributeUri:rO(r,p),filters:aO(a,r,p),component:tt.DashboardFacet,title:i,showOthers:!0},nO(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.MAP,component:tt.DashboardFacet,title:i,geoUrl:oO[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return Zb({id:t,count:o,canRead:l,attributeUri:rO(n,r),filters:aO(a,n,r),component:tt.DashboardFacet,title:i,geoUrl:s,chartType:et.MAP,projection:"geoMercator"},nO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:iO(i),component:tt.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:aO(n,null,a),component:tt.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:Te.GTE,fieldName:"matches",values:["1"]}],component:tt.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:tt.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:et.CLOUD,component:tt.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:et.TREE,component:tt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.NotificationInboxFacet,title:n||fe().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.ActivitiesViewFacet,title:n||fe().text("Activity log")}}},lO=e=>({id:e,height:10}),uO=(0,l.pipe)((0,l.map)((e=>{const t=sO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),cO=e=>{if("0.1"===e.version){const t=uO(e.views),r=Kb(lO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Qb(r,t),views:t}}return e},pO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ae)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>pO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function dO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yO(e,t,r[t])}))}return e}function yO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fO=dO({},rt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),TO=e=>e,EO={[fO.Attributes]:TO,[fO.HierarchyTree]:TO,[fO.HierarchyPaths]:TO,[fO.RelationsTable]:TO,[fO.Relations]:e=>dO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[fO.SingleAttribute]:TO,[fO.Custom]:TO,[fO.AttributeTable]:TO,[fO.Map]:TO,[fO.OldTree]:e=>dO({},e,{class:rt.HierarchyTree}),[fO.OldMap]:e=>dO({},e,{class:rt.Map}),[fO.ImageAttribute]:TO,[fO.PotentialMatches]:TO},mO=(0,l.pipe)((0,l.map)((e=>{const t=EO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),hO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===rt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),bO=(e,t)=>(t||[]).map((t=>dO({},t,hO(e,t.id)))),OO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return dO({},t,{layout:bO(t.views,e.newLayout)});if("0.1"===e.version){const r=mO(e.views),n=Kb(hO(r),e.layout,{columns:3});return dO({},t,{layout:Qb(n,r),views:r})}return e},vO=(e,t)=>e.class===t||e["react-class"]===t,gO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(vO(t,rt.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return(vO(t,rt.SingleAttribute)||vO(t,rt.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(sn(i))||t.some(sn(i))}},_O=(e,t)=>e.filter((e=>t.some((t=>vO(e,t))))).map((e=>{let{id:t}=e;return t})),AO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},NO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),PO=e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function RO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SO(e,t,r[t])}))}return e}function SO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wO=(0,l.curry)(((e,t)=>pO(t).map((t=>(0,l.pipe)((0,l.map)((e=>AO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),IO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),UO=(0,l.propEq)("class",rt.Custom),CO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},DO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=bO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>AO(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow","frozen"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=wO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>AO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(IO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(wO(e),(0,l.filter)(UO))(RO({},n,{items:i})),s=[{id:"common",views:wO(e,RO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=OO(RO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(PO,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},LO=(e,t)=>{if("scroll"===t.layout.layout){const r=wO(e,t.layout),n=cO(RO({},t,{views:r,version:"0.1"}));return{class:it.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:it.Dashboard,views:t.views,layout:t.layout,id:t.id}},jO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries,showOVSwitcher:r.showOVSwitcher,showErrorBands:r.showErrorBands}},kO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},FO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},MO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},xO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},$O=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},VO=(e,t)=>{const r=wO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=NO(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:it.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},GO=(e,t)=>({class:it.Graph,id:t.id}),BO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},WO=e=>t=>!!(0,l.intersection)(e,t).length,YO=(0,l.cond)([[WO(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>LO],[WO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>jO],[WO(["com.reltio.plugins.graph.GraphView"]),()=>GO],[WO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>kO],[WO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>FO],[WO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>MO],[WO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>xO],[WO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>$O],[WO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>VO],[WO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>BO],[l.T,()=>(0,l.always)(void 0)]]),qO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(CO),(0,l.map)((t=>DO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow","frozen"])))(e);return{class:it.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:at.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:at.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>AO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",it.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>AO(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=DO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:it.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=pO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return YO(o)(t,i)};function HO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JO(e,t,r[t])}))}return e}function JO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KO=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},QO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var XO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(XO||(XO={}));const zO={[it.DQDashboard]:`${QO}DqDashboard.svg`,[it.Dashboard]:`${QO}Dashboard.svg`,[it.Graph]:`${QO}Graph.svg`,[it.RelationshipSearch]:`${QO}GraphSearch.svg`,[it.Interactions]:`${QO}Interactions.svg`,[it.PotentialMatches]:`${QO}PotentialMatches.svg`,[it.Profile]:`${QO}Profile.svg`,[it.NestedProfile]:`${QO}Profile.svg`,[it.ProfileActivityLog]:`${QO}ActivityLog.svg`,[it.Relationships]:`${QO}Relationships.svg`,[it.Sources]:`${QO}Crosswalk.svg`,[it.Search]:`${QO}Search.svg`,[XO.DashboardGroup]:`${QO}DashboardGroup.svg`,[XO.ProfileGroup]:`${QO}ProfileGroup.svg`,[XO.SearchGroup]:`${QO}SearchGroup.svg`,DEFAULT:`${QO}Default.svg`},ZO=e=>zO[null==e?void 0:e.class]||zO.DEFAULT,ev=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",it.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>HO({},e,{nestedRoute:`${t+1}`})))))),tv=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},rv=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?zO[XO.ProfileGroup]:null,nv=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===zO[it.Dashboard]||t===zO[it.DQDashboard]})),(0,l.always)(zO[XO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===zO[it.Search]||t===zO[it.RelationshipSearch]})),(0,l.always)(zO[XO.SearchGroup])],[l.T,()=>null]])(e),iv=e=>(0,l.pipe)((0,l.chain)(KO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>HO({},e,{entityTypes:e["entity-types"],screen:qO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=ev(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:ZO(r),screen:tv(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=qO(t,e);return{label:t.label,icon:rv(t)||nv(r)||ZO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function av(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ov=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},sv=e=>({id:e,height:10}),lv=e=>{const t=(e=>(0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,l.pipe)((0,l.chain)(ov),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=uO(((e,t)=>{const r=pO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){av(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Kb(sv,t.layout,{columns:4});return{views:r,layout:Qb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function uv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cv(e,t,r[t])}))}return e}function cv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pv(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const dv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),yv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,fv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),Tv=(0,l.pipe)(dv("top-logo"),fv),Ev=(0,l.prop)("showLookupCode"),mv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(pe,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return uv({thousandSeparator:r,decimalScale:n},pv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(dv("default-perspective"),(0,l.ifElse)(yv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>NO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return uv({},t,pv(e,["action"]))})))(e))(e),f=(e=>dv("checkUser",e))(e),T=(e=>dv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=Ev(h))||O;var O;const v=null===(t=PO(e))||void 0===t?void 0:t.showEntityId,g=(e=>dv("preview",e))(e),_=Tv(e),A=(e=>dv("showAttributeDescription",e))(e),N=(e=>dv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e),R=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e),w=0===Object.keys(P).length?void 0:P,I=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.ProfileCheckUpdate"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.omit)(["id","point"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:w,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N,profileCheckUpdate:I}},hv=e=>({layout:iv(e),pivoting:lv(e),properties:mv(e)});function bv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ov(e,t,r[t])}))}return e}function Ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vv=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${(0,Gr.x0)()}`;return n[e.id].push(t),i=!0,bv({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,bv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function gv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_v(e,t,r[t])}))}return e}function _v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Av={};const Nv=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=ee(`${r.id}: ${r.action.files.join('","')}`);if(E(Av[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}Av=gv({},Av,{[a]:gv({},Av[a]||{},{worker:i})})}else i=Av[a].worker,Av[a].innerText&&t({task:{action:ut.SET_HTML,params:{html:Av[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Av[a].onWorkerMessage);return i&&(Av[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(Av[a].innerText=n.params.html)}},i.addEventListener("message",Av[a].onWorkerMessage)),i},Pv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Rv=(0,l.flip)(Pv);var Sv=r(83926);const wv=(e,t)=>{let r;try{r=t(e)}catch(t){return e}return"number"==typeof e?r.toNumber():r.toString()};function Iv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uv(e,t,r[t])}))}return e}function Uv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cv={[ft.percent]:{valueConverters:{in:e=>wv(e,(e=>new Sv.Decimal(e).mul(1e4).floor().div(100))),out:e=>wv(e,(e=>new Sv.Decimal(e).mul(100).floor().div(1e4)))}}},Dv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Cv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.in)||l.identity)(t)})),Lv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Cv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.out)||l.identity)(t)})),jv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const{uri:n,name:i}=e||{},a=!n||xn(e)?i:n;return t[a]||t[Re]||Fv(r)},kv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{[Rt.relevanceScore.name]:Iv({},jv(Rt.relevanceScore,e,t),{strategy:ft.percent})}},Fv=(0,Ei.Z)((e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:("integer",(null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})),Mv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s,strategy:l}=e;t=Dv(l,t);const u=null!=s?new Sv.Decimal(t).toFixed(s):t,[c,p]=u.split("."),d=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),y=c.replace(d,r),f=null==p?void 0:p.replace(/(0|\.)+$/,"");return i+y+(f?n+f:"")+a};let xv;const $v=()=>xv,Vv={setLocale:e=>{xv=e},getLocale:$v,number:e=>((e,t)=>{const r=String(t);try{const t=Fv(e);return Mv(t,r)}catch(e){return console.warn("Number localization error"),r}})($v(),e),applyFormatToNumber:Mv},Gv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Vv.applyFormatToNumber(e,t):(!e&&t&&(t=Vv.number(t)),t)))),Bv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?fe().number(e,"0,0.0a").toUpperCase():fe().number(e,"0,0"):""},Wv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Yv=!0;const qv=e=>Yv=e,Hv=(e,t)=>e!==t&&t?Yv&&e?`${t} (${e})`:t:e,Jv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Kv=(e,t,r)=>{const n=Jv(e,t,r);return Hv(r,n)},Qv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Xv=(0,l.complement)(Qv),zv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Zv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},eg=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Xv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),tg=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=i?J(i):"L",s=a?X(a):"L LTS";switch(n.type){case Et.TYPE_NUMBER:case Et.TYPE_FLOAT:case Et.TYPE_DOUBLE:case Et.TYPE_LONG:case Et.TYPE_INT:case Et.TYPE_COUNT:{const e=jv(n,r,Vv.getLocale());return t&&Gv(e,t)}case Et.TYPE_BOOLEAN:case Et.TYPE_BOOLEAN_RADIO:case Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isEmpty)(t)?"":(t=t,(0,l.isNil)(t)?t:ce(t)?fe().text("Yes"):fe().text("No"));case Et.TYPE_DATE:return(0,l.is)(Number,t)&&(t=P(Number(t)).getTime()),(t=t)&&(Ju(t)?Ku(t):fe().date(t,o));case Et.TYPE_ACTIVENESS_DATE:case Et.TYPE_LOCAL_DATE:return(t=t)&&(Ju(t)?Ku(t):fe().date(t,o));case Et.TYPE_TIMESTAMP:return(t=t)&&(Ju(t)?Ku(t):fe().date(isNaN(t)?t:Number(t),s));case Et.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Et.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Et.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?Hv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}}));r(72342);const rg={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},success:{main:"#3B873E"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)",hint:"rgba(0,0,0,0.38)"},divider:"rgba(0,0,0,0.38)"},components:{MuiButton:{defaultProps:{color:"inherit"}},MuiTooltip:{defaultProps:{disableInteractive:!0}},MuiTab:{styleOverrides:{root:{maxWidth:"264px"}}},MuiDialogTitle:{styleOverrides:{root:{"&&+.MuiDialogContent-root":{paddingTop:"13px"}}}},MuiFilledInput:{styleOverrides:{root:{lineHeight:"1.1876em",backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},input:{"&.MuiSelect-select":{minHeight:"1.1876em"}}}},MuiInputBase:{styleOverrides:{root:{"& .MuiInputAdornment-root":{color:"rgba(0,0,0,0.87)"}},input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"},"&.Mui-disabled":{WebkitTextFillColor:"inherit"}}}},MuiMenuItem:{styleOverrides:{root:{"&.Mui-selected":{backgroundColor:"rgba(0, 0, 0, 0.08)","&.Mui-focusVisible":{backgroundColor:"rgba(0, 0, 0, 0.08)"},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"};function ng(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ig(e,t,r[t])}))}return e}function ig(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ag=e=>(t,r)=>{const{timeout:n}=r,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,ng({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},og=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},sg=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=ng({},JSON.parse(t),{[vr]:e.status})}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),lg=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s={},u=(0,l.pipe)(ag,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),og,sg);let c=0,p=[];return{request:(e,n)=>{const i=u(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(c){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},ug="__metadata",cg=(e=>{const t=[ug,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),pg=(0,l.set)(cg),dg=(0,l.view)(cg),yg=pg(Ae.NEW),fg=pg(Ae.REMOVED),Tg=pg(Ae.EDITED),Eg=pg(Ae.IGNORED),mg=(0,l.pipe)(dg,(0,l.equals)(Ae.REMOVED)),hg=(0,l.pipe)(dg,(0,l.equals)(Ae.NEW)),bg=(0,l.pipe)(dg,(0,l.equals)(Ae.EDITED)),Og=(0,l.pipe)(dg,(0,l.complement)(l.isNil)),vg=(0,l.pipe)(dg,(0,l.equals)(Ae.IGNORED)),gg=(0,l.omit)([ug]),_g=(e,t)=>e===ug?void 0:t;function Ag(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=Ng(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Pg=(e,t)=>Ng((0,l.propEq)("nodeId",t),e),Rg=(e,t)=>Ng((0,l.pathEq)(["entity","uri"],t),e),Sg=(e,t)=>{const r=Pg(e,t);return r.length>1?r[r.length-2]:null},wg=(e,t)=>{const r=Pg(e,t);return r.length>0?r[r.length-1]:null},Ig=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>Ig(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Ug=()=>{},Cg=(e,t)=>{let{parent:r,nodeProcessing:n=Ug}=t;n(e,r),e.children&&e.children.forEach((t=>Cg(t,{parent:e,nodeProcessing:n})))},Dg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case We.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case We.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case We.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ag(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},Lg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&Cg(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===We.addingChild||r.editingMode===We.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Dg({node:r,connection:n,isReversed:i}),s=Lp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===We.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Dg({node:r,isReversed:i,connection:n}),l=s?Mp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Fp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},jg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=jg(r,t);if(e)return e}return!1},kg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(kg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Fg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>jg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:kg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Mg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},xg={asc:"asc",desc:"desc"},$g=Mg.entityLabel,Vg=xg.asc,Gg=(0,l.always)(0),Bg=e=>{let{sortField:t=$g,sortOrder:r=Vg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Mg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return zN.strings.sort(t,a,o)})(n,r);case Mg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return zN.strings.sort(e,i,a)})(r);default:return Gg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Wg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(xg)),l.identity,(0,l.always)(Vg))),Yg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Mg)),l.identity,(0,l.always)($g)));var qg=r(91104);let Hg;const Jg=(e,t)=>(Hg||(Hg=qg.createClient({key:t})),new Promise((t=>{Hg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),Kg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Qg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ts).flatMap((e=>{let r;return e.type==t&&(r=[Kg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Qg(e.value,t))),r})),Xg=e=>e&&e.length>0,zg=(e,t)=>[].concat(e&&e.attributes?Qg(e.attributes,t):[]).filter(l.identity);function Zg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e_=(e,t,r,n,i,a)=>{if(e&&e.type){const t=hi(r,e.type);n&&(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=zg(e,t.latitude),n=zg(e,t.longitude),Xg(r)&&Xg(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Xg(t)&&t[0].value&&Xg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?Jg(n.label,a).catch((()=>null)):Promise.resolve(null)},t_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=hi(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return e_(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?Jg(a.label,r).catch((()=>null)):e)).then((e=>ae(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},r_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=hi(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Zn(e,r.latitude,t.type)&&Zn(e,r.longitude,t.type)){const e=zg(t,r.latitude),n=zg(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},n_=(e,t,r)=>Promise.all([r_(e,t),t_(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lng===e.point.lng))))]}));function i_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){a_(e,t,r[t])}))}return e}function a_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const o_=(e,t)=>t.values.map(_o(e,t.entityTypeUri)),s_=(e,t,r)=>nl(t.fieldName,r)||Zn(e,pn(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),l_=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?Hv(e,t):e}),r)},u_=(0,l.path)(["attrType","label"]),c_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>i_({},e,{[t]:!0})),{});e[r]=e[r]?i_({},e[r],n):n}return e}),{}),p_=(0,l.pipe)((0,l.prop)("values"),E),d_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Ut.type.name)),y_=e=>e.type===E_.NUMERIC_RANGE_FACET,f_=e=>e.type===E_.DATE_RANGE_FACET,T_=(0,l.either)(y_,f_),E_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},m_=e=>{switch(null==e?void 0:e.name){case Ut.type.name:return E_.ENTITY_TYPE_FACET;case Ut.createdBy.name:case Ut.updatedBy.name:case Ut.sourceSystems.name:case Ut.tags.name:case Ut.roles.name:case Ut.matchRules.name:case Ut.MLRecommendedMatch.name:return E_.WITH_DROPDOWN_CHECKBOXES_FACET;case Ut.createdTime.name:case Ut.updatedTime.name:case Ut.startDate.name:case Ut.endDate.name:return E_.DATE_RANGE_FACET;case Ut.matches.name:case Ut.matchScore.name:return E_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return E_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return E_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return E_.DATE_RANGE_FACET;default:return E_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},h_=(0,l.pipe)(s_,m_),b_=(0,l.pipe)((0,l.path)(["attrType","type"]),ci),O_=(0,l.cond)([[y_,(0,l.always)(Te.IN_RANGE)],[f_,(0,l.always)(Te.WITHIN)],[(0,l.allPass)([b_,e=>e.values.length>=2]),(0,l.always)(Te.EXISTS)],[l.T,(0,l.always)(Te.EQUALS)]]),v_=(0,l.cond)([[f_,(0,l.prop)("values")],[y_,(0,l.prop)("values")],[b_,e=>1===e.values.length?e.values.map(ce):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]),g_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(ge),__=e=>(e=>g_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=Xu(t);return e.replace(r,i).replace(n,a)}),e))(e),A_=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),N_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},P_=e=>[N_.geoPolygon,N_.onMapMove].includes(e),R_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},S_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},w_=(e,t)=>P_(e)?t.map(R_):[S_(t)],I_=e=>P_(e)?fe().text("Geo Polygon"):fe().text("Geo Location"),U_=e=>{switch(e){case N_.geoLocation:return"geoLocation";case N_.geoPolygon:case N_.onMapMove:return"geoPolygon"}},C_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},D_=e=>fe().text(e),L_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Te.EQUALS]:"=",[Te.NOT_EQUALS]:"≠",[Te.STARTS_WITH]:"*",[Te.MISSING_VALUE]:fe().text("missing value"),[Te.HAS_ALL]:fe().text("has all"),[Te.IN_RANGE]:fe().text("in range"),[Te.FULL_TEXT]:fe().text("full text"),[Te.EXISTS]:fe().text("exists"),[Te.COUNT_EQUALS]:`${fe().text("count")} =`,[Te.COUNT_NOT_EQUALS]:`${fe().text("count")} ≠`,[Te.COUNT_LT]:`${fe().text("count")} <`,[Te.COUNT_LTE]:`${fe().text("count")} <=`,[Te.COUNT_GT]:`${fe().text("count")} >`,[Te.COUNT_RANGE]:fe().text("count range"),[Te.LT]:"<",[Te.LTE]:"<=",[Te.GT]:">",[Te.GTE]:">=",[Te.IN_FILE]:fe().text("in file"),[Te.NOT_IN_FILE]:fe().text("not in file"),[Te.CONTAINS]:"~",[Ee.LIST_EQUALS]:"=",[Ee.NOT_LIST_EQUALS]:"≠",[Ee.LIST_EQUALS_CASE_SENSITIVE]:"=",[Ee.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||fe().text(e.toLowerCase())},j_=e=>({type:C_.operator,text:e}),k_=e=>({type:C_.operator,text:D_(e)}),F_=e=>({type:C_.attributeLabel,text:e}),M_=e=>({type:C_.specialAttributeLabel,text:e}),x_=e=>({type:C_.attributeFilter,text:L_(e)}),$_=e=>({type:C_.attributeValue,text:e}),V_=e=>({type:C_.entityTypeLabel,text:e}),G_=()=>({type:C_.space,text:" "}),B_=()=>({type:C_.bracket,text:"("}),W_=()=>({type:C_.bracket,text:")"}),Y_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),q_=(0,l.curry)(((e,t)=>t.map(Y_(e)))),H_=(0,l.curry)(((e,t,r)=>[e,...r,t])),J_=H_(B_(),W_()),K_=H_(G_(),G_()),Q_=(0,l.curry)(((e,t)=>[e,...t])),X_=e=>Q_(V_(e)),z_=e=>Q_(V_(`${e}: `)),Z_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Pu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Au(s),a=Nu(s);!r&&t&&n&&(i.push(B_()),r=!0),i.push(o),r&&a&&(i.push(W_()),r=!1);const l=e?k_(s):j_(s);i.push(...K_([l]))}else i.push(o),r&&(i.push(W_()),r=!1)}return i}},eA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),tA=(0,l.pipe)(Z_({localizable:!1}),eA),rA=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},nA=e=>{let{data:t,values:r,filter:n}=e;return t&&Oc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},iA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(nA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),aA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Kn(e.data.attrType)})(e)&&[Te.HAS_ALL,Te.EQUALS,Te.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Jn((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Zv),oA=(e,t)=>(0,l.pipe)(aA,eg(t))(e),sA=(0,l.pathEq)(["data","fieldName"],Ut.type.name),lA=(0,l.path)(["data","entityTypeUri"]),uA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),cA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ys(e)),attributes:(0,l.filter)((0,l.pipe)(lA,(0,l.anyPass)([l.isNil,ys(e),r=>{const n=(t.entityTypes||[]).filter(ys(e));return(n.length>1?_i(e,n):null)===r&&!!hi(e,r)}])))})(t))))),pA=e=>(0,l.pipe)((0,l.prop)("filter"),pu,(0,l.equals)(e)),dA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=nl(n.fieldName)||n.attrType,s=Yu(o,i),u=tg({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Kn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Hv(a.lookupCode,a.value):Kv(r,Jn(o),a)],[()=>al(s),()=>_o(e,n.entityTypeUri,a)],[()=>ol(s),()=>qo(e,a)],[()=>dl(s),()=>Ko(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>si(c)||ci(c)),$u),$_)()})),yA=(e,t,r,n)=>{const i=dA(e,t,r,n.data,n.filter);return(0,l.cond)([[pA(0),(0,l.always)([])],[(0,l.both)(pA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[G_(),i(r),{type:C_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[G_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),q_({type:C_.punctuationMark,text:", "}))(t)]}]])(n)},fA=(e,t)=>{const r=!!nl(e.data.fieldName);return(0,l.pipe)(rA,r?M_:F_)(e,t)},TA=(e,t,r,n,i)=>[fA(n,i),G_(),x_(n.filter),...yA(e,t,r,n)],EA=(0,l.addIndex)(l.map),mA=(0,l.propEq)("length",1),hA=(0,l.propSatisfies)((0,l.lt)(1),"length"),bA=(0,l.complement)(l.isEmpty),OA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(wu,(0,l.filter)(nA),Iu,(0,l.map)((n=>({operand:TA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,Z_()))(n)},vA=(0,l.pipe)(OA,l.flatten),gA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Tp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=OA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(X_),(0,l.pipe)(s(z_),(0,l.unless)((()=>mA(u)||i),J_)))(u)},_A=(e,t,r,n)=>(0,l.pipe)(wu,(0,l.filter)(iA),Iu,EA(((n,i,a)=>({operand:gA(e,t,r,n,mA(a)),operator:n.operator}))),Z_(),l.flatten)(n),AA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),Z_(),l.flatten),NA=e=>{let{searchType:t,values:[r]}=e;return w_(t,r).join(", ")},PA=(e,t,r,n,i,a)=>{const o=(e=>e?[M_(e.isRawFilter?fe().text("Raw filter"):fe().text("Search")),...K_([x_(Te.EQUALS)]),$_(`"${e.value}"`)]:[])(i),s=(e=>e?[M_(I_(e.searchType)),G_(),$_(NA(e))]:[])(a),u=(0,l.pipe)(_A,(0,l.when)((e=>hA(e)&&(bA(o)||bA(s))),J_))(e,t,r,n);return AA([o,s,u])},RA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),SA=(0,l.pipe)(PA,RA),wA=(0,l.has)("attributes"),IA=Array.isArray,UA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),CA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=DA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(UA(a))),J_),(0,l.concat)(K_([j_(o)]))))(s)},DA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return wA(n)?CA(e,t,r,n,i):IA(n)?n.reduce(((n,a)=>n.concat(DA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(K_([j_(n.operator)])))(TA(e,t,r,n,i))},LA=(e,t,r,n,i)=>(0,l.pipe)(DA,l.flatten)(e,t,r,n,i);function jA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kA(e,t,r[t])}))}return e}function kA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FA=(0,l.complement)(sA),MA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(sA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(lA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},xA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=MA(t);return(r||n)&&Ru(t)},$A=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(xA)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(sA).some((0,l.propEq)("filter",Te.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=MA(r);if(xA(e))t.push(jA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(FA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(sA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(lA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(FA),entityTypes:n,operator:i?a:e.operator,id:(0,Gr.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),VA={[Te.EQUALS]:Te.ON,[Te.IN_RANGE]:Te.WITHIN,[Te.GTE]:Te.AFTER,[Te.GT]:Te.AFTER,[Te.LTE]:Te.BEFORE,[Te.LT]:Te.BEFORE},GA=(0,l.curry)((e=>VA[e]||e)),BA=(0,l.curry)(((e,t)=>{switch(e){case Te.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Te.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),WA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ii),YA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>jA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return WA(e)?(0,l.evolve)({filter:GA,values:BA(t)},e):e}))})))})),qA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Hu),(0,l.map)(Xu))}),HA=(0,l.map)((0,l.cond)([[WA,qA],[l.T,l.identity]])),JA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),$A,cA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),HA)})),YA,(0,l.reject)(uA))(r)));function KA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){QA(e,t,r[t])}))}return e}function QA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XA=(e,t)=>({data:{uri:Tn(e.fieldName)?pn(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||O_(e),id:(0,Gr.x0)(),values:v_(e)}),zA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=nl(a,t,r)||Zn(e,i);if(!s)return null;if(xn(s))return KA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Tp(e,{type:o}),i=(zn(e,pn(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return KA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),ZA=(0,l.curry)(((e,t,r,n)=>JA(zA,e,n,t,r)));function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tN(e,t,r[t])}))}return e}function tN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},nN=e=>"rdmLookups.not.resolved"===e?Ut.notResolved.name:e,iN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===he.NOT_IN_RANGE?Te.IN_RANGE:be(a),u=nN(n),c=nl(u)||Zn(e,i),p=(0,l.cond)([[()=>Tu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>eN({},e,{filename:Wv(e)}))))],[()=>ci(null==c?void 0:c.type),(0,l.map)(ce)],[e=>yu(s)&&!Array.isArray(e[0])&&!ii(null==c?void 0:c.type),oe],[l.T,l.identity]])(o);return{id:(0,Gr.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===he.NOT_IN_RANGE?"and not":"and",filter:s,values:p}})),aN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(iN(e,_i(e,i)));return[{id:(0,Gr.x0)(),operator:"or",attributes:a,entityTypes:i}]})),oN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),sN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([oN("from"),oN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),lN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return eN({},r,{values:sN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?zs(e.fieldName,n):e.fieldName})},uN=(e,t)=>{if((0,l.has)("children")(e)){const r=lN(e,t);return e.children.reduce(((e,n)=>(e.push(uN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return lN(e,t)},cN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(lN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(eN({fieldName:e.fieldName},lN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(uN,l.flatten)],[l.T,lN]]),pN=(0,l.pipe)((0,l.map)(cN),l.flatten),dN=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},yN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=aN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:pN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>eN({},t,{type:h_(e,t)}))).map((e=>eN({},e,{values:T_(e)?dN(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return XA(r,t)})),operator:"or",id:(0,Gr.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[nN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[eN({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return ZA(e,t,r,p)},fN=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(p_),(0,l.partition)(d_))(t),i=n.map((t=>KA({},t,{type:h_(e,t)}))).map((e=>XA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Gr.x0)(),entityTypes:a}]})(e,a);return ZA(e,t,r,o)})(e,t,r,n):yN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},TN=e=>"2.0"===e.version?e.keyword:rN(e),EN=e=>(0,l.pathEq)(["object","uri"],e),mN=(e,t)=>(0,l.pipe)((0,l.find)(EN(e)),(0,l.prop)("object"))(t),hN=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),EN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=mN(r.match,t)||n[r.match];return i?{label:Hc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return go(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},bN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),ON=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),vN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:Hc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return go(e,o.type,t)||{label:t,uri:t}}))}})))(t),gN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},_N=(0,l.path)(["object","uri"]),AN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},NN=e=>void 0!==(null==e?void 0:e.relevance),PN=e=>NN(e)?100*e.relevance+"%":"";function RN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SN(e,t,r[t])}))}return e}function SN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wN=(e,t)=>!!e[t],IN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},UN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},CN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return RN({},t,{[r.uri]:RN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:UN(null==o?void 0:o.parents,n),children:UN(null==o?void 0:o.children,i),values:UN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},DN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=hi(r,t)||Ri(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return rs(r,n,i).flatMap(is).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Zn(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=CN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>CN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},LN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!zr(e.uri)&&an(e.type)&&an(t)&&!t.startsWith(e.type))(n,t))return e;const i=Is(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ts),(0,l.map)(IN))(i);return CN({structure:e,attrType:e[t].attrType,values:a})}),t)},jN=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return wN(e,r)}));return r||n?t.filter(Ts).reduce(((e,t)=>jN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return wN(t,e.type)?CN({structure:t,attrType:t[e.type].attrType,values:[IN(e)]}):t}},kN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?RN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},FN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Is(i,n,r)||[];return a.length?CN({structure:t,attrType:t[r].attrType,values:a.filter(Ts).map(IN)}):t},MN=(e,t,r)=>{const n=tn(e),i=tn(t);return n===i?((e,t)=>{const r=hn(t),n=hn(e);return sn(n,r)||((e,t)=>En(e)&&!En(t)&&sn(t,e))(n,r)})(e,t):!(!r||!mn(t))&&ph(r,i).includes(n)},xN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},$N=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?uh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return MN(r,t,o)}))},VN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>VN(e,t,r)))))},GN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},BN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&xN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!GN(i,a)}},WN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=tn(n),p=ch(c,o,i,a),d=VN("children",t,u),y=VN("parents",t,u),f=d.flatMap((e=>VN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return MN(t,n,p)})).map((t=>BN(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return MN(n,t,p)||tn(t)!==c&&MN(t,n,p)})).map((t=>BN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=VN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&MN(n,t,p)}))})).map((t=>BN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return MN(t,n,p)})).map((e=>BN(r,n,e,s,l))),...E,...m,...T]},YN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=tg({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>Yc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Bn,()=>a(n)],[Kn,()=>(e=>{const r=o(e),n=Jn(t);return zl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Kv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},qN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Te.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(HN(r,t)):i.push(JN([t],r)),i},HN=(e,t)=>{const r=$n(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Bn(i)?HN(i,t[r]):[JN(t[r],i)];return e.push(...a),e}}),[])},JN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Hn(t.uri),filter:t.type===Et.TYPE_BLOB?Te.FULL_TEXT:Te.EQUALS,values:e}:{fieldName:Hn(t.uri),filter:Te.MISSING_VALUE},KN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),QN=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:KN}},XN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},zN={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},47485:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1330e4d9-2502-4c2e-8e78-4ed96a9f9721",e._sentryDebugIdIdentifier="sentry-dbid-1330e4d9-2502-4c2e-8e78-4ed96a9f9721")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1602"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9383],{6391:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Hs,IL3:()=>pT,PY2:()=>vt,Ng6:()=>Me,YJ7:()=>Ne,NlI:()=>Ee,XYV:()=>ge,Xt7:()=>Ce,wfT:()=>sr,EMD:()=>Qt,HAc:()=>Le,PEf:()=>Pt,oA3:()=>Kt,$XE:()=>et,eWf:()=>At,q7e:()=>je,KVe:()=>lr,WVQ:()=>Ti,oZZ:()=>Tr,bNA:()=>Er,Rjq:()=>mr,G39:()=>St,W0P:()=>ut,X1H:()=>ot,hdG:()=>dt,ws7:()=>yt,VI$:()=>pt,yn8:()=>Qe,N0y:()=>Ke,dZX:()=>tt,bQt:()=>br,oS0:()=>Et,KfU:()=>De,bZE:()=>Oe,Nsj:()=>Se,psV:()=>Ae,xPW:()=>gt,pyR:()=>rr,p8l:()=>zt,Wkf:()=>Ue,zHr:()=>Ie,NIO:()=>we,$26:()=>E_,s9T:()=>He,MEy:()=>ju,j5E:()=>Te,vAw:()=>Jt,NMQ:()=>Ht,eVu:()=>ec,YGb:()=>lt,Y1q:()=>Th,RgZ:()=>Zt,Qy0:()=>hr,Q26:()=>Re,pYu:()=>Wt,wIJ:()=>N_,GFH:()=>$e,Ury:()=>wt,S91:()=>It,wSh:()=>te,BDP:()=>ji,pGS:()=>tr,ARY:()=>mt,XGc:()=>or,fO_:()=>jt,wwy:()=>We,h_8:()=>Ct,_XL:()=>Pe,j2V:()=>ur,dMV:()=>ir,xYD:()=>ft,OXy:()=>ht,BXd:()=>Xe,KM9:()=>Fe,lXI:()=>it,C68:()=>Rt,Yj_:()=>Ye,D25:()=>Ge,ZIY:()=>rt,Tl4:()=>C_,lwr:()=>Nt,NkU:()=>cr,Rtp:()=>ar,YGx:()=>ze,uTS:()=>nr,MCv:()=>ke,IYE:()=>Xt,PiC:()=>fr,MVv:()=>ct,Q_m:()=>vr,h_m:()=>at,DUe:()=>ve,tJI:()=>xe,fDt:()=>Ve,cNQ:()=>pr,SwE:()=>Yt,ZHR:()=>yr,PYu:()=>st,lD1:()=>Ut,lVm:()=>Ze,vnX:()=>$g,$x5:()=>Vg,_R1:()=>Mg,wUm:()=>xg,dC6:()=>Je,MBD:()=>Be,GmF:()=>ya,cKm:()=>nt,iP_:()=>_t,NVC:()=>qe,tPT:()=>vl,tZe:()=>ST,kRE:()=>em,psB:()=>tm,X0$:()=>Ol,$vY:()=>bl,zE1:()=>Ul,Wm5:()=>ul,vyX:()=>Fc,wLZ:()=>gl,W4V:()=>ue,EtK:()=>Ss,ayi:()=>hl,asT:()=>jN,kGs:()=>Wh,RLE:()=>Dv,ewt:()=>Nd,O_f:()=>Ru,sOy:()=>sn,kP7:()=>Cv,Tde:()=>Hn,LMI:()=>bc,skb:()=>vA,sPt:()=>cc,sH1:()=>pc,lPZ:()=>Jy,bG8:()=>Hy,_LJ:()=>Ky,RPM:()=>Xd,h27:()=>Ic,Uqd:()=>kc,xG:()=>LA,Z2f:()=>zv,fgW:()=>tA,I69:()=>PA,ZxB:()=>SA,dwd:()=>qy,F$g:()=>Yy,mdt:()=>ob,Qbq:()=>Sh,rny:()=>Qi,UEY:()=>La,Q0T:()=>Da,Lyr:()=>Va,sBn:()=>Ca,itK:()=>Sa,H9$:()=>Ua,KPc:()=>Ia,zos:()=>wa,ELQ:()=>Ga,dZs:()=>ha,Cz4:()=>ma,z_L:()=>xa,fGe:()=>Ea,iuF:()=>Pa,Wib:()=>Ra,Hn0:()=>$a,obS:()=>Ba,E$L:()=>ba,XUh:()=>Na,Qp_:()=>_a,_jk:()=>Oa,sKE:()=>va,WmG:()=>Aa,QKx:()=>Fa,Oik:()=>ka,s0A:()=>ga,o9m:()=>ja,MCd:()=>Ma,RsS:()=>Uc,tGK:()=>Zl,lIv:()=>Cl,Vg3:()=>na,mkC:()=>Wi,xv5:()=>aa,a14:()=>qi,yv0:()=>ia,Zm0:()=>Yi,Nxd:()=>Bi,$mM:()=>ra,ifj:()=>mi,NWi:()=>Og,xr3:()=>bg,wNf:()=>du,iJH:()=>vg,KB$:()=>NN,d89:()=>$i,Edd:()=>Vi,Z5t:()=>Gi,uGe:()=>Fi,UoR:()=>ki,xvW:()=>hg,$qe:()=>mg,yPM:()=>Ta,$cp:()=>Il,vKJ:()=>Sl,VtG:()=>Of,AID:()=>eh,B1H:()=>gN,b7X:()=>Nh,$uE:()=>Hh,keo:()=>Rh,C_p:()=>Fy,G27:()=>pO,O8b:()=>zy,JA0:()=>BE,b3T:()=>Bh,oC6:()=>Vh,_Zs:()=>Gh,epC:()=>Kh,YYG:()=>Jh,f_2:()=>YE,w3l:()=>iN,QHB:()=>cO,Jso:()=>pN,RXH:()=>Kb,Vr9:()=>OO,lMm:()=>hv,BlA:()=>qN,fmQ:()=>Os,yRD:()=>YA,NcL:()=>By,QK6:()=>Pr,ymd:()=>cT,JV_:()=>hm,XiW:()=>Jp,Yrx:()=>IE,BiY:()=>wp,GPx:()=>ml,gjI:()=>El,vlo:()=>Bd,E_P:()=>eb,aAL:()=>Xf,NBq:()=>vs,wp9:()=>ab,DsR:()=>Yf,MPc:()=>Lp,gWE:()=>jp,DT_:()=>kp,ipn:()=>Mp,ORg:()=>Ui,_wz:()=>Fp,RYR:()=>cd,PP2:()=>jE,wS7:()=>lg,cBQ:()=>wf,pBq:()=>Mm,DsO:()=>re,X78:()=>Om,xZs:()=>fm,YFy:()=>CE,Gmt:()=>am,K$w:()=>im,DSj:()=>zf,Mfr:()=>DE,k9j:()=>Uf,EjS:()=>Z,ww$:()=>_l,WVU:()=>nm,hxF:()=>pl,n6p:()=>Ip,E7G:()=>Pp,nwO:()=>XN,Mzk:()=>_f,aFF:()=>Lh,HRH:()=>Mu,EZK:()=>Kc,Kxm:()=>Yc,Z9i:()=>Ty,CrF:()=>QE,DNd:()=>Ya,vUy:()=>$N,lJh:()=>Gu,zHo:()=>Bu,UO$:()=>Wm,zeJ:()=>Zn,dLR:()=>Cs,JQy:()=>Ws,XtP:()=>Is,Ug0:()=>_i,A1W:()=>Ph,sw:()=>Jc,nv3:()=>wg,JgD:()=>Sg,SkP:()=>Ys,SAs:()=>$m,i5L:()=>qs,PWK:()=>Yo,IM5:()=>Us,Aup:()=>bO,Mfk:()=>vv,HQx:()=>as,oN$:()=>is,mB6:()=>tg,p6d:()=>U,o0x:()=>D,ufS:()=>Gv,k7L:()=>Bv,ped:()=>PN,mrB:()=>C,OuZ:()=>Qc,ncP:()=>en,FQ2:()=>Xc,W$R:()=>zc,JOV:()=>Jr,Zmi:()=>Kr,hm5:()=>Xr,ECL:()=>ru,vPL:()=>Zc,qmL:()=>fh,hPi:()=>km,hXd:()=>zi,OCS:()=>Zi,p2l:()=>Ks,qF1:()=>dT,_X$:()=>yT,bzh:()=>ub,k66:()=>ts,kiP:()=>Eo,pSg:()=>de,kz_:()=>xE,H_U:()=>ns,t9e:()=>za,j2$:()=>wT,PFL:()=>kn,aJ3:()=>s_,To9:()=>Jn,wpo:()=>bp,ADq:()=>cy,UUb:()=>ly,tQX:()=>uy,xy8:()=>$n,EUG:()=>ei,AFK:()=>yn,X3M:()=>zn,WN0:()=>rs,kDl:()=>Ds,uDV:()=>yh,IhQ:()=>xs,pfb:()=>Vs,R$r:()=>Zh,w80:()=>Co,Pfu:()=>Qa,Gtj:()=>Wl,fyF:()=>Bl,kkq:()=>es,u5q:()=>tn,O$n:()=>mp,ptG:()=>hp,f4_:()=>hb,uap:()=>mb,d7q:()=>wE,liG:()=>kE,$oF:()=>SE,avf:()=>Dd,DiQ:()=>Cd,cfX:()=>Ud,vD3:()=>jd,Qrb:()=>Id,EJQ:()=>Ld,HWy:()=>wd,gjS:()=>yd,y6v:()=>Sd,JUW:()=>qE,GtP:()=>Ub,_kX:()=>Ha,u1e:()=>Ja,sJj:()=>Uh,CJp:()=>wb,uKF:()=>Ih,wo0:()=>ZE,s5:()=>Jo,cwx:()=>Ho,Y6b:()=>hE,TTx:()=>cm,UtR:()=>bE,HaQ:()=>pm,E6I:()=>KE,Won:()=>vE,vTU:()=>EE,Nsy:()=>sp,KMQ:()=>Dh,Do$:()=>pp,CSV:()=>zs,TMe:()=>OE,l1V:()=>Yu,RHh:()=>Zu,VQ1:()=>Xu,cGG:()=>Qu,z7d:()=>Wd,Xaq:()=>ls,Sj8:()=>WN,PJj:()=>Ql,k3T:()=>Ni,PjQ:()=>Di,s7l:()=>ff,jLA:()=>Cb,BoX:()=>ti,GGR:()=>xd,j5q:()=>Fd,DnY:()=>pf,RY5:()=>sh,Px$:()=>pd,KPC:()=>bN,NIY:()=>vf,HvW:()=>Ef,Fof:()=>Za,BXy:()=>mf,fX:()=>Db,BTI:()=>yp,uie:()=>rp,q27:()=>vp,vrC:()=>DO,fAQ:()=>Am,XkT:()=>cf,lrH:()=>Nm,nt9:()=>hi,XH8:()=>Ep,XH2:()=>Ai,jFi:()=>Tp,qhs:()=>Uo,GBJ:()=>Af,wwR:()=>dp,Uk3:()=>fn,$Rg:()=>gn,ev7:()=>_N,RB9:()=>GE,iFp:()=>Zd,e$p:()=>ty,PcX:()=>ry,SpP:()=>ey,R6_:()=>u_,CY1:()=>m_,Ajk:()=>af,Yiz:()=>nf,FK9:()=>Xy,UOo:()=>Wv,aTW:()=>lm,uug:()=>pu,P$2:()=>O_,XS2:()=>nu,Hyb:()=>_u,d3Y:()=>Vc,Klp:()=>Bc,WxZ:()=>v_,Gzu:()=>Wu,ZOr:()=>uf,uqV:()=>yE,Pm4:()=>ie,hWO:()=>cn,nHA:()=>vb,nVD:()=>uh,_tF:()=>nc,dED:()=>PE,P2h:()=>NE,jrr:()=>po,mmY:()=>fo,T6O:()=>os,h6J:()=>NT,hM2:()=>fN,XR6:()=>ee,jmz:()=>dh,IHt:()=>ph,NZI:()=>fy,wdF:()=>gm,YNv:()=>Ah,IFm:()=>_h,o_F:()=>mh,kgP:()=>_m,ZYI:()=>oT,QXK:()=>xl,efz:()=>$l,Q5d:()=>Ml,Ysv:()=>Vl,UWq:()=>Hd,ocC:()=>qd,io3:()=>vi,Sbt:()=>Lo,roS:()=>Do,Ww1:()=>jo,QaS:()=>Nf,wsP:()=>Ir,ERZ:()=>rN,CL1:()=>TN,idV:()=>Hc,nIW:()=>un,x7Y:()=>A,fjE:()=>c_,sG0:()=>Hv,tV7:()=>Xl,g8o:()=>I_,Qy:()=>w_,t2P:()=>o_,KbW:()=>vo,wId:()=>_o,TAC:()=>AN,LS0:()=>Ao,bFH:()=>eE,Rgl:()=>rE,fW1:()=>cb,GFW:()=>dm,Ywp:()=>Lg,pg:()=>kT,WSA:()=>nE,ffJ:()=>jv,gEI:()=>Fv,fed:()=>dN,tT_:()=>$s,BgZ:()=>Gs,xIV:()=>Bs,KbL:()=>yf,JBA:()=>hn,aNC:()=>Rg,RFJ:()=>aT,Zeh:()=>Bm,OT5:()=>Dg,mC3:()=>Ll,kR6:()=>YN,gFw:()=>bb,NVY:()=>nb,k6v:()=>fT,FEC:()=>TT,L5S:()=>tb,Ob5:()=>gp,KUV:()=>_p,dvH:()=>rb,V3i:()=>_O,VD3:()=>gi,mm2:()=>Ku,rou:()=>Cm,izH:()=>Ka,DK$:()=>Xa,KMp:()=>Qf,c31:()=>Nn,mbo:()=>dy,gT8:()=>Sn,CZ8:()=>hs,uGi:()=>As,Poc:()=>_n,_9k:()=>Rs,ZTM:()=>gs,bwT:()=>Ns,tF$:()=>Rn,o96:()=>bs,M4S:()=>Ps,_vs:()=>Bf,xF8:()=>fd,PUO:()=>jh,ATu:()=>py,j1S:()=>wi,V3K:()=>Ri,Lmx:()=>Si,oSN:()=>Li,ZaZ:()=>An,n_1:()=>TE,N6e:()=>Hf,SxO:()=>yo,w3p:()=>ib,xU7:()=>Ar,hAq:()=>_r,Y_p:()=>Mo,$k6:()=>Fo,Gdl:()=>Kv,U6P:()=>Jv,OwB:()=>l_,hTh:()=>ch,xqc:()=>Ko,JvE:()=>Qo,i29:()=>Nc,dzT:()=>Ji,uPS:()=>Sf,cZV:()=>Rf,n3B:()=>lA,e6O:()=>rA,s7j:()=>A_,j$Q:()=>HE,PeS:()=>Py,kW2:()=>Ib,tH7:()=>qo,Yxg:()=>nl,bOT:()=>kv,MaZ:()=>Md,nqN:()=>kd,jWj:()=>Kd,o_J:()=>us,yW4:()=>PT,uT0:()=>_T,C82:()=>AT,bsH:()=>Ob,u9Z:()=>Um,LCU:()=>ym,J$m:()=>fE,j_Q:()=>Zy,OaI:()=>ef,wB1:()=>vN,SP6:()=>jT,ZYr:()=>hN,IMU:()=>iT,FoU:()=>WE,DVz:()=>eg,mxe:()=>oA,FHr:()=>Vm,D1g:()=>Dm,VO3:()=>Yg,de5:()=>Wg,Uw1:()=>wr,J6q:()=>yy,XCe:()=>lo,fbl:()=>jg,Ir:()=>bo,XQO:()=>Oo,QXb:()=>HT,zXF:()=>Eh,P8_:()=>Em,iiD:()=>Kf,MOC:()=>JT,WF:()=>qT,xE1:()=>Ci,idW:()=>DN,QWZ:()=>Nv,YL3:()=>gf,NW9:()=>Vv,D_E:()=>Nr,Fn9:()=>T,j2U:()=>Js,MpE:()=>Un,kQw:()=>Mn,mfm:()=>Au,vZp:()=>Tn,Wah:()=>my,E8K:()=>wN,VSb:()=>Es,vr_:()=>Fn,Vmh:()=>xN,FgW:()=>gO,oDv:()=>ps,fGG:()=>Pv,kuw:()=>ys,eHk:()=>Jd,Tt2:()=>cs,pQZ:()=>fs,oZ7:()=>Rv,T6Y:()=>ci,VRd:()=>On,_26:()=>Ou,YkM:()=>qn,J6y:()=>ou,njU:()=>fu,TBP:()=>ds,IT0:()=>Ey,x_:()=>Ch,FP6:()=>vn,biM:()=>up,TMl:()=>cp,Vkd:()=>mu,WiY:()=>f_,_zi:()=>hu,RZp:()=>Wy,J6D:()=>Ju,Lt4:()=>ii,QEi:()=>Qn,whI:()=>Ft,KIu:()=>xt,JhM:()=>le,C_0:()=>yi,lzc:()=>Np,qIF:()=>uA,O27:()=>E,aBi:()=>Op,xOX:()=>ll,EdS:()=>an,WgC:()=>nn,eEv:()=>Ln,A4t:()=>Tu,YOQ:()=>mn,Wos:()=>li,jWr:()=>Wa,Or$:()=>Yn,lhE:()=>Oi,CwH:()=>Kn,pzC:()=>al,ymH:()=>yu,QZu:()=>Bn,rYH:()=>y_,FVt:()=>si,Kn2:()=>pe,jgw:()=>Nu,Qgr:()=>Hu,OXP:()=>Ts,nsY:()=>ay,vyG:()=>ny,lS4:()=>Xn,g5f:()=>T_,fp6:()=>uu,Uty:()=>la,YkG:()=>Wn,xdS:()=>wn,kMF:()=>xp,$NE:()=>on,bC9:()=>rn,Ian:()=>Ii,KVV:()=>wh,q9e:()=>ko,iIf:()=>Qv,ian:()=>dl,m6e:()=>fi,OFd:()=>ol,kqr:()=>xn,fnZ:()=>kt,VFZ:()=>yl,ZiX:()=>zr,j5n:()=>ai,zkt:()=>N,Pcm:()=>ON,QDV:()=>il,M5u:()=>d_,laD:()=>sA,mtq:()=>Dn,CtB:()=>Xv,CBv:()=>se,I0t:()=>di,u1G:()=>Gd,gk1:()=>iA,Bgb:()=>nA,uzs:()=>Mt,v0l:()=>sc,Zqp:()=>gE,j0k:()=>Bo,l22:()=>KN,tCm:()=>dn,gmx:()=>iu,mOr:()=>ku,TwZ:()=>U_,GyU:()=>Ig,zGm:()=>xT,bMg:()=>sE,EyD:()=>Tg,FQA:()=>Eg,fZN:()=>cE,xsF:()=>yg,Lxg:()=>fg,O3l:()=>Df,Wni:()=>Cf,wRx:()=>_g,OxG:()=>XT,Jwg:()=>KT,uJQ:()=>QT,qWg:()=>Zv,i96:()=>FT,NPd:()=>Vu,MrZ:()=>Wo,zhn:()=>gg,G8q:()=>Or,Jct:()=>ad,A9Y:()=>ne,Y5F:()=>JA,gxP:()=>ce,c$P:()=>au,M7o:()=>jc,BBN:()=>co,fS6:()=>Ad,ZBU:()=>z,UkJ:()=>No,xkv:()=>Tm,z$M:()=>LN,KAm:()=>VE,lCl:()=>th,rkF:()=>My,IU6:()=>LT,RGr:()=>h,aYu:()=>m,ije:()=>Jl,Buf:()=>Jf,YLu:()=>Hl,ct9:()=>$o,XkY:()=>lE,T5R:()=>$T,uQS:()=>pE,wcJ:()=>xo,d$I:()=>Al,rSp:()=>lp,Sx:()=>bf,Ilm:()=>Dl,Ki6:()=>cl,VGk:()=>Wf,sFD:()=>Qb,eWN:()=>kN,dWE:()=>__,Lkd:()=>Kp,aDL:()=>Ym,yaA:()=>dE,lOh:()=>jm,DBr:()=>n_,hK$:()=>zl,uKH:()=>Lv,TZ_:()=>DT,CMB:()=>cA,FU8:()=>hf,J$p:()=>Km,b5s:()=>Jm,h2W:()=>pn,SL_:()=>Sm,oUH:()=>OT,ck9:()=>VT,RAb:()=>rc,nL:()=>qv,k$p:()=>zb,Xs0:()=>ql,u7I:()=>Lm,rxg:()=>wu,bji:()=>Iu,oCZ:()=>Dy,MjG:()=>Bg,FuV:()=>bT,$ju:()=>gT,t6d:()=>vT,m5F:()=>Sr,sx:()=>FN,rSc:()=>rg,U10:()=>tf,L8n:()=>rm,R9X:()=>mE,rj2:()=>bm,_C4:()=>IT,tCj:()=>mm,uAg:()=>UE,wx9:()=>Pd,KF3:()=>UT,ax9:()=>CT,HH7:()=>qf,ufV:()=>LE,_6y:()=>If,XTh:()=>Fg,AJo:()=>Pf,Ixr:()=>JE,oss:()=>QN,P6Y:()=>zN,q5j:()=>Ry,Bd_:()=>wy,xkB:()=>Sy,W41:()=>Im,WkI:()=>wm,sSE:()=>Ny,GMd:()=>Oc,jtL:()=>vc,Bxm:()=>Uy,FVh:()=>Oy,inb:()=>Cg,U_T:()=>iE,FTe:()=>oe,VGB:()=>ae,tM8:()=>Uu,Wfe:()=>$u,Ls5:()=>xu,$bd:()=>Du});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>_,durationToTimestamp:()=>Z,formatDate:()=>U,formatDateTime:()=>D,formatTime:()=>C,getEndOfDay:()=>I,getLocaleFormat:()=>A,getMomentFormatFromDateMask:()=>J,getMomentFormatFromDateTimeMask:()=>X,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>w,isDateInRange:()=>v,isToday:()=>N,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>g,parseTimestamp:()=>z,toLocalDate:()=>P,toUtcDate:()=>R});var a={};r.r(a),r.d(a,{addAttribute:()=>Lr,editAttribute:()=>jr,editEndDate:()=>Vr,editRoles:()=>Mr,editStartDate:()=>$r,editTags:()=>xr,removeAttribute:()=>Fr});var o={};r.r(o),r.d(o,{EventType:()=>Fh,applyCrosswalks:()=>Wh,collectCrosswalksFromAttributes:()=>Hh,compareActivenessAttributes:()=>Bh,compareAttributes:()=>Vh,compareImages:()=>Gh,compareRoles:()=>Kh,compareTags:()=>Jh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>zh});var l=r(50914);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=(e,t)=>r=>!!(0,l.isNil)(r)||f()(r).isBetween(e,t,"days","[]"),g=e=>e&&e.toDate(),_=e=>(e&&e.setHours(0,0,0,0),e),A=()=>`${f().localeData().longDateFormat("L")} ${f().localeData().longDateFormat("LTS")}`,N=e=>f()(e).isSame(Date.now(),"day"),P=e=>{const t=new Date(e),r=new Date("2023-01-05");return r.setFullYear(t.getUTCFullYear()),r.setMonth(t.getUTCMonth()),r.setDate(t.getUTCDate()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},R=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},S=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),w=S("startOf"),I=S("endOf"),U=e=>f()(e).format(f().localeData().longDateFormat("L")),C=e=>f()(e).format(f().localeData().longDateFormat("LTS")),D=e=>`${U(e)} ${C(e)}`,L=(0,l.equals)("9"),j=(0,l.equals)("99"),k=(0,l.equals)("9999"),F=(0,l.test)(/^[az][az][az]$/),M=(0,l.test)(/^[az][az][az][az]$/),x=(0,l.test)(/^9+$/),$=(0,l.test)(/^[9az]+$/),V=(0,l.cond)([[L,(0,l.always)("M")],[j,(0,l.always)("MM")],[F,(0,l.always)("MMM")],[M,(0,l.always)("MMMM")],[$,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),G=(0,l.cond)([[L,(0,l.always)("D")],[j,(0,l.always)("DD")],[$,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),B=(0,l.cond)([[L,(0,l.always)("y")],[j,(0,l.always)("YY")],[k,(0,l.always)("YYYY")],[x,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),W=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),L),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),j),(0,l.always)("hh")],[L,(0,l.always)("H")],[j,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),Y=(0,l.cond)([[L,(0,l.always)("m")],[j,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),q=(0,l.cond)([[L,(0,l.always)("s")],[j,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),H=/([9az]+)([^9az]+)*/g,J=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[V(e),r,G(n),i,B(a),o])}return e},K=/(9+)([^9]+)*/g,Q=e=>{const t=[...e.toLowerCase().matchAll(K)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[W(e,s),r,Y(n),i,a?q(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},X=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${J(t)} ${Q(r)}`},z=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Z=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},ee=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt(0))).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class te{constructor(e){this.value=void 0,this.value=e}isNone(){return(0,l.isNil)(this.value)}extract(){return this.value}orSome(e){return(0,l.isNil)(this.value)?e:this.value}map(e){return(0,l.isNil)(this.value)?te.None():te.Some(e(this.value))}static Some(e){return new te(e)}static None(){return new te(null)}static fromFalsy(e){return e?te.Some(e):te.None()}static fromNull(e){return(e=>null==e)(e)?te.None():te.Some(e)}static fromUndefined(e){return void 0===e?te.None():te.Some(e)}static fromEmpty(e){return E(e)?te.None():te.Some(e)}}const re=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},ne=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},ie=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ae=e=>Array.isArray(e)?e:[e],oe=e=>[e],se=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),le=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),ue=e=>le(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,ce=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),pe=e=>null!=e&&["object","function"].includes(typeof e),de=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),pe(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var ye=r(2507),fe=r.n(ye);const Te={EQUALS:"equals",NOT_EQUALS:"not equals",EXISTS:"exists",FULL_TEXT:"fullText",HAS_ALL:"hasAll",MISSING_VALUE:"missing",IN_RANGE:"range",LT:"lt",LTE:"lte",GT:"gt",GTE:"gte",STARTS_WITH:"startsWith",COUNT_EQUALS:"count.equals",COUNT_NOT_EQUALS:"count.not.equals",COUNT_LT:"count.less",COUNT_LTE:"count.less.or.equals",COUNT_GT:"count.greater",COUNT_GTE:"count.greater.or.equals",COUNT_RANGE:"count.range",IN_FILE:"in.file",NOT_IN_FILE:"not.in.file",CONTAINS:"contains",ON:"on",BEFORE:"before",AFTER:"after",WITHIN:"within"},Ee={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},me={[Te.EQUALS]:"equals",[Te.NOT_EQUALS]:"not",[Te.STARTS_WITH]:"starts with",[Te.MISSING_VALUE]:"missing value",[Te.IN_RANGE]:"in range",[Te.HAS_ALL]:"has all",[Te.FULL_TEXT]:"full text",[Te.EXISTS]:"exists",[Te.COUNT_EQUALS]:"count equals",[Te.COUNT_NOT_EQUALS]:"count not equal",[Te.COUNT_LT]:"count less",[Te.COUNT_LTE]:"count less or equal",[Te.COUNT_GT]:"count greater",[Te.COUNT_GTE]:"count greater or equal",[Te.COUNT_RANGE]:"count in range",[Te.LT]:"less than",[Te.LTE]:"less than or equal",[Te.GT]:"greater than",[Te.GTE]:"greater than or equal",[Te.IN_FILE]:"in file",[Te.NOT_IN_FILE]:"not in file",[Te.CONTAINS]:"contains",[Te.ON]:"on",[Te.BEFORE]:"before",[Te.AFTER]:"after",[Te.WITHIN]:"within"};var he;!function(e){e.IN="in",e.NOT_IN="notIn",e.NOT_IN_RANGE="not range"}(he||(he={}));const be=e=>({[he.IN]:Te.EQUALS,[he.NOT_IN]:Te.NOT_EQUALS}[e]||e);var Oe,ve;!function(e){e.LAST_DAY="lastDay",e.LAST_WEEK="lastWeek",e.LAST_MONTH="lastMonth",e.LAST_6MONTHS="last6Months",e.LAST_YEAR="lastYear",e.PICK_DATE="pickDate"}(Oe||(Oe={})),function(e){e.LAST_3DAYS="last3Days"}(ve||(ve={}));const ge=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Oe[t]||ve[t],e)),{}),_e={[Oe.LAST_DAY]:"Last 24 hours",[ve.LAST_3DAYS]:"Last 3 days",[Oe.LAST_WEEK]:"Last 7 days",[Oe.LAST_MONTH]:"Last month",[Oe.LAST_6MONTHS]:"Last 6 months",[Oe.LAST_YEAR]:"Last year",[Oe.PICK_DATE]:"Pick date"},Ae={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Ne={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Pe="<No label>",Re="__number";var Se;let we,Ie,Ue,Ce,De,Le,je,ke,Fe,Me,xe,$e,Ve,Ge,Be,We,Ye,qe,He,Je,Ke,Qe,Xe,ze,Ze,et,tt,rt,nt,it,at,ot,st,lt,ut,ct,pt,dt,yt,ft;var Tt;!function(e){e.IN="in",e.OUT="out"}(Se||(Se={})),function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(we||(we={})),function(e){e.local="local",e.validationService="validationService"}(Ie||(Ie={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(Ue||(Ue={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Ce||(Ce={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(De||(De={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Le||(Le={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(je||(je={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(ke||(ke={})),function(e){e.asc="asc",e.desc="desc"}(Fe||(Fe={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Me||(Me={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(xe||(xe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}($e||($e={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Ve||(Ve={})),function(e){e.PROFILE="profile",e.MAP="map"}(Ge||(Ge={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Be||(Be={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(We||(We={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ye||(Ye={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(qe||(qe={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(He||(He={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Je||(Je={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(Ke||(Ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Qe||(Qe={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Xe||(Xe={})),function(e){e.IN="in",e.OUT="out"}(ze||(ze={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ze||(Ze={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(et||(et={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(tt||(tt={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.SingleAttribute="com.reltio.plugins.entity.attributes.SingleAttributeView",e.AttributeTable="com.reltio.plugins.entity.attributes.AttributeTableView",e.Custom="com.reltio.plugins.ui.CustomActionView",e.Map="com.reltio.plugins.react.EntityMapView",e.ImageAttribute="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatches="com.reltio.plugins.entity.PotentialMatchesView"}(rt||(rt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(nt||(nt={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting",e.DCRReview="DCRReview"}(it||(it={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(at||(at={})),function(e){e.NEW="new",e.CLASSIC="classic"}(ot||(ot={})),function(e){e.ASC_BY_NAME="ascByName"}(st||(st={})),function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network",e.TREE="Tree"}(lt||(lt={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(ut||(ut={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(ct||(ct={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(pt||(pt={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(dt||(dt={})),function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(yt||(yt={})),function(e){e.percent="percent"}(ft||(ft={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Tt||(Tt={}));const Et=Tt;let mt,ht;function bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ot(e,t,r[t])}))}return e}function Ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(mt||(mt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(ht||(ht={}));const vt={startDate:{type:Et.TYPE_ACTIVENESS_DATE,get label(){return fe().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Et.TYPE_ACTIVENESS_DATE,get label(){return fe().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},gt=bt({id:{type:Et.TYPE_ENTITY_ID,get label(){return fe().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},vt,{roles:{type:Et.TYPE_STRING,get label(){return fe().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Et.TYPE_STRING,get label(){return fe().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),_t={workflow:{type:Et.TYPE_STRING,get label(){return fe().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Et.TYPE_STRING,get label(){return fe().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Et.TYPE_STRING,get label(){return fe().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},At={commenter:{type:Et.TYPE_STRING,get label(){return fe().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Nt={notResolved:{type:Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return fe().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Pt={createdBy:{type:Et.TYPE_STRING,get label(){return fe().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Et.TYPE_STRING,get label(){return fe().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Rt={matches:{type:Et.TYPE_COUNT,get label(){return fe().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Et.TYPE_COUNT,get label(){return fe().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0},relevanceScore:{type:Et.TYPE_FLOAT,get label(){return fe().text("Relevance scores")},uri:"relevanceScore",name:"relevanceScores.relevance",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchAction:{type:Et.TYPE_STRING,get label(){return fe().text("Match action")},uri:"matchAction",name:"relevanceScores.actionLabel",singleValue:!0,hideForDataTenant:!0,faceted:!0}},St={sourceSystems:{type:Et.TYPE_STRING,get label(){return fe().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Et.TYPE_STRING,get label(){return fe().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Et.TYPE_INT,get label(){return fe().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Et.TYPE_TIMESTAMP,get label(){return fe().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Et.TYPE_STRING,get label(){return fe().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let wt;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(wt||(wt={}));const It={[wt.matchRules]:{type:Et.TYPE_STRING,get label(){return fe().text("Match Rules")},uri:wt.matchRules,name:wt.matchRules,faceted:!0,hideForDataTenant:!0},[wt.MLRecommendedMatch]:{type:Et.TYPE_STRING,get label(){return fe().text("Match IQ")},uri:wt.MLRecommendedMatch,name:wt.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Ut=bt({},gt,_t,At,Nt,Pt,Rt,St,It,{type:{type:Et.TYPE_STRING,get label(){return fe().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Ct="NOT_MATCH";var Dt=r(13980),Lt=r.n(Dt);const jt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},kt=(0,l.equals)(jt.SUGGESTING),Ft=(0,l.equals)(jt.EDITING),Mt=(0,l.equals)(jt.VIEWING),xt=(0,l.either)(Ft,kt);function $t(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vt(e,t,r[t])}))}return e}function Vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=Lt().oneOf(["mobile","tablet","desktop"]),Bt=Lt().shape({deviceTypes:Lt().oneOfType([Gt,Lt().arrayOf(Gt)]),roles:Lt().arrayOf(Lt().string)}),Wt=Lt().shape({value:Lt().string,lookupCode:Lt().string}),Yt=Lt().shape({displayName:Lt().string,parent:Lt().string}),qt=Lt().oneOfType([Lt().string,Lt().number,Lt().bool,Wt]),Ht=Lt().oneOfType([qt,Lt().arrayOf(qt)]),Jt=Lt().shape({fieldName:Lt().string,values:Lt().arrayOf(Ht),filter:Lt().string,type:Lt().string}),Kt=Lt().shape({minValue:Lt().number,maxValue:Lt().number}),Qt=Lt().shape({label:Lt().string,name:Lt().string,description:Lt().string,type:Lt().string,hidden:Lt().bool,faceted:Lt().bool,searchable:Lt().bool,uri:Lt().string,access:Lt().arrayOf(Lt().string),cardinality:Kt}),Xt=Lt().shape({label:Lt().string,uri:Lt().string,typeColor:Lt().string,direction:Lt().string,startObject:Lt().object,endObject:Lt().object}),zt=Lt().shape({typeColor:Lt().string,typeIcon:Lt().string,typeImage:Lt().string,label:Lt().string,uri:Lt().string,attributes:Lt().arrayOf(Qt)}),Zt=Lt().shape({uri:Lt().string,label:Lt().string,memberTypes:Lt().array,extendsTypeUri:Lt().string,attributes:Lt().arrayOf(Qt)}),er=Lt().shape({uri:Lt().string,label:Lt().string,extendsTypeUri:Lt().string,relationshipTypeURIs:Lt().arrayOf(Lt().string)}),tr=Lt().shape({uri:Lt().string,description:Lt().string,label:Lt().string,schemaVersion:Lt().string,entityTypes:Lt().arrayOf(zt),roles:Lt().arrayOf(Lt().object),groupTypes:Lt().arrayOf(Lt().object),relationTypes:Lt().arrayOf(Xt),graphTypes:Lt().arrayOf(er),interactionTypes:Lt().arrayOf(Zt),sources:Lt().arrayOf(Lt().object)}),rr=Lt().shape({uri:Lt().string,type:Lt().string}),nr=Lt().shape({uri:Lt().string,type:Lt().string}),ir=Lt().shape({value:Lt().object,ov:Lt().bool,type:Lt().string,uri:Lt().string}),ar=Lt().shape({refEntity:Lt().oneOfType([Lt().array,Lt().object]),refRelation:Lt().oneOfType([Lt().array,Lt().object]),value:Lt().object,ov:Lt().bool,type:Lt().string,uri:Lt().string}),or=Lt().oneOf((0,l.values)(jt)),sr=Lt().shape({type:Lt().oneOf(Object.values(we)).isRequired,attributeTypeUri:Lt().string.isRequired,parentUri:Lt().string.isRequired,uri:Lt().string,message:Lt().string}),lr={attributeType:Qt,showEmptyEditors:Lt().bool,lazy:Lt().bool,mode:or,metadata:tr,ownError:sr,errors:Lt().arrayOf(sr),crosswalks:Lt().array,onAddAttributes:Lt().func,onAddOneMore:Lt().func,onDeleteAttribute:Lt().func,onChangeAttribute:Lt().func,additionalControlsRenderer:Lt().func,hideDeleteButton:Lt().bool,showNonOv:Lt().bool,state:Lt().oneOf(["deleted","edited"]),expanded:Lt().bool},ur=$t({attributeValue:ir},lr),cr=$t({attributeValue:ar},lr),pr=Lt().shape({value:Lt().oneOfType([Lt().string,Lt().bool,Lt().number]),ov:Lt().bool,type:Lt().string,uri:Lt().string,lookupCode:Lt().string,lookupRawValue:Lt().string}),dr=Lt().shape({inRelations:Lt().arrayOf(Lt().oneOfType([Lt().object,Lt().string])),outRelations:Lt().arrayOf(Lt().oneOfType([Lt().object,Lt().string])),groups:Lt().arrayOf(Lt().string),entityTypes:Lt().arrayOf(Lt().string),nextEntry:Lt().object}),yr=Lt().oneOf(["asc","desc"]),fr=Lt().shape({id:Lt().string,content:dr,allowOnlyCreateNew:Lt().bool,sortColumn:Lt().string,sortOrder:yr,"text-empty":Lt().string,max:Lt().number,icon:Lt().string,caption:Lt().string,canCreate:Bt,canRead:Bt,canUpdate:Bt,canDelete:Bt,editingEnabled:Lt().bool}),Tr=Lt().shape({entityUri:Lt().string,entityType:Lt().string,entityLabel:Lt().string,object:rr}),Er=Lt().shape({relationUri:Lt().string,relationType:Lt().string,relationLabel:Lt().string,direction:Lt().string,object:nr}),mr=Lt().shape({entity:Tr,relation:Er}),hr=Lt().shape({value:Lt().string,isRawFilter:Lt().bool}),br=Lt().shape({id:Lt().string,label:Lt().string,name:Lt().string,availableEntityTypes:Lt().array}),Or=[{label:fe().text("And"),value:"and"},{label:fe().text("Or"),value:"or"},{label:fe().text("And not"),value:"and not"},{label:fe().text("Or not"),value:"or not"}],vr="___!status_code!___",gr=(0,l.when)((0,l.is)(Object),JSON.stringify),_r=e=>{var t;return(null==e?void 0:e[vr])||(null==e||null===(t=e.originalResponse)||void 0===t?void 0:t.status)},Ar=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([[(0,l.prop)("originalResponse"),(0,l.pipe)((0,l.path)(["originalResponse","status"]),(e=>((e,t)=>{switch(e){case 400:return fe().text("Bad Request");case 403:return fe().text("Forbidden");case 404:return fe().text("Not Found");case 405:return fe().text("Method Not Allowed");case 408:return fe().text("Request Timeout");case 500:return fe().text("Internal Server Error");case 502:return fe().text("Bad Gateway");case 503:return fe().text("Service Unavailable");case 504:return fe().text("Gateway Timeout");default:return t||fe().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),gr)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,gr]])(e)},Nr=e=>"AbortError"===e.name,Pr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},Rr=/[\n\r%#()<>?[\\\]^`{}|]/g,Sr=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(Rr,encodeURIComponent)}`,wr=e=>`data:image/gif;base64,${e}`,Ir=e=>{switch(e){case"minutes":return fe().text("minutes");case"hours":return fe().text("hours");case"days":return fe().text("days");case"weeks":return fe().text("weeks");case"months":return fe().text("months");case"years":return fe().text("years");default:return""}};var Ur=r(76665);function Cr(e,t,r,n){if(null==t){const i=`\n Uri is null or undefined.\n getPartInfo parameters when the error occurred:\n 1. name - ${e}\n 2. uri - ${t}\n 3. fullUri - ${r}\n 4. attrType - ${pe(n)?JSON.stringify(n):n}\n `;console.error(i)}const i={name:e,valueUri:r.substr(0,r.indexOf(t)+t.length)};return n&&n.uri&&(i.uri=n.uri.substr(0,n.uri.indexOf(e)+e.length)),i.hasChildren=i.valueUri!==r,i}function Dr(e,t){const r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[];for(let i=0;i<r.length;i+=2)n.push(Cr(r[i],r[i+1],e,t));return n}function Lr(e,t,r,n,i,a,o){void 0===a&&(a=0);const s=Dr(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n addAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n index: ${o}\n `;console.error(s)}if(s.hasChildren)return e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]),Lr(e[s.name].find((function(e){return e.uri===s.valueUri})).value,t,r,n,i,a+1,o);{if(e[s.name]||(e[s.name]=[]),null==n)return;const a=e[t.name],l=n,u=n;let c={value:n.refEntity||pe(l.value)&&!Array.isArray(l.value)?l.value:n,uri:r,type:t.uri};if(n.lookupCode){const e=c,t=n;e.value=t.value,e.lookupCode=t.lookupCode,c=e}if(u.refEntity){const e=c;e.refEntity=u.refEntity,e.label=u.label,c=e}if(u.refRelation){const e=c;e.refRelation=u.refRelation,c=e}return i&&(c.crosswalks=i),a.splice(o||0,0,c),n}}function jr(e,t,r,n,i,a){void 0===a&&(a=0);const o=Dr(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n editAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n value: ${JSON.stringify(n)}\n crosswalks: ${JSON.stringify(i)}\n nestingLevel: ${a}\n `;console.error(o)}if(!o.hasChildren){const o=e[t.name];let s,l=o&&o.find((function(e){return e.uri===r}));if(l){if("[object Object]"!==l.value.toString())kr(n,l),i&&(l.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&o.filter((function(e){return!1===e.ov})).forEach(kr.bind(null,n));else if(function(e){return void 0!==e.refEntity}(n)){const e=l;e.refRelation=n.refRelation,e.refEntity=n.refEntity,e.value=n.value,e.label=n.label,l=e}else null!==n.value&&void 0!==n.value&&null!==l.value&&"object"==typeof l.value&&(l.value=n.value,l.label=n.label);s=l.value}else s=Lr(e,t,r,n,i,a);return s}{const s=jr(e,o,o.valueUri,{},i,a);jr(s,t,r,n,i,a+1)}}function kr(e,t){!function(e){return pe(e)}(e)?(t.value=e,t.lookupCode&&(t.lookupCode=e)):(t.value=e.value,t.lookupCode=e.lookupCode)}function Fr(e,t,r,n){void 0===n&&(n=0);const i=Dr(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(Dr(r,t))}\n removeAttribute params when error occurred:\n attributes: ${JSON.stringify(e)}\n attrType: ${JSON.stringify(t)}\n uri: ${r}\n nestingLevel: ${n}\n `;console.error(i)}if(i.hasChildren){const a=(e[i.name]||[]).find((function(e){return e.uri===i.valueUri}));a&&Fr(a.value,t,r,n+1)}else{const n=e[t.name];n&&(n.forEach((function(e,t){e.uri===r&&n.splice(t,1)})),0===n.length&&delete e[t.name])}}function Mr(e,t){e.roles=t||[]}function xr(e,t){e.tags=t||[]}function $r(e,t){e.startDate=t}function Vr(e,t){e.endDate=t}var Gr=r(37164);const Br="1Tempo4rary",Wr="1Tepmo4Rel",Yr=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),qr=(0,Gr.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Hr=()=>`${qr()}${Date.now()}`,Jr=()=>`1Tempo4DCR${Hr()}`,Kr=e=>`${e}/uri$$${Hr()}`,Qr=e=>()=>Kr(e),Xr=(e,t)=>{const r=Yr(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Kr(n)},zr=e=>e&&e.includes("uri$$"),Zr=Qr("entities"),en=Qr("relations"),tn=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),rn=(0,l.startsWith)("relations/"),nn=(0,l.startsWith)("entities/"),an=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),on=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),sn=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),ln=(0,l.pipe)((0,l.split)("/"),l.head),un=(0,l.pipe)((0,l.split)("/"),l.last),cn=e=>e.split(".").slice(0,2).join("."),pn=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},dn=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),yn=(e,t)=>{const r=e.split("/"),n=t.split("/");return 2===r.length?t:[n,r.slice(2,3),r.slice(3).map(((e,t)=>t%2?r[2]:e))].flat().slice(0,-1).join("/")},fn=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Tn=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),En=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},mn=e=>5===e.split("/").length,hn=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},bn=e=>e.replace(/uri\$\$/g,Br),On=e=>null==e?void 0:e.startsWith("changeRequests/"),vn=e=>On(e)&&e.includes("/changes/"),gn=e=>e.split("/changes/")[1],_n=(0,l.prop)("referencedEntityTypeURI"),An=(0,l.prop)("relationshipTypeURI"),Nn=(0,l.prop)("referencedAttributeURIs"),Pn=(0,l.curry)(((e,t)=>(0,l.pipe)(Nn,(0,l.filter)((0,l.startsWith)(e)))(t))),Rn=Pn("configuration/relationTypes"),Sn=Pn("configuration/entityTypes"),wn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),In=(0,l.filter)(wn),Un=(e,t)=>!t||t.some((t=>sn(e.uri,t)));function Cn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dn=e=>(0,l.allPass)([(0,l.propSatisfies)((0,l.anyPass)([l.isNil,xn,an]),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Et.TYPE_STRING)])(e),Ln=(0,l.has)("values"),jn=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Et.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Et.TYPE_LOOKUP)],[Ln,(0,l.always)(Et.TYPE_ENUM)],[Dn,(0,l.always)(Et.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Et.TYPE_BOOLEAN),(0,l.always)(Et.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),kn=(0,l.pipe)((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cn(e,t,r[t])}))}return e}({},e,{type:jn(e)})),(0,l.pick)(["type","values","lookupCode","uri","name","dependentLookupCode","singleValue"])),Fn=e=>!!e&&(!!e.autoGenerated&&e.type!==Et.TYPE_NESTED||!!e.parentAutoGenerated),Mn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),xn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.startsWith)("configuration/"),l.not),$n=e=>Mn(e)?"analyticsAttributes":"attributes",Vn=(0,l.propEq)("hidden",!0),Gn=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Bn=Gn(Et.TYPE_NESTED),Wn=Gn(Et.TYPE_REFERENCE),Yn=Gn(Et.TYPE_IMAGE),qn=(0,l.either)(Bn,Wn),Hn=(e,t)=>{const r=Mn(e)?"analyticsAttributes":"attributes",n=e.split(`/${r}/`);return[r,...Array.isArray(t)?[...(0,l.chain)((0,l.prop)("name"),t),(0,l.last)(n)]:[...n.slice(1)]].join(".")},Jn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Kn=(0,l.pipe)(Jn,Boolean),Qn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Xn=(0,l.both)(Kn,(0,l.pipe)(Jn,("rdm",(0,l.pipe)(ln,(0,l.equals)("rdm")))));const zn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=$n({uri:t}),i=e=>e.split(`/${n}/`).length,a=(e.entityTypes||[]).concat(e.relationTypes||[]),o=r?a.find((0,l.propEq)("uri",r)):null,s=o?i(o.uri):0,u=(r,i)=>{const o=t.split(`/${n}/`).slice(0,i+1).join(`/${n}/`),s=(0,l.last)(o.split(`/${n}/`)),c=(r?r[n]||ei(e,r)||[]:a).find((e=>{let{uri:t,name:r}=e;return t===o||r===s})),p=c?[c]:[];return c&&o!==t&&p.push(...u(c,i+1)),p},c=u(o,s),p=c.length===i(t)-s;return p?c:[]},Zn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=zn(e,t,r);return n.length?(0,l.last)(n):null},ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;return(0,l.cond)([[(0,l.has)("analyticsAttributes"),(0,l.prop)("analyticsAttributes")],[(0,l.anyPass)([(0,l.propEq)("type",Et.TYPE_NESTED),(0,l.propEq)("type",Et.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Et.TYPE_REFERENCE),(0,l.pipe)(Nn,(0,l.map)((t=>Zn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},ti=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{entityTypes:[]},t=arguments.length>1?arguments[1]:void 0;const r=ei(e,t);return r&&Wn(t)?In(r):r},ri=[Et.TYPE_ACTIVENESS_DATE,Et.TYPE_DATE,Et.TYPE_TIMESTAMP,Et.TYPE_LOCAL_DATE],ni=[Et.TYPE_ACTIVENESS_DATE,Et.TYPE_TIMESTAMP,Et.TYPE_LOCAL_DATE],ii=e=>ri.includes(e),ai=e=>ni.includes(e),oi=[Et.TYPE_INT,Et.TYPE_LONG,Et.TYPE_NUMBER,Et.TYPE_FLOAT,Et.TYPE_DOUBLE,Et.TYPE_COUNT],si=e=>oi.includes(e),li=e=>[Et.TYPE_FLOAT,Et.TYPE_DOUBLE].includes(e),ui=[Et.TYPE_BOOLEAN,Et.TYPE_BOOLEAN_RADIO,Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED],ci=e=>ui.includes(e),pi=[Et.TYPE_URL,Et.TYPE_BLOG_URL,Et.TYPE_IMAGE_URL],di=e=>pi.includes(e),yi=Gn(Et.TYPE_EMAIL),fi=e=>Et.TYPE_SSN===e;var Ti,Ei=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Ti||(Ti={}));const mi=(0,l.curry)(((e,t,r)=>{var n;const i=e===Ti.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),hi=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),bi=(0,l.curry)(((e,t)=>(0,l.pipe)(hi(e),(0,l.prop)("extendsTypeURI"))(t))),Oi=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(bi(e,r)));return n(r)})),vi=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=bi(e,n);return r})),gi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?gi(e,hi(e,t.extendsTypeURI),r):void 0,_i=(e,t)=>{const r=t.map(vi(e));return(r.length?r.reduce(l.intersection):[])[0]},Ai=(e,t)=>gi(e,"string"==typeof t?hi(e,t):t,"typeImage"),Ni=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Oi(e,t,n.uri)?r.concat(n.uri):r),[]);function Pi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ri=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Si=(0,l.pipe)(Ri,(0,l.propOr)("","label")),wi=(0,l.curry)(((e,t)=>{const r=Ri(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),Ii=(0,l.curry)(((e,t,r)=>{const[n,i]=wi(e,r);return Oi(e,n,t)||Oi(e,i,t)})),Ui=(0,l.pipe)((0,l.propOr)([],"relationTypes"),(0,l.reduce)(((e,t)=>{let{uri:r,label:n}=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ci=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?Se.OUT:Se.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(Se.IN),i=r(Se.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Di=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Li=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Li(e,Ri(e,t.extendsTypeURI),r):void 0;var ji;!function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE",e.INITIATE_CHANGE_REQUEST="INITIATE_CHANGE_REQUEST",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(ji||(ji={}));const ki=(0,l.curry)(((e,t)=>e.every((e=>Fi(e,t))))),Fi=(0,l.curry)(((e,t)=>{const r=Fn(t);return Mi(e,t)&&(e===ji.READ||!r)})),Mi=(e,t)=>!t||!t.access||t.access.includes(e),xi=(0,l.curry)(((e,t,r)=>Fi(ji.READ,r)&&(kt(t)?Fi(ji.INITIATE_CHANGE_REQUEST,r):Fi(e,r)))),$i=xi(ji.CREATE),Vi=xi(ji.DELETE),Gi=xi(ji.UPDATE),Bi=ki([ji.CREATE,ji.MERGE,ji.READ,ji.UPDATE]),Wi=ki([ji.UPDATE,ji.READ,ji.CREATE]),Yi=ki([ji.UPDATE,ji.READ]),qi=ki([ji.DELETE,ji.UPDATE,ji.READ]),Hi=(0,l.curry)(((e,t,r)=>e[r]||e[((e,t)=>(0,l.pipe)((0,l.propOr)([],"matchGroups"),(0,l.find)((0,l.propEq)("uri",t)),(0,l.defaultTo)({}),(0,l.prop)("type"))(e))(t,r)]||e["*"])),Ji=(e,t,r)=>(0,l.pipe)((0,l.map)(Hi(e,t)),(0,l.filter)(l.identity))(r),Ki=(e,t,r)=>{const n=Ji(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Fi(ji.MERGE,r)},Qi=(0,l.curry)(((e,t,r,n)=>{const i=Ri(e,n),[a,o]=wi(e,n);return i&&Fi(ji.CREATE,i)&&Oi(e,a,t.type)&&Oi(e,o,r.type)})),Xi=(e,t,r,n,i)=>{const a=hi(e,n.type),o=Ji(t,a,r).map((e=>{let{createRelation:t}=e;return t})).filter(l.identity);return o.some((t=>{let{inRelations:r=[],outRelations:a=[]}=t;return r.some(Qi(e,n,i))||a.some(Qi(e,i,n))}))},zi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=hi(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Ki(o,i,a),canAddRelation:Xi(e,o,i,r,n),canMark:Fi(ji.UPDATE,a)&&Fi(ji.READ,a)}},Zi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>zi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),ea=Mn,ta=(0,l.complement)(ea),ra=Fi(ji.READ),na=e=>{let{attributeType:t,mode:r}=e;return ta(t)&&$i(r,t)&&!Vn(t)},ia=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=zr(r.uri),o=Gi(n),s=$i(n);return(0,l.cond)([[ea,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},aa=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=zr(r.uri),s=Gi(n),u=Vi(n),c=sa(ji.UPDATE,n,a,r),p=sa(ji.DELETE,n,a,r);return(0,l.cond)([[ea,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},oa=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&ei(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!Mi(e,n)||!oa(e,t,r[n.name],n)))))})),sa=(0,l.curry)(((e,t,r,n,i)=>kt(t)?oa(ji.INITIATE_CHANGE_REQUEST,r,n,i):oa(e,r,n,i))),la=(0,l.both)((0,l.complement)(Vn),ra),ua="SuperUser",ca="allTenants",pa=[ca,"allCustomers"],da=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions||void 0!==(null==e?void 0:e.roles);case r.ADMIN:return(e=>t=>((null==t?void 0:t.roles)||[]).includes(e))(r.ADMIN);default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===ua})).filter((e=>{const t=e.split(":"),[i,a=""]=t;let o=a.split(".");return o=(0,l.endsWith)(["*"],o)?o.slice(0,-1):o,(0,l.startsWith)(o,r.resourcePath)||((e,t,r)=>{if(e===ua){const e=r?pa.concat(r.map((e=>`allTenants.${e}`))):pa,n=r&&t[0]===ca?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},ya={NON_SECURED:"NON_SECURED",SECURED:"SECURED",ADMIN:"ROLE_ADMIN",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF",CAN_READ_PREFERENCES:"CAN_READ_PREFERENCES",CAN_UPDATE_PREFERENCES:"CAN_UPDATE_PREFERENCES",CAN_CREATE_PREFERENCES:"CAN_CREATE_PREFERENCES",CAN_DELETE_PREFERENCES:"CAN_DELETE_PREFERENCES"},fa={[ya.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[ya.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[ya.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[ya.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[ya.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ya.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ya.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ya.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ya.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ya.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ya.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ya.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ya.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ya.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ya.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ya.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ya.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ya.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ya.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ya.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ya.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ya.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ya.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ya.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ya.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ya.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ya.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ya.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ya.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ya.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Ta=(0,l.curry)(((e,t,r)=>da({allowedPermissionsNames:e,permissionsNames:ya,permissionsConfig:fa}).some((e=>e(t,{params:{tenant:r}}))))),Ea=Ta([ya.CAN_EXPORT]),ma=Ta([ya.CAN_EXPORT_ACTIVITIES]),ha=Ta([ya.CAN_IMPORT_ENTITIES_FROM_DT]),ba=Ta([ya.CAN_READ_ENTITIES_FROM_DT]),Oa=Ta([ya.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),va=Ta([ya.CAN_UPDATE_PROCESS_INSTANCE]),ga=Ta([ya.CAN_VIEW_WORKFLOW_DEFINITION]),_a=Ta([ya.CAN_CONFIG_ENVIRONMENT_REGISTER]),Aa=Ta([ya.CAN_UPDATE_WORKFLOW_DATA_TASK]),Na=Ta([ya.CAN_READ_WORKFLOW_DATA_TASK]),Pa=Ta([ya.CAN_MANAGE_WORKFLOW_DEFINITION]),Ra=Ta([ya.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Sa=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),wa=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ia=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ua=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ca=Ta([ya.CAN_EXECUTE_WORKFLOW_JOBS]),Da=Ta([ya.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),La=Ta([ya.CAN_CREATE_CONFIG_JAR]),ja=Ta([ya.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ka=Ta([ya.CAN_VIEW_CONFIG_JAR]),Fa=Ta([ya.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ma=Ta([ya.CAN_VIEW_WORKFLOW_JOBS]),xa=Ta([ya.CAN_MAKE_BULK_UPDATE]),$a=Ta([ya.CAN_OPEN_DATA_LOADER_EXECUTE,ya.CAN_OPEN_DATA_LOADER_READ]),Va=Ta([ya.CAN_BULK_DELETE_PROFILES]),Ga=Ta([ya.CAN_READ_MDM_DATA_ENTITIES]),Ba=Ta([ya.CAN_READ_DVF]),Wa=Ta([ya.IS_FREEMIUM_ADMIN]),Ya=(0,l.reject)(Vn),qa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ya,(0,l.filter)(e))(t),Ha=(0,l.curry)(((e,t)=>qa((t=>na({attributeType:t,mode:e})),t))),Ja=(0,l.curry)(((e,t)=>qa((t=>na({attributeType:t,mode:e})||la(t)),t))),Ka=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(la)),Qa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Qa(e)])))),Xa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(la),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Xa(e)])))),za=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...za(e)])))),Za=(0,l.pipe)(hi,(0,l.converge)(l.concat,[Xa,za]));function eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){to(e,t,r[t])}))}return e}function to(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ro=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,ro(e)))},t))),no=e=>{var t;return eo({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},io=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),ao=(0,l.when)(io,(0,l.dissoc)("values")),oo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return eo({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),so=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},lo=(0,Ei.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Qa,t).concat((0,l.chain)(Qa,r)).some(so)})),uo=e=>{let t=!1;const r=ro((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?eo({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},co=e=>{const t=lo(e),r=(0,l.map)((e=>ro((0,l.pipe)(ao,(0,l.when)((0,l.always)(e),oo))))(t)),n=(0,l.map)(no),i=(0,l.map)(uo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},po=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),yo=(0,l.prop)("relationshipTypeURIs"),fo=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(To(e,t)))||[]})),To=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(Ii(e,t))},Eo=(e,t)=>(0,l.pipe)(po,(0,l.defaultTo)({}),yo,(0,l.defaultTo)([]),(0,l.chain)(wi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(hi(e)))(e,t),mo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),ho=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),bo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ho((0,l.complement)(mo))(e)},Oo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ho(mo)(e)},vo=(0,l.pipe)(hi,(0,l.propOr)([],"matchGroups")),go=(e,t,r)=>(0,l.pipe)(vo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),_o=(0,l.curry)(((e,t,r)=>(0,l.pipe)(go,(0,l.propOr)(r,"label"))(e,t,r))),Ao=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(vo,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),No=e=>(0,l.partition)(mo,e),Po=(0,l.includes)(l.__,["and","or","not"]),Ro=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),So=(0,l.includes)(l.__,["equals","notEquals","in"]),wo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return Po(t)?wo(r):Ro(t)?r.filter(an):So(t)?r.map((0,l.prop)("uri")).filter(an):[]})),l.uniq),Io=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(wo),l.uniq),Uo=(0,l.pipe)(vo,Io),Co=(0,l.pipe)(Ao,Io),Do=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Lo=(0,l.pipe)(Do,Xa),jo=(e,t)=>(e.interactionTypes||[]).filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||Oi(e,n,t)})(e,t))})(e,t)),ko=e=>!!e.required,Fo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=(0,l.cond)([[an,hi(e)],[on,Ri(e)]])(t);return Mo(e,a,r,n,i)},Mo=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&an(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Fn(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===Et.TYPE_REFERENCE){const a=An(t),s=Nn(t);o=Fo(e,a,r,n,[...i,t]).filter((e=>s.some(sn(e.uri))))}else t.attributes&&(o=Mo(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===Et.TYPE_REFERENCE?Fo(e,An(t),r,n,[...i,t]):[]},xo=e=>{const t=(0,l.pipe)((0,l.pick)(["dataLabelPattern","dataTooltipPattern","secondaryLabelPattern"]),l.values,(0,l.filter)(l.identity))(e);return(0,l.filter)((0,l.anyPass)([e=>{const r=`{${e.name}.`,n=`{${e.name}}`;return(0,l.any)((0,l.anyPass)([(0,l.includes)(n),(0,l.includes)(r)]),t)},t=>(e.businessCardAttributeURIs||[]).includes(t.uri),ko]),e.attributes||[])},$o=(e,t)=>{const r=Sn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},Vo=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?fe().text(n):n};return r(null,t)})),Go=["label","description","abbreviation","caption","toolTip"],Bo=e=>Vo(Go,e),Wo=(0,l.mergeRight)({attributeTypes:[],categoryTypes:[],changeRequestTypes:[],entityTypes:[],graphTypes:[],groupTypes:[],interactionTypes:[],relationTypes:[],roles:[],sources:[],survivorshipStrategies:[]}),Yo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=un(t);return r.find((e=>{let{uri:t}=e;return un(t)===n}))})),qo=(0,l.curry)(((e,t)=>{const r=un(t);return(0,l.pipe)(Yo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Ho=e=>{let{sources:t}=e;return(null==t?void 0:t.find((0,l.propEq)("uri","configuration/sources/Reltio")))?t:null==t?void 0:t.concat({uri:"configuration/sources/Reltio",label:"Reltio",icon:"images/source/reltio.png",abbreviation:"Reltio"})},Jo=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},Ko=(0,l.curry)(((e,t)=>{let{roles:r=[]}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Qo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=hi(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zo(e,t,r[t])}))}return e}function zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return es(i,e,t,r,n)},es=function(e,t,r){var n;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return te.fromNull(e&&e.length?e:null===(n=ei(t,r))||void 0===n?void 0:n.filter((0,l.complement)(Wn))).map((e=>e.map((e=>{const r=Zo(t,e,i,a);return r.length?Xo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(qn),(0,l.prop)("children"))).filter(la).filter(i).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["attributes","analyticsAttributes"])},rs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["attributes"])},ns=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Zo(e,t,r,["analyticsAttributes"])},is=e=>e.children?e.children.flatMap(is):e,as=e=>e.children?[e,...e.children.flatMap(as)]:e,os=(0,l.curry)(((e,t)=>{let{groupTypes:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),ss=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return un(r)===e})))),ls=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),ss("LUD")),(0,l.defaultTo)(r))(t||[])},us=(e,t)=>{let{survivorshipStrategies:r}=e;return ss(t,r)},cs=(0,l.allPass)([(0,l.complement)(l.isNil),Fi(ji.READ)]),ps=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Fi(ji.READ)]),ds=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([Fi(ji.CREATE),Fi(ji.INITIATE_CHANGE_REQUEST)])]),ys=(0,l.curryN)(2,(0,l.pipe)(hi,ps)),fs=(0,l.curryN)(2,(0,l.pipe)(Ri,cs)),Ts=e=>{let{ov:t}=e;return!1!==t},Es=(e,t)=>((e,t)=>di(e.type)&&se(t))(e,t)||((e,t)=>yi(e.type)&&le(t))(e,t),ms=e=>t=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t),hs=ms("refEntity"),bs=ms("refRelation"),Os=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],vs=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},gs=(0,l.prop)("objectURI"),_s=(0,l.prop)("objectURI"),As=(0,l.prop)("type"),Ns=(0,l.pipe)(hs,(0,l.defaultTo)({}),gs),Ps=(0,l.pipe)(bs,(0,l.defaultTo)({}),_s),Rs=(0,l.pipe)(hs,(0,l.defaultTo)({}),As),Ss=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type,uri:e.uri,value:e.value})));return(e||[]).concat(r)},ws=(0,l.evolve)({refEntity:ie,refRelation:ie});function Is(e,t,r,n){const i=zn(e,r),a=hi(e,t.type)||Ri(e,t.type);if(0===i.length)return null;const o=$n(r);let s=[t],u=1;i[0].uri!==t.type&&(u=0);let c=null;const p=n?[]:null;let d=null;for(let e=u;e<i.length;++e){const t=e===i.length-1,r=i[e];let u=[];if(!Un(r,d)){c=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const c=s.value||s[o]||{};let y=[];r.startObject&&r.endObject||(0,l.both)(En,on)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>An(e)===r.uri||_n(e)===r.uri)),d=y.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(y.push(r),d=null),y.forEach((a=>{const o=c[a.name];o&&(u=u.concat(o)),n&&t&&p.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=u),t&&(c=s)}return p||c}const Us=(e,t)=>{const[r,n,...i]=t.split("/"),a=(e[r]||[]).find((e=>{let{uri:t}=e;return t.endsWith("/"+n)})),o=i.join("/");return o&&a?Us(a.value,o):a},Cs=(0,l.curry)(((e,t)=>{if(!t.startsWith(e.uri))return;const[r,...n]=t.slice(e.uri.length+1).split("/"),i=n.join("/");return Us(e[r],i)}));function Ds(e){return(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]])(e)}const Ls=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),js=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","uri"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","uri"])],[l.T,(0,l.pick)(["value","uri"])]]),ks=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(ks(e,i)))))(r)})),Fs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Fs(e)),e)(t))),Ms=(e,t)=>(0,l.curry)(((r,n)=>(0,l.pipe)(ks(e,r),Fs(t))(n))),xs=Ms(null,Ds),$s=Ms(Ts,Ds),Vs=Ms(null,Ls),Gs=Ms(Ts,Ls),Bs=Ms(Ts,js),Ws=(e,t,r)=>{var n,i,a;return e.uri===t?null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Cs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ys=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ns,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),qs=(e,t)=>{const r=hn(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ws(e,r,n)},Hs=Object.values(vt),Js=(0,l.includes)(l.__,Hs),Ks=e=>Hs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xs(e,t,r[t])}))}return e}function Xs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zs=(e,t)=>`${e}_${t}`,Zs=[Ut.matches.name,Ut.matchRules.name],el=(0,l.values)(_t).map((e=>e.name)),tl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,el)))),rl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Zs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>zs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),nl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,tl(r),rl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(zs(`dtPotentialMatches.${t.name}`,"")))))(Ut)},il=(0,l.propEq)("uri",Ut.type.uri),al=e=>(0,l.values)(It).some((0,l.propEq)("uri",null==e?void 0:e.uri)),ol=(0,l.propEq)("uri",St.sourceSystems.uri),sl=Object.values(gt),ll=(0,l.includes)(l.__,sl),ul=e=>{let{entity:t,attributeType:r,value:n}=e;return Qs({},t,{[r.uri]:void 0===n?r.defaultValue:n})},cl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},pl=e=>{let{entity:t,attributeType:r,value:n}=e;return Qs({},t,{[r.uri]:n})},dl=(0,l.propEq)("uri",gt.roles.uri),yl=(0,l.propEq)("uri",gt.tags.uri);function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tl(e,t,r[t])}))}return e}function Tl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const El=e=>{let{parentUri:t,attributeType:r}=e;return fl({uri:Xr(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(qn,Yn),(0,l.always)({value:{}})],[Kn,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ii)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},ml=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ha(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Qn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=El({parentUri:r,attributeType:e}),s=ti(n,e);s&&(a.value=ml({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Qn(e))&&(o[t]=[a])}return o},hl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return Fo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=hn(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Is(r,e,a)||[]).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,a)=>{let{parentUri:o,attributes:s}=a;if(!s[i]||0===s[i].length){let i=vl({entity:e,attributeType:t,parentUri:o,index:0});if(qn(t)){const e=ti(r,t);i=bl({attributeType:t,subAttributes:e,metadata:r,mode:n,parentUri:o},i)}return i}return e}),e)}),t)},bl=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a,parentUri:o}=e;const s=Is(i,t,r.uri).find((e=>{let{uri:t}=e;return sn(t,o)})),l=fl({},s,{value:ml({attributeTypes:n,parentUri:s.uri,mode:a,metadata:i})});return _l({entity:t,attributeType:r,uri:s.uri,value:l})})),Ol=(0,l.curry)(((e,t)=>{let{metadata:r,attributeTypes:n,parentUri:i,mode:a}=e;const o=n.filter((e=>{let{name:r}=e;return!t[r]})),s=(0,l.mapObjIndexed)(((e,t)=>{const{type:i,attributes:o}=n.find((e=>t===e.name));return e.map((e=>{const{value:t,uri:n}=e;return i===Et.TYPE_NESTED?fl({},e,{value:Ol({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return fl({},s(t),ml({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),vl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=El({parentUri:n,attributeType:r}),u=Ds(l);return(0,Ur.ZP)(t,(e=>{Lr(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},gl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ur.ZP)(t,(e=>{Lr(e.attributes||e.value,r,n.uri,Ds(n),a,o,i)}))},_l=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ur.ZP)(t,(e=>{jr(e.attributes||e.value,r,n,i,a,o)}))},Al=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ur.ZP)(t,(e=>{Fr(e.attributes||e.value,r,n,i)}))},Nl=e=>""===e,Pl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Nl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Nl,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),Rl=(0,l.reject)(Pl),Sl=e=>{let{deleteEmptyComplex:t,valueTransformer:r=l.identity}=e;return(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.map)((0,l.pipe)(r,(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(e=>Sl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Rl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},wl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Sl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),ws),deleteEmptyComplex:e})},Il=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(wl(e),(0,l.reject)(l.isEmpty))},Ul=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Js(r)?ul({entity:e,attributeType:r}):vl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Cl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Js(r)?pl({entity:e,attributeType:r,value:i}):_l({entity:e,attributeType:r,uri:n,value:i})})),Dl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Js(r)?cl({entity:e,attributeType:r}):Al({entity:e,attributeType:r,uri:n})})),Ll=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.pipe)((0,l.filter)((0,l.pipe)((0,l.pathOr)([],["roles"]),(0,l.either)((0,l.propEq)("length",0),(0,l.any)((e=>t.includes(e)))))),(0,l.map)((0,l.pathOr)([],["attributes"])),l.flatten)(e)},jl="UrlThumbnail",kl="CdnUrlThumbnail",Fl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(Ts):(0,l.head)(n);return e&&e.value}return null})(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Ml=Fl(["CdnUrl","Url"],!0),xl=Fl(["CdnUrlPreview","UrlPreview"],!0),$l=Fl([kl,jl],!0),Vl=Fl([kl,jl],!1),Gl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[xn,(0,l.always)(t)],[(0,l.both)(Mn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=xn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Js(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ae)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Bl=(e,t,r)=>{const n=Ka(e),i=(0,l.any)(r?l.T:Ts);return Gl(n,t,i)},Wl=(e,t,r,n,i,a)=>{const o=zr(null==r?void 0:r.uri)?Ha(t,e):Ja(t,e);return Gl(o,r,((e,o)=>{const s=na({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:Ts,e)||xn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Yl;const ql=e=>{Yl=e};function Hl(e,t){return Yl(e,t)}const Jl=e=>(t,r)=>new Promise(((n,i)=>{e(t,r,(e=>{n(e)}),((e,t)=>{i((0,l.when)((0,l.is)(String),(0,l.always)({errorMessage:e,errorCode:t}))(e))}),null)})),Kl=50,Ql=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Kl,offset:a=0,sortByDisplayName:o=!0,sortOrder:s=Fe.asc}=e;return Hl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a,sortByDisplayName:o,sortOrder:s}),headers:{"Content-Type":"application/json"}})},Xl=(0,l.once)((()=>Hl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),zl=e=>Hl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Zl=(e,t)=>Hl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),eu=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),tu=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),eu),ru=(0,l.pipe)((0,l.reject)(E),tu),nu=e=>te.fromNull(me[e]).map(fe().text).orSome(""),iu=(0,l.curry)(((e,t)=>`${e}_${t}`)),au=(0,l.split)("_"),ou=(0,l.includes)("_"),su=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),lu=(0,l.curry)(((e,t)=>e.some(su(t)))),uu=lu([Te.IN_RANGE,Te.COUNT_RANGE,Te.WITHIN]),cu=lu([Te.EXISTS,Te.MISSING_VALUE]),pu=(0,l.cond)([[cu,(0,l.always)(0)],[uu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),du=(0,l.complement)(cu),yu=lu([Te.HAS_ALL,Te.EQUALS,Te.NOT_EQUALS]),fu=lu([Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE]),Tu=lu([Te.IN_FILE,Te.NOT_IN_FILE]),Eu=e=>{switch(e){case Te.COUNT_EQUALS:return Te.EQUALS;case Te.COUNT_NOT_EQUALS:return Te.NOT_EQUALS;case Te.COUNT_LT:return Te.LT;case Te.COUNT_LTE:return Te.LTE;case Te.COUNT_GT:return Te.GT;case Te.COUNT_GTE:return Te.GTE;case Te.COUNT_RANGE:return Te.IN_RANGE}},mu=lu([Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS]),hu=lu([Te.WITHIN]),bu=[[Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE],[Te.NOT_IN_FILE,Te.IN_FILE],[Te.EQUALS,Te.NOT_EQUALS,Te.HAS_ALL],[Te.LT,Te.LTE,Te.GT,Te.GTE],[Te.MISSING_VALUE,Te.EXISTS],[Te.COUNT_RANGE],[Te.IN_RANGE],[Te.STARTS_WITH,Te.CONTAINS],[Te.FULL_TEXT],[Te.ON,Te.BEFORE,Te.AFTER,Te.NOT_EQUALS],[Te.WITHIN]],Ou=(e,t)=>bu.some((r=>r.includes(e)&&r.includes(t))),vu=(0,l.pipe)(l.omit,l.values),gu={OPTIONS_FOR_STRING:vu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_DATE:[Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS,Te.MISSING_VALUE,Te.EXISTS,Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE,Te.IN_FILE,Te.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:vu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_BLOB:vu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_NUMBER:vu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_LOOKUP:vu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Te),OPTIONS_FOR_ENUM:vu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Te),OPTIONS_FOR_ID:[Te.EQUALS,Te.NOT_EQUALS,Te.IN_FILE,Te.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Te.EQUALS,Te.NOT_EQUALS,Te.LT,Te.LTE,Te.GT,Te.GTE,Te.IN_RANGE],OPTIONS_FOR_COMPLEX:[Te.COUNT_EQUALS,Te.COUNT_NOT_EQUALS,Te.COUNT_LT,Te.COUNT_LTE,Te.COUNT_GT,Te.COUNT_GTE,Te.COUNT_RANGE,Te.EXISTS,Te.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Te.EQUALS,Te.NOT_EQUALS,Te.EXISTS,Te.MISSING_VALUE]},_u=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Et.TYPE_TYPEAHEAD:case Et.TYPE_STRING:case Et.TYPE_PASSWORD:case Et.TYPE_TEXT:case Et.TYPE_CIK_ID:case Et.TYPE_URL:case Et.TYPE_BLOG_URL:case Et.TYPE_IMAGE_URL:case Et.TYPE_EMAIL:return gu.OPTIONS_FOR_STRING;case Et.TYPE_LOOKUP:case Et.TYPE_DEPENDENT_LOOKUP:return gu.OPTIONS_FOR_LOOKUP;case Et.TYPE_ENUM:return gu.OPTIONS_FOR_ENUM;case Et.TYPE_DATE:case Et.TYPE_ACTIVENESS_DATE:case Et.TYPE_TIMESTAMP:case Et.TYPE_LOCAL_DATE:return gu.OPTIONS_FOR_DATE;case Et.TYPE_BOOLEAN:case Et.TYPE_BOOLEAN_RADIO:return gu.OPTIONS_FOR_BOOLEAN;case Et.TYPE_BLOB:return gu.OPTIONS_FOR_BLOB;case Et.TYPE_LONG:case Et.TYPE_INT:case Et.TYPE_FLOAT:case Et.TYPE_DOUBLE:case Et.TYPE_NUMBER:return gu.OPTIONS_FOR_NUMBER;case Et.TYPE_ENTITY_ID:return gu.OPTIONS_FOR_ID;case Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Te.EQUALS];case Et.TYPE_COUNT:return gu.OPTIONS_FOR_COUNT;case Et.TYPE_NESTED:case Et.TYPE_REFERENCE:case Et.TYPE_IMAGE:return gu.OPTIONS_FOR_COMPLEX;default:return gu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(fu,n):n},Au=e=>[xe.and,xe.andNot].includes(e),Nu=e=>[xe.or,xe.orNot].includes(e),Pu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Nu)),Ru=(Su=[xe.and],e=>e.slice(0,-1).every((e=>Su.includes(e.operator))));var Su;const wu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Iu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Uu=e=>`(${e})`,Cu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},Du=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[xe.or,xe.orNot],n=t?[xe.and,xe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&Cu(e.slice(1,-1));return!i&&!a||o?e:Uu(e)},Lu="and",ju=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(Lu,n,e),o=(e=>[xe.andNot,xe.orNot].includes(e))(a)?Du(r):r;return i?o:`${t} ${a} ${o}`}),"")}},ku=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Fu=e=>Array.isArray(e)?e.map(Fu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Mu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),xu=e=>`'${e}'`,$u=e=>`"${e}"`,Vu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Gu=(0,l.pipe)(Fu,Mu),Bu=(0,l.pipe)(Gu,xu),Wu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(uu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Yu=(e,t)=>fu(t)?{type:Et.TYPE_INT}:Tu(t)?{type:Et.TYPE_FILE}:mu(t)&&!hu(t)&&ai(e.type)?{type:Et.TYPE_LOCAL_DATE}:e,qu=Object.values(ge),Hu=e=>!Object.values(ge).includes(e),Ju=e=>qu.includes(e),Ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;return fe().text(t[e])},Qu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Oe),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;return e.map((e=>({value:e,get label(){return Ku(e,t)}})))},Xu=e=>{const t=f()().startOf("minute");switch(e){case Oe.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Oe.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Oe.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Oe.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Oe.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case ve.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},zu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xu;return(0,l.is)(String,e)?t(e):zu(e)};let ec;!function(e){e.CurrentUser="currentUser"}(ec||(ec={}));const tc={},rc=(e,t)=>{tc[e]=t},nc=e=>tc[e];function ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ac(e,t,r[t])}))}return e}function ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oc=e=>e.split("{CurrentUser}").join(nc(ec.CurrentUser)||""),sc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),lc=(0,l.curry)(((e,t,r)=>{const n=r.map(uu(e)||t.endsWith(".count")?Gu:Bu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),uc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},cc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=pu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" or "))(n)},pc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Bu).join(",")})`},dc=e=>`*${e}*`,yc=e=>`URL:${e}`,fc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Tc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Te.IN_FILE?r:`not ${r}`},Ec=(e,t)=>[w(e,t),I(e,t)],mc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!hc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Te.ON:return ic({},e,n?{filter:Te.EQUALS}:{filter:Te.IN_RANGE,values:[Ec(i,n)]});case Te.BEFORE:return ic({},e,{filter:Te.LTE,values:[[I(i,n)]]});case Te.AFTER:return ic({},e,{filter:Te.GTE,values:[[w(i,n)]]});case Te.WITHIN:return ic({},e,{filter:Te.IN_RANGE,values:[Xu(i)]})}}return e}),cc),hc=(0,l.propSatisfies)(ai,"type"),bc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),oc)],[(0,l.propEq)("filter",Te.HAS_ALL),(0,l.pipe)((e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(cc({filter:Te.EQUALS,fieldName:t,values:[r]}))),new ju).build())),sc(" or "))(r)}),oc)],[(0,l.propEq)("filter",Te.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Fu,dc))})}),oc)],[(0,l.propEq)("filter",Te.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?cc(ic({},e,{values:(0,l.flatten)(r)})):fc(r)?pc(ic({},e,{filter:"listEquals"})):cc(e)}),oc)],[(0,l.propEq)("filter",Te.NOT_EQUALS),(0,l.pipe)((e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=pu(t);return(0,l.pipe)(uc(i),(0,l.map)(lc(t,r)),sc(" and "))(n)})(ic({},e,{values:(0,l.flatten)(e.values)})):hc(e)?(e=>{const{values:t}=e,r=!hc(e),[n]=t;return(new ju).addClause(cc(ic({},e,{filter:Te.LT,values:[w(n,r)]}))).addClause(cc(ic({},e,{filter:Te.GT,values:[I(n,r)]}))).orBuild()})(e):fc(t)?pc(ic({},e,{filter:"not listEquals"})):cc(e)}),oc)],[(0,l.propSatisfies)(Tu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:r,filter:Tc(t,r),values:n.map((0,l.prop)("link")).map(yc)})}],[(0,l.propSatisfies)(fu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return cc({fieldName:`${r}.count`,values:n,filter:Eu(t)})}],[(0,l.propSatisfies)(mu,"filter"),mc],[(0,l.propEq)("fieldName","geoPolygon"),e=>{let{fieldName:t,values:[r]}=e;const n=(0,l.pipe)((0,l.map)((e=>{let[t,r]=e;return`${t},${r}`})),(0,l.join)(";"))(r);return lc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return lc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(cc,oc)]],Oc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!du(e)||gc(e,r))},vc=(e,t)=>Array.isArray(t)?gc(e,t):e===Te.WITHIN?Ju(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Fu(t).length>0,gc=(e,t)=>t&&t.length>0&&t.every((t=>vc(e,t)));function _c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ac=["relevanceScores"],Nc=e=>{let{fieldName:t=""}=e;const r=t.split(".");if(Ac.includes(r[0]))return r[0];const n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Pc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Rc=(e,t,r)=>"children"===e?wc(r,[...t][0],!0):r,Sc=(e,t,r)=>"values"===e?[...r,...t]:r,wc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.findIndex((0,l.propEq)("fieldName",t.fieldName));if(n>=0){const i=e[n];if("children"in i&&"children"in t)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Rc,t),e);if(!r&&yu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Sc,t),e)}return(0,l.append)(t,e)},Ic=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Nc(e),r=e=>e.fieldName===t?e:r({fieldName:Pc(e),children:[e]});return r(e)})(t);return wc(e,r)}),[]),Uc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),Cc=e=>{let[t]=e;return t.children?Cc(t.children):t.operator},Dc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=Cc(t)===xe.andNot,a=n(t,!1),o=i?`not ${Du(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Cc(r)||Lu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&Uc(i)&&!t?r(i):n(i,a)}],...e])(o))),new ju).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Lc=(0,l.pipe)((0,l.propOr)("","filter"),ou),jc=(0,l.map)((0,l.when)(Lc,(e=>{const[t,r]=au(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_c(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),kc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,l.pipe)((0,l.filter)(Oc),jc,Ic,Dc([...e,...bc],t))},Fc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Mc=[Te.ON,Te.BEFORE,Te.AFTER,Te.WITHIN,Te.NOT_EQUALS,Te.MISSING_VALUE,Te.EXISTS],xc=[Te.EQUALS,Te.NOT_EQUALS,Te.STARTS_WITH,Te.MISSING_VALUE,Te.HAS_ALL,Te.FULL_TEXT,Te.EXISTS],$c=[Te.EQUALS,Te.NOT_EQUALS,Te.LT,Te.LTE,Te.GT,Te.GTE,Te.IN_RANGE],Vc=(e,t)=>{const r=kn(e);return(e=>{switch(e){case vt.startDate.name:case vt.endDate.name:case _t.dueDate.name:case Pt.createdTime.name:case Pt.updatedTime.name:case St.reltioLoadDate.name:case St.createDate.name:case St.updateDate.name:case St.deleteDate.name:case St.publishDate.name:return Mc;case Rt.matches.name:case St.count.name:return $c;case _t.workflow.name:case _t.assignee.name:case _t.step.name:case At.commenter.name:case Pt.createdBy.name:case Pt.updatedBy.name:case St.sourceSystems.name:case St.value.name:return xc;default:return null}})(t)||_u(r)},Gc=[Te.EQUALS,Te.NOT_EQUALS,Te.CONTAINS,Te.STARTS_WITH,Te.MISSING_VALUE,Te.HAS_ALL,Te.IN_RANGE,Te.WITHIN,Te.EXISTS,Te.ON],Bc=(0,l.pipe)(Vc,(0,l.filter)((0,l.includes)(l.__,Gc))),Wc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(Ts);if(a&&a[0])if(n.length>0&&a[0].value)r=Wc(a[0].value,[n.join(".")])[0].value;else if("label"in a[0]&&"string"==typeof a[0].label)r=a[0].label;else if(Object.prototype.hasOwnProperty.call(a[0],"label"))r="";else{var o;r=null!==(o=a[0].value)&&void 0!==o?o:""}return{key:t,value:r}}),""),Yc=(e,t)=>{const r=new RegExp("{[^}]*}","g");let n,i=[];for(;null!=(n=r.exec(t));)i.push(n[0]);i=i.map((function(e){return e.substring(1,e.length-1)}));const a=Wc(e.attributes||e.value,i);let o;return a.every((function(e){return void 0===e.value}))?o="":(o=t,o=o.replace(/\[[^\]]*]/g,(e=>{const t=e.match(/\{[^}]*}/g);return t?t.some((function(e){return e=e.substring(1,e.length-1).trim(),a.some((function(t){return t.key===e&&void 0===t.value}))}))?"":e.substring(1,e.length-1):e})),a.forEach((e=>{var t;o=o.replace("{"+e.key+"}",null!==(t=e.value)&&void 0!==t?t:"")}))),o},qc=/[,\s]*$/,Hc=e=>{const t=fe().text(Pe);if(!e)return t;const r=e.replace(qc,"");return""===r.toString().trim()?t:r},Jc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Kc=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=Jc(e,r.referencedEntityTypeURI);if(n)return Yc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Yc({attributes:t||{}},r.dataLabelPattern);return""},Qc=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Xc=e=>{let{uiPath:t,value:r,uri:n}=e;return`${t}#p~com.reltio.plugins.pivoting.default.DefaultPivotingPerspective_ps~pivoting_a~${encodeURIComponent(n)}_v~${encodeURIComponent(r)}`},zc=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Zc=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),ep=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),$l,(0,l.prop)("value"))),tp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),ep),rp=(e,t,r)=>{const n=tp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Cs(e),ep)))(e))(r)||((e,t)=>{const r=(e=>{const t=t=>`${e.uri}/attributes/${t}`,r=(e=e||{}).imageAttributeURIs||[];return(0,l.uniq)([t("ImageGallery"),...r,t("Image"),t("ImageLinks")])})(hi(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Is(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,ep))(r)})(e,r)||Ai(e,r.type);return Zc(t,n)};function np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ip(e,t,r[t])}))}return e}function ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ap="DTSS/",op=(0,l.replace)(new RegExp("^entities/"),""),sp=e=>ap+e.dataTenant+"/"+e.uri,lp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),up=e=>!(!e||!e.dataTenant),cp=(0,l.startsWith)(ap),pp=(0,l.pipe)((0,l.ifElse)(cp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),dp=(0,l.ifElse)(up,sp,(0,l.prop)("uri")),yp=e=>e&&e.uri?e.dataTenant?sp(e):op(e.uri):"",fp=(0,l.curry)(((e,t,r)=>(hi(t,r.type)||{})[e]||"")),Tp=fp("label"),Ep=fp("typeGraphIcon"),mp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=hi(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(Ts)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Kc(e,o,i),uri:a.uri}})).filter(l.identity):[]},hp=(0,l.pipe)(mp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),bp=(0,l.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,l.is)(Object,r.value)){const n=bp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):bp(e.slice(1),r)}})),Op=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,vp=e=>(0,l.propOr)([],"matchRules",e),gp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?np({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},_p=(e,t,r)=>t&&r?r.aEntity:e,Ap=(0,l.evolve)({attributes:Il(!0)}),Np=(0,l.pipe)(Ap,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Pp=e=>(0,l.assoc)("dataTenant",e);function Rp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sp(e,t,r[t])}))}return e}function Sp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r={dcrObjectUris:[],dcrUri:t},n=e=>e&&e.includes("changeRequest"),i=(0,l.propSatisfies)(n,"uri"),a=(0,l.pipe)((0,l.prop)("changes"),l.keys),o=(0,l.when)(i,(0,l.applySpec)({dcrObjectUris:a,dcrUri:(0,l.prop)("uri")})),s=e=>{let{dcrObjectUris:t,dcrUri:n}=e;r.dcrObjectUris=r.dcrObjectUris.concat(t),r.dcrUri=r.dcrUri||n},u=(0,l.pipe)(o,s,(()=>E())),c=(0,l.pipe)((0,l.prop)("dcrUri"),(0,l.unless)(l.isNil,(0,l.pipe)((0,l.split)("/"),(0,l.prop)(1)))),p=(e,t)=>(e+=e.includes("?")?"&":"?")+eu(t),d=t=>{const n=c(r);return n?p(t,{changeRequestId:n}):e?p(t,{alwaysCreateDCR:!0}):t},y=()=>r.dcrObjectUris,f=()=>r.dcrUri;let T,E=l.identity;const m=()=>!e||f()||T?T||Promise.resolve():(T=new Promise((e=>{E=e})),Promise.resolve());return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f,getDcrUriAwait:m}},Ip=e=>{const t=(t,n)=>i=>{if(!(e=>!pe(e.value))(i)){var a,o;const s=`${n}/${null!==(a=i.refEntity)&&void 0!==a&&a.objectURI?un(i.refEntity.objectURI):Jr()}`;let u;const c=e.objectsInfo[null===(o=i.refEntity)||void 0===o?void 0:o.objectURI];return c&&(u=c.label,c.isExist||(i.refEntity.objectURI=`${e.uri}/changes/${i.refEntity.objectURI}`)),Rp({},i,{label:u,uri:s,value:(0,l.fromPairs)((0,l.map)(r(t,s),(0,l.toPairs)(i.value)))})}return Rp({},i,{uri:`${n}/${Jr()}`})},r=(e,r)=>n=>{let[i,a]=n;return[i,(0,l.map)(t(`${e}/attributes/${i}`,`${r}/${i}`),a)]};return(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",pt.CREATE_ENTITY),(0,l.evolve)({newValue:e=>{const{uri:t,type:n}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(r(n,`${t}/attributes`)),l.fromPairs)},e)}}))))},e)},Up=()=>{const e={newUriMap:{}};return{getUri:t=>(0,l.pathOr)(t,["newUriMap",t],e),addUriFromCreateRequest:t=>r=>{var n;return null!=r&&null!==(n=r[0])&&void 0!==n&&n.successful&&((t,r)=>{e.newUriMap=(0,l.assoc)(t,r,e.newUriMap)})(t,r[0].object.uri),r},hasNewUri:()=>!(0,l.isEmpty)(e.newUriMap)}};function Cp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dp(e,t,r[t])}))}return e}function Dp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Xe.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},jp=e=>{let{relationUri:t}=e;return{type:Xe.DELETE_RELATION,parameters:{relationUri:t}}},kp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Xe.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Fp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Xe.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Mp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Xe.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},xp=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),$p=e=>e.type===Xe.DELETE_RELATION,Vp=e=>e.type===Xe.CREATE_RELATION,Gp=e=>e.type===Xe.REPOINT_RELATION,Bp=e=>e.type===Xe.UPDATE_RELATION,Wp=async e=>{const t=[];for(const r of e){const e=await r();t.push(e);const n=Array.isArray(e)&&e.find((0,l.has)("errors"));if(n)throw n.errors}return t.flat()},Yp=e=>{let{type:t,parameters:r,dcrProcessor:n,relationUriProcessor:i}=e;const{enhanceUriWithDCR:a,updateDCRUriFromResponse:o}=n,s=e=>(o(e),e);switch(t){case Xe.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:o,attributes:l,startDate:u,endDate:c}=t;return Yf({startEntityUri:e,endEntityUri:n,relationType:o,attributes:l,startDate:u,endDate:c,uriPreprocessor:a}).then(s).then(i.addUriFromCreateRequest(t.uri))};case Xe.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Wf(e,a).then(s)};case Xe.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Kf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(s)};case Xe.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return qf({oldRelation:e,newRelation:t,uriPreprocessor:a}).then(s)};case Xe.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:a,isReversed:o}=r,{uri:s}=a,u=[jp({relationUri:s}),Lp({parentUri:o?e:t,relation:a,entityUri:o?t:e})];return(0,l.pipe)((0,l.map)(Hp(n,i)),(0,l.map)(Yp),Wp)(u)}}},qp=e=>t=>()=>e().then(t),Hp=(e,t)=>r=>Cp({dcrProcessor:e,relationUriProcessor:t},r),Jp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=wp({alwaysCreateDCR:e,dcrUri:t}),n=Up();return{commandExecutor:e=>(0,l.pipe)(l.flatten,(0,l.map)(Hp(r,n)),(0,l.map)(Yp),(0,l.map)(qp(r.getDcrUriAwait)),Wp)(e),dcrProcessor:r,relationUriProcessor:n}},Kp=e=>t=>(0,l.map)((t=>Cp({},t,{parameters:(0,l.evolve)({parentUri:rh(e),entityUri:rh(e),newEntityUri:rh(e)},t.parameters)})),t),Qp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Xp=(e,t)=>{const r=e.filter(Vp).find(xp(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Bp(o)&&xp(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Gp(o)||!xp(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(Qp({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},zp=(e,t)=>{const r=e.filter(Gp).filter(xp(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Bp(i)||!xp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Zp=(e,t)=>{const r=e.filter($p).filter(xp(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!xp(t,e)))},ed=(e,t)=>{const r=e.filter(Bp).filter(xp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Bp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Qp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},td=e=>{const t=e.filter($p).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Zp,e)},rd=e=>{const t=e.filter(Vp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Xp,e)},nd=e=>{const t=e.filter(Gp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(zp,e)},id=e=>{const t=e.filter(Bp).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(ed,e))(t)},ad=e=>(0,l.pipe)(td,rd,nd,id)(e);function od(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sd(e,t,r[t])}))}return e}function sd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ld=e=>od({},(0,l.path)(Id(),e),{startDate:(0,l.path)(Ld(),e),endDate:(0,l.path)(jd(),e)}),ud=(e,t)=>(0,l.pipe)((0,l.path)(Dd()),rh(t))(e),cd=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=ud(e,r),i=(0,l.path)(Ud(),e)===ze.IN,a=e.parentEntityUri||n;return Lp({parentUri:i?t:a,relation:ld(e),entityUri:i?a:t})})),...o.map((t=>{const i=ud(t,r),a=(0,l.path)(Ud(),t)===ze.IN,o=i!==(0,l.pipe)((0,l.path)(Id()),a?kd:Fd)(t),s=$d(e,(0,l.path)(Sd(),t)),u=t.parentEntityUri||n,c=rh(r,i);return o?Mp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Id(),t),isReversed:!1}):Fp({oldRelation:(0,l.path)(Id(),s),newRelation:ld(t)})})),...i.map((e=>jp({relationUri:e}))),...s.map((e=>kp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},pd=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return od({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),dd=(0,l.has)("dataTenant"),yd=(0,l.ifElse)(dd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),fd=(e,t)=>(0,l.pipe)(Ri,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Hs),Ya)(e,t);function Td(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ed(e,t,r[t])}))}return e}function Ed(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const md=e=>(0,l.prop)("uri",e),hd=e=>md(e)?e.uri:e,bd=e=>t=>hd(t)===e,Od=(0,l.curry)(((e,t)=>{const r=(n,i)=>{var a;let o=hd(i),s=!1;o.startsWith("!")&&(o=o.slice(1),s=!0);const u=e[o]&&Fi(ji.READ,e[o]),c=n.find(bd(o))||!u?n:n.concat(md(i)?Td({},i,{uri:o}):null!==(a=t.find(bd(o)))&&void 0!==a?a:o);return s?c:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==o||t.find(bd(n))?t:r(t,n)),c)};return t.reduce(r,[])})),vd=(0,l.curry)(((e,t)=>{const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.reduce(((r,n)=>{const i=hd(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(bd(a))?r:r.concat(a)}),[])};return Td({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),gd=(0,l.indexBy)((0,l.prop)("uri")),_d=(0,l.curry)(((e,t)=>{const r=gd(e.relationTypes),n=gd(e.entityTypes),i=e=>(0,l.evolve)({inRelations:Od(r),outRelations:Od(r),entityTypes:Od(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),vd(r)),i)(t)})),Ad=(e,t)=>(0,l.evolve)({content:_d(e)},t),Nd=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},Pd=(e,t,r)=>{const n=Yc(t,e.dataLabelPattern),i=(0,l.lensProp)("entity");return(0,l.over)(i,(0,l.evolve)({entityLabel:(0,l.always)(n),object:{label:(0,l.always)(n)}}),r)},Rd="relation",Sd=(0,l.always)([Rd,"relationUri"]),wd=(0,l.always)([Rd,"relationType"]),Id=(0,l.always)([Rd,"object"]),Ud=(0,l.always)([Rd,"direction"]),Cd=(0,l.always)([Rd,"object","attributes"]),Dd=(0,l.always)(["entity","entityUri"]),Ld=(0,l.always)([Rd,"startDate"]),jd=(0,l.always)([Rd,"endDate"]),kd=(0,l.path)(["startObject","objectURI"]),Fd=(0,l.path)(["endObject","objectURI"]),Md=(0,l.path)(["startObject","objectTypeURI"]),xd=(0,l.path)(["endObject","objectTypeURI"]),$d=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(Sd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=$d(r.connections,t);if(e)return e}}},Vd=(0,l.pipe)($d,(0,l.path)(Id())),Gd=(0,l.allPass)([(0,l.pipe)((0,l.path)(Dd()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(wd()),(0,l.complement)(E))]),Bd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:en()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=qd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Wd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Nd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Wd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:Se.IN}:{type:t[0],direction:Se.OUT}:null},Yd=e=>e.uri||e,qd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&$i(i,t)&&Gi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Se.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],hi(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],hi(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Yd,Ri(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Se.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Se.OUT)),(0,l.map)(u))},t)||{}},Hd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ci({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=wi(e,n.uri);return n&&(!t||Oi(e,i,t))&&(!r||Oi(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],hi(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],hi(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(cs,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},Jd=(0,l.curry)(((e,t,r,n,i)=>{const a=Oi(n,l.__,t.type),o=e?xd:Md,s=Oi(n,l.__,r.type),u=e?Md:xd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Kd=(e,t,r)=>{const n=e?xd:Md,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(Oi(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Qd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xd=e=>{let{type:t,attributeType:r,attributeTypeUri:n,parentUri:i,uri:a,message:o,source:s}=e;return{type:t,uri:a,attributeTypeUri:n,attributeType:r,parentUri:i,message:o,source:s}},zd=e=>!e.deactivated,Zd=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},ey=e=>Zd(e)+e.message,ty=(0,l.unless)(l.isNil,(0,l.prop)("message")),ry=(0,l.unless)(l.isNil,(0,l.prop)("type")),ny=(0,l.curry)(((e,t)=>sn(t.parentUri,e))),iy=(0,l.curry)(((e,t)=>t.parentUri===e)),ay=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),sn(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Et.TYPE_REFERENCE),(0,l.pipe)(Nn,(0,l.any)(sn(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),oy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),sy=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),ly=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Ey,zd,ny(e),ay(t),(0,l.complement)(sy(e,t.uri))]))(r)},uy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Ey,zd,iy(e),oy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",we.missed))]))(r);return n&&n.message||""},cy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===we.missed))},py=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(Sd(),e))]))(t)},dy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},yy=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([zd,ny(t)]))(r)},fy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zd,(0,l.propEq)("type",we.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Ty=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?yh(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case Le.attributeValue:{const e=a;if(Bn(a))return Yc(o,e.dataLabelPattern);if(Wn(a)){const t=o,i=Ns(t),a=_n(e),s=hi(n,a);return zr(i)?Yc(r[i],s.dataLabelPattern):t.label}return""}case Le.tempEntity:return Yc(o,a.dataLabelPattern);case Le.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=hi(n,null==e?void 0:e.entityType);return`${Hc(i&&zr(i)?Yc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Si(n,null==t?void 0:t.relationType)}`}}})({entitiesMap:r,metadata:n},e);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qd(e,t,r[t])}))}return e}({},e,{label:Hc(t)})}))},Ey=e=>!e.severity||e.severity===Ue.ERROR,my=(e,t,r)=>(0,l.allPass)([(0,l.pipe)((0,l.prop)("uri"),E),(0,l.propEq)("parentUri",t),(0,l.propEq)("attributeTypeUri",r)])(e),hy=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Et.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(hy(n))}));case Et.TYPE_REFERENCE:return!!hs(t);case Et.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),by=(e,t)=>e.every((0,l.complement)(hy(t))),Oy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Fo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Is(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!Ts(e.parent))))).forEach((e=>{by(e.attrValues,n)&&r.push(Xd({type:we.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:fe().text("Attribute is required"),source:Ie.local}))})),r}),[])},vy=(0,l.curry)(((e,t,r)=>Is(e,t,r,!1))),gy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),hi(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Vn),(0,l.filter)(Wn),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(vy(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ns),(0,l.map)((e=>{let{uri:r}=e;return Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:yn(r,t.type),parentUri:r,message:fe().text("Entity is required"),source:Ie.local})})))(t)},_y=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ns,zr)).flatMap((n=>{const i=Ns(n),a=t[i],o=Zn(e,yn(n.uri,r.type));return Ay(e,t,o,a)})),Ay=(e,t,r,n)=>{const i=Nn(r),a=i.map((t=>Zn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Et.TYPE_REFERENCE))).flatMap(Rn).concat(i);return Ny(e,t,n,(e=>a.some(sn(e.uri))))},Ny=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Oy(e,r,n),a=gy(e,r),o=_y(e,t,r);return[...i,...a,...o]},Py=(e,t)=>({attributes:{[e.name]:[t]},type:fn(e.uri),uri:fn(t.uri)}),Ry=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Py(t,r),a=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(r[0]||e).uri;return t.uri===n};return Ny(e,n,i,a)},Sy=(e,t)=>{const r=(0,l.path)(Id(),t)||{};return Oy(e,r)},wy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Dd()),(0,l.ifElse)(zr,(e=>t[e]),(0,l.always)(null)))(r),i=Sy(e,r),a=(e=>(0,l.path)(Dd(),e)?[]:[Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(wd(),e),parentUri:(0,l.path)(Sd(),e),message:fe().text("Entity is required"),source:Ie.local})])(r),o=((e,t,r)=>r?Ny(e,t,r):[])(e,t,n);return[...i,...a,...o]},Iy=e=>(0,l.path)(["entity","uri"],e)?[]:[Xd({type:we.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:fe().text("Entity is required"),source:Ie.local})],Uy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Oy(e,r),i=Iy(t);return[...n,...i]};function Cy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dy=(e,t)=>{var r,n;const i=hi(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||lo(e)},Ly=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),jy=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Ly(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},ky=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(Ps,zr,l.not)]),(e=>{const t=(0,l.pipe)(Ps,un)(e);return jy((e=>e.replace(t,t+Wr)))(e)})),(0,l.when)((0,l.pipe)(Ns,zr),(t=>{const r=Ns(t),n=e[r],i=n&&My(n,e);return null!=i&&i.attributes?(0,l.evolve)({value:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),Fy=(e,t,r,n)=>Wh(Vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Hh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,n).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(ky(r,e.type)),(0,l.map)(jy(bn))))})(e))).concat(Zm(e,t)),My=(e,t)=>(0,l.evolve)({attributes:Sl({valueTransformer:(0,l.pipe)(ws,ky(t),Ly(bn)),deleteEmptyComplex:!0}),uri:bn})(e);function xy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$y(e,t,r[t])}))}return e}function $y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Br,"g"),"uri$$$$").replace(new RegExp(Wr,"g"),""))),Gy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Vy,objectParentUri:Vy}),(e=>{return xy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?we.missed:we.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&hn(e.objectUri),uri:e.objectUri,source:Ie.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),By=(e,t)=>(0,l.map)((0,l.pipe)(Gy,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Ty(t,s),p=null!=c&&c.length?c.slice(0,-1):Ty(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Zn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Le.attributeValue&&(a=e.valueType)}return a})(o,c,e);return xy({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&mn(i)){const n=(0,l.last)(a),i=n.valueType;if(Wn(i)&&Sn(i).includes(o)){const i=Ns(n.value),o=i&&zr(i)?t[i]:null;return o?xy({},e,{parentUri:o.uri,path:a.concat({type:Le.tempEntity,value:o,valueType:hi(r,o.type),label:""})}):e}}return e}})(t)))(e),Wy=e=>{if(e.type===De.AGO||e.type===De.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===De.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Yy=e=>`equals(user, '${Mu(e)}')`,qy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Hy=e=>`equals(items.objectType, '${e.uri}')`,Jy=e=>{const{period:t,type:r}=e;if(!Wy(e))return"";switch(r){case De.WITHIN:return`gte(timestamp, ${Z(t)})`;case De.AGO:return`lte(timestamp, ${Z(t)})`;case De.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Ky=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Qy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Xy=e=>{let{query:t,body:r}=e;return t=Qy(t),Hl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},zy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(kc(),Fc(t.globalFilter))(n),activeness:t.activityFilter||Ne.ACTIVE_ONLY,options:t.searchOptions};return(0,l.reject)(E,i)},Zy=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Hl("/entities/_total",{method:"POST",body:JSON.stringify(zy(e,t,r))})},ef=e=>Hl("/entities/_total",{method:"POST",body:JSON.stringify(Object.fromEntries(new URLSearchParams(e).entries()))}),tf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(ps),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Te.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(kc(),Fc(r.globalFilter))([i,a]),s=(0,l.reject)(E,{filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Ne.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return Hl("/entities/_typeAheadSearch",{method:"POST",body:JSON.stringify(s)})},rf=(0,l.pipe)((0,l.reject)(l.isNil),tu),nf=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(kc(),Fc(i))(r),p=rf({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Xy({query:p,body:d})},af=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return nf({fieldName:t,searchParams:i,options:n})};function of(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",lf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e,{filter:"containsWordStartingWith",fieldName:"attributes",values:[r]}],i=(0,l.reject)(E,{filter:(0,l.pipe)(kc(),Fc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||sf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null,options:t.searchOptions});return i},uf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=lf(e,t,r);return Hl("/entities/_search",{method:"POST",body:JSON.stringify(n)})},cf=e=>Ef(e,{select:"secondaryLabel"}),pf=(e,t)=>{const{select:r=sf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Hl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},df=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),zr)),yf=e=>{const{parentUri:t,attributeTypeUri:r,values:n=[],offset:i,defaultMaxValues:a,tenant:o,apiPath:s,searchQuery:u,filters:c=[],sorting:p,options:d="ovOnly"}=e,y=n.length,f=df(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Hn(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(kc(),Fc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),Hl(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},ff=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Tf={options:"sendHidden,addRefAttrUriToCrosswalk"},Ef=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tf;return Hl(`/${e}${ru(t)}`)},mf=(e,t)=>Ef(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){of(e,t,r[t])}))}return e}({},Tf,{explicitSurvivorshipGroup:t})),hf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",body:JSON.stringify([e])},n=t("/entities");return Hl(n,r)},bf=e=>Hl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Of=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Hl(`/${e}/_clone${ru({executeLCA:!1,valuesToCopy:r})}`,n)},vf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Hl(`/entities/_events/_total${tu({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},gf=(e,t)=>Hl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),_f=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Hl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Af=e=>Ef(e,{select:"updatedTime"}),Nf=e=>{let{entityUri:t,offset:r,max:n,filter:i,sort:a,order:o}=e;const s={offset:r,max:n,filter:i,sort:a,order:o};return Hl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),tu)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pf=e=>{const t=new FormData;return t.append("file",e),Hl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=Ar(e,fe().text("Can't upload file"));return Promise.reject(t)}))},Rf=e=>{let{containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,countResults:s=!1,findPublic:l=!0,includes:u,startsWith:c}=e;return Hl(`/personal/findSavedSearches${tu({countResults:s,findPublic:l})}`,{method:"POST",body:JSON.stringify({containsWordStartingWith:t,sortBy:r,sortOrder:n,favoriteOnly:i,offset:a,max:o,includes:u,startsWith:c}),headers:{"Content-Type":"application/json"}})},Sf=e=>Hl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),wf=e=>Hl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),If=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Hl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Uf=e=>{let{uri:t}=e;return Hl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Cf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),If)(e),Df=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),If)(e);function Lf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jf=["max","offset","filter"],kf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:kf(e)},t):function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lf(e,t,r[t])}))}return e}({},t,(0,l.pick)(jf,e)))),Ff=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Me.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Me.ALL,e)))return!1},Mf=(0,l.omit)(["activeness"]),xf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Ff(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(kf(e),(0,l.omit)(jf))(e))),Mf,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${ru(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},$f=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Vf=(0,l.reject)(l.isNil),Gf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Bf=e=>Hl(Gf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Wf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Gf);return Hl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Yf=e=>{let{startEntityUri:t,endEntityUri:r,relationType:n,attributes:i,startDate:a,endDate:o,uriPreprocessor:s=l.identity}=e;const u={type:n,startObject:{objectURI:t},endObject:{objectURI:r},attributes:i?Il()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Vf,ae,JSON.stringify);return Hl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},qf=e=>{let{oldRelation:t,newRelation:r,uriPreprocessor:n=l.identity}=e;const i=(0,l.prop)("attributes"),a=(0,l.pipe)((0,l.prop)("uri"),(0,l.concat)(l.__,"/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk"),Gf,n),o=Vh(i(t),i(r),!1).concat(Bh(t,r));return Hl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Hf=(e,t,r)=>{const{url:n,options:i}=xf(e,t,r);return Hl(n,i).then($f)},Jf=(e,t)=>Hl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Kf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Se.IN?a.inRelations=[n]:a.outRelations=[n],Hl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Qf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Hl(`${t}/recentSearches${ru({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Xf=e=>Hl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),zf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Hl(`/recentSearches${ru({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eT(e,t,r[t])}))}return e}function eT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tT={select:"label,secondaryLabel,name,type,startDate,endDate"},rT=(0,l.reject)(l.isNil),nT=(0,l.pipe)(rT,tu),iT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=Zf({},tT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Hl(`/${t}/_tree${nT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},aT=e=>{let{uri:t,graphUri:r}=e;const n=Zf({},tT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Hl(`/${t}/_parents${nT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},oT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=Zf({},tT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Hl(`/${t}/_hops${nT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function sT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const lT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},uT="/activities",cT=e=>{let{label:t,description:r}=e;return Hl(uT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:lT()}})};var pT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(pT||(pT={}));const dT=e=>{const t=ru(e);return Hl(uT+t,{method:"GET"})},yT=e=>Hl(`/activities/_total${ru(e)}`,{method:"GET"}),fT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return Hl(`/${t}/_activities${ru(r)}`,{method:"GET"})},TT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return Hl(`/${t}/_activities/_total${ru(r)}`,{method:"GET"})};function ET(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mT(e,t,r[t])}))}return e}function mT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},bT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Hl(hT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},OT=e=>{let{workflowPath:t,url:r,tenant:n,method:i,data:a,headers:o}=e,s=r;return r.includes("http:")||r.includes("https:")||(s=hT({url:r,workflowPath:t,tenant:n})),Hl(s,{method:i||"GET",body:JSON.stringify(a),headers:ET({"Content-Type":"application/json"},null!=o?o:{})})},vT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=hT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Hl(e,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(n)})}));return(0,l.pipe)((e=>e.map((t=>[e[0],t])).slice(1)),(0,l.map)(s(o,r)),(e=>Promise.all(e)),(0,l.andThen)(l.last))(n)},gT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=hT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?ET({},l,{comment:o}):l;return Hl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},_T=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=hT({url:`/tasks${s?ru(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(ET({objectURIs:[i]},(0,l.reject)(E,a)))};return Hl(u,ET({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},AT=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Hl(hT({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Hl(hT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(ET({max:a,offset:o},i))})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Hl(hT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Hl(hT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Hl(hT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return RT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},DT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a,processInstanceComment:o}=e;return Hl(hT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a,processInstanceComment:o})})},LT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Hl(hT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},jT=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Hl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),tu)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},kT=e=>{let{entityUri:t,max:r,sort:n,order:i,activeness:a,filter:o}=e;const s={max:r,filter:o,sort:n,order:i,activeness:a};return Hl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),tu)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},FT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Hl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},MT=(e,t,r)=>Promise.all(t.map((async t=>await Hl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),xT=async(e,t)=>await MT(e,t,"NOT"),$T=async(e,t)=>await MT(e,t,"MATCH"),VT=async(e,t)=>await Promise.all(t.map((async t=>await Hl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function GT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BT(e,t,r[t])}))}return e}function BT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WT(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const YT=3e4,qT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Hl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},HT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return dE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},JT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return dE({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},KT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Hl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},QT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{dataTenant:a,uri:o}=n;return Promise.all(i.map((e=>{let{uri:n}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},XT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(up,i);return Promise.all([s.length?FT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return KT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},zT=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return r.map((0,l.assoc)("matchRule",t))})),(0,l.reduce)(((e,t)=>{let{matchRule:r}=t,n=WT(t,["matchRule"]);const i=e.findIndex((e=>{let{object:{uri:t}}=e;return n.uri===t}));return-1===i?e.concat({object:n,matchRules:[r]}):(0,l.adjust)(i,(0,l.evolve)({matchRules:(0,l.append)(r)}),e)}),[])),ZT=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),zT),eE=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Hl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(ZT)},tE=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},rE=tE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Hl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json",SearchMetadata:"AUTO"},body:JSON.stringify([{uri:a,type:o}])}).then(ZT)})),nE=tE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Hl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),iE=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(l.flatten)}return t(...arguments)}},aE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Hl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},oE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{dataTenant:o,uri:s}=i;return Promise.all(a.map((t=>{let{uri:i}=t;return aE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},sE=oE("NOT"),lE=oE("MATCH"),uE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(up,a);return Promise.all([MT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return aE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},cE=uE("NOT"),pE=uE("MATCH");function dE(e){let{requestProvider:t=Hl,url:r,options:n,dataTenant:i,customerTenant:a,dtssPath:o}=e;r=o.endsWith("/")&&r.startsWith("/")?r.slice(1):r;const s=n||{},{headers:l}=s;return t(`${o}${r}`,GT({},WT(s,["headers"]),{headers:GT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const yE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;const s=function(e){const t=lf(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"");return`/entities${ru(t)}`}(t,r,n);return dE({url:s,dataTenant:i,customerTenant:a,dtssPath:o})},fE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return dE({url:"/entities/_total",dataTenant:i,customerTenant:a,dtssPath:o,options:{method:"POST",body:JSON.stringify(zy(t,r,n))}})},TE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=xf(t,r);return dE({url:`entities/_connections/_getConnections${ru({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)($f,(0,l.map)((0,l.evolve)({connections:(0,l.map)((0,l.pipe)((0,l.assocPath)(["entity","dataTenant"],n),(0,l.assocPath)(["relation","dataTenant"],n)))}))))},EE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return dE({url:`${ff(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},mE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Hl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},hE=e=>{let{dtssPath:t,tenant:r}=e;return Hl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:YT})},bE=e=>{let{dtssPath:t,customerTenant:r}=e;return Hl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:YT})},OE=e=>{let{dtssPath:t,tenants:r}=e;return Hl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:YT})},vE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return dE({url:ff(t),dataTenant:r,customerTenant:n,dtssPath:i})},gE=()=>Hl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function _E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){AE(e,t,r[t])}))}return e}function AE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=_E({},n,{ordered:"true",orderBy:"LastName,FirstName",from:0,max:100},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,["select"]));return Hl(`${t}/api/${r}/graph/search${ru({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},PE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Hl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:_E({},n,i),headers:{"Content-Type":"application/json"}})},RE=(e,t)=>`${e}/${t}/comments`,SE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Hl(`${RE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},wE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Hl(`${RE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},IE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Hl(RE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},UE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Hl(`${RE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Hl(`${RE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Hl(`${RE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},LE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Hl(`${RE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},jE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Hl(`${RE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},kE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=ru({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Hl(`${RE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function FE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ME(e,t,r[t])}))}return e}function ME(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xE=e=>{let{tenant:t,servicesPath:r}=e;return Hl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$E="graphExport",VE=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(FE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:FE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await YE({servicesPath:e,tenant:t,environment:r,namespace:$E,options:FE({method:"POST"},o)})),s},GE=e=>{let{servicesPath:t,key:r}=e;return Hl(`${t}/settings${ru({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},BE=e=>{let{servicesPath:t}=e;return Hl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},WE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Hl(`${n}/plugins${ru({tenant:t,user:r})}`,{method:"GET"})},YE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Hl(`${n}/configService${ru({tenant:t,environment:r,namespace:a,projection:o})}`,i)},qE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return YE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},HE=e=>{let{servicesPath:t,stateHash:r}=e;return Hl(`${t}/searchLink?key=${r}`,{method:"GET"})},JE=e=>{let{imageServicePath:t,environment:r,tenant:n,image:i}=e;const a=new FormData;return"string"==typeof i?(a.append("sourceUrl",i),a.append("upload","false")):a.append("file",i),Hl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},KE=e=>Hl(`/${e}?showObjectsInfo=true`,{method:"GET"}),QE=e=>{let{exportPath:t,tenant:r,options:n}=e;return Hl(`${t}/${r}/activities${ru(n)}`,{method:"POST"})};function XE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zE(e,t,r[t])}))}return e}function zE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZE=e=>{const{entityUri:t}=e;return Hl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},em=e=>{let{entityUri:t,crosswalk:r}=e;return Hl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},tm=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Hl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[XE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),XE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},rm=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Hl(`/${r}/_${n}${ru({contributorURI:t})}`,{method:"POST"})},nm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Hl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},im=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Hl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},am=e=>{let{entityUri:t,crosswalkId:r}=e;return Hl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function om(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sm(e,t,r[t])}))}return e}function sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lm=e=>{let{entityTypeUri:t}=e;return Hl(`/dataQuality/fillRates${tu({entityType:un(t)})}`,{method:"GET"})},um=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},cm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i,searchByOv:a}=e;const o=om({},n===Qe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),s=tu(om({},n===Qe.ATTRIBUTE_TYPE?{numberOfThreads:um({attributes:r,metrics:i})||1}:{},a?{options:"searchByOv"}:{}));return Hl(`/entityType/${un(t)}/dataQuality/${n}${s}`,{method:"POST",body:JSON.stringify(o)})},pm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Hl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${un(n)}`,{method:"GET",headers:{env:i}})},dm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Qe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u,anomaly:c}=e;const p={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u,anomaly:c};return Hl(`${t}/${r}/entityType/${un(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(p)})},ym=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/permissions/${t}`,{method:"GET"})},fm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Hl(`/${t}${ru({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Tm=e=>{let{attributeUri:t,value:r}=e;return Hl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Em=e=>{let{attributeUri:t,value:r}=e;return Hl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},mm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Hl(`/${t}${ru({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},hm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=ru({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Il()([[{value:a}]]);return Hl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},bm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Hl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Om=e=>{let{entityUri:t,attributeName:r}=e;return Hl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function vm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gm=e=>{let{entityUri:t}=e;return Hl(`/${t}/_historicURIs`,{method:"GET"})},_m=e=>{let{entityUri:t,historicUris:r}=e,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["entityUri","historicUris"]);return Hl(`/${t}/_changesWithTotal${ru(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Am=(e,t)=>Hl(`/${e}/_previousChange${ru({timestamp:t})}`,{method:"GET"}),Nm=(e,t)=>Hl(`/${e}${ru({time:t})}`,{method:"GET"});function Pm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=pe(n)?JSON.stringify(n):n),Hl(t,{method:o,body:s,headers:Pm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},wm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=ru({options:a.join(","),severity:o.join(",")});return Hl(`${t}/validate/${i}/entity/${yp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Im=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Hl(`${t}/validate/${n}/entity${ru({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Um=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/tenants/${t}/name`,{method:"GET"})},Cm=e=>{let{tenant:t,apiPath:r}=e;return Hl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Dm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Hl(`${a}/preferences${ru({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Lm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return Hl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},jm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Hl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},km=e=>{const{servicesPath:t}=e;return Hl(`${t}/getTokenForWorker`,{method:"GET"})};var Fm=r(47485);const Mm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Zr(),s={attributes:ml({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=Is(r,e,n.uri)[0];return i&&i.value?_l({entity:e,attributeType:n,uri:i.uri,value:t}):vl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},xm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ns),(0,l.filter)(zr),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),$m=(0,l.curry)(((e,t)=>{const r=xm(e=e||{},t=t||{});return r.concat((0,l.chain)($m(e),r))})),Vm=(0,l.curry)(((e,t)=>(0,l.pipe)(de,(0,l.filter)(e))(t))),Gm=Vm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Bm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),zr)),Wm=e=>(0,l.pipe)(Gm,Bm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Ym=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Gm,(0,l.find)((t=>(0,l.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,l.set)((0,l.lensPath)(n),t,r):r})),qm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),zr),(0,l.omit)(["uri","timestamp"])),Hm=(0,l.pipe)(qm,Ap),Jm=async(e,t,r)=>{if(!e)return null;const n=Wm(e);if(n.length>0)for(const r of n)e=Ym(r,t[r],e);const i=await hf(Hm(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Km=async(e,t,r)=>{const n=Xm(e,t),i={};for(const t of n)i[t]=await Jm(e[t],i,r);return i},Qm=(0,l.curry)(((e,t)=>{const r=Fm.Node(t);return Wm(e[t]).forEach((t=>{const n=Qm(e,t);r.addEdge(n)})),r})),Xm=(e,t)=>(0,l.pipe)((0,l.map)(Qm(e)),(0,l.map)(Fm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),zm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(qm))})),Zm=(e,t)=>[...Jh(e.tags||[],t.tags||[]),...Kh(e.roles||[],t.roles||[]),...Gh(e,t),...Bh(e,t)],eh=(e,t,r)=>[...Wh(Vh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Hh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e,r),...Zm(e,t)],th=(0,l.pipe)(((e,t)=>{const r=(0,l.toPairs)(e);return(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)((e=>r.reduce(((e,t)=>{let[r,n]=t;return Ym(r,n,e)}),e))))}),t)}),zm),rh=(0,l.curry)(((e,t)=>(0,l.when)(zr,(0,l.propOr)(l.__,t,e),t)));function nh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ih(e,t,r[t])}))}return e}function ih(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ah=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:n,children:i}})},oh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return nh({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},sh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t[e],a=xm(t,i),o=ah({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>sh(n.uri,t,[e],r)),o)},lh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(Sd(),n),a=t?oh({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Dd(),n),s=zr(o)?[o]:[],u=ah({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>sh(t,r,[i],e)),u)}),n)},uh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return lh(r,e,t,sh(e,t))},ch=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return uh(t,r,n);if(rn(e)){const t=$d(n,e);return t&&lh([t],null,r)}return r[e]?sh(e,r):void 0},ph=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>ph(e,t))))},dh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>dh(e,t))))},yh=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=tn(t),u=uh(r,n,i),c=((e,t,r)=>{let{entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[];let s;for(let e=0;e<t.length;e++){const u=t[e],c=t[e+1]||r;if(rn(c)){if(s=$d(i,c),!s)return null;o.push({type:Le.relationConnection,value:s,valueType:Ri(a,(0,l.path)(wd(),s))});continue}if(rn(u)){const e=n[c];if(!e)return null;o.push({type:Le.tempEntity,value:e,valueType:hi(a,e.type)});continue}const p=n[u],d=Ys(p,c),y=n[c];if(!d||!y)return null;o.push({type:Le.attributeValue,value:d,valueType:Zn(a,yn(d.uri,p.type))}),o.push({type:Le.tempEntity,value:y,valueType:hi(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},dh(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=rn(s),d=p?Vd(i,s):n[s],[y,f]=t!==s?(e=>{const t=e.split("/attributes/").slice(1).join("/attributes/");if(!t)return[];const[r,n]=t.split("/").reduce(((e,t,r)=>(e[r%2==0?0:1].push(t),e)),[[],[]]);return r.length!==n.length?[]:[r,n]})(t):[[],[]];if(!d||!y||!f)return null;let T,E=p?Ri(a,d.type):hi(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ei(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:Le.tempEntity,value:T,valueType:hi(a,T.type)}),o.push({type:Le.attributeValue,value:s,valueType:E}),m=s.value;const l=Ns(s);T=l&&zr(l)?n[l]:null}}return o},fh=e=>e.every((e=>{let{type:t}=e;return[Le.attributeValue,Le.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Le.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let Th;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Th||(Th={}));const Eh={[Th.insertAttribute]:{color:"#599E0E"},[Th.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Th.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},mh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Th.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Th.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Th.deleteAttribute;default:return""}},hh="/",bh=(0,l.pipe)((0,l.split)(hh),(0,l.propSatisfies)((0,l.lte)(2),"length")),Oh=(0,l.pipe)((0,l.split)(hh),(0,l.slice)(0,-2),(0,l.join)(hh)),vh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>bh(e),vh(Oh(e))]])(t))),gh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+hh))),_h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=vh(e,t);return(0,l.isNil)(r)?gh(e)(t)?"UPDATE_ATTRIBUTE":"":r},Ah=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]},Nh=e=>{let t=[];var r;return e&&(t.push({uri:e.uri,crosswalks:e.crosswalks,merges:e.merges}),null===(r=e.merges)||void 0===r||r.forEach((e=>{e.losers.forEach((e=>{t=t.concat(Nh(e))}))}))),t},Ph=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Ih,t),(0,l.propOr)([],"crosswalks",e))),e),Rh=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(Rh(e))}))})),r},Sh=e=>{let t=0;var r;return e?(null===(r=e.merges)||void 0===r||r.forEach((e=>{var r;null===(r=e.losers)||void 0===r||r.forEach((e=>{const r=Sh(e);r>t&&(t=r)}))})),t+1):t},wh=(e,t)=>{if(zr(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Ih=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Uh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ch=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Dh=(e,t)=>{const r=t.reduce(((e,t)=>(e["configuration/sources/"+t.name]=t,e)),{}),n=t.reduce(((e,t)=>(e[t.id]=t,e)),{});return(0,l.pipe)((0,l.map)((e=>{var t,i;if(r[e.type])return r[e.type];const a=null===(t=e.crosswalkExternalInfo)||void 0===t||null===(i=t.dtssInfo)||void 0===i?void 0:i.tenantId;return a&&n[a]?n[a]:void 0})),(0,l.reject)(l.isNil),l.uniq,(0,l.ifElse)((e=>{let{length:t}=e;return 1===t}),l.head,(()=>{})))(e)},Lh=(0,l.eqBy)(Ih),jh=(0,l.pipe)((0,l.propOr)({},"attributes"),l.values,l.flatten,(0,l.filter)((0,l.has)("refRelation")),(0,l.chain)((e=>(0,l.pipe)(bs,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function kh(e){return e&&void 0!==e.uri}let Fh;function Mh(e){return function(t,r){const n=[];return a=r,!(i=t)&&!a||!(!i||!a)&&i.length===a.length&&i.every((function(e,t){return e===a[t]}))||n.push({type:e,newValue:r}),n;var i,a}}function xh(e){return void 0!==e.refEntity}function $h(e,t){function r(r){if(e[r]&&t[r])if(Array.isArray(e[r])&&Array.isArray(t[r])){if(e[r].length!==t[r].length)return!1;if(e[r][0]&&t[r][0]&&e[r][0].objectURI!==t[r][0].objectURI)return!1}else if(e[r].objectURI!==t[r].objectURI)return!1;return!0}return r("refEntity")&&r("refRelation")}function Vh(e,t,r){const n=[];for(const a in e)if(e.hasOwnProperty(a)){if("paging"===a)continue;const p=e[a];if(void 0===t[a])for(const e in p)p.hasOwnProperty(e)&&n.push(...o(p[e]));else for(const e in p)if(p.hasOwnProperty(e)){const f=p[e],T=y(f,t[a]);void 0===T?n.push(...o(f)):f.value===T.value||f.lookupCode&&f.lookupCode===T.lookupCode?f.ignored!==T.ignored&&n.push(...s(T)):null==T.value||""===T.value?n.push(...o(f)):"Nested"===d(f)?f.ignored!==T.ignored&&(0,l.equals)(f.value,T.value)?n.push(...s(T)):n.push(...Vh(f.value,T.value,r)):"Reference"===d(f)?$h(f,T)?n.push(...Vh(f.value,T.value,r)):(n.push(...o(f)),n.push(c([T]))):""!==T.value&&(!1===T.ov?n.push(...u(T)):n.push(...(i=T,[{type:Fh.UPDATE_ATTRIBUTE,uri:i.uri,newValue:{value:i.lookupCode||i.value}}])))}}var i;for(const r in t)if(t.hasOwnProperty(r)){if("paging"===r)continue;let i=(t[r]||[]).filter((function(t){return void 0===y(t,e[r])}));i=a((0,l.clone)(i)),i.length&&n.push(c(i))}return n;function a(e){return e?e.map((function(e){let t;if(e){const r=e.value;return null!=r&&(pe(r)?Object.keys(r).forEach((function(e){const n=a(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function o(e){return[{type:Fh.DELETE_ATTRIBUTE,uri:e.uri}]}function s(e){return e&&(e.ignored?function(e){return[{type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!1}}]}(e))}function u(e){const t=e.uri.lastIndexOf("/"),r=e.uri.substr(0,t);return[{type:Fh._UPDATE_NON_OV_ATTRIBUTE,uri:e.uri,typeUri:r,value:e.lookupCode||e.value}]}function c(e){let t=e[0].uri;const n=t.lastIndexOf("/");return t=t.substr(0,n),{type:Fh.INSERT_ATTRIBUTE,uri:t,newValue:e.map((function(e){let t;const n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),p(n.value),xh(e)&&(e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t)),n}))}}function p(e){if(null!==e&&"[object Object]"===e.toString())for(const t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,p(e.value)}))}function d(e){const t=e.value;if(pe(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function y(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Gh(e,t){const r=[];var n,i;return e.defaultProfilePic!==t.defaultProfilePic?r.push({type:Fh.UPDATE_PROFILE_PIC_BY_URI,newValue:{value:t.defaultProfilePic}}):(n=e.defaultProfilePicValue)===(i=t.defaultProfilePicValue)||kh(n)&&kh(i)&&n.uri===i.uri||r.push({type:Fh.UPDATE_PROFILE_PIC_BY_URL,newValue:{value:t.defaultProfilePicValue}}),r}function Bh(e,t){const r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:Fh.UPDATE_START_DATE,newValue:{value:n}});const i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:Fh.UPDATE_END_DATE,newValue:{value:i}}),r;function a(e,t){let r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Wh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i="configuration/sources/Reltio",a="configuration/sources/ReltioCleanser";function o(e,t){return e.crosswalk={type:t.type,value:t.value},e}function s(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function l(e){return e.removeIt=!0}const u=e.map((function(e){if(e.crosswalk)return[e];const s=Yh(t,e.uri),l=s.filter((function(e){return e.type===i})),u=s.filter((function(e){return e.type!==i}));let c=[];switch(e.type){case Fh.INSERT_ATTRIBUTE:c.push(e);break;case Fh._UPDATE_NON_OV_ATTRIBUTE:c=c.concat(s.map((function(t){return o(e,t)})));break;case Fh.DELETE_ATTRIBUTE:(u.length||0==l.length)&&c.push({type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}}),c=c.concat(l.map((function(t){return o({type:Fh.DELETE_ATTRIBUTE,uri:e.uri},t)})));break;case Fh.UPDATE_ATTRIBUTE:{const s=u.some((e=>{let{type:t}=e;return t===a}))&&r?qh(r,t,e.uri):null;if(s||l.length){if(l.length)c=c.concat(l.map((function(t){return o({type:Fh.UPDATE_ATTRIBUTE,uri:e.uri,newValue:e.newValue},t)})));else if(s){const r=Yh(t,s.uri).filter((e=>{let{type:t}=e;return t===i}));c=c.concat(r.map((t=>o({type:Fh.UPDATE_ATTRIBUTE,uri:s.uri,newValue:e.newValue},t))))}}else c.push({type:Fh.INSERT_ATTRIBUTE,uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});u.length&&n&&c.push({type:Fh.IGNORE_ATTRIBUTE,uri:e.uri,newValue:{value:!0}});break}}return c}));let c=u.flat();const p=s(c,"typeUri");for(const e in p){if("undefined"===e)continue;const t=p[e],r=c.filter((function(e){return e.type!==Fh._UPDATE_NON_OV_ATTRIBUTE})).filter((function(t){return t.uri.substr(0,t.uri.lastIndexOf("/"))===e||"INSERT_ATTRIBUTE"===t.type&&t.uri===e})),n=t.find((function(e){const{crosswalk:t}=e;return t&&t.type===i}));!r.find((function(e){return"UPDATE_ATTRIBUTE"===e.type}))&&n&&(c.push({type:Fh.UPDATE_ATTRIBUTE,uri:n.uri,newValue:{value:n.value},crosswalk:n.crosswalk}),r.forEach(l)),t.forEach(l)}return c=c.filter((function(e){return!e.removeIt})),c.forEach((function(e){delete e.insteadOfUpdate})),c}!function(e){e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_TAGS="UPDATE_TAGS",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e._UPDATE_NON_OV_ATTRIBUTE="_UPDATE_NON_OV_ATTRIBUTE"}(Fh||(Fh={}));const Yh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),qh=(e,t,r)=>(0,l.pipe)(qs,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return wh(t,r)},e=>{let[t]=e;return!Ts(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Hh(e,t){t=t||[];for(const r in e)if(e.hasOwnProperty(r)){const n=e[r];for(let e=0;e<n.length;e++){const r=n[e];if(xh(r)&&r.refRelation){const e=r.refRelation[0]||r.refRelation;if(e.crosswalks){const r=e.crosswalks.filter((function(e){return e.attributes||e.attributeURIs}));for(let e=0;e<r.length;e++){let n=!0;for(let i=0;i<t.length;i++)if(t[i].type===r[e].type&&t[i].value===r[e].value){t[i].attributes=t[i].attributes||t[i].attributeURIs,t[i].attributes=t[i].attributes.concat(r[e].attributes||r[e].attributeURIs),t[i].attributes=Object.keys(t[i].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[i].attributeURIs,n=!1;break}n&&t.push(r[e])}}}}}return t}function Jh(e,t){return Mh(Fh.UPDATE_TAGS).call(this,e,t)}function Kh(e,t){return Mh(Fh.UPDATE_ROLES).call(this,e,t)}function Qh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xh(e,t,r[t])}))}return e}function Xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var zh=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(pe(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:pe(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(pe(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){pe(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=Qh({},a("INSERT_ATTRIBUTE",r),a("DELETE_ATTRIBUTE",n));return[i,o]};return{computeHistoryDiff:a,computeEntityHistoryDiff:(e,t)=>{const{attributes:r,appearance:n}=e?a(e.attributes,t.attributes):{attributes:t.attributes,appearance:{}},[i,s]=o(e?e.roles:[],t.roles),[l,u]=o(e?e.tags:[],t.tags);return{attributes:r,appearance:Qh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Zh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Zh(t.value):[]];return e.concat(r)}),[])),eb=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,tb=e=>e?[dp(e)]:[],rb=e=>{const t=[...Zh((null==e?void 0:e.attributes)||[]),...Zh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...tb(e),...t]:[]},nb=(e,t)=>[e,...t.map((t=>eb(e,t)))],ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return yd(t)}))},ab=(e,t)=>{switch(e){case je.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case je.ENTITY_ATTRIBUTE:case je.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[fn(t)]})(t);case je.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case je.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,dp({uri:n,dataTenant:i}),r]})(t)}},ob=e=>(0,l.pipe)(l.values,(0,l.map)((0,l.map)((0,l.pipe)((0,l.prop)("replies"),l.inc))),(0,l.map)(l.sum),l.sum)(e),sb=(0,l.curry)(((e,t)=>{const r=Do(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(sb(e,r.extendsTypeURI)):n})),lb=(0,l.curry)(((e,t)=>(0,l.reduce)(((t,r)=>(0,l.assoc)(r,((e,t)=>(0,l.path)(["members",t],e))(e,r),t)),{},t))),ub=(e,t)=>(0,l.pipe)((0,l.prop)("type"),sb(e),lb(t))(t),cb=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var pb,db=r(29504);function yb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.PotentialMatches="potentialMatches",e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(pb||(pb={}));const fb={},Tb={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},potentialMatches:{colors:["#fec92f","#ee4272","#6d9a35","#555962","#2d9ecf"]},random1:{colors:["#fccde5","#ff9acc","#81b2d3","#f8b6b8","#bd81be","#82c55c","#c4e3f1","#7f939e","#ffee91","#fec92f","#ee4272","#2d9ecf","#c4c0e1","#7accca","#cdc393","#f69785","#f0ecc7","#9fd6bf","#6d9a35","#afbc26","#12959f","#aacf99","#056b97","#eab710","#b4d36a","#70bede","#f57f27","#7a843b","#cfd0d2","#555962","#b71137","#ffdc0e","#bea68c","#5f3566"]},spectreYellowCyan:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#7accca","#12959f"]},spectreBlueBrown:{granularity:3,colors:["#c4e3f1","#70bede","#81b2d3","#2d9ecf","#056b97","#aacf99","#b4de6a","#82c55c","#6d9a35","#afbc26","#7a843b","#cfd0d2","#7f939e","#555962","#f0ecc7","#cfc393","#bea68c"]},charts:{colors:["#0072ce","#c4ce00","#ce5c00","#4bafff","#f97061","#9e7ed3","#c34980","#c4ce00","#669977","#ffe16f","#4896df","#40cfbb","#9bc66a","#ce5c00","#4bafff","#f085f2","#bea68c"]},crosswalks:{colors:["#86f2f9","#cae815","#f8a4a4","#fd63c0","#b6c5ec","#8fe98e","#ff9c72","#84cbf3","#a8f384","#d9ffa8","#ace1ff"]}},Eb=e=>{if(!fb[e]){const t=Tb[e]||Tb.random0;fb[e]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return fb[e]},mb=(0,l.curry)(((e,t)=>{const r=Eb(e);return r.idToColor[t]||(r.idToColor[t]=(e=>{const t=e.counter,r=e.granularity||1;return e.counter+=r,e.counter>=e.colors.length&&(++e.granularityCounter>=r&&(e.granularityCounter=0),e.counter=e.granularityCounter),e.colors[t]})(r)),r.idToColor[t]})),hb=e=>mb(pb.Charts,e),bb=()=>Eb(pb.PotentialMatches).colors,Ob=e=>mb(pb.Random1,e),vb=e=>(0,db.getColor)(e)?"#FFFFFF":"#212121";var gb=r(73116);const _b=Array.from({length:100},((e,t)=>t/100)),Ab=e=>{const t=Number(e.replace(/\D/g,""))||0;let r=3735928559^t,n=1103547991^t;for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),r=Math.imul(r^t,2654435761),n=Math.imul(n^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Nb={},Pb=new gb.Z({hash:Ab,saturation:_b.slice(15,71),lightness:_b.slice(50,90)}),Rb=new gb.Z({hash:Ab,saturation:_b.slice(46,89),lightness:_b.slice(44,58)}),Sb=(0,l.curry)(((e,t,r)=>{t in Nb||(Nb[t]={});const n=Nb[t];r in n||(n[r]=((e,t)=>{const r=String(Ab(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),wb=Sb(Pb,"crosswalks"),Ib=Sb(Pb,"sources"),Ub=Sb(Pb,"contributors"),Cb=Sb(Pb,"dataValidationFunctions"),Db=Sb(Rb,"entities");function Lb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kb=(0,l.has)("items"),Fb=e=>0===e,Mb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.min(Math.max(e,t),r)},xb=e=>e.reduce(((e,t)=>e+t.width),0),$b=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Vb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Gb=e=>e.reduce(((e,t)=>e+t.height),0),Bb=e=>(0,l.is)(String,e)&&e.includes("%"),Wb=(0,l.has)("spacer"),Yb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),qb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(kb(t)?qb(t):t)),[]),Hb=(e,t)=>{const r=[...t];for(;(0,l.sum)(r)>e;){const e=Math.max(...r);if(1===e)break;const t=r.indexOf(e);r[t]--}return r},Jb=e=>({id:e.layout}),Kb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Jb;const i=(e,t,r,n)=>{let{width:i}=e;const a=t.items.some((e=>e.flex));let o;if(a){const[e,n]=(0,l.partition)((0,l.propIs)(Number,"flex"),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("flex"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/(a+n.length))),u=Math.max(s/Math.max((0,l.length)(n),1),1),c=(e,t,r)=>Math.max(Math.round(t/r*e),1);o=r.flex?c(i,r.flex,a+n.length):u}else{const[e,n]=(0,l.partition)((0,l.both)((0,l.propIs)(String,"width"),(0,l.pipe)((0,l.propOr)("","width"),(0,l.includes)("%"))),t.items),a=(0,l.pipe)((0,l.map)((0,l.pipe)((0,l.prop)("width"),parseInt)),l.sum)(e),s=Math.round(i-i*(a/100)),u=Math.max(s/Math.max((0,l.length)(n),1),1);o=Bb(r.width)?Yb(i,r.width):u}return Mb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Mb(n,t,r)},o=(e,t)=>kb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,kb(a)?n(a.layout):e(a.view)))),s=Hb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=Fb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(kb(n))return r.concat(p(Lb({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Lb({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:xb(u),height:$b(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=kb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Fb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(kb(i))return r.concat(p(Lb({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Lb({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Mb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Mb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Vb(i),height:Gb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>Fb(r)?e.y:(0,l.last)(t).y+((0,l.last)(t).height||n),i=(t,r,i,o)=>{const s=e(i),l=t.width,u=a(s),c=n(t,r,o,u);return Lb({},s,{x:t.x,y:c,width:l,height:u})},o=(e,t)=>{const r=t.reduce(((t,r,a)=>{if("string"==typeof r)t.push(i(e,t,r,a));else if("object"==typeof r){const o=Math.max(Math.round(e.width/2),1),s=Hb(e.width,[o,o]),u=Lb({},e,{width:s[0]}),c=Lb({},e,{x:e.x+s[0],width:s[1]}),p=(0,l.has)("left",r)&&i(u,t,r.left,a),d=(0,l.has)("right",r)&&i(c,t,r.right,a),y=(0,l.propOr)(0,"height"),f=Math.max(y(p),y(d));t.push(Lb({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Lb({},e,{height:Gb(r),items:r})},s=o(t,(0,l.propOr)([],"top",r)),u=Math.round(.66*t.width),c=(0,l.isEmpty)(s)?t.y:t.y+s.height,p=o(Lb({},t,{y:c,width:u}),(0,l.propOr)([],"center",r)),d=o({x:t.x+u,y:c,width:t.width-u},(0,l.propOr)([],"right",r)),y=s.height+Math.max(p.height,d.height),f=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Lb({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Lb({},t,{items:(0,l.reject)(Wb,t.items)});switch(r.layout){case"scroll":return o(e,r);case"hbox":return s(e,r);case"vbox":return u(e,r);default:return null}},d=(0,l.propEq)("layout","profile",t),y={x:0,y:0,width:r.columns},f=d?c(y,t):p(y,t);return qb(f)},Qb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Xb=[tt.FilteredEntitiesViewFacet,tt.ActivitiesViewFacet,tt.ProfileStatsFacet,tt.FilteredSavedSearchesFacet],zb=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Xb.includes(a.component)?8:4;return Lb({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eO(e,t,r[t])}))}return e}function eO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tO={BarChart:et.BAR,BarChartGrouped:et.BAR,BarChartHorizontal:et.BAR,LineChart:et.LINE,Map:et.MAP,Pie:et.PIE},rO=(e,t)=>Tn(e)?pn(e,t):e,nO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=tO[r];return Zb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},iO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Zb({findPublic:r},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,["findShared"]))},aO=(e,t,r)=>{const n=(e=>e&&ae(e).map((e=>{const{type:t,value:r}=e;return Zb({},e,{value:[he.IN,he.NOT_IN,Te.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:be(t),fieldName:r,values:n?ae(n):void 0}})))(e);return t&&Tn(t)||!r?n:(n||[]).concat((i=r,{filter:Te.EQUALS,fieldName:"type",values:[i]}));var i},oO=["https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/world.countries.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/usa_prefix_latlng.topo.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/us-10m.json","https://reltio-ui-files.s3.amazonaws.com/map_resources/new_dashboard/zips-us-topo.json"],sO={"com.reltio.plugins.dashboard.BarChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.BAR,component:tt.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.BUBBLE,component:tt.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:tt.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ae(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Zb({id:t,count:o,canRead:u,orderType:s,attributeUri:rO(r,p),filters:aO(a,r,p),component:tt.DashboardFacet,title:i,showOthers:!0},nO(l))},"com.reltio.plugins.dashboard.MapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,mapType:l,canRead:u}=e;return{id:t,count:o,canRead:u,orderType:s,attributeUri:rO(n,r),filters:aO(a,n,r),chartType:et.MAP,component:tt.DashboardFacet,title:i,geoUrl:oO[l||0],projection:"geoMercator"}},"com.reltio.plugins.dashboard.SimpleMapView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,map:s,canRead:l,options:u}=e;return Zb({id:t,count:o,canRead:l,attributeUri:rO(n,r),filters:aO(a,n,r),component:tt.DashboardFacet,title:i,geoUrl:s,chartType:et.MAP,projection:"geoMercator"},nO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:iO(i),component:tt.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:aO(n,null,a),component:tt.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:Te.GTE,fieldName:"matches",values:["1"]}],component:tt.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:tt.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:et.CLOUD,component:tt.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:et.TREE,component:tt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.NotificationInboxFacet,title:n||fe().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:tt.ActivitiesViewFacet,title:n||fe().text("Activity log")}}},lO=e=>({id:e,height:10}),uO=(0,l.pipe)((0,l.map)((e=>{const t=sO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),cO=e=>{if("0.1"===e.version){const t=uO(e.views),r=Kb(lO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Qb(r,t),views:t}}return e},pO=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ae)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>pO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function dO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){yO(e,t,r[t])}))}return e}function yO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fO=dO({},rt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),TO=e=>e,EO={[fO.Attributes]:TO,[fO.HierarchyTree]:TO,[fO.HierarchyPaths]:TO,[fO.RelationsTable]:TO,[fO.Relations]:e=>dO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[fO.SingleAttribute]:TO,[fO.Custom]:TO,[fO.AttributeTable]:TO,[fO.Map]:TO,[fO.OldTree]:e=>dO({},e,{class:rt.HierarchyTree}),[fO.OldMap]:e=>dO({},e,{class:rt.Map}),[fO.ImageAttribute]:TO,[fO.PotentialMatches]:TO},mO=(0,l.pipe)((0,l.map)((e=>{const t=EO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),hO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===rt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),bO=(e,t)=>(t||[]).map((t=>dO({},t,hO(e,t.id)))),OO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return dO({},t,{layout:bO(t.views,e.newLayout)});if("0.1"===e.version){const r=mO(e.views),n=Kb(hO(r),e.layout,{columns:3});return dO({},t,{layout:Qb(n,r),views:r})}return e},vO=(e,t)=>e.class===t||e["react-class"]===t,gO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(vO(t,rt.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return(vO(t,rt.SingleAttribute)||vO(t,rt.AttributeTable))&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(n[0]||e).uri;return r&&!r.some(sn(i))||t.some(sn(i))}},_O=(e,t)=>e.filter((e=>t.some((t=>vO(e,t))))).map((e=>{let{id:t}=e;return t})),AO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},NO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),PO=e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function RO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SO(e,t,r[t])}))}return e}function SO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wO=(0,l.curry)(((e,t)=>pO(t).map((t=>(0,l.pipe)((0,l.map)((e=>AO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),IO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),UO=(0,l.propEq)("class",rt.Custom),CO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},DO=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];let i;if("2.0"===r&&t.newLayout){const{newLayout:r}=t,a=bO(t.views,r);return i=(0,l.when)((0,l.pipe)(l.head,(0,l.is)(String)),(0,l.pipe)((0,l.map)((t=>(0,l.pipe)((0,l.map)((e=>AO(e,t))),(0,l.reject)(l.isNil),l.head)(e))),(0,l.reject)(l.isNil),(e=>[{id:"common",views:e}])))(t.sidePanelViews),(0,l.pipe)((0,l.pick)(["views","profileBand","workflow","frozen"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=wO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>AO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(IO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(wO(e),(0,l.filter)(UO))(RO({},n,{items:i})),s=[{id:"common",views:wO(e,RO({},n,{items:a}))}];return o.length>0&&s.push({id:"D&B",views:o}),s}})(e,t);const o=(e=>(0,l.pipe)((0,l.chain)((e=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.entity.side.WorkflowsView"===e.class))})(e))),l.head,(0,l.unless)(l.isNil,(0,l.pick)(["showClosedTasks","assignee","processTypes"])))(e))(e),s=OO(RO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(PO,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:s.views,layout:s.layout,sidePanelViews:i,profileBand:u,workflow:o})},LO=(e,t)=>{if("scroll"===t.layout.layout){const r=wO(e,t.layout),n=cO(RO({},t,{views:r,version:"0.1"}));return{class:it.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:it.Dashboard,views:t.views,layout:t.layout,id:t.id}},jO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries,showOVSwitcher:r.showOVSwitcher,showErrorBands:r.showErrorBands}},kO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},FO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},MO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},xO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},$O=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},VO=(e,t)=>{const r=wO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=NO(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:it.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},GO=(e,t)=>({class:it.Graph,id:t.id}),BO=(e,t)=>{const r=wO(e,t.layout)[0];return{class:it.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},WO=e=>t=>!!(0,l.intersection)(e,t).length,YO=(0,l.cond)([[WO(["com.reltio.plugins.dashboard.BarChartView","com.reltio.plugins.dashboard.BubbleChartView","com.reltio.plugins.ui.CustomActionView","com.reltio.plugins.dashboard.FacetChartView","com.reltio.plugins.dashboard.MapView","com.reltio.plugins.dashboard.SimpleMapView","com.reltio.plugins.dashboard.ProfileStatsView","com.reltio.plugins.dashboard.FilteredSavedSearchesView","com.reltio.plugins.dashboard.FilteredEntitiesView","com.reltio.plugins.dashboard.EntitiesByTypeView","com.reltio.plugins.dashboard.EntitiesByTagView","com.reltio.plugins.dashboard.EntitiesByRoleView","com.reltio.plugins.inbox.NotificationInboxView","com.reltio.plugins.activities.ActivitiesView","com.reltio.plugins.react.ReactDashboardView"]),()=>LO],[WO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>jO],[WO(["com.reltio.plugins.graph.GraphView"]),()=>GO],[WO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>kO],[WO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>FO],[WO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>MO],[WO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>xO],[WO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>$O],[WO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>VO],[WO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>BO],[l.T,()=>(0,l.always)(void 0)]]),qO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(CO),(0,l.map)((t=>DO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow","frozen"])))(e);return{class:it.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:at.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:at.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>AO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",it.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>AO(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=DO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:it.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=pO(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return YO(o)(t,i)};function HO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JO(e,t,r[t])}))}return e}function JO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const KO=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},QO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var XO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(XO||(XO={}));const zO={[it.DQDashboard]:`${QO}DqDashboard.svg`,[it.Dashboard]:`${QO}Dashboard.svg`,[it.Graph]:`${QO}Graph.svg`,[it.RelationshipSearch]:`${QO}GraphSearch.svg`,[it.Interactions]:`${QO}Interactions.svg`,[it.PotentialMatches]:`${QO}PotentialMatches.svg`,[it.Profile]:`${QO}Profile.svg`,[it.NestedProfile]:`${QO}Profile.svg`,[it.ProfileActivityLog]:`${QO}ActivityLog.svg`,[it.Relationships]:`${QO}Relationships.svg`,[it.Sources]:`${QO}Crosswalk.svg`,[it.Search]:`${QO}Search.svg`,[XO.DashboardGroup]:`${QO}DashboardGroup.svg`,[XO.ProfileGroup]:`${QO}ProfileGroup.svg`,[XO.SearchGroup]:`${QO}SearchGroup.svg`,DEFAULT:`${QO}Default.svg`},ZO=e=>zO[null==e?void 0:e.class]||zO.DEFAULT,ev=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",it.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>HO({},e,{nestedRoute:`${t+1}`})))))),tv=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},rv=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?zO[XO.ProfileGroup]:null,nv=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===zO[it.Dashboard]||t===zO[it.DQDashboard]})),(0,l.always)(zO[XO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===zO[it.Search]||t===zO[it.RelationshipSearch]})),(0,l.always)(zO[XO.SearchGroup])],[l.T,()=>null]])(e),iv=e=>(0,l.pipe)((0,l.chain)(KO),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>HO({},e,{entityTypes:e["entity-types"],screen:qO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=ev(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:ZO(r),screen:tv(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=qO(t,e);return{label:t.label,icon:rv(t)||nv(r)||ZO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function av(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ov=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},sv=e=>({id:e,height:10}),lv=e=>{const t=(e=>(0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["attribute-types"]))}))(e))(e),r=(e=>(0,l.pipe)((0,l.chain)(ov),(0,l.pluck)("pivotingAttributes"),l.flatten)(e))(e);return((e,t)=>{const r=(e=>(e||[]).find((0,l.propEq)("attribute-types","*")))(t);return(0,l.pipe)((0,l.reduce)(((e,n)=>{const i=((e,t)=>e.find((e=>Array.isArray(e["attribute-types"])&&e["attribute-types"].includes(t.uri))))(t,n)||r;return null!=i&&i.id&&(e[i.id]||(e[i.id]={extension:i,attributeTypes:[]}),e[i.id].attributeTypes.push(n)),e}),{}),l.values)(e)})(r,t).map((t=>{let{extension:r,attributeTypes:n}=t;const i=((e,t)=>{if("scroll"===t.layout.layout){const r=uO(((e,t)=>{const r=pO(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){av(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Kb(sv,t.layout,{columns:4});return{views:r,layout:Qb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function uv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cv(e,t,r[t])}))}return e}function cv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pv(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const dv=(0,l.curry)(((e,t)=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)(e))(t))),yv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,fv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),Tv=(0,l.pipe)(dv("top-logo"),fv),Ev=(0,l.prop)("showLookupCode"),mv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propSatisfies)((0,l.either)(pe,(0,l.equals)("none")),"format")),(0,l.map)((e=>{let{format:t}=e;if("none"===t)return{thousandSeparator:""};const{groupSeparator:r,digitsAfterDecimalSeparator:n}=t;return uv({thousandSeparator:r,decimalScale:n},pv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(e=>{let{workflowPath:t,enabled:r}=e;return{enabled:r,path:t}}))(e))(e),p=(e=>(0,l.pipe)(dv("default-perspective"),(0,l.ifElse)(yv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=(e=>(0,l.pipe)((e=>NO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return uv({},t,pv(e,["action"]))})))(e))(e),f=(e=>dv("checkUser",e))(e),T=(e=>dv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),h=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=Ev(h))||O;var O;const v=null===(t=PO(e))||void 0===t?void 0:t.showEntityId,g=(e=>dv("preview",e))(e),_=Tv(e),A=(e=>dv("showAttributeDescription",e))(e),N=(e=>dv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.framework.util.DateMask"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(e=>{let{dateMask:t,dateTimeMask:r}=e;return{dateMask:t,dateTimeMask:r}}),(0,l.reject)(l.isNil))(e))(e),R=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.network.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["id","point"]))(e))(e),S=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e),w=0===Object.keys(P).length?void 0:P,I=(e=>(0,l.pipe)((0,l.map)((e=>AO(e,"com.reltio.plugins.ui.ProfileCheckUpdate"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.omit)(["id","point"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:w,requestProvider:R,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:S,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N,profileCheckUpdate:I}},hv=e=>({layout:iv(e),pivoting:lv(e),properties:mv(e)});function bv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ov(e,t,r[t])}))}return e}function Ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vv=e=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${(0,Gr.x0)()}`;return n[e.id].push(t),i=!0,bv({},e,{id:t})}return n[e.id]=[e.id],e})),o={},s=r&&i?r.map((e=>null==o[e.id]?(o[e.id]=0,e):(o[e.id]++,bv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function gv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_v(e,t,r[t])}))}return e}function _v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Av={};const Nv=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=ee(`${r.id}: ${r.action.files.join('","')}`);if(E(Av[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}Av=gv({},Av,{[a]:gv({},Av[a]||{},{worker:i})})}else i=Av[a].worker,Av[a].innerText&&t({task:{action:ut.SET_HTML,params:{html:Av[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Av[a].onWorkerMessage);return i&&(Av[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(Av[a].innerText=n.params.html)}},i.addEventListener("message",Av[a].onWorkerMessage)),i},Pv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Rv=(0,l.flip)(Pv);var Sv=r(83926);const wv=(e,t)=>{let r;try{r=t(e)}catch(t){return e}return"number"==typeof e?r.toNumber():r.toString()};function Iv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uv(e,t,r[t])}))}return e}function Uv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cv={[ft.percent]:{valueConverters:{in:e=>wv(e,(e=>new Sv.Decimal(e).mul(1e4).floor().div(100))),out:e=>wv(e,(e=>new Sv.Decimal(e).mul(100).floor().div(1e4)))}}},Dv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Cv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.in)||l.identity)(t)})),Lv=(0,l.curry)(((e,t)=>{var r,n;return((null===(r=Cv[e])||void 0===r||null===(n=r.valueConverters)||void 0===n?void 0:n.out)||l.identity)(t)})),jv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const{uri:n,name:i}=e||{},a=!n||xn(e)?i:n;return t[a]||t[Re]||Fv(r)},kv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{[Rt.relevanceScore.name]:Iv({},jv(Rt.relevanceScore,e,t),{strategy:ft.percent})}},Fv=(0,Ei.Z)((e=>{var t;e=null===(t=e)||void 0===t?void 0:t.replace(/_/g,"-");const r=new Intl.NumberFormat(e).formatToParts(1000000.1),n=e=>{var t;return null===(t=r.find((t=>{let{type:r}=t;return r===e})))||void 0===t?void 0:t.value};return{thousandSeparator:n("group"),decimalSeparator:n("decimal"),groupSize:("integer",(null===(i=r.filter((e=>{let{type:t}=e;return"integer"===t})).map((e=>{let{value:t}=e;return t})).sort(((e,t)=>t.length-e.length)))||void 0===i?void 0:i[0])||"000").length};var i})),Mv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s,strategy:l}=e;t=Dv(l,t);const u=null!=s?new Sv.Decimal(t).toFixed(s):t,[c,p]=u.split("."),d=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),y=c.replace(d,r),f=null==p?void 0:p.replace(/(0|\.)+$/,"");return i+y+(f?n+f:"")+a};let xv;const $v=()=>xv,Vv={setLocale:e=>{xv=e},getLocale:$v,number:e=>((e,t)=>{const r=String(t);try{const t=Fv(e);return Mv(t,r)}catch(e){return console.warn("Number localization error"),r}})($v(),e),applyFormatToNumber:Mv},Gv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Vv.applyFormatToNumber(e,t):(!e&&t&&(t=Vv.number(t)),t)))),Bv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?fe().number(e,"0,0.0a").toUpperCase():fe().number(e,"0,0"):""},Wv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Yv=!0;const qv=e=>Yv=e,Hv=(e,t)=>e!==t&&t?Yv&&e?`${t} (${e})`:t:e,Jv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Kv=(e,t,r)=>{const n=Jv(e,t,r);return Hv(r,n)},Qv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Xv=(0,l.complement)(Qv),zv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Zv=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,l.pipe)((0,l.reduce)(((e,t)=>t.reduce(((e,t)=>{let{type:r,codeValues:n}=t;return e[r]={type:r,codeValues:(0,l.uniq)([...(0,l.pathOr)([],[r,"codeValues"],e),...n])},e}),e)),{}),l.values)(t)},eg=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Xv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),tg=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=i?J(i):"L",s=a?X(a):"L LTS";switch(n.type){case Et.TYPE_NUMBER:case Et.TYPE_FLOAT:case Et.TYPE_DOUBLE:case Et.TYPE_LONG:case Et.TYPE_INT:case Et.TYPE_COUNT:{const e=jv(n,r,Vv.getLocale());return t&&Gv(e,t)}case Et.TYPE_BOOLEAN:case Et.TYPE_BOOLEAN_RADIO:case Et.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isEmpty)(t)?"":(t=t,(0,l.isNil)(t)?t:ce(t)?fe().text("Yes"):fe().text("No"));case Et.TYPE_DATE:return(0,l.is)(Number,t)&&(t=P(Number(t)).getTime()),(t=t)&&(Ju(t)?Ku(t):fe().date(t,o));case Et.TYPE_ACTIVENESS_DATE:case Et.TYPE_LOCAL_DATE:return(t=t)&&(Ju(t)?Ku(t):fe().date(t,o));case Et.TYPE_TIMESTAMP:return(t=t)&&(Ju(t)?Ku(t):fe().date(isNaN(t)?t:Number(t),s));case Et.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Et.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Et.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?Hv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}}));r(72342);const rg={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},success:{main:"#3B873E"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)",hint:"rgba(0,0,0,0.38)"},divider:"rgba(0,0,0,0.38)"},components:{MuiButton:{defaultProps:{color:"inherit"}},MuiTooltip:{defaultProps:{disableInteractive:!0}},MuiTab:{styleOverrides:{root:{maxWidth:"264px"}}},MuiDialogTitle:{styleOverrides:{root:{"&&+.MuiDialogContent-root":{paddingTop:"13px"}}}},MuiFilledInput:{styleOverrides:{root:{lineHeight:"1.1876em",backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},input:{"&.MuiSelect-select":{minHeight:"1.1876em"}}}},MuiInputBase:{styleOverrides:{root:{"& .MuiInputAdornment-root":{color:"rgba(0,0,0,0.87)"}},input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"},"&.Mui-disabled":{WebkitTextFillColor:"inherit"}}}},MuiMenuItem:{styleOverrides:{root:{"&.Mui-selected":{backgroundColor:"rgba(0, 0, 0, 0.08)","&.Mui-focusVisible":{backgroundColor:"rgba(0, 0, 0, 0.08)"},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}},transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"};function ng(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ig(e,t,r[t])}))}return e}function ig(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ag=e=>(t,r)=>{const{timeout:n}=r,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["timeout"]);if(AbortController&&n){const r=new AbortController,a=setTimeout((()=>r.abort()),n);return e(t,ng({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},og=e=>{const t=e=>{switch(e){case 429:case 502:case 503:case 504:return 4;default:return 0}},r=e=>{const t=Math.random()+1;return new Promise((r=>{const n=Math.min(Math.round(1e3*Math.exp(e)*t),2e4);setTimeout(r,n)}))};return(n,i)=>{const a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e(n,i).then((e=>{const n=t(e.status);return n>0&&o<n?r(o).then((()=>a(o+1))):e}))};return a()}},sg=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=ng({},JSON.parse(t),{[vr]:e.status})}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),lg=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i,resolve:a}=t,o=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e,resolve:a})),t.next);o(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s={},u=(0,l.pipe)(ag,(e=>{const t={},r={};return n=>{var i,a;const o=null!==(i=e.attemptsThreshold)&&void 0!==i?i:10,s=null!==(a=e.attemptsTimeWindowSize)&&void 0!==a?a:5e3;return(i,a)=>{const l=(e=>{const[t]=e.split("?");return t.split("/")[2]})(i),u=t[l],c=()=>Promise.reject({errorMessage:`service ${l} was disabled (authorization issues)`});if(u)return c();if(r[l]){const e=r[l].length;if(e>o){const n=e-o-1;if(r[l][e-1]-r[l][n]<=s)return t[l]=!0,c();r[l]=r[l].slice(n)}}return n(i,a).then((t=>{var n;return!e.excludedServices||null!==(n=e.excludedServices)&&void 0!==n&&n.includes(l)||(401===t.status?(r[l]||(r[l]=[]),u||r[l].push(Date.now())):r[l]&&t.ok&&(r[l].length=0)),t}))}}})(s),(e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),og,sg);let c=0,p=[];return{request:(e,n)=>{const i=u(fetch);if(null!=n&&n.noRequestProcessor)return i(e,n);const a=()=>{const a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},resolve:e=>{r(e)},abort:i})})):a(e,n)};if(c){const{delayedRequest:e,resolver:t}=(e=>{let t;const r=new Promise((e=>{t=()=>{e(null)}})).then((()=>e()));return{delayedRequest:r,resolver:t}})(a);return p.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,setRequestProviderConfiguration:e=>{Object.assign(s,e)},startInterceptorInit:()=>{c+=1},finishInterceptorInit:()=>{c=Math.max(c-1,0),0===c&&(p.forEach((e=>e())),p=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},ug="__metadata",cg=(e=>{const t=[ug,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),pg=(0,l.set)(cg),dg=(0,l.view)(cg),yg=pg(Ae.NEW),fg=pg(Ae.REMOVED),Tg=pg(Ae.EDITED),Eg=pg(Ae.IGNORED),mg=(0,l.pipe)(dg,(0,l.equals)(Ae.REMOVED)),hg=(0,l.pipe)(dg,(0,l.equals)(Ae.NEW)),bg=(0,l.pipe)(dg,(0,l.equals)(Ae.EDITED)),Og=(0,l.pipe)(dg,(0,l.complement)(l.isNil)),vg=(0,l.pipe)(dg,(0,l.equals)(Ae.IGNORED)),gg=(0,l.omit)([ug]),_g=(e,t)=>e===ug?void 0:t;function Ag(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e(t))return r.concat(t);if(t&&t.children)for(const n of t.children){const i=Ng(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Pg=(e,t)=>Ng((0,l.propEq)("nodeId",t),e),Rg=(e,t)=>Ng((0,l.pathEq)(["entity","uri"],t),e),Sg=(e,t)=>{const r=Pg(e,t);return r.length>1?r[r.length-2]:null},wg=(e,t)=>{const r=Pg(e,t);return r.length>0?r[r.length-1]:null},Ig=(e,t)=>{let{parent:r,childrenProcessing:n=(e=>e),nodeProcessing:i=(e=>e)}=t;return(e=i(e,r)).children&&(e.children=n(e.children.map((t=>Ig(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Ug=()=>{},Cg=(e,t)=>{let{parent:r,nodeProcessing:n=Ug}=t;n(e,r),e.children&&e.children.forEach((t=>Cg(t,{parent:e,nodeProcessing:n})))},Dg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case We.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case We.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case We.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ag(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},Lg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&Cg(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===We.addingChild||r.editingMode===We.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Dg({node:r,connection:n,isReversed:i}),s=Lp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===We.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Dg({node:r,isReversed:i,connection:n}),l=s?Mp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Fp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},jg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=jg(r,t);if(e)return e}return!1},kg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(kg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Fg=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>jg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:kg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Mg={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},xg={asc:"asc",desc:"desc"},$g=Mg.entityLabel,Vg=xg.asc,Gg=(0,l.always)(0),Bg=e=>{let{sortField:t=$g,sortOrder:r=Vg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Mg.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return zN.strings.sort(t,a,o)})(n,r);case Mg.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return zN.strings.sort(e,i,a)})(r);default:return Gg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Wg=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(xg)),l.identity,(0,l.always)(Vg))),Yg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Mg)),l.identity,(0,l.always)($g)));var qg=r(91104);let Hg;const Jg=(e,t)=>(Hg||(Hg=qg.createClient({key:t})),new Promise((t=>{Hg.geocode({address:e},((e,r)=>{e&&(console.warn(e),t(null));const{results:n}=r.json,i=(0,l.pathOr)(null,[0,"geometry","location"],n);t(i||null)}))}))),Kg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Qg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(Ts).flatMap((e=>{let r;return e.type==t&&(r=[Kg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Qg(e.value,t))),r})),Xg=e=>e&&e.length>0,zg=(e,t)=>[].concat(e&&e.attributes?Qg(e.attributes,t):[]).filter(l.identity);function Zg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e_=(e,t,r,n,i,a)=>{if(e&&e.type){const t=hi(r,e.type);n&&(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=zg(e,t.latitude),n=zg(e,t.longitude),Xg(r)&&Xg(n)&&(0,l.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),r,n);var r,n})).filter(l.identity);if(a.length>0)return Promise.resolve(a[0])}const o=t.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Xg(t)&&t[0].value&&Xg(r)&&r[0].value)return{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(l.identity);if(e.length>0)return Promise.resolve(e)}return n&&n.label?Jg(n.label,a).catch((()=>null)):Promise.resolve(null)},t_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=hi(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>[e,t.attributes[e]])).filter((e=>{let[,t]=e;return t})).flatMap((e=>{let[r,n]=e;return n.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e,name:r})))})));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s,name:u}=t;return e_(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?Jg(a.label,r).catch((()=>null)):e)).then((e=>ae(e).filter(l.identity).map((e=>({id:e.id||n,label:i,entity:a,point:e}))))).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},r_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Promise.resolve((0,l.pipe)((0,l.chain)((t=>{const r=hi(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Zn(e,r.latitude,t.type)&&Zn(e,r.longitude,t.type)){const e=zg(t,r.latitude),n=zg(t,r.longitude),i=(e,r)=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}});return(0,l.zipWith)(i,e,n)}}))})),(0,l.filter)(l.identity),(0,l.uniqBy)((0,l.prop)("id")))(t))},n_=(e,t,r)=>Promise.all([r_(e,t),t_(e,t,r)]).then((e=>{const[t,r]=e;return[...t,...r.filter((e=>0===t.length||!t.some((t=>t.entity===e.entity&&t.point.lat===e.point.lat&&t.point.lng===e.point.lng))))]}));function i_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){a_(e,t,r[t])}))}return e}function a_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const o_=(e,t)=>t.values.map(_o(e,t.entityTypeUri)),s_=(e,t,r)=>nl(t.fieldName,r)||Zn(e,pn(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),l_=(e,t)=>{const r=(0,l.propOr)([],"values",t),n=(0,l.path)([t.attrType.lookupCode],e);return(0,l.map)((e=>{const t=(0,l.prop)(e,n);return t?Hv(e,t):e}),r)},u_=(0,l.path)(["attrType","label"]),c_=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>i_({},e,{[t]:!0})),{});e[r]=e[r]?i_({},e[r],n):n}return e}),{}),p_=(0,l.pipe)((0,l.prop)("values"),E),d_=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Ut.type.name)),y_=e=>e.type===E_.NUMERIC_RANGE_FACET,f_=e=>e.type===E_.DATE_RANGE_FACET,T_=(0,l.either)(y_,f_),E_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},m_=e=>{switch(null==e?void 0:e.name){case Ut.type.name:return E_.ENTITY_TYPE_FACET;case Ut.createdBy.name:case Ut.updatedBy.name:case Ut.sourceSystems.name:case Ut.tags.name:case Ut.roles.name:case Ut.matchRules.name:case Ut.MLRecommendedMatch.name:return E_.WITH_DROPDOWN_CHECKBOXES_FACET;case Ut.createdTime.name:case Ut.updatedTime.name:case Ut.startDate.name:case Ut.endDate.name:return E_.DATE_RANGE_FACET;case Ut.matches.name:case Ut.matchScore.name:return E_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return E_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return E_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return E_.DATE_RANGE_FACET;default:return E_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},h_=(0,l.pipe)(s_,m_),b_=(0,l.pipe)((0,l.path)(["attrType","type"]),ci),O_=(0,l.cond)([[y_,(0,l.always)(Te.IN_RANGE)],[f_,(0,l.always)(Te.WITHIN)],[(0,l.allPass)([b_,e=>e.values.length>=2]),(0,l.always)(Te.EXISTS)],[l.T,(0,l.always)(Te.EQUALS)]]),v_=(0,l.cond)([[f_,(0,l.prop)("values")],[y_,(0,l.prop)("values")],[b_,e=>1===e.values.length?e.values.map(ce):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]),g_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(ge),__=e=>(e=>g_.reduce(((e,t)=>{const r=new RegExp(`'{0,1}${encodeURIComponent("${")}${t}${encodeURIComponent("}")}'{0,1}`,"g"),n=new RegExp(`'{0,1}${encodeURIComponent("${")}now${encodeURIComponent("}")}'{0,1}`,"g"),[i,a]=Xu(t);return e.replace(r,i).replace(n,a)}),e))(e),A_=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),N_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},P_=e=>[N_.geoPolygon,N_.onMapMove].includes(e),R_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},S_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},w_=(e,t)=>P_(e)?t.map(R_):[S_(t)],I_=e=>P_(e)?fe().text("Geo Polygon"):fe().text("Geo Location"),U_=e=>{switch(e){case N_.geoLocation:return"geoLocation";case N_.geoPolygon:case N_.onMapMove:return"geoPolygon"}},C_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},D_=e=>fe().text(e),L_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Te.EQUALS]:"=",[Te.NOT_EQUALS]:"≠",[Te.STARTS_WITH]:"*",[Te.MISSING_VALUE]:fe().text("missing value"),[Te.HAS_ALL]:fe().text("has all"),[Te.IN_RANGE]:fe().text("in range"),[Te.FULL_TEXT]:fe().text("full text"),[Te.EXISTS]:fe().text("exists"),[Te.COUNT_EQUALS]:`${fe().text("count")} =`,[Te.COUNT_NOT_EQUALS]:`${fe().text("count")} ≠`,[Te.COUNT_LT]:`${fe().text("count")} <`,[Te.COUNT_LTE]:`${fe().text("count")} <=`,[Te.COUNT_GT]:`${fe().text("count")} >`,[Te.COUNT_RANGE]:fe().text("count range"),[Te.LT]:"<",[Te.LTE]:"<=",[Te.GT]:">",[Te.GTE]:">=",[Te.IN_FILE]:fe().text("in file"),[Te.NOT_IN_FILE]:fe().text("not in file"),[Te.CONTAINS]:"~",[Ee.LIST_EQUALS]:"=",[Ee.NOT_LIST_EQUALS]:"≠",[Ee.LIST_EQUALS_CASE_SENSITIVE]:"=",[Ee.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||fe().text(e.toLowerCase())},j_=e=>({type:C_.operator,text:e}),k_=e=>({type:C_.operator,text:D_(e)}),F_=e=>({type:C_.attributeLabel,text:e}),M_=e=>({type:C_.specialAttributeLabel,text:e}),x_=e=>({type:C_.attributeFilter,text:L_(e)}),$_=e=>({type:C_.attributeValue,text:e}),V_=e=>({type:C_.entityTypeLabel,text:e}),G_=()=>({type:C_.space,text:" "}),B_=()=>({type:C_.bracket,text:"("}),W_=()=>({type:C_.bracket,text:")"}),Y_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),q_=(0,l.curry)(((e,t)=>t.map(Y_(e)))),H_=(0,l.curry)(((e,t,r)=>[e,...r,t])),J_=H_(B_(),W_()),K_=H_(G_(),G_()),Q_=(0,l.curry)(((e,t)=>[e,...t])),X_=e=>Q_(V_(e)),z_=e=>Q_(V_(`${e}: `)),Z_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Pu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Au(s),a=Nu(s);!r&&t&&n&&(i.push(B_()),r=!0),i.push(o),r&&a&&(i.push(W_()),r=!1);const l=e?k_(s):j_(s);i.push(...K_([l]))}else i.push(o),r&&(i.push(W_()),r=!1)}return i}},eA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),tA=(0,l.pipe)(Z_({localizable:!1}),eA),rA=function(e){let{data:{title:t,pathToTitle:r}}=e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r&&n?r.slice(1).join(" / "):t},nA=e=>{let{data:t,values:r,filter:n}=e;return t&&Oc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},iA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(nA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),aA=(0,l.pipe)((0,l.chain)((0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)((e=>(e=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.attrType)&&Kn(e.data.attrType)})(e)&&[Te.HAS_ALL,Te.EQUALS,Te.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Jn((0,l.path)(["data","attrType"],e)),codeValues:(0,l.flatten)((0,l.propOr)([],"values",e))}))),(0,l.filter)((e=>{let{codeValues:t}=e;return t.length>0})))),Zv),oA=(e,t)=>(0,l.pipe)(aA,eg(t))(e),sA=(0,l.pathEq)(["data","fieldName"],Ut.type.name),lA=(0,l.path)(["data","entityTypeUri"]),uA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),cA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ys(e)),attributes:(0,l.filter)((0,l.pipe)(lA,(0,l.anyPass)([l.isNil,ys(e),r=>{const n=(t.entityTypes||[]).filter(ys(e));return(n.length>1?_i(e,n):null)===r&&!!hi(e,r)}])))})(t))))),pA=e=>(0,l.pipe)((0,l.prop)("filter"),pu,(0,l.equals)(e)),dA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=nl(n.fieldName)||n.attrType,s=Yu(o,i),u=tg({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Kn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Hv(a.lookupCode,a.value):Kv(r,Jn(o),a)],[()=>al(s),()=>_o(e,n.entityTypeUri,a)],[()=>ol(s),()=>qo(e,a)],[()=>dl(s),()=>Ko(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>si(c)||ci(c)),$u),$_)()})),yA=(e,t,r,n)=>{const i=dA(e,t,r,n.data,n.filter);return(0,l.cond)([[pA(0),(0,l.always)([])],[(0,l.both)(pA(2),(2,(0,l.pipe)((0,l.prop)("values"),l.flatten,l.length,(0,l.equals)(2)))),e=>{let{values:t}=e;const[r,n]=(0,l.flatten)(t);return[G_(),i(r),{type:C_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[G_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),q_({type:C_.punctuationMark,text:", "}))(t)]}]])(n)},fA=(e,t)=>{const r=!!nl(e.data.fieldName);return(0,l.pipe)(rA,r?M_:F_)(e,t)},TA=(e,t,r,n,i)=>[fA(n,i),G_(),x_(n.filter),...yA(e,t,r,n)],EA=(0,l.addIndex)(l.map),mA=(0,l.propEq)("length",1),hA=(0,l.propSatisfies)((0,l.lt)(1),"length"),bA=(0,l.complement)(l.isEmpty),OA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(wu,(0,l.filter)(nA),Iu,(0,l.map)((n=>({operand:TA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,Z_()))(n)},vA=(0,l.pipe)(OA,l.flatten),gA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Tp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=OA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(X_),(0,l.pipe)(s(z_),(0,l.unless)((()=>mA(u)||i),J_)))(u)},_A=(e,t,r,n)=>(0,l.pipe)(wu,(0,l.filter)(iA),Iu,EA(((n,i,a)=>({operand:gA(e,t,r,n,mA(a)),operator:n.operator}))),Z_(),l.flatten)(n),AA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),Z_(),l.flatten),NA=e=>{let{searchType:t,values:[r]}=e;return w_(t,r).join(", ")},PA=(e,t,r,n,i,a)=>{const o=(e=>e?[M_(e.isRawFilter?fe().text("Raw filter"):fe().text("Search")),...K_([x_(Te.EQUALS)]),$_(`"${e.value}"`)]:[])(i),s=(e=>e?[M_(I_(e.searchType)),G_(),$_(NA(e))]:[])(a),u=(0,l.pipe)(_A,(0,l.when)((e=>hA(e)&&(bA(o)||bA(s))),J_))(e,t,r,n);return AA([o,s,u])},RA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),SA=(0,l.pipe)(PA,RA),wA=(0,l.has)("attributes"),IA=Array.isArray,UA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),CA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=DA(e,t,r,a,i);return(0,l.when)((0,l.always)((0,l.complement)(l.isNil)(o)),(0,l.pipe)((0,l.when)((0,l.always)((0,l.not)(UA(a))),J_),(0,l.concat)(K_([j_(o)]))))(s)},DA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return wA(n)?CA(e,t,r,n,i):IA(n)?n.reduce(((n,a)=>n.concat(DA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(K_([j_(n.operator)])))(TA(e,t,r,n,i))},LA=(e,t,r,n,i)=>(0,l.pipe)(DA,l.flatten)(e,t,r,n,i);function jA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kA(e,t,r[t])}))}return e}function kA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FA=(0,l.complement)(sA),MA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(sA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(lA),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},xA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=MA(t);return(r||n)&&Ru(t)},$A=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(xA)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(sA).some((0,l.propEq)("filter",Te.NOT_EQUALS))))&&t.push("Can't convert advanced search group with 'Type' attribute and 'not equals' filter."),t.length)throw t;return e}),(0,l.reduce)(((e,t)=>e.concat((e=>{const t=[],r=e.attributes||[],{entityTypesFromSpecialAttributes:n,entityTypesFromAttributes:i}=MA(r);if(xA(e))t.push(jA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(FA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(sA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(lA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(FA),entityTypes:n,operator:i?a:e.operator,id:(0,Gr.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),VA={[Te.EQUALS]:Te.ON,[Te.IN_RANGE]:Te.WITHIN,[Te.GTE]:Te.AFTER,[Te.GT]:Te.AFTER,[Te.LTE]:Te.BEFORE,[Te.LT]:Te.BEFORE},GA=(0,l.curry)((e=>VA[e]||e)),BA=(0,l.curry)(((e,t)=>{switch(e){case Te.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Te.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),WA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ii),YA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>jA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return WA(e)?(0,l.evolve)({filter:GA,values:BA(t)},e):e}))})))})),qA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Hu),(0,l.map)(Xu))}),HA=(0,l.map)((0,l.cond)([[WA,qA],[l.T,l.identity]])),JA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),$A,cA(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),HA)})),YA,(0,l.reject)(uA))(r)));function KA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){QA(e,t,r[t])}))}return e}function QA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XA=(e,t)=>({data:{uri:Tn(e.fieldName)?pn(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||O_(e),id:(0,Gr.x0)(),values:v_(e)}),zA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=nl(a,t,r)||Zn(e,i);if(!s)return null;if(xn(s))return KA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Tp(e,{type:o}),i=(zn(e,pn(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return KA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),ZA=(0,l.curry)(((e,t,r,n)=>JA(zA,e,n,t,r)));function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tN(e,t,r[t])}))}return e}function tN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},nN=e=>"rdmLookups.not.resolved"===e?Ut.notResolved.name:e,iN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===he.NOT_IN_RANGE?Te.IN_RANGE:be(a),u=nN(n),c=nl(u)||Zn(e,i),p=(0,l.cond)([[()=>Tu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>eN({},e,{filename:Wv(e)}))))],[()=>ci(null==c?void 0:c.type),(0,l.map)(ce)],[e=>yu(s)&&!Array.isArray(e[0])&&!ii(null==c?void 0:c.type),oe],[l.T,l.identity]])(o);return{id:(0,Gr.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===he.NOT_IN_RANGE?"and not":"and",filter:s,values:p}})),aN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(iN(e,_i(e,i)));return[{id:(0,Gr.x0)(),operator:"or",attributes:a,entityTypes:i}]})),oN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),sN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([oN("from"),oN("to")]),(0,l.pipe)((0,l.pick)(["from","to"]),l.values)],[(0,l.pipe)((0,l.prop)("rangeSelection"),E,l.not),(0,l.pipe)((0,l.prop)("rangeSelection"),(0,l.pick)(["start","end"]),l.values)],[l.T,()=>[]]]),lN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return eN({},r,{values:sN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?zs(e.fieldName,n):e.fieldName})},uN=(e,t)=>{if((0,l.has)("children")(e)){const r=lN(e,t);return e.children.reduce(((e,n)=>(e.push(uN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return lN(e,t)},cN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(lN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(eN({fieldName:e.fieldName},lN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(uN,l.flatten)],[l.T,lN]]),pN=(0,l.pipe)((0,l.map)(cN),l.flatten),dN=e=>{if(e.every((e=>Array.isArray(e))))return e;if(2===e.length)return[e.map((e=>Number(e)))];if(1===e.length){const t=Number(e[0]);return[[t,t]]}return e},yN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=aN(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:pN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>eN({},t,{type:h_(e,t)}))).map((e=>eN({},e,{values:T_(e)?dN(e.values):e.values}))).map((e=>{let{filter:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["filter"]);return XA(r,t)})),operator:"or",id:(0,Gr.x0)(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[nN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[eN({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return ZA(e,t,r,p)},fN=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(p_),(0,l.partition)(d_))(t),i=n.map((t=>KA({},t,{type:h_(e,t)}))).map((e=>XA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Gr.x0)(),entityTypes:a}]})(e,a);return ZA(e,t,r,o)})(e,t,r,n):yN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},TN=e=>"2.0"===e.version?e.keyword:rN(e),EN=e=>(0,l.pathEq)(["object","uri"],e),mN=(e,t)=>(0,l.pipe)((0,l.find)(EN(e)),(0,l.prop)("object"))(t),hN=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,l.pipe)((0,l.find)((0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),EN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=mN(r.match,t)||n[r.match];return i?{label:Hc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return go(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},bN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),ON=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),vN=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[],negativeRules:a=[]}=t;const o=(0,l.propOr)({},n,r);return{label:Hc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return go(e,o.type,t)||{label:t,uri:t}}))}})))(t),gN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.map)((0,l.prop)("shortestTransitiveMatchPath")),l.flatten,(0,l.filter)(l.identity),(0,l.map)((0,l.prop)("match")),l.uniq);return t(e)},_N=(0,l.path)(["object","uri"]),AN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find((e=>{let{uri:r}=e;return r===t}))},NN=e=>void 0!==(null==e?void 0:e.relevance),PN=e=>NN(e)?100*e.relevance+"%":"";function RN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SN(e,t,r[t])}))}return e}function SN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wN=(e,t)=>!!e[t],IN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},UN=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return 0===t.length&&e?e:(0,l.uniqBy)(r,[...t,...e||[]])},CN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return RN({},t,{[r.uri]:RN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:UN(null==o?void 0:o.parents,n),children:UN(null==o?void 0:o.children,i),values:UN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},DN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=hi(r,t)||Ri(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return rs(r,n,i).flatMap(is).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Zn(r,e))).filter(l.identity).filter((0,l.prop)("dependentLookupCode"));return(e=>{let{structure:t,parentAttrType:r,childrenAttrTypes:n}=e;const i=n.map((0,l.prop)("uri")),a=CN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>CN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},LN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!zr(e.uri)&&an(e.type)&&an(t)&&!t.startsWith(e.type))(n,t))return e;const i=Is(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(Ts),(0,l.map)(IN))(i);return CN({structure:e,attrType:e[t].attrType,values:a})}),t)},jN=e=>{let{structure:t,attributeValue:r}=e;if((0,l.is)(Object,r.value))return Object.values(r.value).reduce(((e,t)=>{const r=t.some((e=>{let{value:t}=e;return(0,l.is)(Object,t)})),n=t.some((t=>{let{type:r}=t;return wN(e,r)}));return r||n?t.filter(Ts).reduce(((e,t)=>jN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return wN(t,e.type)?CN({structure:t,attrType:t[e.type].attrType,values:[IN(e)]}):t}},kN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?RN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},FN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Is(i,n,r)||[];return a.length?CN({structure:t,attrType:t[r].attrType,values:a.filter(Ts).map(IN)}):t},MN=(e,t,r)=>{const n=tn(e),i=tn(t);return n===i?((e,t)=>{const r=hn(t),n=hn(e);return sn(n,r)||((e,t)=>En(e)&&!En(t)&&sn(t,e))(n,r)})(e,t):!(!r||!mn(t))&&ph(r,i).includes(n)},xN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},$N=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?uh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return MN(r,t,o)}))},VN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>VN(e,t,r)))))},GN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},BN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&xN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!GN(i,a)}},WN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=tn(n),p=ch(c,o,i,a),d=VN("children",t,u),y=VN("parents",t,u),f=d.flatMap((e=>VN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return MN(t,n,p)})).map((t=>BN(e.attrType.uri,n,t,s,l)))));if(!T.length)return[];const E=y.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return MN(n,t,p)||tn(t)!==c&&MN(t,n,p)})).map((t=>BN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=VN("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return T.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&MN(n,t,p)}))})).map((t=>BN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return MN(t,n,p)})).map((e=>BN(r,n,e,s,l))),...E,...m,...T]},YN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=tg({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>Yc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Bn,()=>a(n)],[Kn,()=>(e=>{const r=o(e),n=Jn(t);return zl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Kv(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},qN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Te.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(HN(r,t)):i.push(JN([t],r)),i},HN=(e,t)=>{const r=$n(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Bn(i)?HN(i,t[r]):[JN(t[r],i)];return e.push(...a),e}}),[])},JN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Hn(t.uri),filter:t.type===Et.TYPE_BLOB?Te.FULL_TEXT:Te.EQUALS,values:e}:{fieldName:Hn(t.uri),filter:Te.MISSING_VALUE},KN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),QN=new class{constructor(){this.comparators=void 0,this.comparators={}}register(e,t){this.comparators[e]=t}get(e){var t;return null!==(t=this.comparators[e])&&void 0!==t?t:KN}},XN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},zN={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},47485:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
2
2
  //# sourceMappingURL=9383.js.map