@reltio/remotes 1.4.1502 → 1.4.1504

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/5740.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5740],{16657:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>tl,IL3:()=>cT,PY2:()=>kn,Ng6:()=>Ot,YJ7:()=>In,NlI:()=>bn,XYV:()=>Rn,Xt7:()=>ft,wfT:()=>hi,EMD:()=>si,HAc:()=>Et,PEf:()=>Vn,oA3:()=>oi,$XE:()=>kt,eWf:()=>xn,q7e:()=>mt,KVe:()=>bi,WVQ:()=>Yr,oZZ:()=>Ri,bNA:()=>Si,Rjq:()=>wi,G39:()=>Wn,W0P:()=>Yt,X1H:()=>Gt,hdG:()=>Jt,ws7:()=>Qt,VI$:()=>Ht,yn8:()=>Ct,N0y:()=>Ut,dZX:()=>Ft,bQt:()=>Ui,oS0:()=>Xt,KfU:()=>Tt,bZE:()=>Nn,Nsj:()=>Dn,psV:()=>wn,xPW:()=>Fn,pyR:()=>yi,p8l:()=>ui,Wkf:()=>yt,zHr:()=>dt,NIO:()=>pt,$26:()=>r_,Esk:()=>ti,s9T:()=>wt,MEy:()=>Vu,j5E:()=>hn,vAw:()=>ai,NMQ:()=>ii,eVu:()=>oc,YGb:()=>Bt,mNm:()=>pi,Y1q:()=>yh,RgZ:()=>ci,Qy0:()=>Ii,Q26:()=>Cn,pYu:()=>ei,wIJ:()=>P_,GFH:()=>gt,Ury:()=>Bn,S91:()=>Yn,p3$:()=>Di,wSh:()=>Z,BDP:()=>Bi,pGS:()=>di,ARY:()=>zt,XGc:()=>mi,fO_:()=>an,wwy:()=>Pt,h_8:()=>Hn,_XL:()=>Un,j2V:()=>Oi,dMV:()=>Ti,NBX:()=>NN,OXy:()=>Zt,BXd:()=>Dt,KM9:()=>bt,CJB:()=>_i,lXI:()=>$t,C68:()=>Gn,yxQ:()=>Ci,Yj_:()=>Rt,D25:()=>At,ZIY:()=>Mt,Tl4:()=>D_,lwr:()=>$n,NkU:()=>vi,Rtp:()=>Ei,YGx:()=>Lt,uTS:()=>fi,MCv:()=>ht,IYE:()=>li,PiC:()=>Pi,MVv:()=>qt,h_m:()=>Vt,DUe:()=>Pn,tJI:()=>vt,fDt:()=>_t,cNQ:()=>gi,SwE:()=>ri,ZHR:()=>Ni,PYu:()=>Wt,lD1:()=>qn,lVm:()=>jt,vnX:()=>Pg,$x5:()=>Rg,_R1:()=>Ag,wUm:()=>Ng,dC6:()=>It,MBD:()=>Nt,GmF:()=>ga,cKm:()=>xt,iP_:()=>Mn,NVC:()=>St,tPT:()=>wl,tZe:()=>RT,kRE:()=>ZE,psB:()=>em,X0$:()=>Sl,$vY:()=>Rl,zE1:()=>xl,Wm5:()=>ml,vyX:()=>Gc,wLZ:()=>Il,W4V:()=>se,EtK:()=>ks,ayi:()=>Pl,asT:()=>FN,kGs:()=>$h,ewt:()=>Nd,O_f:()=>Du,sOy:()=>Ke,Tde:()=>Ar,LMI:()=>Nc,skb:()=>gA,sPt:()=>Ec,sH1:()=>mc,lPZ:()=>Jy,bG8:()=>Hy,_LJ:()=>Qy,RPM:()=>Xd,h27:()=>jc,Uqd:()=>Vc,xG:()=>jA,Z2f:()=>xv,fgW:()=>rA,I69:()=>RA,ZxB:()=>wA,dwd:()=>qy,F$g:()=>Yy,mdt:()=>rb,Qbq:()=>Ph,rny:()=>aa,UEY:()=>Wa,Q0T:()=>Ga,Lyr:()=>Ka,sBn:()=>Va,itK:()=>Fa,H9$:()=>$a,KPc:()=>xa,zos:()=>Ma,ELQ:()=>Xa,dZs:()=>Ra,Cz4:()=>Pa,z_L:()=>Ja,fGe:()=>Na,iuF:()=>ja,Wib:()=>ka,Hn0:()=>Qa,obS:()=>za,E$L:()=>Sa,XUh:()=>La,Qp_:()=>Ca,_jk:()=>wa,sKE:()=>Ia,WmG:()=>Da,QKx:()=>qa,Oik:()=>Ya,s0A:()=>Ua,o9m:()=>Ba,MCd:()=>Ha,RsS:()=>kc,tGK:()=>lu,lIv:()=>$l,Vg3:()=>da,mkC:()=>Zi,xv5:()=>fa,a14:()=>ta,yv0:()=>ya,Zm0:()=>ea,Nxd:()=>zi,$mM:()=>pa,ifj:()=>Hr,NWi:()=>og,xr3:()=>ag,wNf:()=>hu,iJH:()=>sg,d89:()=>Qi,Edd:()=>Ki,Z5t:()=>Xi,uGe:()=>qi,UoR:()=>Yi,xvW:()=>ig,$qe:()=>ng,yPM:()=>Aa,$cp:()=>Ml,vKJ:()=>kl,VtG:()=>Of,AID:()=>zm,B1H:()=>_N,b7X:()=>_h,$uE:()=>Wh,keo:()=>Nh,C_p:()=>Fy,G27:()=>sO,JA0:()=>GE,b3T:()=>xh,oC6:()=>Fh,_Zs:()=>Mh,epC:()=>Yh,YYG:()=>Bh,f_2:()=>BE,w3l:()=>aN,QHB:()=>oO,Jso:()=>dN,RXH:()=>Yb,Vr9:()=>EO,lMm:()=>fv,BlA:()=>JN,fmQ:()=>Ss,yRD:()=>qA,NcL:()=>Wy,QK6:()=>Ee,ymd:()=>uT,JV_:()=>Em,XiW:()=>Jp,Yrx:()=>wE,GPx:()=>Nl,gjI:()=>Al,vlo:()=>Wd,E_P:()=>Kh,aAL:()=>Kf,NBq:()=>ws,wp9:()=>tb,DsR:()=>Bf,MPc:()=>Lp,gWE:()=>jp,DT_:()=>kp,ipn:()=>Mp,ORg:()=>$i,_wz:()=>Fp,RYR:()=>cd,PP2:()=>LE,wS7:()=>Jv,cBQ:()=>Sf,pBq:()=>km,DsO:()=>ee,X78:()=>hm,xZs:()=>dm,YFy:()=>UE,Gmt:()=>im,K$w:()=>nm,DSj:()=>Xf,Mfr:()=>CE,k9j:()=>If,EjS:()=>X,ww$:()=>Ul,WVU:()=>rm,hxF:()=>bl,n6p:()=>nn,E7G:()=>Up,nwO:()=>ZN,Mzk:()=>_f,aFF:()=>Ch,HRH:()=>Bu,EZK:()=>ep,Kxm:()=>Kc,Z9i:()=>Ty,CrF:()=>QE,DNd:()=>eo,vUy:()=>GN,lJh:()=>Ju,zHo:()=>Qu,sEJ:()=>RN,UO$:()=>Gm,zeJ:()=>Ir,dLR:()=>$s,JQy:()=>zs,XtP:()=>Ms,Ug0:()=>Tn,A1W:()=>Ah,sw:()=>Zc,nv3:()=>Tg,JgD:()=>fg,nve:()=>SN,SkP:()=>Zs,SAs:()=>Mm,i5L:()=>el,PWK:()=>Zo,IM5:()=>xs,Aup:()=>TO,Mfk:()=>mv,HQx:()=>ys,oN$:()=>ds,mB6:()=>Gv,p6d:()=>w,o0x:()=>U,ufS:()=>wv,k7L:()=>Iv,mrB:()=>I,OuZ:()=>tp,ncP:()=>Be,FQ2:()=>rp,W$R:()=>np,JOV:()=>Me,Zmi:()=>xe,hm5:()=>Ve,ECL:()=>Kr,vPL:()=>ip,qmL:()=>dh,hPi:()=>Lm,hXd:()=>sa,OCS:()=>la,p2l:()=>nl,qF1:()=>pT,_X$:()=>dT,yj2:()=>g_,bzh:()=>ab,k66:()=>us,kiP:()=>No,pSg:()=>ce,kz_:()=>ME,H_U:()=>ps,t9e:()=>so,j2$:()=>ST,PFL:()=>yr,aJ3:()=>Hg,To9:()=>Nr,wpo:()=>Ap,ADq:()=>cy,UUb:()=>ly,tQX:()=>uy,xy8:()=>mr,EUG:()=>Ur,AFK:()=>rt,X3M:()=>wr,WN0:()=>cs,kDl:()=>Vs,uDV:()=>ph,IhQ:()=>Hs,pfb:()=>Qs,R$r:()=>Qh,w80:()=>Vo,Pfu:()=>ao,Gtj:()=>Zl,fyF:()=>zl,kkq:()=>ls,u5q:()=>Ye,O$n:()=>gp,ptG:()=>_p,f4_:()=>fb,uap:()=>yb,d7q:()=>SE,liG:()=>jE,$oF:()=>RE,avf:()=>Dd,DiQ:()=>Cd,cfX:()=>Ud,vD3:()=>jd,Qrb:()=>Id,EJQ:()=>Ld,HWy:()=>wd,gjS:()=>yd,y6v:()=>Sd,JUW:()=>YE,GtP:()=>Rb,_kX:()=>ro,u1e:()=>no,sJj:()=>wh,CJp:()=>Nb,uKF:()=>Sh,wo0:()=>zE,s5:()=>rs,cwx:()=>ts,Y6b:()=>mE,TTx:()=>lm,UtR:()=>hE,HaQ:()=>um,E6I:()=>JE,Won:()=>OE,vTU:()=>TE,Nsy:()=>dp,KMQ:()=>Uh,Do$:()=>Ep,CSV:()=>ol,TMe:()=>bE,l1V:()=>Xu,RHh:()=>ac,VQ1:()=>nc,cGG:()=>rc,z7d:()=>Bd,Xaq:()=>Es,Sj8:()=>qN,PJj:()=>au,k3T:()=>mn,PjQ:()=>Gi,s7l:()=>ff,jLA:()=>Sb,GGR:()=>xd,j5q:()=>Fd,DnY:()=>pf,RY5:()=>ah,Px$:()=>pd,KPC:()=>ON,NIY:()=>vf,HvW:()=>Ef,Fof:()=>lo,BXy:()=>mf,fX:()=>wb,BTI:()=>hp,uie:()=>sp,q27:()=>Pp,vrC:()=>wO,fAQ:()=>gm,XkT:()=>cf,lrH:()=>_m,nt9:()=>cn,XH8:()=>vp,XH2:()=>En,jFi:()=>Op,qhs:()=>$o,wwR:()=>mp,Uk3:()=>nt,$Rg:()=>ct,ev7:()=>AN,RB9:()=>VE,iFp:()=>Zd,e$p:()=>ty,PcX:()=>ry,SpP:()=>ey,R6_:()=>Qg,CY1:()=>n_,Ajk:()=>af,Yiz:()=>nf,FK9:()=>Xy,UOo:()=>Uv,aTW:()=>om,uug:()=>mu,P$2:()=>o_,XS2:()=>uu,Hyb:()=>wu,d3Y:()=>qc,Klp:()=>Jc,WxZ:()=>s_,Gzu:()=>Ku,ZOr:()=>uf,uqV:()=>dE,Pm4:()=>re,hWO:()=>Ze,nHA:()=>mb,nVD:()=>sh,_tF:()=>uc,dED:()=>NE,P2h:()=>AE,jrr:()=>vo,mmY:()=>_o,T6O:()=>fs,h6J:()=>AT,hM2:()=>TN,XR6:()=>z,jmz:()=>ch,IHt:()=>uh,NZI:()=>fy,wdF:()=>Om,YNv:()=>gh,IFm:()=>vh,o_F:()=>Th,kgP:()=>vm,ZYI:()=>aT,QXK:()=>Jl,efz:()=>Ql,Q5d:()=>Hl,Ysv:()=>Kl,UWq:()=>Hd,ocC:()=>qd,io3:()=>yn,Sbt:()=>Wo,roS:()=>Go,Ww1:()=>Bo,QaS:()=>Af,wsP:()=>Oe,ERZ:()=>nN,CL1:()=>EN,idV:()=>zc,nIW:()=>ze,fjE:()=>Kg,sG0:()=>Lv,tV7:()=>ou,g8o:()=>U_,Qy:()=>I_,t2P:()=>qg,KbW:()=>Io,wId:()=>Co,LS0:()=>Do,bFH:()=>ZT,Rgl:()=>tE,fW1:()=>ob,GFW:()=>cm,Ywp:()=>Og,pg:()=>jT,WSA:()=>rE,fed:()=>yN,tT_:()=>Js,BgZ:()=>Ks,xIV:()=>Xs,KbL:()=>yf,JBA:()=>st,aNC:()=>yg,RFJ:()=>iT,Zeh:()=>Vm,OT5:()=>bg,mC3:()=>Gl,kR6:()=>HN,gFw:()=>Tb,NVY:()=>Zh,k6v:()=>yT,FEC:()=>fT,L5S:()=>Xh,Ob5:()=>Rp,KUV:()=>Sp,dvH:()=>zh,V3i:()=>bO,VD3:()=>fn,mm2:()=>tc,rou:()=>Im,izH:()=>io,DK$:()=>oo,KMp:()=>Qf,c31:()=>rr,mbo:()=>dy,gT8:()=>ar,CZ8:()=>Ps,uGi:()=>Cs,Poc:()=>er,_9k:()=>js,ZTM:()=>Is,bwT:()=>Ds,tzW:()=>sr,tF$:()=>ir,o96:()=>Rs,M4S:()=>Ls,_vs:()=>Gf,xF8:()=>fd,PUO:()=>Dh,ATu:()=>py,j1S:()=>Mi,V3K:()=>ki,Lmx:()=>Fi,oSN:()=>Wi,ZaZ:()=>tr,n_1:()=>fE,N6e:()=>qf,SxO:()=>go,w3p:()=>eb,xU7:()=>fe,Y_p:()=>Ho,$k6:()=>qo,Gdl:()=>kv,U6P:()=>jv,OwB:()=>Jg,hTh:()=>lh,xqc:()=>ns,JvE:()=>is,i29:()=>Ic,dzT:()=>na,uPS:()=>Rf,cZV:()=>Pf,n3B:()=>uA,e6O:()=>nA,s7j:()=>N_,j$Q:()=>qE,PeS:()=>Py,kW2:()=>Pb,tH7:()=>es,Yxg:()=>pl,MaZ:()=>Md,nqN:()=>kd,jWj:()=>Qd,o_J:()=>ms,yW4:()=>NT,uT0:()=>gT,C82:()=>_T,bsH:()=>Eb,u9Z:()=>wm,LCU:()=>pm,J$m:()=>yE,j_Q:()=>Zy,OaI:()=>ef,wB1:()=>gN,SP6:()=>LT,ZYr:()=>bN,IMU:()=>nT,FoU:()=>WE,DVz:()=>Vv,mxe:()=>sA,FHr:()=>xm,D1g:()=>Um,VO3:()=>Ug,de5:()=>Ig,Uw1:()=>be,J6q:()=>yy,XCe:()=>ho,fbl:()=>vg,Ir:()=>So,XQO:()=>wo,QXb:()=>qT,zXF:()=>fh,P8_:()=>fm,iiD:()=>Jf,MOC:()=>HT,WF:()=>YT,xE1:()=>Vi,idW:()=>jN,QWZ:()=>vv,YL3:()=>gf,NW9:()=>Sv,D_E:()=>Te,Fn9:()=>T,j2U:()=>rl,MpE:()=>lr,kQw:()=>Tr,mfm:()=>Iu,vZp:()=>it,Wah:()=>my,E8K:()=>UN,VSb:()=>As,vr_:()=>fr,Vmh:()=>VN,FgW:()=>hO,oDv:()=>bs,fGG:()=>gv,kuw:()=>vs,eHk:()=>Jd,Tt2:()=>hs,pQZ:()=>gs,oZ7:()=>_v,T6Y:()=>$r,_26:()=>Pu,YkM:()=>_r,J6y:()=>du,njU:()=>Ou,TBP:()=>Os,IT0:()=>Ey,x_:()=>Ih,FP6:()=>ut,biM:()=>fp,TMl:()=>Tp,Vkd:()=>_u,WiY:()=>e_,_zi:()=>Au,RZp:()=>By,J6D:()=>ec,Lt4:()=>Lr,QEi:()=>Rr,whI:()=>sn,KIu:()=>un,JhM:()=>oe,C_0:()=>Wr,lzc:()=>Ip,qIF:()=>cA,O27:()=>E,aBi:()=>Np,xOX:()=>El,EdS:()=>Je,WgC:()=>He,eEv:()=>pr,A4t:()=>vu,YOQ:()=>ot,Wos:()=>Mr,jWr:()=>Za,Or$:()=>gr,lhE:()=>dn,CwH:()=>Pr,pzC:()=>yl,ymH:()=>bu,QZu:()=>Or,rYH:()=>Zg,FVt:()=>Fr,Kn2:()=>ue,jgw:()=>Uu,Qgr:()=>Zu,OXP:()=>_s,nsY:()=>ay,vyG:()=>ny,lS4:()=>Sr,g5f:()=>t_,fp6:()=>Tu,Uty:()=>ma,YkG:()=>vr,xdS:()=>or,kMF:()=>xp,$NE:()=>Qe,bC9:()=>qe,Ian:()=>xi,KVV:()=>Rh,q9e:()=>Yo,iIf:()=>Fv,ian:()=>Ol,m6e:()=>Br,OFd:()=>fl,kqr:()=>Er,fnZ:()=>on,VFZ:()=>vl,ZiX:()=>Ge,j5n:()=>jr,zkt:()=>_,Pcm:()=>vN,QDV:()=>dl,M5u:()=>zg,laD:()=>lA,mtq:()=>cr,CtB:()=>Mv,CBv:()=>ae,I0t:()=>Gr,u1G:()=>Gd,gk1:()=>aA,Bgb:()=>iA,uzs:()=>ln,v0l:()=>yc,Zqp:()=>vE,j0k:()=>zo,l22:()=>XN,tCm:()=>tt,gmx:()=>cu,mOr:()=>Gu,TwZ:()=>C_,GyU:()=>Eg,zGm:()=>MT,bMg:()=>oE,EyD:()=>tg,FQA:()=>rg,fZN:()=>uE,xsF:()=>Zv,Lxg:()=>eg,O3l:()=>Cf,Wni:()=>Uf,wRx:()=>ug,OxG:()=>KT,Jwg:()=>JT,uJQ:()=>QT,qWg:()=>$v,i96:()=>kT,NPd:()=>Hu,zhn:()=>lg,G8q:()=>Li,Jct:()=>ad,A9Y:()=>te,Y5F:()=>QA,gxP:()=>le,c$P:()=>pu,M7o:()=>$c,BBN:()=>Oo,fS6:()=>Ad,ZBU:()=>K,UkJ:()=>Lo,xkv:()=>ym,z$M:()=>kN,KAm:()=>$E,lCl:()=>Zm,rkF:()=>My,IU6:()=>DT,RGr:()=>h,aYu:()=>m,ije:()=>nu,Buf:()=>Hf,YLu:()=>ru,ct9:()=>Qo,XkY:()=>sE,T5R:()=>xT,uQS:()=>cE,wcJ:()=>Jo,d$I:()=>Cl,rSp:()=>yp,Sx:()=>bf,Ilm:()=>Vl,Ki6:()=>hl,VGk:()=>Wf,sFD:()=>qb,eWN:()=>MN,dWE:()=>A_,Lkd:()=>Qp,aDL:()=>Wm,yaA:()=>pE,lOh:()=>Dm,DBr:()=>Wg,hK$:()=>su,TZ_:()=>CT,CMB:()=>pA,FU8:()=>hf,J$p:()=>Hm,b5s:()=>qm,h2W:()=>et,SL_:()=>Pm,oUH:()=>bT,ck9:()=>$T,RAb:()=>lc,nL:()=>Dv,k$p:()=>Jb,Xs0:()=>tu,u7I:()=>Cm,rxg:()=>ju,bji:()=>ku,oCZ:()=>Dy,MjG:()=>wg,FuV:()=>hT,$ju:()=>vT,t6d:()=>OT,m5F:()=>he,sx:()=>xN,rSc:()=>Wv,U10:()=>tf,L8n:()=>tm,R9X:()=>EE,rj2:()=>mm,_C4:()=>wT,tCj:()=>Tm,uAg:()=>IE,wx9:()=>Pd,KF3:()=>IT,ax9:()=>UT,HH7:()=>Yf,ufV:()=>DE,_6y:()=>wf,XTh:()=>_g,AJo:()=>Nf,Ixr:()=>HE,oss:()=>zN,P6Y:()=>eP,q5j:()=>Ry,Bd_:()=>wy,xkB:()=>Sy,W41:()=>Sm,WkI:()=>Rm,sSE:()=>Ny,GMd:()=>Pc,jtL:()=>Rc,Bxm:()=>Uy,FVh:()=>Oy,U_T:()=>nE,FTe:()=>ie,VGB:()=>ne,tM8:()=>Fu,Wfe:()=>qu,Ls5:()=>Yu,$bd:()=>xu});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:()=>g,durationToTimestamp:()=>X,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>Q,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>K,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ae,editAttribute:()=>Ne,editEndDate:()=>Ue,editRoles:()=>Se,editStartDate:()=>Ie,editTags:()=>we,removeAttribute:()=>Re});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>$h,collectCrosswalksFromAttributes:()=>Wh,compareActivenessAttributes:()=>xh,compareAttributes:()=>Fh,compareImages:()=>Mh,compareRoles:()=>Yh,compareTags:()=>Bh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Jh});var l=r(17440);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=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;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},N=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)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];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)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/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),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?B(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},Q=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},K=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class Z{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)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(87918),de=r.n(pe);const ye=(0,l.when)((0,l.is)(Object),JSON.stringify),fe=(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 de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),ye)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,ye]])(e)},Te=e=>"AbortError"===e.name,Ee=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)},me=/[\n\r%#()<>?[\\\]^`{}|]/g,he=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(me,encodeURIComponent)}`,be=e=>`data:image/gif;base64,${e}`,Oe=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var ve=r(76665);function ge(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 - ${ue(n)?JSON.stringify(n):n}\n `;console.error(i)}var 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 _e(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ge(r[i],r[i+1],e,t));return n}function Ae(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=_e(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Ae(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function Ne(e,t,r,n,i,a){void 0===a&&(a=0);var o=_e(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Pe(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Pe.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Ae(e,t,r,n,i,a),s}var c=Ne(e,o,o.valueUri,{},i,a);Ne(c,t,r,n,i,a+1)}function Pe(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Re(e,t,r,n){void 0===n&&(n=0);var i=_e(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Re(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function Se(e,t){e.roles=t||[]}function we(e,t){e.tags=t||[]}function Ie(e,t){e.startDate=t||""}function Ue(e,t){e.endDate=t||""}var Ce=r(37164);const De="1Tempo4rary",Le="1Tepmo4Rel",je=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ke=(0,Ce.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Fe=()=>`${ke()}${Date.now()}`,Me=()=>`1Tempo4DCR${Fe()}`,xe=e=>`${e}/uri$$${Fe()}`,$e=e=>()=>xe(e),Ve=(e,t)=>{const r=je(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return xe(n)},Ge=e=>e&&e.includes("uri$$"),We=$e("entities"),Be=$e("relations"),Ye=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),qe=(0,l.startsWith)("relations/"),He=(0,l.startsWith)("entities/"),Je=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ke=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Xe=(0,l.pipe)((0,l.split)("/"),l.head),ze=(0,l.pipe)((0,l.split)("/"),l.last),Ze=e=>e.split(".").slice(0,2).join("."),et=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},tt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),rt=(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("/")},nt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},it=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),at=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},ot=e=>5===e.split("/").length,st=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},lt=e=>e.replace(/uri\$\$/g,De),ut=e=>e.includes("changeRequests/")&&e.includes("/changes/"),ct=e=>e.split("/changes/")[1];let pt,dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Pt,Rt,St,wt,It,Ut,Ct,Dt,Lt,jt,kt,Ft,Mt,xt,$t,Vt,Gt,Wt,Bt,Yt,qt,Ht,Jt,Qt;var Kt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(pt||(pt={})),function(e){e.local="local",e.validationService="validationService"}(dt||(dt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(yt||(yt={})),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"}(ft||(ft={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Tt||(Tt={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Et||(Et={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(mt||(mt={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(ht||(ht={})),function(e){e.asc="asc",e.desc="desc"}(bt||(bt={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ot||(Ot={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(vt||(vt={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(gt||(gt={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(_t||(_t={})),function(e){e.PROFILE="profile",e.MAP="map"}(At||(At={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Nt||(Nt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Pt||(Pt={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Rt||(Rt={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(St||(St={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(wt||(wt={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(It||(It={})),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"}(Ut||(Ut={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Ct||(Ct={})),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"}(Dt||(Dt={})),function(e){e.IN="in",e.OUT="out"}(Lt||(Lt={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(jt||(jt={})),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"}(kt||(kt={})),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"}(Ft||(Ft={})),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"}(Mt||(Mt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(xt||(xt={})),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"}($t||($t={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(Vt||(Vt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Gt||(Gt={})),function(e){e.ASC_BY_NAME="ascByName"}(Wt||(Wt={})),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"}(Bt||(Bt={})),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"}(Yt||(Yt={})),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"}(qt||(qt={})),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"}(Ht||(Ht={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(Jt||(Jt={})),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"}(Qt||(Qt={})),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"}(Kt||(Kt={}));const Xt=Kt;let zt,Zt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(zt||(zt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(Zt||(Zt={}));const er=(0,l.prop)("referencedEntityTypeURI"),tr=(0,l.prop)("relationshipTypeURI"),rr=(0,l.prop)("referencedAttributeURIs"),nr=(0,l.curry)(((e,t)=>(0,l.pipe)(rr,(0,l.filter)((0,l.startsWith)(e)))(t))),ir=nr("configuration/relationTypes"),ar=nr("configuration/entityTypes"),or=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),sr=(0,l.filter)(or),lr=(e,t)=>!t||t.some((t=>Ke(e.uri,t)));function ur(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cr=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Je),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Xt.TYPE_STRING)]),pr=(0,l.has)("values"),dr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Xt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Xt.TYPE_LOOKUP)],[pr,(0,l.always)(Xt.TYPE_ENUM)],[cr,(0,l.always)(Xt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Xt.TYPE_BOOLEAN),(0,l.always)(Xt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),yr=(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){ur(e,t,r[t])}))}return e}({},e,{type:dr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),fr=e=>!!e&&(!!e.autoGenerated&&e.type!==Xt.TYPE_NESTED||!!e.parentAutoGenerated),Tr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Er=(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),mr=e=>Tr(e)?"analyticsAttributes":"attributes",hr=(0,l.propEq)("hidden",!0),br=(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))),Or=br(Xt.TYPE_NESTED),vr=br(Xt.TYPE_REFERENCE),gr=br(Xt.TYPE_IMAGE),_r=(0,l.either)(Or,vr),Ar=(e,t)=>{const r=Tr(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(".")},Nr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Pr=(0,l.pipe)(Nr,Boolean),Rr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Sr=(0,l.both)(Pr,(0,l.pipe)(Nr,("rdm",(0,l.pipe)(Xe,(0,l.equals)("rdm")))));const wr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=mr({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]||Ur(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:[]},Ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=wr(e,t,r);return n.length?(0,l.last)(n):null},Ur=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",Xt.TYPE_NESTED),(0,l.propEq)("type",Xt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Xt.TYPE_REFERENCE),(0,l.pipe)(rr,(0,l.map)((t=>Ir(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Cr=[Xt.TYPE_ACTIVENESS_DATE,Xt.TYPE_DATE,Xt.TYPE_TIMESTAMP,Xt.TYPE_LOCAL_DATE],Dr=[Xt.TYPE_ACTIVENESS_DATE,Xt.TYPE_TIMESTAMP,Xt.TYPE_LOCAL_DATE],Lr=e=>Cr.includes(e),jr=e=>Dr.includes(e),kr=[Xt.TYPE_INT,Xt.TYPE_LONG,Xt.TYPE_NUMBER,Xt.TYPE_FLOAT,Xt.TYPE_DOUBLE,Xt.TYPE_COUNT],Fr=e=>kr.includes(e),Mr=e=>[Xt.TYPE_FLOAT,Xt.TYPE_DOUBLE].includes(e),xr=[Xt.TYPE_BOOLEAN,Xt.TYPE_BOOLEAN_RADIO,Xt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],$r=e=>xr.includes(e),Vr=[Xt.TYPE_URL,Xt.TYPE_BLOG_URL,Xt.TYPE_IMAGE_URL],Gr=e=>Vr.includes(e),Wr=br(Xt.TYPE_EMAIL),Br=e=>Xt.TYPE_SSN===e;var Yr,qr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Yr||(Yr={}));const Hr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Yr.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)))})),Jr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Qr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Jr),Kr=(0,l.pipe)((0,l.reject)(E),Qr);function Xr(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){zr(e,t,r[t])}))}return e}function zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zr=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("?")?"&":"?")+Jr(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}},en=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?ze(t.refEntity.objectURI):Me()}`;return Xr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(tn(n),(0,l.toPairs)(t.value)))})}return Xr({},t,{uri:`${e}/${Me()}`})},tn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(en(`${e}/${r}`),n)]},rn=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(tn(`${t}/attributes`)),l.fromPairs)},e)},nn=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Ht.CREATE_ENTITY),(0,l.evolve)({newValue:rn}))))},e),an={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},on=(0,l.equals)(an.SUGGESTING),sn=(0,l.equals)(an.EDITING),ln=(0,l.equals)(an.VIEWING),un=(0,l.either)(sn,on),cn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),pn=(0,l.curry)(((e,t)=>(0,l.pipe)(cn(e),(0,l.prop)("extendsTypeURI"))(t))),dn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(pn(e,r)));return n(r)})),yn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=pn(e,n);return r})),fn=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?fn(e,cn(e,t.extendsTypeURI),r):void 0,Tn=(e,t)=>{const r=t.map(yn(e));return(r.length?r.reduce(l.intersection):[])[0]},En=(e,t)=>fn(e,(0,l.is)(Object,t)?t:cn(e,t),"typeImage"),mn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&dn(e,t,n.uri)?r.concat(n.uri):r),[]),hn={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"},bn={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},On={[hn.EQUALS]:"equals",[hn.NOT_EQUALS]:"not",[hn.STARTS_WITH]:"starts with",[hn.MISSING_VALUE]:"missing value",[hn.IN_RANGE]:"in range",[hn.HAS_ALL]:"has all",[hn.FULL_TEXT]:"full text",[hn.EXISTS]:"exists",[hn.COUNT_EQUALS]:"count equals",[hn.COUNT_NOT_EQUALS]:"count not equal",[hn.COUNT_LT]:"count less",[hn.COUNT_LTE]:"count less or equal",[hn.COUNT_GT]:"count greater",[hn.COUNT_GTE]:"count greater or equal",[hn.COUNT_RANGE]:"count in range",[hn.LT]:"less than",[hn.LTE]:"less than or equal",[hn.GT]:"greater than",[hn.GTE]:"greater than or equal",[hn.IN_FILE]:"in file",[hn.NOT_IN_FILE]:"not in file",[hn.CONTAINS]:"contains",[hn.ON]:"on",[hn.BEFORE]:"before",[hn.AFTER]:"after",[hn.WITHIN]:"within"},vn="in",gn="notIn",_n="not range",An=e=>({[vn]:hn.EQUALS,[gn]:hn.NOT_EQUALS}[e]||e);var Nn,Pn;!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"}(Nn||(Nn={})),function(e){e.LAST_3DAYS="last3Days"}(Pn||(Pn={}));const Rn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Nn[t]||Pn[t],e)),{}),Sn={[Nn.LAST_DAY]:"Last 24 hours",[Pn.LAST_3DAYS]:"Last 3 days",[Nn.LAST_WEEK]:"Last 7 days",[Nn.LAST_MONTH]:"Last month",[Nn.LAST_6MONTHS]:"Last 6 months",[Nn.LAST_YEAR]:"Last year",[Nn.PICK_DATE]:"Pick date"},wn={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},In={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Un="<No label>",Cn="__number",Dn={IN:"in",OUT:"out"};function Ln(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){jn(e,t,r[t])}))}return e}function jn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kn={startDate:{type:Xt.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Xt.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Fn=Ln({id:{type:Xt.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},kn,{roles:{type:Xt.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Xt.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),Mn={workflow:{type:Xt.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Xt.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Xt.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},xn={commenter:{type:Xt.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},$n={notResolved:{type:Xt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Vn={createdBy:{type:Xt.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Xt.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Gn={matches:{type:Xt.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Xt.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Wn={sourceSystems:{type:Xt.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Xt.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Xt.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Xt.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Xt.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Bn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Bn||(Bn={}));const Yn={[Bn.matchRules]:{type:Xt.TYPE_STRING,get label(){return de().text("Match Rules")},uri:Bn.matchRules,name:Bn.matchRules,faceted:!0,hideForDataTenant:!0},[Bn.MLRecommendedMatch]:{type:Xt.TYPE_STRING,get label(){return de().text("Match IQ")},uri:Bn.MLRecommendedMatch,name:Bn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},qn=Ln({},Fn,Mn,xn,$n,Vn,Gn,Wn,Yn,{type:{type:Xt.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Hn="NOT_MATCH";var Jn=r(13980),Qn=r.n(Jn);function Kn(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){Xn(e,t,r[t])}))}return e}function Xn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zn=Qn().oneOf(["mobile","tablet","desktop"]),Zn=Qn().shape({deviceTypes:Qn().oneOfType([zn,Qn().arrayOf(zn)]),roles:Qn().arrayOf(Qn().string)}),ei=Qn().shape({value:Qn().string,lookupCode:Qn().string}),ti=Qn().shape({link:Qn().string,filename:Qn().string}),ri=Qn().shape({displayName:Qn().string,parent:Qn().string}),ni=Qn().oneOfType([Qn().string,Qn().number,Qn().bool,ei]),ii=Qn().oneOfType([ni,Qn().arrayOf(ni)]),ai=Qn().shape({fieldName:Qn().string,values:Qn().arrayOf(ii),filter:Qn().string,type:Qn().string}),oi=Qn().shape({minValue:Qn().number,maxValue:Qn().number}),si=Qn().shape({label:Qn().string,name:Qn().string,description:Qn().string,type:Qn().string,hidden:Qn().bool,faceted:Qn().bool,searchable:Qn().bool,uri:Qn().string,access:Qn().arrayOf(Qn().string),cardinality:oi}),li=Qn().shape({label:Qn().string,uri:Qn().string,typeColor:Qn().string,direction:Qn().string,startObject:Qn().object,endObject:Qn().object}),ui=Qn().shape({typeColor:Qn().string,typeIcon:Qn().string,typeImage:Qn().string,label:Qn().string,uri:Qn().string,attributes:Qn().arrayOf(si)}),ci=Qn().shape({uri:Qn().string,label:Qn().string,memberTypes:Qn().array,extendsTypeUri:Qn().string,attributes:Qn().arrayOf(si)}),pi=Qn().shape({uri:Qn().string,label:Qn().string,extendsTypeUri:Qn().string,relationshipTypeURIs:Qn().arrayOf(Qn().string)}),di=Qn().shape({uri:Qn().string,description:Qn().string,label:Qn().string,schemaVersion:Qn().string,entityTypes:Qn().arrayOf(ui),roles:Qn().arrayOf(Qn().object),groupTypes:Qn().arrayOf(Qn().object),relationTypes:Qn().arrayOf(li),graphTypes:Qn().arrayOf(pi),interactionTypes:Qn().arrayOf(ci),sources:Qn().arrayOf(Qn().object)}),yi=Qn().shape({uri:Qn().string,type:Qn().string}),fi=Qn().shape({uri:Qn().string,type:Qn().string}),Ti=Qn().shape({value:Qn().object,ov:Qn().bool,type:Qn().string,uri:Qn().string}),Ei=Qn().shape({refEntity:Qn().oneOfType([Qn().array,Qn().object]),refRelation:Qn().oneOfType([Qn().array,Qn().object]),value:Qn().object,ov:Qn().bool,type:Qn().string,uri:Qn().string}),mi=Qn().oneOf((0,l.values)(an)),hi=Qn().shape({type:Qn().oneOf(Object.values(pt)).isRequired,attributeTypeUri:Qn().string.isRequired,parentUri:Qn().string.isRequired,uri:Qn().string,message:Qn().string}),bi={attributeType:si,showEmptyEditors:Qn().bool,lazy:Qn().bool,mode:mi,metadata:di,ownError:hi,errors:Qn().arrayOf(hi),crosswalks:Qn().array,onAddAttributes:Qn().func,onAddOneMore:Qn().func,onDeleteAttribute:Qn().func,onChangeAttribute:Qn().func,additionalControlsRenderer:Qn().func,hideDeleteButton:Qn().bool,showNonOv:Qn().bool,state:Qn().oneOf(["deleted","edited"]),expanded:Qn().bool},Oi=Kn({attributeValue:Ti},bi),vi=Kn({attributeValue:Ei},bi),gi=Qn().shape({value:Qn().oneOfType([Qn().string,Qn().bool,Qn().number]),ov:Qn().bool,type:Qn().string,uri:Qn().string,lookupCode:Qn().string,lookupRawValue:Qn().string}),_i=Qn().shape({totalOvValues:Qn().number,totalValues:Qn().number}),Ai=Qn().shape({inRelations:Qn().arrayOf(Qn().oneOfType([Qn().object,Qn().string])),outRelations:Qn().arrayOf(Qn().oneOfType([Qn().object,Qn().string])),groups:Qn().arrayOf(Qn().string),entityTypes:Qn().arrayOf(Qn().string),nextEntry:Qn().object}),Ni=Qn().oneOf(["asc","desc"]),Pi=Qn().shape({id:Qn().string,content:Ai,allowOnlyCreateNew:Qn().bool,sortColumn:Qn().string,sortOrder:Ni,"text-empty":Qn().string,max:Qn().number,icon:Qn().string,caption:Qn().string,canCreate:Zn,canRead:Zn,canUpdate:Zn,canDelete:Zn,editingEnabled:Qn().bool}),Ri=Qn().shape({entityUri:Qn().string,entityType:Qn().string,entityLabel:Qn().string,object:yi}),Si=Qn().shape({relationUri:Qn().string,relationType:Qn().string,relationLabel:Qn().string,direction:Qn().string,object:fi}),wi=Qn().shape({entity:Ri,relation:Si}),Ii=Qn().shape({value:Qn().string,isRawFilter:Qn().bool}),Ui=Qn().shape({id:Qn().string,label:Qn().string,name:Qn().string,availableEntityTypes:Qn().array}),Ci=Qn().shape({id:Qn().string,allowMergeAll:Qn().bool,matchActions:Qn().object,availableTabs:Qn().arrayOf(Qn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),Di=Qn().arrayOf(Qn().shape({uri:Qn().string,label:Qn().string})),Li=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}];function ji(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ki=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Fi=(0,l.pipe)(ki,(0,l.propOr)("","label")),Mi=(0,l.curry)(((e,t)=>{const r=ki(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),xi=(0,l.curry)(((e,t,r)=>{const[n,i]=Mi(e,r);return dn(e,n,t)||dn(e,i,t)})),$i=(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){ji(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Vi=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?Dn.OUT:Dn.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(Dn.IN),i=r(Dn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Gi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Wi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Wi(e,ki(e,t.extendsTypeURI),r):void 0,Bi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Yi=(0,l.curry)(((e,t)=>e.every((e=>qi(e,t))))),qi=(0,l.curry)(((e,t)=>{const r=fr(t);return Hi(e,t)&&(e===Bi.READ||!r)})),Hi=(e,t)=>!t||!t.access||t.access.includes(e),Ji=(0,l.curry)(((e,t,r)=>qi(Bi.READ,r)&&(on(t)?qi(Bi.INITIATE_CHANGE_REQUEST,r):qi(e,r)))),Qi=Ji(Bi.CREATE),Ki=Ji(Bi.DELETE),Xi=Ji(Bi.UPDATE),zi=Yi([Bi.CREATE,Bi.MERGE,Bi.READ,Bi.UPDATE]),Zi=Yi([Bi.UPDATE,Bi.READ,Bi.CREATE]),ea=Yi([Bi.UPDATE,Bi.READ]),ta=Yi([Bi.DELETE,Bi.UPDATE,Bi.READ]),ra=(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["*"])),na=(e,t,r)=>(0,l.pipe)((0,l.map)(ra(e,t)),(0,l.filter)(l.identity))(r),ia=(e,t,r)=>{const n=na(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&qi(Bi.MERGE,r)},aa=(0,l.curry)(((e,t,r,n)=>{const i=ki(e,n),[a,o]=Mi(e,n);return i&&qi(Bi.CREATE,i)&&dn(e,a,t.type)&&dn(e,o,r.type)})),oa=(e,t,r,n,i)=>{const a=cn(e,n.type),o=na(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(aa(e,n,i))||a.some(aa(e,i,n))}))},sa=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=cn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:ia(o,i,a),canAddRelation:oa(e,o,i,r,n),canMark:qi(Bi.UPDATE,a)&&qi(Bi.READ,a)}},la=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>sa(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),ua=Tr,ca=(0,l.complement)(ua),pa=qi(Bi.READ),da=e=>{let{attributeType:t,mode:r}=e;return ca(t)&&Qi(r,t)&&!hr(t)},ya=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Ge(r.uri),o=Xi(n),s=Qi(n);return(0,l.cond)([[ua,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},fa=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Ge(r.uri),s=Xi(n),u=Ki(n),c=Ea(Bi.UPDATE,n,a,r),p=Ea(Bi.DELETE,n,a,r);return(0,l.cond)([[ua,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)},Ta=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&Ur(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=>!Hi(e,n)||!Ta(e,t,r[n.name],n)))))})),Ea=(0,l.curry)(((e,t,r,n,i)=>on(t)?Ta(Bi.INITIATE_CHANGE_REQUEST,r,n,i):Ta(e,r,n,i))),ma=(0,l.both)((0,l.complement)(hr),pa),ha="SuperUser",ba="allTenants",Oa=[ba,"allCustomers"],va=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===ha})).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===ha){const e=r?Oa.concat(r.map((e=>`allTenants.${e}`))):Oa,n=r&&t[0]===ba?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}))},ga={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"},_a={[ga.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[ga.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[ga.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[ga.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[ga.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ga.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ga.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ga.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ga.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ga.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ga.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ga.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ga.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ga.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ga.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ga.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ga.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ga.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ga.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ga.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ga.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ga.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ga.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ga.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ga.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ga.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ga.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ga.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ga.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ga.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ga.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ga.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ga.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ga.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Aa=(0,l.curry)(((e,t,r)=>va({allowedPermissionsNames:e,permissionsNames:ga,permissionsConfig:_a}).some((e=>e(t,{params:{tenant:r}}))))),Na=Aa([ga.CAN_EXPORT]),Pa=Aa([ga.CAN_EXPORT_ACTIVITIES]),Ra=Aa([ga.CAN_IMPORT_ENTITIES_FROM_DT]),Sa=Aa([ga.CAN_READ_ENTITIES_FROM_DT]),wa=Aa([ga.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Ia=Aa([ga.CAN_UPDATE_PROCESS_INSTANCE]),Ua=Aa([ga.CAN_VIEW_WORKFLOW_DEFINITION]),Ca=Aa([ga.CAN_CONFIG_ENVIRONMENT_REGISTER]),Da=Aa([ga.CAN_UPDATE_WORKFLOW_DATA_TASK]),La=Aa([ga.CAN_READ_WORKFLOW_DATA_TASK]),ja=Aa([ga.CAN_MANAGE_WORKFLOW_DEFINITION]),ka=Aa([ga.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Fa=Aa([ga.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Ma=Aa([ga.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),xa=Aa([ga.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),$a=Aa([ga.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Va=Aa([ga.CAN_EXECUTE_WORKFLOW_JOBS]),Ga=Aa([ga.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Wa=Aa([ga.CAN_CREATE_CONFIG_JAR]),Ba=Aa([ga.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ya=Aa([ga.CAN_VIEW_CONFIG_JAR]),qa=Aa([ga.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ha=Aa([ga.CAN_VIEW_WORKFLOW_JOBS]),Ja=Aa([ga.CAN_MAKE_BULK_UPDATE]),Qa=Aa([ga.CAN_OPEN_DATA_LOADER_EXECUTE,ga.CAN_OPEN_DATA_LOADER_READ]),Ka=Aa([ga.CAN_BULK_DELETE_PROFILES]),Xa=Aa([ga.CAN_READ_MDM_DATA_ENTITIES]),za=Aa([ga.CAN_READ_DVF]),Za=Aa([ga.IS_FREEMIUM_ADMIN]),eo=(0,l.reject)(hr),to=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),eo,(0,l.filter)(e))(t),ro=(0,l.curry)(((e,t)=>to((t=>da({attributeType:t,mode:e})),t))),no=(0,l.curry)(((e,t)=>to((t=>da({attributeType:t,mode:e})||ma(t)),t))),io=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ma)),ao=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...ao(e)])))),oo=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ma),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...oo(e)])))),so=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...so(e)])))),lo=(0,l.pipe)(cn,(0,l.converge)(l.concat,[oo,so]));function uo(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){co(e,t,r[t])}))}return e}function co(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const po=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,po(e)))},t))),yo=e=>{var t;return uo({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},fo=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),To=(0,l.when)(fo,(0,l.dissoc)("values")),Eo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return uo({},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})})),mo=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},ho=(0,qr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(ao,t).concat((0,l.chain)(ao,r)).some(mo)})),bo=e=>{let t=!1;const r=po((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?uo({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Oo=e=>{const t=ho(e),r=(0,l.map)((e=>po((0,l.pipe)(To,(0,l.when)((0,l.always)(e),Eo))))(t)),n=(0,l.map)(yo),i=(0,l.map)(bo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},vo=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),go=(0,l.prop)("relationshipTypeURIs"),_o=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Ao(e,t)))||[]})),Ao=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(xi(e,t))},No=(e,t)=>(0,l.pipe)(vo,(0,l.defaultTo)({}),go,(0,l.defaultTo)([]),(0,l.chain)(Mi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(cn(e)))(e,t),Po=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Ro=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),So=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ro((0,l.complement)(Po))(e)},wo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ro(Po)(e)},Io=(0,l.pipe)(cn,(0,l.propOr)([],"matchGroups")),Uo=(e,t,r)=>(0,l.pipe)(Io,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Co=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Uo,(0,l.propOr)(r,"label"))(e,t,r))),Do=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Io,(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]})),Lo=e=>(0,l.partition)(Po,e),jo=(0,l.includes)(l.__,["and","or","not"]),ko=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Fo=(0,l.includes)(l.__,["equals","notEquals","in"]),Mo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return jo(t)?Mo(r):ko(t)?r.filter(Je):Fo(t)?r.map((0,l.prop)("uri")).filter(Je):[]})),l.uniq),xo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Mo),l.uniq),$o=(0,l.pipe)(Io,xo),Vo=(0,l.pipe)(Do,xo),Go=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Wo=(0,l.pipe)(Go,oo),Bo=(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||dn(e,n,t)})(e,t))})(e,t)),Yo=e=>!!e.required,qo=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)([[Je,cn(e)],[Qe,ki(e)]])(t);return Ho(e,a,r,n,i)},Ho=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&Je(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!fr(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===Xt.TYPE_REFERENCE){const a=tr(t),s=rr(t);o=qo(e,a,r,n,[...i,t]).filter((e=>s.some(Ke(e.uri))))}else t.attributes&&(o=Ho(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===Xt.TYPE_REFERENCE?qo(e,tr(t),r,n,[...i,t]):[]},Jo=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),Yo]),e.attributes||[])},Qo=(e,t)=>{const r=ar(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},Ko=(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)?de().text(n):n};return r(null,t)})),Xo=["label","description","abbreviation","caption","toolTip"],zo=e=>Ko(Xo,e),Zo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=ze(t);return r.find((e=>{let{uri:t}=e;return ze(t)===n}))})),es=(0,l.curry)(((e,t)=>{const r=ze(t);return(0,l.pipe)(Zo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),ts=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"})},rs=(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}))},ns=(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)})),is=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=cn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function as(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){os(e,t,r[t])}))}return e}function os(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ss=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 ls(i,e,t,r,n)},ls=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]:["attributes"];return Z.fromNull(e&&e.length?e:Ur(t,r)).map((e=>e.map((e=>{const r=ss(t,e,n,i);return r.length?as({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(_r),(0,l.prop)("children"))).filter(ma).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},us=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ss(e,t,r,["attributes","analyticsAttributes"])},cs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ss(e,t,r,["attributes"])},ps=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ss(e,t,r,["analyticsAttributes"])},ds=e=>e.children?e.children.flatMap(ds):e,ys=e=>e.children?[e,...e.children.flatMap(ys)]:e,fs=(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)})),Ts=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return ze(r)===e})))),Es=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Ts("LUD")),(0,l.defaultTo)(r))(t||[])},ms=(e,t)=>{let{survivorshipStrategies:r}=e;return Ts(t,r)},hs=(0,l.allPass)([(0,l.complement)(l.isNil),qi(Bi.READ)]),bs=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),qi(Bi.READ)]),Os=(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)([qi(Bi.CREATE),qi(Bi.INITIATE_CHANGE_REQUEST)])]),vs=(0,l.curryN)(2,(0,l.pipe)(cn,bs)),gs=(0,l.curryN)(2,(0,l.pipe)(ki,hs)),_s=e=>{let{ov:t}=e;return!1!==t},As=(e,t)=>((e,t)=>Gr(e.type)&&ae(t))(e,t)||((e,t)=>Wr(e.type)&&oe(t))(e,t),Ns=(0,l.curry)(((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))),Ps=Ns("refEntity"),Rs=Ns("refRelation"),Ss=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ws=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Is=(0,l.prop)("objectURI"),Us=(0,l.prop)("objectURI"),Cs=(0,l.prop)("type"),Ds=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Is),Ls=(0,l.pipe)(Rs,(0,l.defaultTo)({}),Us),js=(0,l.pipe)(Ps,(0,l.defaultTo)({}),Cs),ks=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Fs=(0,l.evolve)({refEntity:re,refRelation:re}),Ms=(e,t,r,n)=>{const i=wr(e,r),a=cn(e,t.type)||ki(e,t.type);if(0===i.length)return null;const o=mr(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(!lr(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)(at,Qe)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>tr(e)===r.uri||er(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},xs=(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?xs(a.value,o):a},$s=(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 xs(e[r],i)})),Vs=(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")]]),Gs=(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"])]]),Ws=(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"])]]),Bs=(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)(Bs(e,i)))))(r)})),Ys=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ys(e)),e)(t))),qs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Bs(e,r),Ys(t))(n))),Hs=qs(null,Vs),Js=qs(_s,Vs),Qs=qs(null,Gs),Ks=qs(_s,Gs),Xs=qs(_s,Ws),zs=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=$s(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Zs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ds,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),el=(e,t)=>{const r=st(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return zs(e,r,n)},tl=Object.values(kn),rl=(0,l.includes)(l.__,tl),nl=e=>tl.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function il(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){al(e,t,r[t])}))}return e}function al(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ol=(e,t)=>`${e}_${t}`,sl=[qn.matches.name,qn.matchRules.name],ll=(0,l.values)(Mn).map((e=>e.name)),ul=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ll)))),cl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,sl)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ol(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),pl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,ul(r),cl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ol(`dtPotentialMatches.${t.name}`,"")))))(qn)},dl=(0,l.propEq)("uri",qn.type.uri),yl=e=>(0,l.values)(Yn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),fl=(0,l.propEq)("uri",Wn.sourceSystems.uri),Tl=Object.values(Fn),El=(0,l.includes)(l.__,Tl),ml=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:void 0===n?r.defaultValue:n})},hl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},bl=e=>{let{entity:t,attributeType:r,value:n}=e;return il({},t,{[r.uri]:n})},Ol=(0,l.propEq)("uri",Fn.roles.uri),vl=(0,l.propEq)("uri",Fn.tags.uri);function gl(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){_l(e,t,r[t])}))}return e}function _l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Al=e=>{let{parentUri:t,attributeType:r}=e;return gl({uri:Ve(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(_r,gr),(0,l.always)({value:{}})],[Pr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),Lr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Nl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(ro(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Rr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Al({parentUri:r,attributeType:e});let s=Ur(n,e);s&&(e.type===Xt.TYPE_REFERENCE&&(s=sr(s)),a.value=Nl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Rr(e))&&(o[t]=[a])}return o},Pl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return qo(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=st(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(Ms(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=wl({entity:e,attributeType:t,parentUri:o,index:0});if(_r(t)){const e=Ur(r,t),a=Or(t)?e:sr(e);i=Rl({attributeType:t,subAttributes:a,metadata:r,mode:n},i)}return i}return e}),e)}),t)},Rl=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a}=e;const o=Ms(i,t,r.uri)[0],s=gl({},o,{value:Nl({attributeTypes:n,parentUri:o.uri,mode:a,metadata:i})});return Ul({entity:t,attributeType:r,uri:o.uri,value:s})})),Sl=(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===Xt.TYPE_NESTED?gl({},e,{value:Sl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return gl({},s(t),Nl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),wl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Al({parentUri:n,attributeType:r}),u=Vs(l);return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Il=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,n.uri,Vs(n),a,o,i)}))},Ul=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n,i,a,o)}))},Cl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{Re(e.attributes||e.value,r,n,i)}))},Dl=e=>""===e,Ll=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Dl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Dl,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]]),jl=(0,l.reject)(Ll),kl=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=>kl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),jl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Fl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return kl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Fs),deleteEmptyComplex:e})},Ml=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Fl(e),(0,l.reject)(l.isEmpty))},xl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return rl(r)?ml({entity:e,attributeType:r}):wl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),$l=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return rl(r)?bl({entity:e,attributeType:r,value:i}):Ul({entity:e,attributeType:r,uri:n,value:i})})),Vl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return rl(r)?hl({entity:e,attributeType:r}):Cl({entity:e,attributeType:r,uri:n})})),Gl=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)},Wl="UrlThumbnail",Bl="CdnUrlThumbnail",Yl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(_s):(0,l.head)(n);return e&&e.value}return null})),ql=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Yl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Hl=ql(["CdnUrl","Url"],!0),Jl=ql(["CdnUrlPreview","UrlPreview"],!0),Ql=ql([Bl,Wl],!0),Kl=ql([Bl,Wl]),Xl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Er,(0,l.always)(t)],[(0,l.both)(Tr,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Er(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(rl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},zl=(e,t,r)=>{const n=io(e),i=(0,l.any)(r?l.T:_s);return Xl(n,t,i)},Zl=(e,t,r,n,i,a)=>{const o=Ge(null==r?void 0:r.uri)?ro(t,e):no(t,e);return Xl(o,r,((e,o)=>{const s=da({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:_s,e)||Er(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let eu;const tu=e=>{eu=e};function ru(e,t){return eu(e,t)}const nu=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)})),iu=50,au=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=iu,offset:a=0}=e;return ru("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},ou=(0,l.once)((()=>ru("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),su=e=>ru("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),lu=(e,t)=>ru("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),uu=e=>Z.fromNull(On[e]).map(de().text).orSome(""),cu=(0,l.curry)(((e,t)=>`${e}_${t}`)),pu=(0,l.split)("_"),du=(0,l.includes)("_"),yu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),fu=(0,l.curry)(((e,t)=>e.some(yu(t)))),Tu=fu([hn.IN_RANGE,hn.COUNT_RANGE,hn.WITHIN]),Eu=fu([hn.EXISTS,hn.MISSING_VALUE]),mu=(0,l.cond)([[Eu,(0,l.always)(0)],[Tu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),hu=(0,l.complement)(Eu),bu=fu([hn.HAS_ALL,hn.EQUALS,hn.NOT_EQUALS]),Ou=fu([hn.COUNT_EQUALS,hn.COUNT_NOT_EQUALS,hn.COUNT_LT,hn.COUNT_LTE,hn.COUNT_GT,hn.COUNT_GTE,hn.COUNT_RANGE]),vu=fu([hn.IN_FILE,hn.NOT_IN_FILE]),gu=e=>{switch(e){case hn.COUNT_EQUALS:return hn.EQUALS;case hn.COUNT_NOT_EQUALS:return hn.NOT_EQUALS;case hn.COUNT_LT:return hn.LT;case hn.COUNT_LTE:return hn.LTE;case hn.COUNT_GT:return hn.GT;case hn.COUNT_GTE:return hn.GTE;case hn.COUNT_RANGE:return hn.IN_RANGE}},_u=fu([hn.ON,hn.BEFORE,hn.AFTER,hn.WITHIN,hn.NOT_EQUALS]),Au=fu([hn.WITHIN]),Nu=[[hn.COUNT_EQUALS,hn.COUNT_NOT_EQUALS,hn.COUNT_LT,hn.COUNT_LTE,hn.COUNT_GT,hn.COUNT_GTE],[hn.NOT_IN_FILE,hn.IN_FILE],[hn.EQUALS,hn.NOT_EQUALS,hn.HAS_ALL],[hn.LT,hn.LTE,hn.GT,hn.GTE],[hn.MISSING_VALUE,hn.EXISTS],[hn.COUNT_RANGE],[hn.IN_RANGE],[hn.STARTS_WITH,hn.CONTAINS],[hn.FULL_TEXT],[hn.ON,hn.BEFORE,hn.AFTER,hn.NOT_EQUALS],[hn.WITHIN]],Pu=(e,t)=>Nu.some((r=>r.includes(e)&&r.includes(t))),Ru=(0,l.pipe)(l.omit,l.values),Su={OPTIONS_FOR_STRING:Ru(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],hn),OPTIONS_FOR_DATE:[hn.ON,hn.BEFORE,hn.AFTER,hn.WITHIN,hn.NOT_EQUALS,hn.MISSING_VALUE,hn.EXISTS,hn.COUNT_EQUALS,hn.COUNT_NOT_EQUALS,hn.COUNT_LT,hn.COUNT_LTE,hn.COUNT_GT,hn.COUNT_GTE,hn.COUNT_RANGE,hn.IN_FILE,hn.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Ru(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],hn),OPTIONS_FOR_BLOB:Ru(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],hn),OPTIONS_FOR_NUMBER:Ru(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],hn),OPTIONS_FOR_LOOKUP:Ru(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],hn),OPTIONS_FOR_ENUM:Ru(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],hn),OPTIONS_FOR_ID:[hn.EQUALS,hn.NOT_EQUALS,hn.IN_FILE,hn.NOT_IN_FILE],OPTIONS_FOR_COUNT:[hn.EQUALS,hn.NOT_EQUALS,hn.LT,hn.LTE,hn.GT,hn.GTE,hn.IN_RANGE],OPTIONS_FOR_COMPLEX:[hn.COUNT_EQUALS,hn.COUNT_NOT_EQUALS,hn.COUNT_LT,hn.COUNT_LTE,hn.COUNT_GT,hn.COUNT_GTE,hn.COUNT_RANGE,hn.EXISTS,hn.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[hn.EQUALS,hn.NOT_EQUALS,hn.EXISTS,hn.MISSING_VALUE]},wu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Xt.TYPE_TYPEAHEAD:case Xt.TYPE_STRING:case Xt.TYPE_PASSWORD:case Xt.TYPE_TEXT:case Xt.TYPE_CIK_ID:case Xt.TYPE_URL:case Xt.TYPE_BLOG_URL:case Xt.TYPE_IMAGE_URL:case Xt.TYPE_EMAIL:return Su.OPTIONS_FOR_STRING;case Xt.TYPE_LOOKUP:case Xt.TYPE_DEPENDENT_LOOKUP:return Su.OPTIONS_FOR_LOOKUP;case Xt.TYPE_ENUM:return Su.OPTIONS_FOR_ENUM;case Xt.TYPE_DATE:case Xt.TYPE_ACTIVENESS_DATE:case Xt.TYPE_TIMESTAMP:case Xt.TYPE_LOCAL_DATE:return Su.OPTIONS_FOR_DATE;case Xt.TYPE_BOOLEAN:case Xt.TYPE_BOOLEAN_RADIO:return Su.OPTIONS_FOR_BOOLEAN;case Xt.TYPE_BLOB:return Su.OPTIONS_FOR_BLOB;case Xt.TYPE_LONG:case Xt.TYPE_INT:case Xt.TYPE_FLOAT:case Xt.TYPE_DOUBLE:case Xt.TYPE_NUMBER:return Su.OPTIONS_FOR_NUMBER;case Xt.TYPE_ENTITY_ID:return Su.OPTIONS_FOR_ID;case Xt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[hn.EQUALS];case Xt.TYPE_COUNT:return Su.OPTIONS_FOR_COUNT;case Xt.TYPE_NESTED:case Xt.TYPE_REFERENCE:case Xt.TYPE_IMAGE:return Su.OPTIONS_FOR_COMPLEX;default:return Su.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Ou,n):n},Iu=e=>[vt.and,vt.andNot].includes(e),Uu=e=>[vt.or,vt.orNot].includes(e),Cu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Uu)),Du=(Lu=[vt.and],e=>e.slice(0,-1).every((e=>Lu.includes(e.operator))));var Lu;const ju=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),ku=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Fu=e=>`(${e})`,Mu=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},xu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[vt.or,vt.orNot],n=t?[vt.and,vt.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)&&Mu(e.slice(1,-1));return!i&&!a||o?e:Fu(e)},$u="and",Vu=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)($u,n,e),o=(e=>[vt.andNot,vt.orNot].includes(e))(a)?xu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Gu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Wu=e=>Array.isArray(e)?e.map(Wu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Bu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Yu=e=>`'${e}'`,qu=e=>`"${e}"`,Hu=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Ju=(0,l.pipe)(Wu,Bu),Qu=(0,l.pipe)(Ju,Yu),Ku=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Tu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Xu=(e,t)=>Ou(t)?{type:Xt.TYPE_INT}:vu(t)?{type:Xt.TYPE_FILE}:_u(t)&&!Au(t)&&jr(e.type)?{type:Xt.TYPE_LOCAL_DATE}:e,zu=Object.values(Rn),Zu=e=>!Object.values(Rn).includes(e),ec=e=>zu.includes(e),tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sn;return de().text(t[e])},rc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Nn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sn;return e.map((e=>({value:e,get label(){return tc(e,t)}})))},nc=e=>{const t=f()().startOf("minute");switch(e){case Nn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Nn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Nn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Nn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Nn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Pn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},ic=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},ac=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nc;return(0,l.is)(String,e)?t(e):ic(e)};let oc;!function(e){e.CurrentUser="currentUser"}(oc||(oc={}));const sc={},lc=(e,t)=>{sc[e]=t},uc=e=>sc[e];function cc(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){pc(e,t,r[t])}))}return e}function pc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dc=e=>e.split("{CurrentUser}").join(uc(oc.CurrentUser)||""),yc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),fc=(0,l.curry)(((e,t,r)=>{const n=r.map(Tu(e)||t.endsWith(".count")?Ju:Qu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Tc=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Ec=e=>{let{filter:t,fieldName:r,values:n}=e;const i=mu(t);return(0,l.pipe)(Tc(i),(0,l.map)(fc(t,r)),yc(" or "))(n)},mc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Qu).join(",")})`},hc=e=>`*${e}*`,bc=e=>`URL:${e}`,Oc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,vc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===hn.IN_FILE?r:`not ${r}`},gc=(e,t)=>[R(e,t),S(e,t)],_c=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Ac(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case hn.ON:return cc({},e,n?{filter:hn.EQUALS}:{filter:hn.IN_RANGE,values:[gc(i,n)]});case hn.BEFORE:return cc({},e,{filter:hn.LTE,values:[[S(i,n)]]});case hn.AFTER:return cc({},e,{filter:hn.GTE,values:[[R(i,n)]]});case hn.WITHIN:return cc({},e,{filter:hn.IN_RANGE,values:[nc(i)]})}}return e}),Ec),Ac=(0,l.propSatisfies)(jr,"type"),Nc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),dc)],[(0,l.propEq)("filter",hn.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(Ec({filter:hn.EQUALS,fieldName:t,values:[r]}))),new Vu).build())),yc(" or "))(r)}),dc)],[(0,l.propEq)("filter",hn.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Ec({fieldName:r,filter:t,values:n.map((0,l.pipe)(Wu,hc))})}),dc)],[(0,l.propEq)("filter",hn.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Ec(cc({},e,{values:(0,l.flatten)(r)})):Oc(r)?mc(cc({},e,{filter:"listEquals"})):Ec(e)}),dc)],[(0,l.propEq)("filter",hn.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=mu(t);return(0,l.pipe)(Tc(i),(0,l.map)(fc(t,r)),yc(" and "))(n)})(cc({},e,{values:(0,l.flatten)(e.values)})):Ac(e)?(e=>{const{values:t}=e,r=!Ac(e),[n]=t;return(new Vu).addClause(Ec(cc({},e,{filter:hn.LT,values:[R(n,r)]}))).addClause(Ec(cc({},e,{filter:hn.GT,values:[S(n,r)]}))).orBuild()})(e):Oc(t)?mc(cc({},e,{filter:"not listEquals"})):Ec(e)}),dc)],[(0,l.propSatisfies)(vu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Ec({fieldName:r,filter:vc(t,r),values:n.map((0,l.prop)("link")).map(bc)})}],[(0,l.propSatisfies)(Ou,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Ec({fieldName:`${r}.count`,values:n,filter:gu(t)})}],[(0,l.propSatisfies)(_u,"filter"),_c],[(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 fc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return fc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Ec,dc)]],Pc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!hu(e)||Sc(e,r))},Rc=(e,t)=>Array.isArray(t)?Sc(e,t):e===hn.WITHIN?ec(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Wu(t).length>0,Sc=(e,t)=>t&&t.length>0&&t.every((t=>Rc(e,t)));function wc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ic=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Uc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Cc=(e,t,r)=>"children"===e?Lc(r,[...t][0],!0):r,Dc=(e,t,r)=>"values"===e?[...r,...t]:r,Lc=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)(Cc,t),e);if(!r&&bu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Dc,t),e)}return(0,l.append)(t,e)},jc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Ic(e),r=e=>e.fieldName===t?e:r({fieldName:Uc(e),children:[e]});return r(e)})(t);return Lc(e,r)}),[]),kc=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")),Fc=e=>{let[t]=e;return t.children?Fc(t.children):t.operator},Mc=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=Fc(t)===vt.andNot,a=n(t,!1),o=i?`not ${xu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Fc(r)||$u} ${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&&kc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Vu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},xc=(0,l.pipe)((0,l.propOr)("","filter"),du),$c=(0,l.map)((0,l.when)(xc,(e=>{const[t,r]=pu(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){wc(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Vc=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)(Pc),$c,jc,Mc([...e,...Nc],t))},Gc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Wc=[hn.ON,hn.BEFORE,hn.AFTER,hn.WITHIN,hn.NOT_EQUALS,hn.MISSING_VALUE,hn.EXISTS],Bc=[hn.EQUALS,hn.NOT_EQUALS,hn.STARTS_WITH,hn.MISSING_VALUE,hn.HAS_ALL,hn.FULL_TEXT,hn.EXISTS],Yc=[hn.EQUALS,hn.NOT_EQUALS,hn.LT,hn.LTE,hn.GT,hn.GTE,hn.IN_RANGE],qc=(e,t)=>{const r=yr(e);return(e=>{switch(e){case kn.startDate.name:case kn.endDate.name:case Mn.dueDate.name:case Vn.createdTime.name:case Vn.updatedTime.name:case Wn.reltioLoadDate.name:case Wn.createDate.name:case Wn.updateDate.name:case Wn.deleteDate.name:case Wn.publishDate.name:return Wc;case Gn.matches.name:case Wn.count.name:return Yc;case Mn.workflow.name:case Mn.assignee.name:case Mn.step.name:case xn.commenter.name:case Vn.createdBy.name:case Vn.updatedBy.name:case Wn.sourceSystems.name:case Wn.value.name:return Bc;default:return null}})(t)||wu(r)},Hc=[hn.EQUALS,hn.NOT_EQUALS,hn.CONTAINS,hn.STARTS_WITH,hn.MISSING_VALUE,hn.HAS_ALL,hn.IN_RANGE,hn.WITHIN,hn.EXISTS,hn.ON],Jc=(0,l.pipe)(qc,(0,l.filter)((0,l.includes)(l.__,Hc))),Qc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(_s);return a&&a[0]&&(r=n.length>0&&a[0].value?Qc(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),Kc=(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=Qc(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=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},Xc=/[,\s]*$/,zc=e=>{const t=de().text(Un);if(!e)return t;const r=e.replace(Xc,"");return""===r.toString().trim()?t:r},Zc=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},ep=(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=Zc(e,r.referencedEntityTypeURI);if(n)return Kc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Kc({attributes:t||{}},r.dataLabelPattern);return""},tp=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},rp=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)}`},np=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},ip=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),ap=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ql,(0,l.prop)("value"))),op=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),ap),sp=(e,t,r)=>{const n=op(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)($s(e),ap)))(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")])})(cn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ms(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,ap))(r)})(e,r)||En(e,r.type);return ip(t,n)};function lp(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){up(e,t,r[t])}))}return e}function up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cp="DTSS/",pp=(0,l.replace)(new RegExp("^entities/"),""),dp=e=>cp+e.dataTenant+"/"+e.uri,yp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),fp=e=>!(!e||!e.dataTenant),Tp=(0,l.startsWith)(cp),Ep=(0,l.pipe)((0,l.ifElse)(Tp,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),mp=(0,l.ifElse)(fp,dp,(0,l.prop)("uri")),hp=e=>e&&e.uri?e.dataTenant?dp(e):pp(e.uri):"",bp=(0,l.curry)(((e,t,r)=>(cn(t,r.type)||{})[e]||"")),Op=bp("label"),vp=bp("typeGraphIcon"),gp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=cn(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(_s)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:ep(e,o,i),uri:a.uri}})).filter(l.identity):[]},_p=(0,l.pipe)(gp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Ap=(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=Ap(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Ap(e.slice(1),r)}})),Np=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Pp=e=>(0,l.propOr)([],"matchRules",e),Rp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?lp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Sp=(e,t,r)=>t&&r?r.aEntity:e,wp=(0,l.evolve)({attributes:Ml(!0)}),Ip=(0,l.pipe)(wp,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Up=e=>(0,l.assoc)("dataTenant",e);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:Dt.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},jp=e=>{let{relationUri:t}=e;return{type:Dt.DELETE_RELATION,parameters:{relationUri:t}}},kp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Dt.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Fp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Dt.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Mp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Dt.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===Dt.DELETE_RELATION,Vp=e=>e.type===Dt.CREATE_RELATION,Gp=e=>e.type===Dt.REPOINT_RELATION,Wp=e=>e.type===Dt.UPDATE_RELATION,Bp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Yp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Dt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Bf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Dt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Wf(e,i).then(o)};case Dt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Jf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Dt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Yf({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Dt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[jp({relationUri:o}),Lp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Hp(n)),(0,l.map)(Yp),Bp)(s)}}},qp=e=>t=>()=>e().then(t),Hp=e=>t=>Cp({dcrProcessor:e},t),Jp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Zr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Hp(r)),(0,l.map)(Yp),(0,l.map)(qp(r.getDcrUriAwait)),Bp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Qp=e=>t=>(0,l.map)((t=>Cp({},t,{parameters:(0,l.evolve)({parentUri:eh(e),entityUri:eh(e),newEntityUri:eh(e)},t.parameters)})),t),Kp=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)=>Wp(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(Kp({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:!Wp(i)||!xp(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Kp({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(Wp).filter(xp(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Wp(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Kp({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(Wp).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()),eh(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)===Lt.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)===Lt.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=eh(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)(ki,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(tl),eo)(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=(t,n)=>{let i=hd(n),a=!1;i.startsWith("!")&&(i=i.slice(1),a=!0);const o=e[i]&&qi(Bi.READ,e[i]),s=t.find(bd(i))||!o?t:t.concat(md(n)?Td({},n,{uri:i}):i);return a?s:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==i||t.find(bd(n))?t:r(t,n)),s)};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=Kc(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))]),Wd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Be()},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=Bd(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)},Bd=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:Dn.IN}:{type:t[0],direction:Dn.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&&Qi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Dn.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"],cn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],cn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Yd,ki(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Dn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Dn.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}=Vi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=Mi(e,n.uri);return n&&(!t||dn(e,i,t))&&(!r||dn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],cn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],cn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(hs,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=dn(n,l.__,t.type),o=e?xd:Md,s=dn(n,l.__,r.type),u=e?Md:xd;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Qd=(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(dn(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Kd(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)=>Ke(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"),Ke(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Xt.TYPE_REFERENCE),(0,l.pipe)(rr,(0,l.any)(Ke(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",pt.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===pt.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",pt.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",pt.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",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Ty=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?ph(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 Et.attributeValue:{const e=a;if(Or(a))return Kc(o,e.dataLabelPattern);if(vr(a)){const t=o,i=Ds(t),a=er(e),s=cn(n,a);return Ge(i)?Kc(r[i],s.dataLabelPattern):t.label}return""}case Et.tempEntity:return Kc(o,a.dataLabelPattern);case Et.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=cn(n,null==e?void 0:e.entityType);return`${zc(i&&Ge(i)?Kc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Fi(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){Kd(e,t,r[t])}))}return e}({},e,{label:zc(t)})}))},Ey=e=>!e.severity||e.severity===yt.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 Xt.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 Xt.TYPE_REFERENCE:return!!Ps(t);case Xt.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=qo(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=Ms(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!_s(e.parent))))).forEach((e=>{by(e.attrValues,n)&&r.push(Xd({type:pt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:de().text("Attribute is required"),source:dt.local}))})),r}),[])},vy=(0,l.curry)(((e,t,r)=>Ms(e,t,r,!1))),gy=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),cn(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(hr),(0,l.filter)(vr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(vy(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ds),(0,l.map)((e=>{let{uri:r}=e;return Xd({type:pt.missedRefEntity,uri:"",attributeTypeUri:rt(r,t.type),parentUri:r,message:de().text("Entity is required"),source:dt.local})})))(t)},_y=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ds,Ge)).flatMap((n=>{const i=Ds(n),a=t[i],o=Ir(e,rt(n.uri,r.type));return Ay(e,t,o,a)})),Ay=(e,t,r,n)=>{const i=rr(r),a=i.map((t=>Ir(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Xt.TYPE_REFERENCE))).flatMap(ir).concat(i);return Ny(e,t,n,(e=>a.some(Ke(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:nt(e.uri),uri:nt(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)(Ge,(e=>t[e]),(0,l.always)(null)))(r),i=Sy(e,r),a=(e=>(0,l.path)(Dd(),e)?[]:[Xd({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(wd(),e),parentUri:(0,l.path)(Sd(),e),message:de().text("Entity is required"),source:dt.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:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:de().text("Entity is required"),source:dt.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=cn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||ho(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)(Ls,Ge,l.not)]),(e=>{const t=(0,l.pipe)(Ls,ze)(e);return jy((e=>e.replace(t,t+Le)))(e)})),(0,l.when)((0,l.pipe)(Ds,Ge),(t=>{const r=Ds(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)=>$h(Fh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Wh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).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(lt))))})(e))).concat(Xm(e,t)),My=(e,t)=>(0,l.evolve)({attributes:kl({valueTransformer:(0,l.pipe)(Fs,ky(t),Ly(lt)),deleteEmptyComplex:!0}),uri:lt})(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(De,"g"),"uri$$$$").replace(new RegExp(Le,"g"),""))),Gy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Vy,objectParentUri:Vy}),(e=>{return xy({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?pt.missed:pt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&st(e.objectUri),uri:e.objectUri,source:dt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Wy=(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&&Ir(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Et.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&&ot(i)){const n=(0,l.last)(a),i=n.valueType;if(vr(i)&&ar(i).includes(o)){const i=Ds(n.value),o=i&&Ge(i)?t[i]:null;return o?xy({},e,{parentUri:o.uri,path:a.concat({type:Et.tempEntity,value:o,valueType:cn(r,o.type),label:""})}):e}}return e}})(t)))(e),By=e=>{if(e.type===Tt.AGO||e.type===Tt.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Tt.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},Yy=e=>`equals(user, '${Bu(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(!By(e))return"";switch(r){case Tt.WITHIN:return`gte(timestamp, ${X(t)})`;case Tt.AGO:return`lte(timestamp, ${X(t)})`;case Tt.BETWEEN:{const[e,r]=t;return`range(timestamp, ${e.valueOf()}, ${f()(r).endOf("date").valueOf()})`}default:return""}},Qy=e=>[`equals(items.objectUri, '${e}')`,`equals(items.startObjectUri, '${e}')`,`equals(items.endObjectUri, '${e}')`].join(" or "),Ky=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Xy=e=>{let{query:t,body:r}=e;return t=Ky(t),ru(`/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)(Vc(),Gc(t.globalFilter))(n),activeness:t.activityFilter||In.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Kr(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;const n=zy(e,t,r);return ru(n)},ef=e=>ru(`/entities/_total?${e}`),tf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(bs),(0,l.map)((0,l.prop)("uri")))(e),i={filter:hn.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Vc(),Gc(r.globalFilter))([i,a]),s=Kr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||In.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return ru("/entities/_typeAheadSearch"+s,{method:"GET"})},rf=(0,l.pipe)((0,l.reject)(l.isNil),Qr),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)(Vc(),Gc(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={filter:(0,l.pipe)(Vc(),Gc(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};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Kr(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 ru(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),ru("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},df=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Ge)),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=Ar(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Vc(),Gc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),ru(`${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 ru(`/${e}${Kr(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 ru(n,r)},bf=e=>ru(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Of=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return ru(`/${e}/_clone${Kr({executeLCA:!1,valuesToCopy:r})}`,n)},vf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return ru(`/entities/_events/_total${Qr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},gf=(e,t)=>ru(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),_f=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return ru(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},Af=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 ru(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Qr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Nf=e=>{const t=new FormData;return t.append("file",e),ru("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=fe(e,de().text("Can't upload file"));return Promise.reject(t)}))},Pf=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 ru(`/personal/findSavedSearches${Qr({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"}})},Rf=e=>ru(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Sf=e=>ru("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),wf=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return ru(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},If=e=>{let{uri:t}=e;return ru(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Uf=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),wf)(e),Cf=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),wf)(e);function Df(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lf=["max","offset","filter"],jf=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:jf(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){Df(e,t,r[t])}))}return e}({},t,(0,l.pick)(Lf,e)))),kf=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ot.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ot.ALL,e)))return!1},Ff=(0,l.omit)(["activeness"]),Mf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=kf(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(jf(e),(0,l.omit)(Lf))(e))),Ff,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Kr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},xf=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),$f=(0,l.reject)(l.isNil),Vf=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Gf=e=>ru(Vf(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,Vf);return ru(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Bf=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?Ml()(i):null,startDate:a,endDate:o},c=(0,l.pipe)($f,ne,JSON.stringify);return ru(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Yf=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"),Vf,n),o=Fh(i(t),i(r)).concat(xh(t,r));return ru(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},qf=(e,t,r)=>{const{url:n,options:i}=Mf(e,t,r);return ru(n,i).then(xf)},Hf=(e,t)=>ru(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Jf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Dn.IN?a.inRelations=[n]:a.outRelations=[n],ru(`/${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 ru(`${t}/recentSearches${Kr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Kf=e=>ru("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xf=e=>{let{environment:t,tenant:r,createdDate:n}=e;return ru(`/recentSearches${Kr({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){Zf(e,t,r[t])}))}return e}function Zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eT={select:"label,secondaryLabel,name,type,startDate,endDate"},tT=(0,l.reject)(l.isNil),rT=(0,l.pipe)(tT,Qr),nT=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i,signal:a}=e;const o=zf({},eT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return ru(`/${t}/_tree${rT(o)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:a})},iT=e=>{let{uri:t,graphUri:r}=e;const n=zf({},eT,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return ru(`/${t}/_parents${rT(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},aT=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s,signal:l}=e;const u=zf({},eT,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return ru(`/${t}/_hops${rT(u)}`,{method:"GET",headers:{"Content-Type":"application/json"},signal:l})};function oT(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 sT=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},lT="/activities",uT=e=>{let{label:t,description:r}=e;return ru(lT,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:sT()}})};var cT;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(cT||(cT={}));const pT=e=>{const t=Kr(e);return ru(lT+t,{method:"GET"})},dT=e=>ru(`/activities/_total${Kr(e)}`,{method:"GET"}),yT=e=>{const{entityUri:t}=e,r=oT(e,["entityUri"]);return ru(`/${t}/_activities${Kr(r)}`,{method:"GET"})},fT=e=>{const{entityUri:t}=e,r=oT(e,["entityUri"]);return ru(`/${t}/_activities/_total${Kr(r)}`,{method:"GET"})};function TT(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 mT=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},hT=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return ru(mT({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},bT=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=mT({url:r,workflowPath:t,tenant:n})),ru(s,{method:i||"GET",body:JSON.stringify(a),headers:TT({"Content-Type":"application/json"},null!=o?o:{})})},OT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=mT({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return ru(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)},vT=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=mT({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?TT({},l,{comment:o}):l;return ru(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},gT=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=mT({url:`/tasks${s?Kr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(TT({objectURIs:[i]},(0,l.reject)(E,a)))};return ru(u,TT({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},_T=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return ru(mT({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})})},AT=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return ru(mT({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(TT({max:a,offset:o},i))})},NT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return ru(mT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},PT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return ru(mT({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},RT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return PT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},ST=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return ru(mT({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},wT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return PT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},IT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return PT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},UT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return PT({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},CT=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return ru(mT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},DT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return ru(mT({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},LT=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 ru(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Qr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},jT=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 ru(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Qr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},kT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return ru("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},FT=(e,t,r)=>Promise.all(t.map((async t=>await ru(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),MT=async(e,t)=>await FT(e,t,"NOT"),xT=async(e,t)=>await FT(e,t,"MATCH"),$T=async(e,t)=>await Promise.all(t.map((async t=>await ru(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function VT(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){GT(e,t,r[t])}))}return e}function GT(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 BT=3e4,YT=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return ru(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},qT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return pE({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}})},HT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return pE({url:`entities/_connections/_import?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,dataEntityUri:i,customerEntityUri:a}=e;return ru(`${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 JT({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},KT=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(fp,i);return Promise.all([s.length?kT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return JT({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},XT=(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"),XT),ZT=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return ru(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(zT)},eE=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)},tE=eE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return ru(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(zT)})),rE=eE((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return ru(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),nE=(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)}},iE=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return ru(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},aE=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 iE(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},oE=aE("NOT"),sE=aE("MATCH"),lE=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(fp,a);return Promise.all([FT(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return iE(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},uE=lE("NOT"),cE=lE("MATCH");function pE(e){let{requestProvider:t=ru,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}`,VT({},WT(s,["headers"]),{headers:VT({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const dE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return pE({url:lf(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},yE=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return pE({url:zy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},fE=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Mf(t,r);return pE({url:`entities/_connections/_getConnections${Kr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(xf,(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)))}))))},TE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return pE({url:`${ff(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},EE=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return ru(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},mE=e=>{let{dtssPath:t,tenant:r}=e;return ru(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},hE=e=>{let{dtssPath:t,customerTenant:r}=e;return ru(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:BT})},bE=e=>{let{dtssPath:t,tenants:r}=e;return ru(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET",timeout:BT})},OE=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return pE({url:ff(t),dataTenant:r,customerTenant:n,dtssPath:i})},vE=()=>ru("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function gE(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){_E(e,t,r[t])}))}return e}function _E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=gE({},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 ru(`${t}/api/${r}/graph/search${Kr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},NE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return ru(`${t}/api/${r}/graph/search/count`,{method:"POST",body:gE({},n,i),headers:{"Content-Type":"application/json"}})},PE=(e,t)=>`${e}/${t}/comments`,RE=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return ru(`${PE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},SE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ru(`${PE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},wE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ru(PE(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},IE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return ru(`${PE(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},UE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return ru(`${PE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},CE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return ru(`${PE(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return ru(`${PE(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},LE=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return ru(`${PE(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},jE=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Kr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return ru(`${PE(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function kE(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){FE(e,t,r[t])}))}return e}function FE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ME=e=>{let{tenant:t,servicesPath:r}=e;return ru(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xE="graphExport",$E=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await BE({servicesPath:e,tenant:t,environment:r,namespace:xE,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(kE({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await BE({servicesPath:e,tenant:t,environment:r,namespace:xE,options:kE({method:"PUT"},o)})}catch(e){s=null}return s||(s=await BE({servicesPath:e,tenant:t,environment:r,namespace:xE,options:kE({method:"POST"},o)})),s},VE=e=>{let{servicesPath:t,key:r}=e;return ru(`${t}/settings${Kr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},GE=e=>{let{servicesPath:t}=e;return ru(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},WE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return ru(`${n}/plugins${Kr({tenant:t,user:r})}`,{method:"GET"})},BE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return ru(`${n}/configService${Kr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},YE=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return BE({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},qE=e=>{let{servicesPath:t,stateHash:r}=e;return ru(`${t}/searchLink?key=${r}`,{method:"GET"})},HE=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),ru(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},JE=e=>ru(`/${e}?showObjectsInfo=true`,{method:"GET"}),QE=e=>{let{exportPath:t,tenant:r,options:n}=e;return ru(`${t}/${r}/activities${Kr(n)}`,{method:"POST"})};function KE(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){XE(e,t,r[t])}))}return e}function XE(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 ru(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ZE=e=>{let{entityUri:t,crosswalk:r}=e;return ru(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},em=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return ru("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[KE({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),KE({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},tm=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return ru(`/${r}/_${n}${Kr({contributorURI:t})}`,{method:"POST"})},rm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return ru(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},nm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return ru(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},im=e=>{let{entityUri:t,crosswalkId:r}=e;return ru(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function am(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=e=>{let{entityTypeUri:t}=e;return ru(`/dataQuality/fillRates${Qr({entityType:ze(t)})}`,{method:"GET"})},sm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},lm=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=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){am(e,t,r[t])}))}return e}({},n===Ct.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Ct.ATTRIBUTE_TYPE?Qr({numberOfThreads:sm({attributes:r,metrics:i})||1}):"";return ru(`/entityType/${ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},um=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return ru(`${t}/api/${r}/dataValidationFunctions/entityTypes/${ze(n)}`,{method:"GET",headers:{env:i}})},cm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Ct.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return ru(`${t}/${r}/entityType/${ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},pm=e=>{let{tenant:t,apiPath:r}=e;return ru(`${r}/permissions/${t}`,{method:"GET"})},dm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return ru(`/${t}${Kr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},ym=e=>{let{attributeUri:t,value:r}=e;return ru(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},fm=e=>{let{attributeUri:t,value:r}=e;return ru(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Tm=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return ru(`/${t}${Kr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Em=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Kr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ml()([[{value:a}]]);return ru(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},mm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return ru(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},hm=e=>{let{entityUri:t,attributeName:r}=e;return ru(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function bm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Om=e=>{let{entityUri:t}=e;return ru(`/${t}/_historicURIs`,{method:"GET"})},vm=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 ru(`/${t}/_changesWithTotal${Kr(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){bm(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},gm=(e,t)=>ru(`/${e}/_previousChange${Kr({timestamp:t})}`,{method:"GET"}),_m=(e,t)=>ru(`/${e}${Kr({time:t})}`,{method:"GET"});function Am(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){Nm(e,t,r[t])}))}return e}function Nm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),ru(t,{method:o,body:s,headers:Am({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Rm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Kr({options:a.join(","),severity:o.join(",")});return ru(`${t}/validate/${i}/entity/${hp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Sm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return ru(`${t}/validate/${n}/entity${Kr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},wm=e=>{let{tenant:t,apiPath:r}=e;return ru(`${r}/tenants/${t}/name`,{method:"GET"})},Im=e=>{let{tenant:t,apiPath:r}=e;return ru(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Um=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return ru(`${a}/preferences${Kr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Cm=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 ru(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Dm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return ru(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Lm=e=>{const{servicesPath:t}=e;return ru(`${t}/getTokenForWorker`,{method:"GET"})};var jm=r(29524);const km=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=We(),s={attributes:Nl({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=Ms(r,e,n.uri)[0];return i&&i.value?Ul({entity:e,attributeType:n,uri:i.uri,value:t}):wl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Fm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ds),(0,l.filter)(Ge),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Mm=(0,l.curry)(((e,t)=>{const r=Fm(e=e||{},t=t||{});return r.concat((0,l.chain)(Mm(e),r))})),xm=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),$m=xm((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Vm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Ge)),Gm=e=>(0,l.pipe)($m,Vm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Wm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)($m,(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})),Bm=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Ge),(0,l.omit)(["uri","timestamp"])),Ym=(0,l.pipe)(Bm,wp),qm=async(e,t,r)=>{if(!e)return null;const n=Gm(e);if(n.length>0)for(const r of n)e=Wm(r,t[r],e);const i=await hf(Ym(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},Hm=async(e,t,r)=>{const n=Qm(e,t),i={};for(const t of n)i[t]=await qm(e[t],i,r);return i},Jm=(0,l.curry)(((e,t)=>{const r=jm.Node(t);return Gm(e[t]).forEach((t=>{const n=Jm(e,t);r.addEdge(n)})),r})),Qm=(e,t)=>(0,l.pipe)((0,l.map)(Jm(e)),(0,l.map)(jm.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Km=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Bm))})),Xm=(e,t)=>[...Bh(e.tags||[],t.tags||[]),...Yh(e.roles||[],t.roles||[]),...Mh(e,t),...xh(e,t)],zm=(e,t)=>[...$h(Fh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Wh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...Xm(e,t)],Zm=(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 Wm(r,n,e)}),e))))}),t)}),Km),eh=(0,l.curry)(((e,t)=>(0,l.when)(Ge,(0,l.propOr)(l.__,t,e),t)));function th(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){rh(e,t,r[t])}))}return e}function rh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nh=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return th({},t,{[r]:{parents:n,children:i}})},ih=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return th({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},ah=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=Fm(t,i),o=nh({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>ah(n.uri,t,[e],r)),o)},oh=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?ih({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Dd(),n),s=Ge(o)?[o]:[],u=nh({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>ah(t,r,[i],e)),u)}),n)},sh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return oh(r,e,t,ah(e,t))},lh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return sh(t,r,n);if(qe(e)){const t=$d(n,e);return t&&oh([t],null,r)}return r[e]?ah(e,r):void 0},uh=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>uh(e,t))))},ch=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>ch(e,t))))},ph=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ye(t),u=sh(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(qe(c)){if(s=$d(i,c),!s)return null;o.push({type:Et.relationConnection,value:s,valueType:ki(a,(0,l.path)(wd(),s))});continue}if(qe(u)){const e=n[c];if(!e)return null;o.push({type:Et.tempEntity,value:e,valueType:cn(a,e.type)});continue}const p=n[u],d=Zs(p,c),y=n[c];if(!d||!y)return null;o.push({type:Et.attributeValue,value:d,valueType:Ir(a,rt(d.uri,p.type))}),o.push({type:Et.tempEntity,value:y,valueType:cn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},ch(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=qe(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?ki(a,d.type):cn(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Ur(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:Et.tempEntity,value:T,valueType:cn(a,T.type)}),o.push({type:Et.attributeValue,value:s,valueType:E}),m=s.value;const l=Ds(s);T=l&&Ge(l)?n[l]:null}}return o},dh=e=>e.every((e=>{let{type:t}=e;return[Et.attributeValue,Et.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Et.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let yh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(yh||(yh={}));const fh={[yh.insertAttribute]:{color:"#599E0E"},[yh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[yh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Th=e=>{switch(e){case"UPDATE_ATTRIBUTE":return yh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return yh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return yh.deleteAttribute;default:return""}},Eh="/",mh=(0,l.pipe)((0,l.split)(Eh),(0,l.propSatisfies)((0,l.lte)(2),"length")),hh=(0,l.pipe)((0,l.split)(Eh),(0,l.slice)(0,-2),(0,l.join)(Eh)),bh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>mh(e),bh(hh(e))]])(t))),Oh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+Eh))),vh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=bh(e,t);return(0,l.isNil)(r)?Oh(e)(t)?"UPDATE_ATTRIBUTE":"":r},gh=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]},_h=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(_h(e))}))}))),t},Ah=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Sh,t),(0,l.propOr)([],"crosswalks",e))),e),Nh=(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(Nh(e))}))})),r},Ph=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=Ph(e);r>t&&(t=r)}))})),t+1):t},Rh=(e,t)=>{if(Ge(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Sh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},wh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Ih=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Uh=(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)},Ch=(0,l.eqBy)(Sh),Dh=(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)(Rs,(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 Lh(e){return e&&void 0!==e.uri}function jh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function kh(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 Fh(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(Fh(d.value,y.value,r)):"Reference"===g(d)?kh(d,y)?o.push.apply(o,Fh(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(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 m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),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}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function Mh(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||Lh(r)&&Lh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function xh(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function $h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Vh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Gh(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Vh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Vh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Gh=(e,t,r)=>(0,l.pipe)(el,(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 Rh(t,r)},e=>{let[t]=e;return!_s(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Wh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Bh(e,t){return jh("UPDATE_TAGS").call(this,e,t)}function Yh(e,t){return jh("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){Hh(e,t,r[t])}))}return e}function Hh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jh=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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 Qh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Qh(t.value):[]];return e.concat(r)}),[])),Kh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Xh=e=>e?[mp(e)]:[],zh=e=>{const t=[...Qh((null==e?void 0:e.attributes)||[]),...Qh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...Xh(e),...t]:[]},Zh=(e,t)=>[e,...t.map((t=>Kh(e,t)))],eb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return yd(t)}))},tb=(e,t)=>{switch(e){case mt.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case mt.ENTITY_ATTRIBUTE:case mt.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[nt(t)]})(t);case mt.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case mt.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,mp({uri:n,dataTenant:i}),r]})(t)}},rb=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),nb=(0,l.curry)(((e,t)=>{const r=Go(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(nb(e,r.extendsTypeURI)):n})),ib=(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))),ab=(e,t)=>(0,l.pipe)((0,l.prop)("type"),nb(e),ib(t))(t),ob=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 sb,lb=r(33164);function ub(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"}(sb||(sb={}));const cb={},pb={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"]}},db=e=>{if(!cb[e]){const t=pb[e]||pb.random0;cb[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){ub(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return cb[e]},yb=(0,l.curry)(((e,t)=>{const r=db(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]})),fb=e=>yb(sb.Charts,e),Tb=()=>db(sb.PotentialMatches).colors,Eb=e=>yb(sb.Random1,e),mb=e=>(0,lb.getColor)(e)?"#FFFFFF":"#212121";var hb=r(73116);const bb=Array.from({length:100},((e,t)=>t/100)),Ob=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)},vb={},gb=new hb.Z({hash:Ob,saturation:bb.slice(15,71),lightness:bb.slice(50,90)}),_b=new hb.Z({hash:Ob,saturation:bb.slice(46,89),lightness:bb.slice(44,58)}),Ab=(0,l.curry)(((e,t,r)=>{t in vb||(vb[t]={});const n=vb[t];r in n||(n[r]=((e,t)=>{const r=String(Ob(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Nb=Ab(gb,"crosswalks"),Pb=Ab(gb,"sources"),Rb=Ab(gb,"contributors"),Sb=Ab(gb,"dataValidationFunctions"),wb=Ab(_b,"entities");function Ib(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){Ub(e,t,r[t])}))}return e}function Ub(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cb=(0,l.has)("items"),Db=e=>0===e,Lb=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)},jb=e=>e.reduce(((e,t)=>e+t.width),0),kb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Fb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Mb=e=>e.reduce(((e,t)=>e+t.height),0),xb=e=>(0,l.is)(String,e)&&e.includes("%"),$b=(0,l.has)("spacer"),Vb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Gb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Cb(t)?Gb(t):t)),[]),Wb=(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},Bb=e=>({id:e.layout}),Yb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bb;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=xb(r.width)?Vb(i,r.width):u}return Lb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Lb(n,t,r)},o=(e,t)=>Cb(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Cb(a)?n(a.layout):e(a.view)))),s=Wb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=Db(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Cb(n))return r.concat(p(Ib({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Ib({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:jb(u),height:kb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Cb(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Db(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Cb(i))return r.concat(p(Ib({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Ib({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Lb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Lb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Fb(i),height:Mb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>Db(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 Ib({},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=Wb(e.width,[o,o]),u=Ib({},e,{width:s[0]}),c=Ib({},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(Ib({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Ib({},e,{height:Mb(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(Ib({},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 Ib({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Ib({},t,{items:(0,l.reject)($b,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 Gb(f)},qb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Hb=[Ft.FilteredEntitiesViewFacet,Ft.ActivitiesViewFacet,Ft.ProfileStatsFacet,Ft.FilteredSavedSearchesFacet],Jb=(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=Hb.includes(a.component)?8:4;return Ib({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Qb(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){Kb(e,t,r[t])}))}return e}function Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb={BarChart:kt.BAR,BarChartGrouped:kt.BAR,BarChartHorizontal:kt.BAR,LineChart:kt.LINE,Map:kt.MAP,Pie:kt.PIE},zb=(e,t)=>it(e)?et(e,t):e,Zb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Xb[r];return Qb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},eO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Qb({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"]))},tO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Qb({},e,{value:[vn,gn,hn.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:An(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&it(t)||!r?n:(n||[]).concat((i=r,{filter:hn.EQUALS,fieldName:"type",values:[i]}));var i},rO=["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"],nO={"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:zb(n,r),filters:tO(a,n,r),chartType:kt.BAR,component:Ft.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:zb(n,r),filters:tO(a,n,r),chartType:kt.BUBBLE,component:Ft.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:Ft.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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Qb({id:t,count:o,canRead:u,orderType:s,attributeUri:zb(r,p),filters:tO(a,r,p),component:Ft.DashboardFacet,title:i,showOthers:!0},Zb(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:zb(n,r),filters:tO(a,n,r),chartType:kt.MAP,component:Ft.DashboardFacet,title:i,geoUrl:rO[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 Qb({id:t,count:o,canRead:l,attributeUri:zb(n,r),filters:tO(a,n,r),component:Ft.DashboardFacet,title:i,geoUrl:s,chartType:kt.MAP,projection:"geoMercator"},Zb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ft.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:eO(i),component:Ft.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:tO(n,null,a),component:Ft.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:hn.GTE,fieldName:"matches",values:["1"]}],component:Ft.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:Ft.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:kt.CLOUD,component:Ft.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:kt.TREE,component:Ft.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ft.NotificationInboxFacet,title:n||de().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ft.ActivitiesViewFacet,title:n||de().text("Activity log")}}},iO=e=>({id:e,height:10}),aO=(0,l.pipe)((0,l.map)((e=>{const t=nO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),oO=e=>{if("0.1"===e.version){const t=aO(e.views),r=Yb(iO,e.layout,{columns:4});return{id:e.id,margin:0,layout:qb(r,t),views:t}}return e},sO=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"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>sO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function lO(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){uO(e,t,r[t])}))}return e}function uO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cO=lO({},Mt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),pO=e=>e,dO={[cO.Attributes]:pO,[cO.HierarchyTree]:pO,[cO.HierarchyPaths]:pO,[cO.RelationsTable]:pO,[cO.Relations]:e=>lO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[cO.SingleAttribute]:pO,[cO.Custom]:pO,[cO.AttributeTable]:pO,[cO.Map]:pO,[cO.OldTree]:e=>lO({},e,{class:Mt.HierarchyTree}),[cO.OldMap]:e=>lO({},e,{class:Mt.Map}),[cO.ImageAttribute]:pO,[cO.PotentialMatches]:pO},yO=(0,l.pipe)((0,l.map)((e=>{const t=dO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),fO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===Mt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),TO=(e,t)=>(t||[]).map((t=>lO({},t,fO(e,t.id)))),EO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return lO({},t,{layout:TO(t.views,e.newLayout)});if("0.1"===e.version){const r=yO(e.views),n=Yb(fO(r),e.layout,{columns:3});return lO({},t,{layout:qb(n,r),views:r})}return e},mO=(e,t)=>e.class===t||e["react-class"]===t,hO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(mO(t,Mt.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(mO(t,Mt.SingleAttribute)||mO(t,Mt.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(Ke(i))||t.some(Ke(i))}},bO=(e,t)=>e.filter((e=>t.some((t=>mO(e,t))))).map((e=>{let{id:t}=e;return t})),OO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},vO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),gO=e=>(0,l.pipe)((0,l.map)((e=>OO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function _O(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){AO(e,t,r[t])}))}return e}function AO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NO=(0,l.curry)(((e,t)=>sO(t).map((t=>(0,l.pipe)((0,l.map)((e=>OO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),PO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),RO=(0,l.propEq)("class",Mt.Custom),SO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},wO=(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=TO(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=>OO(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"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=NO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>OO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(PO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(NO(e),(0,l.filter)(RO))(_O({},n,{items:i})),s=[{id:"common",views:NO(e,_O({},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=EO(_O({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(gO,(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})},IO=(e,t)=>{if("scroll"===t.layout.layout){const r=NO(e,t.layout),n=oO(_O({},t,{views:r,version:"0.1"}));return{class:$t.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:$t.Dashboard,views:t.views,layout:t.layout,id:t.id}},UO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},CO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},DO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},LO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},jO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},kO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},FO=(e,t)=>{const r=NO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=vO(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:$t.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}},MO=(e,t)=>({class:$t.Graph,id:t.id}),xO=(e,t)=>{const r=NO(e,t.layout)[0];return{class:$t.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},$O=e=>t=>!!(0,l.intersection)(e,t).length,VO=(0,l.cond)([[$O(["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"]),()=>IO],[$O(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>UO],[$O(["com.reltio.plugins.graph.GraphView"]),()=>MO],[$O(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>CO],[$O(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>DO],[$O(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>LO],[$O(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>jO],[$O(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>kO],[$O(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>FO],[$O(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>xO],[l.T,()=>(0,l.always)(void 0)]]),GO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(SO),(0,l.map)((t=>wO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:$t.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:Vt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:Vt.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=>OO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",$t.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>OO(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=wO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:$t.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=sO(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 VO(o)(t,i)};function WO(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){BO(e,t,r[t])}))}return e}function BO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YO=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 HO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(HO||(HO={}));const JO={[$t.DQDashboard]:`${qO}DqDashboard.svg`,[$t.Dashboard]:`${qO}Dashboard.svg`,[$t.Graph]:`${qO}Graph.svg`,[$t.RelationshipSearch]:`${qO}GraphSearch.svg`,[$t.Interactions]:`${qO}Interactions.svg`,[$t.PotentialMatches]:`${qO}PotentialMatches.svg`,[$t.Profile]:`${qO}Profile.svg`,[$t.NestedProfile]:`${qO}Profile.svg`,[$t.ProfileActivityLog]:`${qO}ActivityLog.svg`,[$t.Relationships]:`${qO}Relationships.svg`,[$t.Sources]:`${qO}Crosswalk.svg`,[$t.Search]:`${qO}Search.svg`,[HO.DashboardGroup]:`${qO}DashboardGroup.svg`,[HO.ProfileGroup]:`${qO}ProfileGroup.svg`,[HO.SearchGroup]:`${qO}SearchGroup.svg`,DEFAULT:`${qO}Default.svg`},QO=e=>JO[null==e?void 0:e.class]||JO.DEFAULT,KO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",$t.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>WO({},e,{nestedRoute:`${t+1}`})))))),XO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},zO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?JO[HO.ProfileGroup]:null,ZO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===JO[$t.Dashboard]||t===JO[$t.DQDashboard]})),(0,l.always)(JO[HO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===JO[$t.Search]||t===JO[$t.RelationshipSearch]})),(0,l.always)(JO[HO.SearchGroup])],[l.T,()=>null]])(e),ev=e=>(0,l.pipe)((0,l.chain)(YO),(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=>WO({},e,{entityTypes:e["entity-types"],screen:GO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=KO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:QO(r),screen:XO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=GO(t,e);return{label:t.label,icon:zO(t)||ZO(r)||QO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},nv=e=>({id:e,height:10}),iv=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)(rv),(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=aO(((e,t)=>{const r=sO(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){tv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Yb(nv,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 av(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}function sv(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 lv=(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))),uv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,cv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),pv=(0,l.pipe)(lv("top-logo"),cv),dv=(0,l.prop)("showLookupCode"),yv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>OO(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=>OO(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=>OO(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=>OO(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=>OO(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=>OO(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=>OO(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)(ue,(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 av({thousandSeparator:r,decimalScale:n},sv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>OO(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)(lv("default-perspective"),(0,l.ifElse)(uv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>OO(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=>vO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return av({},t,sv(e,["action"]))})))(e))(e),f=(e=>lv("checkUser",e))(e),T=(e=>lv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>OO(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=>OO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=dv(h))||O;var O;const v=null===(t=gO(e))||void 0===t?void 0:t.showEntityId,g=(e=>lv("preview",e))(e),_=pv(e),A=(e=>lv("showAttributeDescription",e))(e),N=(e=>lv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>OO(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=>OO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(P).length?void 0:P,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:R,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},fv=e=>({layout:ev(e),pivoting:iv(e),properties:yv(e)});function Tv(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){Ev(e,t,r[t])}))}return e}function Ev(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mv=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,Ce.x0)()}`;return n[e.id].push(t),i=!0,Tv({},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]++,Tv({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function hv(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){bv(e,t,r[t])}))}return e}function bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Ov={};const vv=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(E(Ov[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))}Ov=hv({},Ov,{[a]:hv({},Ov[a]||{},{worker:i})})}else i=Ov[a].worker,Ov[a].innerText&&t({task:{action:Yt.SET_HTML,params:{html:Ov[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Ov[a].onWorkerMessage);return i&&(Ov[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||(Ov[a].innerText=n.params.html)}},i.addEventListener("message",Ov[a].onWorkerMessage)),i},gv=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),_v=(0,l.flip)(gv);var Av=r(83926);const Nv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Av.Decimal(t).toFixed(s):t,[u,c]=l.split("."),p=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),d=u.replace(p,r),y=null==c?void 0:c.replace(/(0|\.)+$/,"");return i+d+(y?n+y:"")+a};let Pv;const Rv=()=>Pv,Sv={setLocale:e=>{Pv=e},getLocale:Rv,number:e=>((e,t)=>{const r=String(t);try{const t=(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:((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})(e);return Nv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Rv(),e),applyFormatToNumber:Nv},wv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?Sv.applyFormatToNumber(e,t):(!e&&t&&(t=Sv.number(t)),t)))),Iv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Uv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Cv=!0;const Dv=e=>Cv=e,Lv=(e,t)=>e!==t&&t?Cv&&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 Lv(r,n)},Fv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Mv=(0,l.complement)(Fv),xv=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),$v=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)},Vv=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Mv(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Gv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Cn],s=i?q(i):"L",u=a?Q(a):"L LTS";switch(n.type){case Xt.TYPE_NUMBER:case Xt.TYPE_FLOAT:case Xt.TYPE_DOUBLE:case Xt.TYPE_LONG:case Xt.TYPE_INT:case Xt.TYPE_COUNT:return t&&wv(o,t);case Xt.TYPE_BOOLEAN:case Xt.TYPE_BOOLEAN_RADIO:case Xt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?de().text("Yes"):de().text("No");case Xt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(ec(t)?tc(t):de().date(t,s));case Xt.TYPE_ACTIVENESS_DATE:case Xt.TYPE_LOCAL_DATE:return(t=t)&&(ec(t)?tc(t):de().date(t,s));case Xt.TYPE_TIMESTAMP:return(t=t)&&(ec(t)?tc(t):de().date(isNaN(t)?t:Number(t),u));case Xt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Xt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Xt.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)?Lv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),Wv={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},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)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},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)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},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 Bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yv=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,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){Bv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},qv=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()}},Hv=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),Jv=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=(0,l.pipe)(Yv,(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),qv,Hv);let u=0,c=[];return{request:(e,n)=>{const i=s(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(u){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 c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},Qv="__metadata",Kv=(e=>{const t=[Qv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),Xv=(0,l.set)(Kv),zv=(0,l.view)(Kv),Zv=Xv(wn.NEW),eg=Xv(wn.REMOVED),tg=Xv(wn.EDITED),rg=Xv(wn.IGNORED),ng=(0,l.pipe)(zv,(0,l.equals)(wn.REMOVED)),ig=(0,l.pipe)(zv,(0,l.equals)(wn.NEW)),ag=(0,l.pipe)(zv,(0,l.equals)(wn.EDITED)),og=(0,l.pipe)(zv,(0,l.complement)(l.isNil)),sg=(0,l.pipe)(zv,(0,l.equals)(wn.IGNORED)),lg=(0,l.omit)([Qv]),ug=(e,t)=>e===Qv?void 0:t;function cg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pg=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=pg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},dg=(e,t)=>pg((0,l.propEq)("nodeId",t),e),yg=(e,t)=>pg((0,l.pathEq)(["entity","uri"],t),e),fg=(e,t)=>{const r=dg(e,t);return r.length>1?r[r.length-2]:null},Tg=(e,t)=>{const r=dg(e,t);return r.length>0?r[r.length-1]:null},Eg=(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=>Eg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},mg=()=>{},hg=(e,t)=>{let{parent:r,nodeProcessing:n=mg}=t;n(e,r),e.children&&e.children.forEach((t=>hg(t,{parent:e,nodeProcessing:n})))},bg=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Pt.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 Pt.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 Pt.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){cg(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})}}},Og=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&&hg(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Pt.addingChild||r.editingMode===Pt.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=bg({node:r,connection:n,isReversed:i}),s=Lp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Pt.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=bg({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},vg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=vg(r,t);if(e)return e}return!1},gg=(0,l.curry)(((e,t)=>{const r=(0,l.map)(gg(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),_g=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>vg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:gg(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Ag={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ng={asc:"asc",desc:"desc"},Pg=Ag.entityLabel,Rg=Ng.asc,Sg=(0,l.always)(0),wg=e=>{let{sortField:t=Pg,sortOrder:r=Rg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Ag.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return eP.strings.sort(t,a,o)})(n,r);case Ag.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return eP.strings.sort(e,i,a)})(r);default:return Sg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Ig=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ng)),l.identity,(0,l.always)(Rg))),Ug=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ag)),l.identity,(0,l.always)(Pg)));var Cg=r(91104);let Dg;const Lg=(e,t)=>(Dg||(Dg=Cg.createClient({key:t})),new Promise((t=>{Dg.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)}))}))),jg=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},kg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(_s).flatMap((e=>{let r;return e.type==t&&(r=[jg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(kg(e.value,t))),r})),Fg=e=>e&&e.length>0,Mg=(e,t)=>[].concat(e&&e.attributes?kg(e.attributes,t):[]).filter(l.identity);function xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $g=(e,t,r,n,i,a)=>{if(e&&e.type){const t=cn(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){xg(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Mg(e,t.latitude),n=Mg(e,t.longitude),Fg(r)&&Fg(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(Fg(t)&&t[0].value&&Fg(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?Lg(n.label,a).catch((()=>null)):Promise.resolve(null)},Vg=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=cn(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 $g(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?Lg(a.label,r).catch((()=>null)):e)).then((e=>ne(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)))},Gg=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=cn(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Ir(e,r.latitude,t.type)&&Ir(e,r.longitude,t.type)){const e=Mg(t,r.latitude),n=Mg(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))},Wg=(e,t,r)=>Promise.all([Gg(e,t),Vg(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 Bg(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){Yg(e,t,r[t])}))}return e}function Yg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qg=(e,t)=>t.values.map(Co(e,t.entityTypeUri)),Hg=(e,t,r)=>pl(t.fieldName,r)||Ir(e,et(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Jg=(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?Lv(e,t):e}),r)},Qg=(0,l.path)(["attrType","label"]),Kg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Bg({},e,{[t]:!0})),{});e[r]=e[r]?Bg({},e[r],n):n}return e}),{}),Xg=(0,l.pipe)((0,l.prop)("values"),E),zg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",qn.type.name)),Zg=e=>e.type===r_.NUMERIC_RANGE_FACET,e_=e=>e.type===r_.DATE_RANGE_FACET,t_=(0,l.either)(Zg,e_),r_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},n_=e=>{switch(null==e?void 0:e.name){case qn.type.name:return r_.ENTITY_TYPE_FACET;case qn.createdBy.name:case qn.updatedBy.name:case qn.sourceSystems.name:case qn.tags.name:case qn.roles.name:case qn.matchRules.name:case qn.MLRecommendedMatch.name:return r_.WITH_DROPDOWN_CHECKBOXES_FACET;case qn.createdTime.name:case qn.updatedTime.name:case qn.startDate.name:case qn.endDate.name:return r_.DATE_RANGE_FACET;case qn.matches.name:case qn.matchScore.name:return r_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return r_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return r_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return r_.DATE_RANGE_FACET;default:return r_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},i_=(0,l.pipe)(Hg,n_),a_=(0,l.pipe)((0,l.path)(["attrType","type"]),$r),o_=(0,l.cond)([[Zg,(0,l.always)(hn.IN_RANGE)],[e_,(0,l.always)(hn.WITHIN)],[(0,l.allPass)([a_,e=>e.values.length>=2]),(0,l.always)(hn.EXISTS)],[l.T,(0,l.always)(hn.EQUALS)]]),s_=(0,l.cond)([[e_,(0,l.prop)("values")],[Zg,(0,l.prop)("values")],[a_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function l_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u_=(0,l.pipe)((0,l.path)(["attrType","type"]),Lr),c_=(0,l.pipe)((0,l.path)(["attrType","type"]),Fr),p_=(0,l.pipe)((0,l.prop)("attrType"),yl),d_=(0,l.pipe)((0,l.prop)("attrType"),dl),y_=e=>t=>t.values.map((t=>cn(e,t).label)).join(" , "),f_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),T_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(de().number),f_)),(0,l.join)(","))(e.values);return`${Qg(e)}: ${t}`},E_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),f_)),(0,l.join)(","))(e.values);return`${Qg(e)}: ${t}`},m_=e=>t=>`${Qg(t)}: ${qg(e,t).join(", ")}`,h_=e=>t=>{const r=Jg(e,t);return`${Qg(t)}: ${r.join(", ")}`},b_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[d_,y_(e)],[c_,T_],[u_,E_],[p_,m_(e)],[l.T,h_(t)]]),r))),O_=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((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){l_(e,t,r[t])}))}return e}({},t,{attrType:Hg(e,t,n)}))),b_(e,r))(t),v_=new RegExp(`^${de().text("Search")}`),g_=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...O_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(v_,"",u)]},__=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Rn),A_=e=>(e=>__.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]=nc(t);return e.replace(r,i).replace(n,a)}),e))(e),N_=(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}`})),P_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},R_=e=>[P_.geoPolygon,P_.onMapMove].includes(e),S_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},w_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},I_=(e,t)=>R_(e)?t.map(S_):[w_(t)],U_=e=>R_(e)?de().text("Geo Polygon"):de().text("Geo Location"),C_=e=>{switch(e){case P_.geoLocation:return"geoLocation";case P_.geoPolygon:case P_.onMapMove:return"geoPolygon"}},D_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},L_=e=>de().text(e),j_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[hn.EQUALS]:"=",[hn.NOT_EQUALS]:"≠",[hn.STARTS_WITH]:"*",[hn.MISSING_VALUE]:de().text("missing value"),[hn.HAS_ALL]:de().text("has all"),[hn.IN_RANGE]:de().text("in range"),[hn.FULL_TEXT]:de().text("full text"),[hn.EXISTS]:de().text("exists"),[hn.COUNT_EQUALS]:`${de().text("count")} =`,[hn.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[hn.COUNT_LT]:`${de().text("count")} <`,[hn.COUNT_LTE]:`${de().text("count")} <=`,[hn.COUNT_GT]:`${de().text("count")} >`,[hn.COUNT_RANGE]:de().text("count range"),[hn.LT]:"<",[hn.LTE]:"<=",[hn.GT]:">",[hn.GTE]:">=",[hn.IN_FILE]:de().text("in file"),[hn.NOT_IN_FILE]:de().text("not in file"),[hn.CONTAINS]:"~",[bn.LIST_EQUALS]:"=",[bn.NOT_LIST_EQUALS]:"≠",[bn.LIST_EQUALS_CASE_SENSITIVE]:"=",[bn.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},k_=e=>({type:D_.operator,text:e}),F_=e=>({type:D_.operator,text:L_(e)}),M_=e=>({type:D_.attributeLabel,text:e}),x_=e=>({type:D_.specialAttributeLabel,text:e}),$_=e=>({type:D_.attributeFilter,text:j_(e)}),V_=e=>({type:D_.attributeValue,text:e}),G_=e=>({type:D_.entityTypeLabel,text:e}),W_=()=>({type:D_.space,text:" "}),B_=()=>({type:D_.bracket,text:"("}),Y_=()=>({type:D_.bracket,text:")"}),q_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),H_=(0,l.curry)(((e,t)=>t.map(q_(e)))),J_=(0,l.curry)(((e,t,r)=>[e,...r,t])),Q_=J_(B_(),Y_()),K_=J_(W_(),W_()),X_=(0,l.curry)(((e,t)=>[e,...t])),z_=e=>X_(G_(e)),Z_=e=>X_(G_(`${e}: `)),eA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Cu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Iu(s),a=Uu(s);!r&&t&&n&&(i.push(B_()),r=!0),i.push(o),r&&a&&(i.push(Y_()),r=!1);const l=e?F_(s):k_(s);i.push(...K_([l]))}else i.push(o),r&&(i.push(Y_()),r=!1)}return i}},tA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),rA=(0,l.pipe)(eA({localizable:!1}),tA),nA=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},iA=e=>{let{data:t,values:r,filter:n}=e;return t&&Pc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},aA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(iA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),oA=(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)&&Pr(e.data.attrType)})(e)&&[hn.HAS_ALL,hn.EQUALS,hn.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Nr((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})))),$v),sA=(e,t)=>(0,l.pipe)(oA,Vv(t))(e),lA=(0,l.pathEq)(["data","fieldName"],qn.type.name),uA=(0,l.path)(["data","entityTypeUri"]),cA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),pA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(vs(e)),attributes:(0,l.filter)((0,l.pipe)(uA,(0,l.anyPass)([l.isNil,vs(e),r=>{const n=(t.entityTypes||[]).filter(vs(e));return(n.length>1?Tn(e,n):null)===r&&!!cn(e,r)}])))})(t))))),dA=e=>(0,l.pipe)((0,l.prop)("filter"),mu,(0,l.equals)(e)),yA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=pl(n.fieldName)||n.attrType,s=Xu(o,i),u=Gv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Pr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Lv(a.lookupCode,a.value):kv(r,Nr(o),a)],[()=>yl(s),()=>Co(e,n.entityTypeUri,a)],[()=>fl(s),()=>es(e,a)],[()=>Ol(s),()=>ns(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Fr(c)||$r(c)),qu),V_)()})),fA=(e,t,r,n)=>{const i=yA(e,t,r,n.data,n.filter);return(0,l.cond)([[dA(0),(0,l.always)([])],[(0,l.both)(dA(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[W_(),i(r),{type:D_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[W_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),H_({type:D_.punctuationMark,text:", "}))(t)]}]])(n)},TA=(e,t)=>{const r=!!pl(e.data.fieldName);return(0,l.pipe)(nA,r?x_:M_)(e,t)},EA=(e,t,r,n,i)=>[TA(n,i),W_(),$_(n.filter),...fA(e,t,r,n)],mA=(0,l.addIndex)(l.map),hA=(0,l.propEq)("length",1),bA=(0,l.propSatisfies)((0,l.lt)(1),"length"),OA=(0,l.complement)(l.isEmpty),vA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(ju,(0,l.filter)(iA),ku,(0,l.map)((n=>({operand:EA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,eA()))(n)},gA=(0,l.pipe)(vA,l.flatten),_A=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Op(e,{type:t}))).join(", ");return r?t(r):l.identity},u=vA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(z_),(0,l.pipe)(s(Z_),(0,l.unless)((()=>hA(u)||i),Q_)))(u)},AA=(e,t,r,n)=>(0,l.pipe)(ju,(0,l.filter)(aA),ku,mA(((n,i,a)=>({operand:_A(e,t,r,n,hA(a)),operator:n.operator}))),eA(),l.flatten)(n),NA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),eA(),l.flatten),PA=e=>{let{searchType:t,values:[r]}=e;return I_(t,r).join(", ")},RA=(e,t,r,n,i,a)=>{const o=(e=>e?[x_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...K_([$_(hn.EQUALS)]),V_(`"${e.value}"`)]:[])(i),s=(e=>e?[x_(U_(e.searchType)),W_(),V_(PA(e))]:[])(a),u=(0,l.pipe)(AA,(0,l.when)((e=>bA(e)&&(OA(o)||OA(s))),Q_))(e,t,r,n);return NA([o,s,u])},SA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),wA=(0,l.pipe)(RA,SA),IA=(0,l.has)("attributes"),UA=Array.isArray,CA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),DA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=LA(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)(CA(a))),Q_),(0,l.concat)(K_([k_(o)]))))(s)},LA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return IA(n)?DA(e,t,r,n,i):UA(n)?n.reduce(((n,a)=>n.concat(LA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(K_([k_(n.operator)])))(EA(e,t,r,n,i))},jA=(e,t,r,n,i)=>(0,l.pipe)(LA,l.flatten)(e,t,r,n,i);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){FA(e,t,r[t])}))}return e}function FA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MA=(0,l.complement)(lA),xA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(lA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(uA),(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}},$A=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=xA(t);return(r||n)&&Du(t)},VA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)($A)),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(lA).some((0,l.propEq)("filter",hn.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}=xA(r);if($A(e))t.push(kA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(MA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(lA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(uA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(MA),entityTypes:n,operator:i?a:e.operator,id:(0,Ce.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),GA={[hn.EQUALS]:hn.ON,[hn.IN_RANGE]:hn.WITHIN,[hn.GTE]:hn.AFTER,[hn.GT]:hn.AFTER,[hn.LTE]:hn.BEFORE,[hn.LT]:hn.BEFORE},WA=(0,l.curry)((e=>GA[e]||e)),BA=(0,l.curry)(((e,t)=>{switch(e){case hn.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case hn.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),YA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Lr),qA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>kA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return YA(e)?(0,l.evolve)({filter:WA,values:BA(t)},e):e}))})))})),HA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Zu),(0,l.map)(nc))}),JA=(0,l.map)((0,l.cond)([[YA,HA],[l.T,l.identity]])),QA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),VA,pA(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")),JA)})),qA,(0,l.reject)(cA))(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){XA(e,t,r[t])}))}return e}function XA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zA=(e,t)=>({data:{uri:it(e.fieldName)?et(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||o_(e),id:(0,Ce.x0)(),values:s_(e)}),ZA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=pl(a,t,r)||Ir(e,i);if(!s)return null;if(Er(s))return KA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Op(e,{type:o}),i=(wr(e,et(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]})}})),eN=(0,l.curry)(((e,t,r,n)=>QA(ZA,e,n,t,r)));function tN(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){rN(e,t,r[t])}))}return e}function rN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},iN=e=>"rdmLookups.not.resolved"===e?qn.notResolved.name:e,aN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===_n?hn.IN_RANGE:An(a),u=iN(n),c=pl(u)||Ir(e,i),p=(0,l.cond)([[()=>vu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>tN({},e,{filename:Uv(e)}))))],[()=>$r(null==c?void 0:c.type),(0,l.map)(le)],[e=>bu(s)&&!Array.isArray(e[0])&&!Lr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,Ce.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===_n?"and not":"and",filter:s,values:p}})),oN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(aN(e,Tn(e,i)));return[{id:(0,Ce.x0)(),operator:"or",attributes:a,entityTypes:i}]})),sN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),lN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([sN("from"),sN("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,()=>[]]]),uN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return tN({},r,{values:lN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ol(e.fieldName,n):e.fieldName})},cN=(e,t)=>{if((0,l.has)("children")(e)){const r=uN(e,t);return e.children.reduce(((e,n)=>(e.push(cN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return uN(e,t)},pN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(uN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(tN({fieldName:e.fieldName},uN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(cN,l.flatten)],[l.T,uN]]),dN=(0,l.pipe)((0,l.map)(pN),l.flatten),yN=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},fN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=oN(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:dN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>tN({},t,{type:i_(e,t)}))).map((e=>tN({},e,{values:t_(e)?yN(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 zA(r,t)})),operator:"or",id:(0,Ce.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=>({[iN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[tN({},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 eN(e,t,r,p)},TN=(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)(Xg),(0,l.partition)(zg))(t),i=n.map((t=>KA({},t,{type:i_(e,t)}))).map((e=>zA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Ce.x0)(),entityTypes:a}]})(e,a);return eN(e,t,r,o)})(e,t,r,n):fN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},EN=e=>"2.0"===e.version?e.keyword:nN(e),mN=e=>(0,l.pathEq)(["object","uri"],e),hN=(e,t)=>(0,l.pipe)((0,l.find)(mN(e)),(0,l.prop)("object"))(t),bN=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"),mN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=hN(r.match,t)||n[r.match];return i?{label:zc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Uo(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)},ON=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),vN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),gN=(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:zc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Uo(e,o.type,t)||{label:t,uri:t}}))}})))(t),_N=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)},AN=(0,l.path)(["object","uri"]),NN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},PN=e=>e.getValue(),RN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=RN(n[e],t),!r);e++);return r},SN=(e,t)=>{const r=[],n=(0,l.pipe)(PN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(SN,[t]),a);return r.push.apply(r,o),r};function wN(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){IN(e,t,r[t])}))}return e}function IN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UN=(e,t)=>!!e[t],CN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},DN=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||[]])},LN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return wN({},t,{[r.uri]:wN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:DN(null==o?void 0:o.parents,n),children:DN(null==o?void 0:o.children,i),values:DN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},jN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=cn(r,t)||ki(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return cs(r,n,i).flatMap(ds).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Ir(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=LN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>LN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},kN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Ge(e.uri)&&Je(e.type)&&Je(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ms(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(_s),(0,l.map)(CN))(i);return LN({structure:e,attrType:e[t].attrType,values:a})}),t)},FN=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 UN(e,r)}));return r||n?t.filter(_s).reduce(((e,t)=>FN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return UN(t,e.type)?LN({structure:t,attrType:t[e.type].attrType,values:[CN(e)]}):t}},MN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?wN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},xN=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ms(i,n,r)||[];return a.length?LN({structure:t,attrType:t[r].attrType,values:a.filter(_s).map(CN)}):t},$N=(e,t,r)=>{const n=Ye(e),i=Ye(t);return n===i?((e,t)=>{const r=st(t),n=st(e);return Ke(n,r)||((e,t)=>at(e)&&!at(t)&&Ke(t,e))(n,r)})(e,t):!(!r||!ot(t))&&uh(r,i).includes(n)},VN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},GN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?sh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return $N(r,t,o)}))},WN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>WN(e,t,r)))))},BN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},YN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&VN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!BN(i,a)}},qN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Ye(n),p=lh(c,o,i,a),d=WN("children",t,u),y=WN("parents",t,u),f=d.flatMap((e=>WN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return $N(t,n,p)})).map((t=>YN(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 $N(n,t,p)||Ye(t)!==c&&$N(t,n,p)})).map((t=>YN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=WN("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)&&$N(n,t,p)}))})).map((t=>YN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return $N(t,n,p)})).map((e=>YN(r,n,e,s,l))),...E,...m,...T]},HN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Gv({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=>Kc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Or,()=>a(n)],[Pr,()=>(e=>{const r=o(e),n=Nr(t);return su([{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)},JN=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:hn.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(QN(r,t)):i.push(KN([t],r)),i},QN=(e,t)=>{const r=mr(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=Or(i)?QN(i,t[r]):[KN(t[r],i)];return e.push(...a),e}}),[])},KN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Ar(t.uri),filter:t.type===Xt.TYPE_BLOB?hn.FULL_TEXT:hn.EQUALS,values:e}:{fieldName:Ar(t.uri),filter:hn.MISSING_VALUE},XN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),zN=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:XN}},ZN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},eP={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(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}},29524:(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
+ (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5740],{16657:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>rl,IL3:()=>pT,PY2:()=>Fn,Ng6:()=>vt,YJ7:()=>Un,NlI:()=>On,XYV:()=>Sn,Xt7:()=>Tt,wfT:()=>bi,EMD:()=>li,HAc:()=>mt,PEf:()=>Gn,oA3:()=>si,$XE:()=>Ft,eWf:()=>$n,q7e:()=>ht,KVe:()=>Oi,WVQ:()=>qr,oZZ:()=>Si,bNA:()=>wi,Rjq:()=>Ii,G39:()=>Bn,W0P:()=>qt,X1H:()=>Wt,hdG:()=>Qt,ws7:()=>Kt,VI$:()=>Jt,yn8:()=>Dt,N0y:()=>Ct,dZX:()=>Mt,bQt:()=>Ci,oS0:()=>zt,KfU:()=>Et,bZE:()=>Pn,Nsj:()=>Ln,psV:()=>In,xPW:()=>Mn,pyR:()=>fi,p8l:()=>ci,Wkf:()=>ft,zHr:()=>yt,NIO:()=>dt,$26:()=>n_,Esk:()=>ri,s9T:()=>It,MEy:()=>Gu,j5E:()=>bn,vAw:()=>oi,NMQ:()=>ai,eVu:()=>sc,YGb:()=>Yt,mNm:()=>di,Y1q:()=>fh,RgZ:()=>pi,Qy0:()=>Ui,Q26:()=>Dn,pYu:()=>ti,wIJ:()=>R_,GFH:()=>_t,Ury:()=>Yn,S91:()=>qn,p3$:()=>Li,wSh:()=>Z,BDP:()=>Yi,pGS:()=>yi,ARY:()=>Zt,XGc:()=>hi,fO_:()=>on,wwy:()=>Rt,h_8:()=>Jn,_XL:()=>Cn,j2V:()=>vi,dMV:()=>Ei,NBX:()=>PN,OXy:()=>er,BXd:()=>Lt,KM9:()=>Ot,CJB:()=>Ai,lXI:()=>Vt,C68:()=>Wn,yxQ:()=>Di,Yj_:()=>St,D25:()=>Nt,ZIY:()=>xt,Tl4:()=>L_,lwr:()=>Vn,NkU:()=>gi,Rtp:()=>mi,YGx:()=>jt,uTS:()=>Ti,MCv:()=>bt,IYE:()=>ui,PiC:()=>Ri,MVv:()=>Ht,h_m:()=>Gt,DUe:()=>Rn,tJI:()=>gt,fDt:()=>At,cNQ:()=>_i,SwE:()=>ni,ZHR:()=>Pi,PYu:()=>Bt,lD1:()=>Hn,lVm:()=>kt,vnX:()=>Rg,$x5:()=>Sg,_R1:()=>Ng,wUm:()=>Pg,dC6:()=>Ut,MBD:()=>Pt,GmF:()=>_a,cKm:()=>$t,iP_:()=>xn,NVC:()=>wt,tPT:()=>Il,tZe:()=>ST,kRE:()=>em,psB:()=>tm,X0$:()=>wl,$vY:()=>Sl,zE1:()=>$l,Wm5:()=>hl,vyX:()=>Wc,wLZ:()=>Ul,W4V:()=>se,EtK:()=>Fs,ayi:()=>Rl,asT:()=>MN,kGs:()=>Vh,ewt:()=>Pd,O_f:()=>Lu,sOy:()=>Ke,Tde:()=>Nr,LMI:()=>Pc,skb:()=>_A,sPt:()=>mc,sH1:()=>hc,lPZ:()=>Qy,bG8:()=>Jy,_LJ:()=>Ky,RPM:()=>zd,h27:()=>kc,Uqd:()=>Gc,xG:()=>kA,Z2f:()=>$v,fgW:()=>nA,I69:()=>SA,ZxB:()=>IA,dwd:()=>Hy,F$g:()=>qy,mdt:()=>nb,Qbq:()=>Rh,rny:()=>oa,UEY:()=>Ba,Q0T:()=>Wa,Lyr:()=>Xa,sBn:()=>Ga,itK:()=>Ma,H9$:()=>Va,KPc:()=>$a,zos:()=>xa,ELQ:()=>za,dZs:()=>Sa,Cz4:()=>Ra,z_L:()=>Qa,fGe:()=>Pa,iuF:()=>ka,Wib:()=>Fa,Hn0:()=>Ka,obS:()=>Za,E$L:()=>wa,XUh:()=>ja,Qp_:()=>Da,_jk:()=>Ia,sKE:()=>Ua,WmG:()=>La,QKx:()=>Ha,Oik:()=>qa,s0A:()=>Ca,o9m:()=>Ya,MCd:()=>Ja,RsS:()=>Fc,tGK:()=>uu,lIv:()=>Vl,Vg3:()=>ya,mkC:()=>ea,xv5:()=>Ta,a14:()=>ra,yv0:()=>fa,Zm0:()=>ta,Nxd:()=>Zi,$mM:()=>da,ifj:()=>Jr,NWi:()=>sg,xr3:()=>og,wNf:()=>bu,iJH:()=>lg,d89:()=>Ki,Edd:()=>Xi,Z5t:()=>zi,uGe:()=>Hi,UoR:()=>qi,xvW:()=>ag,$qe:()=>ig,yPM:()=>Na,$cp:()=>xl,vKJ:()=>Fl,VtG:()=>vf,AID:()=>Zm,B1H:()=>AN,b7X:()=>Ah,$uE:()=>Bh,keo:()=>Ph,C_p:()=>My,G27:()=>lO,JA0:()=>WE,b3T:()=>$h,oC6:()=>Mh,_Zs:()=>xh,epC:()=>qh,YYG:()=>Yh,f_2:()=>YE,w3l:()=>oN,QHB:()=>sO,Jso:()=>yN,RXH:()=>qb,Vr9:()=>mO,lMm:()=>Tv,BlA:()=>QN,fmQ:()=>ws,yRD:()=>HA,NcL:()=>By,QK6:()=>Ee,ymd:()=>cT,JV_:()=>mm,XiW:()=>Qp,Yrx:()=>IE,GPx:()=>Pl,gjI:()=>Nl,vlo:()=>Bd,E_P:()=>Xh,aAL:()=>Xf,NBq:()=>Is,wp9:()=>rb,DsR:()=>Yf,MPc:()=>jp,gWE:()=>kp,DT_:()=>Fp,ipn:()=>xp,ORg:()=>Vi,_wz:()=>Mp,RYR:()=>pd,PP2:()=>jE,wS7:()=>Qv,cBQ:()=>wf,pBq:()=>Fm,DsO:()=>ee,X78:()=>bm,xZs:()=>ym,YFy:()=>CE,Gmt:()=>am,K$w:()=>im,DSj:()=>zf,Mfr:()=>DE,k9j:()=>Uf,EjS:()=>X,ww$:()=>Cl,WVU:()=>nm,hxF:()=>Ol,n6p:()=>an,E7G:()=>Cp,nwO:()=>eP,Mzk:()=>Af,aFF:()=>Dh,HRH:()=>Yu,EZK:()=>tp,Kxm:()=>Xc,Z9i:()=>Ey,CrF:()=>KE,DNd:()=>to,vUy:()=>WN,lJh:()=>Qu,zHo:()=>Ku,sEJ:()=>SN,UO$:()=>Wm,zeJ:()=>Ur,dLR:()=>Vs,JQy:()=>Zs,XtP:()=>xs,Ug0:()=>En,A1W:()=>Nh,sw:()=>ep,nv3:()=>Eg,JgD:()=>Tg,nve:()=>wN,SkP:()=>el,SAs:()=>xm,i5L:()=>tl,PWK:()=>es,IM5:()=>$s,Aup:()=>EO,Mfk:()=>hv,HQx:()=>fs,oN$:()=>ys,mB6:()=>Wv,p6d:()=>w,o0x:()=>U,ufS:()=>Iv,k7L:()=>Uv,mrB:()=>I,OuZ:()=>rp,ncP:()=>Be,FQ2:()=>np,W$R:()=>ip,JOV:()=>Me,Zmi:()=>xe,hm5:()=>Ve,ECL:()=>Xr,vPL:()=>ap,qmL:()=>yh,hPi:()=>jm,hXd:()=>la,OCS:()=>ua,p2l:()=>il,qF1:()=>dT,_X$:()=>yT,yj2:()=>__,bzh:()=>ob,k66:()=>cs,kiP:()=>Po,pSg:()=>ce,kz_:()=>xE,H_U:()=>ds,t9e:()=>lo,j2$:()=>wT,PFL:()=>fr,aJ3:()=>Jg,To9:()=>Pr,wpo:()=>Np,ADq:()=>py,UUb:()=>uy,tQX:()=>cy,xy8:()=>hr,EUG:()=>Cr,AFK:()=>rt,X3M:()=>Ir,WN0:()=>ps,kDl:()=>Gs,uDV:()=>dh,IhQ:()=>Js,pfb:()=>Ks,R$r:()=>Kh,w80:()=>Go,Pfu:()=>oo,Gtj:()=>eu,fyF:()=>Zl,kkq:()=>us,u5q:()=>Ye,O$n:()=>_p,ptG:()=>Ap,f4_:()=>Tb,uap:()=>fb,d7q:()=>wE,liG:()=>kE,$oF:()=>SE,avf:()=>Ld,DiQ:()=>Dd,cfX:()=>Cd,vD3:()=>kd,Qrb:()=>Ud,EJQ:()=>jd,HWy:()=>Id,gjS:()=>fd,y6v:()=>wd,JUW:()=>qE,GtP:()=>Sb,_kX:()=>no,u1e:()=>io,sJj:()=>Ih,CJp:()=>Pb,uKF:()=>wh,wo0:()=>ZE,s5:()=>ns,cwx:()=>rs,Y6b:()=>hE,TTx:()=>um,UtR:()=>bE,HaQ:()=>cm,E6I:()=>QE,Won:()=>vE,vTU:()=>EE,Nsy:()=>yp,KMQ:()=>Ch,Do$:()=>mp,CSV:()=>sl,TMe:()=>OE,l1V:()=>zu,RHh:()=>oc,VQ1:()=>ic,cGG:()=>nc,z7d:()=>Yd,Xaq:()=>ms,Sj8:()=>HN,PJj:()=>ou,k3T:()=>hn,PjQ:()=>Wi,s7l:()=>Tf,jLA:()=>wb,GGR:()=>$d,j5q:()=>Md,DnY:()=>df,RY5:()=>oh,Px$:()=>dd,KPC:()=>vN,NIY:()=>gf,HvW:()=>mf,Fof:()=>uo,BXy:()=>hf,fX:()=>Ib,BTI:()=>bp,uie:()=>lp,q27:()=>Rp,vrC:()=>IO,fAQ:()=>_m,XkT:()=>pf,lrH:()=>Am,nt9:()=>pn,XH8:()=>gp,XH2:()=>mn,jFi:()=>vp,qhs:()=>Vo,wwR:()=>hp,Uk3:()=>nt,$Rg:()=>pt,ev7:()=>NN,RB9:()=>GE,iFp:()=>ey,e$p:()=>ry,PcX:()=>ny,SpP:()=>ty,R6_:()=>Kg,CY1:()=>i_,Ajk:()=>of,Yiz:()=>af,FK9:()=>zy,UOo:()=>Cv,aTW:()=>sm,uug:()=>hu,P$2:()=>s_,XS2:()=>cu,Hyb:()=>Iu,d3Y:()=>Hc,Klp:()=>Qc,WxZ:()=>l_,Gzu:()=>Xu,ZOr:()=>cf,uqV:()=>yE,Pm4:()=>re,hWO:()=>Ze,nHA:()=>hb,nVD:()=>lh,_tF:()=>cc,dED:()=>PE,P2h:()=>NE,jrr:()=>go,mmY:()=>Ao,T6O:()=>Ts,h6J:()=>NT,hM2:()=>EN,XR6:()=>z,jmz:()=>ph,IHt:()=>ch,NZI:()=>Ty,wdF:()=>vm,YNv:()=>_h,IFm:()=>gh,o_F:()=>Eh,kgP:()=>gm,ZYI:()=>oT,QXK:()=>Ql,efz:()=>Kl,Q5d:()=>Jl,Ysv:()=>Xl,UWq:()=>Jd,ocC:()=>Hd,io3:()=>fn,Sbt:()=>Bo,roS:()=>Wo,Ww1:()=>Yo,QaS:()=>Nf,wsP:()=>Oe,ERZ:()=>iN,CL1:()=>mN,idV:()=>Zc,nIW:()=>ze,fjE:()=>Xg,sG0:()=>jv,tV7:()=>su,g8o:()=>C_,Qy:()=>U_,t2P:()=>Hg,KbW:()=>Uo,wId:()=>Do,LS0:()=>Lo,bFH:()=>eE,Rgl:()=>rE,fW1:()=>sb,GFW:()=>pm,Ywp:()=>vg,pg:()=>kT,WSA:()=>nE,fed:()=>fN,tT_:()=>Qs,BgZ:()=>Xs,xIV:()=>zs,KbL:()=>ff,JBA:()=>st,aNC:()=>fg,RFJ:()=>aT,Zeh:()=>Gm,OT5:()=>Og,mC3:()=>Wl,kR6:()=>JN,gFw:()=>Eb,NVY:()=>eb,k6v:()=>fT,FEC:()=>TT,L5S:()=>zh,Ob5:()=>Sp,KUV:()=>wp,dvH:()=>Zh,V3i:()=>OO,VD3:()=>Tn,mm2:()=>rc,rou:()=>Um,izH:()=>ao,DK$:()=>so,KMp:()=>Kf,c31:()=>nr,mbo:()=>yy,gT8:()=>or,CZ8:()=>Rs,uGi:()=>Ds,Poc:()=>tr,_9k:()=>ks,ZTM:()=>Us,bwT:()=>Ls,tzW:()=>lr,tF$:()=>ar,o96:()=>Ss,M4S:()=>js,_vs:()=>Wf,xF8:()=>Td,PUO:()=>Lh,ATu:()=>dy,j1S:()=>xi,V3K:()=>Fi,Lmx:()=>Mi,oSN:()=>Bi,ZaZ:()=>rr,n_1:()=>TE,N6e:()=>Hf,SxO:()=>_o,w3p:()=>tb,xU7:()=>fe,Y_p:()=>Jo,$k6:()=>Ho,Gdl:()=>Fv,U6P:()=>kv,OwB:()=>Qg,hTh:()=>uh,xqc:()=>is,JvE:()=>as,i29:()=>Uc,dzT:()=>ia,uPS:()=>Sf,cZV:()=>Rf,n3B:()=>cA,e6O:()=>iA,s7j:()=>P_,j$Q:()=>HE,PeS:()=>Ry,kW2:()=>Rb,tH7:()=>ts,Yxg:()=>dl,MaZ:()=>xd,nqN:()=>Fd,jWj:()=>Kd,o_J:()=>hs,yW4:()=>PT,uT0:()=>_T,C82:()=>AT,bsH:()=>mb,u9Z:()=>Im,LCU:()=>dm,J$m:()=>fE,j_Q:()=>ef,OaI:()=>tf,wB1:()=>_N,SP6:()=>jT,ZYr:()=>ON,IMU:()=>iT,FoU:()=>BE,DVz:()=>Gv,mxe:()=>lA,FHr:()=>$m,D1g:()=>Cm,VO3:()=>Cg,de5:()=>Ug,Uw1:()=>be,J6q:()=>fy,XCe:()=>bo,fbl:()=>gg,Ir:()=>wo,XQO:()=>Io,QXb:()=>HT,zXF:()=>Th,P8_:()=>Tm,iiD:()=>Qf,MOC:()=>JT,WF:()=>qT,xE1:()=>Gi,idW:()=>kN,QWZ:()=>gv,YL3:()=>_f,NW9:()=>wv,D_E:()=>Te,Fn9:()=>T,j2U:()=>nl,MpE:()=>ur,kQw:()=>Er,mfm:()=>Uu,vZp:()=>it,Wah:()=>hy,E8K:()=>CN,VSb:()=>Ns,vr_:()=>Tr,Vmh:()=>GN,FgW:()=>bO,oDv:()=>Os,fGG:()=>_v,kuw:()=>gs,eHk:()=>Qd,Tt2:()=>bs,pQZ:()=>_s,oZ7:()=>Av,T6Y:()=>Vr,VRd:()=>ut,_26:()=>Ru,YkM:()=>Ar,J6y:()=>yu,njU:()=>vu,TBP:()=>vs,IT0:()=>my,x_:()=>Uh,FP6:()=>ct,biM:()=>Tp,TMl:()=>Ep,Vkd:()=>Au,WiY:()=>t_,_zi:()=>Nu,RZp:()=>Yy,J6D:()=>tc,Lt4:()=>jr,QEi:()=>Sr,whI:()=>ln,KIu:()=>cn,JhM:()=>oe,C_0:()=>Br,lzc:()=>Up,qIF:()=>pA,O27:()=>E,aBi:()=>Pp,xOX:()=>ml,EdS:()=>Je,WgC:()=>He,eEv:()=>dr,A4t:()=>gu,YOQ:()=>ot,Wos:()=>xr,jWr:()=>eo,Or$:()=>_r,lhE:()=>yn,CwH:()=>Rr,pzC:()=>fl,ymH:()=>Ou,QZu:()=>vr,rYH:()=>e_,FVt:()=>Mr,Kn2:()=>ue,jgw:()=>Cu,Qgr:()=>ec,OXP:()=>As,nsY:()=>oy,vyG:()=>iy,lS4:()=>wr,g5f:()=>r_,fp6:()=>Eu,Uty:()=>ha,YkG:()=>gr,xdS:()=>sr,kMF:()=>$p,$NE:()=>Qe,bC9:()=>qe,Ian:()=>$i,KVV:()=>Sh,q9e:()=>qo,iIf:()=>Mv,ian:()=>vl,m6e:()=>Yr,OFd:()=>Tl,kqr:()=>mr,fnZ:()=>sn,VFZ:()=>gl,ZiX:()=>Ge,j5n:()=>kr,zkt:()=>_,Pcm:()=>gN,QDV:()=>yl,M5u:()=>Zg,laD:()=>uA,mtq:()=>pr,CtB:()=>xv,CBv:()=>ae,I0t:()=>Wr,u1G:()=>Wd,gk1:()=>oA,Bgb:()=>aA,uzs:()=>un,v0l:()=>fc,Zqp:()=>gE,j0k:()=>Zo,l22:()=>zN,tCm:()=>tt,gmx:()=>pu,mOr:()=>Wu,TwZ:()=>D_,GyU:()=>mg,zGm:()=>xT,bMg:()=>sE,EyD:()=>rg,FQA:()=>ng,fZN:()=>cE,xsF:()=>eg,Lxg:()=>tg,O3l:()=>Df,Wni:()=>Cf,wRx:()=>cg,OxG:()=>XT,Jwg:()=>QT,uJQ:()=>KT,qWg:()=>Vv,i96:()=>FT,NPd:()=>Ju,zhn:()=>ug,G8q:()=>ji,Jct:()=>od,A9Y:()=>te,Y5F:()=>KA,gxP:()=>le,c$P:()=>du,M7o:()=>Vc,BBN:()=>vo,fS6:()=>Nd,ZBU:()=>K,UkJ:()=>jo,xkv:()=>fm,z$M:()=>FN,KAm:()=>VE,lCl:()=>eh,rkF:()=>xy,IU6:()=>LT,RGr:()=>h,aYu:()=>m,ije:()=>iu,Buf:()=>Jf,YLu:()=>nu,ct9:()=>Ko,XkY:()=>lE,T5R:()=>$T,uQS:()=>pE,wcJ:()=>Qo,d$I:()=>Dl,rSp:()=>fp,Sx:()=>Of,Ilm:()=>Gl,Ki6:()=>bl,VGk:()=>Bf,sFD:()=>Hb,eWN:()=>xN,dWE:()=>N_,Lkd:()=>Kp,aDL:()=>Bm,yaA:()=>dE,lOh:()=>Lm,DBr:()=>Bg,hK$:()=>lu,TZ_:()=>DT,CMB:()=>dA,FU8:()=>bf,J$p:()=>Jm,b5s:()=>Hm,h2W:()=>et,SL_:()=>Rm,oUH:()=>OT,ck9:()=>VT,RAb:()=>uc,nL:()=>Lv,k$p:()=>Qb,Xs0:()=>ru,u7I:()=>Dm,rxg:()=>ku,bji:()=>Fu,oCZ:()=>Ly,MjG:()=>Ig,FuV:()=>bT,$ju:()=>gT,t6d:()=>vT,m5F:()=>he,sx:()=>$N,rSc:()=>Bv,U10:()=>rf,L8n:()=>rm,R9X:()=>mE,rj2:()=>hm,_C4:()=>IT,tCj:()=>Em,uAg:()=>UE,wx9:()=>Rd,KF3:()=>UT,ax9:()=>CT,HH7:()=>qf,ufV:()=>LE,_6y:()=>If,XTh:()=>Ag,AJo:()=>Pf,Ixr:()=>JE,oss:()=>ZN,P6Y:()=>tP,q5j:()=>Sy,Bd_:()=>Iy,xkB:()=>wy,W41:()=>wm,WkI:()=>Sm,sSE:()=>Py,GMd:()=>Rc,jtL:()=>Sc,Bxm:()=>Cy,FVh:()=>vy,U_T:()=>iE,FTe:()=>ie,VGB:()=>ne,tM8:()=>Mu,Wfe:()=>Hu,Ls5:()=>qu,$bd:()=>$u});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:()=>g,durationToTimestamp:()=>X,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>Q,getMomentFormatFromTimeMask:()=>J,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>K,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ae,editAttribute:()=>Ne,editEndDate:()=>Ue,editRoles:()=>Se,editStartDate:()=>Ie,editTags:()=>we,removeAttribute:()=>Re});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>Vh,collectCrosswalksFromAttributes:()=>Bh,compareActivenessAttributes:()=>$h,compareAttributes:()=>Mh,compareImages:()=>xh,compareRoles:()=>qh,compareTags:()=>Yh});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Qh});var l=r(17440);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=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;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},N=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)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),D=(0,l.equals)("99"),L=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[D,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[D,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[D,(0,l.always)("YY")],[L,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),D),(0,l.always)("hh")],[C,(0,l.always)("H")],[D,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[D,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[D,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(Y)];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)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/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),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?B(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},Q=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${J(r)}`},K=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>{const[t,r]=e;return f()().subtract(t,r).valueOf()},z=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0";class Z{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)?Z.None():Z.Some(e(this.value))}static Some(e){return new Z(e)}static None(){return new Z(null)}static fromFalsy(e){return e?Z.Some(e):Z.None()}static fromNull(e){return(e=>null==e)(e)?Z.None():Z.Some(e)}static fromUndefined(e){return void 0===e?Z.None():Z.Some(e)}static fromEmpty(e){return E(e)?Z.None():Z.Some(e)}}const ee=(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)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>oe(e=e||"")?`mailto:${e}`:!e.includes("://")&&(e.toLowerCase().startsWith("www.")||e.split(".").length>2)?`http://${e}`:e,le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=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)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t};var pe=r(87918),de=r.n(pe);const ye=(0,l.when)((0,l.is)(Object),JSON.stringify),fe=(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 de().text("Bad Request");case 403:return de().text("Forbidden");case 404:return de().text("Not Found");case 405:return de().text("Method Not Allowed");case 408:return de().text("Request Timeout");case 500:return de().text("Internal Server Error");case 502:return de().text("Bad Gateway");case 503:return de().text("Service Unavailable");case 504:return de().text("Gateway Timeout");default:return t||de().text("Something went wrong")}})(e,t)))],...n.map((e=>[(0,l.prop)(e),(0,l.pipe)((0,l.prop)(e),ye)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,ye]])(e)},Te=e=>"AbortError"===e.name,Ee=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)},me=/[\n\r%#()<>?[\\\]^`{}|]/g,he=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(me,encodeURIComponent)}`,be=e=>`data:image/gif;base64,${e}`,Oe=e=>{switch(e){case"minutes":return de().text("minutes");case"hours":return de().text("hours");case"days":return de().text("days");case"weeks":return de().text("weeks");case"months":return de().text("months");case"years":return de().text("years");default:return""}};var ve=r(76665);function ge(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 - ${ue(n)?JSON.stringify(n):n}\n `;console.error(i)}var 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 _e(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(ge(r[i],r[i+1],e,t));return n}function Ae(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=_e(r,t)[a];if(!s){const s=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){e[s.name]||(e[s.name]=[{uri:s.valueUri,value:{},type:s.uri}]);var l=e[s.name].filter((function(e){return e.uri===s.valueUri}))[0];return Ae(l.value,t,r,n,i,a+1,o)}var u=e[t.name];if(u||(u=e[t.name]=[]),null!=n){var c={value:n.refEntity?n.value:n,uri:r,type:t.uri};return n.lookupCode&&(c.value=n.value,c.lookupCode=n.lookupCode),n.refEntity&&(c.refEntity=n.refEntity,c.label=n.label),n.refRelation&&(c.refRelation=n.refRelation),i&&(c.crosswalks=i),u.splice(o||0,0,c),n}}function Ne(e,t,r,n,i,a){void 0===a&&(a=0);var o=_e(r,t)[a];if(!o){const o=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){var s,l=e[t.name],u=l&&l.filter((function(e){return e.uri===r}))[0];return u?("[object Object]"!==u.value.toString()?(Pe(n,u),i&&(u.crosswalks=i),t.cardinality&&1===t.cardinality.minValue&&1===t.cardinality.maxValue&&l.filter((function(e){return!1===e.ov})).forEach(Pe.bind(null,n))):n.refEntity?(u.refRelation=n.refRelation,u.refEntity=n.refEntity,u.value=n.value,u.label=n.label):null!==n.value&&void 0!==n.value&&null!==u.value&&"object"==typeof u.value&&(u.value=n.value,u.label=n.label),s=u.value):s=Ae(e,t,r,n,i,a),s}var c=Ne(e,o,o.valueUri,{},i,a);Ne(c,t,r,n,i,a+1)}function Pe(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Re(e,t,r,n){void 0===n&&(n=0);var i=_e(r)[n];if(!i){const i=`\n getInfoByUri(uri, attrType)[nestingLevel] returned undefined.\n getInfoByUri(uri, attrType): ${JSON.stringify(_e(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){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Re(a.value,t,r,n+1)}else{var o=e[t.name];o&&(o.forEach((function(e,t){e.uri===r&&o.splice(t,1)})),0===o.length&&delete e[t.name])}}function Se(e,t){e.roles=t||[]}function we(e,t){e.tags=t||[]}function Ie(e,t){e.startDate=t||""}function Ue(e,t){e.endDate=t||""}var Ce=r(37164);const De="1Tempo4rary",Le="1Tepmo4Rel",je=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ke=(0,Ce.kP)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",16),Fe=()=>`${ke()}${Date.now()}`,Me=()=>`1Tempo4DCR${Fe()}`,xe=e=>`${e}/uri$$${Fe()}`,$e=e=>()=>xe(e),Ve=(e,t)=>{const r=je(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return xe(n)},Ge=e=>e&&e.includes("uri$$"),We=$e("entities"),Be=$e("relations"),Ye=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),qe=(0,l.startsWith)("relations/"),He=(0,l.startsWith)("entities/"),Je=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Qe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ke=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Xe=(0,l.pipe)((0,l.split)("/"),l.head),ze=(0,l.pipe)((0,l.split)("/"),l.last),Ze=e=>e.split(".").slice(0,2).join("."),et=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},tt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),rt=(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("/")},nt=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},it=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),at=e=>{const t=e.startsWith("configuration/")?3:2;return e.split("/").length===t},ot=e=>5===e.split("/").length,st=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},lt=e=>e.replace(/uri\$\$/g,De),ut=e=>null==e?void 0:e.startsWith("changeRequests/"),ct=e=>ut(e)&&e.includes("/changes/"),pt=e=>e.split("/changes/")[1];let dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Pt,Rt,St,wt,It,Ut,Ct,Dt,Lt,jt,kt,Ft,Mt,xt,$t,Vt,Gt,Wt,Bt,Yt,qt,Ht,Jt,Qt,Kt;var Xt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(dt||(dt={})),function(e){e.local="local",e.validationService="validationService"}(yt||(yt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(ft||(ft={})),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"}(Tt||(Tt={})),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(Et||(Et={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(mt||(mt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ht||(ht={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(bt||(bt={})),function(e){e.asc="asc",e.desc="desc"}(Ot||(Ot={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(vt||(vt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(gt||(gt={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(_t||(_t={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(At||(At={})),function(e){e.PROFILE="profile",e.MAP="map"}(Nt||(Nt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Pt||(Pt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Rt||(Rt={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(St||(St={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(wt||(wt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(It||(It={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Ut||(Ut={})),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"}(Ct||(Ct={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Dt||(Dt={})),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"}(Lt||(Lt={})),function(e){e.IN="in",e.OUT="out"}(jt||(jt={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(kt||(kt={})),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"}(Ft||(Ft={})),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"}(Mt||(Mt={})),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"}(xt||(xt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}($t||($t={})),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"}(Vt||(Vt={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(Gt||(Gt={})),function(e){e.NEW="new",e.CLASSIC="classic"}(Wt||(Wt={})),function(e){e.ASC_BY_NAME="ascByName"}(Bt||(Bt={})),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"}(Yt||(Yt={})),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"}(qt||(qt={})),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"}(Ht||(Ht={})),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"}(Jt||(Jt={})),function(e){e.AWAITING_REVIEW="AWAITING_REVIEW",e.APPLIED="APPLIED",e.REJECTED="REJECTED"}(Qt||(Qt={})),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"}(Kt||(Kt={})),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"}(Xt||(Xt={}));const zt=Xt;let Zt,er;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Zt||(Zt={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(er||(er={}));const tr=(0,l.prop)("referencedEntityTypeURI"),rr=(0,l.prop)("relationshipTypeURI"),nr=(0,l.prop)("referencedAttributeURIs"),ir=(0,l.curry)(((e,t)=>(0,l.pipe)(nr,(0,l.filter)((0,l.startsWith)(e)))(t))),ar=ir("configuration/relationTypes"),or=ir("configuration/entityTypes"),sr=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),lr=(0,l.filter)(sr),ur=(e,t)=>!t||t.some((t=>Ke(e.uri,t)));function cr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pr=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Je),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",zt.TYPE_STRING)]),dr=(0,l.has)("values"),yr=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(zt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(zt.TYPE_LOOKUP)],[dr,(0,l.always)(zt.TYPE_ENUM)],[pr,(0,l.always)(zt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",zt.TYPE_BOOLEAN),(0,l.always)(zt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),fr=(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){cr(e,t,r[t])}))}return e}({},e,{type:yr(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Tr=e=>!!e&&(!!e.autoGenerated&&e.type!==zt.TYPE_NESTED||!!e.parentAutoGenerated),Er=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),mr=(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),hr=e=>Er(e)?"analyticsAttributes":"attributes",br=(0,l.propEq)("hidden",!0),Or=(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))),vr=Or(zt.TYPE_NESTED),gr=Or(zt.TYPE_REFERENCE),_r=Or(zt.TYPE_IMAGE),Ar=(0,l.either)(vr,gr),Nr=(e,t)=>{const r=Er(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(".")},Pr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Rr=(0,l.pipe)(Pr,Boolean),Sr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),wr=(0,l.both)(Rr,(0,l.pipe)(Pr,("rdm",(0,l.pipe)(Xe,(0,l.equals)("rdm")))));const Ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=hr({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]||Cr(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:[]},Ur=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Ir(e,t,r);return n.length?(0,l.last)(n):null},Cr=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",zt.TYPE_NESTED),(0,l.propEq)("type",zt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.map)((t=>Ur(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Dr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],Lr=[zt.TYPE_ACTIVENESS_DATE,zt.TYPE_TIMESTAMP,zt.TYPE_LOCAL_DATE],jr=e=>Dr.includes(e),kr=e=>Lr.includes(e),Fr=[zt.TYPE_INT,zt.TYPE_LONG,zt.TYPE_NUMBER,zt.TYPE_FLOAT,zt.TYPE_DOUBLE,zt.TYPE_COUNT],Mr=e=>Fr.includes(e),xr=e=>[zt.TYPE_FLOAT,zt.TYPE_DOUBLE].includes(e),$r=[zt.TYPE_BOOLEAN,zt.TYPE_BOOLEAN_RADIO,zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Vr=e=>$r.includes(e),Gr=[zt.TYPE_URL,zt.TYPE_BLOG_URL,zt.TYPE_IMAGE_URL],Wr=e=>Gr.includes(e),Br=Or(zt.TYPE_EMAIL),Yr=e=>zt.TYPE_SSN===e;var qr,Hr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(qr||(qr={}));const Jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===qr.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)))})),Qr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Kr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Qr),Xr=(0,l.pipe)((0,l.reject)(E),Kr);function zr(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){Zr(e,t,r[t])}))}return e}function Zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const en=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("?")?"&":"?")+Qr(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}},tn=e=>t=>{if(!(e=>!ue(e.value))(t)){var r;const n=`${e}/${null!==(r=t.refEntity)&&void 0!==r&&r.objectURI?ze(t.refEntity.objectURI):Me()}`;return zr({},t,{uri:n,value:(0,l.fromPairs)((0,l.map)(rn(n),(0,l.toPairs)(t.value)))})}return zr({},t,{uri:`${e}/${Me()}`})},rn=e=>t=>{let[r,n]=t;return[r,(0,l.map)(tn(`${e}/${r}`),n)]},nn=e=>{const{uri:t}=e;return(0,l.evolve)({attributes:(0,l.pipe)(l.toPairs,(0,l.map)(rn(`${t}/attributes`)),l.fromPairs)},e)},an=e=>(0,l.evolve)({changes:(0,l.map)((0,l.map)((0,l.when)((0,l.propEq)("type",Jt.CREATE_ENTITY),(0,l.evolve)({newValue:nn}))))},e),on={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},sn=(0,l.equals)(on.SUGGESTING),ln=(0,l.equals)(on.EDITING),un=(0,l.equals)(on.VIEWING),cn=(0,l.either)(ln,sn),pn=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),dn=(0,l.curry)(((e,t)=>(0,l.pipe)(pn(e),(0,l.prop)("extendsTypeURI"))(t))),yn=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(dn(e,r)));return n(r)})),fn=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=dn(e,n);return r})),Tn=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Tn(e,pn(e,t.extendsTypeURI),r):void 0,En=(e,t)=>{const r=t.map(fn(e));return(r.length?r.reduce(l.intersection):[])[0]},mn=(e,t)=>Tn(e,(0,l.is)(Object,t)?t:pn(e,t),"typeImage"),hn=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&yn(e,t,n.uri)?r.concat(n.uri):r),[]),bn={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"},On={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},vn={[bn.EQUALS]:"equals",[bn.NOT_EQUALS]:"not",[bn.STARTS_WITH]:"starts with",[bn.MISSING_VALUE]:"missing value",[bn.IN_RANGE]:"in range",[bn.HAS_ALL]:"has all",[bn.FULL_TEXT]:"full text",[bn.EXISTS]:"exists",[bn.COUNT_EQUALS]:"count equals",[bn.COUNT_NOT_EQUALS]:"count not equal",[bn.COUNT_LT]:"count less",[bn.COUNT_LTE]:"count less or equal",[bn.COUNT_GT]:"count greater",[bn.COUNT_GTE]:"count greater or equal",[bn.COUNT_RANGE]:"count in range",[bn.LT]:"less than",[bn.LTE]:"less than or equal",[bn.GT]:"greater than",[bn.GTE]:"greater than or equal",[bn.IN_FILE]:"in file",[bn.NOT_IN_FILE]:"not in file",[bn.CONTAINS]:"contains",[bn.ON]:"on",[bn.BEFORE]:"before",[bn.AFTER]:"after",[bn.WITHIN]:"within"},gn="in",_n="notIn",An="not range",Nn=e=>({[gn]:bn.EQUALS,[_n]:bn.NOT_EQUALS}[e]||e);var Pn,Rn;!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"}(Pn||(Pn={})),function(e){e.LAST_3DAYS="last3Days"}(Rn||(Rn={}));const Sn=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Pn[t]||Rn[t],e)),{}),wn={[Pn.LAST_DAY]:"Last 24 hours",[Rn.LAST_3DAYS]:"Last 3 days",[Pn.LAST_WEEK]:"Last 7 days",[Pn.LAST_MONTH]:"Last month",[Pn.LAST_6MONTHS]:"Last 6 months",[Pn.LAST_YEAR]:"Last year",[Pn.PICK_DATE]:"Pick date"},In={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Un={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Cn="<No label>",Dn="__number",Ln={IN:"in",OUT:"out"};function jn(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){kn(e,t,r[t])}))}return e}function kn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fn={startDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:zt.TYPE_ACTIVENESS_DATE,get label(){return de().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Mn=jn({id:{type:zt.TYPE_ENTITY_ID,get label(){return de().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Fn,{roles:{type:zt.TYPE_STRING,get label(){return de().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:zt.TYPE_STRING,get label(){return de().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),xn={workflow:{type:zt.TYPE_STRING,get label(){return de().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:zt.TYPE_STRING,get label(){return de().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:zt.TYPE_STRING,get label(){return de().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},$n={commenter:{type:zt.TYPE_STRING,get label(){return de().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Vn={notResolved:{type:zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return de().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},Gn={createdBy:{type:zt.TYPE_STRING,get label(){return de().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:zt.TYPE_STRING,get label(){return de().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},Wn={matches:{type:zt.TYPE_COUNT,get label(){return de().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:zt.TYPE_COUNT,get label(){return de().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Bn={sourceSystems:{type:zt.TYPE_STRING,get label(){return de().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:zt.TYPE_STRING,get label(){return de().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:zt.TYPE_INT,get label(){return de().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:zt.TYPE_TIMESTAMP,get label(){return de().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:zt.TYPE_STRING,get label(){return de().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let Yn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(Yn||(Yn={}));const qn={[Yn.matchRules]:{type:zt.TYPE_STRING,get label(){return de().text("Match Rules")},uri:Yn.matchRules,name:Yn.matchRules,faceted:!0,hideForDataTenant:!0},[Yn.MLRecommendedMatch]:{type:zt.TYPE_STRING,get label(){return de().text("Match IQ")},uri:Yn.MLRecommendedMatch,name:Yn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},Hn=jn({},Mn,xn,$n,Vn,Gn,Wn,Bn,qn,{type:{type:zt.TYPE_STRING,get label(){return de().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Jn="NOT_MATCH";var Qn=r(13980),Kn=r.n(Qn);function Xn(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){zn(e,t,r[t])}))}return e}function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zn=Kn().oneOf(["mobile","tablet","desktop"]),ei=Kn().shape({deviceTypes:Kn().oneOfType([Zn,Kn().arrayOf(Zn)]),roles:Kn().arrayOf(Kn().string)}),ti=Kn().shape({value:Kn().string,lookupCode:Kn().string}),ri=Kn().shape({link:Kn().string,filename:Kn().string}),ni=Kn().shape({displayName:Kn().string,parent:Kn().string}),ii=Kn().oneOfType([Kn().string,Kn().number,Kn().bool,ti]),ai=Kn().oneOfType([ii,Kn().arrayOf(ii)]),oi=Kn().shape({fieldName:Kn().string,values:Kn().arrayOf(ai),filter:Kn().string,type:Kn().string}),si=Kn().shape({minValue:Kn().number,maxValue:Kn().number}),li=Kn().shape({label:Kn().string,name:Kn().string,description:Kn().string,type:Kn().string,hidden:Kn().bool,faceted:Kn().bool,searchable:Kn().bool,uri:Kn().string,access:Kn().arrayOf(Kn().string),cardinality:si}),ui=Kn().shape({label:Kn().string,uri:Kn().string,typeColor:Kn().string,direction:Kn().string,startObject:Kn().object,endObject:Kn().object}),ci=Kn().shape({typeColor:Kn().string,typeIcon:Kn().string,typeImage:Kn().string,label:Kn().string,uri:Kn().string,attributes:Kn().arrayOf(li)}),pi=Kn().shape({uri:Kn().string,label:Kn().string,memberTypes:Kn().array,extendsTypeUri:Kn().string,attributes:Kn().arrayOf(li)}),di=Kn().shape({uri:Kn().string,label:Kn().string,extendsTypeUri:Kn().string,relationshipTypeURIs:Kn().arrayOf(Kn().string)}),yi=Kn().shape({uri:Kn().string,description:Kn().string,label:Kn().string,schemaVersion:Kn().string,entityTypes:Kn().arrayOf(ci),roles:Kn().arrayOf(Kn().object),groupTypes:Kn().arrayOf(Kn().object),relationTypes:Kn().arrayOf(ui),graphTypes:Kn().arrayOf(di),interactionTypes:Kn().arrayOf(pi),sources:Kn().arrayOf(Kn().object)}),fi=Kn().shape({uri:Kn().string,type:Kn().string}),Ti=Kn().shape({uri:Kn().string,type:Kn().string}),Ei=Kn().shape({value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),mi=Kn().shape({refEntity:Kn().oneOfType([Kn().array,Kn().object]),refRelation:Kn().oneOfType([Kn().array,Kn().object]),value:Kn().object,ov:Kn().bool,type:Kn().string,uri:Kn().string}),hi=Kn().oneOf((0,l.values)(on)),bi=Kn().shape({type:Kn().oneOf(Object.values(dt)).isRequired,attributeTypeUri:Kn().string.isRequired,parentUri:Kn().string.isRequired,uri:Kn().string,message:Kn().string}),Oi={attributeType:li,showEmptyEditors:Kn().bool,lazy:Kn().bool,mode:hi,metadata:yi,ownError:bi,errors:Kn().arrayOf(bi),crosswalks:Kn().array,onAddAttributes:Kn().func,onAddOneMore:Kn().func,onDeleteAttribute:Kn().func,onChangeAttribute:Kn().func,additionalControlsRenderer:Kn().func,hideDeleteButton:Kn().bool,showNonOv:Kn().bool,state:Kn().oneOf(["deleted","edited"]),expanded:Kn().bool},vi=Xn({attributeValue:Ei},Oi),gi=Xn({attributeValue:mi},Oi),_i=Kn().shape({value:Kn().oneOfType([Kn().string,Kn().bool,Kn().number]),ov:Kn().bool,type:Kn().string,uri:Kn().string,lookupCode:Kn().string,lookupRawValue:Kn().string}),Ai=Kn().shape({totalOvValues:Kn().number,totalValues:Kn().number}),Ni=Kn().shape({inRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),outRelations:Kn().arrayOf(Kn().oneOfType([Kn().object,Kn().string])),groups:Kn().arrayOf(Kn().string),entityTypes:Kn().arrayOf(Kn().string),nextEntry:Kn().object}),Pi=Kn().oneOf(["asc","desc"]),Ri=Kn().shape({id:Kn().string,content:Ni,allowOnlyCreateNew:Kn().bool,sortColumn:Kn().string,sortOrder:Pi,"text-empty":Kn().string,max:Kn().number,icon:Kn().string,caption:Kn().string,canCreate:ei,canRead:ei,canUpdate:ei,canDelete:ei,editingEnabled:Kn().bool}),Si=Kn().shape({entityUri:Kn().string,entityType:Kn().string,entityLabel:Kn().string,object:fi}),wi=Kn().shape({relationUri:Kn().string,relationType:Kn().string,relationLabel:Kn().string,direction:Kn().string,object:Ti}),Ii=Kn().shape({entity:Si,relation:wi}),Ui=Kn().shape({value:Kn().string,isRawFilter:Kn().bool}),Ci=Kn().shape({id:Kn().string,label:Kn().string,name:Kn().string,availableEntityTypes:Kn().array}),Di=Kn().shape({id:Kn().string,allowMergeAll:Kn().bool,matchActions:Kn().object,availableTabs:Kn().arrayOf(Kn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),Li=Kn().arrayOf(Kn().shape({uri:Kn().string,label:Kn().string})),ji=[{label:de().text("And"),value:"and"},{label:de().text("Or"),value:"or"},{label:de().text("And not"),value:"and not"},{label:de().text("Or not"),value:"or not"}];function ki(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Mi=(0,l.pipe)(Fi,(0,l.propOr)("","label")),xi=(0,l.curry)(((e,t)=>{const r=Fi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),$i=(0,l.curry)(((e,t,r)=>{const[n,i]=xi(e,r);return yn(e,n,t)||yn(e,i,t)})),Vi=(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){ki(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Gi=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?Ln.OUT:Ln.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(Ln.IN),i=r(Ln.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Wi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Bi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Bi(e,Fi(e,t.extendsTypeURI),r):void 0,Yi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},qi=(0,l.curry)(((e,t)=>e.every((e=>Hi(e,t))))),Hi=(0,l.curry)(((e,t)=>{const r=Tr(t);return Ji(e,t)&&(e===Yi.READ||!r)})),Ji=(e,t)=>!t||!t.access||t.access.includes(e),Qi=(0,l.curry)(((e,t,r)=>Hi(Yi.READ,r)&&(sn(t)?Hi(Yi.INITIATE_CHANGE_REQUEST,r):Hi(e,r)))),Ki=Qi(Yi.CREATE),Xi=Qi(Yi.DELETE),zi=Qi(Yi.UPDATE),Zi=qi([Yi.CREATE,Yi.MERGE,Yi.READ,Yi.UPDATE]),ea=qi([Yi.UPDATE,Yi.READ,Yi.CREATE]),ta=qi([Yi.UPDATE,Yi.READ]),ra=qi([Yi.DELETE,Yi.UPDATE,Yi.READ]),na=(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["*"])),ia=(e,t,r)=>(0,l.pipe)((0,l.map)(na(e,t)),(0,l.filter)(l.identity))(r),aa=(e,t,r)=>{const n=ia(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Hi(Yi.MERGE,r)},oa=(0,l.curry)(((e,t,r,n)=>{const i=Fi(e,n),[a,o]=xi(e,n);return i&&Hi(Yi.CREATE,i)&&yn(e,a,t.type)&&yn(e,o,r.type)})),sa=(e,t,r,n,i)=>{const a=pn(e,n.type),o=ia(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(oa(e,n,i))||a.some(oa(e,i,n))}))},la=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=pn(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:aa(o,i,a),canAddRelation:sa(e,o,i,r,n),canMark:Hi(Yi.UPDATE,a)&&Hi(Yi.READ,a)}},ua=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>la(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),ca=Er,pa=(0,l.complement)(ca),da=Hi(Yi.READ),ya=e=>{let{attributeType:t,mode:r}=e;return pa(t)&&Ki(r,t)&&!br(t)},fa=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Ge(r.uri),o=zi(n),s=Ki(n);return(0,l.cond)([[ca,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Ta=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Ge(r.uri),s=zi(n),u=Xi(n),c=ma(Yi.UPDATE,n,a,r),p=ma(Yi.DELETE,n,a,r);return(0,l.cond)([[ca,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)},Ea=(0,l.curry)(((e,t,r,n)=>{const i="Reference"!==n.type&&Cr(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=>!Ji(e,n)||!Ea(e,t,r[n.name],n)))))})),ma=(0,l.curry)(((e,t,r,n,i)=>sn(t)?Ea(Yi.INITIATE_CHANGE_REQUEST,r,n,i):Ea(e,r,n,i))),ha=(0,l.both)((0,l.complement)(br),da),ba="SuperUser",Oa="allTenants",va=[Oa,"allCustomers"],ga=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===ba})).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===ba){const e=r?va.concat(r.map((e=>`allTenants.${e}`))):va,n=r&&t[0]===Oa?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}))},_a={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"},Aa={[_a.CAN_DELETE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["DELETE"]},[_a.CAN_CREATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["CREATE"]},[_a.CAN_UPDATE_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["UPDATE"]},[_a.CAN_READ_PREFERENCES]:{serviceId:"MDM",resourcePath:["ui","preferences"],privileges:["READ"]},[_a.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[_a.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[_a.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[_a.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[_a.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[_a.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[_a.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[_a.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[_a.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[_a.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[_a.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[_a.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[_a.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[_a.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[_a.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[_a.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[_a.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[_a.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[_a.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[_a.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[_a.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[_a.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[_a.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[_a.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[_a.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[_a.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[_a.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[_a.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[_a.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[_a.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Na=(0,l.curry)(((e,t,r)=>ga({allowedPermissionsNames:e,permissionsNames:_a,permissionsConfig:Aa}).some((e=>e(t,{params:{tenant:r}}))))),Pa=Na([_a.CAN_EXPORT]),Ra=Na([_a.CAN_EXPORT_ACTIVITIES]),Sa=Na([_a.CAN_IMPORT_ENTITIES_FROM_DT]),wa=Na([_a.CAN_READ_ENTITIES_FROM_DT]),Ia=Na([_a.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),Ua=Na([_a.CAN_UPDATE_PROCESS_INSTANCE]),Ca=Na([_a.CAN_VIEW_WORKFLOW_DEFINITION]),Da=Na([_a.CAN_CONFIG_ENVIRONMENT_REGISTER]),La=Na([_a.CAN_UPDATE_WORKFLOW_DATA_TASK]),ja=Na([_a.CAN_READ_WORKFLOW_DATA_TASK]),ka=Na([_a.CAN_MANAGE_WORKFLOW_DEFINITION]),Fa=Na([_a.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),Ma=Na([_a.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),xa=Na([_a.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),$a=Na([_a.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Va=Na([_a.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ga=Na([_a.CAN_EXECUTE_WORKFLOW_JOBS]),Wa=Na([_a.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ba=Na([_a.CAN_CREATE_CONFIG_JAR]),Ya=Na([_a.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),qa=Na([_a.CAN_VIEW_CONFIG_JAR]),Ha=Na([_a.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Ja=Na([_a.CAN_VIEW_WORKFLOW_JOBS]),Qa=Na([_a.CAN_MAKE_BULK_UPDATE]),Ka=Na([_a.CAN_OPEN_DATA_LOADER_EXECUTE,_a.CAN_OPEN_DATA_LOADER_READ]),Xa=Na([_a.CAN_BULK_DELETE_PROFILES]),za=Na([_a.CAN_READ_MDM_DATA_ENTITIES]),Za=Na([_a.CAN_READ_DVF]),eo=Na([_a.IS_FREEMIUM_ADMIN]),to=(0,l.reject)(br),ro=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),to,(0,l.filter)(e))(t),no=(0,l.curry)(((e,t)=>ro((t=>ya({attributeType:t,mode:e})),t))),io=(0,l.curry)(((e,t)=>ro((t=>ya({attributeType:t,mode:e})||ha(t)),t))),ao=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(ha)),oo=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...oo(e)])))),so=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(ha),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...so(e)])))),lo=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...lo(e)])))),uo=(0,l.pipe)(pn,(0,l.converge)(l.concat,[so,lo]));function co(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){po(e,t,r[t])}))}return e}function po(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yo=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,yo(e)))},t))),fo=e=>{var t;return co({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},To=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Eo=(0,l.when)(To,(0,l.dissoc)("values")),mo=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return co({},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})})),ho=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},bo=(0,Hr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(oo,t).concat((0,l.chain)(oo,r)).some(ho)})),Oo=e=>{let t=!1;const r=yo((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?co({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},vo=e=>{const t=bo(e),r=(0,l.map)((e=>yo((0,l.pipe)(Eo,(0,l.when)((0,l.always)(e),mo))))(t)),n=(0,l.map)(fo),i=(0,l.map)(Oo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},go=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),_o=(0,l.prop)("relationshipTypeURIs"),Ao=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(No(e,t)))||[]})),No=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some($i(e,t))},Po=(e,t)=>(0,l.pipe)(go,(0,l.defaultTo)({}),_o,(0,l.defaultTo)([]),(0,l.chain)(xi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(pn(e)))(e,t),Ro=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),So=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),wo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return So((0,l.complement)(Ro))(e)},Io=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return So(Ro)(e)},Uo=(0,l.pipe)(pn,(0,l.propOr)([],"matchGroups")),Co=(e,t,r)=>(0,l.pipe)(Uo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),Do=(0,l.curry)(((e,t,r)=>(0,l.pipe)(Co,(0,l.propOr)(r,"label"))(e,t,r))),Lo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Uo,(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]})),jo=e=>(0,l.partition)(Ro,e),ko=(0,l.includes)(l.__,["and","or","not"]),Fo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),Mo=(0,l.includes)(l.__,["equals","notEquals","in"]),xo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return ko(t)?xo(r):Fo(t)?r.filter(Je):Mo(t)?r.map((0,l.prop)("uri")).filter(Je):[]})),l.uniq),$o=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(xo),l.uniq),Vo=(0,l.pipe)(Uo,$o),Go=(0,l.pipe)(Lo,$o),Wo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Bo=(0,l.pipe)(Wo,so),Yo=(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||yn(e,n,t)})(e,t))})(e,t)),qo=e=>!!e.required,Ho=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)([[Je,pn(e)],[Qe,Fi(e)]])(t);return Jo(e,a,r,n,i)},Jo=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=e=>e.uri&&Je(e.uri)&&3===e.uri.split("/").length;return!t||t.hidden&&!a(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Tr(e)&&n(e,i))).flatMap((t=>{const a=t.required?[t]:[];if(r){let o;if(t.type===zt.TYPE_REFERENCE){const a=rr(t),s=nr(t);o=Ho(e,a,r,n,[...i,t]).filter((e=>s.some(Ke(e.uri))))}else t.attributes&&(o=Jo(e,t,r,n,[...i,t]));o&&a.push(...o)}return a})):t.type===zt.TYPE_REFERENCE?Ho(e,rr(t),r,n,[...i,t]):[]},Qo=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),qo]),e.attributes||[])},Ko=(e,t)=>{const r=or(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},Xo=(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)?de().text(n):n};return r(null,t)})),zo=["label","description","abbreviation","caption","toolTip"],Zo=e=>Xo(zo,e),es=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=ze(t);return r.find((e=>{let{uri:t}=e;return ze(t)===n}))})),ts=(0,l.curry)(((e,t)=>{const r=ze(t);return(0,l.pipe)(es(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),rs=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"})},ns=(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}))},is=(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)})),as=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=pn(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function os(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){ss(e,t,r[t])}))}return e}function ss(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ls=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 us(i,e,t,r,n)},us=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]:["attributes"];return Z.fromNull(e&&e.length?e:Cr(t,r)).map((e=>e.map((e=>{const r=ls(t,e,n,i);return r.length?os({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Ar),(0,l.prop)("children"))).filter(ha).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},cs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ls(e,t,r,["attributes","analyticsAttributes"])},ps=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ls(e,t,r,["attributes"])},ds=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return ls(e,t,r,["analyticsAttributes"])},ys=e=>e.children?e.children.flatMap(ys):e,fs=e=>e.children?[e,...e.children.flatMap(fs)]:e,Ts=(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)})),Es=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return ze(r)===e})))),ms=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Es("LUD")),(0,l.defaultTo)(r))(t||[])},hs=(e,t)=>{let{survivorshipStrategies:r}=e;return Es(t,r)},bs=(0,l.allPass)([(0,l.complement)(l.isNil),Hi(Yi.READ)]),Os=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Hi(Yi.READ)]),vs=(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)([Hi(Yi.CREATE),Hi(Yi.INITIATE_CHANGE_REQUEST)])]),gs=(0,l.curryN)(2,(0,l.pipe)(pn,Os)),_s=(0,l.curryN)(2,(0,l.pipe)(Fi,bs)),As=e=>{let{ov:t}=e;return!1!==t},Ns=(e,t)=>((e,t)=>Wr(e.type)&&ae(t))(e,t)||((e,t)=>Br(e.type)&&oe(t))(e,t),Ps=(0,l.curry)(((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))),Rs=Ps("refEntity"),Ss=Ps("refRelation"),ws=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],Is=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Us=(0,l.prop)("objectURI"),Cs=(0,l.prop)("objectURI"),Ds=(0,l.prop)("type"),Ls=(0,l.pipe)(Rs,(0,l.defaultTo)({}),Us),js=(0,l.pipe)(Ss,(0,l.defaultTo)({}),Cs),ks=(0,l.pipe)(Rs,(0,l.defaultTo)({}),Ds),Fs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Ms=(0,l.evolve)({refEntity:re,refRelation:re}),xs=(e,t,r,n)=>{const i=Ir(e,r),a=pn(e,t.type)||Fi(e,t.type);if(0===i.length)return null;const o=hr(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(!ur(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)(at,Qe)(r.uri)?(y=((null==a?void 0:a.attributes)||[]).filter((e=>rr(e)===r.uri||tr(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},$s=(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?$s(a.value,o):a},Vs=(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 $s(e[r],i)})),Gs=(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")]]),Ws=(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"])]]),Bs=(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"])]]),Ys=(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)(Ys(e,i)))))(r)})),qs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(qs(e)),e)(t))),Hs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Ys(e,r),qs(t))(n))),Js=Hs(null,Gs),Qs=Hs(As,Gs),Ks=Hs(null,Ws),Xs=Hs(As,Ws),zs=Hs(As,Bs),Zs=(e,t,r)=>{var n,i,a;return e.uri===t?null==e||null===(n=e.attributes)||void 0===n?void 0:n[r]:null===(i=Vs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},el=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Ls,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),tl=(e,t)=>{const r=st(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Zs(e,r,n)},rl=Object.values(Fn),nl=(0,l.includes)(l.__,rl),il=e=>rl.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function al(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){ol(e,t,r[t])}))}return e}function ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sl=(e,t)=>`${e}_${t}`,ll=[Hn.matches.name,Hn.matchRules.name],ul=(0,l.values)(xn).map((e=>e.name)),cl=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ul)))),pl=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ll)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>sl(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),dl=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,cl(r),pl(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(sl(`dtPotentialMatches.${t.name}`,"")))))(Hn)},yl=(0,l.propEq)("uri",Hn.type.uri),fl=e=>(0,l.values)(qn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),Tl=(0,l.propEq)("uri",Bn.sourceSystems.uri),El=Object.values(Mn),ml=(0,l.includes)(l.__,El),hl=e=>{let{entity:t,attributeType:r,value:n}=e;return al({},t,{[r.uri]:void 0===n?r.defaultValue:n})},bl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Ol=e=>{let{entity:t,attributeType:r,value:n}=e;return al({},t,{[r.uri]:n})},vl=(0,l.propEq)("uri",Mn.roles.uri),gl=(0,l.propEq)("uri",Mn.tags.uri);function _l(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){Al(e,t,r[t])}))}return e}function Al(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nl=e=>{let{parentUri:t,attributeType:r}=e;return _l({uri:Ve(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[(0,l.either)(Ar,_r),(0,l.always)({value:{}})],[Rr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),jr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},Pl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(no(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Sr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Nl({parentUri:r,attributeType:e});let s=Cr(n,e);s&&(e.type===zt.TYPE_REFERENCE&&(s=lr(s)),a.value=Pl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||Sr(e))&&(o[t]=[a])}return o},Rl=e=>{let{entity:t,metadata:r,mode:n,attrTypeFilter:i}=e;return Ho(r,t.type,!0,i).reduce(((e,t)=>{const i=t.name,a=st(t.uri);return(a===e.type?[{parentUri:e.uri,attributes:e.attributes}]:(xs(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=Il({entity:e,attributeType:t,parentUri:o,index:0});if(Ar(t)){const e=Cr(r,t),a=vr(t)?e:lr(e);i=Sl({attributeType:t,subAttributes:a,metadata:r,mode:n},i)}return i}return e}),e)}),t)},Sl=(0,l.curry)(((e,t)=>{let{attributeType:r,subAttributes:n,metadata:i,mode:a}=e;const o=xs(i,t,r.uri)[0],s=_l({},o,{value:Pl({attributeTypes:n,parentUri:o.uri,mode:a,metadata:i})});return Cl({entity:t,attributeType:r,uri:o.uri,value:s})})),wl=(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===zt.TYPE_NESTED?_l({},e,{value:wl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return _l({},s(t),Pl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Il=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Nl({parentUri:n,attributeType:r}),u=Gs(l);return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},Ul=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ae(e.attributes||e.value,r,n.uri,Gs(n),a,o,i)}))},Cl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,ve.ZP)(t,(e=>{Ne(e.attributes||e.value,r,n,i,a,o)}))},Dl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,ve.ZP)(t,(e=>{Re(e.attributes||e.value,r,n,i)}))},Ll=e=>""===e,jl=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Ll,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Ll,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]]),kl=(0,l.reject)(jl),Fl=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=>Fl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),kl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Ml=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Fl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Ms),deleteEmptyComplex:e})},xl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Ml(e),(0,l.reject)(l.isEmpty))},$l=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return nl(r)?hl({entity:e,attributeType:r}):Il({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Vl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return nl(r)?Ol({entity:e,attributeType:r,value:i}):Cl({entity:e,attributeType:r,uri:n,value:i})})),Gl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return nl(r)?bl({entity:e,attributeType:r}):Dl({entity:e,attributeType:r,uri:n})})),Wl=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)},Bl="UrlThumbnail",Yl="CdnUrlThumbnail",ql=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(As):(0,l.head)(n);return e&&e.value}return null})),Hl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>ql(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Jl=Hl(["CdnUrl","Url"],!0),Ql=Hl(["CdnUrlPreview","UrlPreview"],!0),Kl=Hl([Yl,Bl],!0),Xl=Hl([Yl,Bl]),zl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[mr,(0,l.always)(t)],[(0,l.both)(Er,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=mr(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(nl(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Zl=(e,t,r)=>{const n=ao(e),i=(0,l.any)(r?l.T:As);return zl(n,t,i)},eu=(e,t,r,n,i,a)=>{const o=Ge(null==r?void 0:r.uri)?no(t,e):io(t,e);return zl(o,r,((e,o)=>{const s=ya({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:As,e)||mr(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let tu;const ru=e=>{tu=e};function nu(e,t){return tu(e,t)}const iu=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)})),au=50,ou=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=au,offset:a=0}=e;return nu("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},su=(0,l.once)((()=>nu("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),lu=e=>nu("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),uu=(e,t)=>nu("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),cu=e=>Z.fromNull(vn[e]).map(de().text).orSome(""),pu=(0,l.curry)(((e,t)=>`${e}_${t}`)),du=(0,l.split)("_"),yu=(0,l.includes)("_"),fu=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Tu=(0,l.curry)(((e,t)=>e.some(fu(t)))),Eu=Tu([bn.IN_RANGE,bn.COUNT_RANGE,bn.WITHIN]),mu=Tu([bn.EXISTS,bn.MISSING_VALUE]),hu=(0,l.cond)([[mu,(0,l.always)(0)],[Eu,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),bu=(0,l.complement)(mu),Ou=Tu([bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS]),vu=Tu([bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE]),gu=Tu([bn.IN_FILE,bn.NOT_IN_FILE]),_u=e=>{switch(e){case bn.COUNT_EQUALS:return bn.EQUALS;case bn.COUNT_NOT_EQUALS:return bn.NOT_EQUALS;case bn.COUNT_LT:return bn.LT;case bn.COUNT_LTE:return bn.LTE;case bn.COUNT_GT:return bn.GT;case bn.COUNT_GTE:return bn.GTE;case bn.COUNT_RANGE:return bn.IN_RANGE}},Au=Tu([bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS]),Nu=Tu([bn.WITHIN]),Pu=[[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE],[bn.NOT_IN_FILE,bn.IN_FILE],[bn.EQUALS,bn.NOT_EQUALS,bn.HAS_ALL],[bn.LT,bn.LTE,bn.GT,bn.GTE],[bn.MISSING_VALUE,bn.EXISTS],[bn.COUNT_RANGE],[bn.IN_RANGE],[bn.STARTS_WITH,bn.CONTAINS],[bn.FULL_TEXT],[bn.ON,bn.BEFORE,bn.AFTER,bn.NOT_EQUALS],[bn.WITHIN]],Ru=(e,t)=>Pu.some((r=>r.includes(e)&&r.includes(t))),Su=(0,l.pipe)(l.omit,l.values),wu={OPTIONS_FOR_STRING:Su(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_DATE:[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS,bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Su(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_BLOB:Su(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_NUMBER:Su(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_LOOKUP:Su(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],bn),OPTIONS_FOR_ENUM:Su(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],bn),OPTIONS_FOR_ID:[bn.EQUALS,bn.NOT_EQUALS,bn.IN_FILE,bn.NOT_IN_FILE],OPTIONS_FOR_COUNT:[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],OPTIONS_FOR_COMPLEX:[bn.COUNT_EQUALS,bn.COUNT_NOT_EQUALS,bn.COUNT_LT,bn.COUNT_LTE,bn.COUNT_GT,bn.COUNT_GTE,bn.COUNT_RANGE,bn.EXISTS,bn.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[bn.EQUALS,bn.NOT_EQUALS,bn.EXISTS,bn.MISSING_VALUE]},Iu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case zt.TYPE_TYPEAHEAD:case zt.TYPE_STRING:case zt.TYPE_PASSWORD:case zt.TYPE_TEXT:case zt.TYPE_CIK_ID:case zt.TYPE_URL:case zt.TYPE_BLOG_URL:case zt.TYPE_IMAGE_URL:case zt.TYPE_EMAIL:return wu.OPTIONS_FOR_STRING;case zt.TYPE_LOOKUP:case zt.TYPE_DEPENDENT_LOOKUP:return wu.OPTIONS_FOR_LOOKUP;case zt.TYPE_ENUM:return wu.OPTIONS_FOR_ENUM;case zt.TYPE_DATE:case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_TIMESTAMP:case zt.TYPE_LOCAL_DATE:return wu.OPTIONS_FOR_DATE;case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:return wu.OPTIONS_FOR_BOOLEAN;case zt.TYPE_BLOB:return wu.OPTIONS_FOR_BLOB;case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_NUMBER:return wu.OPTIONS_FOR_NUMBER;case zt.TYPE_ENTITY_ID:return wu.OPTIONS_FOR_ID;case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[bn.EQUALS];case zt.TYPE_COUNT:return wu.OPTIONS_FOR_COUNT;case zt.TYPE_NESTED:case zt.TYPE_REFERENCE:case zt.TYPE_IMAGE:return wu.OPTIONS_FOR_COMPLEX;default:return wu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(vu,n):n},Uu=e=>[gt.and,gt.andNot].includes(e),Cu=e=>[gt.or,gt.orNot].includes(e),Du=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Cu)),Lu=(ju=[gt.and],e=>e.slice(0,-1).every((e=>ju.includes(e.operator))));var ju;const ku=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),Fu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Mu=e=>`(${e})`,xu=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},$u=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[gt.or,gt.orNot],n=t?[gt.and,gt.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)&&xu(e.slice(1,-1));return!i&&!a||o?e:Mu(e)},Vu="and",Gu=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)(Vu,n,e),o=(e=>[gt.andNot,gt.orNot].includes(e))(a)?$u(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Wu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Bu=e=>Array.isArray(e)?e.map(Bu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Yu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),qu=e=>`'${e}'`,Hu=e=>`"${e}"`,Ju=e=>(0,l.pipe)((0,l.map)(e),(0,l.join)(" or ")),Qu=(0,l.pipe)(Bu,Yu),Ku=(0,l.pipe)(Qu,qu),Xu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Eu(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),zu=(e,t)=>vu(t)?{type:zt.TYPE_INT}:gu(t)?{type:zt.TYPE_FILE}:Au(t)&&!Nu(t)&&kr(e.type)?{type:zt.TYPE_LOCAL_DATE}:e,Zu=Object.values(Sn),ec=e=>!Object.values(Sn).includes(e),tc=e=>Zu.includes(e),rc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return de().text(t[e])},nc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Pn),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return e.map((e=>({value:e,get label(){return rc(e,t)}})))},ic=e=>{const t=f()().startOf("minute");switch(e){case Pn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Pn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Pn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Pn.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Pn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Rn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},ac=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},oc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ic;return(0,l.is)(String,e)?t(e):ac(e)};let sc;!function(e){e.CurrentUser="currentUser"}(sc||(sc={}));const lc={},uc=(e,t)=>{lc[e]=t},cc=e=>lc[e];function pc(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){dc(e,t,r[t])}))}return e}function dc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yc=e=>e.split("{CurrentUser}").join(cc(sc.CurrentUser)||""),fc=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Tc=(0,l.curry)(((e,t,r)=>{const n=r.map(Eu(e)||t.endsWith(".count")?Qu:Ku).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Ec=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},mc=e=>{let{filter:t,fieldName:r,values:n}=e;const i=hu(t);return(0,l.pipe)(Ec(i),(0,l.map)(Tc(t,r)),fc(" or "))(n)},hc=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Ku).join(",")})`},bc=e=>`*${e}*`,Oc=e=>`URL:${e}`,vc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,gc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===bn.IN_FILE?r:`not ${r}`},_c=(e,t)=>[R(e,t),S(e,t)],Ac=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Nc(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case bn.ON:return pc({},e,n?{filter:bn.EQUALS}:{filter:bn.IN_RANGE,values:[_c(i,n)]});case bn.BEFORE:return pc({},e,{filter:bn.LTE,values:[[S(i,n)]]});case bn.AFTER:return pc({},e,{filter:bn.GTE,values:[[R(i,n)]]});case bn.WITHIN:return pc({},e,{filter:bn.IN_RANGE,values:[ic(i)]})}}return e}),mc),Nc=(0,l.propSatisfies)(kr,"type"),Pc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),yc)],[(0,l.propEq)("filter",bn.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(mc({filter:bn.EQUALS,fieldName:t,values:[r]}))),new Gu).build())),fc(" or "))(r)}),yc)],[(0,l.propEq)("filter",bn.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return mc({fieldName:r,filter:t,values:n.map((0,l.pipe)(Bu,bc))})}),yc)],[(0,l.propEq)("filter",bn.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?mc(pc({},e,{values:(0,l.flatten)(r)})):vc(r)?hc(pc({},e,{filter:"listEquals"})):mc(e)}),yc)],[(0,l.propEq)("filter",bn.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=hu(t);return(0,l.pipe)(Ec(i),(0,l.map)(Tc(t,r)),fc(" and "))(n)})(pc({},e,{values:(0,l.flatten)(e.values)})):Nc(e)?(e=>{const{values:t}=e,r=!Nc(e),[n]=t;return(new Gu).addClause(mc(pc({},e,{filter:bn.LT,values:[R(n,r)]}))).addClause(mc(pc({},e,{filter:bn.GT,values:[S(n,r)]}))).orBuild()})(e):vc(t)?hc(pc({},e,{filter:"not listEquals"})):mc(e)}),yc)],[(0,l.propSatisfies)(gu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return mc({fieldName:r,filter:gc(t,r),values:n.map((0,l.prop)("link")).map(Oc)})}],[(0,l.propSatisfies)(vu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return mc({fieldName:`${r}.count`,values:n,filter:_u(t)})}],[(0,l.propSatisfies)(Au,"filter"),Ac],[(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 Tc(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Tc(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(mc,yc)]],Rc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!bu(e)||wc(e,r))},Sc=(e,t)=>Array.isArray(t)?wc(e,t):e===bn.WITHIN?tc(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Bu(t).length>0,wc=(e,t)=>t&&t.length>0&&t.every((t=>Sc(e,t)));function Ic(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Cc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Dc=(e,t,r)=>"children"===e?jc(r,[...t][0],!0):r,Lc=(e,t,r)=>"values"===e?[...r,...t]:r,jc=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)(Dc,t),e);if(!r&&Ou(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Lc,t),e)}return(0,l.append)(t,e)},kc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Uc(e),r=e=>e.fieldName===t?e:r({fieldName:Cc(e),children:[e]});return r(e)})(t);return jc(e,r)}),[]),Fc=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")),Mc=e=>{let[t]=e;return t.children?Mc(t.children):t.operator},xc=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=Mc(t)===gt.andNot,a=n(t,!1),o=i?`not ${$u(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Mc(r)||Vu} ${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&&Fc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Gu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},$c=(0,l.pipe)((0,l.propOr)("","filter"),yu),Vc=(0,l.map)((0,l.when)($c,(e=>{const[t,r]=du(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){Ic(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Gc=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)(Rc),Vc,kc,xc([...e,...Pc],t))},Wc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Bc=[bn.ON,bn.BEFORE,bn.AFTER,bn.WITHIN,bn.NOT_EQUALS,bn.MISSING_VALUE,bn.EXISTS],Yc=[bn.EQUALS,bn.NOT_EQUALS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.FULL_TEXT,bn.EXISTS],qc=[bn.EQUALS,bn.NOT_EQUALS,bn.LT,bn.LTE,bn.GT,bn.GTE,bn.IN_RANGE],Hc=(e,t)=>{const r=fr(e);return(e=>{switch(e){case Fn.startDate.name:case Fn.endDate.name:case xn.dueDate.name:case Gn.createdTime.name:case Gn.updatedTime.name:case Bn.reltioLoadDate.name:case Bn.createDate.name:case Bn.updateDate.name:case Bn.deleteDate.name:case Bn.publishDate.name:return Bc;case Wn.matches.name:case Bn.count.name:return qc;case xn.workflow.name:case xn.assignee.name:case xn.step.name:case $n.commenter.name:case Gn.createdBy.name:case Gn.updatedBy.name:case Bn.sourceSystems.name:case Bn.value.name:return Yc;default:return null}})(t)||Iu(r)},Jc=[bn.EQUALS,bn.NOT_EQUALS,bn.CONTAINS,bn.STARTS_WITH,bn.MISSING_VALUE,bn.HAS_ALL,bn.IN_RANGE,bn.WITHIN,bn.EXISTS,bn.ON],Qc=(0,l.pipe)(Hc,(0,l.filter)((0,l.includes)(l.__,Jc))),Kc=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(As);return a&&a[0]&&(r=n.length>0&&a[0].value?Kc(a[0].value,[n.join(".")])[0].value:"label"in a[0]&&"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),Xc=(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=Kc(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=>{o=o.replace("{"+e.key+"}",e.value||"")}))),o},zc=/[,\s]*$/,Zc=e=>{const t=de().text(Cn);if(!e)return t;const r=e.replace(zc,"");return""===r.toString().trim()?t:r},ep=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},tp=(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=ep(e,r.referencedEntityTypeURI);if(n)return Xc({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Xc({attributes:t||{}},r.dataLabelPattern);return""},rp=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},np=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)}`},ip=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},ap=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),op=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Kl,(0,l.prop)("value"))),sp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),op),lp=(e,t,r)=>{const n=sp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(Vs(e),op)))(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")])})(pn(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>xs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,op))(r)})(e,r)||mn(e,r.type);return ap(t,n)};function up(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){cp(e,t,r[t])}))}return e}function cp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pp="DTSS/",dp=(0,l.replace)(new RegExp("^entities/"),""),yp=e=>pp+e.dataTenant+"/"+e.uri,fp=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Tp=e=>!(!e||!e.dataTenant),Ep=(0,l.startsWith)(pp),mp=(0,l.pipe)((0,l.ifElse)(Ep,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),hp=(0,l.ifElse)(Tp,yp,(0,l.prop)("uri")),bp=e=>e&&e.uri?e.dataTenant?yp(e):dp(e.uri):"",Op=(0,l.curry)(((e,t,r)=>(pn(t,r.type)||{})[e]||"")),vp=Op("label"),gp=Op("typeGraphIcon"),_p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=pn(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(As)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:tp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Ap=(0,l.pipe)(_p,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Np=(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=Np(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Np(e.slice(1),r)}})),Pp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Rp=e=>(0,l.propOr)([],"matchRules",e),Sp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?up({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},wp=(e,t,r)=>t&&r?r.aEntity:e,Ip=(0,l.evolve)({attributes:xl(!0)}),Up=(0,l.pipe)(Ip,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Cp=e=>(0,l.assoc)("dataTenant",e);function Dp(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){Lp(e,t,r[t])}))}return e}function Lp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jp=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Lt.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},kp=e=>{let{relationUri:t}=e;return{type:Lt.DELETE_RELATION,parameters:{relationUri:t}}},Fp=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Lt.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Mp=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Lt.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},xp=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Lt.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},$p=(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))),Vp=e=>e.type===Lt.DELETE_RELATION,Gp=e=>e.type===Lt.CREATE_RELATION,Wp=e=>e.type===Lt.REPOINT_RELATION,Bp=e=>e.type===Lt.UPDATE_RELATION,Yp=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),qp=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Lt.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Yf({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Lt.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Bf(e,i).then(o)};case Lt.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Qf(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Lt.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return qf({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Lt.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[kp({relationUri:o}),jp({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Jp(n)),(0,l.map)(qp),Yp)(s)}}},Hp=e=>t=>()=>e().then(t),Jp=e=>t=>Dp({dcrProcessor:e},t),Qp=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=en({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Jp(r)),(0,l.map)(qp),(0,l.map)(Hp(r.getDcrUriAwait)),Yp,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Kp=e=>t=>(0,l.map)((t=>Dp({},t,{parameters:(0,l.evolve)({parentUri:th(e),entityUri:th(e),newEntityUri:th(e)},t.parameters)})),t),Xp=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},zp=(e,t)=>{const r=e.filter(Gp).find($p(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Bp(o)&&$p(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Wp(o)||!$p(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(Xp({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(Wp).filter($p(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Bp(i)||!$p(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Xp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},ed=(e,t)=>{const r=e.filter(Vp).filter($p(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!$p(t,e)))},td=(e,t)=>{const r=e.filter(Bp).filter($p(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(Xp({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},rd=e=>{const t=e.filter(Vp).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(ed,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(Wp).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Zp,e)},ad=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)(td,e))(t)},od=e=>(0,l.pipe)(rd,nd,id,ad)(e);function sd(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){ld(e,t,r[t])}))}return e}function ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ud=e=>sd({},(0,l.path)(Ud(),e),{startDate:(0,l.path)(jd(),e),endDate:(0,l.path)(kd(),e)}),cd=(e,t)=>(0,l.pipe)((0,l.path)(Ld()),th(t))(e),pd=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=cd(e,r),i=(0,l.path)(Cd(),e)===jt.IN,a=e.parentEntityUri||n;return jp({parentUri:i?t:a,relation:ud(e),entityUri:i?a:t})})),...o.map((t=>{const i=cd(t,r),a=(0,l.path)(Cd(),t)===jt.IN,o=i!==(0,l.pipe)((0,l.path)(Ud()),a?Fd:Md)(t),s=Vd(e,(0,l.path)(wd(),t)),u=t.parentEntityUri||n,c=th(r,i);return o?xp({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(Ud(),t),isReversed:!1}):Mp({oldRelation:(0,l.path)(Ud(),s),newRelation:ud(t)})})),...i.map((e=>kp({relationUri:e}))),...s.map((e=>Fp({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},dd=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return sd({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),yd=(0,l.has)("dataTenant"),fd=(0,l.ifElse)(yd,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),Td=(e,t)=>(0,l.pipe)(Fi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(rl),to)(e,t);function Ed(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){md(e,t,r[t])}))}return e}function md(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>(0,l.prop)("uri",e),bd=e=>hd(e)?e.uri:e,Od=e=>t=>bd(t)===e,vd=(0,l.curry)(((e,t)=>{const r=(t,n)=>{let i=bd(n),a=!1;i.startsWith("!")&&(i=i.slice(1),a=!0);const o=e[i]&&Hi(Yi.READ,e[i]),s=t.find(Od(i))||!o?t:t.concat(hd(n)?Ed({},n,{uri:i}):i);return a?s:(0,l.keys)(e).reduce(((t,n)=>e[n].extendsTypeURI!==i||t.find(Od(n))?t:r(t,n)),s)};return t.reduce(r,[])})),gd=(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=bd(n),a=(0,l.path)([i,t,"objectTypeUri"],e);return!a||r.find(Od(a))?r:r.concat(a)}),[])};return Ed({},t,{entityTypes:[...r("startObject",t.inRelations),...r("endObject",t.outRelations)]})})),_d=(0,l.indexBy)((0,l.prop)("uri")),Ad=(0,l.curry)(((e,t)=>{const r=_d(e.relationTypes),n=_d(e.entityTypes),i=e=>(0,l.evolve)({inRelations:vd(r),outRelations:vd(r),entityTypes:vd(n),nextEntry:i},e);return(0,l.pipe)((0,l.unless)((0,l.either)((0,l.prop)("nextEntry"),(0,l.prop)("entityTypes")),gd(r)),i)(t)})),Nd=(e,t)=>(0,l.evolve)({content:Ad(e)},t),Pd=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)}},Rd=(e,t,r)=>{const n=Xc(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)},Sd="relation",wd=(0,l.always)([Sd,"relationUri"]),Id=(0,l.always)([Sd,"relationType"]),Ud=(0,l.always)([Sd,"object"]),Cd=(0,l.always)([Sd,"direction"]),Dd=(0,l.always)([Sd,"object","attributes"]),Ld=(0,l.always)(["entity","entityUri"]),jd=(0,l.always)([Sd,"startDate"]),kd=(0,l.always)([Sd,"endDate"]),Fd=(0,l.path)(["startObject","objectURI"]),Md=(0,l.path)(["endObject","objectURI"]),xd=(0,l.path)(["startObject","objectTypeURI"]),$d=(0,l.path)(["endObject","objectTypeURI"]),Vd=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(wd()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Vd(r.connections,t);if(e)return e}}},Gd=(0,l.pipe)(Vd,(0,l.path)(Ud())),Wd=(0,l.allPass)([(0,l.pipe)((0,l.path)(Ld()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(Id()),(0,l.complement)(E))]),Bd=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Be()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=Hd({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Yd(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?Pd(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Yd=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:Ln.IN}:{type:t[0],direction:Ln.OUT}:null},qd=e=>e.uri||e,Hd=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Ki(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Ln.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"],pn(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(qd,Fi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Ln.OUT)),(0,l.map)(u))},t)||{}},Jd=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Gi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=xi(e,n.uri);return n&&(!t||yn(e,i,t))&&(!r||yn(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],pn(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],pn(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(bs,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)}},Qd=(0,l.curry)(((e,t,r,n,i)=>{const a=yn(n,l.__,t.type),o=e?$d:xd,s=yn(n,l.__,r.type),u=e?xd:$d;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),Kd=(e,t,r)=>{const n=e?$d:xd,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(yn(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function Xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zd=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,ey=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},ty=e=>ey(e)+e.message,ry=(0,l.unless)(l.isNil,(0,l.prop)("message")),ny=(0,l.unless)(l.isNil,(0,l.prop)("type")),iy=(0,l.curry)(((e,t)=>Ke(t.parentUri,e))),ay=(0,l.curry)(((e,t)=>t.parentUri===e)),oy=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Ke(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",zt.TYPE_REFERENCE),(0,l.pipe)(nr,(0,l.any)(Ke(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),sy=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),ly=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),uy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([my,Zd,iy(e),oy(t),(0,l.complement)(ly(e,t.uri))]))(r)},cy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([my,Zd,ay(e),sy(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",dt.missed))]))(r);return n&&n.message||""},py=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===dt.missed))},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",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(wd(),e))]))(t)},yy=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",dt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},fy=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Zd,iy(t)]))(r)},Ty=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",dt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Ey=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?dh(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 mt.attributeValue:{const e=a;if(vr(a))return Xc(o,e.dataLabelPattern);if(gr(a)){const t=o,i=Ls(t),a=tr(e),s=pn(n,a);return Ge(i)?Xc(r[i],s.dataLabelPattern):t.label}return""}case mt.tempEntity:return Xc(o,a.dataLabelPattern);case mt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=pn(n,null==e?void 0:e.entityType);return`${Zc(i&&Ge(i)?Xc(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Mi(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){Xd(e,t,r[t])}))}return e}({},e,{label:Zc(t)})}))},my=e=>!e.severity||e.severity===ft.ERROR,hy=(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),by=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case zt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(by(n))}));case zt.TYPE_REFERENCE:return!!Rs(t);case zt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Oy=(e,t)=>e.every((0,l.complement)(by(t))),vy=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Ho(e,t.type||t.relationType,!0,r);return n.reduce(((r,n)=>{const i=xs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!As(e.parent))))).forEach((e=>{Oy(e.attrValues,n)&&r.push(zd({type:dt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:de().text("Attribute is required"),source:yt.local}))})),r}),[])},gy=(0,l.curry)(((e,t,r)=>xs(e,t,r,!1))),_y=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),pn(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(br),(0,l.filter)(gr),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(gy(e,t)));return(0,l.pipe)(r,(0,l.reject)(Ls),(0,l.map)((e=>{let{uri:r}=e;return zd({type:dt.missedRefEntity,uri:"",attributeTypeUri:rt(r,t.type),parentUri:r,message:de().text("Entity is required"),source:yt.local})})))(t)},Ay=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Ls,Ge)).flatMap((n=>{const i=Ls(n),a=t[i],o=Ur(e,rt(n.uri,r.type));return Ny(e,t,o,a)})),Ny=(e,t,r,n)=>{const i=nr(r),a=i.map((t=>Ur(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",zt.TYPE_REFERENCE))).flatMap(ar).concat(i);return Py(e,t,n,(e=>a.some(Ke(e.uri))))},Py=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=vy(e,r,n),a=_y(e,r),o=Ay(e,t,r);return[...i,...a,...o]},Ry=(e,t)=>({attributes:{[e.name]:[t]},type:nt(e.uri),uri:nt(t.uri)}),Sy=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Ry(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 Py(e,n,i,a)},wy=(e,t)=>{const r=(0,l.path)(Ud(),t)||{};return vy(e,r)},Iy=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Ld()),(0,l.ifElse)(Ge,(e=>t[e]),(0,l.always)(null)))(r),i=wy(e,r),a=(e=>(0,l.path)(Ld(),e)?[]:[zd({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(Id(),e),parentUri:(0,l.path)(wd(),e),message:de().text("Entity is required"),source:yt.local})])(r),o=((e,t,r)=>r?Py(e,t,r):[])(e,t,n);return[...i,...a,...o]},Uy=e=>(0,l.path)(["entity","uri"],e)?[]:[zd({type:dt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:de().text("Entity is required"),source:yt.local})],Cy=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=vy(e,r),i=Uy(t);return[...n,...i]};function Dy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ly=(e,t)=>{var r,n;const i=pn(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||bo(e)},jy=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),ky=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(jy(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Fy=(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)(js,Ge,l.not)]),(e=>{const t=(0,l.pipe)(js,ze)(e);return ky((e=>e.replace(t,t+Le)))(e)})),(0,l.when)((0,l.pipe)(Ls,Ge),(t=>{const r=Ls(t),n=e[r],i=n&&xy(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){Dy(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),My=(e,t,r)=>Vh(Mh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),Bh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).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)(Fy(r,e.type)),(0,l.map)(ky(lt))))})(e))).concat(zm(e,t)),xy=(e,t)=>(0,l.evolve)({attributes:Fl({valueTransformer:(0,l.pipe)(Ms,Fy(t),jy(lt)),deleteEmptyComplex:!0}),uri:lt})(e);function $y(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){Vy(e,t,r[t])}))}return e}function Vy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gy=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(De,"g"),"uri$$$$").replace(new RegExp(Le,"g"),""))),Wy=e=>(0,l.pipe)((0,l.evolve)({objectUri:Gy,objectParentUri:Gy}),(e=>{return $y({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?dt.missed:dt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&st(e.objectUri),uri:e.objectUri,source:yt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),By=(e,t)=>(0,l.map)((0,l.pipe)(Wy,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Ey(t,s),p=null!=c&&c.length?c.slice(0,-1):Ey(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Ur(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===mt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return $y({},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&&ot(i)){const n=(0,l.last)(a),i=n.valueType;if(gr(i)&&or(i).includes(o)){const i=Ls(n.value),o=i&&Ge(i)?t[i]:null;return o?$y({},e,{parentUri:o.uri,path:a.concat({type:mt.tempEntity,value:o,valueType:pn(r,o.type),label:""})}):e}}return e}})(t)))(e),Yy=e=>{if(e.type===Et.AGO||e.type===Et.WITHIN){const[t,r]=e.period;return"Number"===(0,l.type)(t)&&"String"===(0,l.type)(r)&&t>0}if(e.type===Et.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}},qy=e=>`equals(user, '${Yu(e)}')`,Hy=e=>`equals(items.delta.sources, '${e.abbreviation}')`,Jy=e=>`equals(items.objectType, '${e.uri}')`,Qy=e=>{const{period:t,type:r}=e;if(!Yy(e))return"";switch(r){case Et.WITHIN:return`gte(timestamp, ${X(t)})`;case Et.AGO:return`lte(timestamp, ${X(t)})`;case Et.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 "),Xy=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),zy=e=>{let{query:t,body:r}=e;return t=Xy(t),nu(`/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)(Gc(),Wc(t.globalFilter))(n),activeness:t.activityFilter||Un.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Xr(i)}`},ef=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=Zy(e,t,r);return nu(n)},tf=e=>nu(`/entities/_total?${e}`),rf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(Os),(0,l.map)((0,l.prop)("uri")))(e),i={filter:bn.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(Gc(),Wc(r.globalFilter))([i,a]),s=Xr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Un.ACTIVE_ONLY,max:r.max||4,options:r.searchByOv?"searchByOv":""});return nu("/entities/_typeAheadSearch"+s,{method:"GET"})},nf=(0,l.pipe)((0,l.reject)(l.isNil),Kr),af=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)(Gc(),Wc(i))(r),p=nf({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return zy({query:p,body:d})},of=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return af({fieldName:t,searchParams:i,options:n})};function sf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lf="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",uf=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={filter:(0,l.pipe)(Gc(),Wc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||lf,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Xr(i)}`},cf=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=uf(e,t,r);return nu(n)},pf=e=>mf(e,{select:"secondaryLabel"}),df=(e,t)=>{const{select:r=lf,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),nu("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},yf=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Ge)),ff=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=yf(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Nr(r),m={attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(Gc(),Wc(d.globalFilter))(h);return b&&(m.filter=b),p&&(m.sort=p.field,m.order=p.order),nu(`${s}/api/${o}/${t}/_object`,{method:"POST",body:JSON.stringify(m)})},Tf=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Ef={options:"sendHidden,addRefAttrUriToCrosswalk"},mf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ef;return nu(`/${e}${Xr(t)}`)},hf=(e,t)=>mf(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){sf(e,t,r[t])}))}return e}({},Ef,{explicitSurvivorshipGroup:t})),bf=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 nu(n,r)},Of=e=>nu(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),vf=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return nu(`/${e}/_clone${Xr({executeLCA:!1,valuesToCopy:r})}`,n)},gf=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return nu(`/entities/_events/_total${Kr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},_f=(e,t)=>nu(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",body:t}),Af=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return nu(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",body:JSON.stringify(r)})},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 nu(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Pf=e=>{const t=new FormData;return t.append("file",e),nu("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=fe(e,de().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 nu(`/personal/findSavedSearches${Kr({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=>nu(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),wf=e=>nu("/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 nu(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Uf=e=>{let{uri:t}=e;return nu(`/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"],vt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],vt.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${Xr(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)("/")),Wf=e=>nu(Gf(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Bf=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Gf);return nu(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?xl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Vf,ne,JSON.stringify);return nu(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=Mh(i(t),i(r)).concat($h(t,r));return nu(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 nu(n,i).then($f)},Jf=(e,t)=>nu(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Qf=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Ln.IN?a.inRelations=[n]:a.outRelations=[n],nu(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Kf=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return nu(`${t}/recentSearches${Xr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Xf=e=>nu("/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 nu(`/recentSearches${Xr({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,Kr),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 nu(`/${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 nu(`/${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 nu(`/${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 nu(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=Xr(e);return nu(uT+t,{method:"GET"})},yT=e=>nu(`/activities/_total${Xr(e)}`,{method:"GET"}),fT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return nu(`/${t}/_activities${Xr(r)}`,{method:"GET"})},TT=e=>{const{entityUri:t}=e,r=sT(e,["entityUri"]);return nu(`/${t}/_activities/_total${Xr(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 nu(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})),nu(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 nu(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 nu(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?Xr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(ET({objectURIs:[i]},(0,l.reject)(E,a)))};return nu(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 nu(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 nu(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 nu(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 nu(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 nu(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}=e;return nu(hT({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},LT=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return nu(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 nu(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Kr)(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 nu(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Kr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},FT=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return nu("/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 nu(`/${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 nu(`/${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){WT(e,t,r[t])}))}return e}function WT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BT(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 nu(`${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)}})},QT=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return nu(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},KT=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 QT({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)(Tp,i);return Promise.all([s.length?FT(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return QT({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=BT(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 nu(`${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 nu(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},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 nu(`${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 nu(`${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)(Tp,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=nu,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({},BT(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;return dE({url:uf(t,r,n),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:Zy(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},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${Xr({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:`${Tf(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 nu(`${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 nu(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET",timeout:YT})},bE=e=>{let{dtssPath:t,customerTenant:r}=e;return nu(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r},timeout:YT})},OE=e=>{let{dtssPath:t,tenants:r}=e;return nu(`${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:Tf(t),dataTenant:r,customerTenant:n,dtssPath:i})},gE=()=>nu("/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 nu(`${t}/api/${r}/graph/search${Xr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},PE=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return nu(`${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 nu(`${RE(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},wE=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return nu(`${RE(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},IE=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return nu(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 nu(`${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 nu(`${RE(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},DE=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return nu(`${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 nu(`${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 nu(`${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=Xr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return nu(`${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 nu(`${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 nu(`${t}/settings${Xr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},WE=e=>{let{servicesPath:t}=e;return nu(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},BE=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return nu(`${n}/plugins${Xr({tenant:t,user:r})}`,{method:"GET"})},YE=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return nu(`${n}/configService${Xr({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 nu(`${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),nu(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},QE=e=>nu(`/${e}?showObjectsInfo=true`,{method:"GET"}),KE=e=>{let{exportPath:t,tenant:r,options:n}=e;return nu(`${t}/${r}/activities${Xr(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 nu(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},em=e=>{let{entityUri:t,crosswalk:r}=e;return nu(`/${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 nu("/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 nu(`/${r}/_${n}${Xr({contributorURI:t})}`,{method:"POST"})},nm=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return nu(`/${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 nu(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},am=e=>{let{entityUri:t,crosswalkId:r}=e;return nu(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function om(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{entityTypeUri:t}=e;return nu(`/dataQuality/fillRates${Kr({entityType:ze(t)})}`,{method:"GET"})},lm=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},um=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=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){om(e,t,r[t])}))}return e}({},n===Dt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Dt.ATTRIBUTE_TYPE?Kr({numberOfThreads:lm({attributes:r,metrics:i})||1}):"";return nu(`/entityType/${ze(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},cm=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return nu(`${t}/api/${r}/dataValidationFunctions/entityTypes/${ze(n)}`,{method:"GET",headers:{env:i}})},pm=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Dt.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return nu(`${t}/${r}/entityType/${ze(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},dm=e=>{let{tenant:t,apiPath:r}=e;return nu(`${r}/permissions/${t}`,{method:"GET"})},ym=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return nu(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},fm=e=>{let{attributeUri:t,value:r}=e;return nu(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Tm=e=>{let{attributeUri:t,value:r}=e;return nu(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Em=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return nu(`/${t}${Xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},mm=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Xr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=xl()([[{value:a}]]);return nu(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},hm=e=>{let{entityUri:t,attributeName:r,value:n}=e;return nu(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},bm=e=>{let{entityUri:t,attributeName:r}=e;return nu(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function Om(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vm=e=>{let{entityUri:t}=e;return nu(`/${t}/_historicURIs`,{method:"GET"})},gm=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 nu(`/${t}/_changesWithTotal${Xr(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){Om(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},_m=(e,t)=>nu(`/${e}/_previousChange${Xr({timestamp:t})}`,{method:"GET"}),Am=(e,t)=>nu(`/${e}${Xr({time:t})}`,{method:"GET"});function Nm(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){Pm(e,t,r[t])}))}return e}function Pm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rm=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;const o=r||"GET";let s;return"GET"!==o&&(s=ue(n)?JSON.stringify(n):n),nu(t,{method:o,body:s,headers:Nm({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Sm=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Xr({options:a.join(","),severity:o.join(",")});return nu(`${t}/validate/${i}/entity/${bp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},wm=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return nu(`${t}/validate/${n}/entity${Xr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Im=e=>{let{tenant:t,apiPath:r}=e;return nu(`${r}/tenants/${t}/name`,{method:"GET"})},Um=e=>{let{tenant:t,apiPath:r}=e;return nu(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Cm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return nu(`${a}/preferences${Xr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Dm=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 nu(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Lm=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return nu(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},jm=e=>{const{servicesPath:t}=e;return nu(`${t}/getTokenForWorker`,{method:"GET"})};var km=r(29524);const Fm=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=We(),s={attributes:Pl({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=xs(r,e,n.uri)[0];return i&&i.value?Cl({entity:e,attributeType:n,uri:i.uri,value:t}):Il({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Mm=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Ls),(0,l.filter)(Ge),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),xm=(0,l.curry)(((e,t)=>{const r=Mm(e=e||{},t=t||{});return r.concat((0,l.chain)(xm(e),r))})),$m=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),Vm=$m((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Gm=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Ge)),Wm=e=>(0,l.pipe)(Vm,Gm(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Bm=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Vm,(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})),Ym=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Ge),(0,l.omit)(["uri","timestamp"])),qm=(0,l.pipe)(Ym,Ip),Hm=async(e,t,r)=>{if(!e)return null;const n=Wm(e);if(n.length>0)for(const r of n)e=Bm(r,t[r],e);const i=await bf(qm(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},Jm=async(e,t,r)=>{const n=Km(e,t),i={};for(const t of n)i[t]=await Hm(e[t],i,r);return i},Qm=(0,l.curry)(((e,t)=>{const r=km.Node(t);return Wm(e[t]).forEach((t=>{const n=Qm(e,t);r.addEdge(n)})),r})),Km=(e,t)=>(0,l.pipe)((0,l.map)(Qm(e)),(0,l.map)(km.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Xm=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Ym))})),zm=(e,t)=>[...Yh(e.tags||[],t.tags||[]),...qh(e.roles||[],t.roles||[]),...xh(e,t),...$h(e,t)],Zm=(e,t)=>[...Vh(Mh((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),Bh((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...zm(e,t)],eh=(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 Bm(r,n,e)}),e))))}),t)}),Xm),th=(0,l.curry)(((e,t)=>(0,l.when)(Ge,(0,l.propOr)(l.__,t,e),t)));function rh(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){nh(e,t,r[t])}))}return e}function nh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ih=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return rh({},t,{[r]:{parents:n,children:i}})},ah=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return rh({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},oh=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=Mm(t,i),o=ih({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>oh(n.uri,t,[e],r)),o)},sh=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)(wd(),n),a=t?ah({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Ld(),n),s=Ge(o)?[o]:[],u=ih({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>oh(t,r,[i],e)),u)}),n)},lh=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return sh(r,e,t,oh(e,t))},uh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return lh(t,r,n);if(qe(e)){const t=Vd(n,e);return t&&sh([t],null,r)}return r[e]?oh(e,r):void 0},ch=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>ch(e,t))))},ph=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>ph(e,t))))},dh=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ye(t),u=lh(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(qe(c)){if(s=Vd(i,c),!s)return null;o.push({type:mt.relationConnection,value:s,valueType:Fi(a,(0,l.path)(Id(),s))});continue}if(qe(u)){const e=n[c];if(!e)return null;o.push({type:mt.tempEntity,value:e,valueType:pn(a,e.type)});continue}const p=n[u],d=el(p,c),y=n[c];if(!d||!y)return null;o.push({type:mt.attributeValue,value:d,valueType:Ur(a,rt(d.uri,p.type))}),o.push({type:mt.tempEntity,value:y,valueType:pn(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},ph(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=qe(s),d=p?Gd(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?Fi(a,d.type):pn(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Cr(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:mt.tempEntity,value:T,valueType:pn(a,T.type)}),o.push({type:mt.attributeValue,value:s,valueType:E}),m=s.value;const l=Ls(s);T=l&&Ge(l)?n[l]:null}}return o},yh=e=>e.every((e=>{let{type:t}=e;return[mt.attributeValue,mt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===mt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let fh;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(fh||(fh={}));const Th={[fh.insertAttribute]:{color:"#599E0E"},[fh.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[fh.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Eh=e=>{switch(e){case"UPDATE_ATTRIBUTE":return fh.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return fh.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return fh.deleteAttribute;default:return""}},mh="/",hh=(0,l.pipe)((0,l.split)(mh),(0,l.propSatisfies)((0,l.lte)(2),"length")),bh=(0,l.pipe)((0,l.split)(mh),(0,l.slice)(0,-2),(0,l.join)(mh)),Oh=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>hh(e),Oh(bh(e))]])(t))),vh=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+mh))),gh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Oh(e,t);return(0,l.isNil)(r)?vh(e)(t)?"UPDATE_ATTRIBUTE":"":r},_h=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]},Ah=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(Ah(e))}))}))),t},Nh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(wh,t),(0,l.propOr)([],"crosswalks",e))),e),Ph=(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(Ph(e))}))})),r},Rh=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=Rh(e);r>t&&(t=r)}))})),t+1):t},Sh=(e,t)=>{if(Ge(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},wh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Ih=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Uh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Ch=(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)},Dh=(0,l.eqBy)(wh),Lh=(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)(Ss,(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 jh(e){return e&&void 0!==e.uri}function kh(e){return function(t,r){var n,i,a=[];return i=r,!(n=t)&&!i||!(!n||!i)&&n.length===i.length&&n.every((function(e,t){return e===i[t]}))||a.push({type:e,newValue:r}),a}}function Fh(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 Mh(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(Mh(d.value,y.value,r)):"Reference"===g(d)?Fh(d,y)?o.push.apply(o,Mh(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(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 m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),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}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function xh(e,t){var r,n,i=[];return e.defaultProfilePic!==t.defaultProfilePic?i.push({type:"UPDATE_PROFILE_PIC_BY_URI",newValue:{value:t.defaultProfilePic}}):(r=e.defaultProfilePicValue)===(n=t.defaultProfilePicValue)||jh(r)&&jh(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function $h(e,t){var r=[],n=a(e.startDate,t.startDate);void 0!==n&&r.push({type:"UPDATE_START_DATE",newValue:{value:n}});var i=a(e.endDate,t.endDate);return void 0!==i&&r.push({type:"UPDATE_END_DATE",newValue:{value:i}}),r;function a(e,t){var r;return e!=t&&(r=(0,l.isNil)(t)?"":t+""),r}}function Vh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=Gh(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?Wh(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=Gh(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const Gh=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),Wh=(e,t,r)=>(0,l.pipe)(tl,(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 Sh(t,r)},e=>{let[t]=e;return!As(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function Bh(e,t){for(var r in t=t||[],e)if(e.hasOwnProperty(r))for(var n=e[r],i=0;i<n.length;i++){var a=n[i];if(a.refRelation){var o=a.refRelation[0]||a.refRelation;if(o.crosswalks)for(var s=o.crosswalks.filter((function(e){return e.attributes||e.attributeURIs})),l=0;l<s.length;l++){for(var u=!0,c=0;c<t.length;c++)if(t[c].type===s[l].type&&t[c].value===s[l].value){t[c].attributes=t[c].attributes||t[c].attributeURIs,t[c].attributes=t[c].attributes.concat(s[l].attributes||s[l].attributeURIs),t[c].attributes=Object.keys(t[c].attributes.reduce((function(e,t){return e[t]=!0,e}),{})),delete t[c].attributeURIs,u=!1;break}u&&t.push(s[l])}}}return t}function Yh(e,t){return kh("UPDATE_TAGS").call(this,e,t)}function qh(e,t){return kh("UPDATE_ROLES").call(this,e,t)}function Hh(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){Jh(e,t,r[t])}))}return e}function Jh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Qh=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(ue(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:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(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=Hh({},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:Hh({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Kh=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Kh(t.value):[]];return e.concat(r)}),[])),Xh=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,zh=e=>e?[hp(e)]:[],Zh=e=>{const t=[...Kh((null==e?void 0:e.attributes)||[]),...Kh((null==e?void 0:e.analyticsAttributes)||[])];return e?[...zh(e),...t]:[]},eb=(e,t)=>[e,...t.map((t=>Xh(e,t)))],tb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return fd(t)}))},rb=(e,t)=>{switch(e){case ht.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ht.ENTITY_ATTRIBUTE:case ht.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[nt(t)]})(t);case ht.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ht.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,hp({uri:n,dataTenant:i}),r]})(t)}},nb=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),ib=(0,l.curry)(((e,t)=>{const r=Wo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(ib(e,r.extendsTypeURI)):n})),ab=(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))),ob=(e,t)=>(0,l.pipe)((0,l.prop)("type"),ib(e),ab(t))(t),sb=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 lb,ub=r(33164);function cb(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"}(lb||(lb={}));const pb={},db={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"]}},yb=e=>{if(!pb[e]){const t=db[e]||db.random0;pb[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){cb(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return pb[e]},fb=(0,l.curry)(((e,t)=>{const r=yb(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]})),Tb=e=>fb(lb.Charts,e),Eb=()=>yb(lb.PotentialMatches).colors,mb=e=>fb(lb.Random1,e),hb=e=>(0,ub.getColor)(e)?"#FFFFFF":"#212121";var bb=r(73116);const Ob=Array.from({length:100},((e,t)=>t/100)),vb=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)},gb={},_b=new bb.Z({hash:vb,saturation:Ob.slice(15,71),lightness:Ob.slice(50,90)}),Ab=new bb.Z({hash:vb,saturation:Ob.slice(46,89),lightness:Ob.slice(44,58)}),Nb=(0,l.curry)(((e,t,r)=>{t in gb||(gb[t]={});const n=gb[t];r in n||(n[r]=((e,t)=>{const r=String(vb(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Pb=Nb(_b,"crosswalks"),Rb=Nb(_b,"sources"),Sb=Nb(_b,"contributors"),wb=Nb(_b,"dataValidationFunctions"),Ib=Nb(Ab,"entities");function Ub(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){Cb(e,t,r[t])}))}return e}function Cb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Db=(0,l.has)("items"),Lb=e=>0===e,jb=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)},kb=e=>e.reduce(((e,t)=>e+t.width),0),Fb=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Mb=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),xb=e=>e.reduce(((e,t)=>e+t.height),0),$b=e=>(0,l.is)(String,e)&&e.includes("%"),Vb=(0,l.has)("spacer"),Gb=(e,t)=>Math.max(Math.round(parseFloat(t)/100*e),1),Wb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Db(t)?Wb(t):t)),[]),Bb=(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},Yb=e=>({id:e.layout}),qb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yb;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=$b(r.width)?Gb(i,r.width):u}return jb(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return jb(n,t,r)},o=(e,t)=>Db(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.map((a=>i(t,r,a,Db(a)?n(a.layout):e(a.view)))),s=Bb(t.width,o),u=r.items.reduce(((r,n,i)=>{const o=s[i],u=Lb(i)?t.x:(0,l.last)(r).x+(0,l.propOr)(o,"width",(0,l.last)(r));if(Db(n))return r.concat(p(Ub({},t,{x:u,width:o}),n));{const i=e(n.view);return r.push(Ub({y:t.y,x:u,height:a(i),width:o},i)),r}}),[]);return{x:t.x,y:t.y,width:kb(u),height:Fb(u),items:u}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Db(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Lb(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Db(i))return r.concat(p(Ub({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Ub({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?jb(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?jb(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Mb(i),height:xb(i),items:i}},c=(t,r)=>{const n=(e,t,r,n)=>Lb(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 Ub({},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=Bb(e.width,[o,o]),u=Ub({},e,{width:s[0]}),c=Ub({},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(Ub({},e,{y:n(e,t,a,f),height:f,items:(0,l.filter)(l.identity,[p,d])}))}return t}),[]);return Ub({},e,{height:xb(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(Ub({},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 Ub({},t,{height:y,items:(0,l.reject)(f,[s,p,d])})},p=(e,t)=>{const r=Ub({},t,{items:(0,l.reject)(Vb,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 Wb(f)},Hb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Jb=[Mt.FilteredEntitiesViewFacet,Mt.ActivitiesViewFacet,Mt.ProfileStatsFacet,Mt.FilteredSavedSearchesFacet],Qb=(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=Jb.includes(a.component)?8:4;return Ub({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Kb(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){Xb(e,t,r[t])}))}return e}function Xb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zb={BarChart:Ft.BAR,BarChartGrouped:Ft.BAR,BarChartHorizontal:Ft.BAR,LineChart:Ft.LINE,Map:Ft.MAP,Pie:Ft.PIE},Zb=(e,t)=>it(e)?et(e,t):e,eO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=zb[r];return Kb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},tO=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Kb({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"]))},rO=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Kb({},e,{value:[gn,_n,bn.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Nn(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&it(t)||!r?n:(n||[]).concat((i=r,{filter:bn.EQUALS,fieldName:"type",values:[i]}));var i},nO=["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"],iO={"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:Zb(n,r),filters:rO(a,n,r),chartType:Ft.BAR,component:Mt.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:Zb(n,r),filters:rO(a,n,r),chartType:Ft.BUBBLE,component:Mt.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:Mt.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=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Kb({id:t,count:o,canRead:u,orderType:s,attributeUri:Zb(r,p),filters:rO(a,r,p),component:Mt.DashboardFacet,title:i,showOthers:!0},eO(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:Zb(n,r),filters:rO(a,n,r),chartType:Ft.MAP,component:Mt.DashboardFacet,title:i,geoUrl:nO[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 Kb({id:t,count:o,canRead:l,attributeUri:Zb(n,r),filters:rO(a,n,r),component:Mt.DashboardFacet,title:i,geoUrl:s,chartType:Ft.MAP,projection:"geoMercator"},eO(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.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:tO(i),component:Mt.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:rO(n,null,a),component:Mt.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:bn.GTE,fieldName:"matches",values:["1"]}],component:Mt.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:Mt.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:Ft.CLOUD,component:Mt.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:Ft.TREE,component:Mt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.NotificationInboxFacet,title:n||de().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Mt.ActivitiesViewFacet,title:n||de().text("Activity log")}}},aO=e=>({id:e,height:10}),oO=(0,l.pipe)((0,l.map)((e=>{const t=iO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),sO=e=>{if("0.1"===e.version){const t=oO(e.views),r=qb(aO,e.layout,{columns:4});return{id:e.id,margin:0,layout:Hb(r,t),views:t}}return e},lO=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"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>lO(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function uO(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){cO(e,t,r[t])}))}return e}function cO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pO=uO({},xt,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),dO=e=>e,yO={[pO.Attributes]:dO,[pO.HierarchyTree]:dO,[pO.HierarchyPaths]:dO,[pO.RelationsTable]:dO,[pO.Relations]:e=>uO({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[pO.SingleAttribute]:dO,[pO.Custom]:dO,[pO.AttributeTable]:dO,[pO.Map]:dO,[pO.OldTree]:e=>uO({},e,{class:xt.HierarchyTree}),[pO.OldMap]:e=>uO({},e,{class:xt.Map}),[pO.ImageAttribute]:dO,[pO.PotentialMatches]:dO},fO=(0,l.pipe)((0,l.map)((e=>{const t=yO[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),TO=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===xt.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),EO=(e,t)=>(t||[]).map((t=>uO({},t,TO(e,t.id)))),mO=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return uO({},t,{layout:EO(t.views,e.newLayout)});if("0.1"===e.version){const r=fO(e.views),n=qb(TO(r),e.layout,{columns:3});return uO({},t,{layout:Hb(n,r),views:r})}return e},hO=(e,t)=>e.class===t||e["react-class"]===t,bO=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(hO(t,xt.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(hO(t,xt.SingleAttribute)||hO(t,xt.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(Ke(i))||t.some(Ke(i))}},OO=(e,t)=>e.filter((e=>t.some((t=>hO(e,t))))).map((e=>{let{id:t}=e;return t})),vO=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},gO=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),_O=e=>(0,l.pipe)((0,l.map)((e=>vO(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function AO(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){NO(e,t,r[t])}))}return e}function NO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PO=(0,l.curry)(((e,t)=>lO(t).map((t=>(0,l.pipe)((0,l.map)((e=>vO(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),RO=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),SO=(0,l.propEq)("class",xt.Custom),wO=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},IO=(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=EO(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=>vO(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"]),(0,l.mergeRight)({entityType:n,layout:a,sidePanelViews:i}),(0,l.reject)(l.isNil))(t)}const a=PO(e,t.layout);i=((e,t)=>{if(t.side){var r;const n=(0,l.pipe)((0,l.chain)((e=>vO(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[i,a]=(0,l.partition)(RO,null!==(r=null==n?void 0:n.items)&&void 0!==r?r:[]),o=(0,l.pipe)(PO(e),(0,l.filter)(SO))(AO({},n,{items:i})),s=[{id:"common",views:PO(e,AO({},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=mO(AO({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(_O,(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})},UO=(e,t)=>{if("scroll"===t.layout.layout){const r=PO(e,t.layout),n=sO(AO({},t,{views:r,version:"0.1"}));return{class:Vt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Vt.Dashboard,views:t.views,layout:t.layout,id:t.id}},CO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel,showTimeSeries:r.showTimeSeries}},DO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},LO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},jO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},kO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},FO=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},MO=(e,t)=>{const r=PO(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=gO(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:Vt.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}},xO=(e,t)=>({class:Vt.Graph,id:t.id}),$O=(e,t)=>{const r=PO(e,t.layout)[0];return{class:Vt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},VO=e=>t=>!!(0,l.intersection)(e,t).length,GO=(0,l.cond)([[VO(["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"]),()=>UO],[VO(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>CO],[VO(["com.reltio.plugins.graph.GraphView"]),()=>xO],[VO(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>DO],[VO(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>LO],[VO(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>jO],[VO(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>kO],[VO(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>FO],[VO(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>MO],[VO(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>$O],[l.T,()=>(0,l.always)(void 0)]]),WO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(wO),(0,l.map)((t=>IO(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Vt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:Gt.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:Gt.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=>vO(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Vt.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>vO(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=IO(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Vt.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=lO(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 GO(o)(t,i)};function BO(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 qO=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))},HO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var JO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(JO||(JO={}));const QO={[Vt.DQDashboard]:`${HO}DqDashboard.svg`,[Vt.Dashboard]:`${HO}Dashboard.svg`,[Vt.Graph]:`${HO}Graph.svg`,[Vt.RelationshipSearch]:`${HO}GraphSearch.svg`,[Vt.Interactions]:`${HO}Interactions.svg`,[Vt.PotentialMatches]:`${HO}PotentialMatches.svg`,[Vt.Profile]:`${HO}Profile.svg`,[Vt.NestedProfile]:`${HO}Profile.svg`,[Vt.ProfileActivityLog]:`${HO}ActivityLog.svg`,[Vt.Relationships]:`${HO}Relationships.svg`,[Vt.Sources]:`${HO}Crosswalk.svg`,[Vt.Search]:`${HO}Search.svg`,[JO.DashboardGroup]:`${HO}DashboardGroup.svg`,[JO.ProfileGroup]:`${HO}ProfileGroup.svg`,[JO.SearchGroup]:`${HO}SearchGroup.svg`,DEFAULT:`${HO}Default.svg`},KO=e=>QO[null==e?void 0:e.class]||QO.DEFAULT,XO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Vt.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>BO({},e,{nestedRoute:`${t+1}`})))))),zO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},ZO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?QO[JO.ProfileGroup]:null,ev=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===QO[Vt.Dashboard]||t===QO[Vt.DQDashboard]})),(0,l.always)(QO[JO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===QO[Vt.Search]||t===QO[Vt.RelationshipSearch]})),(0,l.always)(QO[JO.SearchGroup])],[l.T,()=>null]])(e),tv=e=>(0,l.pipe)((0,l.chain)(qO),(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=>BO({},e,{entityTypes:e["entity-types"],screen:WO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=XO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:KO(r),screen:zO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=WO(t,e);return{label:t.label,icon:ZO(t)||ev(r)||KO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function rv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nv=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},iv=e=>({id:e,height:10}),av=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)(nv),(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=oO(((e,t)=>{const r=lO(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){rv(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=qb(iv,t.layout,{columns:4});return{views:r,layout:Hb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function ov(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){sv(e,t,r[t])}))}return e}function sv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lv(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 uv=(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))),cv=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,pv=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),dv=(0,l.pipe)(uv("top-logo"),pv),yv=(0,l.prop)("showLookupCode"),fv=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>vO(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=>vO(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=>vO(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=>vO(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=>vO(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=>vO(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=>vO(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)(ue,(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 ov({thousandSeparator:r,decimalScale:n},lv(t,["groupSeparator","digitsAfterDecimalSeparator"]))})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>vO(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)(uv("default-perspective"),(0,l.ifElse)(cv,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>vO(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=>gO(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return ov({},t,lv(e,["action"]))})))(e))(e),f=(e=>uv("checkUser",e))(e),T=(e=>uv("checkIdle",e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>vO(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=>vO(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),b=void 0===(O=yv(h))||O;var O;const v=null===(t=_O(e))||void 0===t?void 0:t.showEntityId,g=(e=>uv("preview",e))(e),_=dv(e),A=(e=>uv("showAttributeDescription",e))(e),N=(e=>uv("topBackgroundColor",e))(e),P=(e=>(0,l.pipe)((0,l.map)((e=>vO(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=>vO(e,"com.reltio.plugins.search.dev.SearchView"))),(0,l.reject)(l.isNil),l.head,(0,l.path)(["options","showSearchByOv"]))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:b},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(P).length?void 0:P,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSearchByOv:R,showSwitchToClassic:m,showEntityId:v,preview:g,logo:_,showAttributeDescription:A,headerColor:N}},Tv=e=>({layout:tv(e),pivoting:av(e),properties:fv(e)});function Ev(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){mv(e,t,r[t])}))}return e}function mv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hv=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,Ce.x0)()}`;return n[e.id].push(t),i=!0,Ev({},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]++,Ev({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};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}let vv={};const gv=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=z(`${r.id}: ${r.action.files.join('","')}`);if(E(vv[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))}vv=bv({},vv,{[a]:bv({},vv[a]||{},{worker:i})})}else i=vv[a].worker,vv[a].innerText&&t({task:{action:qt.SET_HTML,params:{html:vv[a].innerText}},worker:i,config:r}),i.removeEventListener("message",vv[a].onWorkerMessage);return i&&(vv[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||(vv[a].innerText=n.params.html)}},i.addEventListener("message",vv[a].onWorkerMessage)),i},_v=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Av=(0,l.flip)(_v);var Nv=r(83926);const Pv=(e,t)=>{const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a="",groupSize:o=3,decimalScale:s}=e,l=null!=s?new Nv.Decimal(t).toFixed(s):t,[u,c]=l.split("."),p=new RegExp(`\\B(?=(\\d{${o}})+(?!\\d))`,"g"),d=u.replace(p,r),y=null==c?void 0:c.replace(/(0|\.)+$/,"");return i+d+(y?n+y:"")+a};let Rv;const Sv=()=>Rv,wv={setLocale:e=>{Rv=e},getLocale:Sv,number:e=>((e,t)=>{const r=String(t);try{const t=(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:((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})(e);return Pv(t,r)}catch(e){return console.warn("Number localization error"),r}})(Sv(),e),applyFormatToNumber:Pv},Iv=(0,l.curry)(((e,t)=>null==t?"":("string"!=typeof t&&(t=String(t)),e&&t?wv.applyFormatToNumber(e,t):(!e&&t&&(t=wv.number(t)),t)))),Uv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?de().number(e,"0,0.0a").toUpperCase():de().number(e,"0,0"):""},Cv=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let Dv=!0;const Lv=e=>Dv=e,jv=(e,t)=>e!==t&&t?Dv&&e?`${t} (${e})`:t:e,kv=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Fv=(e,t,r)=>{const n=kv(e,t,r);return jv(r,n)},Mv=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),xv=(0,l.complement)(Mv),$v=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Vv=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)},Gv=(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})))),Wv=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri]||r[Dn],s=i?q(i):"L",u=a?Q(a):"L LTS";switch(n.type){case zt.TYPE_NUMBER:case zt.TYPE_FLOAT:case zt.TYPE_DOUBLE:case zt.TYPE_LONG:case zt.TYPE_INT:case zt.TYPE_COUNT:return t&&Iv(o,t);case zt.TYPE_BOOLEAN:case zt.TYPE_BOOLEAN_RADIO:case zt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?de().text("Yes"):de().text("No");case zt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(tc(t)?rc(t):de().date(t,s));case zt.TYPE_ACTIVENESS_DATE:case zt.TYPE_LOCAL_DATE:return(t=t)&&(tc(t)?rc(t):de().date(t,s));case zt.TYPE_TIMESTAMP:return(t=t)&&(tc(t)?rc(t):de().date(isNaN(t)?t:Number(t),u));case zt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case zt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case zt.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)?jv((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),Bv={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},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)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},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)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},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 Yv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qv=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,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){Yv(e,t,r[t])}))}return e}({},i,{signal:r.signal})).finally((()=>{clearTimeout(a)}))}return e(t,i)},Hv=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()}},Jv=e=>(t,r)=>e(t,r).then((e=>e.ok?e:e.text().then((t=>{let r;try{r=JSON.parse(t)}catch(n){r={errorMessage:t,errorCode:e.status,originalResponse:e}}throw r})))),Qv=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=(0,l.pipe)(qv,(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),Hv,Jv);let u=0,c=[];return{request:(e,n)=>{const i=s(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(u){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 c.push(t),e}return a()},addRequestInterceptor:n,addResponseInterceptor:i,startInterceptorInit:()=>{u+=1},finishInterceptorInit:()=>{u=Math.max(u-1,0),0===u&&(c.forEach((e=>e())),c=[])},removeRequestInterceptor:a,removeResponseInterceptor:o}},Kv="__metadata",Xv=(e=>{const t=[Kv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),zv=(0,l.set)(Xv),Zv=(0,l.view)(Xv),eg=zv(In.NEW),tg=zv(In.REMOVED),rg=zv(In.EDITED),ng=zv(In.IGNORED),ig=(0,l.pipe)(Zv,(0,l.equals)(In.REMOVED)),ag=(0,l.pipe)(Zv,(0,l.equals)(In.NEW)),og=(0,l.pipe)(Zv,(0,l.equals)(In.EDITED)),sg=(0,l.pipe)(Zv,(0,l.complement)(l.isNil)),lg=(0,l.pipe)(Zv,(0,l.equals)(In.IGNORED)),ug=(0,l.omit)([Kv]),cg=(e,t)=>e===Kv?void 0:t;function pg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dg=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=dg(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},yg=(e,t)=>dg((0,l.propEq)("nodeId",t),e),fg=(e,t)=>dg((0,l.pathEq)(["entity","uri"],t),e),Tg=(e,t)=>{const r=yg(e,t);return r.length>1?r[r.length-2]:null},Eg=(e,t)=>{const r=yg(e,t);return r.length>0?r[r.length-1]:null},mg=(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=>mg(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},hg=()=>{},bg=(e,t)=>{let{parent:r,nodeProcessing:n=hg}=t;n(e,r),e.children&&e.children.forEach((t=>bg(t,{parent:e,nodeProcessing:n})))},Og=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Rt.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 Rt.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 Rt.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){pg(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})}}},vg=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&&bg(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Rt.addingChild||r.editingMode===Rt.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Og({node:r,connection:n,isReversed:i}),s=jp({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Rt.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Og({node:r,isReversed:i,connection:n}),l=s?xp({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Mp({oldRelation:e,newRelation:a});t.push(l)}}})})),t},gg=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=gg(r,t);if(e)return e}return!1},_g=(0,l.curry)(((e,t)=>{const r=(0,l.map)(_g(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Ag=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>gg(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:_g(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Ng={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Pg={asc:"asc",desc:"desc"},Rg=Ng.entityLabel,Sg=Pg.asc,wg=(0,l.always)(0),Ig=e=>{let{sortField:t=Rg,sortOrder:r=Sg,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Ng.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return tP.strings.sort(t,a,o)})(n,r);case Ng.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return tP.strings.sort(e,i,a)})(r);default:return wg}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Ug=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Pg)),l.identity,(0,l.always)(Sg))),Cg=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ng)),l.identity,(0,l.always)(Rg)));var Dg=r(91104);let Lg;const jg=(e,t)=>(Lg||(Lg=Dg.createClient({key:t})),new Promise((t=>{Lg.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},Fg=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(As).flatMap((e=>{let r;return e.type==t&&(r=[kg(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Fg(e.value,t))),r})),Mg=e=>e&&e.length>0,xg=(e,t)=>[].concat(e&&e.attributes?Fg(e.attributes,t):[]).filter(l.identity);function $g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vg=(e,t,r,n,i,a)=>{if(e&&e.type){const t=pn(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){$g(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=xg(e,t.latitude),n=xg(e,t.longitude),Mg(r)&&Mg(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(Mg(t)&&t[0].value&&Mg(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)},Gg=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=pn(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 Vg(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?jg(a.label,r).catch((()=>null)):e)).then((e=>ne(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)))},Wg=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=pn(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Ur(e,r.latitude,t.type)&&Ur(e,r.longitude,t.type)){const e=xg(t,r.latitude),n=xg(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))},Bg=(e,t,r)=>Promise.all([Wg(e,t),Gg(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 Yg(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){qg(e,t,r[t])}))}return e}function qg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hg=(e,t)=>t.values.map(Do(e,t.entityTypeUri)),Jg=(e,t,r)=>dl(t.fieldName,r)||Ur(e,et(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Qg=(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?jv(e,t):e}),r)},Kg=(0,l.path)(["attrType","label"]),Xg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Yg({},e,{[t]:!0})),{});e[r]=e[r]?Yg({},e[r],n):n}return e}),{}),zg=(0,l.pipe)((0,l.prop)("values"),E),Zg=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Hn.type.name)),e_=e=>e.type===n_.NUMERIC_RANGE_FACET,t_=e=>e.type===n_.DATE_RANGE_FACET,r_=(0,l.either)(e_,t_),n_={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},i_=e=>{switch(null==e?void 0:e.name){case Hn.type.name:return n_.ENTITY_TYPE_FACET;case Hn.createdBy.name:case Hn.updatedBy.name:case Hn.sourceSystems.name:case Hn.tags.name:case Hn.roles.name:case Hn.matchRules.name:case Hn.MLRecommendedMatch.name:return n_.WITH_DROPDOWN_CHECKBOXES_FACET;case Hn.createdTime.name:case Hn.updatedTime.name:case Hn.startDate.name:case Hn.endDate.name:return n_.DATE_RANGE_FACET;case Hn.matches.name:case Hn.matchScore.name:return n_.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return n_.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return n_.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return n_.DATE_RANGE_FACET;default:return n_.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},a_=(0,l.pipe)(Jg,i_),o_=(0,l.pipe)((0,l.path)(["attrType","type"]),Vr),s_=(0,l.cond)([[e_,(0,l.always)(bn.IN_RANGE)],[t_,(0,l.always)(bn.WITHIN)],[(0,l.allPass)([o_,e=>e.values.length>=2]),(0,l.always)(bn.EXISTS)],[l.T,(0,l.always)(bn.EQUALS)]]),l_=(0,l.cond)([[t_,(0,l.prop)("values")],[e_,(0,l.prop)("values")],[o_,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function u_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const c_=(0,l.pipe)((0,l.path)(["attrType","type"]),jr),p_=(0,l.pipe)((0,l.path)(["attrType","type"]),Mr),d_=(0,l.pipe)((0,l.prop)("attrType"),fl),y_=(0,l.pipe)((0,l.prop)("attrType"),yl),f_=e=>t=>t.values.map((t=>pn(e,t).label)).join(" , "),T_=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),E_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(de().number),T_)),(0,l.join)(","))(e.values);return`${Kg(e)}: ${t}`},m_=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),T_)),(0,l.join)(","))(e.values);return`${Kg(e)}: ${t}`},h_=e=>t=>`${Kg(t)}: ${Hg(e,t).join(", ")}`,b_=e=>t=>{const r=Qg(e,t);return`${Kg(t)}: ${r.join(", ")}`},O_=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[y_,f_(e)],[p_,E_],[c_,m_],[d_,h_(e)],[l.T,b_(t)]]),r))),v_=(e,t,r,n)=>(0,l.pipe)(l.values,(0,l.reject)((0,l.pipe)((0,l.prop)("values"),E)),(0,l.map)((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){u_(e,t,r[t])}))}return e}({},t,{attrType:Jg(e,t,n)}))),O_(e,r))(t),g_=new RegExp(`^${de().text("Search")}`),__=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...v_(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(g_,"",u)]},A_=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Sn),N_=e=>(e=>A_.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]=ic(t);return e.replace(r,i).replace(n,a)}),e))(e),P_=(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}`})),R_={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},S_=e=>[R_.geoPolygon,R_.onMapMove].includes(e),w_=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},I_=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},U_=(e,t)=>S_(e)?t.map(w_):[I_(t)],C_=e=>S_(e)?de().text("Geo Polygon"):de().text("Geo Location"),D_=e=>{switch(e){case R_.geoLocation:return"geoLocation";case R_.geoPolygon:case R_.onMapMove:return"geoPolygon"}},L_={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},j_=e=>de().text(e),k_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[bn.EQUALS]:"=",[bn.NOT_EQUALS]:"≠",[bn.STARTS_WITH]:"*",[bn.MISSING_VALUE]:de().text("missing value"),[bn.HAS_ALL]:de().text("has all"),[bn.IN_RANGE]:de().text("in range"),[bn.FULL_TEXT]:de().text("full text"),[bn.EXISTS]:de().text("exists"),[bn.COUNT_EQUALS]:`${de().text("count")} =`,[bn.COUNT_NOT_EQUALS]:`${de().text("count")} ≠`,[bn.COUNT_LT]:`${de().text("count")} <`,[bn.COUNT_LTE]:`${de().text("count")} <=`,[bn.COUNT_GT]:`${de().text("count")} >`,[bn.COUNT_RANGE]:de().text("count range"),[bn.LT]:"<",[bn.LTE]:"<=",[bn.GT]:">",[bn.GTE]:">=",[bn.IN_FILE]:de().text("in file"),[bn.NOT_IN_FILE]:de().text("not in file"),[bn.CONTAINS]:"~",[On.LIST_EQUALS]:"=",[On.NOT_LIST_EQUALS]:"≠",[On.LIST_EQUALS_CASE_SENSITIVE]:"=",[On.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||de().text(e.toLowerCase())},F_=e=>({type:L_.operator,text:e}),M_=e=>({type:L_.operator,text:j_(e)}),x_=e=>({type:L_.attributeLabel,text:e}),$_=e=>({type:L_.specialAttributeLabel,text:e}),V_=e=>({type:L_.attributeFilter,text:k_(e)}),G_=e=>({type:L_.attributeValue,text:e}),W_=e=>({type:L_.entityTypeLabel,text:e}),B_=()=>({type:L_.space,text:" "}),Y_=()=>({type:L_.bracket,text:"("}),q_=()=>({type:L_.bracket,text:")"}),H_=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),J_=(0,l.curry)(((e,t)=>t.map(H_(e)))),Q_=(0,l.curry)(((e,t,r)=>[e,...r,t])),K_=Q_(Y_(),q_()),X_=Q_(B_(),B_()),z_=(0,l.curry)(((e,t)=>[e,...t])),Z_=e=>z_(W_(e)),eA=e=>z_(W_(`${e}: `)),tA=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Du(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Uu(s),a=Cu(s);!r&&t&&n&&(i.push(Y_()),r=!0),i.push(o),r&&a&&(i.push(q_()),r=!1);const l=e?M_(s):F_(s);i.push(...X_([l]))}else i.push(o),r&&(i.push(q_()),r=!1)}return i}},rA=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),nA=(0,l.pipe)(tA({localizable:!1}),rA),iA=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},aA=e=>{let{data:t,values:r,filter:n}=e;return t&&Rc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},oA=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(aA)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),sA=(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)&&Rr(e.data.attrType)})(e)&&[bn.HAS_ALL,bn.EQUALS,bn.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Pr((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})))),Vv),lA=(e,t)=>(0,l.pipe)(sA,Gv(t))(e),uA=(0,l.pathEq)(["data","fieldName"],Hn.type.name),cA=(0,l.path)(["data","entityTypeUri"]),pA=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),dA=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(gs(e)),attributes:(0,l.filter)((0,l.pipe)(cA,(0,l.anyPass)([l.isNil,gs(e),r=>{const n=(t.entityTypes||[]).filter(gs(e));return(n.length>1?En(e,n):null)===r&&!!pn(e,r)}])))})(t))))),yA=e=>(0,l.pipe)((0,l.prop)("filter"),hu,(0,l.equals)(e)),fA=(0,l.curry)(((e,t,r,n,i,a)=>{const o=dl(n.fieldName)||n.attrType,s=zu(o,i),u=Wv({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Rr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?jv(a.lookupCode,a.value):Fv(r,Pr(o),a)],[()=>fl(s),()=>Do(e,n.entityTypeUri,a)],[()=>Tl(s),()=>ts(e,a)],[()=>vl(s),()=>is(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Mr(c)||Vr(c)),Hu),G_)()})),TA=(e,t,r,n)=>{const i=fA(e,t,r,n.data,n.filter);return(0,l.cond)([[yA(0),(0,l.always)([])],[(0,l.both)(yA(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[B_(),i(r),{type:L_.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[B_(),...(0,l.pipe)(l.flatten,(0,l.map)(i),J_({type:L_.punctuationMark,text:", "}))(t)]}]])(n)},EA=(e,t)=>{const r=!!dl(e.data.fieldName);return(0,l.pipe)(iA,r?$_:x_)(e,t)},mA=(e,t,r,n,i)=>[EA(n,i),B_(),V_(n.filter),...TA(e,t,r,n)],hA=(0,l.addIndex)(l.map),bA=(0,l.propEq)("length",1),OA=(0,l.propSatisfies)((0,l.lt)(1),"length"),vA=(0,l.complement)(l.isEmpty),gA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(ku,(0,l.filter)(aA),Fu,(0,l.map)((n=>({operand:mA(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,tA()))(n)},_A=(0,l.pipe)(gA,l.flatten),AA=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>vp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=gA(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(Z_),(0,l.pipe)(s(eA),(0,l.unless)((()=>bA(u)||i),K_)))(u)},NA=(e,t,r,n)=>(0,l.pipe)(ku,(0,l.filter)(oA),Fu,hA(((n,i,a)=>({operand:AA(e,t,r,n,bA(a)),operator:n.operator}))),tA(),l.flatten)(n),PA=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),tA(),l.flatten),RA=e=>{let{searchType:t,values:[r]}=e;return U_(t,r).join(", ")},SA=(e,t,r,n,i,a)=>{const o=(e=>e?[$_(e.isRawFilter?de().text("Raw filter"):de().text("Search")),...X_([V_(bn.EQUALS)]),G_(`"${e.value}"`)]:[])(i),s=(e=>e?[$_(C_(e.searchType)),B_(),G_(RA(e))]:[])(a),u=(0,l.pipe)(NA,(0,l.when)((e=>OA(e)&&(vA(o)||vA(s))),K_))(e,t,r,n);return PA([o,s,u])},wA=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),IA=(0,l.pipe)(SA,wA),UA=(0,l.has)("attributes"),CA=Array.isArray,DA=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),LA=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=jA(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)(DA(a))),K_),(0,l.concat)(X_([F_(o)]))))(s)},jA=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return UA(n)?LA(e,t,r,n,i):CA(n)?n.reduce(((n,a)=>n.concat(jA(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(X_([F_(n.operator)])))(mA(e,t,r,n,i))},kA=(e,t,r,n,i)=>(0,l.pipe)(jA,l.flatten)(e,t,r,n,i);function FA(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){MA(e,t,r[t])}))}return e}function MA(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=(0,l.complement)(uA),$A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(uA),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(cA),(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}},VA=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=$A(t);return(r||n)&&Lu(t)},GA=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(VA)),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(uA).some((0,l.propEq)("filter",bn.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}=$A(r);if(VA(e))t.push(FA({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(xA)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(uA,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(cA,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(xA),entityTypes:n,operator:i?a:e.operator,id:(0,Ce.x0)()}}));t.push(...n)}var a;return t})(t))),[]))),WA={[bn.EQUALS]:bn.ON,[bn.IN_RANGE]:bn.WITHIN,[bn.GTE]:bn.AFTER,[bn.GT]:bn.AFTER,[bn.LTE]:bn.BEFORE,[bn.LT]:bn.BEFORE},BA=(0,l.curry)((e=>WA[e]||e)),YA=(0,l.curry)(((e,t)=>{switch(e){case bn.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case bn.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),qA=(0,l.pipe)((0,l.path)(["data","attrType","type"]),jr),HA=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>FA({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return qA(e)?(0,l.evolve)({filter:BA,values:YA(t)},e):e}))})))})),JA=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),ec),(0,l.map)(ic))}),QA=(0,l.map)((0,l.cond)([[qA,JA],[l.T,l.identity]])),KA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),GA,dA(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")),QA)})),HA,(0,l.reject)(pA))(r)));function XA(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){zA(e,t,r[t])}))}return e}function zA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZA=(e,t)=>({data:{uri:it(e.fieldName)?et(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||s_(e),id:(0,Ce.x0)(),values:l_(e)}),eN=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=dl(a,t,r)||Ur(e,i);if(!s)return null;if(mr(s))return XA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=vp(e,{type:o}),i=(Ir(e,et(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return XA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),tN=(0,l.curry)(((e,t,r,n)=>KA(eN,e,n,t,r)));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){nN(e,t,r[t])}))}return e}function nN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iN=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},aN=e=>"rdmLookups.not.resolved"===e?Hn.notResolved.name:e,oN=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===An?bn.IN_RANGE:Nn(a),u=aN(n),c=dl(u)||Ur(e,i),p=(0,l.cond)([[()=>gu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>rN({},e,{filename:Cv(e)}))))],[()=>Vr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Ou(s)&&!Array.isArray(e[0])&&!jr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:(0,Ce.x0)(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===An?"and not":"and",filter:s,values:p}})),sN=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(oN(e,En(e,i)));return[{id:(0,Ce.x0)(),operator:"or",attributes:a,entityTypes:i}]})),lN=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),uN=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([lN("from"),lN("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,()=>[]]]),cN=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return rN({},r,{values:uN(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?sl(e.fieldName,n):e.fieldName})},pN=(e,t)=>{if((0,l.has)("children")(e)){const r=cN(e,t);return e.children.reduce(((e,n)=>(e.push(pN(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return cN(e,t)},dN=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(cN(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(rN({fieldName:e.fieldName},cN(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(pN,l.flatten)],[l.T,cN]]),yN=(0,l.pipe)((0,l.map)(dN),l.flatten),fN=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},TN=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=sN(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:yN(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>rN({},t,{type:a_(e,t)}))).map((e=>rN({},e,{values:r_(e)?fN(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 ZA(r,t)})),operator:"or",id:(0,Ce.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=>({[aN(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[rN({},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 tN(e,t,r,p)},EN=(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)(zg),(0,l.partition)(Zg))(t),i=n.map((t=>XA({},t,{type:a_(e,t)}))).map((e=>ZA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:(0,Ce.x0)(),entityTypes:a}]})(e,a);return tN(e,t,r,o)})(e,t,r,n):TN(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},mN=e=>"2.0"===e.version?e.keyword:iN(e),hN=e=>(0,l.pathEq)(["object","uri"],e),bN=(e,t)=>(0,l.pipe)((0,l.find)(hN(e)),(0,l.prop)("object"))(t),ON=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"),hN(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=bN(r.match,t)||n[r.match];return i?{label:Zc((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return Co(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)},vN=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),gN=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),_N=(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:Zc((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return Co(e,o.type,t)||{label:t,uri:t}}))}})))(t),AN=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)},NN=(0,l.path)(["object","uri"]),PN=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},RN=e=>e.getValue(),SN=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=SN(n[e],t),!r);e++);return r},wN=(e,t)=>{const r=[],n=(0,l.pipe)(RN,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(wN,[t]),a);return r.push.apply(r,o),r};function IN(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){UN(e,t,r[t])}))}return e}function UN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CN=(e,t)=>!!e[t],DN=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},LN=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||[]])},jN=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return IN({},t,{[r.uri]:IN({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:LN(null==o?void 0:o.parents,n),children:LN(null==o?void 0:o.children,i),values:LN(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},kN=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=pn(r,t)||Fi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return ps(r,n,i).flatMap(ys).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Ur(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=jN({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>jN({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},FN=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Ge(e.uri)&&Je(e.type)&&Je(t)&&!t.startsWith(e.type))(n,t))return e;const i=xs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(As),(0,l.map)(DN))(i);return jN({structure:e,attrType:e[t].attrType,values:a})}),t)},MN=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 CN(e,r)}));return r||n?t.filter(As).reduce(((e,t)=>MN({structure:e,attributeValue:t})),e):e}),t);{const e=r;return CN(t,e.type)?jN({structure:t,attrType:t[e.type].attrType,values:[DN(e)]}):t}},xN=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?IN({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},$N=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=xs(i,n,r)||[];return a.length?jN({structure:t,attrType:t[r].attrType,values:a.filter(As).map(DN)}):t},VN=(e,t,r)=>{const n=Ye(e),i=Ye(t);return n===i?((e,t)=>{const r=st(t),n=st(e);return Ke(n,r)||((e,t)=>at(e)&&!at(t)&&Ke(t,e))(n,r)})(e,t):!(!r||!ot(t))&&ch(r,i).includes(n)},GN=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},WN=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?lh(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return VN(r,t,o)}))},BN=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>BN(e,t,r)))))},YN=(e,t)=>{var r;return null==e||null===(r=e[t])||void 0===r?void 0:r.isTouched},qN=(e,t,r,n,i)=>{let{uri:a,value:o}=r;const s=a!==t&&GN(n,e);return{type:e,uri:a,lookupValue:o,autopopulate:s,useDefaultValue:s&&!YN(i,a)}},HN=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s,editorsState:l}=e;const u=t[r],c=Ye(n),p=uh(c,o,i,a),d=BN("children",t,u),y=BN("parents",t,u),f=d.flatMap((e=>BN("parents",t,e))).filter((e=>![...y,u,...d].includes(e))),T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return VN(t,n,p)})).map((t=>qN(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 VN(n,t,p)||Ye(t)!==c&&VN(t,n,p)})).map((t=>qN(e.attrType.uri,n,t,s,l))))),m=f.flatMap((e=>{const r=BN("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)&&VN(n,t,p)}))})).map((t=>qN(e.attrType.uri,n,t,s,l)))}));return[...u.values.filter((e=>{let{uri:t}=e;return VN(t,n,p)})).map((e=>qN(r,n,e,s,l))),...E,...m,...T]},JN=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=Wv({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=>Xc(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[vr,()=>a(n)],[Rr,()=>(e=>{const r=o(e),n=Pr(t);return lu([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Fv(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:bn.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(KN(r,t)):i.push(XN([t],r)),i},KN=(e,t)=>{const r=hr(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=vr(i)?KN(i,t[r]):[XN(t[r],i)];return e.push(...a),e}}),[])},XN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Nr(t.uri),filter:t.type===zt.TYPE_BLOB?bn.FULL_TEXT:bn.EQUALS,values:e}:{fieldName:Nr(t.uri),filter:bn.MISSING_VALUE},zN=(e,t)=>(0,l.equals)(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),ZN=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:zN}},eP={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},tP={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(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}},29524:(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=5740.js.map