@reltio/remotes 1.4.1408 → 1.4.1409
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/3273.js +1 -1
- package/3273.js.map +1 -1
- package/{1689.css → 4407.css} +2 -2
- package/4407.css.map +1 -0
- package/4407.js +2 -0
- package/4407.js.map +1 -0
- package/447.js +1 -1
- package/447.js.map +1 -1
- package/4843.js +1 -1
- package/6413.js +1 -1
- package/6413.js.map +1 -1
- package/6495.js +1 -1
- package/6495.js.map +1 -1
- package/6913.js +1 -1
- package/6913.js.map +1 -1
- package/9043.js +1 -1
- package/9043.js.map +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/remoteEntry.js.map +1 -1
- package/1689.css.map +0 -1
- package/1689.js +0 -2
- package/1689.js.map +0 -1
package/6495.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6495],{55046:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Ms,IL3:()=>Gp,PY2:()=>on,Ng6:()=>Ne,YJ7:()=>zr,NlI:()=>Vr,XYV:()=>Kr,Xt7:()=>Oe,wfT:()=>Wn,EMD:()=>Un,HAc:()=>ve,PEf:()=>pn,oA3:()=>In,$XE:()=>Ve,eWf:()=>un,q7e:()=>ge,KVe:()=>Bn,WVQ:()=>Or,oZZ:()=>Zn,bNA:()=>ei,Rjq:()=>ti,G39:()=>yn,W0P:()=>Je,X1H:()=>He,yn8:()=>Fe,N0y:()=>ke,dZX:()=>Ge,bQt:()=>ni,oS0:()=>Ze,bZE:()=>Hr,Nsj:()=>en,psV:()=>Xr,xPW:()=>sn,pyR:()=>Fn,p8l:()=>Ln,Wkf:()=>be,zHr:()=>he,NIO:()=>me,$26:()=>sg,Esk:()=>Nn,s9T:()=>je,MEy:()=>gu,j5E:()=>$r,vAw:()=>wn,NMQ:()=>Sn,eVu:()=>$u,YGb:()=>Ke,mNm:()=>Dn,Y1q:()=>jE,s_5:()=>Mn,RgZ:()=>jn,unl:()=>zn,Qy0:()=>ri,pYu:()=>An,wIJ:()=>Ug,GFH:()=>Re,Ury:()=>fn,S91:()=>Tn,p3$:()=>si,wSh:()=>Z,BDP:()=>mi,pGS:()=>kn,ARY:()=>et,XGc:()=>Gn,fO_:()=>Rr,wwy:()=>Ue,h_8:()=>mn,_XL:()=>Zr,j2V:()=>Yn,dMV:()=>$n,NBX:()=>IA,OXy:()=>tt,BXd:()=>Me,KM9:()=>Ae,CJB:()=>Qn,lXI:()=>Ye,nqG:()=>ai,C68:()=>dn,yxQ:()=>ii,Yj_:()=>Ce,D25:()=>we,ZIY:()=>We,Tl4:()=>Mg,lwr:()=>cn,NkU:()=>qn,Rtp:()=>Vn,YGx:()=>xe,uTS:()=>xn,MCv:()=>_e,IYE:()=>Cn,PiC:()=>Xn,MVv:()=>Xe,h_m:()=>qe,DUe:()=>Qr,tJI:()=>Pe,fDt:()=>Se,cNQ:()=>Hn,SwE:()=>Pn,ZHR:()=>Jn,PYu:()=>Qe,lD1:()=>En,lVm:()=>$e,vnX:()=>Uv,$x5:()=>Cv,_R1:()=>wv,wUm:()=>Iv,z7V:()=>oi,dC6:()=>De,MBD:()=>Ie,GmF:()=>Ki,cKm:()=>Be,iP_:()=>ln,NVC:()=>Le,tPT:()=>pl,tZe:()=>ad,kRE:()=>yf,psB:()=>ff,X0$:()=>cl,zE1:()=>vl,Wm5:()=>el,vyX:()=>gc,wLZ:()=>dl,W4V:()=>se,EtK:()=>bs,Wtd:()=>ul,asT:()=>GA,kGs:()=>sm,ewt:()=>XT,O_f:()=>Tu,sOy:()=>Nt,Tde:()=>Zt,LMI:()=>ac,skb:()=>R_,sPt:()=>Ju,sH1:()=>Xu,RPM:()=>Sm,h27:()=>Tc,Uqd:()=>vc,xG:()=>$_,Z2f:()=>qO,fgW:()=>s_,I69:()=>C_,ZxB:()=>j_,mdt:()=>_m,Qbq:()=>HE,rny:()=>Ci,UEY:()=>Ea,Q0T:()=>Ta,Lyr:()=>_a,sBn:()=>fa,itK:()=>ca,H9$:()=>ya,KPc:()=>da,zos:()=>pa,ELQ:()=>Aa,dZs:()=>ea,Cz4:()=>Zi,z_L:()=>va,fGe:()=>zi,iuF:()=>la,Wib:()=>ua,Hn0:()=>ga,obS:()=>Na,E$L:()=>ta,XUh:()=>sa,Qp_:()=>aa,_jk:()=>ra,sKE:()=>na,WmG:()=>oa,QKx:()=>ba,Oik:()=>ha,s0A:()=>ia,o9m:()=>ma,MCd:()=>Oa,RsS:()=>Ec,tGK:()=>Bl,lIv:()=>gl,Vg3:()=>xi,mkC:()=>Pi,xv5:()=>Vi,a14:()=>Si,yv0:()=>$i,Zm0:()=>Ri,Nxd:()=>Ni,$mM:()=>Mi,ifj:()=>gr,NWi:()=>pv,xr3:()=>cv,wNf:()=>eu,iJH:()=>dv,d89:()=>gi,Edd:()=>_i,Z5t:()=>Ai,uGe:()=>bi,UoR:()=>hi,xvW:()=>uv,$qe:()=>lv,yPM:()=>Xi,$cp:()=>Ol,vKJ:()=>hl,VtG:()=>zc,AID:()=>pT,B1H:()=>SA,b7X:()=>BE,$uE:()=>cm,keo:()=>qE,C_p:()=>ph,G27:()=>hb,JA0:()=>tf,b3T:()=>om,oC6:()=>im,_Zs:()=>am,epC:()=>dm,YYG:()=>pm,f_2:()=>nf,w3l:()=>cA,QHB:()=>mb,Jso:()=>mA,RXH:()=>rb,Vr9:()=>Rb,lMm:()=>AO,BlA:()=>zA,fmQ:()=>ps,yRD:()=>X_,NcL:()=>mh,QK6:()=>de,ymd:()=>Vp,JV_:()=>wf,XiW:()=>IT,Yrx:()=>Gy,GPx:()=>ll,gjI:()=>sl,vlo:()=>TE,E_P:()=>mm,aAL:()=>Sp,NBq:()=>ds,wp9:()=>gm,DsR:()=>gp,MPc:()=>ET,gWE:()=>mT,DT_:()=>hT,ipn:()=>OT,ORg:()=>fi,_wz:()=>bT,RYR:()=>qT,PP2:()=>Hy,wS7:()=>ZO,cBQ:()=>op,pBq:()=>Kf,DsO:()=>ee,X78:()=>Uf,xZs:()=>Nf,YFy:()=>By,Gmt:()=>hf,K$w:()=>mf,DSj:()=>wp,Mfr:()=>Yy,k9j:()=>lp,ww$:()=>yl,WVU:()=>Ef,hxF:()=>rl,E7G:()=>Hd,nwO:()=>tN,Mzk:()=>tp,aFF:()=>ZE,HRH:()=>Nu,EZK:()=>md,Kxm:()=>yd,Z9i:()=>qm,CrF:()=>uf,DNd:()=>Ra,vUy:()=>HA,lJh:()=>Su,zHo:()=>wu,sEJ:()=>CA,UO$:()=>tT,zeJ:()=>ar,dLR:()=>_s,JQy:()=>Ds,XtP:()=>vs,Ug0:()=>Fr,A1W:()=>YE,sw:()=>Ed,nv3:()=>Ov,JgD:()=>bv,nve:()=>LA,SkP:()=>ks,SAs:()=>Xf,i5L:()=>Fs,PWK:()=>Po,IM5:()=>gs,Aup:()=>Pb,Mfk:()=>wO,HQx:()=>$o,oN$:()=>xo,mB6:()=>KO,p6d:()=>w,o0x:()=>U,ufS:()=>kO,k7L:()=>FO,mrB:()=>I,ncP:()=>bt,Zmi:()=>ft,hm5:()=>Et,ECL:()=>Nr,vPL:()=>Od,qmL:()=>LE,hPi:()=>Hf,hXd:()=>ji,OCS:()=>Di,p2l:()=>$s,qF1:()=>Wp,_X$:()=>Bp,yj2:()=>Rg,bzh:()=>Pm,k66:()=>ko,kiP:()=>Xa,pSg:()=>ce,kz_:()=>Xy,H_U:()=>Mo,t9e:()=>ja,j2$:()=>od,PFL:()=>Gt,aJ3:()=>zv,To9:()=>er,wpo:()=>$d,ADq:()=>Vm,UUb:()=>xm,tQX:()=>$m,xy8:()=>qt,EUG:()=>or,AFK:()=>Ut,X3M:()=>ir,WN0:()=>Fo,kDl:()=>As,uDV:()=>CE,IhQ:()=>Is,pfb:()=>Cs,R$r:()=>Em,w80:()=>fo,Pfu:()=>Ca,Gtj:()=>Dl,fyF:()=>jl,kkq:()=>Do,u5q:()=>Ot,O$n:()=>Md,ptG:()=>xd,f4_:()=>Ph,uap:()=>Nh,d7q:()=>Vy,liG:()=>Qy,$oF:()=>$y,avf:()=>aE,DiQ:()=>iE,cfX:()=>nE,vD3:()=>sE,Qrb:()=>rE,EJQ:()=>oE,HWy:()=>tE,gjS:()=>KT,y6v:()=>eE,JUW:()=>af,GtP:()=>xh,_kX:()=>wa,u1e:()=>Ia,sJj:()=>JE,CJp:()=>Fh,uKF:()=>KE,wo0:()=>df,s5:()=>wo,cwx:()=>So,Y6b:()=>Iy,TTx:()=>gf,UtR:()=>Uy,HaQ:()=>_f,E6I:()=>lf,Won:()=>Ly,vTU:()=>Sy,Nsy:()=>Sd,KMQ:()=>zE,Do$:()=>Cd,CSV:()=>Ws,TMe:()=>Cy,l1V:()=>Uu,RHh:()=>xu,VQ1:()=>Fu,cGG:()=>ku,z7d:()=>EE,Xaq:()=>Wo,Sj8:()=>JA,PJj:()=>Vl,k3T:()=>xr,PjQ:()=>Ei,s7l:()=>qc,jLA:()=>$h,GGR:()=>pE,j5q:()=>uE,DnY:()=>Wc,RY5:()=>PE,Px$:()=>HT,KPC:()=>NA,NIY:()=>Zc,HvW:()=>Qc,Fof:()=>Da,BXy:()=>Kc,fX:()=>Vh,BTI:()=>jd,uie:()=>_d,ChB:()=>hd,q27:()=>Gd,vrC:()=>$b,fAQ:()=>Df,XkT:()=>Gc,lrH:()=>kf,nt9:()=>Cr,XH8:()=>Fd,XH2:()=>Mr,jFi:()=>kd,qhs:()=>yo,wwR:()=>Ld,Uk3:()=>Ct,ev7:()=>wA,RB9:()=>ef,iFp:()=>Im,e$p:()=>Cm,PcX:()=>Lm,SpP:()=>Um,R6_:()=>eg,CY1:()=>lg,Ajk:()=>Fc,Yiz:()=>kc,FK9:()=>Ic,UOo:()=>MO,aTW:()=>Of,uug:()=>Zl,P$2:()=>pg,XS2:()=>Yl,Hyb:()=>pu,d3Y:()=>Pc,Klp:()=>Sc,WxZ:()=>dg,Gzu:()=>Iu,ZOr:()=>Vc,uqV:()=>Ny,Pm4:()=>re,hWO:()=>St,nHA:()=>wh,nVD:()=>SE,_tF:()=>Wu,dED:()=>My,P2h:()=>Fy,jrr:()=>Ha,mmY:()=>Ka,T6O:()=>Vo,h6J:()=>rd,hM2:()=>OA,XR6:()=>X,jmz:()=>UE,IHt:()=>IE,NZI:()=>Ym,wdF:()=>Lf,YNv:()=>WE,IFm:()=>GE,o_F:()=>kE,kgP:()=>jf,ZYI:()=>Fp,QXK:()=>Il,efz:()=>Ul,Q5d:()=>wl,Ysv:()=>Cl,UWq:()=>bE,ocC:()=>hE,io3:()=>Dr,Sbt:()=>Eo,roS:()=>To,Ww1:()=>mo,QaS:()=>rp,ERZ:()=>lA,CL1:()=>vA,idV:()=>Td,nIW:()=>Rt,fjE:()=>tg,sG0:()=>VO,tV7:()=>Gl,g8o:()=>kg,Qy:()=>Dg,t2P:()=>Xv,KbW:()=>ro,wId:()=>io,LS0:()=>ao,bFH:()=>dy,Rgl:()=>fy,fW1:()=>hh,GFW:()=>Af,Ywp:()=>Nv,pg:()=>Kd,WSA:()=>Ty,fed:()=>hA,tT_:()=>Us,BgZ:()=>Ls,xIV:()=>js,KbL:()=>Yc,JBA:()=>kt,aNC:()=>hv,RFJ:()=>kp,Zeh:()=>eT,OT5:()=>Av,mC3:()=>Al,kR6:()=>XA,gFw:()=>Rh,NVY:()=>Om,k6v:()=>Yp,FEC:()=>qp,L5S:()=>hm,Ob5:()=>Wd,KUV:()=>Bd,dvH:()=>bm,V3i:()=>Ib,VD3:()=>kr,mm2:()=>Du,rou:()=>Wf,izH:()=>Ua,DK$:()=>La,KMp:()=>Rp,c31:()=>it,mbo:()=>Wm,gT8:()=>st,CZ8:()=>us,uGi:()=>Ts,Poc:()=>rt,_9k:()=>hs,ZTM:()=>ys,bwT:()=>Es,tzW:()=>ut,tF$:()=>ot,o96:()=>cs,M4S:()=>ms,_vs:()=>Op,xF8:()=>JT,PUO:()=>em,ATu:()=>Gm,j1S:()=>di,V3K:()=>ci,Lmx:()=>pi,ZaZ:()=>nt,n_1:()=>Ry,N6e:()=>Ap,SxO:()=>Qa,w3p:()=>vm,xU7:()=>pe,Y_p:()=>Oo,$k6:()=>bo,Gdl:()=>WO,U6P:()=>GO,OwB:()=>Zv,hTh:()=>wE,xqc:()=>Io,JvE:()=>Uo,i29:()=>cc,dzT:()=>Ii,uPS:()=>ap,cZV:()=>ip,n3B:()=>f_,e6O:()=>l_,s7j:()=>Ig,j$Q:()=>of,kW2:()=>Mh,tH7:()=>Ro,Yxg:()=>Qs,MaZ:()=>cE,nqN:()=>lE,jWj:()=>vE,o_J:()=>Bo,hgZ:()=>bd,yW4:()=>nd,uT0:()=>ed,C82:()=>td,bsH:()=>Sh,u9Z:()=>Gf,J$m:()=>Py,j_Q:()=>Cc,OaI:()=>Lc,wB1:()=>RA,SP6:()=>Qd,ZYr:()=>AA,IMU:()=>Dp,FoU:()=>rf,DVz:()=>QO,mxe:()=>d_,FHr:()=>zf,D1g:()=>Bf,VO3:()=>kv,de5:()=>Dv,Uw1:()=>Te,J6q:()=>Bm,XCe:()=>Ba,fbl:()=>Pv,Ir:()=>eo,XQO:()=>to,QXb:()=>ay,zXF:()=>DE,P8_:()=>Rf,iiD:()=>Pp,MOC:()=>oy,WF:()=>iy,xE1:()=>Ti,idW:()=>$A,QWZ:()=>LO,YL3:()=>ep,Fn9:()=>T,j2U:()=>xs,MpE:()=>ct,kQw:()=>Bt,mfm:()=>du,vZp:()=>Lt,E8K:()=>kA,VSb:()=>ss,vr_:()=>Wt,Vmh:()=>qA,FgW:()=>wb,oDv:()=>qo,fGG:()=>jO,kuw:()=>Qo,eHk:()=>OE,Tt2:()=>Yo,pQZ:()=>Ko,oZ7:()=>DO,T6Y:()=>Tr,_26:()=>lu,YkM:()=>zt,J6y:()=>Ql,njU:()=>ru,TBP:()=>Ho,IT0:()=>Hm,x_:()=>XE,biM:()=>Id,TMl:()=>Ud,Vkd:()=>au,WiY:()=>ag,_zi:()=>ou,J6D:()=>ju,Lt4:()=>ur,QEi:()=>rr,whI:()=>wr,KIu:()=>Ur,JhM:()=>oe,C_0:()=>hr,lzc:()=>qd,qIF:()=>T_,O27:()=>E,aBi:()=>Vd,xOX:()=>Zs,EdS:()=>_t,WgC:()=>gt,eEv:()=>$t,A4t:()=>nu,YOQ:()=>Dt,Wos:()=>yr,jWr:()=>Pa,Or$:()=>Xt,lhE:()=>jr,CwH:()=>tr,pzC:()=>Js,ymH:()=>tu,QZu:()=>Kt,rYH:()=>ig,FVt:()=>dr,Kn2:()=>ue,jgw:()=>yu,Qgr:()=>Lu,OXP:()=>os,lS4:()=>nr,g5f:()=>og,fp6:()=>Xl,Uty:()=>Bi,YkG:()=>Jt,xdS:()=>lt,kMF:()=>vT,$NE:()=>At,bC9:()=>vt,Ian:()=>yi,KVV:()=>QE,q9e:()=>ho,iIf:()=>BO,ian:()=>nl,m6e:()=>br,OFd:()=>Xs,kqr:()=>Yt,fnZ:()=>Sr,VFZ:()=>il,ZiX:()=>mt,j5n:()=>cr,zkt:()=>_,Pcm:()=>PA,QDV:()=>Ks,M5u:()=>ng,laD:()=>y_,mtq:()=>xt,CtB:()=>YO,CBv:()=>ae,I0t:()=>mr,u1G:()=>fE,gk1:()=>c_,Bgb:()=>u_,uzs:()=>Ir,v0l:()=>Hu,Zqp:()=>jy,j0k:()=>No,tCm:()=>It,gmx:()=>ql,mOr:()=>_u,TwZ:()=>Fg,GyU:()=>vv,zGm:()=>zd,bMg:()=>by,EyD:()=>ov,FQA:()=>sv,fZN:()=>gy,xsF:()=>iv,Lxg:()=>av,O3l:()=>cp,Wni:()=>up,wRx:()=>fv,OxG:()=>uy,uJQ:()=>ly,qWg:()=>HO,i96:()=>Jd,zhn:()=>yv,G8q:()=>li,Jct:()=>VT,A9Y:()=>te,Y5F:()=>eA,gxP:()=>le,c$P:()=>Hl,M7o:()=>Oc,BBN:()=>qa,ZBU:()=>J,UkJ:()=>oo,xkv:()=>Pf,z$M:()=>VA,KAm:()=>Zy,lCl:()=>dT,rkF:()=>dh,IU6:()=>pd,RGr:()=>h,aYu:()=>m,ije:()=>xl,Buf:()=>Np,YLu:()=>Ml,ct9:()=>go,XkY:()=>Oy,T5R:()=>Zd,uQS:()=>_y,wcJ:()=>vo,d$I:()=>fl,rSp:()=>wd,Sx:()=>Xc,Ilm:()=>_l,Ki6:()=>tl,VGk:()=>vp,sFD:()=>nb,eWN:()=>WA,dWE:()=>wg,Lkd:()=>UT,aDL:()=>rT,yaA:()=>Ay,lOh:()=>qf,DBr:()=>Qv,hK$:()=>Wl,TZ_:()=>cd,CMB:()=>E_,FU8:()=>Jc,J$p:()=>oT,b5s:()=>aT,h2W:()=>wt,SL_:()=>xf,oUH:()=>Xp,ck9:()=>ey,RAb:()=>Gu,nL:()=>$O,k$p:()=>ab,Xs0:()=>Fl,u7I:()=>Yf,rxg:()=>mu,bji:()=>hu,oCZ:()=>sh,MjG:()=>jv,FuV:()=>Jp,$ju:()=>Zp,t6d:()=>zp,m5F:()=>fe,sx:()=>BA,rSc:()=>JO,U10:()=>jc,L8n:()=>Tf,R9X:()=>wy,rj2:()=>If,_C4:()=>sd,tCj:()=>Sf,uAg:()=>Wy,wx9:()=>zT,KF3:()=>ld,ax9:()=>ud,HH7:()=>_p,ufV:()=>qy,_6y:()=>sp,XTh:()=>Sv,AJo:()=>np,Ixr:()=>sf,P6Y:()=>rN,Bd_:()=>nh,xkB:()=>rh,W41:()=>Vf,WkI:()=>$f,sSE:()=>th,GMd:()=>oc,jtL:()=>sc,Bxm:()=>ah,FVh:()=>Jm,U_T:()=>Ey,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Ru,Ls5:()=>Pu,$bd:()=>Ou});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,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>zo,editAttribute:()=>Zo,editEndDate:()=>as,editRoles:()=>rs,editStartDate:()=>is,editTags:()=>ns,removeAttribute:()=>ts});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>sm,collectCrosswalksFromAttributes:()=>cm,compareActivenessAttributes:()=>om,compareAttributes:()=>im,compareImages:()=>am,compareRoles:()=>dm,compareTags:()=>pm});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Tm});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.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),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"),L=(0,l.equals)("99"),j=(0,l.equals)("9999"),D=(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")],[L,(0,l.always)("MM")],[D,(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")],[L,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[j,(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),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[L,(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,Q=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},K=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)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},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},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=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)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;var Ee=r(76665);let me,he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,je,De,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe;var ze;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(me||(me={})),function(e){e.local="local",e.validationService="validationService"}(he||(he={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(be||(be={})),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"}(Oe||(Oe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ve||(ve={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ge||(ge={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(_e||(_e={})),function(e){e.asc="asc",e.desc="desc"}(Ae||(Ae={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ne||(Ne={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Pe||(Pe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Re||(Re={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Se||(Se={})),function(e){e.PROFILE="profile",e.MAP="map"}(we||(we={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ie||(Ie={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ue||(Ue={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ce||(Ce={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(De||(De={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(ke||(ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Fe||(Fe={})),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"}(Me||(Me={})),function(e){e.IN="in",e.OUT="out"}(xe||(xe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}($e||($e={})),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"}(Ve||(Ve={})),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"}(Ge||(Ge={})),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"}(We||(We={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Be||(Be={})),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"}(Ye||(Ye={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(qe||(qe={})),function(e){e.NEW="new",e.CLASSIC="classic"}(He||(He={})),function(e){e.ASC_BY_NAME="ascByName"}(Qe||(Qe={})),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"}(Ke||(Ke={})),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"}(Je||(Je={})),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"}(Xe||(Xe={})),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"}(ze||(ze={}));const Ze=ze;let et,tt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(et||(et={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(tt||(tt={}));const rt=(0,l.prop)("referencedEntityTypeURI"),nt=(0,l.prop)("relationshipTypeURI"),it=(0,l.prop)("referencedAttributeURIs"),at=(0,l.curry)(((e,t)=>(0,l.pipe)(it,(0,l.filter)((0,l.startsWith)(e)))(t))),ot=at("configuration/relationTypes"),st=at("configuration/entityTypes"),lt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),ut=(0,l.filter)(lt),ct=(e,t)=>!t||t.some((t=>t===e.uri)),pt="1Tempo4rary",dt="1Tepmo4Rel",yt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ft=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Tt=e=>()=>ft(e),Et=(e,t)=>{const r=yt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return ft(n)},mt=e=>e&&e.includes("uri$$"),ht=Tt("entities"),bt=Tt("relations"),Ot=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),vt=(0,l.startsWith)("relations/"),gt=(0,l.startsWith)("entities/"),_t=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),At=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Nt=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Pt=(0,l.pipe)((0,l.split)("/"),l.head),Rt=(0,l.pipe)((0,l.split)("/"),l.last),St=e=>e.split(".").slice(0,2).join("."),wt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},It=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),Ut=(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("/")},Ct=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Lt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),jt=e=>2===e.split("/").length,Dt=e=>5===e.split("/").length,kt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Ft=e=>e.replace(/uri\$\$/g,pt);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 xt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,_t),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Ze.TYPE_STRING)]),$t=(0,l.has)("values"),Vt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Ze.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Ze.TYPE_LOOKUP)],[$t,(0,l.always)(Ze.TYPE_ENUM)],[xt,(0,l.always)(Ze.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Ze.TYPE_BOOLEAN),(0,l.always)(Ze.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Gt=(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){Mt(e,t,r[t])}))}return e}({},e,{type:Vt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Wt=e=>!!e&&(!!e.autoGenerated&&e.type!==Ze.TYPE_NESTED||!!e.parentAutoGenerated),Bt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Yt=(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),qt=e=>Bt(e)?"analyticsAttributes":"attributes",Ht=(0,l.propEq)("hidden",!0),Qt=(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))),Kt=Qt(Ze.TYPE_NESTED),Jt=Qt(Ze.TYPE_REFERENCE),Xt=Qt(Ze.TYPE_IMAGE),zt=(0,l.either)(Kt,Jt),Zt=(e,t)=>{const r=Bt(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(".")},er=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),tr=(0,l.pipe)(er,Boolean),rr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),nr=(0,l.both)(tr,(0,l.pipe)(er,("rdm",(0,l.pipe)(Pt,(0,l.equals)("rdm")))));const ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=qt({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]||or(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:[]},ar=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},or=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",Ze.TYPE_NESTED),(0,l.propEq)("type",Ze.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Ze.TYPE_REFERENCE),(0,l.pipe)(it,(0,l.map)((t=>ar(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},sr=[Ze.TYPE_ACTIVENESS_DATE,Ze.TYPE_DATE,Ze.TYPE_TIMESTAMP,Ze.TYPE_LOCAL_DATE],lr=[Ze.TYPE_ACTIVENESS_DATE,Ze.TYPE_TIMESTAMP,Ze.TYPE_LOCAL_DATE],ur=e=>sr.includes(e),cr=e=>lr.includes(e),pr=[Ze.TYPE_INT,Ze.TYPE_LONG,Ze.TYPE_NUMBER,Ze.TYPE_FLOAT,Ze.TYPE_DOUBLE,Ze.TYPE_COUNT],dr=e=>pr.includes(e),yr=e=>[Ze.TYPE_FLOAT,Ze.TYPE_DOUBLE].includes(e),fr=[Ze.TYPE_BOOLEAN,Ze.TYPE_BOOLEAN_RADIO,Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Tr=e=>fr.includes(e),Er=[Ze.TYPE_URL,Ze.TYPE_BLOG_URL,Ze.TYPE_IMAGE_URL],mr=e=>Er.includes(e),hr=Qt(Ze.TYPE_EMAIL),br=e=>Ze.TYPE_SSN===e;var Or,vr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Or||(Or={}));const gr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Or.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)))})),_r=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Ar=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),_r),Nr=(0,l.pipe)((0,l.reject)(E),Ar),Pr=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("?")?"&":"?")+_r(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}},Rr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Sr=(0,l.equals)(Rr.SUGGESTING),wr=(0,l.equals)(Rr.EDITING),Ir=(0,l.equals)(Rr.VIEWING),Ur=(0,l.either)(wr,Sr),Cr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Lr=(0,l.curry)(((e,t)=>(0,l.pipe)(Cr(e),(0,l.prop)("extendsTypeURI"))(t))),jr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Lr(e,r)));return n(r)})),Dr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Lr(e,n);return r})),kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?kr(e,Cr(e,t.extendsTypeURI),r):void 0,Fr=(e,t)=>{const r=t.map(Dr(e));return(r.length?r.reduce(l.intersection):[])[0]},Mr=(e,t)=>kr(e,(0,l.is)(Object,t)?t:Cr(e,t),"typeImage"),xr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&jr(e,t,n.uri)?r.concat(n.uri):r),[]),$r={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"},Vr={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Gr={[$r.EQUALS]:"equals",[$r.NOT_EQUALS]:"not",[$r.STARTS_WITH]:"starts with",[$r.MISSING_VALUE]:"missing value",[$r.IN_RANGE]:"in range",[$r.HAS_ALL]:"has all",[$r.FULL_TEXT]:"full text",[$r.EXISTS]:"exists",[$r.COUNT_EQUALS]:"count equals",[$r.COUNT_NOT_EQUALS]:"count not equal",[$r.COUNT_LT]:"count less",[$r.COUNT_LTE]:"count less or equal",[$r.COUNT_GT]:"count greater",[$r.COUNT_GTE]:"count greater or equal",[$r.COUNT_RANGE]:"count in range",[$r.LT]:"less than",[$r.LTE]:"less than or equal",[$r.GT]:"greater than",[$r.GTE]:"greater than or equal",[$r.IN_FILE]:"in file",[$r.NOT_IN_FILE]:"not in file",[$r.CONTAINS]:"contains",[$r.ON]:"on",[$r.BEFORE]:"before",[$r.AFTER]:"after",[$r.WITHIN]:"within"},Wr="in",Br="notIn",Yr="not range",qr=e=>({[Wr]:$r.EQUALS,[Br]:$r.NOT_EQUALS}[e]||e);var Hr,Qr;!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"}(Hr||(Hr={})),function(e){e.LAST_3DAYS="last3Days"}(Qr||(Qr={}));const Kr=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Hr[t]||Qr[t],e)),{}),Jr={[Hr.LAST_DAY]:"Last 24 hours",[Qr.LAST_3DAYS]:"Last 3 days",[Hr.LAST_WEEK]:"Last 7 days",[Hr.LAST_MONTH]:"Last month",[Hr.LAST_6MONTHS]:"Last 6 months",[Hr.LAST_YEAR]:"Last year",[Hr.PICK_DATE]:"Pick date"},Xr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},zr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Zr="<No label>",en={IN:"in",OUT:"out"};var tn=r(87918),rn=r.n(tn);function nn(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){an(e,t,r[t])}))}return e}function an(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const on={startDate:{type:Ze.TYPE_ACTIVENESS_DATE,get label(){return rn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Ze.TYPE_ACTIVENESS_DATE,get label(){return rn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},sn=nn({id:{type:Ze.TYPE_ENTITY_ID,get label(){return rn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},on,{roles:{type:Ze.TYPE_STRING,get label(){return rn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Ze.TYPE_STRING,get label(){return rn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),ln={workflow:{type:Ze.TYPE_STRING,get label(){return rn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Ze.TYPE_STRING,get label(){return rn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Ze.TYPE_STRING,get label(){return rn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},un={commenter:{type:Ze.TYPE_STRING,get label(){return rn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},cn={notResolved:{type:Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return rn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},pn={createdBy:{type:Ze.TYPE_STRING,get label(){return rn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Ze.TYPE_STRING,get label(){return rn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},dn={matches:{type:Ze.TYPE_COUNT,get label(){return rn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Ze.TYPE_COUNT,get label(){return rn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},yn={sourceSystems:{type:Ze.TYPE_STRING,get label(){return rn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Ze.TYPE_STRING,get label(){return rn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Ze.TYPE_INT,get label(){return rn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Ze.TYPE_STRING,get label(){return rn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let fn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(fn||(fn={}));const Tn={[fn.matchRules]:{type:Ze.TYPE_STRING,get label(){return rn().text("Match Rules")},uri:fn.matchRules,name:fn.matchRules,faceted:!0,hideForDataTenant:!0},[fn.MLRecommendedMatch]:{type:Ze.TYPE_STRING,get label(){return rn().text("Match IQ")},uri:fn.MLRecommendedMatch,name:fn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},En=nn({},sn,ln,un,cn,pn,dn,yn,Tn,{type:{type:Ze.TYPE_STRING,get label(){return rn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),mn="NOT_MATCH";var hn=r(13980),bn=r.n(hn);function On(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){vn(e,t,r[t])}))}return e}function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gn=bn().oneOf(["mobile","tablet","desktop"]),_n=bn().shape({deviceTypes:bn().oneOfType([gn,bn().arrayOf(gn)]),roles:bn().arrayOf(bn().string)}),An=bn().shape({value:bn().string,lookupCode:bn().string}),Nn=bn().shape({link:bn().string,filename:bn().string}),Pn=bn().shape({displayName:bn().string,parent:bn().string}),Rn=bn().oneOfType([bn().string,bn().number,bn().bool,An]),Sn=bn().oneOfType([Rn,bn().arrayOf(Rn)]),wn=bn().shape({fieldName:bn().string,values:bn().arrayOf(Sn),filter:bn().string,type:bn().string}),In=bn().shape({minValue:bn().number,maxValue:bn().number}),Un=bn().shape({label:bn().string,name:bn().string,description:bn().string,type:bn().string,hidden:bn().bool,faceted:bn().bool,searchable:bn().bool,uri:bn().string,access:bn().arrayOf(bn().string),cardinality:In}),Cn=bn().shape({label:bn().string,uri:bn().string,typeColor:bn().string,direction:bn().string,startObject:bn().object,endObject:bn().object}),Ln=bn().shape({typeColor:bn().string,typeIcon:bn().string,typeImage:bn().string,label:bn().string,uri:bn().string,attributes:bn().arrayOf(Un)}),jn=bn().shape({uri:bn().string,label:bn().string,memberTypes:bn().array,extendsTypeUri:bn().string,attributes:bn().arrayOf(Un)}),Dn=bn().shape({uri:bn().string,label:bn().string,extendsTypeUri:bn().string,relationshipTypeURIs:bn().arrayOf(bn().string)}),kn=bn().shape({uri:bn().string,description:bn().string,label:bn().string,schemaVersion:bn().string,entityTypes:bn().arrayOf(Ln),roles:bn().arrayOf(bn().object),groupTypes:bn().arrayOf(bn().object),relationTypes:bn().arrayOf(Cn),graphTypes:bn().arrayOf(Dn),interactionTypes:bn().arrayOf(jn),sources:bn().arrayOf(bn().object)}),Fn=bn().shape({uri:bn().string,type:bn().string}),Mn=bn().shape({uri:bn().string,attributes:bn().object,type:bn().string,timestamp:bn().number,members:bn().object}),xn=bn().shape({uri:bn().string,type:bn().string}),$n=bn().shape({value:bn().object,ov:bn().bool,type:bn().string,uri:bn().string}),Vn=bn().shape({refEntity:bn().oneOfType([bn().array,bn().object]),refRelation:bn().oneOfType([bn().array,bn().object]),value:bn().object,ov:bn().bool,type:bn().string,uri:bn().string}),Gn=bn().oneOf((0,l.values)(Rr)),Wn=bn().shape({type:bn().oneOf(Object.values(me)).isRequired,attributeTypeUri:bn().string.isRequired,parentUri:bn().string.isRequired,uri:bn().string,message:bn().string}),Bn={attributeType:Un,showEmptyEditors:bn().bool,lazy:bn().bool,mode:Gn,metadata:kn,ownError:Wn,errors:bn().arrayOf(Wn),crosswalks:bn().array,onAddAttributes:bn().func,onAddOneMore:bn().func,onDeleteAttribute:bn().func,onChangeAttribute:bn().func,additionalControlsRenderer:bn().func,hideDeleteButton:bn().bool,showNonOv:bn().bool,state:bn().oneOf(["deleted","edited"]),expanded:bn().bool},Yn=On({attributeValue:$n},Bn),qn=On({attributeValue:Vn},Bn),Hn=bn().shape({value:bn().oneOfType([bn().string,bn().bool,bn().number]),ov:bn().bool,type:bn().string,uri:bn().string,lookupCode:bn().string,lookupRawValue:bn().string}),Qn=bn().shape({totalOvValues:bn().number,totalValues:bn().number}),Kn=bn().shape({inRelations:bn().arrayOf(bn().oneOfType([bn().object,bn().string])),outRelations:bn().arrayOf(bn().oneOfType([bn().object,bn().string])),groups:bn().arrayOf(bn().string),entityTypes:bn().arrayOf(bn().string),nextEntry:bn().object}),Jn=bn().oneOf(["asc","desc"]),Xn=bn().shape({id:bn().string,content:Kn,allowOnlyCreateNew:bn().bool,sortColumn:bn().string,sortOrder:Jn,"text-empty":bn().string,max:bn().number,icon:bn().string,caption:bn().string,canCreate:_n,canRead:_n,canUpdate:_n,canDelete:_n,editingEnabled:bn().bool}),zn=bn().shape({id:bn().string,caption:bn().string,pageSize:bn().number,icon:bn().string,canCreate:_n,canRead:_n,canUpdate:_n,canDelete:_n,attributes:bn().object}),Zn=bn().shape({entityUri:bn().string,entityType:bn().string,entityLabel:bn().string,object:Fn}),ei=bn().shape({relationUri:bn().string,relationType:bn().string,relationLabel:bn().string,direction:bn().string,object:xn}),ti=bn().shape({entity:Zn,relation:ei}),ri=bn().shape({value:bn().string,isRawFilter:bn().bool}),ni=bn().shape({id:bn().string,label:bn().string,name:bn().string,availableEntityTypes:bn().array}),ii=bn().shape({id:bn().string,allowMergeAll:bn().bool,matchActions:bn().object,availableTabs:bn().arrayOf(bn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ai=bn().shape({matchRules:bn().arrayOf(bn().string),object:Fn,shortestTransitiveMatchPath:bn().arrayOf(bn().shape({matchRules:bn().arrayOf(bn().string),match:bn().string})),direct:bn().bool,matchScore:bn().number}),oi=bn().arrayOf(ai),si=bn().arrayOf(bn().shape({uri:bn().string,label:bn().string})),li=[{label:rn().text("And"),value:"and"},{label:rn().text("Or"),value:"or"},{label:rn().text("And not"),value:"and not"},{label:rn().text("Or not"),value:"or not"}];function ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ci=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),pi=(0,l.pipe)(ci,(0,l.propOr)("","label")),di=(0,l.curry)(((e,t)=>{const r=ci(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),yi=(0,l.curry)(((e,t,r)=>{const[n,i]=di(e,r);return jr(e,n,t)||jr(e,i,t)})),fi=(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){ui(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ti=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?en.OUT:en.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(en.IN),i=r(en.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ei=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),mi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},hi=(0,l.curry)(((e,t)=>e.every((e=>bi(e,t))))),bi=(0,l.curry)(((e,t)=>{const r=Wt(t);return Oi(e,t)&&(e===mi.READ||!r)})),Oi=(e,t)=>!t||!t.access||t.access.includes(e),vi=(0,l.curry)(((e,t,r)=>bi(mi.READ,r)&&(Sr(t)?bi(mi.INITIATE_CHANGE_REQUEST,r):bi(e,r)))),gi=vi(mi.CREATE),_i=vi(mi.DELETE),Ai=vi(mi.UPDATE),Ni=hi([mi.CREATE,mi.MERGE,mi.READ,mi.UPDATE]),Pi=hi([mi.UPDATE,mi.READ,mi.CREATE]),Ri=hi([mi.UPDATE,mi.READ]),Si=hi([mi.DELETE,mi.UPDATE,mi.READ]),wi=(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["*"])),Ii=(e,t,r)=>(0,l.pipe)((0,l.map)(wi(e,t)),(0,l.filter)(l.identity))(r),Ui=(e,t,r)=>{const n=Ii(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&bi(mi.MERGE,r)},Ci=(0,l.curry)(((e,t,r,n)=>{const i=ci(e,n),[a,o]=di(e,n);return i&&bi(mi.CREATE,i)&&jr(e,a,t.type)&&jr(e,o,r.type)})),Li=(e,t,r,n,i)=>{const a=Cr(e,n.type),o=Ii(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(Ci(e,n,i))||a.some(Ci(e,i,n))}))},ji=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Cr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Ui(o,i,a),canAddRelation:Li(e,o,i,r,n),canMark:bi(mi.UPDATE,a)&&bi(mi.READ,a)}},Di=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>ji(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),ki=Bt,Fi=(0,l.complement)(ki),Mi=bi(mi.READ),xi=e=>{let{attributeType:t,mode:r}=e;return Fi(t)&&gi(r,t)&&!Ht(t)},$i=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=mt(r.uri),o=Ai(n),s=gi(n);return(0,l.cond)([[ki,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Vi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=mt(r.uri),s=Ai(n),u=_i(n),c=Wi(mi.UPDATE,n,a,r),p=Wi(mi.DELETE,n,a,r);return(0,l.cond)([[ki,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)},Gi=(0,l.curry)(((e,t,r,n)=>{const i=or(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=>!Oi(e,n)||!Gi(e,t,r[n.name],n)))))})),Wi=(0,l.curry)(((e,t,r,n,i)=>Sr(t)?Gi(mi.INITIATE_CHANGE_REQUEST,r,n,i):Gi(e,r,n,i))),Bi=(0,l.both)((0,l.complement)(Ht),Mi),Yi="SuperUser",qi="allTenants",Hi=[qi,"allCustomers"],Qi=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;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===Yi})).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===Yi){const e=r?Hi.concat(r.map((e=>`allTenants.${e}`))):Hi,n=r&&t[0]===qi?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}))},Ki={NON_SECURED:"NON_SECURED",SECURED:"SECURED",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"},Ji={[Ki.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Ki.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Ki.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Ki.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Ki.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Ki.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Ki.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Ki.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Ki.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Ki.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Ki.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Ki.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Ki.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Ki.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Ki.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Ki.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Ki.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Ki.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Ki.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Ki.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Ki.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Ki.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Ki.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Ki.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Ki.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Ki.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Ki.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Ki.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Ki.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Ki.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Xi=(0,l.curry)(((e,t,r)=>Qi({allowedPermissionsNames:e,permissionsNames:Ki,permissionsConfig:Ji}).some((e=>e(t,{params:{tenant:r}}))))),zi=Xi([Ki.CAN_EXPORT]),Zi=Xi([Ki.CAN_EXPORT_ACTIVITIES]),ea=Xi([Ki.CAN_IMPORT_ENTITIES_FROM_DT]),ta=Xi([Ki.CAN_READ_ENTITIES_FROM_DT]),ra=Xi([Ki.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),na=Xi([Ki.CAN_UPDATE_PROCESS_INSTANCE]),ia=Xi([Ki.CAN_VIEW_WORKFLOW_DEFINITION]),aa=Xi([Ki.CAN_CONFIG_ENVIRONMENT_REGISTER]),oa=Xi([Ki.CAN_UPDATE_WORKFLOW_DATA_TASK]),sa=Xi([Ki.CAN_READ_WORKFLOW_DATA_TASK]),la=Xi([Ki.CAN_MANAGE_WORKFLOW_DEFINITION]),ua=Xi([Ki.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ca=Xi([Ki.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),pa=Xi([Ki.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),da=Xi([Ki.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ya=Xi([Ki.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),fa=Xi([Ki.CAN_EXECUTE_WORKFLOW_JOBS]),Ta=Xi([Ki.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Ea=Xi([Ki.CAN_CREATE_CONFIG_JAR]),ma=Xi([Ki.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ha=Xi([Ki.CAN_VIEW_CONFIG_JAR]),ba=Xi([Ki.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),Oa=Xi([Ki.CAN_VIEW_WORKFLOW_JOBS]),va=Xi([Ki.CAN_MAKE_BULK_UPDATE]),ga=Xi([Ki.CAN_OPEN_DATA_LOADER_EXECUTE,Ki.CAN_OPEN_DATA_LOADER_READ]),_a=Xi([Ki.CAN_BULK_DELETE_PROFILES]),Aa=Xi([Ki.CAN_READ_MDM_DATA_ENTITIES]),Na=Xi([Ki.CAN_READ_DVF]),Pa=Xi([Ki.IS_FREEMIUM_ADMIN]),Ra=(0,l.reject)(Ht),Sa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Ra,(0,l.filter)(e))(t),wa=(0,l.curry)(((e,t)=>Sa((t=>xi({attributeType:t,mode:e})),t))),Ia=(0,l.curry)(((e,t)=>Sa((t=>xi({attributeType:t,mode:e})||Bi(t)),t))),Ua=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Bi)),Ca=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ca(e)])))),La=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Bi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...La(e)])))),ja=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...ja(e)])))),Da=(0,l.pipe)(Cr,(0,l.converge)(l.concat,[La,ja]));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.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Ma(e)))},t))),xa=e=>{var t;return ka({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},$a=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Va=(0,l.when)($a,(0,l.dissoc)("values")),Ga=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return ka({},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})})),Wa=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Ba=(0,vr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ca,t).concat((0,l.chain)(Ca,r)).some(Wa)})),Ya=e=>{let t=!1;const r=Ma((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?ka({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},qa=e=>{const t=Ba(e),r=(0,l.map)((e=>Ma((0,l.pipe)(Va,(0,l.when)((0,l.always)(e),Ga))))(t)),n=(0,l.map)(xa),i=(0,l.map)(Ya);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Ha=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Qa=(0,l.prop)("relationshipTypeURIs"),Ka=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Ja(e,t)))||[]})),Ja=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(yi(e,t))},Xa=(e,t)=>(0,l.pipe)(Ha,(0,l.defaultTo)({}),Qa,(0,l.defaultTo)([]),(0,l.chain)(di(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Cr(e)))(e,t),za=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Za=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Za((0,l.complement)(za))(e)},to=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Za(za)(e)},ro=(0,l.pipe)(Cr,(0,l.propOr)([],"matchGroups")),no=(e,t,r)=>(0,l.pipe)(ro,(0,l.find)((0,l.propEq)("uri",r)))(e,t),io=(0,l.curry)(((e,t,r)=>(0,l.pipe)(no,(0,l.propOr)(r,"label"))(e,t,r))),ao=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(ro,(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]})),oo=e=>(0,l.partition)(za,e),so=(0,l.includes)(l.__,["and","or","not"]),lo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),uo=(0,l.includes)(l.__,["equals","notEquals","in"]),co=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return so(t)?co(r):lo(t)?r.filter(_t):uo(t)?r.map((0,l.prop)("uri")).filter(_t):[]})),l.uniq),po=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(co),l.uniq),yo=(0,l.pipe)(ro,po),fo=(0,l.pipe)(ao,po),To=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},Eo=(0,l.pipe)(To,La),mo=(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||jr(e,n,t)})(e,t))})(e,t)),ho=e=>!!e.required,bo=(e,t,r)=>{const n=(0,l.cond)([[_t,Cr(e)],[At,ci(e)]])(t);return Oo(e,n,r)},Oo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&_t(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Wt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Ze.TYPE_REFERENCE){const n=nt(t),a=it(t);i=bo(e,n,r).filter((e=>a.some(Nt(e.uri))))}else t.attributes&&(i=Oo(e,t,r));i&&n.push(...i)}return n})):t.type===Ze.TYPE_REFERENCE?bo(e,nt(t),r):[],vo=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),ho]),e.attributes||[])},go=(e,t)=>{const r=st(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},_o=(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)?rn().text(n):n};return r(null,t)})),Ao=["label","description","abbreviation","caption","toolTip"],No=e=>_o(Ao,e),Po=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Rt(t);return r.find((e=>{let{uri:t}=e;return Rt(t)===n}))})),Ro=(0,l.curry)(((e,t)=>{const r=Rt(t);return(0,l.pipe)(Po(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),So=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"})},wo=(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}))},Io=(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)})),Uo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Cr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));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){Lo(e,t,r[t])}))}return e}function Lo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jo=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 Do(i,e,t,r,n)},Do=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:or(t,r)).map((e=>e.map((e=>{const r=jo(t,e,n,i);return r.length?Co({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(zt),(0,l.prop)("children"))).filter(Bi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return jo(e,t,r,["attributes","analyticsAttributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return jo(e,t,r,["attributes"])},Mo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return jo(e,t,r,["analyticsAttributes"])},xo=e=>e.children?e.children.flatMap(xo):e,$o=e=>e.children?[e,...e.children.flatMap($o)]:e,Vo=(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)})),Go=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Rt(r)===e})))),Wo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Go("LUD")),(0,l.defaultTo)(r))(t||[])},Bo=(e,t)=>{let{survivorshipStrategies:r}=e;return Go(t,r)},Yo=(0,l.allPass)([(0,l.complement)(l.isNil),bi(mi.READ)]),qo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),bi(mi.READ)]),Ho=(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)([bi(mi.CREATE),bi(mi.INITIATE_CHANGE_REQUEST)])]),Qo=(0,l.curryN)(2,(0,l.pipe)(Cr,qo)),Ko=(0,l.curryN)(2,(0,l.pipe)(ci,Yo));function Jo(e,t,r,n){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 Xo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Jo(r[i],r[i+1],e,t));return n}function zo(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Xo(r,t)[a];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 zo(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 Zo(e,t,r,n,i,a){void 0===a&&(a=0);var o=Xo(r,t)[a];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()?(es(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(es.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=zo(e,t,r,n,i,a),s}var c=Zo(e,o,o.valueUri,{},i,a);Zo(c,t,r,n,i,a+1)}function es(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function ts(e,t,r,n){void 0===n&&(n=0);var i=Xo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&ts(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 rs(e,t){e.roles=t||[]}function ns(e,t){e.tags=t||[]}function is(e,t){e.startDate=t||""}function as(e,t){e.endDate=t||""}const os=e=>{let{ov:t}=e;return!1!==t},ss=(e,t)=>((e,t)=>mr(e.type)&&ae(t))(e,t)||((e,t)=>hr(e.type)&&oe(t))(e,t),ls=(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))),us=ls("refEntity"),cs=ls("refRelation"),ps=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ds=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},ys=(0,l.prop)("objectURI"),fs=(0,l.prop)("objectURI"),Ts=(0,l.prop)("type"),Es=(0,l.pipe)(us,(0,l.defaultTo)({}),ys),ms=(0,l.pipe)(cs,(0,l.defaultTo)({}),fs),hs=(0,l.pipe)(us,(0,l.defaultTo)({}),Ts),bs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Os=(0,l.evolve)({refEntity:re,refRelation:re}),vs=(e,t,r,n)=>{const i=ir(e,r),a=Cr(e,t.type)||ci(e,t.type);if(0===i.length)return null;const o=qt(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!ct(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>nt(e)===r.uri||rt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},gs=(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?gs(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 gs(e[r],i)})),As=(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")]]),Ns=(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"])]]),Ps=(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"])]]),Rs=(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)(Rs(e,i)))))(r)})),Ss=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(Ss(e)),e)(t))),ws=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Rs(e,r),Ss(t))(n))),Is=ws(null,As),Us=ws(os,As),Cs=ws(null,Ns),Ls=ws(os,Ns),js=ws(os,Ps),Ds=(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]},ks=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(Es,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Fs=(e,t)=>{const r=kt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ds(e,r,n)},Ms=Object.values(on),xs=(0,l.includes)(l.__,Ms),$s=e=>Ms.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Vs(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){Gs(e,t,r[t])}))}return e}function Gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ws=(e,t)=>`${e}_${t}`,Bs=[En.matches.name,En.matchRules.name],Ys=(0,l.values)(ln).map((e=>e.name)),qs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ys)))),Hs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Bs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Ws(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Qs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,qs(r),Hs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Ws(`dtPotentialMatches.${t.name}`,"")))))(En)},Ks=(0,l.propEq)("uri",En.type.uri),Js=e=>(0,l.values)(Tn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),Xs=(0,l.propEq)("uri",yn.sourceSystems.uri),zs=Object.values(sn),Zs=(0,l.includes)(l.__,zs),el=e=>{let{entity:t,attributeType:r,value:n}=e;return Vs({},t,{[r.uri]:void 0===n?r.defaultValue:n})},tl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},rl=e=>{let{entity:t,attributeType:r,value:n}=e;return Vs({},t,{[r.uri]:n})},nl=(0,l.propEq)("uri",sn.roles.uri),il=(0,l.propEq)("uri",sn.tags.uri);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=>{let{parentUri:t,attributeType:r}=e;return al({uri:Et(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[zt,(0,l.always)({value:{}})],[tr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ur)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},ll=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(wa(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=sl({parentUri:r,attributeType:e});let s=or(n,e);s&&(e.type===Ze.TYPE_REFERENCE&&(s=ut(s)),a.value=ll({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||rr(e))&&(o[t]=[a])}return o},ul=e=>{let{entity:t,metadata:r}=e;return bo(r,t.type,!0).filter(rr).reduce(((e,t)=>{const n=t.name,i=kt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:vs(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:pl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},cl=(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===Ze.TYPE_NESTED?al({},e,{value:cl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return al({},s(t),ll({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),pl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=sl({parentUri:n,attributeType:r}),u=As(l);return(0,Ee.ZP)(t,(e=>{zo(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},dl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{zo(e.attributes||e.value,r,n.uri,As(n),a,o,i)}))},yl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{Zo(e.attributes||e.value,r,n,i,a,o)}))},fl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ee.ZP)(t,(e=>{ts(e.attributes||e.value,r,n,i)}))},Tl=e=>""===e,El=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([Tl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([Tl,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]]),ml=(0,l.reject)(El),hl=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=>hl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),ml)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},bl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return hl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Os),deleteEmptyComplex:e})},Ol=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(bl(e),(0,l.reject)(l.isEmpty))},vl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return xs(r)?el({entity:e,attributeType:r}):pl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),gl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return xs(r)?rl({entity:e,attributeType:r,value:i}):yl({entity:e,attributeType:r,uri:n,value:i})})),_l=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return xs(r)?tl({entity:e,attributeType:r}):fl({entity:e,attributeType:r,uri:n})})),Al=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)},Nl="UrlThumbnail",Pl="CdnUrlThumbnail",Rl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(os):(0,l.head)(n);return e&&e.value}return null})),Sl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Rl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),wl=Sl(["CdnUrl","Url"],!0),Il=Sl(["CdnUrlPreview","UrlPreview"],!0),Ul=Sl([Pl,Nl],!0),Cl=Sl([Pl,Nl]),Ll=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Yt,(0,l.always)(t)],[(0,l.both)(Bt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Yt(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(xs(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)}),[])},jl=(e,t,r)=>{const n=Ua(e),i=(0,l.any)(r?l.T:os);return Ll(n,t,i)},Dl=(e,t,r,n,i,a)=>{const o=mt(null==r?void 0:r.uri)?wa(t,e):Ia(t,e);return Ll(o,r,((e,o)=>{const s=xi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:os,e)||Yt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let kl;const Fl=e=>{kl=e};function Ml(e,t){return kl(e,t)}const xl=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)})),$l=50,Vl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=$l,offset:a=0}=e;return Ml("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},Gl=(0,l.once)((()=>Ml("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Wl=e=>Ml("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Bl=(e,t)=>Ml("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Yl=e=>Z.fromNull(Gr[e]).map(rn().text).orSome(""),ql=(0,l.curry)(((e,t)=>`${e}_${t}`)),Hl=(0,l.split)("_"),Ql=(0,l.includes)("_"),Kl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Jl=(0,l.curry)(((e,t)=>e.some(Kl(t)))),Xl=Jl([$r.IN_RANGE,$r.COUNT_RANGE,$r.WITHIN]),zl=Jl([$r.EXISTS,$r.MISSING_VALUE]),Zl=(0,l.cond)([[zl,(0,l.always)(0)],[Xl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),eu=(0,l.complement)(zl),tu=Jl([$r.HAS_ALL,$r.EQUALS,$r.NOT_EQUALS]),ru=Jl([$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE]),nu=Jl([$r.IN_FILE,$r.NOT_IN_FILE]),iu=e=>{switch(e){case $r.COUNT_EQUALS:return $r.EQUALS;case $r.COUNT_NOT_EQUALS:return $r.NOT_EQUALS;case $r.COUNT_LT:return $r.LT;case $r.COUNT_LTE:return $r.LTE;case $r.COUNT_GT:return $r.GT;case $r.COUNT_GTE:return $r.GTE;case $r.COUNT_RANGE:return $r.IN_RANGE}},au=Jl([$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS]),ou=Jl([$r.WITHIN]),su=[[$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE],[$r.NOT_IN_FILE,$r.IN_FILE],[$r.EQUALS,$r.NOT_EQUALS,$r.HAS_ALL],[$r.LT,$r.LTE,$r.GT,$r.GTE],[$r.MISSING_VALUE,$r.EXISTS],[$r.COUNT_RANGE],[$r.IN_RANGE],[$r.STARTS_WITH,$r.CONTAINS],[$r.FULL_TEXT],[$r.ON,$r.BEFORE,$r.AFTER,$r.NOT_EQUALS],[$r.WITHIN]],lu=(e,t)=>su.some((r=>r.includes(e)&&r.includes(t))),uu=(0,l.pipe)(l.omit,l.values),cu={OPTIONS_FOR_STRING:uu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_DATE:[$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS,$r.MISSING_VALUE,$r.EXISTS,$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE,$r.IN_FILE,$r.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:uu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_BLOB:uu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_NUMBER:uu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_LOOKUP:uu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],$r),OPTIONS_FOR_ENUM:uu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_ID:[$r.EQUALS,$r.NOT_EQUALS,$r.IN_FILE,$r.NOT_IN_FILE],OPTIONS_FOR_COUNT:[$r.EQUALS,$r.NOT_EQUALS,$r.LT,$r.LTE,$r.GT,$r.GTE,$r.IN_RANGE],OPTIONS_FOR_COMPLEX:[$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE,$r.EXISTS,$r.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[$r.EQUALS,$r.NOT_EQUALS,$r.EXISTS,$r.MISSING_VALUE]},pu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Ze.TYPE_TYPEAHEAD:case Ze.TYPE_STRING:case Ze.TYPE_PASSWORD:case Ze.TYPE_TEXT:case Ze.TYPE_CIK_ID:case Ze.TYPE_URL:case Ze.TYPE_BLOG_URL:case Ze.TYPE_IMAGE_URL:case Ze.TYPE_EMAIL:return cu.OPTIONS_FOR_STRING;case Ze.TYPE_LOOKUP:case Ze.TYPE_DEPENDENT_LOOKUP:return cu.OPTIONS_FOR_LOOKUP;case Ze.TYPE_ENUM:return cu.OPTIONS_FOR_ENUM;case Ze.TYPE_DATE:case Ze.TYPE_ACTIVENESS_DATE:case Ze.TYPE_TIMESTAMP:case Ze.TYPE_LOCAL_DATE:return cu.OPTIONS_FOR_DATE;case Ze.TYPE_BOOLEAN:case Ze.TYPE_BOOLEAN_RADIO:return cu.OPTIONS_FOR_BOOLEAN;case Ze.TYPE_BLOB:return cu.OPTIONS_FOR_BLOB;case Ze.TYPE_LONG:case Ze.TYPE_INT:case Ze.TYPE_FLOAT:case Ze.TYPE_DOUBLE:case Ze.TYPE_NUMBER:return cu.OPTIONS_FOR_NUMBER;case Ze.TYPE_ENTITY_ID:return cu.OPTIONS_FOR_ID;case Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[$r.EQUALS];case Ze.TYPE_COUNT:return cu.OPTIONS_FOR_COUNT;case Ze.TYPE_NESTED:case Ze.TYPE_REFERENCE:case Ze.TYPE_IMAGE:return cu.OPTIONS_FOR_COMPLEX;default:return cu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(ru,n):n},du=e=>[Pe.and,Pe.andNot].includes(e),yu=e=>[Pe.or,Pe.orNot].includes(e),fu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),yu)),Tu=(Eu=[Pe.and],e=>e.slice(0,-1).every((e=>Eu.includes(e.operator))));var Eu;const mu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),hu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),bu=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},Ou=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Pe.or,Pe.orNot],n=t?[Pe.and,Pe.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)&&bu(e.slice(1,-1));return!i&&!a||o?e:`(${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=>[Pe.andNot,Pe.orNot].includes(e))(a)?Ou(r):r;return i?o:`${t} ${a} ${o}`}),"")}},_u=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Au=e=>Array.isArray(e)?e.map(Au).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Nu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Pu=e=>`'${e}'`,Ru=e=>`"${e}"`,Su=(0,l.pipe)(Au,Nu),wu=(0,l.pipe)(Su,Pu),Iu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Xl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Uu=(e,t)=>ru(t)?{type:Ze.TYPE_INT}:nu(t)?{type:Ze.TYPE_FILE}:au(t)&&!ou(t)&&cr(e.type)?{type:Ze.TYPE_LOCAL_DATE}:e,Cu=Object.values(Kr),Lu=e=>!Object.values(Kr).includes(e),ju=e=>Cu.includes(e),Du=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr;return rn().text(t[e])},ku=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Hr),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr;return e.map((e=>({value:e,get label(){return Du(e,t)}})))},Fu=e=>{const t=f()().startOf("minute");switch(e){case Hr.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Hr.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Hr.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Hr.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Hr.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Qr.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},Mu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fu;return(0,l.is)(String,e)?t(e):Mu(e)};let $u;!function(e){e.CurrentUser="currentUser"}($u||($u={}));const Vu={},Gu=(e,t)=>{Vu[e]=t},Wu=e=>Vu[e];function Bu(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){Yu(e,t,r[t])}))}return e}function Yu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qu=e=>e.split("{CurrentUser}").join(Wu($u.CurrentUser)||""),Hu=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Qu=(0,l.curry)(((e,t,r)=>{const n=r.map(Xl(e)||t.endsWith(".count")?Su:wu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Ku=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Ju=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Zl(t);return(0,l.pipe)(Ku(i),(0,l.map)(Qu(t,r)),Hu(" or "))(n)},Xu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(wu).join(",")})`},zu=e=>`*${e}*`,Zu=e=>`URL:${e}`,ec=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,tc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===$r.IN_FILE?r:`not ${r}`},rc=(e,t)=>[R(e,t),S(e,t)],nc=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!ic(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case $r.ON:return Bu({},e,n?{filter:$r.EQUALS}:{filter:$r.IN_RANGE,values:[rc(i,n)]});case $r.BEFORE:return Bu({},e,{filter:$r.LTE,values:[[S(i,n)]]});case $r.AFTER:return Bu({},e,{filter:$r.GTE,values:[[R(i,n)]]});case $r.WITHIN:return Bu({},e,{filter:$r.IN_RANGE,values:[Fu(i)]})}}return e}),Ju),ic=(0,l.propSatisfies)(cr,"type"),ac=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),qu)],[(0,l.propEq)("filter",$r.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(Ju({filter:$r.EQUALS,fieldName:t,values:[r]}))),new gu).build())),Hu(" or "))(r)}),qu)],[(0,l.propEq)("filter",$r.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Ju({fieldName:r,filter:t,values:n.map((0,l.pipe)(Au,zu))})}),qu)],[(0,l.propEq)("filter",$r.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Ju(Bu({},e,{values:(0,l.flatten)(r)})):ec(r)?Xu(Bu({},e,{filter:"listEquals"})):Ju(e)}),qu)],[(0,l.propEq)("filter",$r.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=Zl(t);return(0,l.pipe)(Ku(i),(0,l.map)(Qu(t,r)),Hu(" and "))(n)})(Bu({},e,{values:(0,l.flatten)(e.values)})):ic(e)?(e=>{const{values:t}=e,r=!ic(e),[n]=t;return(new gu).addClause(Ju(Bu({},e,{filter:$r.LT,values:[R(n,r)]}))).addClause(Ju(Bu({},e,{filter:$r.GT,values:[S(n,r)]}))).orBuild()})(e):ec(t)?Xu(Bu({},e,{filter:"not listEquals"})):Ju(e)}),qu)],[(0,l.propSatisfies)(nu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Ju({fieldName:r,filter:tc(t,r),values:n.map((0,l.prop)("link")).map(Zu)})}],[(0,l.propSatisfies)(ru,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Ju({fieldName:`${r}.count`,values:n,filter:iu(t)})}],[(0,l.propSatisfies)(au,"filter"),nc],[(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 Qu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Qu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Ju,qu)]],oc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!eu(e)||lc(e,r))},sc=(e,t)=>Array.isArray(t)?lc(e,t):e===$r.WITHIN?ju(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Au(t).length>0,lc=(e,t)=>t&&t.length>0&&t.every((t=>sc(e,t)));function uc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},pc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),dc=(e,t,r)=>"children"===e?fc(r,[...t][0],!0):r,yc=(e,t,r)=>"values"===e?[...r,...t]:r,fc=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&&tu(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(yc,t),e)}return(0,l.append)(t,e)},Tc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=cc(e),r=e=>e.fieldName===t?e:r({fieldName:pc(e),children:[e]});return r(e)})(t);return fc(e,r)}),[]),Ec=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},hc=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)===Pe.andNot,a=n(t,!1),o=i?`not ${Ou(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&&Ec(i)&&!t?r(i):n(i,a)}],...e])(o))),new gu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},bc=(0,l.pipe)((0,l.propOr)("","filter"),Ql),Oc=(0,l.map)((0,l.when)(bc,(e=>{const[t,r]=Hl(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){uc(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)(oc),Oc,Tc,hc([...e,...ac],t))},gc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),_c=[$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS,$r.MISSING_VALUE,$r.EXISTS],Ac=[$r.EQUALS,$r.NOT_EQUALS,$r.STARTS_WITH,$r.MISSING_VALUE,$r.HAS_ALL,$r.FULL_TEXT,$r.EXISTS],Nc=[$r.EQUALS,$r.NOT_EQUALS,$r.LT,$r.LTE,$r.GT,$r.GTE,$r.IN_RANGE],Pc=(e,t)=>{const r=Gt(e);return(e=>{switch(e){case on.startDate.name:case on.endDate.name:case ln.dueDate.name:case pn.createdTime.name:case pn.updatedTime.name:case yn.reltioLoadDate.name:case yn.createDate.name:case yn.updateDate.name:case yn.deleteDate.name:case yn.publishDate.name:return _c;case dn.matches.name:case yn.count.name:return Nc;case ln.workflow.name:case ln.assignee.name:case ln.step.name:case un.commenter.name:case pn.createdBy.name:case pn.updatedBy.name:case yn.sourceSystems.name:case yn.value.name:return Ac;default:return null}})(t)||pu(r)},Rc=[$r.EQUALS,$r.NOT_EQUALS,$r.CONTAINS,$r.STARTS_WITH,$r.MISSING_VALUE,$r.HAS_ALL,$r.IN_RANGE,$r.WITHIN,$r.EXISTS,$r.ON],Sc=(0,l.pipe)(Pc,(0,l.filter)((0,l.includes)(l.__,Rc))),wc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Ic=e=>{let{query:t,body:r}=e;return t=wc(t),Ml(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Uc=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||zr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Nr(i)}`},Cc=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=Uc(e,t,r);return Ml(n)},Lc=e=>Ml(`/entities/_total?${e}`),jc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(qo),(0,l.map)((0,l.prop)("uri")))(e),i={filter:$r.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=Nr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||zr.ACTIVE_ONLY,max:r.max||4});return Ml("/entities/_typeAheadSearch"+s,{method:"GET"})},Dc=(0,l.pipe)((0,l.reject)(l.isNil),Ar),kc=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=Dc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Ic({query:p,body:d})},Fc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return kc({fieldName:t,searchParams:i,options:n})};function Mc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",$c=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||xc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Nr(i)}`},Vc=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=$c(e,t,r);return Ml(n)},Gc=e=>Qc(e,{select:"secondaryLabel"}),Wc=(e,t)=>{const{select:r=xc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Ml("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Bc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),mt)),Yc=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=Bc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Zt(r),m={method:"POST",data:{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.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Ml(`${s}/api/${o}/${t}/_object`,m)},qc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Hc={options:"sendHidden,addRefAttrUriToCrosswalk"},Qc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hc;return Ml(`/${e}${Nr(t)}`)},Kc=(e,t)=>Qc(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){Mc(e,t,r[t])}))}return e}({},Hc,{explicitSurvivorshipGroup:t})),Jc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",data:[e]},n=t("/entities");return Ml(n,r)},Xc=e=>Ml(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),zc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Ml(`/${e}/_clone${Nr({executeLCA:!1,valuesToCopy:r})}`,n)},Zc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Ml(`/entities/_events/_total${Ar({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ep=(e,t)=>Ml(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),tp=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Ml(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},rp=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 Ml(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Ar)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},np=e=>{const t=new FormData;return t.append("file",e),Ml("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,rn().text("Can't upload file"));return Promise.reject(t)}))},ip=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 Ml(`/personal/findSavedSearches${Ar({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"}})},ap=e=>Ml(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),op=e=>Ml("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sp=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Ml(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},lp=e=>{let{uri:t}=e;return Ml(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},up=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),sp)(e),cp=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),sp)(e);function pp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dp=["max","offset","filter"],yp=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:yp(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){pp(e,t,r[t])}))}return e}({},t,(0,l.pick)(dp,e)))),fp=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ne.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ne.ALL,e)))return!1},Tp=(0,l.omit)(["activeness"]),Ep=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=fp(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(yp(e),(0,l.omit)(dp))(e))),Tp,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Nr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},mp=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),hp=(0,l.reject)(l.isNil),bp=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Op=e=>Ml(bp(e),{method:"GET",headers:{"Content-Type":"application/json"}}),vp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,bp);return Ml(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},gp=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?Ol()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(hp,ne,JSON.stringify);return Ml(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},_p=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"),bp,n),o=im(i(t),i(r)).concat(om(t,r));return Ml(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Ap=(e,t,r)=>{const{url:n,options:i}=Ep(e,t,r);return Ml(n,i).then(mp)},Np=(e,t)=>Ml(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Pp=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===en.IN?a.inRelations=[n]:a.outRelations=[n],Ml(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Rp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Ml(`${t}/recentSearches${Nr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},Sp=e=>Ml("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),wp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Ml(`/recentSearches${Nr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Ip(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={select:"label,secondaryLabel,name,type,startDate,endDate"},Lp=(0,l.reject)(l.isNil),jp=(0,l.pipe)(Lp,Ar),Dp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Ip({},Cp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Ml(`/${t}/_tree${jp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},kp=e=>{let{uri:t,graphUri:r}=e;const n=Ip({},Cp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Ml(`/${t}/_parents${jp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Fp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Ip({},Cp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Ml(`/${t}/_hops${jp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Mp(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 xp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},$p="/activities",Vp=e=>{let{label:t,description:r}=e;return Ml($p,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:xp()}})};var Gp;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Gp||(Gp={}));const Wp=e=>{const t=Nr(e);return Ml($p+t,{method:"GET"})},Bp=e=>Ml(`/activities/_total${Nr(e)}`,{method:"GET"}),Yp=e=>{const{entityUri:t}=e,r=Mp(e,["entityUri"]);return Ml(`/${t}/_activities${Nr(r)}`,{method:"GET"})},qp=e=>{const{entityUri:t}=e,r=Mp(e,["entityUri"]);return Ml(`/${t}/_activities/_total${Nr(r)}`,{method:"GET"})};function Hp(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){Qp(e,t,r[t])}))}return e}function Qp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Jp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Ml(Kp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Xp=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=Kp({url:r,workflowPath:t,tenant:n})),Ml(s,{method:i||"GET",body:JSON.stringify(a),headers:Hp({"Content-Type":"application/json"},null!=o?o:{})})},zp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Kp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Ml(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)},Zp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Kp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Hp({},l,{comment:o}):l;return Ml(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},ed=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Kp({url:`/tasks${s?Nr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Hp({objectURIs:[i]},(0,l.reject)(E,a)))};return Ml(u,Hp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},td=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Ml(Kp({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})})},rd=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Ml(Kp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(Hp({max:a,offset:o},i))})},nd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Ml(Kp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},id=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Ml(Kp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ad=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return id({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},od=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Ml(Kp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},sd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return id({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},ld=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return id({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},ud=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return id({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},cd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Ml(Kp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},pd=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Ml(Kp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},dd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(os);return a&&a[0]&&(r=n.length>0&&a[0].value?dd(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),yd=(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=dd(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},fd=/[,\s]*$/,Td=e=>{const t=rn().text(Zr);if(!e)return t;const r=e.replace(fd,"");return""===r.toString().trim()?t:r},Ed=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},md=(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=Ed(e,r.referencedEntityTypeURI);if(n)return yd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return yd({attributes:t||{}},r.dataLabelPattern);return""},hd=e=>{let{uiPath:t,uri:r,screen:n="profile"}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}${n}?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},bd=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},Od=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",vd=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Ul,(0,l.prop)("value"))),gd=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),vd),_d=(e,t,r)=>{const n=gd(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(_s(e),vd)))(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")])})(Cr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>vs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,vd))(r)})(e,r)||Mr(e,r.type);return Od(t,n)};function Ad(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){Nd(e,t,r[t])}))}return e}function Nd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pd="DTSS/",Rd=(0,l.replace)(new RegExp("^entities/"),""),Sd=e=>Pd+e.dataTenant+"/"+e.uri,wd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Id=e=>!(!e||!e.dataTenant),Ud=(0,l.startsWith)(Pd),Cd=(0,l.pipe)((0,l.ifElse)(Ud,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Ld=(0,l.ifElse)(Id,Sd,(0,l.prop)("uri")),jd=e=>e&&e.uri?e.dataTenant?Sd(e):Rd(e.uri):"",Dd=(0,l.curry)(((e,t,r)=>(Cr(t,r.type)||{})[e]||"")),kd=Dd("label"),Fd=Dd("typeGraphIcon"),Md=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Cr(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(os)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:md(e,o,i),uri:a.uri}})).filter(l.identity):[]},xd=(0,l.pipe)(Md,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),$d=(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=$d(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):$d(e.slice(1),r)}})),Vd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Gd=e=>(0,l.propOr)([],"matchRules",e),Wd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Ad({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Bd=(e,t,r)=>t&&r?r.aEntity:e,Yd=(0,l.evolve)({attributes:Ol(!0)}),qd=(0,l.pipe)(Yd,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Hd=e=>(0,l.assoc)("dataTenant",e),Qd=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 Ml(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Ar)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Kd=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 Ml(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Ar)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Ml("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Xd=(e,t,r)=>Promise.all(t.map((async t=>await Ml(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),zd=async(e,t)=>await Xd(e,t,"NOT"),Zd=async(e,t)=>await Xd(e,t,"MATCH"),ey=async(e,t)=>await Promise.all(t.map((async t=>await Ml(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function ty(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){ry(e,t,r[t])}))}return e}function ry(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ny(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 iy=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Ml(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},ay=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Ay({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},oy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Ay({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},sy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Ml(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},ly=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 sy({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},uy=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Id,i);return Promise.all([s.length?Jd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return sy({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},cy=(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=ny(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)}),[])),py=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),cy),dy=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Ml(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(py)},yy=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)},fy=yy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Ml(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(py)})),Ty=yy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Ml(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Ey=(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)}},my=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Ml(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},hy=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 my(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},by=hy("NOT"),Oy=hy("MATCH"),vy=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Id,a);return Promise.all([Xd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return my(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},gy=vy("NOT"),_y=vy("MATCH");function Ay(e){let{requestProvider:t=Ml,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}`,ty({},ny(s,["headers"]),{headers:ty({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Ny=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Ay({url:$c(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Py=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Ay({url:Uc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Ry=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Ep(t,r);return Ay({url:`entities/_connections/_getConnections${Nr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(mp,(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)))}))))},Sy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Ay({url:`${qc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},wy=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Ml(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Iy=e=>{let{dtssPath:t,tenant:r}=e;return Ml(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Uy=e=>{let{dtssPath:t,customerTenant:r}=e;return Ml(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},Cy=e=>{let{dtssPath:t,tenants:r}=e;return Ml(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},Ly=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Ay({url:qc(t),dataTenant:r,customerTenant:n,dtssPath:i})},jy=()=>Ml("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function Dy(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){ky(e,t,r[t])}))}return e}function ky(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Dy({},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 Ml(`${t}/api/${r}/graph/search${Nr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},My=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Ml(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Dy({},n,i),headers:{"Content-Type":"application/json"}})},xy=(e,t)=>`${e}/${t}/comments`,$y=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Ml(`${xy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Vy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Ml(`${xy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Gy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Ml(xy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Wy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Ml(`${xy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},By=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Ml(`${xy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Yy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Ml(`${xy(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},qy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Ml(`${xy(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Hy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Ml(`${xy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Qy=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Nr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Ml(`${xy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Ky(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){Jy(e,t,r[t])}))}return e}function Jy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xy=e=>{let{tenant:t,servicesPath:r}=e;return Ml(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},zy="graphExport",Zy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await nf({servicesPath:e,tenant:t,environment:r,namespace:zy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Ky({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await nf({servicesPath:e,tenant:t,environment:r,namespace:zy,options:Ky({method:"PUT"},o)})}catch(e){s=null}return s||(s=await nf({servicesPath:e,tenant:t,environment:r,namespace:zy,options:Ky({method:"POST"},o)})),s},ef=e=>{let{servicesPath:t,key:r}=e;return Ml(`${t}/settings${Nr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},tf=e=>{let{servicesPath:t}=e;return Ml(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},rf=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Ml(`${n}/plugins${Nr({tenant:t,user:r})}`,{method:"GET"})},nf=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Ml(`${n}/configService${Nr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},af=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return nf({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},of=e=>{let{servicesPath:t,stateHash:r}=e;return Ml(`${t}/searchLink?key=${r}`,{method:"GET"})},sf=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),Ml(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},lf=e=>Ml(`/${e}?showObjectsInfo=true`,{method:"GET"}),uf=e=>{let{exportPath:t,tenant:r,options:n}=e;return Ml(`${t}/${r}/activities${Nr(n)}`,{method:"POST"})};function cf(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){pf(e,t,r[t])}))}return e}function pf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const df=e=>{const{entityUri:t}=e;return Ml(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},yf=e=>{let{entityUri:t,crosswalk:r}=e;return Ml(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ff=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Ml("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[cf({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),cf({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},Tf=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Ml(`/${r}/_${n}${Nr({contributorURI:t})}`,{method:"POST"})},Ef=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Ml(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},mf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Ml(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},hf=e=>{let{entityUri:t,crosswalkId:r}=e;return Ml(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function bf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Of=e=>{let{entityTypeUri:t}=e;return Ml(`/dataQuality/fillRates${Ar({entityType:Rt(t)})}`,{method:"GET"})},vf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},gf=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){bf(e,t,r[t])}))}return e}({},n===Fe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Fe.ATTRIBUTE_TYPE?Ar({numberOfThreads:vf({attributes:r,metrics:i})||1}):"";return Ml(`/entityType/${Rt(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},_f=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Ml(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Rt(n)}`,{method:"GET",headers:{env:i}})},Af=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Fe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return Ml(`${t}/${r}/entityType/${Rt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Nf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Ml(`/${t}${Nr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Pf=e=>{let{attributeUri:t,value:r}=e;return Ml(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Rf=e=>{let{attributeUri:t,value:r}=e;return Ml(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},Sf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Ml(`/${t}${Nr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},wf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Nr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Ol()([[{value:a}]]);return Ml(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},If=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Ml(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Uf=e=>{let{entityUri:t,attributeName:r}=e;return Ml(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function Cf(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=e=>{let{entityUri:t}=e;return Ml(`/${t}/_historicURIs`,{method:"GET"})},jf=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 Ml(`/${t}/_changesWithTotal${Nr(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){Cf(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Df=(e,t)=>Ml(`/${e}/_previousChange${Nr({timestamp:t})}`,{method:"GET"}),kf=(e,t)=>Ml(`/${e}${Nr({time:t})}`,{method:"GET"});function Ff(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){Mf(e,t,r[t])}))}return e}function Mf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return Ml(t,{method:r||"GET",body:n,headers:Ff({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},$f=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Nr({options:a.join(","),severity:o.join(",")});return Ml(`${t}/validate/${i}/entity/${jd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Vf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Ml(`${t}/validate/${n}/entity${Nr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Gf=e=>{let{tenant:t,apiPath:r}=e;return Ml(`${r}/tenants/${t}/name`,{method:"GET"})},Wf=e=>{let{tenant:t,apiPath:r}=e;return Ml(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Bf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Ml(`${a}/preferences${Nr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Yf=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 Ml(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},qf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Ml(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Hf=e=>{const{servicesPath:t}=e;return Ml(`${t}/getTokenForWorker`,{method:"GET"})};var Qf=r(29524);const Kf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=ht(),s={attributes:ll({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=vs(r,e,n.uri)[0];return i&&i.value?yl({entity:e,attributeType:n,uri:i.uri,value:t}):pl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Jf=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(Es),(0,l.filter)(mt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Xf=(0,l.curry)(((e,t)=>{const r=Jf(e=e||{},t=t||{});return r.concat((0,l.chain)(Xf(e),r))})),zf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),Zf=zf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),eT=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),mt)),tT=e=>(0,l.pipe)(Zf,eT(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),rT=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Zf,(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})),nT=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),mt),(0,l.omit)(["uri","timestamp"])),iT=(0,l.pipe)(nT,Yd),aT=async(e,t,r)=>{if(!e)return null;const n=tT(e);if(n.length>0)for(const r of n)e=rT(r,t[r],e);const i=await Jc(iT(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},oT=async(e,t,r)=>{const n=lT(e,t),i={};for(const t of n)i[t]=await aT(e[t],i,r);return i},sT=(0,l.curry)(((e,t)=>{const r=Qf.Node(t);return tT(e[t]).forEach((t=>{const n=sT(e,t);r.addEdge(n)})),r})),lT=(e,t)=>(0,l.pipe)((0,l.map)(sT(e)),(0,l.map)(Qf.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),uT=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(nT))})),cT=(e,t)=>[...pm(e.tags||[],t.tags||[]),...dm(e.roles||[],t.roles||[]),...am(e,t),...om(e,t)],pT=(e,t)=>[...sm(im((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),cm((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...cT(e,t)],dT=(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 rT(r,n,e)}),e))))}),t)}),uT),yT=(0,l.curry)(((e,t)=>(0,l.when)(mt,(0,l.propOr)(l.__,t,e),t)));function fT(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){TT(e,t,r[t])}))}return e}function TT(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=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Me.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},mT=e=>{let{relationUri:t}=e;return{type:Me.DELETE_RELATION,parameters:{relationUri:t}}},hT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Me.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},bT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Me.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},OT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Me.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},vT=(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))),gT=e=>e.type===Me.DELETE_RELATION,_T=e=>e.type===Me.CREATE_RELATION,AT=e=>e.type===Me.REPOINT_RELATION,NT=e=>e.type===Me.UPDATE_RELATION,PT=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),RT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Me.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return gp({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Me.DELETE_RELATION:return()=>{const{relationUri:e}=r;return vp(e,i).then(o)};case Me.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Pp(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Me.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return _p({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Me.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[mT({relationUri:o}),ET({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(wT(n)),(0,l.map)(RT),PT)(s)}}},ST=e=>t=>()=>e().then(t),wT=e=>t=>fT({dcrProcessor:e},t),IT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Pr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(wT(r)),(0,l.map)(RT),(0,l.map)(ST(r.getDcrUriAwait)),PT,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},UT=e=>t=>(0,l.map)((t=>fT({},t,{parameters:(0,l.evolve)({parentUri:yT(e),entityUri:yT(e),newEntityUri:yT(e)},t.parameters)})),t),CT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},LT=(e,t)=>{const r=e.filter(_T).find(vT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>NT(o)&&vT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!AT(o)||!vT(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(CT({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},jT=(e,t)=>{const r=e.filter(AT).filter(vT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!NT(i)||!vT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(CT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},DT=(e,t)=>{const r=e.filter(gT).filter(vT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!vT(t,e)))},kT=(e,t)=>{const r=e.filter(NT).filter(vT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!NT(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(CT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},FT=e=>{const t=e.filter(gT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(DT,e)},MT=e=>{const t=e.filter(_T).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(LT,e)},xT=e=>{const t=e.filter(AT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(jT,e)},$T=e=>{const t=e.filter(NT).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)(kT,e))(t)},VT=e=>(0,l.pipe)(FT,MT,xT,$T)(e);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}const BT=e=>GT({},(0,l.path)(rE(),e),{startDate:(0,l.path)(oE(),e),endDate:(0,l.path)(sE(),e)}),YT=(e,t)=>(0,l.pipe)((0,l.path)(aE()),yT(t))(e),qT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=YT(e,r),i=(0,l.path)(nE(),e)===xe.IN,a=e.parentEntityUri||n;return ET({parentUri:i?t:a,relation:BT(e),entityUri:i?a:t})})),...o.map((t=>{const i=YT(t,r),a=(0,l.path)(nE(),t)===xe.IN,o=i!==(0,l.pipe)((0,l.path)(rE()),a?lE:uE)(t),s=dE(e,(0,l.path)(eE(),t)),u=t.parentEntityUri||n,c=yT(r,i);return o?OT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(rE(),t),isReversed:!1}):bT({oldRelation:(0,l.path)(rE(),s),newRelation:BT(t)})})),...i.map((e=>mT({relationUri:e}))),...s.map((e=>hT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},HT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return GT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),QT=(0,l.has)("dataTenant"),KT=(0,l.ifElse)(QT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),JT=(e,t)=>(0,l.pipe)(ci,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Ms),Ra)(e,t),XT=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)}},zT=(e,t,r)=>{const n=yd(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)},ZT="relation",eE=(0,l.always)([ZT,"relationUri"]),tE=(0,l.always)([ZT,"relationType"]),rE=(0,l.always)([ZT,"object"]),nE=(0,l.always)([ZT,"direction"]),iE=(0,l.always)([ZT,"object","attributes"]),aE=(0,l.always)(["entity","entityUri"]),oE=(0,l.always)([ZT,"startDate"]),sE=(0,l.always)([ZT,"endDate"]),lE=(0,l.path)(["startObject","objectURI"]),uE=(0,l.path)(["endObject","objectURI"]),cE=(0,l.path)(["startObject","objectTypeURI"]),pE=(0,l.path)(["endObject","objectTypeURI"]),dE=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(eE()),(0,l.equals)(t))(r))return r;if(r.connections){const e=dE(r.connections,t);if(e)return e}}},yE=(0,l.pipe)(dE,(0,l.path)(rE())),fE=(0,l.allPass)([(0,l.pipe)((0,l.path)(aE()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(tE()),(0,l.complement)(E))]),TE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:bt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=hE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=EE(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?XT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},EE=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:en.IN}:{type:t[0],direction:en.OUT}:null},mE=e=>e.uri||e,hE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&gi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===en.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"],Cr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Cr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(mE,ci(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(en.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(en.OUT)),(0,l.map)(u))},t)||{}},bE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ti({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=di(e,n.uri);return n&&(!t||jr(e,i,t))&&(!r||jr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Cr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Cr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(Yo,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)}},OE=(0,l.curry)(((e,t,r,n,i)=>{const a=jr(n,l.__,t.type),o=e?pE:cE,s=jr(n,l.__,r.type),u=e?cE:pE;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),vE=(e,t,r)=>{const n=e?pE:cE,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(jr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};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{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return gE({},t,{[r]:{parents:n,children:i}})},NE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return gE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},PE=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=Jf(t,i),o=AE({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>PE(n.uri,t,[e],r)),o)},RE=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)(eE(),n),a=t?NE({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(aE(),n),s=mt(o)?[o]:[],u=AE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>PE(t,r,[i],e)),u)}),n)},SE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return RE(r,e,t,PE(e,t))},wE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return SE(t,r,n);if(vt(e)){const t=dE(n,e);return t&&RE([t],null,r)}return r[e]?PE(e,r):void 0},IE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>IE(e,t))))},UE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>UE(e,t))))},CE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ot(t),u=SE(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(vt(c)){if(s=dE(i,c),!s)return null;o.push({type:ve.relationConnection,value:s,valueType:ci(a,(0,l.path)(tE(),s))});continue}if(vt(u)){const e=n[c];if(!e)return null;o.push({type:ve.tempEntity,value:e,valueType:Cr(a,e.type)});continue}const p=n[u],d=ks(p,c),y=n[c];if(!d||!y)return null;o.push({type:ve.attributeValue,value:d,valueType:ar(a,Ut(d.uri,p.type))}),o.push({type:ve.tempEntity,value:y,valueType:Cr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},UE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=vt(s),d=p?yE(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?ci(a,d.type):Cr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:or(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:ve.tempEntity,value:T,valueType:Cr(a,T.type)}),o.push({type:ve.attributeValue,value:s,valueType:E}),m=s.value;const l=Es(s);T=l&&mt(l)?n[l]:null}}return o},LE=e=>e.every((e=>{let{type:t}=e;return[ve.attributeValue,ve.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ve.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let jE;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(jE||(jE={}));const DE={[jE.insertAttribute]:{color:"#599E0E"},[jE.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[jE.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},kE=e=>{switch(e){case"UPDATE_ATTRIBUTE":return jE.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return jE.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return jE.deleteAttribute;default:return""}},FE="/",ME=(0,l.pipe)((0,l.split)(FE),(0,l.propSatisfies)((0,l.lte)(2),"length")),xE=(0,l.pipe)((0,l.split)(FE),(0,l.slice)(0,-2),(0,l.join)(FE)),$E=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>ME(e),$E(xE(e))]])(t))),VE=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+FE))),GE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=$E(e,t);return(0,l.isNil)(r)?VE(e)(t)?"UPDATE_ATTRIBUTE":"":r},WE=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]},BE=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(BE(e))}))}))),t},YE=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(KE,t),(0,l.propOr)([],"crosswalks",e))),e),qE=(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(qE(e))}))})),r},HE=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=HE(e);r>t&&(t=r)}))})),t+1):t},QE=(e,t)=>{if(mt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},KE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},JE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},XE=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},zE=(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)},ZE=(0,l.eqBy)(KE),em=(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)(cs,(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 tm(e){return e&&void 0!==e.uri}function rm(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 nm(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 im(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(im(d.value,y.value,r)):"Reference"===g(d)?nm(d,y)?o.push.apply(o,im(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 am(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)||tm(r)&&tm(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function om(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 sm(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=lm(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?um(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=lm(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 lm=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),um=(e,t,r)=>(0,l.pipe)(Fs,(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 QE(t,r)},e=>{let[t]=e;return!os(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function cm(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 pm(e,t){return rm("UPDATE_TAGS").call(this,e,t)}function dm(e,t){return rm("UPDATE_ROLES").call(this,e,t)}function ym(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){fm(e,t,r[t])}))}return e}function fm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Tm=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=ym({},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:ym({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const Em=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Em(t.value):[]];return e.concat(r)}),[])),mm=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,hm=e=>e?[Ld(e)]:[],bm=e=>{const t=[...Em((null==e?void 0:e.attributes)||[]),...Em((null==e?void 0:e.analyticsAttributes)||[])];return e?[...hm(e),...t]:[]},Om=(e,t)=>[e,...t.map((t=>mm(e,t)))],vm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return KT(t)}))},gm=(e,t)=>{switch(e){case ge.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ge.ENTITY_ATTRIBUTE:case ge.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ct(t)]})(t);case ge.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ge.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Ld({uri:n,dataTenant:i}),r]})(t)}},_m=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),Am=(0,l.curry)(((e,t)=>{const r=To(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Am(e,r.extendsTypeURI)):n})),Nm=(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))),Pm=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Am(e),Nm(t))(t);function Rm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sm=e=>{let{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}},wm=e=>!e.deactivated,Im=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},Um=e=>Im(e)+e.message,Cm=(0,l.unless)(l.isNil,(0,l.prop)("message")),Lm=(0,l.unless)(l.isNil,(0,l.prop)("type")),jm=(0,l.curry)(((e,t)=>Nt(t.parentUri,e))),Dm=(0,l.curry)(((e,t)=>t.parentUri===e)),km=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Nt(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Ze.TYPE_REFERENCE),(0,l.pipe)(it,(0,l.any)(Nt(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),Fm=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),Mm=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),xm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Hm,wm,jm(e),km(t),(0,l.complement)(Mm(e,t.uri))]))(r)},$m=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Hm,wm,Dm(e),Fm(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",me.missed))]))(r);return n&&n.message||""},Vm=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===me.missed))},Gm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([wm,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(eE(),e))]))(t)},Wm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([wm,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},Bm=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([wm,jm(t)]))(r)},Ym=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([wm,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},qm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?CE(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 ve.attributeValue:{const e=a;if(Kt(a))return yd(o,e.dataLabelPattern);if(Jt(a)){const t=o,i=Es(t),a=rt(e),s=Cr(n,a);return mt(i)?yd(r[i],s.dataLabelPattern):t.label}return""}case ve.tempEntity:return yd(o,a.dataLabelPattern);case ve.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Cr(n,null==e?void 0:e.entityType);return`${Td(i&&mt(i)?yd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||pi(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){Rm(e,t,r[t])}))}return e}({},e,{label:Td(t)})}))},Hm=e=>!e.severity||e.severity===be.ERROR,Qm=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Ze.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(Qm(n))}));case Ze.TYPE_REFERENCE:return!!us(t);case Ze.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Km=(e,t)=>e.every((0,l.complement)(Qm(t))),Jm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=bo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=vs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!os(e.parent))))).forEach((e=>{Km(e.attrValues,n)&&r.push(Sm({type:me.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:rn().text("Attribute is required"),source:he.local}))})),r}),[])},Xm=(0,l.curry)(((e,t,r)=>vs(e,t,r,!1))),zm=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Cr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Ht),(0,l.filter)(Jt),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(Xm(e,t)));return(0,l.pipe)(r,(0,l.reject)(Es),(0,l.map)((e=>{let{uri:r}=e;return Sm({type:me.missedRefEntity,uri:"",attributeTypeUri:Ut(r,t.type),parentUri:r,message:rn().text("Entity is required"),source:he.local})})))(t)},Zm=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(Es,mt)).flatMap((n=>{const i=Es(n),a=t[i],o=ar(e,Ut(n.uri,r.type));return eh(e,t,o,a)})),eh=(e,t,r,n)=>{const i=it(r),a=i.map((t=>ar(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Ze.TYPE_REFERENCE))).flatMap(ot).concat(i);return th(e,t,n,(e=>a.some(Nt(e.uri))))},th=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Jm(e,r,n),a=zm(e,r),o=Zm(e,t,r);return[...i,...a,...o]},rh=(e,t)=>{const r=(0,l.path)(rE(),t)||{};return Jm(e,r)},nh=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(aE()),(0,l.ifElse)(mt,(e=>t[e]),(0,l.always)(null)))(r),i=rh(e,r),a=(e=>(0,l.path)(aE(),e)?[]:[Sm({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(tE(),e),parentUri:(0,l.path)(eE(),e),message:rn().text("Entity is required"),source:he.local})])(r),o=((e,t,r)=>r?th(e,t,r):[])(e,t,n);return[...i,...a,...o]},ih=e=>(0,l.path)(["entity","uri"],e)?[]:[Sm({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:rn().text("Entity is required"),source:he.local})],ah=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Jm(e,r),i=ih(t);return[...n,...i]};function oh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sh=(e,t)=>{var r,n;const i=Cr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Ba(e)},lh=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),uh=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(lh(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},ch=(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)(ms,mt,l.not)]),(e=>{const t=(0,l.pipe)(ms,Rt)(e);return uh((e=>e.replace(t,t+dt)))(e)})),(0,l.when)((0,l.pipe)(Es,mt),(t=>{const r=Es(t),n=e[r],i=n&&dh(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){oh(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),ph=(e,t,r)=>sm(im((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),cm((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)(ch(r,e.type)),(0,l.map)(uh(Ft))))})(e))).concat(cT(e,t)),dh=(e,t)=>(0,l.evolve)({attributes:hl({valueTransformer:(0,l.pipe)(Os,ch(t),lh(Ft)),deleteEmptyComplex:!0}),uri:Ft})(e);function yh(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){fh(e,t,r[t])}))}return e}function fh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Th=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(pt,"g"),"uri$$$$").replace(new RegExp(dt,"g"),""))),Eh=e=>(0,l.pipe)((0,l.evolve)({objectUri:Th,objectParentUri:Th}),(e=>{return yh({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?me.missed:me.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&kt(e.objectUri),uri:e.objectUri,source:he.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),mh=(e,t)=>(0,l.map)((0,l.pipe)(Eh,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=qm(t,s),p=null!=c&&c.length?c.slice(0,-1):qm(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&ar(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ve.attributeValue&&(a=e.valueType)}return a})(o,c,e);return yh({},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&&Dt(i)){const n=(0,l.last)(a),i=n.valueType;if(Jt(i)&&st(i).includes(o)){const i=Es(n.value),o=i&&mt(i)?t[i]:null;return o?yh({},e,{parentUri:o.uri,path:a.concat({type:ve.tempEntity,value:o,valueType:Cr(r,o.type),label:""})}):e}}return e}})(t)))(e),hh=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 bh,Oh=r(33164);function vh(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"}(bh||(bh={}));const gh={},_h={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"]}},Ah=e=>{if(!gh[e]){const t=_h[e]||_h.random0;gh[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){vh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return gh[e]},Nh=(0,l.curry)(((e,t)=>{const r=Ah(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]})),Ph=e=>Nh(bh.Charts,e),Rh=()=>Ah(bh.PotentialMatches).colors,Sh=e=>Nh(bh.Random1,e),wh=e=>(0,Oh.getColor)(e)?"#FFFFFF":"#212121";var Ih=r(73116);const Uh=Array.from({length:100},((e,t)=>t/100)),Ch=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)},Lh={},jh=new Ih.Z({hash:Ch,saturation:Uh.slice(15,71),lightness:Uh.slice(50,90)}),Dh=new Ih.Z({hash:Ch,saturation:Uh.slice(46,89),lightness:Uh.slice(44,58)}),kh=(0,l.curry)(((e,t,r)=>{t in Lh||(Lh[t]={});const n=Lh[t];r in n||(n[r]=((e,t)=>{const r=String(Ch(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Fh=kh(jh,"crosswalks"),Mh=kh(jh,"sources"),xh=kh(jh,"contributors"),$h=kh(jh,"dataValidationFunctions"),Vh=kh(Dh,"entities");function Gh(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){Wh(e,t,r[t])}))}return e}function Wh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bh=(0,l.has)("items"),Yh=e=>0===e,qh=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)},Hh=e=>e.reduce(((e,t)=>e+t.width),0),Qh=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Kh=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Jh=e=>e.reduce(((e,t)=>e+t.height),0),Xh=e=>(0,l.is)(String,e)&&e.includes("%"),zh=e=>Boolean(e.spacer),Zh=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),eb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Bh(t)?eb(t):t)),[]),tb=e=>({id:e.layout}),rb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tb;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.floor(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=Xh(r.width)?Zh(i,r.width):u}return qh(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return qh(n,t,r)},o=(e,t)=>Bh(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,u)=>{const c=i(t,r,s,Bh(s)?n(s.layout):e(s.view)),d=Yh(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(Bh(s))return o.concat(p(Gh({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(Gh({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Hh(o),height:Qh(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Bh(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Yh(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Bh(i))return r.concat(p(Gh({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Gh({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?qh(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?qh(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Kh(i),height:Jh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=Yh(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return Gh({},o,{x:t.x,y:c,width:s,height:u})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=Gh({},e,{width:a}),s=Gh({},e,{x:e.x+a,width:a}),u=(0,l.has)("left",r)&&n(o,t,r.left,i),c=(0,l.has)("right",r)&&n(s,t,r.right,i),p=(0,l.propOr)(0,"height"),d=Math.max(p(u),p(c));t.push(Gh({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return Gh({},e,{height:Jh(r),items:r})},o=i(t,(0,l.propOr)([],"top",r)),s=Math.round(.66*t.width),u=(0,l.isEmpty)(o)?t.y:t.y+o.height,c=i(Gh({},t,{y:u,width:s}),(0,l.propOr)([],"center",r)),p=i({x:t.x+s,y:u,width:t.width-s},(0,l.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Gh({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=Gh({},t,{items:(0,l.reject)(zh,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 eb(f)},nb=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),ib=[Ge.FilteredEntitiesViewFacet,Ge.ActivitiesViewFacet,Ge.ProfileStatsFacet,Ge.FilteredSavedSearchesFacet],ab=(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=ib.includes(a.component)?8:4;return Gh({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function ob(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){sb(e,t,r[t])}))}return e}function sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lb={BarChart:Ve.BAR,BarChartGrouped:Ve.BAR,BarChartHorizontal:Ve.BAR,LineChart:Ve.LINE,Map:Ve.MAP,Pie:Ve.PIE},ub=(e,t)=>Lt(e)?wt(e,t):e,cb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=lb[r];return ob({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},pb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return ob({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"]))},db=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return ob({},e,{value:[Wr,Br,$r.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:qr(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Lt(t)||!r?n:(n||[]).concat((i=r,{filter:$r.EQUALS,fieldName:"type",values:[i]}));var i},yb=["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"],fb={"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:ub(n,r),filters:db(a,n,r),chartType:Ve.BAR,component:Ge.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:ub(n,r),filters:db(a,n,r),chartType:Ve.BUBBLE,component:Ge.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:Ge.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 ob({id:t,count:o,canRead:u,orderType:s,attributeUri:ub(r,p),filters:db(a,r,p),component:Ge.DashboardFacet,title:i,showOthers:!0},cb(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:ub(n,r),filters:db(a,n,r),chartType:Ve.MAP,component:Ge.DashboardFacet,title:i,geoUrl:yb[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 ob({id:t,count:o,canRead:l,attributeUri:ub(n,r),filters:db(a,n,r),component:Ge.DashboardFacet,title:i,geoUrl:s,chartType:Ve.MAP,projection:"geoMercator"},cb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.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:pb(i),component:Ge.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:db(n,null,a),component:Ge.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:$r.GTE,fieldName:"matches",values:["1"]}],component:Ge.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:Ge.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:Ve.CLOUD,component:Ge.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:Ve.TREE,component:Ge.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.NotificationInboxFacet,title:n||rn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ActivitiesViewFacet,title:n||rn().text("Activity log")}}},Tb=e=>({id:e,height:10}),Eb=(0,l.pipe)((0,l.map)((e=>{const t=fb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),mb=e=>{if("0.1"===e.version){const t=Eb(e.views),r=rb(Tb,e.layout,{columns:4});return{id:e.id,margin:0,layout:nb(r,t),views:t}}return e},hb=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=>hb(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function bb(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){Ob(e,t,r[t])}))}return e}function Ob(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vb=bb({},We,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),gb=e=>e,_b={[vb.Attributes]:gb,[vb.HierarchyTree]:gb,[vb.HierarchyPaths]:gb,[vb.RelationsTable]:gb,[vb.Relations]:e=>bb({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[vb.SingleAttribute]:gb,[vb.Custom]:gb,[vb.AttributeTable]:gb,[vb.Map]:gb,[vb.OldTree]:e=>bb({},e,{class:We.HierarchyTree}),[vb.OldMap]:e=>bb({},e,{class:We.Map}),[vb.ImageAttribute]:gb,[vb.PotentialMatches]:gb},Ab=(0,l.pipe)((0,l.map)((e=>{const t=_b[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Nb=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===We.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Pb=(e,t)=>(t||[]).map((t=>bb({},t,Nb(e,t.id)))),Rb=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return bb({},t,{layout:Pb(t.views,e.newLayout)});if("0.1"===e.version){const r=Ab(e.views),n=rb(Nb(r),e.layout,{columns:4});return bb({},t,{layout:nb(n,r),views:r})}return e},Sb=(e,t)=>e.class===t||e["react-class"]===t,wb=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Sb(t,We.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 Sb(t,We.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(Nt(n))||t.some(Nt(n))}},Ib=(e,t)=>e.filter((e=>t.some((t=>Sb(e,t))))).map((e=>{let{id:t}=e;return t})),Ub=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Cb=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),Lb=e=>(0,l.pipe)((0,l.map)((e=>Ub(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function jb(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){Db(e,t,r[t])}))}return e}function Db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kb=(0,l.curry)(((e,t)=>hb(t).map((t=>(0,l.pipe)((0,l.map)((e=>Ub(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),Fb=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),Mb=(0,l.propEq)("class",We.Custom),xb=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},$b=(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=Pb(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=>Ub(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=kb(e,t.layout);i=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>Ub(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[n,i]=(0,l.partition)(Fb,null==r?void 0:r.items),a=(0,l.pipe)(kb(e),(0,l.filter)(Mb))(jb({},r,{items:n})),o=[{id:"common",views:kb(e,jb({},r,{items:i}))}];return a.length>0&&o.push({id:"D&B",views:a}),o}})(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=Rb(jb({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(Lb,(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})},Vb=(e,t)=>{if("scroll"===t.layout.layout){const r=kb(e,t.layout),n=mb(jb({},t,{views:r,version:"0.1"}));return{class:Ye.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Ye.Dashboard,views:t.views,layout:t.layout,id:t.id}},Gb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},Wb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},Bb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},Yb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},qb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},Hb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Qb=(e,t)=>{const r=kb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Cb(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:Ye.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}},Kb=(e,t)=>({class:Ye.Graph,id:t.id}),Jb=(e,t)=>{const r=kb(e,t.layout)[0];return{class:Ye.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},Xb=e=>t=>!!(0,l.intersection)(e,t).length,zb=(0,l.cond)([[Xb(["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"]),()=>Vb],[Xb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>Gb],[Xb(["com.reltio.plugins.graph.GraphView"]),()=>Kb],[Xb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>Wb],[Xb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>Bb],[Xb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>Yb],[Xb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>qb],[Xb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>Hb],[Xb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Qb],[Xb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Jb],[l.T,()=>(0,l.always)(void 0)]]),Zb=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(xb),(0,l.map)((t=>$b(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Ye.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:qe.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:qe.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=>Ub(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Ye.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>Ub(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=$b(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Ye.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=hb(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 zb(o)(t,i)};function eO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tO(e,t,r[t])}))}return e}function tO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rO=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))},nO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var iO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(iO||(iO={}));const aO={[Ye.DQDashboard]:`${nO}DqDashboard.svg`,[Ye.Dashboard]:`${nO}Dashboard.svg`,[Ye.Graph]:`${nO}Graph.svg`,[Ye.RelationshipSearch]:`${nO}GraphSearch.svg`,[Ye.Interactions]:`${nO}Interactions.svg`,[Ye.PotentialMatches]:`${nO}PotentialMatches.svg`,[Ye.Profile]:`${nO}Profile.svg`,[Ye.NestedProfile]:`${nO}Profile.svg`,[Ye.ProfileActivityLog]:`${nO}ActivityLog.svg`,[Ye.Relationships]:`${nO}Relationships.svg`,[Ye.Sources]:`${nO}Crosswalk.svg`,[Ye.Search]:`${nO}Search.svg`,[iO.DashboardGroup]:`${nO}DashboardGroup.svg`,[iO.ProfileGroup]:`${nO}ProfileGroup.svg`,[iO.SearchGroup]:`${nO}SearchGroup.svg`,DEFAULT:`${nO}Default.svg`},oO=e=>aO[null==e?void 0:e.class]||aO.DEFAULT,sO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Ye.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>eO({},e,{nestedRoute:`${t+1}`})))))),lO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},uO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?aO[iO.ProfileGroup]:null,cO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===aO[Ye.Dashboard]||t===aO[Ye.DQDashboard]})),(0,l.always)(aO[iO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===aO[Ye.Search]||t===aO[Ye.RelationshipSearch]})),(0,l.always)(aO[iO.SearchGroup])],[l.T,()=>null]])(e),pO=e=>(0,l.pipe)((0,l.chain)(rO),(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=>eO({},e,{entityTypes:e["entity-types"],screen:Zb(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=sO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:oO(r),screen:lO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=Zb(t,e);return{label:t.label,icon:uO(t)||cO(r)||oO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function dO(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((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},fO=e=>({id:e,height:10}),TO=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)(yO),(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=Eb(((e,t)=>{const r=hb(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){dO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=rb(fO,t.layout,{columns:4});return{views:r,layout:nb(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function EO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mO=(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))),hO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,bO=e=>(0,l.pipe)((e=>Cb(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=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){EO(e,t,r[t])}))}return e}({},t,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,["action"]))})))(e),OO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),vO=(0,l.pipe)(mO("top-logo"),OO),gO=(0,l.prop)("showLookupCode"),_O=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>Ub(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=>Ub(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=>Ub(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=>Ub(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=>Ub(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=>Ub(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=>Ub(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>Ub(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)(mO("default-perspective"),(0,l.ifElse)(hO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>Ub(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=bO(e),f=(e=>mO("checkUser",e))(e),T=(e=>mO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>Ub(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>Ub(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=gO(m))||b;var b;const O=null===(t=Lb(e))||void 0===t?void 0:t.showEntityId,v=(e=>mO("preview",e))(e),g=vO(e),_=(e=>mO("topBackgroundColor",e))(e),A=(e=>(0,l.pipe)((0,l.map)((e=>Ub(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);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:h},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(A).length?void 0:A,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,headerColor:_}},AO=e=>({layout:pO(e),pivoting:TO(e),properties:_O(e)});var NO=r(58697),PO=r.n(NO);function RO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){SO(e,t,r[t])}))}return e}function SO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wO=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}_${PO()()}`;return n[e.id].push(t),i=!0,RO({},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]++,RO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function IO(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}let CO={};const LO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(CO[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))}CO=IO({},CO,{[a]:IO({},CO[a]||{},{worker:i})})}else i=CO[a].worker,CO[a].innerText&&t({task:{action:Je.SET_HTML,params:{html:CO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",CO[a].onWorkerMessage);return i&&(CO[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||(CO[a].innerText=n.params.html)}},i.addEventListener("message",CO[a].onWorkerMessage)),i},jO=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),DO=(0,l.flip)(jO),kO=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=rn().number(t));return t})),FO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?rn().number(e,"0,0.0a").toUpperCase():rn().number(e,"0,0"):""},MO=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let xO=!0;const $O=e=>xO=e,VO=(e,t)=>e!==t&&t?xO&&e?`${t} (${e})`:t:e,GO=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),WO=(e,t,r)=>{const n=GO(e,t,r);return VO(r,n)},BO=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),YO=(0,l.complement)(BO),qO=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),HO=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)},QO=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(YO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),KO=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case Ze.TYPE_NUMBER:case Ze.TYPE_FLOAT:case Ze.TYPE_DOUBLE:case Ze.TYPE_LONG:case Ze.TYPE_INT:case Ze.TYPE_COUNT:return t&&kO(o,t);case Ze.TYPE_BOOLEAN:case Ze.TYPE_BOOLEAN_RADIO:case Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?rn().text("Yes"):rn().text("No");case Ze.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(ju(t)?Du(t):rn().date(t,s));case Ze.TYPE_ACTIVENESS_DATE:case Ze.TYPE_LOCAL_DATE:return(t=t)&&(ju(t)?Du(t):rn().date(t,s));case Ze.TYPE_TIMESTAMP:return(t=t)&&(ju(t)?Du(t):rn().date(isNaN(t)?t:Number(t),u));case Ze.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Ze.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Ze.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)?VO((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),JO={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)"},XO=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()}},zO=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}}throw r})))),ZO=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}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(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)((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),XO,zO);return{request:(e,n)=>{const i=s(fetch),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))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},ev="__metadata",tv=(e=>{const t=[ev,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),rv=(0,l.set)(tv),nv=(0,l.view)(tv),iv=rv(Xr.NEW),av=rv(Xr.REMOVED),ov=rv(Xr.EDITED),sv=rv(Xr.IGNORED),lv=(0,l.pipe)(nv,(0,l.equals)(Xr.REMOVED)),uv=(0,l.pipe)(nv,(0,l.equals)(Xr.NEW)),cv=(0,l.pipe)(nv,(0,l.equals)(Xr.EDITED)),pv=(0,l.pipe)(nv,(0,l.complement)(l.isNil)),dv=(0,l.pipe)(nv,(0,l.equals)(Xr.IGNORED)),yv=(0,l.omit)([ev]),fv=(e,t)=>e===ev?void 0:t;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 Ev=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=Ev(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},mv=(e,t)=>Ev((0,l.propEq)("nodeId",t),e),hv=(e,t)=>Ev((0,l.pathEq)(["entity","uri"],t),e),bv=(e,t)=>{const r=mv(e,t);return r.length>1?r[r.length-2]:null},Ov=(e,t)=>{const r=mv(e,t);return r.length>0?r[r.length-1]:null},vv=(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=>vv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},gv=()=>{},_v=(e,t)=>{let{parent:r,nodeProcessing:n=gv}=t;n(e,r),e.children&&e.children.forEach((t=>_v(t,{parent:e,nodeProcessing:n})))},Av=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ue.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 Ue.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 Ue.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){Tv(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})}}},Nv=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&&_v(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ue.addingChild||r.editingMode===Ue.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Av({node:r,connection:n,isReversed:i}),s=ET({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ue.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Av({node:r,isReversed:i,connection:n}),l=s?OT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):bT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Pv=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Pv(r,t);if(e)return e}return!1},Rv=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Rv(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),Sv=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Pv(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Rv(e,n.root)}}));return(0,l.pipe)(r,n)(t)},wv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Iv={asc:"asc",desc:"desc"},Uv=wv.entityLabel,Cv=Iv.asc,Lv=(0,l.always)(0),jv=e=>{let{sortField:t=Uv,sortOrder:r=Cv,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case wv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return rN.strings.sort(t,a,o)})(n,r);case wv.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return rN.strings.sort(e,i,a)})(r);default:return Lv}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Dv=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Iv)),l.identity,(0,l.always)(Cv))),kv=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(wv)),l.identity,(0,l.always)(Uv)));var Fv=r(91104);let Mv;const xv=(e,t)=>(Mv||(Mv=Fv.createClient({key:t})),new Promise((t=>{Mv.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)}))}))),$v=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Vv=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(os).flatMap((e=>{let r;return e.type==t&&(r=[$v(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Vv(e.value,t))),r})),Gv=e=>e&&e.length>0,Wv=(e,t)=>[].concat(e&&e.attributes?Vv(e.attributes,t):[]).filter(l.identity);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,n,i,a)=>{if(e&&e.type){const t=Cr(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){Bv(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Wv(e,t.latitude),n=Wv(e,t.longitude),Gv(r)&&Gv(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(Gv(t)&&t[0].value&&Gv(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?xv(n.label,a).catch((()=>null)):Promise.resolve(null)},qv=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=Cr(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 Yv(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?xv(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)))},Hv=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=Cr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(ar(e,r.latitude,t.type)&&ar(e,r.longitude,t.type)){const e=Wv(t,r.latitude),n=Wv(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))},Qv=(e,t,r)=>Promise.all([Hv(e,t),qv(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 Kv(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){Jv(e,t,r[t])}))}return e}function Jv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xv=(e,t)=>t.values.map(io(e,t.entityTypeUri)),zv=(e,t,r)=>Qs(t.fieldName,r)||ar(e,wt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Zv=(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?VO(e,t):e}),r)},eg=(0,l.path)(["attrType","label"]),tg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Kv({},e,{[t]:!0})),{});e[r]=e[r]?Kv({},e[r],n):n}return e}),{}),rg=(0,l.pipe)((0,l.prop)("values"),E),ng=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",En.type.name)),ig=e=>e.type===sg.NUMERIC_RANGE_FACET,ag=e=>e.type===sg.DATE_RANGE_FACET,og=(0,l.either)(ig,ag),sg={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},lg=e=>{switch(null==e?void 0:e.name){case En.type.name:return sg.ENTITY_TYPE_FACET;case En.createdBy.name:case En.updatedBy.name:case En.sourceSystems.name:case En.tags.name:case En.roles.name:case En.matchRules.name:case En.MLRecommendedMatch.name:return sg.WITH_DROPDOWN_CHECKBOXES_FACET;case En.createdTime.name:case En.updatedTime.name:case En.startDate.name:case En.endDate.name:return sg.DATE_RANGE_FACET;case En.matches.name:case En.matchScore.name:return sg.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return sg.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return sg.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return sg.DATE_RANGE_FACET;default:return sg.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},ug=(0,l.pipe)(zv,lg),cg=(0,l.pipe)((0,l.path)(["attrType","type"]),Tr),pg=(0,l.cond)([[ig,(0,l.always)($r.IN_RANGE)],[ag,(0,l.always)($r.WITHIN)],[(0,l.allPass)([cg,e=>e.values.length>=2]),(0,l.always)($r.EXISTS)],[l.T,(0,l.always)($r.EQUALS)]]),dg=(0,l.cond)([[ag,(0,l.prop)("values")],[ig,(0,l.prop)("values")],[cg,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 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 fg=(0,l.pipe)((0,l.path)(["attrType","type"]),ur),Tg=(0,l.pipe)((0,l.path)(["attrType","type"]),dr),Eg=(0,l.pipe)((0,l.prop)("attrType"),Js),mg=(0,l.pipe)((0,l.prop)("attrType"),Ks),hg=e=>t=>t.values.map((t=>Cr(e,t).label)).join(" , "),bg=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),Og=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(rn().number),bg)),(0,l.join)(","))(e.values);return`${eg(e)}: ${t}`},vg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),bg)),(0,l.join)(","))(e.values);return`${eg(e)}: ${t}`},gg=e=>t=>`${eg(t)}: ${Xv(e,t).join(", ")}`,_g=e=>t=>{const r=Zv(e,t);return`${eg(t)}: ${r.join(", ")}`},Ag=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[mg,hg(e)],[Tg,Og],[fg,vg],[Eg,gg(e)],[l.T,_g(t)]]),r))),Ng=(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){yg(e,t,r[t])}))}return e}({},t,{attrType:zv(e,t,n)}))),Ag(e,r))(t),Pg=new RegExp(`^${rn().text("Search")}`),Rg=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Ng(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Pg,"",u)]},Sg=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Kr),wg=e=>(e=>Sg.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]=Fu(t);return e.replace(r,i).replace(n,a)}),e))(e),Ig=(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}`})),Ug={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Cg=e=>[Ug.geoPolygon,Ug.onMapMove].includes(e),Lg=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},jg=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Dg=(e,t)=>Cg(e)?t.map(Lg):[jg(t)],kg=e=>Cg(e)?rn().text("Geo Polygon"):rn().text("Geo Location"),Fg=e=>{switch(e){case Ug.geoLocation:return"geoLocation";case Ug.geoPolygon:case Ug.onMapMove:return"geoPolygon"}},Mg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},xg=e=>rn().text(e),$g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[$r.EQUALS]:"=",[$r.NOT_EQUALS]:"≠",[$r.STARTS_WITH]:"*",[$r.MISSING_VALUE]:rn().text("missing value"),[$r.HAS_ALL]:rn().text("has all"),[$r.IN_RANGE]:rn().text("in range"),[$r.FULL_TEXT]:rn().text("full text"),[$r.EXISTS]:rn().text("exists"),[$r.COUNT_EQUALS]:`${rn().text("count")} =`,[$r.COUNT_NOT_EQUALS]:`${rn().text("count")} ≠`,[$r.COUNT_LT]:`${rn().text("count")} <`,[$r.COUNT_LTE]:`${rn().text("count")} <=`,[$r.COUNT_GT]:`${rn().text("count")} >`,[$r.COUNT_RANGE]:rn().text("count range"),[$r.LT]:"<",[$r.LTE]:"<=",[$r.GT]:">",[$r.GTE]:">=",[$r.IN_FILE]:rn().text("in file"),[$r.NOT_IN_FILE]:rn().text("not in file"),[$r.CONTAINS]:"~",[Vr.LIST_EQUALS]:"=",[Vr.NOT_LIST_EQUALS]:"≠",[Vr.LIST_EQUALS_CASE_SENSITIVE]:"=",[Vr.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||rn().text(e.toLowerCase())},Vg=e=>({type:Mg.operator,text:e}),Gg=e=>({type:Mg.operator,text:xg(e)}),Wg=e=>({type:Mg.attributeLabel,text:e}),Bg=e=>({type:Mg.specialAttributeLabel,text:e}),Yg=e=>({type:Mg.attributeFilter,text:$g(e)}),qg=e=>({type:Mg.attributeValue,text:e}),Hg=e=>({type:Mg.entityTypeLabel,text:e}),Qg=()=>({type:Mg.space,text:" "}),Kg=()=>({type:Mg.bracket,text:"("}),Jg=()=>({type:Mg.bracket,text:")"}),Xg=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),zg=(0,l.curry)(((e,t)=>t.map(Xg(e)))),Zg=(0,l.curry)(((e,t,r)=>[e,...r,t])),e_=Zg(Kg(),Jg()),t_=Zg(Qg(),Qg()),r_=(0,l.curry)(((e,t)=>[e,...t])),n_=e=>r_(Hg(e)),i_=e=>r_(Hg(`${e}: `)),a_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=fu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=du(s),a=yu(s);!r&&t&&n&&(i.push(Kg()),r=!0),i.push(o),r&&a&&(i.push(Jg()),r=!1);const l=e?Gg(s):Vg(s);i.push(...t_([l]))}else i.push(o),r&&(i.push(Jg()),r=!1)}return i}},o_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),s_=(0,l.pipe)(a_({localizable:!1}),o_),l_=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},u_=e=>{let{data:t,values:r,filter:n}=e;return t&&oc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},c_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(u_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),p_=(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)&&tr(e.data.attrType)})(e)&&[$r.HAS_ALL,$r.EQUALS,$r.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:er((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})))),HO),d_=(e,t)=>(0,l.pipe)(p_,QO(t))(e),y_=(0,l.pathEq)(["data","fieldName"],En.type.name),f_=(0,l.path)(["data","entityTypeUri"]),T_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),E_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Qo(e)),attributes:(0,l.filter)((0,l.pipe)(f_,(0,l.anyPass)([l.isNil,Qo(e),r=>{const n=(t.entityTypes||[]).filter(Qo(e));return(n.length>1?Fr(e,n):null)===r&&!!Cr(e,r)}])))})(t))))),m_=e=>(0,l.pipe)((0,l.prop)("filter"),Zl,(0,l.equals)(e)),h_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Qs(n.fieldName)||n.attrType,s=Uu(o,i),u=KO({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>tr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?VO(a.lookupCode,a.value):WO(r,er(o),a)],[()=>Js(s),()=>io(e,n.entityTypeUri,a)],[()=>Xs(s),()=>Ro(e,a)],[()=>nl(s),()=>Io(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>dr(c)||Tr(c)),Ru),qg)()})),b_=(e,t,r,n)=>{const i=h_(e,t,r,n.data,n.filter);return(0,l.cond)([[m_(0),(0,l.always)([])],[(0,l.both)(m_(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[Qg(),i(r),{type:Mg.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Qg(),...(0,l.pipe)(l.flatten,(0,l.map)(i),zg({type:Mg.punctuationMark,text:", "}))(t)]}]])(n)},O_=(e,t)=>{const r=!!Qs(e.data.fieldName);return(0,l.pipe)(l_,r?Bg:Wg)(e,t)},v_=(e,t,r,n,i)=>[O_(n,i),Qg(),Yg(n.filter),...b_(e,t,r,n)],g_=(0,l.addIndex)(l.map),__=(0,l.propEq)("length",1),A_=(0,l.propSatisfies)((0,l.lt)(1),"length"),N_=(0,l.complement)(l.isEmpty),P_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(mu,(0,l.filter)(u_),hu,(0,l.map)((n=>({operand:v_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,a_()))(n)},R_=(0,l.pipe)(P_,l.flatten),S_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>kd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=P_(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(n_),(0,l.pipe)(s(i_),(0,l.unless)((()=>__(u)||i),e_)))(u)},w_=(e,t,r,n)=>(0,l.pipe)(mu,(0,l.filter)(c_),hu,g_(((n,i,a)=>({operand:S_(e,t,r,n,__(a)),operator:n.operator}))),a_(),l.flatten)(n),I_=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),a_(),l.flatten),U_=e=>{let{searchType:t,values:[r]}=e;return Dg(t,r).join(", ")},C_=(e,t,r,n,i,a)=>{const o=(e=>e?[Bg(e.isRawFilter?rn().text("Raw filter"):rn().text("Search")),...t_([Yg($r.EQUALS)]),qg(`"${e.value}"`)]:[])(i),s=(e=>e?[Bg(kg(e.searchType)),Qg(),qg(U_(e))]:[])(a),u=(0,l.pipe)(w_,(0,l.when)((e=>A_(e)&&(N_(o)||N_(s))),e_))(e,t,r,n);return I_([o,s,u])},L_=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),j_=(0,l.pipe)(C_,L_),D_=(0,l.has)("attributes"),k_=Array.isArray,F_=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),M_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=x_(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)(F_(a))),e_),(0,l.concat)(t_([Vg(o)]))))(s)},x_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return D_(n)?M_(e,t,r,n,i):k_(n)?n.reduce(((n,a)=>n.concat(x_(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(t_([Vg(n.operator)])))(v_(e,t,r,n,i))},$_=(e,t,r,n,i)=>(0,l.pipe)(x_,l.flatten)(e,t,r,n,i);function V_(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}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 W_=(0,l.complement)(y_),B_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(y_),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(f_),(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}},Y_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=B_(t);return(r||n)&&Tu(t)},q_=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(Y_)),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(y_).some((0,l.propEq)("filter",$r.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}=B_(r);if(Y_(e))t.push(V_({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(W_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(y_,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(f_,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(W_),entityTypes:n,operator:i?a:e.operator,id:PO()()}}));t.push(...n)}var a;return t})(t))),[]))),H_={[$r.EQUALS]:$r.ON,[$r.IN_RANGE]:$r.WITHIN,[$r.GTE]:$r.AFTER,[$r.GT]:$r.AFTER,[$r.LTE]:$r.BEFORE,[$r.LT]:$r.BEFORE},Q_=(0,l.curry)((e=>H_[e]||e)),K_=(0,l.curry)(((e,t)=>{switch(e){case $r.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case $r.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),J_=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ur),X_=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>V_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return J_(e)?(0,l.evolve)({filter:Q_,values:K_(t)},e):e}))})))})),z_=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Lu),(0,l.map)(Fu))}),Z_=(0,l.map)((0,l.cond)([[J_,z_],[l.T,l.identity]])),eA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),q_,E_(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")),Z_)})),X_,(0,l.reject)(T_))(r)));function tA(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){rA(e,t,r[t])}))}return e}function rA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nA=(e,t)=>({data:{uri:Lt(e.fieldName)?wt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||pg(e),id:PO()(),values:dg(e)}),iA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Qs(a,t,r)||ar(e,i);if(!s)return null;if(Yt(s))return tA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=kd(e,{type:o}),i=(ir(e,wt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return tA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),aA=(0,l.curry)(((e,t,r,n)=>eA(iA,e,n,t,r)));function oA(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){sA(e,t,r[t])}))}return e}function sA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},uA=e=>"rdmLookups.not.resolved"===e?En.notResolved.name:e,cA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Yr?$r.IN_RANGE:qr(a),u=uA(n),c=Qs(u)||ar(e,i),p=(0,l.cond)([[()=>nu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>oA({},e,{filename:MO(e)}))))],[()=>Tr(null==c?void 0:c.type),(0,l.map)(le)],[e=>tu(s)&&!Array.isArray(e[0])&&!ur(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:PO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Yr?"and not":"and",filter:s,values:p}})),pA=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(cA(e,Fr(e,i)));return[{id:PO()(),operator:"or",attributes:a,entityTypes:i}]})),dA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),yA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([dA("from"),dA("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,()=>[]]]),fA=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return oA({},r,{values:yA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Ws(e.fieldName,n):e.fieldName})},TA=(e,t)=>{if((0,l.has)("children")(e)){const r=fA(e,t);return e.children.reduce(((e,n)=>(e.push(TA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return fA(e,t)},EA=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(fA(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(oA({fieldName:e.fieldName},fA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(TA,l.flatten)],[l.T,fA]]),mA=(0,l.pipe)((0,l.map)(EA),l.flatten),hA=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},bA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=pA(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:mA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>oA({},t,{type:ug(e,t)}))).map((e=>oA({},e,{values:og(e)?hA(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 nA(r,t)})),operator:"or",id:PO()(),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=>({[uA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[oA({},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 aA(e,t,r,p)},OA=(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)(rg),(0,l.partition)(ng))(t),i=n.map((t=>tA({},t,{type:ug(e,t)}))).map((e=>nA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:PO()(),entityTypes:a}]})(e,a);return aA(e,t,r,o)})(e,t,r,n):bA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},vA=e=>"2.0"===e.version?e.keyword:lA(e),gA=e=>(0,l.pathEq)(["object","uri"],e),_A=(e,t)=>(0,l.pipe)((0,l.find)(gA(e)),(0,l.prop)("object"))(t),AA=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"),gA(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=_A(r.match,t)||n[r.match];return i?{label:Td((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return no(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)},NA=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),PA=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),RA=(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:Td((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return no(e,o.type,t)||{label:t,uri:t}}))}})))(t),SA=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)},wA=(0,l.path)(["object","uri"]),IA=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},UA=e=>e.getValue(),CA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=CA(n[e],t),!r);e++);return r},LA=(e,t)=>{const r=[],n=(0,l.pipe)(UA,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(LA,[t]),a);return r.push.apply(r,o),r};function jA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){DA(e,t,r[t])}))}return e}function DA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kA=(e,t)=>!!e[t],FA=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},MA=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||[]])},xA=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return jA({},t,{[r.uri]:jA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:MA(null==o?void 0:o.parents,n),children:MA(null==o?void 0:o.children,i),values:MA(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},$A=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Cr(r,t)||ci(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Fo(r,n,i).flatMap(xo).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>ar(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=xA({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>xA({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},VA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!mt(e.uri)&&_t(e.type)&&_t(t)&&!t.startsWith(e.type))(n,t))return e;const i=vs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(os),(0,l.map)(FA))(i);return xA({structure:e,attrType:e[t].attrType,values:a})}),t)},GA=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 kA(e,r)}));return r||n?t.filter(os).reduce(((e,t)=>GA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return kA(t,e.type)?xA({structure:t,attrType:t[e.type].attrType,values:[FA(e)]}):t}},WA=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?jA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},BA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=vs(i,n,r)||[];return a.length?xA({structure:t,attrType:t[r].attrType,values:a.filter(os).map(FA)}):t},YA=(e,t,r)=>{const n=Ot(e),i=Ot(t);return n===i?((e,t)=>{const r=kt(t),n=kt(e);return Nt(n,r)||((e,t)=>jt(e)&&!jt(t)&&Nt(t,e))(n,r)})(e,t):!(!r||!Dt(t))&&IE(r,i).includes(n)},qA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},HA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?SE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return YA(r,t,o)}))},QA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>QA(e,t,r)))))},KA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&qA(n,e)}},JA=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ot(n),c=wE(u,o,i,a),p=QA("children",t,l),d=QA("parents",t,l),y=p.flatMap((e=>QA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return YA(t,n,c)})).map((t=>KA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return YA(n,t,c)||Ot(t)!==u&&YA(t,n,c)})).map((t=>KA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=QA("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&YA(n,t,c)}))})).map((t=>KA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return YA(t,n,c)})).map((e=>KA(r,n,e,s))),...T,...E,...f]},XA=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=KO({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=>yd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Kt,()=>a(n)],[tr,()=>(e=>{const r=o(e),n=er(t);return Wl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return WO(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},zA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:$r.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(ZA(r,t)):i.push(eN([t],r)),i},ZA=(e,t)=>{const r=qt(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=Kt(i)?ZA(i,t[r]):[eN(t[r],i)];return e.push(...a),e}}),[])},eN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Zt(t.uri),filter:t.type===Ze.TYPE_BLOB?$r.FULL_TEXT:$r.EQUALS,values:e}:{fieldName:Zt(t.uri),filter:$r.MISSING_VALUE},tN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},rN={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([[6495],{55046:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>xs,IL3:()=>Wp,PY2:()=>on,Ng6:()=>Ne,YJ7:()=>zr,NlI:()=>Vr,XYV:()=>Kr,Xt7:()=>Oe,wfT:()=>Wn,EMD:()=>Un,HAc:()=>ve,PEf:()=>pn,oA3:()=>In,$XE:()=>Ve,eWf:()=>un,q7e:()=>ge,KVe:()=>Bn,WVQ:()=>Or,oZZ:()=>Zn,bNA:()=>ei,Rjq:()=>ti,G39:()=>yn,W0P:()=>Je,X1H:()=>He,yn8:()=>Fe,N0y:()=>ke,dZX:()=>Ge,bQt:()=>ni,oS0:()=>Ze,bZE:()=>Hr,Nsj:()=>en,psV:()=>Xr,xPW:()=>sn,pyR:()=>Fn,p8l:()=>Ln,Wkf:()=>be,zHr:()=>he,NIO:()=>me,$26:()=>lg,Esk:()=>Nn,s9T:()=>je,MEy:()=>_u,j5E:()=>$r,vAw:()=>wn,NMQ:()=>Sn,eVu:()=>Vu,YGb:()=>Ke,mNm:()=>Dn,Y1q:()=>DE,s_5:()=>Mn,RgZ:()=>jn,unl:()=>zn,Qy0:()=>ri,pYu:()=>An,wIJ:()=>Cg,GFH:()=>Re,Ury:()=>fn,S91:()=>Tn,p3$:()=>si,wSh:()=>Z,BDP:()=>hi,pGS:()=>kn,ARY:()=>et,XGc:()=>Gn,fO_:()=>Rr,wwy:()=>Ue,h_8:()=>mn,_XL:()=>Zr,j2V:()=>Yn,dMV:()=>$n,NBX:()=>UA,OXy:()=>tt,BXd:()=>Me,KM9:()=>Ae,CJB:()=>Qn,lXI:()=>Ye,nqG:()=>ai,C68:()=>dn,yxQ:()=>ii,Yj_:()=>Ce,D25:()=>we,ZIY:()=>We,Tl4:()=>xg,lwr:()=>cn,NkU:()=>qn,Rtp:()=>Vn,YGx:()=>xe,uTS:()=>xn,MCv:()=>_e,IYE:()=>Cn,PiC:()=>Xn,MVv:()=>Xe,h_m:()=>qe,DUe:()=>Qr,tJI:()=>Pe,fDt:()=>Se,cNQ:()=>Hn,SwE:()=>Pn,ZHR:()=>Jn,PYu:()=>Qe,lD1:()=>En,lVm:()=>$e,vnX:()=>Cv,$x5:()=>Lv,_R1:()=>Iv,wUm:()=>Uv,z7V:()=>oi,dC6:()=>De,MBD:()=>Ie,GmF:()=>Ji,cKm:()=>Be,iP_:()=>ln,NVC:()=>Le,tPT:()=>dl,tZe:()=>od,kRE:()=>ff,psB:()=>Tf,X0$:()=>pl,zE1:()=>gl,Wm5:()=>tl,vyX:()=>_c,wLZ:()=>yl,W4V:()=>se,EtK:()=>Os,Wtd:()=>cl,asT:()=>WA,kGs:()=>lm,ewt:()=>zT,O_f:()=>Eu,sOy:()=>Nt,Tde:()=>Zt,LMI:()=>oc,skb:()=>S_,sPt:()=>Xu,sH1:()=>zu,RPM:()=>wm,h27:()=>Ec,Uqd:()=>gc,xG:()=>V_,Z2f:()=>HO,fgW:()=>l_,I69:()=>L_,ZxB:()=>D_,mdt:()=>Am,Qbq:()=>QE,rny:()=>Li,UEY:()=>ma,Q0T:()=>Ea,Lyr:()=>Aa,sBn:()=>Ta,itK:()=>pa,H9$:()=>fa,KPc:()=>ya,zos:()=>da,ELQ:()=>Na,dZs:()=>ta,Cz4:()=>ea,z_L:()=>ga,fGe:()=>Zi,iuF:()=>ua,Wib:()=>ca,Hn0:()=>_a,obS:()=>Pa,E$L:()=>ra,XUh:()=>la,Qp_:()=>oa,_jk:()=>na,sKE:()=>ia,WmG:()=>sa,QKx:()=>Oa,Oik:()=>ba,s0A:()=>aa,o9m:()=>ha,MCd:()=>va,RsS:()=>mc,tGK:()=>Yl,lIv:()=>_l,Vg3:()=>$i,mkC:()=>Ri,xv5:()=>Gi,a14:()=>wi,yv0:()=>Vi,Zm0:()=>Si,Nxd:()=>Pi,$mM:()=>xi,ifj:()=>gr,NWi:()=>dv,xr3:()=>pv,wNf:()=>tu,iJH:()=>yv,d89:()=>_i,Edd:()=>Ai,Z5t:()=>Ni,uGe:()=>Oi,UoR:()=>bi,xvW:()=>cv,$qe:()=>uv,yPM:()=>zi,$cp:()=>vl,vKJ:()=>bl,VtG:()=>Zc,AID:()=>dT,B1H:()=>wA,b7X:()=>YE,$uE:()=>pm,keo:()=>HE,C_p:()=>dh,G27:()=>bb,JA0:()=>rf,b3T:()=>sm,oC6:()=>am,_Zs:()=>om,epC:()=>ym,YYG:()=>dm,f_2:()=>af,w3l:()=>pA,QHB:()=>hb,Jso:()=>hA,RXH:()=>nb,Vr9:()=>Sb,lMm:()=>NO,BlA:()=>ZA,fmQ:()=>ds,yRD:()=>z_,NcL:()=>hh,QK6:()=>de,ymd:()=>Gp,JV_:()=>If,XiW:()=>UT,Yrx:()=>Wy,GPx:()=>ul,gjI:()=>ll,vlo:()=>EE,E_P:()=>hm,aAL:()=>wp,NBq:()=>ys,wp9:()=>_m,DsR:()=>_p,MPc:()=>mT,gWE:()=>hT,DT_:()=>bT,ipn:()=>vT,ORg:()=>fi,_wz:()=>OT,RYR:()=>HT,PP2:()=>Qy,wS7:()=>ev,cBQ:()=>sp,pBq:()=>Jf,DsO:()=>ee,X78:()=>Cf,xZs:()=>Pf,YFy:()=>Yy,Gmt:()=>bf,K$w:()=>hf,DSj:()=>Ip,Mfr:()=>qy,k9j:()=>up,ww$:()=>fl,WVU:()=>mf,hxF:()=>nl,E7G:()=>Qd,nwO:()=>rN,Mzk:()=>rp,aFF:()=>em,HRH:()=>Pu,EZK:()=>hd,Kxm:()=>fd,Z9i:()=>Hm,CrF:()=>cf,DNd:()=>Sa,vUy:()=>QA,lJh:()=>wu,zHo:()=>Iu,sEJ:()=>LA,UO$:()=>rT,zeJ:()=>ar,dLR:()=>As,JQy:()=>ks,XtP:()=>gs,Ug0:()=>Fr,A1W:()=>qE,sw:()=>md,nv3:()=>vv,JgD:()=>Ov,nve:()=>jA,SkP:()=>Fs,SAs:()=>zf,i5L:()=>Ms,PWK:()=>Ro,IM5:()=>_s,Aup:()=>Rb,Mfk:()=>IO,HQx:()=>Vo,oN$:()=>$o,mB6:()=>JO,p6d:()=>w,o0x:()=>U,ufS:()=>FO,k7L:()=>MO,mrB:()=>I,ncP:()=>bt,Zmi:()=>ft,hm5:()=>Et,ECL:()=>Nr,vPL:()=>vd,qmL:()=>jE,hPi:()=>Qf,hXd:()=>Di,OCS:()=>ki,p2l:()=>Vs,qF1:()=>Bp,_X$:()=>Yp,yj2:()=>Sg,bzh:()=>Rm,k66:()=>Fo,kiP:()=>za,pSg:()=>ce,kz_:()=>zy,H_U:()=>xo,t9e:()=>Da,j2$:()=>sd,PFL:()=>Gt,aJ3:()=>Zv,To9:()=>er,wpo:()=>Vd,ADq:()=>Gm,UUb:()=>$m,tQX:()=>Vm,xy8:()=>qt,EUG:()=>or,AFK:()=>Ut,X3M:()=>ir,WN0:()=>Mo,kDl:()=>Ns,uDV:()=>LE,IhQ:()=>Us,pfb:()=>Ls,R$r:()=>mm,w80:()=>To,Pfu:()=>La,Gtj:()=>kl,fyF:()=>Dl,kkq:()=>ko,u5q:()=>Ot,O$n:()=>xd,ptG:()=>$d,f4_:()=>Rh,uap:()=>Ph,d7q:()=>Gy,liG:()=>Ky,$oF:()=>Vy,avf:()=>oE,DiQ:()=>aE,cfX:()=>iE,vD3:()=>lE,Qrb:()=>nE,EJQ:()=>sE,HWy:()=>rE,gjS:()=>JT,y6v:()=>tE,JUW:()=>of,GtP:()=>$h,_kX:()=>Ia,u1e:()=>Ua,sJj:()=>XE,CJp:()=>Mh,uKF:()=>JE,wo0:()=>yf,s5:()=>Io,cwx:()=>wo,Y6b:()=>Uy,TTx:()=>_f,UtR:()=>Cy,HaQ:()=>Af,E6I:()=>uf,Won:()=>jy,vTU:()=>wy,Nsy:()=>wd,KMQ:()=>ZE,Do$:()=>Ld,CSV:()=>Bs,TMe:()=>Ly,l1V:()=>Cu,RHh:()=>$u,VQ1:()=>Mu,cGG:()=>Fu,z7d:()=>mE,Xaq:()=>Bo,Sj8:()=>XA,PJj:()=>Gl,k3T:()=>xr,PjQ:()=>Ei,s7l:()=>Hc,jLA:()=>Vh,GGR:()=>dE,j5q:()=>cE,DnY:()=>Bc,RY5:()=>RE,Px$:()=>QT,KPC:()=>PA,NIY:()=>ep,HvW:()=>Kc,Fof:()=>ka,BXy:()=>Jc,fX:()=>Gh,BTI:()=>Dd,uie:()=>Ad,ChB:()=>bd,q27:()=>Wd,vrC:()=>Vb,fAQ:()=>kf,XkT:()=>Wc,lrH:()=>Ff,nt9:()=>Cr,XH8:()=>Md,XH2:()=>Mr,jFi:()=>Fd,qhs:()=>fo,wwR:()=>jd,Uk3:()=>Ct,ev7:()=>IA,RB9:()=>tf,iFp:()=>Um,e$p:()=>Lm,PcX:()=>jm,SpP:()=>Cm,R6_:()=>tg,CY1:()=>ug,Ajk:()=>Mc,Yiz:()=>Fc,FK9:()=>Uc,UOo:()=>xO,aTW:()=>vf,uug:()=>eu,P$2:()=>dg,XS2:()=>ql,Hyb:()=>du,d3Y:()=>Rc,Klp:()=>wc,WxZ:()=>yg,Gzu:()=>Uu,ZOr:()=>Gc,uqV:()=>Py,Pm4:()=>re,hWO:()=>St,nHA:()=>Ih,nVD:()=>wE,_tF:()=>Bu,dED:()=>xy,P2h:()=>My,jrr:()=>Qa,mmY:()=>Ja,T6O:()=>Go,h6J:()=>nd,hM2:()=>vA,XR6:()=>X,jmz:()=>CE,IHt:()=>UE,NZI:()=>qm,wdF:()=>jf,YNv:()=>BE,IFm:()=>WE,o_F:()=>FE,kgP:()=>Df,ZYI:()=>Mp,QXK:()=>Ul,efz:()=>Cl,Q5d:()=>Il,Ysv:()=>Ll,UWq:()=>OE,ocC:()=>bE,io3:()=>Dr,Sbt:()=>mo,roS:()=>Eo,Ww1:()=>ho,QaS:()=>np,ERZ:()=>uA,CL1:()=>gA,idV:()=>Ed,nIW:()=>Rt,fjE:()=>rg,sG0:()=>GO,tV7:()=>Wl,g8o:()=>Fg,Qy:()=>kg,t2P:()=>zv,KbW:()=>no,wId:()=>ao,LS0:()=>oo,bFH:()=>yy,Rgl:()=>Ty,fW1:()=>bh,GFW:()=>Nf,Ywp:()=>Pv,pg:()=>Jd,WSA:()=>Ey,fed:()=>bA,tT_:()=>Cs,BgZ:()=>js,xIV:()=>Ds,KbL:()=>qc,JBA:()=>kt,aNC:()=>bv,RFJ:()=>Fp,Zeh:()=>tT,OT5:()=>Nv,mC3:()=>Nl,kR6:()=>zA,gFw:()=>Sh,NVY:()=>vm,k6v:()=>qp,FEC:()=>Hp,L5S:()=>bm,Ob5:()=>Bd,KUV:()=>Yd,dvH:()=>Om,V3i:()=>Ub,VD3:()=>kr,mm2:()=>ku,rou:()=>Bf,izH:()=>Ca,DK$:()=>ja,KMp:()=>Sp,c31:()=>it,mbo:()=>Bm,gT8:()=>st,CZ8:()=>cs,uGi:()=>Es,Poc:()=>rt,_9k:()=>bs,ZTM:()=>fs,bwT:()=>ms,tzW:()=>ut,tF$:()=>ot,o96:()=>ps,M4S:()=>hs,_vs:()=>vp,xF8:()=>XT,PUO:()=>tm,ATu:()=>Wm,j1S:()=>di,V3K:()=>ci,Lmx:()=>pi,oSN:()=>mi,ZaZ:()=>nt,n_1:()=>Sy,N6e:()=>Np,SxO:()=>Ka,w3p:()=>gm,xU7:()=>pe,Y_p:()=>vo,$k6:()=>Oo,Gdl:()=>BO,U6P:()=>WO,OwB:()=>eg,hTh:()=>IE,xqc:()=>Uo,JvE:()=>Co,i29:()=>pc,dzT:()=>Ui,uPS:()=>op,cZV:()=>ap,n3B:()=>T_,e6O:()=>u_,s7j:()=>Ug,j$Q:()=>sf,kW2:()=>xh,tH7:()=>So,Yxg:()=>Ks,MaZ:()=>pE,nqN:()=>uE,jWj:()=>gE,o_J:()=>Yo,hgZ:()=>Od,yW4:()=>id,uT0:()=>td,C82:()=>rd,bsH:()=>wh,u9Z:()=>Wf,J$m:()=>Ry,j_Q:()=>Lc,OaI:()=>jc,wB1:()=>SA,SP6:()=>Kd,ZYr:()=>NA,IMU:()=>kp,FoU:()=>nf,DVz:()=>KO,mxe:()=>y_,FHr:()=>Zf,D1g:()=>Yf,VO3:()=>Fv,de5:()=>kv,Uw1:()=>Te,J6q:()=>Ym,XCe:()=>Ya,fbl:()=>Rv,Ir:()=>to,XQO:()=>ro,QXb:()=>oy,zXF:()=>kE,P8_:()=>Sf,iiD:()=>Rp,MOC:()=>sy,WF:()=>ay,xE1:()=>Ti,idW:()=>VA,QWZ:()=>jO,YL3:()=>tp,Fn9:()=>T,j2U:()=>$s,MpE:()=>ct,kQw:()=>Bt,mfm:()=>yu,vZp:()=>Lt,E8K:()=>FA,VSb:()=>ls,vr_:()=>Wt,Vmh:()=>HA,FgW:()=>Ib,oDv:()=>Ho,fGG:()=>DO,kuw:()=>Ko,eHk:()=>vE,Tt2:()=>qo,pQZ:()=>Jo,oZ7:()=>kO,T6Y:()=>Tr,_26:()=>uu,YkM:()=>zt,J6y:()=>Kl,njU:()=>nu,TBP:()=>Qo,IT0:()=>Qm,x_:()=>zE,biM:()=>Ud,TMl:()=>Cd,Vkd:()=>ou,WiY:()=>og,_zi:()=>su,J6D:()=>Du,Lt4:()=>ur,QEi:()=>rr,whI:()=>wr,KIu:()=>Ur,JhM:()=>oe,C_0:()=>hr,lzc:()=>Hd,qIF:()=>E_,O27:()=>E,aBi:()=>Gd,xOX:()=>el,EdS:()=>_t,WgC:()=>gt,eEv:()=>$t,A4t:()=>iu,YOQ:()=>Dt,Wos:()=>yr,jWr:()=>Ra,Or$:()=>Xt,lhE:()=>jr,CwH:()=>tr,pzC:()=>Xs,ymH:()=>ru,QZu:()=>Kt,rYH:()=>ag,FVt:()=>dr,Kn2:()=>ue,jgw:()=>fu,Qgr:()=>ju,OXP:()=>ss,lS4:()=>nr,g5f:()=>sg,fp6:()=>zl,Uty:()=>Yi,YkG:()=>Jt,xdS:()=>lt,kMF:()=>gT,$NE:()=>At,bC9:()=>vt,Ian:()=>yi,KVV:()=>KE,q9e:()=>bo,iIf:()=>YO,ian:()=>il,m6e:()=>br,OFd:()=>zs,kqr:()=>Yt,fnZ:()=>Sr,VFZ:()=>al,ZiX:()=>mt,j5n:()=>cr,zkt:()=>_,Pcm:()=>RA,QDV:()=>Js,M5u:()=>ig,laD:()=>f_,mtq:()=>xt,CtB:()=>qO,CBv:()=>ae,I0t:()=>mr,u1G:()=>TE,gk1:()=>p_,Bgb:()=>c_,uzs:()=>Ir,v0l:()=>Qu,Zqp:()=>Dy,j0k:()=>Po,tCm:()=>It,gmx:()=>Hl,mOr:()=>Au,TwZ:()=>Mg,GyU:()=>gv,zGm:()=>Zd,bMg:()=>Oy,EyD:()=>sv,FQA:()=>lv,fZN:()=>_y,xsF:()=>av,Lxg:()=>ov,O3l:()=>pp,Wni:()=>cp,wRx:()=>Tv,OxG:()=>cy,uJQ:()=>uy,qWg:()=>QO,i96:()=>Xd,zhn:()=>fv,G8q:()=>li,Jct:()=>GT,A9Y:()=>te,Y5F:()=>tA,gxP:()=>le,c$P:()=>Ql,M7o:()=>vc,BBN:()=>Ha,ZBU:()=>J,UkJ:()=>so,xkv:()=>Rf,z$M:()=>GA,KAm:()=>ef,lCl:()=>yT,rkF:()=>yh,IU6:()=>dd,RGr:()=>h,aYu:()=>m,ije:()=>$l,Buf:()=>Pp,YLu:()=>xl,ct9:()=>_o,XkY:()=>vy,T5R:()=>ey,uQS:()=>Ay,wcJ:()=>go,d$I:()=>Tl,rSp:()=>Id,Sx:()=>zc,Ilm:()=>Al,Ki6:()=>rl,VGk:()=>gp,sFD:()=>ib,eWN:()=>BA,dWE:()=>Ig,Lkd:()=>CT,aDL:()=>nT,yaA:()=>Ny,lOh:()=>Hf,DBr:()=>Kv,hK$:()=>Bl,TZ_:()=>pd,CMB:()=>m_,FU8:()=>Xc,J$p:()=>sT,b5s:()=>oT,h2W:()=>wt,SL_:()=>$f,oUH:()=>zp,ck9:()=>ty,RAb:()=>Wu,nL:()=>VO,k$p:()=>ob,Xs0:()=>Ml,u7I:()=>qf,rxg:()=>hu,bji:()=>bu,oCZ:()=>lh,MjG:()=>Dv,FuV:()=>Xp,$ju:()=>ed,t6d:()=>Zp,m5F:()=>fe,sx:()=>YA,rSc:()=>XO,U10:()=>Dc,L8n:()=>Ef,R9X:()=>Iy,rj2:()=>Uf,_C4:()=>ld,tCj:()=>wf,uAg:()=>By,wx9:()=>ZT,KF3:()=>ud,ax9:()=>cd,HH7:()=>Ap,ufV:()=>Hy,_6y:()=>lp,XTh:()=>wv,AJo:()=>ip,Ixr:()=>lf,P6Y:()=>nN,Bd_:()=>ih,xkB:()=>nh,W41:()=>Gf,WkI:()=>Vf,sSE:()=>rh,GMd:()=>sc,jtL:()=>lc,Bxm:()=>oh,FVh:()=>Xm,U_T:()=>my,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Su,Ls5:()=>Ru,$bd:()=>vu});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,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Zo,editAttribute:()=>es,editEndDate:()=>os,editRoles:()=>ns,editStartDate:()=>as,editTags:()=>is,removeAttribute:()=>rs});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>lm,collectCrosswalksFromAttributes:()=>pm,compareActivenessAttributes:()=>sm,compareAttributes:()=>am,compareImages:()=>om,compareRoles:()=>ym,compareTags:()=>dm});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Em});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.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),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"),L=(0,l.equals)("99"),j=(0,l.equals)("9999"),D=(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")],[L,(0,l.always)("MM")],[D,(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")],[L,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[j,(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),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),B=(0,l.cond)([[C,(0,l.always)("s")],[L,(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,Q=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},K=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)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},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},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=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)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;var Ee=r(76665);let me,he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,je,De,ke,Fe,Me,xe,$e,Ve,Ge,We,Be,Ye,qe,He,Qe,Ke,Je,Xe;var ze;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(me||(me={})),function(e){e.local="local",e.validationService="validationService"}(he||(he={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(be||(be={})),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"}(Oe||(Oe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ve||(ve={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ge||(ge={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(_e||(_e={})),function(e){e.asc="asc",e.desc="desc"}(Ae||(Ae={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ne||(Ne={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Pe||(Pe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Re||(Re={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Se||(Se={})),function(e){e.PROFILE="profile",e.MAP="map"}(we||(we={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ie||(Ie={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ue||(Ue={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ce||(Ce={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(De||(De={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(ke||(ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Fe||(Fe={})),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"}(Me||(Me={})),function(e){e.IN="in",e.OUT="out"}(xe||(xe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}($e||($e={})),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"}(Ve||(Ve={})),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"}(Ge||(Ge={})),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"}(We||(We={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Be||(Be={})),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"}(Ye||(Ye={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(qe||(qe={})),function(e){e.NEW="new",e.CLASSIC="classic"}(He||(He={})),function(e){e.ASC_BY_NAME="ascByName"}(Qe||(Qe={})),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"}(Ke||(Ke={})),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"}(Je||(Je={})),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"}(Xe||(Xe={})),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"}(ze||(ze={}));const Ze=ze;let et,tt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(et||(et={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(tt||(tt={}));const rt=(0,l.prop)("referencedEntityTypeURI"),nt=(0,l.prop)("relationshipTypeURI"),it=(0,l.prop)("referencedAttributeURIs"),at=(0,l.curry)(((e,t)=>(0,l.pipe)(it,(0,l.filter)((0,l.startsWith)(e)))(t))),ot=at("configuration/relationTypes"),st=at("configuration/entityTypes"),lt=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),ut=(0,l.filter)(lt),ct=(e,t)=>!t||t.some((t=>t===e.uri)),pt="1Tempo4rary",dt="1Tepmo4Rel",yt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),ft=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Tt=e=>()=>ft(e),Et=(e,t)=>{const r=yt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return ft(n)},mt=e=>e&&e.includes("uri$$"),ht=Tt("entities"),bt=Tt("relations"),Ot=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),vt=(0,l.startsWith)("relations/"),gt=(0,l.startsWith)("entities/"),_t=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),At=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Nt=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),Pt=(0,l.pipe)((0,l.split)("/"),l.head),Rt=(0,l.pipe)((0,l.split)("/"),l.last),St=e=>e.split(".").slice(0,2).join("."),wt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},It=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),Ut=(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("/")},Ct=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Lt=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),jt=e=>2===e.split("/").length,Dt=e=>5===e.split("/").length,kt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Ft=e=>e.replace(/uri\$\$/g,pt);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 xt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,_t),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Ze.TYPE_STRING)]),$t=(0,l.has)("values"),Vt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Ze.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Ze.TYPE_LOOKUP)],[$t,(0,l.always)(Ze.TYPE_ENUM)],[xt,(0,l.always)(Ze.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Ze.TYPE_BOOLEAN),(0,l.always)(Ze.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Gt=(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){Mt(e,t,r[t])}))}return e}({},e,{type:Vt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Wt=e=>!!e&&(!!e.autoGenerated&&e.type!==Ze.TYPE_NESTED||!!e.parentAutoGenerated),Bt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Yt=(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),qt=e=>Bt(e)?"analyticsAttributes":"attributes",Ht=(0,l.propEq)("hidden",!0),Qt=(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))),Kt=Qt(Ze.TYPE_NESTED),Jt=Qt(Ze.TYPE_REFERENCE),Xt=Qt(Ze.TYPE_IMAGE),zt=(0,l.either)(Kt,Jt),Zt=(e,t)=>{const r=Bt(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(".")},er=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),tr=(0,l.pipe)(er,Boolean),rr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),nr=(0,l.both)(tr,(0,l.pipe)(er,("rdm",(0,l.pipe)(Pt,(0,l.equals)("rdm")))));const ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=qt({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]||or(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:[]},ar=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},or=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",Ze.TYPE_NESTED),(0,l.propEq)("type",Ze.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Ze.TYPE_REFERENCE),(0,l.pipe)(it,(0,l.map)((t=>ar(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},sr=[Ze.TYPE_ACTIVENESS_DATE,Ze.TYPE_DATE,Ze.TYPE_TIMESTAMP,Ze.TYPE_LOCAL_DATE],lr=[Ze.TYPE_ACTIVENESS_DATE,Ze.TYPE_TIMESTAMP,Ze.TYPE_LOCAL_DATE],ur=e=>sr.includes(e),cr=e=>lr.includes(e),pr=[Ze.TYPE_INT,Ze.TYPE_LONG,Ze.TYPE_NUMBER,Ze.TYPE_FLOAT,Ze.TYPE_DOUBLE,Ze.TYPE_COUNT],dr=e=>pr.includes(e),yr=e=>[Ze.TYPE_FLOAT,Ze.TYPE_DOUBLE].includes(e),fr=[Ze.TYPE_BOOLEAN,Ze.TYPE_BOOLEAN_RADIO,Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Tr=e=>fr.includes(e),Er=[Ze.TYPE_URL,Ze.TYPE_BLOG_URL,Ze.TYPE_IMAGE_URL],mr=e=>Er.includes(e),hr=Qt(Ze.TYPE_EMAIL),br=e=>Ze.TYPE_SSN===e;var Or,vr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Or||(Or={}));const gr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Or.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)))})),_r=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Ar=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),_r),Nr=(0,l.pipe)((0,l.reject)(E),Ar),Pr=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("?")?"&":"?")+_r(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}},Rr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Sr=(0,l.equals)(Rr.SUGGESTING),wr=(0,l.equals)(Rr.EDITING),Ir=(0,l.equals)(Rr.VIEWING),Ur=(0,l.either)(wr,Sr),Cr=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Lr=(0,l.curry)(((e,t)=>(0,l.pipe)(Cr(e),(0,l.prop)("extendsTypeURI"))(t))),jr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Lr(e,r)));return n(r)})),Dr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Lr(e,n);return r})),kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?kr(e,Cr(e,t.extendsTypeURI),r):void 0,Fr=(e,t)=>{const r=t.map(Dr(e));return(r.length?r.reduce(l.intersection):[])[0]},Mr=(e,t)=>kr(e,(0,l.is)(Object,t)?t:Cr(e,t),"typeImage"),xr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&jr(e,t,n.uri)?r.concat(n.uri):r),[]),$r={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"},Vr={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},Gr={[$r.EQUALS]:"equals",[$r.NOT_EQUALS]:"not",[$r.STARTS_WITH]:"starts with",[$r.MISSING_VALUE]:"missing value",[$r.IN_RANGE]:"in range",[$r.HAS_ALL]:"has all",[$r.FULL_TEXT]:"full text",[$r.EXISTS]:"exists",[$r.COUNT_EQUALS]:"count equals",[$r.COUNT_NOT_EQUALS]:"count not equal",[$r.COUNT_LT]:"count less",[$r.COUNT_LTE]:"count less or equal",[$r.COUNT_GT]:"count greater",[$r.COUNT_GTE]:"count greater or equal",[$r.COUNT_RANGE]:"count in range",[$r.LT]:"less than",[$r.LTE]:"less than or equal",[$r.GT]:"greater than",[$r.GTE]:"greater than or equal",[$r.IN_FILE]:"in file",[$r.NOT_IN_FILE]:"not in file",[$r.CONTAINS]:"contains",[$r.ON]:"on",[$r.BEFORE]:"before",[$r.AFTER]:"after",[$r.WITHIN]:"within"},Wr="in",Br="notIn",Yr="not range",qr=e=>({[Wr]:$r.EQUALS,[Br]:$r.NOT_EQUALS}[e]||e);var Hr,Qr;!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"}(Hr||(Hr={})),function(e){e.LAST_3DAYS="last3Days"}(Qr||(Qr={}));const Kr=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Hr[t]||Qr[t],e)),{}),Jr={[Hr.LAST_DAY]:"Last 24 hours",[Qr.LAST_3DAYS]:"Last 3 days",[Hr.LAST_WEEK]:"Last 7 days",[Hr.LAST_MONTH]:"Last month",[Hr.LAST_6MONTHS]:"Last 6 months",[Hr.LAST_YEAR]:"Last year",[Hr.PICK_DATE]:"Pick date"},Xr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},zr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Zr="<No label>",en={IN:"in",OUT:"out"};var tn=r(87918),rn=r.n(tn);function nn(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){an(e,t,r[t])}))}return e}function an(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const on={startDate:{type:Ze.TYPE_ACTIVENESS_DATE,get label(){return rn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Ze.TYPE_ACTIVENESS_DATE,get label(){return rn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},sn=nn({id:{type:Ze.TYPE_ENTITY_ID,get label(){return rn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},on,{roles:{type:Ze.TYPE_STRING,get label(){return rn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Ze.TYPE_STRING,get label(){return rn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),ln={workflow:{type:Ze.TYPE_STRING,get label(){return rn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Ze.TYPE_STRING,get label(){return rn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Ze.TYPE_STRING,get label(){return rn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},un={commenter:{type:Ze.TYPE_STRING,get label(){return rn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},cn={notResolved:{type:Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return rn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},pn={createdBy:{type:Ze.TYPE_STRING,get label(){return rn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Ze.TYPE_STRING,get label(){return rn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},dn={matches:{type:Ze.TYPE_COUNT,get label(){return rn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Ze.TYPE_COUNT,get label(){return rn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},yn={sourceSystems:{type:Ze.TYPE_STRING,get label(){return rn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Ze.TYPE_STRING,get label(){return rn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Ze.TYPE_INT,get label(){return rn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Ze.TYPE_TIMESTAMP,get label(){return rn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Ze.TYPE_STRING,get label(){return rn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let fn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(fn||(fn={}));const Tn={[fn.matchRules]:{type:Ze.TYPE_STRING,get label(){return rn().text("Match Rules")},uri:fn.matchRules,name:fn.matchRules,faceted:!0,hideForDataTenant:!0},[fn.MLRecommendedMatch]:{type:Ze.TYPE_STRING,get label(){return rn().text("Match IQ")},uri:fn.MLRecommendedMatch,name:fn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},En=nn({},sn,ln,un,cn,pn,dn,yn,Tn,{type:{type:Ze.TYPE_STRING,get label(){return rn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),mn="NOT_MATCH";var hn=r(13980),bn=r.n(hn);function On(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){vn(e,t,r[t])}))}return e}function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gn=bn().oneOf(["mobile","tablet","desktop"]),_n=bn().shape({deviceTypes:bn().oneOfType([gn,bn().arrayOf(gn)]),roles:bn().arrayOf(bn().string)}),An=bn().shape({value:bn().string,lookupCode:bn().string}),Nn=bn().shape({link:bn().string,filename:bn().string}),Pn=bn().shape({displayName:bn().string,parent:bn().string}),Rn=bn().oneOfType([bn().string,bn().number,bn().bool,An]),Sn=bn().oneOfType([Rn,bn().arrayOf(Rn)]),wn=bn().shape({fieldName:bn().string,values:bn().arrayOf(Sn),filter:bn().string,type:bn().string}),In=bn().shape({minValue:bn().number,maxValue:bn().number}),Un=bn().shape({label:bn().string,name:bn().string,description:bn().string,type:bn().string,hidden:bn().bool,faceted:bn().bool,searchable:bn().bool,uri:bn().string,access:bn().arrayOf(bn().string),cardinality:In}),Cn=bn().shape({label:bn().string,uri:bn().string,typeColor:bn().string,direction:bn().string,startObject:bn().object,endObject:bn().object}),Ln=bn().shape({typeColor:bn().string,typeIcon:bn().string,typeImage:bn().string,label:bn().string,uri:bn().string,attributes:bn().arrayOf(Un)}),jn=bn().shape({uri:bn().string,label:bn().string,memberTypes:bn().array,extendsTypeUri:bn().string,attributes:bn().arrayOf(Un)}),Dn=bn().shape({uri:bn().string,label:bn().string,extendsTypeUri:bn().string,relationshipTypeURIs:bn().arrayOf(bn().string)}),kn=bn().shape({uri:bn().string,description:bn().string,label:bn().string,schemaVersion:bn().string,entityTypes:bn().arrayOf(Ln),roles:bn().arrayOf(bn().object),groupTypes:bn().arrayOf(bn().object),relationTypes:bn().arrayOf(Cn),graphTypes:bn().arrayOf(Dn),interactionTypes:bn().arrayOf(jn),sources:bn().arrayOf(bn().object)}),Fn=bn().shape({uri:bn().string,type:bn().string}),Mn=bn().shape({uri:bn().string,attributes:bn().object,type:bn().string,timestamp:bn().number,members:bn().object}),xn=bn().shape({uri:bn().string,type:bn().string}),$n=bn().shape({value:bn().object,ov:bn().bool,type:bn().string,uri:bn().string}),Vn=bn().shape({refEntity:bn().oneOfType([bn().array,bn().object]),refRelation:bn().oneOfType([bn().array,bn().object]),value:bn().object,ov:bn().bool,type:bn().string,uri:bn().string}),Gn=bn().oneOf((0,l.values)(Rr)),Wn=bn().shape({type:bn().oneOf(Object.values(me)).isRequired,attributeTypeUri:bn().string.isRequired,parentUri:bn().string.isRequired,uri:bn().string,message:bn().string}),Bn={attributeType:Un,showEmptyEditors:bn().bool,lazy:bn().bool,mode:Gn,metadata:kn,ownError:Wn,errors:bn().arrayOf(Wn),crosswalks:bn().array,onAddAttributes:bn().func,onAddOneMore:bn().func,onDeleteAttribute:bn().func,onChangeAttribute:bn().func,additionalControlsRenderer:bn().func,hideDeleteButton:bn().bool,showNonOv:bn().bool,state:bn().oneOf(["deleted","edited"]),expanded:bn().bool},Yn=On({attributeValue:$n},Bn),qn=On({attributeValue:Vn},Bn),Hn=bn().shape({value:bn().oneOfType([bn().string,bn().bool,bn().number]),ov:bn().bool,type:bn().string,uri:bn().string,lookupCode:bn().string,lookupRawValue:bn().string}),Qn=bn().shape({totalOvValues:bn().number,totalValues:bn().number}),Kn=bn().shape({inRelations:bn().arrayOf(bn().oneOfType([bn().object,bn().string])),outRelations:bn().arrayOf(bn().oneOfType([bn().object,bn().string])),groups:bn().arrayOf(bn().string),entityTypes:bn().arrayOf(bn().string),nextEntry:bn().object}),Jn=bn().oneOf(["asc","desc"]),Xn=bn().shape({id:bn().string,content:Kn,allowOnlyCreateNew:bn().bool,sortColumn:bn().string,sortOrder:Jn,"text-empty":bn().string,max:bn().number,icon:bn().string,caption:bn().string,canCreate:_n,canRead:_n,canUpdate:_n,canDelete:_n,editingEnabled:bn().bool}),zn=bn().shape({id:bn().string,caption:bn().string,pageSize:bn().number,icon:bn().string,canCreate:_n,canRead:_n,canUpdate:_n,canDelete:_n,attributes:bn().object}),Zn=bn().shape({entityUri:bn().string,entityType:bn().string,entityLabel:bn().string,object:Fn}),ei=bn().shape({relationUri:bn().string,relationType:bn().string,relationLabel:bn().string,direction:bn().string,object:xn}),ti=bn().shape({entity:Zn,relation:ei}),ri=bn().shape({value:bn().string,isRawFilter:bn().bool}),ni=bn().shape({id:bn().string,label:bn().string,name:bn().string,availableEntityTypes:bn().array}),ii=bn().shape({id:bn().string,allowMergeAll:bn().bool,matchActions:bn().object,availableTabs:bn().arrayOf(bn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ai=bn().shape({matchRules:bn().arrayOf(bn().string),object:Fn,shortestTransitiveMatchPath:bn().arrayOf(bn().shape({matchRules:bn().arrayOf(bn().string),match:bn().string})),direct:bn().bool,matchScore:bn().number}),oi=bn().arrayOf(ai),si=bn().arrayOf(bn().shape({uri:bn().string,label:bn().string})),li=[{label:rn().text("And"),value:"and"},{label:rn().text("Or"),value:"or"},{label:rn().text("And not"),value:"and not"},{label:rn().text("Or not"),value:"or not"}];function ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ci=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),pi=(0,l.pipe)(ci,(0,l.propOr)("","label")),di=(0,l.curry)(((e,t)=>{const r=ci(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),yi=(0,l.curry)(((e,t,r)=>{const[n,i]=di(e,r);return jr(e,n,t)||jr(e,i,t)})),fi=(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){ui(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ti=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?en.OUT:en.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(en.IN),i=r(en.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ei=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),mi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?mi(e,ci(e,t.extendsTypeURI),r):void 0,hi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},bi=(0,l.curry)(((e,t)=>e.every((e=>Oi(e,t))))),Oi=(0,l.curry)(((e,t)=>{const r=Wt(t);return vi(e,t)&&(e===hi.READ||!r)})),vi=(e,t)=>!t||!t.access||t.access.includes(e),gi=(0,l.curry)(((e,t,r)=>Oi(hi.READ,r)&&(Sr(t)?Oi(hi.INITIATE_CHANGE_REQUEST,r):Oi(e,r)))),_i=gi(hi.CREATE),Ai=gi(hi.DELETE),Ni=gi(hi.UPDATE),Pi=bi([hi.CREATE,hi.MERGE,hi.READ,hi.UPDATE]),Ri=bi([hi.UPDATE,hi.READ,hi.CREATE]),Si=bi([hi.UPDATE,hi.READ]),wi=bi([hi.DELETE,hi.UPDATE,hi.READ]),Ii=(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["*"])),Ui=(e,t,r)=>(0,l.pipe)((0,l.map)(Ii(e,t)),(0,l.filter)(l.identity))(r),Ci=(e,t,r)=>{const n=Ui(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Oi(hi.MERGE,r)},Li=(0,l.curry)(((e,t,r,n)=>{const i=ci(e,n),[a,o]=di(e,n);return i&&Oi(hi.CREATE,i)&&jr(e,a,t.type)&&jr(e,o,r.type)})),ji=(e,t,r,n,i)=>{const a=Cr(e,n.type),o=Ui(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(Li(e,n,i))||a.some(Li(e,i,n))}))},Di=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Cr(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Ci(o,i,a),canAddRelation:ji(e,o,i,r,n),canMark:Oi(hi.UPDATE,a)&&Oi(hi.READ,a)}},ki=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Di(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Fi=Bt,Mi=(0,l.complement)(Fi),xi=Oi(hi.READ),$i=e=>{let{attributeType:t,mode:r}=e;return Mi(t)&&_i(r,t)&&!Ht(t)},Vi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=mt(r.uri),o=Ni(n),s=_i(n);return(0,l.cond)([[Fi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Gi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=mt(r.uri),s=Ni(n),u=Ai(n),c=Bi(hi.UPDATE,n,a,r),p=Bi(hi.DELETE,n,a,r);return(0,l.cond)([[Fi,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)},Wi=(0,l.curry)(((e,t,r,n)=>{const i=or(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=>!vi(e,n)||!Wi(e,t,r[n.name],n)))))})),Bi=(0,l.curry)(((e,t,r,n,i)=>Sr(t)?Wi(hi.INITIATE_CHANGE_REQUEST,r,n,i):Wi(e,r,n,i))),Yi=(0,l.both)((0,l.complement)(Ht),xi),qi="SuperUser",Hi="allTenants",Qi=[Hi,"allCustomers"],Ki=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;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===qi})).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===qi){const e=r?Qi.concat(r.map((e=>`allTenants.${e}`))):Qi,n=r&&t[0]===Hi?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}))},Ji={NON_SECURED:"NON_SECURED",SECURED:"SECURED",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"},Xi={[Ji.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Ji.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Ji.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Ji.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Ji.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Ji.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Ji.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Ji.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Ji.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Ji.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Ji.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Ji.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Ji.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Ji.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Ji.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Ji.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Ji.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Ji.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Ji.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Ji.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Ji.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Ji.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Ji.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Ji.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Ji.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Ji.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Ji.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Ji.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Ji.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Ji.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},zi=(0,l.curry)(((e,t,r)=>Ki({allowedPermissionsNames:e,permissionsNames:Ji,permissionsConfig:Xi}).some((e=>e(t,{params:{tenant:r}}))))),Zi=zi([Ji.CAN_EXPORT]),ea=zi([Ji.CAN_EXPORT_ACTIVITIES]),ta=zi([Ji.CAN_IMPORT_ENTITIES_FROM_DT]),ra=zi([Ji.CAN_READ_ENTITIES_FROM_DT]),na=zi([Ji.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ia=zi([Ji.CAN_UPDATE_PROCESS_INSTANCE]),aa=zi([Ji.CAN_VIEW_WORKFLOW_DEFINITION]),oa=zi([Ji.CAN_CONFIG_ENVIRONMENT_REGISTER]),sa=zi([Ji.CAN_UPDATE_WORKFLOW_DATA_TASK]),la=zi([Ji.CAN_READ_WORKFLOW_DATA_TASK]),ua=zi([Ji.CAN_MANAGE_WORKFLOW_DEFINITION]),ca=zi([Ji.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),pa=zi([Ji.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),da=zi([Ji.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ya=zi([Ji.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),fa=zi([Ji.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),Ta=zi([Ji.CAN_EXECUTE_WORKFLOW_JOBS]),Ea=zi([Ji.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),ma=zi([Ji.CAN_CREATE_CONFIG_JAR]),ha=zi([Ji.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ba=zi([Ji.CAN_VIEW_CONFIG_JAR]),Oa=zi([Ji.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),va=zi([Ji.CAN_VIEW_WORKFLOW_JOBS]),ga=zi([Ji.CAN_MAKE_BULK_UPDATE]),_a=zi([Ji.CAN_OPEN_DATA_LOADER_EXECUTE,Ji.CAN_OPEN_DATA_LOADER_READ]),Aa=zi([Ji.CAN_BULK_DELETE_PROFILES]),Na=zi([Ji.CAN_READ_MDM_DATA_ENTITIES]),Pa=zi([Ji.CAN_READ_DVF]),Ra=zi([Ji.IS_FREEMIUM_ADMIN]),Sa=(0,l.reject)(Ht),wa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Sa,(0,l.filter)(e))(t),Ia=(0,l.curry)(((e,t)=>wa((t=>$i({attributeType:t,mode:e})),t))),Ua=(0,l.curry)(((e,t)=>wa((t=>$i({attributeType:t,mode:e})||Yi(t)),t))),Ca=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Yi)),La=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...La(e)])))),ja=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Yi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...ja(e)])))),Da=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Da(e)])))),ka=(0,l.pipe)(Cr,(0,l.converge)(l.concat,[ja,Da]));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.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,xa(e)))},t))),$a=e=>{var t;return Fa({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},Va=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ga=(0,l.when)(Va,(0,l.dissoc)("values")),Wa=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Fa({},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})})),Ba=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Ya=(0,vr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(La,t).concat((0,l.chain)(La,r)).some(Ba)})),qa=e=>{let t=!1;const r=xa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Fa({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ha=e=>{const t=Ya(e),r=(0,l.map)((e=>xa((0,l.pipe)(Ga,(0,l.when)((0,l.always)(e),Wa))))(t)),n=(0,l.map)($a),i=(0,l.map)(qa);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Qa=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ka=(0,l.prop)("relationshipTypeURIs"),Ja=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Xa(e,t)))||[]})),Xa=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(yi(e,t))},za=(e,t)=>(0,l.pipe)(Qa,(0,l.defaultTo)({}),Ka,(0,l.defaultTo)([]),(0,l.chain)(di(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Cr(e)))(e,t),Za=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),eo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),to=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return eo((0,l.complement)(Za))(e)},ro=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return eo(Za)(e)},no=(0,l.pipe)(Cr,(0,l.propOr)([],"matchGroups")),io=(e,t,r)=>(0,l.pipe)(no,(0,l.find)((0,l.propEq)("uri",r)))(e,t),ao=(0,l.curry)(((e,t,r)=>(0,l.pipe)(io,(0,l.propOr)(r,"label"))(e,t,r))),oo=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(no,(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]})),so=e=>(0,l.partition)(Za,e),lo=(0,l.includes)(l.__,["and","or","not"]),uo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),co=(0,l.includes)(l.__,["equals","notEquals","in"]),po=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return lo(t)?po(r):uo(t)?r.filter(_t):co(t)?r.map((0,l.prop)("uri")).filter(_t):[]})),l.uniq),yo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(po),l.uniq),fo=(0,l.pipe)(no,yo),To=(0,l.pipe)(oo,yo),Eo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},mo=(0,l.pipe)(Eo,ja),ho=(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||jr(e,n,t)})(e,t))})(e,t)),bo=e=>!!e.required,Oo=(e,t,r)=>{const n=(0,l.cond)([[_t,Cr(e)],[At,ci(e)]])(t);return vo(e,n,r)},vo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&_t(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Wt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Ze.TYPE_REFERENCE){const n=nt(t),a=it(t);i=Oo(e,n,r).filter((e=>a.some(Nt(e.uri))))}else t.attributes&&(i=vo(e,t,r));i&&n.push(...i)}return n})):t.type===Ze.TYPE_REFERENCE?Oo(e,nt(t),r):[],go=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),bo]),e.attributes||[])},_o=(e,t)=>{const r=st(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},Ao=(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)?rn().text(n):n};return r(null,t)})),No=["label","description","abbreviation","caption","toolTip"],Po=e=>Ao(No,e),Ro=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Rt(t);return r.find((e=>{let{uri:t}=e;return Rt(t)===n}))})),So=(0,l.curry)(((e,t)=>{const r=Rt(t);return(0,l.pipe)(Ro(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),wo=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"})},Io=(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}))},Uo=(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)})),Co=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Cr(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));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){jo(e,t,r[t])}))}return e}function jo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Do=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 ko(i,e,t,r,n)},ko=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:or(t,r)).map((e=>e.map((e=>{const r=Do(t,e,n,i);return r.length?Lo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(zt),(0,l.prop)("children"))).filter(Yi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes","analyticsAttributes"])},Mo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes"])},xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["analyticsAttributes"])},$o=e=>e.children?e.children.flatMap($o):e,Vo=e=>e.children?[e,...e.children.flatMap(Vo)]:e,Go=(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)})),Wo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Rt(r)===e})))),Bo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Wo("LUD")),(0,l.defaultTo)(r))(t||[])},Yo=(e,t)=>{let{survivorshipStrategies:r}=e;return Wo(t,r)},qo=(0,l.allPass)([(0,l.complement)(l.isNil),Oi(hi.READ)]),Ho=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Oi(hi.READ)]),Qo=(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)([Oi(hi.CREATE),Oi(hi.INITIATE_CHANGE_REQUEST)])]),Ko=(0,l.curryN)(2,(0,l.pipe)(Cr,Ho)),Jo=(0,l.curryN)(2,(0,l.pipe)(ci,qo));function Xo(e,t,r,n){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 zo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Xo(r[i],r[i+1],e,t));return n}function Zo(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=zo(r,t)[a];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 Zo(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 es(e,t,r,n,i,a){void 0===a&&(a=0);var o=zo(r,t)[a];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()?(ts(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(ts.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=Zo(e,t,r,n,i,a),s}var c=es(e,o,o.valueUri,{},i,a);es(c,t,r,n,i,a+1)}function ts(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function rs(e,t,r,n){void 0===n&&(n=0);var i=zo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&rs(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 ns(e,t){e.roles=t||[]}function is(e,t){e.tags=t||[]}function as(e,t){e.startDate=t||""}function os(e,t){e.endDate=t||""}const ss=e=>{let{ov:t}=e;return!1!==t},ls=(e,t)=>((e,t)=>mr(e.type)&&ae(t))(e,t)||((e,t)=>hr(e.type)&&oe(t))(e,t),us=(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))),cs=us("refEntity"),ps=us("refRelation"),ds=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ys=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},fs=(0,l.prop)("objectURI"),Ts=(0,l.prop)("objectURI"),Es=(0,l.prop)("type"),ms=(0,l.pipe)(cs,(0,l.defaultTo)({}),fs),hs=(0,l.pipe)(ps,(0,l.defaultTo)({}),Ts),bs=(0,l.pipe)(cs,(0,l.defaultTo)({}),Es),Os=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},vs=(0,l.evolve)({refEntity:re,refRelation:re}),gs=(e,t,r,n)=>{const i=ir(e,r),a=Cr(e,t.type)||ci(e,t.type);if(0===i.length)return null;const o=qt(r);let s=[t],l=1;i[0].uri!==t.type&&(l=0);let u=null;const c=n?[]:null;let p=null;for(let e=l;e<i.length;++e){const t=e===i.length-1,r=i[e];let l=[];if(!ct(r,p)){u=n?[]:null;break}Array.isArray(s)&&(s.forEach((s=>{const u=s.value||s[o]||{};let d=[];r.startObject&&r.endObject||r.typeColor?(d=a.attributes.filter((e=>nt(e)===r.uri||rt(e)===r.uri)),p=d.reduce(((e,t)=>{const r=t.referencedAttributeURIs&&t.referencedAttributeURIs.filter((function(t){return-1===e.indexOf(t)}));return r?e.concat(r):e}),[])):(d.push(r),p=null),d.forEach((a=>{const o=u[a.name];o&&(l=l.concat(o)),n&&t&&c.push({attrValues:o||[],parent:s,attrType:r,parentType:i[e-1],typePath:i})}))})),s=l),t&&(u=s)}return c||u},_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},As=(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)})),Ns=(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")]]),Ps=(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"])]]),Rs=(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"])]]),Ss=(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)(Ss(e,i)))))(r)})),ws=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(ws(e)),e)(t))),Is=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Ss(e,r),ws(t))(n))),Us=Is(null,Ns),Cs=Is(ss,Ns),Ls=Is(null,Ps),js=Is(ss,Ps),Ds=Is(ss,Rs),ks=(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=As(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Fs=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ms,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Ms=(e,t)=>{const r=kt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return ks(e,r,n)},xs=Object.values(on),$s=(0,l.includes)(l.__,xs),Vs=e=>xs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Gs(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){Ws(e,t,r[t])}))}return e}function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bs=(e,t)=>`${e}_${t}`,Ys=[En.matches.name,En.matchRules.name],qs=(0,l.values)(ln).map((e=>e.name)),Hs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,qs)))),Qs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ys)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Bs(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Ks=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Hs(r),Qs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Bs(`dtPotentialMatches.${t.name}`,"")))))(En)},Js=(0,l.propEq)("uri",En.type.uri),Xs=e=>(0,l.values)(Tn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),zs=(0,l.propEq)("uri",yn.sourceSystems.uri),Zs=Object.values(sn),el=(0,l.includes)(l.__,Zs),tl=e=>{let{entity:t,attributeType:r,value:n}=e;return Gs({},t,{[r.uri]:void 0===n?r.defaultValue:n})},rl=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},nl=e=>{let{entity:t,attributeType:r,value:n}=e;return Gs({},t,{[r.uri]:n})},il=(0,l.propEq)("uri",sn.roles.uri),al=(0,l.propEq)("uri",sn.tags.uri);function ol(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){sl(e,t,r[t])}))}return e}function sl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ll=e=>{let{parentUri:t,attributeType:r}=e;return ol({uri:Et(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[zt,(0,l.always)({value:{}})],[tr,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),ur)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},ul=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ia(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=ll({parentUri:r,attributeType:e});let s=or(n,e);s&&(e.type===Ze.TYPE_REFERENCE&&(s=ut(s)),a.value=ul({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||rr(e))&&(o[t]=[a])}return o},cl=e=>{let{entity:t,metadata:r}=e;return Oo(r,t.type,!0).filter(rr).reduce(((e,t)=>{const n=t.name,i=kt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:gs(r,e,i).map((e=>{let{value:t,uri:r}=e;return{parentUri:r,attributes:t}}))).reduce(((e,r)=>{let{parentUri:i,attributes:a}=r;return a[n]&&0!==a[n].length?e:dl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},pl=(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===Ze.TYPE_NESTED?ol({},e,{value:pl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return ol({},s(t),ul({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),dl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=ll({parentUri:n,attributeType:r}),u=Ns(l);return(0,Ee.ZP)(t,(e=>{Zo(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},yl=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{Zo(e.attributes||e.value,r,n.uri,Ns(n),a,o,i)}))},fl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{es(e.attributes||e.value,r,n,i,a,o)}))},Tl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ee.ZP)(t,(e=>{rs(e.attributes||e.value,r,n,i)}))},El=e=>""===e,ml=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([El,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([El,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]]),hl=(0,l.reject)(ml),bl=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=>bl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),hl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Ol=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),vs),deleteEmptyComplex:e})},vl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Ol(e),(0,l.reject)(l.isEmpty))},gl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return $s(r)?tl({entity:e,attributeType:r}):dl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),_l=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return $s(r)?nl({entity:e,attributeType:r,value:i}):fl({entity:e,attributeType:r,uri:n,value:i})})),Al=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return $s(r)?rl({entity:e,attributeType:r}):Tl({entity:e,attributeType:r,uri:n})})),Nl=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)},Pl="UrlThumbnail",Rl="CdnUrlThumbnail",Sl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(ss):(0,l.head)(n);return e&&e.value}return null})),wl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Sl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),Il=wl(["CdnUrl","Url"],!0),Ul=wl(["CdnUrlPreview","UrlPreview"],!0),Cl=wl([Rl,Pl],!0),Ll=wl([Rl,Pl]),jl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Yt,(0,l.always)(t)],[(0,l.both)(Bt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Yt(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)($s(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)}),[])},Dl=(e,t,r)=>{const n=Ca(e),i=(0,l.any)(r?l.T:ss);return jl(n,t,i)},kl=(e,t,r,n,i,a)=>{const o=mt(null==r?void 0:r.uri)?Ia(t,e):Ua(t,e);return jl(o,r,((e,o)=>{const s=$i({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:ss,e)||Yt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Fl;const Ml=e=>{Fl=e};function xl(e,t){return Fl(e,t)}const $l=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)})),Vl=50,Gl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Vl,offset:a=0}=e;return xl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},Wl=(0,l.once)((()=>xl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Bl=e=>xl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Yl=(e,t)=>xl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),ql=e=>Z.fromNull(Gr[e]).map(rn().text).orSome(""),Hl=(0,l.curry)(((e,t)=>`${e}_${t}`)),Ql=(0,l.split)("_"),Kl=(0,l.includes)("_"),Jl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Xl=(0,l.curry)(((e,t)=>e.some(Jl(t)))),zl=Xl([$r.IN_RANGE,$r.COUNT_RANGE,$r.WITHIN]),Zl=Xl([$r.EXISTS,$r.MISSING_VALUE]),eu=(0,l.cond)([[Zl,(0,l.always)(0)],[zl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),tu=(0,l.complement)(Zl),ru=Xl([$r.HAS_ALL,$r.EQUALS,$r.NOT_EQUALS]),nu=Xl([$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE]),iu=Xl([$r.IN_FILE,$r.NOT_IN_FILE]),au=e=>{switch(e){case $r.COUNT_EQUALS:return $r.EQUALS;case $r.COUNT_NOT_EQUALS:return $r.NOT_EQUALS;case $r.COUNT_LT:return $r.LT;case $r.COUNT_LTE:return $r.LTE;case $r.COUNT_GT:return $r.GT;case $r.COUNT_GTE:return $r.GTE;case $r.COUNT_RANGE:return $r.IN_RANGE}},ou=Xl([$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS]),su=Xl([$r.WITHIN]),lu=[[$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE],[$r.NOT_IN_FILE,$r.IN_FILE],[$r.EQUALS,$r.NOT_EQUALS,$r.HAS_ALL],[$r.LT,$r.LTE,$r.GT,$r.GTE],[$r.MISSING_VALUE,$r.EXISTS],[$r.COUNT_RANGE],[$r.IN_RANGE],[$r.STARTS_WITH,$r.CONTAINS],[$r.FULL_TEXT],[$r.ON,$r.BEFORE,$r.AFTER,$r.NOT_EQUALS],[$r.WITHIN]],uu=(e,t)=>lu.some((r=>r.includes(e)&&r.includes(t))),cu=(0,l.pipe)(l.omit,l.values),pu={OPTIONS_FOR_STRING:cu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_DATE:[$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS,$r.MISSING_VALUE,$r.EXISTS,$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE,$r.IN_FILE,$r.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:cu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_BLOB:cu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_NUMBER:cu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_LOOKUP:cu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],$r),OPTIONS_FOR_ENUM:cu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],$r),OPTIONS_FOR_ID:[$r.EQUALS,$r.NOT_EQUALS,$r.IN_FILE,$r.NOT_IN_FILE],OPTIONS_FOR_COUNT:[$r.EQUALS,$r.NOT_EQUALS,$r.LT,$r.LTE,$r.GT,$r.GTE,$r.IN_RANGE],OPTIONS_FOR_COMPLEX:[$r.COUNT_EQUALS,$r.COUNT_NOT_EQUALS,$r.COUNT_LT,$r.COUNT_LTE,$r.COUNT_GT,$r.COUNT_GTE,$r.COUNT_RANGE,$r.EXISTS,$r.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[$r.EQUALS,$r.NOT_EQUALS,$r.EXISTS,$r.MISSING_VALUE]},du=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Ze.TYPE_TYPEAHEAD:case Ze.TYPE_STRING:case Ze.TYPE_PASSWORD:case Ze.TYPE_TEXT:case Ze.TYPE_CIK_ID:case Ze.TYPE_URL:case Ze.TYPE_BLOG_URL:case Ze.TYPE_IMAGE_URL:case Ze.TYPE_EMAIL:return pu.OPTIONS_FOR_STRING;case Ze.TYPE_LOOKUP:case Ze.TYPE_DEPENDENT_LOOKUP:return pu.OPTIONS_FOR_LOOKUP;case Ze.TYPE_ENUM:return pu.OPTIONS_FOR_ENUM;case Ze.TYPE_DATE:case Ze.TYPE_ACTIVENESS_DATE:case Ze.TYPE_TIMESTAMP:case Ze.TYPE_LOCAL_DATE:return pu.OPTIONS_FOR_DATE;case Ze.TYPE_BOOLEAN:case Ze.TYPE_BOOLEAN_RADIO:return pu.OPTIONS_FOR_BOOLEAN;case Ze.TYPE_BLOB:return pu.OPTIONS_FOR_BLOB;case Ze.TYPE_LONG:case Ze.TYPE_INT:case Ze.TYPE_FLOAT:case Ze.TYPE_DOUBLE:case Ze.TYPE_NUMBER:return pu.OPTIONS_FOR_NUMBER;case Ze.TYPE_ENTITY_ID:return pu.OPTIONS_FOR_ID;case Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[$r.EQUALS];case Ze.TYPE_COUNT:return pu.OPTIONS_FOR_COUNT;case Ze.TYPE_NESTED:case Ze.TYPE_REFERENCE:case Ze.TYPE_IMAGE:return pu.OPTIONS_FOR_COMPLEX;default:return pu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(nu,n):n},yu=e=>[Pe.and,Pe.andNot].includes(e),fu=e=>[Pe.or,Pe.orNot].includes(e),Tu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),fu)),Eu=(mu=[Pe.and],e=>e.slice(0,-1).every((e=>mu.includes(e.operator))));var mu;const hu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),bu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),Ou=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},vu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Pe.or,Pe.orNot],n=t?[Pe.and,Pe.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)&&Ou(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},gu="and",_u=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)(gu,n,e),o=(e=>[Pe.andNot,Pe.orNot].includes(e))(a)?vu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Au=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Nu=e=>Array.isArray(e)?e.map(Nu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Pu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),Ru=e=>`'${e}'`,Su=e=>`"${e}"`,wu=(0,l.pipe)(Nu,Pu),Iu=(0,l.pipe)(wu,Ru),Uu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(zl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Cu=(e,t)=>nu(t)?{type:Ze.TYPE_INT}:iu(t)?{type:Ze.TYPE_FILE}:ou(t)&&!su(t)&&cr(e.type)?{type:Ze.TYPE_LOCAL_DATE}:e,Lu=Object.values(Kr),ju=e=>!Object.values(Kr).includes(e),Du=e=>Lu.includes(e),ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr;return rn().text(t[e])},Fu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.values(Hr),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jr;return e.map((e=>({value:e,get label(){return ku(e,t)}})))},Mu=e=>{const t=f()().startOf("minute");switch(e){case Hr.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Hr.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Hr.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Hr.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Hr.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case Qr.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];default:return e}},xu=e=>{let[t,r]=e;return[f()(t).valueOf(),f()(r).endOf("date").valueOf()]},$u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mu;return(0,l.is)(String,e)?t(e):xu(e)};let Vu;!function(e){e.CurrentUser="currentUser"}(Vu||(Vu={}));const Gu={},Wu=(e,t)=>{Gu[e]=t},Bu=e=>Gu[e];function Yu(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){qu(e,t,r[t])}))}return e}function qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hu=e=>e.split("{CurrentUser}").join(Bu(Vu.CurrentUser)||""),Qu=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Ku=(0,l.curry)(((e,t,r)=>{const n=r.map(zl(e)||t.endsWith(".count")?wu:Iu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Ju=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Xu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=eu(t);return(0,l.pipe)(Ju(i),(0,l.map)(Ku(t,r)),Qu(" or "))(n)},zu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Iu).join(",")})`},Zu=e=>`*${e}*`,ec=e=>`URL:${e}`,tc=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,rc=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===$r.IN_FILE?r:`not ${r}`},nc=(e,t)=>[R(e,t),S(e,t)],ic=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!ac(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case $r.ON:return Yu({},e,n?{filter:$r.EQUALS}:{filter:$r.IN_RANGE,values:[nc(i,n)]});case $r.BEFORE:return Yu({},e,{filter:$r.LTE,values:[[S(i,n)]]});case $r.AFTER:return Yu({},e,{filter:$r.GTE,values:[[R(i,n)]]});case $r.WITHIN:return Yu({},e,{filter:$r.IN_RANGE,values:[Mu(i)]})}}return e}),Xu),ac=(0,l.propSatisfies)(cr,"type"),oc=[[(0,l.prop)("rawFilter"),(0,l.pipe)((0,l.prop)("rawFilter"),Hu)],[(0,l.propEq)("filter",$r.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(Xu({filter:$r.EQUALS,fieldName:t,values:[r]}))),new _u).build())),Qu(" or "))(r)}),Hu)],[(0,l.propEq)("filter",$r.CONTAINS),(0,l.pipe)((e=>{let{filter:t,fieldName:r,values:n}=e;return Xu({fieldName:r,filter:t,values:n.map((0,l.pipe)(Nu,Zu))})}),Hu)],[(0,l.propEq)("filter",$r.EQUALS),(0,l.pipe)((e=>{const{fieldName:t,values:r}=e;return"type"===t?Xu(Yu({},e,{values:(0,l.flatten)(r)})):tc(r)?zu(Yu({},e,{filter:"listEquals"})):Xu(e)}),Hu)],[(0,l.propEq)("filter",$r.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=eu(t);return(0,l.pipe)(Ju(i),(0,l.map)(Ku(t,r)),Qu(" and "))(n)})(Yu({},e,{values:(0,l.flatten)(e.values)})):ac(e)?(e=>{const{values:t}=e,r=!ac(e),[n]=t;return(new _u).addClause(Xu(Yu({},e,{filter:$r.LT,values:[R(n,r)]}))).addClause(Xu(Yu({},e,{filter:$r.GT,values:[S(n,r)]}))).orBuild()})(e):tc(t)?zu(Yu({},e,{filter:"not listEquals"})):Xu(e)}),Hu)],[(0,l.propSatisfies)(iu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Xu({fieldName:r,filter:rc(t,r),values:n.map((0,l.prop)("link")).map(ec)})}],[(0,l.propSatisfies)(nu,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Xu({fieldName:`${r}.count`,values:n,filter:au(t)})}],[(0,l.propSatisfies)(ou,"filter"),ic],[(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 Ku(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Ku(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,(0,l.pipe)(Xu,Hu)]],sc=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!tu(e)||uc(e,r))},lc=(e,t)=>Array.isArray(t)?uc(e,t):e===$r.WITHIN?Du(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Nu(t).length>0,uc=(e,t)=>t&&t.length>0&&t.every((t=>lc(e,t)));function cc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pc=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},dc=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),yc=(e,t,r)=>"children"===e?Tc(r,[...t][0],!0):r,fc=(e,t,r)=>"values"===e?[...r,...t]:r,Tc=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)(yc,t),e);if(!r&&ru(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(fc,t),e)}return(0,l.append)(t,e)},Ec=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=pc(e),r=e=>e.fieldName===t?e:r({fieldName:dc(e),children:[e]});return r(e)})(t);return Tc(e,r)}),[]),mc=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")),hc=e=>{let[t]=e;return t.children?hc(t.children):t.operator},bc=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=hc(t)===Pe.andNot,a=n(t,!1),o=i?`not ${vu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${hc(r)||gu} ${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&&mc(i)&&!t?r(i):n(i,a)}],...e])(o))),new _u).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Oc=(0,l.pipe)((0,l.propOr)("","filter"),Kl),vc=(0,l.map)((0,l.when)(Oc,(e=>{const[t,r]=Ql(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){cc(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)(sc),vc,Ec,bc([...e,...oc],t))},_c=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),Ac=[$r.ON,$r.BEFORE,$r.AFTER,$r.WITHIN,$r.NOT_EQUALS,$r.MISSING_VALUE,$r.EXISTS],Nc=[$r.EQUALS,$r.NOT_EQUALS,$r.STARTS_WITH,$r.MISSING_VALUE,$r.HAS_ALL,$r.FULL_TEXT,$r.EXISTS],Pc=[$r.EQUALS,$r.NOT_EQUALS,$r.LT,$r.LTE,$r.GT,$r.GTE,$r.IN_RANGE],Rc=(e,t)=>{const r=Gt(e);return(e=>{switch(e){case on.startDate.name:case on.endDate.name:case ln.dueDate.name:case pn.createdTime.name:case pn.updatedTime.name:case yn.reltioLoadDate.name:case yn.createDate.name:case yn.updateDate.name:case yn.deleteDate.name:case yn.publishDate.name:return Ac;case dn.matches.name:case yn.count.name:return Pc;case ln.workflow.name:case ln.assignee.name:case ln.step.name:case un.commenter.name:case pn.createdBy.name:case pn.updatedBy.name:case yn.sourceSystems.name:case yn.value.name:return Nc;default:return null}})(t)||du(r)},Sc=[$r.EQUALS,$r.NOT_EQUALS,$r.CONTAINS,$r.STARTS_WITH,$r.MISSING_VALUE,$r.HAS_ALL,$r.IN_RANGE,$r.WITHIN,$r.EXISTS,$r.ON],wc=(0,l.pipe)(Rc,(0,l.filter)((0,l.includes)(l.__,Sc))),Ic=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Uc=e=>{let{query:t,body:r}=e;return t=Ic(t),xl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Cc=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(),_c(t.globalFilter))(n),activeness:t.activityFilter||zr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Nr(i)}`},Lc=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=Cc(e,t,r);return xl(n)},jc=e=>xl(`/entities/_total?${e}`),Dc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(Ho),(0,l.map)((0,l.prop)("uri")))(e),i={filter:$r.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(gc(),_c(r.globalFilter))([i,a]),s=Nr({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||zr.ACTIVE_ONLY,max:r.max||4});return xl("/entities/_typeAheadSearch"+s,{method:"GET"})},kc=(0,l.pipe)((0,l.reject)(l.isNil),Ar),Fc=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(),_c(i))(r),p=kc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Uc({query:p,body:d})},Mc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Fc({fieldName:t,searchParams:i,options:n})};function xc(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="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Vc=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(),_c(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||$c,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Nr(i)}`},Gc=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=Vc(e,t,r);return xl(n)},Wc=e=>Kc(e,{select:"secondaryLabel"}),Bc=(e,t)=>{const{select:r=$c,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),xl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Yc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),mt)),qc=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=Yc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Zt(r),m={method:"POST",data:{attributesPaging:T,defaultMaxValues:a,options:d,select:"crosswalks,"+E}},h=[...c,{filter:"containsWordStartingWith",fieldName:E,values:[u]}],b=(0,l.pipe)(gc(),_c(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),xl(`${s}/api/${o}/${t}/_object`,m)},Hc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Qc={options:"sendHidden,addRefAttrUriToCrosswalk"},Kc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qc;return xl(`/${e}${Nr(t)}`)},Jc=(e,t)=>Kc(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){xc(e,t,r[t])}))}return e}({},Qc,{explicitSurvivorshipGroup:t})),Xc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r={method:"POST",data:[e]},n=t("/entities");return xl(n,r)},zc=e=>xl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Zc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return xl(`/${e}/_clone${Nr({executeLCA:!1,valuesToCopy:r})}`,n)},ep=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return xl(`/entities/_events/_total${Ar({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},tp=(e,t)=>xl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),rp=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return xl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},np=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 xl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Ar)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ip=e=>{const t=new FormData;return t.append("file",e),xl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,rn().text("Can't upload file"));return Promise.reject(t)}))},ap=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 xl(`/personal/findSavedSearches${Ar({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"}})},op=e=>xl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),sp=e=>xl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),lp=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return xl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},up=e=>{let{uri:t}=e;return xl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},cp=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),lp)(e),pp=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),lp)(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 yp=["max","offset","filter"],fp=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:fp(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){dp(e,t,r[t])}))}return e}({},t,(0,l.pick)(yp,e)))),Tp=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ne.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ne.ALL,e)))return!1},Ep=(0,l.omit)(["activeness"]),mp=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Tp(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(fp(e),(0,l.omit)(yp))(e))),Ep,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${Nr(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},hp=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),bp=(0,l.reject)(l.isNil),Op=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),vp=e=>xl(Op(e),{method:"GET",headers:{"Content-Type":"application/json"}}),gp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,Op);return xl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},_p=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?vl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(bp,ne,JSON.stringify);return xl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Ap=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"),Op,n),o=am(i(t),i(r)).concat(sm(t,r));return xl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Np=(e,t,r)=>{const{url:n,options:i}=mp(e,t,r);return xl(n,i).then(hp)},Pp=(e,t)=>xl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Rp=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===en.IN?a.inRelations=[n]:a.outRelations=[n],xl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Sp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return xl(`${t}/recentSearches${Nr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},wp=e=>xl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Ip=e=>{let{environment:t,tenant:r,createdDate:n}=e;return xl(`/recentSearches${Nr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};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 Lp={select:"label,secondaryLabel,name,type,startDate,endDate"},jp=(0,l.reject)(l.isNil),Dp=(0,l.pipe)(jp,Ar),kp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Up({},Lp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return xl(`/${t}/_tree${Dp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Fp=e=>{let{uri:t,graphUri:r}=e;const n=Up({},Lp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return xl(`/${t}/_parents${Dp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Mp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=Up({},Lp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return xl(`/${t}/_hops${Dp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function xp(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 $p=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Vp="/activities",Gp=e=>{let{label:t,description:r}=e;return xl(Vp,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:$p()}})};var Wp;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Wp||(Wp={}));const Bp=e=>{const t=Nr(e);return xl(Vp+t,{method:"GET"})},Yp=e=>xl(`/activities/_total${Nr(e)}`,{method:"GET"}),qp=e=>{const{entityUri:t}=e,r=xp(e,["entityUri"]);return xl(`/${t}/_activities${Nr(r)}`,{method:"GET"})},Hp=e=>{const{entityUri:t}=e,r=xp(e,["entityUri"]);return xl(`/${t}/_activities/_total${Nr(r)}`,{method:"GET"})};function Qp(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){Kp(e,t,r[t])}))}return e}function Kp(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{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Xp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return xl(Jp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},zp=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=Jp({url:r,workflowPath:t,tenant:n})),xl(s,{method:i||"GET",body:JSON.stringify(a),headers:Qp({"Content-Type":"application/json"},null!=o?o:{})})},Zp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Jp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return xl(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)},ed=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Jp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Qp({},l,{comment:o}):l;return xl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},td=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Jp({url:`/tasks${s?Nr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Qp({objectURIs:[i]},(0,l.reject)(E,a)))};return xl(u,Qp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},rd=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return xl(Jp({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})})},nd=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return xl(Jp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(Qp({max:a,offset:o},i))})},id=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return xl(Jp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},ad=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return xl(Jp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},od=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return ad({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},sd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return xl(Jp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ld=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return ad({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},ud=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return ad({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},cd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return ad({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},pd=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return xl(Jp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},dd=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return xl(Jp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},yd=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(ss);return a&&a[0]&&(r=n.length>0&&a[0].value?yd(a[0].value,[n.join(".")])[0].value:"string"==typeof a[0].label?a[0].label:Object.prototype.hasOwnProperty.call(a[0],"label")?"":a[0].value||""),{key:t,value:r}}),""),fd=(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=yd(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},Td=/[,\s]*$/,Ed=e=>{const t=rn().text(Zr);if(!e)return t;const r=e.replace(Td,"");return""===r.toString().trim()?t:r},md=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},hd=(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=md(e,r.referencedEntityTypeURI);if(n)return fd({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return fd({attributes:t||{}},r.dataLabelPattern);return""},bd=e=>{let{uiPath:t,uri:r,screen:n="profile"}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}${n}?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Od=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},vd=(0,l.curry)(((e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"")),gd=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Cl,(0,l.prop)("value"))),_d=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),gd),Ad=(e,t,r)=>{const n=_d(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(As(e),gd)))(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")])})(Cr(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>gs(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,gd))(r)})(e,r)||Mr(e,r.type);return vd(t,n)};function Nd(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){Pd(e,t,r[t])}))}return e}function Pd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rd="DTSS/",Sd=(0,l.replace)(new RegExp("^entities/"),""),wd=e=>Rd+e.dataTenant+"/"+e.uri,Id=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Ud=e=>!(!e||!e.dataTenant),Cd=(0,l.startsWith)(Rd),Ld=(0,l.pipe)((0,l.ifElse)(Cd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),jd=(0,l.ifElse)(Ud,wd,(0,l.prop)("uri")),Dd=e=>e&&e.uri?e.dataTenant?wd(e):Sd(e.uri):"",kd=(0,l.curry)(((e,t,r)=>(Cr(t,r.type)||{})[e]||"")),Fd=kd("label"),Md=kd("typeGraphIcon"),xd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Cr(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(ss)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:hd(e,o,i),uri:a.uri}})).filter(l.identity):[]},$d=(0,l.pipe)(xd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Vd=(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=Vd(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Vd(e.slice(1),r)}})),Gd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Wd=e=>(0,l.propOr)([],"matchRules",e),Bd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Nd({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Yd=(e,t,r)=>t&&r?r.aEntity:e,qd=(0,l.evolve)({attributes:vl(!0)}),Hd=(0,l.pipe)(qd,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Qd=e=>(0,l.assoc)("dataTenant",e),Kd=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 xl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Ar)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jd=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 xl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Ar)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Xd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return xl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},zd=(e,t,r)=>Promise.all(t.map((async t=>await xl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),Zd=async(e,t)=>await zd(e,t,"NOT"),ey=async(e,t)=>await zd(e,t,"MATCH"),ty=async(e,t)=>await Promise.all(t.map((async t=>await xl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));function ry(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){ny(e,t,r[t])}))}return e}function ny(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iy(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 ay=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return xl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},oy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Ny({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},sy=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Ny({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},ly=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return xl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},uy=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 ly({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},cy=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Ud,i);return Promise.all([s.length?Xd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return ly({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},py=(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=iy(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)}),[])),dy=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),py),yy=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return xl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(dy)},fy=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)},Ty=fy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return xl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(dy)})),Ey=fy((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return xl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),my=(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)}},hy=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return xl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},by=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 hy(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Oy=by("NOT"),vy=by("MATCH"),gy=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Ud,a);return Promise.all([zd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return hy(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},_y=gy("NOT"),Ay=gy("MATCH");function Ny(e){let{requestProvider:t=xl,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}`,ry({},iy(s,["headers"]),{headers:ry({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Py=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Ny({url:Vc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Ry=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Ny({url:Cc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Sy=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=mp(t,r);return Ny({url:`entities/_connections/_getConnections${Nr({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(hp,(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)))}))))},wy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Ny({url:`${Hc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Iy=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return xl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Uy=e=>{let{dtssPath:t,tenant:r}=e;return xl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Cy=e=>{let{dtssPath:t,customerTenant:r}=e;return xl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},Ly=e=>{let{dtssPath:t,tenants:r}=e;return xl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},jy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Ny({url:Hc(t),dataTenant:r,customerTenant:n,dtssPath:i})},Dy=()=>xl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function ky(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){Fy(e,t,r[t])}))}return e}function Fy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const My=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=ky({},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 xl(`${t}/api/${r}/graph/search${Nr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},xy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return xl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:ky({},n,i),headers:{"Content-Type":"application/json"}})},$y=(e,t)=>`${e}/${t}/comments`,Vy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return xl(`${$y(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Gy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return xl(`${$y(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Wy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return xl($y(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},By=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return xl(`${$y(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Yy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return xl(`${$y(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},qy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return xl(`${$y(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Hy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return xl(`${$y(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Qy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return xl(`${$y(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Ky=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Nr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return xl(`${$y(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Jy(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){Xy(e,t,r[t])}))}return e}function Xy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zy=e=>{let{tenant:t,servicesPath:r}=e;return xl(`${r}/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Zy="graphExport",ef=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await af({servicesPath:e,tenant:t,environment:r,namespace:Zy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Jy({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await af({servicesPath:e,tenant:t,environment:r,namespace:Zy,options:Jy({method:"PUT"},o)})}catch(e){s=null}return s||(s=await af({servicesPath:e,tenant:t,environment:r,namespace:Zy,options:Jy({method:"POST"},o)})),s},tf=e=>{let{servicesPath:t,key:r}=e;return xl(`${t}/settings${Nr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},rf=e=>{let{servicesPath:t}=e;return xl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},nf=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return xl(`${n}/plugins${Nr({tenant:t,user:r})}`,{method:"GET"})},af=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return xl(`${n}/configService${Nr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},of=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return af({tenant:t,environment:r,servicesPath:n,options:{method:"GET"}})},sf=e=>{let{servicesPath:t,stateHash:r}=e;return xl(`${t}/searchLink?key=${r}`,{method:"GET"})},lf=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),xl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},uf=e=>xl(`/${e}?showObjectsInfo=true`,{method:"GET"}),cf=e=>{let{exportPath:t,tenant:r,options:n}=e;return xl(`${t}/${r}/activities${Nr(n)}`,{method:"POST"})};function pf(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}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 yf=e=>{const{entityUri:t}=e;return xl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ff=e=>{let{entityUri:t,crosswalk:r}=e;return xl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Tf=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return xl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[pf({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),pf({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},Ef=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return xl(`/${r}/_${n}${Nr({contributorURI:t})}`,{method:"POST"})},mf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return xl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},hf=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return xl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},bf=e=>{let{entityUri:t,crosswalkId:r}=e;return xl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};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 vf=e=>{let{entityTypeUri:t}=e;return xl(`/dataQuality/fillRates${Ar({entityType:Rt(t)})}`,{method:"GET"})},gf=e=>{let{attributes:t=[],metrics:r=[]}=e;const n=r.length,i=t.length*n;return i>10?10:i},_f=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){Of(e,t,r[t])}))}return e}({},n===Fe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{}),o=n===Fe.ATTRIBUTE_TYPE?Ar({numberOfThreads:gf({attributes:r,metrics:i})||1}):"";return xl(`/entityType/${Rt(t)}/dataQuality/${n}${o}`,{method:"POST",body:JSON.stringify(a)})},Af=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return xl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Rt(n)}`,{method:"GET",headers:{env:i}})},Nf=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Fe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return xl(`${t}/${r}/entityType/${Rt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},Pf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return xl(`/${t}${Nr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Rf=e=>{let{attributeUri:t,value:r}=e;return xl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},Sf=e=>{let{attributeUri:t,value:r}=e;return xl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},wf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return xl(`/${t}${Nr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},If=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Nr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=vl()([[{value:a}]]);return xl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Uf=e=>{let{entityUri:t,attributeName:r,value:n}=e;return xl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Cf=e=>{let{entityUri:t,attributeName:r}=e;return xl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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=e=>{let{entityUri:t}=e;return xl(`/${t}/_historicURIs`,{method:"GET"})},Df=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 xl(`/${t}/_changesWithTotal${Nr(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}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},kf=(e,t)=>xl(`/${e}/_previousChange${Nr({timestamp:t})}`,{method:"GET"}),Ff=(e,t)=>xl(`/${e}${Nr({time:t})}`,{method:"GET"});function Mf(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){xf(e,t,r[t])}))}return e}function xf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $f=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return xl(t,{method:r||"GET",body:n,headers:Mf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},Vf=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Nr({options:a.join(","),severity:o.join(",")});return xl(`${t}/validate/${i}/entity/${Dd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Gf=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return xl(`${t}/validate/${n}/entity${Nr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Wf=e=>{let{tenant:t,apiPath:r}=e;return xl(`${r}/tenants/${t}/name`,{method:"GET"})},Bf=e=>{let{tenant:t,apiPath:r}=e;return xl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Yf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return xl(`${a}/preferences${Nr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},qf=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 xl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Hf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return xl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},Qf=e=>{const{servicesPath:t}=e;return xl(`${t}/getTokenForWorker`,{method:"GET"})};var Kf=r(29524);const Jf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=ht(),s={attributes:ul({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=gs(r,e,n.uri)[0];return i&&i.value?fl({entity:e,attributeType:n,uri:i.uri,value:t}):dl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Xf=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ms),(0,l.filter)(mt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),zf=(0,l.curry)(((e,t)=>{const r=Xf(e=e||{},t=t||{});return r.concat((0,l.chain)(zf(e),r))})),Zf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),eT=Zf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),tT=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),mt)),rT=e=>(0,l.pipe)(eT,tT(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),nT=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(eT,(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})),iT=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),mt),(0,l.omit)(["uri","timestamp"])),aT=(0,l.pipe)(iT,qd),oT=async(e,t,r)=>{if(!e)return null;const n=rT(e);if(n.length>0)for(const r of n)e=nT(r,t[r],e);const i=await Xc(aT(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},sT=async(e,t,r)=>{const n=uT(e,t),i={};for(const t of n)i[t]=await oT(e[t],i,r);return i},lT=(0,l.curry)(((e,t)=>{const r=Kf.Node(t);return rT(e[t]).forEach((t=>{const n=lT(e,t);r.addEdge(n)})),r})),uT=(e,t)=>(0,l.pipe)((0,l.map)(lT(e)),(0,l.map)(Kf.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),cT=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(iT))})),pT=(e,t)=>[...dm(e.tags||[],t.tags||[]),...ym(e.roles||[],t.roles||[]),...om(e,t),...sm(e,t)],dT=(e,t)=>[...lm(am((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),pm((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...pT(e,t)],yT=(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 nT(r,n,e)}),e))))}),t)}),cT),fT=(0,l.curry)(((e,t)=>(0,l.when)(mt,(0,l.propOr)(l.__,t,e),t)));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{parentUri:t,relation:r,entityUri:n}=e;return{type:Me.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},hT=e=>{let{relationUri:t}=e;return{type:Me.DELETE_RELATION,parameters:{relationUri:t}}},bT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Me.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},OT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Me.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},vT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Me.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},gT=(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))),_T=e=>e.type===Me.DELETE_RELATION,AT=e=>e.type===Me.CREATE_RELATION,NT=e=>e.type===Me.REPOINT_RELATION,PT=e=>e.type===Me.UPDATE_RELATION,RT=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),ST=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Me.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return _p({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Me.DELETE_RELATION:return()=>{const{relationUri:e}=r;return gp(e,i).then(o)};case Me.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Rp(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Me.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Ap({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Me.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[hT({relationUri:o}),mT({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(IT(n)),(0,l.map)(ST),RT)(s)}}},wT=e=>t=>()=>e().then(t),IT=e=>t=>TT({dcrProcessor:e},t),UT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Pr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(IT(r)),(0,l.map)(ST),(0,l.map)(wT(r.getDcrUriAwait)),RT,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},CT=e=>t=>(0,l.map)((t=>TT({},t,{parameters:(0,l.evolve)({parentUri:fT(e),entityUri:fT(e),newEntityUri:fT(e)},t.parameters)})),t),LT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},jT=(e,t)=>{const r=e.filter(AT).find(gT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>PT(o)&&gT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!NT(o)||!gT(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(LT({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},DT=(e,t)=>{const r=e.filter(NT).filter(gT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!PT(i)||!gT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(LT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},kT=(e,t)=>{const r=e.filter(_T).filter(gT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!gT(t,e)))},FT=(e,t)=>{const r=e.filter(PT).filter(gT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!PT(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(LT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},MT=e=>{const t=e.filter(_T).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(kT,e)},xT=e=>{const t=e.filter(AT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(jT,e)},$T=e=>{const t=e.filter(NT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(DT,e)},VT=e=>{const t=e.filter(PT).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)(FT,e))(t)},GT=e=>(0,l.pipe)(MT,xT,$T,VT)(e);function WT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BT(e,t,r[t])}))}return e}function BT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YT=e=>WT({},(0,l.path)(nE(),e),{startDate:(0,l.path)(sE(),e),endDate:(0,l.path)(lE(),e)}),qT=(e,t)=>(0,l.pipe)((0,l.path)(oE()),fT(t))(e),HT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=qT(e,r),i=(0,l.path)(iE(),e)===xe.IN,a=e.parentEntityUri||n;return mT({parentUri:i?t:a,relation:YT(e),entityUri:i?a:t})})),...o.map((t=>{const i=qT(t,r),a=(0,l.path)(iE(),t)===xe.IN,o=i!==(0,l.pipe)((0,l.path)(nE()),a?uE:cE)(t),s=yE(e,(0,l.path)(tE(),t)),u=t.parentEntityUri||n,c=fT(r,i);return o?vT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(nE(),t),isReversed:!1}):OT({oldRelation:(0,l.path)(nE(),s),newRelation:YT(t)})})),...i.map((e=>hT({relationUri:e}))),...s.map((e=>bT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},QT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return WT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),KT=(0,l.has)("dataTenant"),JT=(0,l.ifElse)(KT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),XT=(e,t)=>(0,l.pipe)(ci,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(xs),Sa)(e,t),zT=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)}},ZT=(e,t,r)=>{const n=fd(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)},eE="relation",tE=(0,l.always)([eE,"relationUri"]),rE=(0,l.always)([eE,"relationType"]),nE=(0,l.always)([eE,"object"]),iE=(0,l.always)([eE,"direction"]),aE=(0,l.always)([eE,"object","attributes"]),oE=(0,l.always)(["entity","entityUri"]),sE=(0,l.always)([eE,"startDate"]),lE=(0,l.always)([eE,"endDate"]),uE=(0,l.path)(["startObject","objectURI"]),cE=(0,l.path)(["endObject","objectURI"]),pE=(0,l.path)(["startObject","objectTypeURI"]),dE=(0,l.path)(["endObject","objectTypeURI"]),yE=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(tE()),(0,l.equals)(t))(r))return r;if(r.connections){const e=yE(r.connections,t);if(e)return e}}},fE=(0,l.pipe)(yE,(0,l.path)(nE())),TE=(0,l.allPass)([(0,l.pipe)((0,l.path)(oE()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(rE()),(0,l.complement)(E))]),EE=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:bt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=bE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=mE(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?zT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},mE=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:en.IN}:{type:t[0],direction:en.OUT}:null},hE=e=>e.uri||e,bE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&_i(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===en.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"],Cr(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Cr(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(hE,ci(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(en.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(en.OUT)),(0,l.map)(u))},t)||{}},OE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ti({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=di(e,n.uri);return n&&(!t||jr(e,i,t))&&(!r||jr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Cr(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Cr(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(qo,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)}},vE=(0,l.curry)(((e,t,r,n,i)=>{const a=jr(n,l.__,t.type),o=e?dE:pE,s=jr(n,l.__,r.type),u=e?pE:dE;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),gE=(e,t,r)=>{const n=e?dE:pE,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(jr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};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{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return _E({},t,{[r]:{parents:n,children:i}})},PE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return _E({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},RE=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=Xf(t,i),o=NE({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>RE(n.uri,t,[e],r)),o)},SE=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)(tE(),n),a=t?PE({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(oE(),n),s=mt(o)?[o]:[],u=NE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>RE(t,r,[i],e)),u)}),n)},wE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return SE(r,e,t,RE(e,t))},IE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return wE(t,r,n);if(vt(e)){const t=yE(n,e);return t&&SE([t],null,r)}return r[e]?RE(e,r):void 0},UE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>UE(e,t))))},CE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>CE(e,t))))},LE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ot(t),u=wE(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(vt(c)){if(s=yE(i,c),!s)return null;o.push({type:ve.relationConnection,value:s,valueType:ci(a,(0,l.path)(rE(),s))});continue}if(vt(u)){const e=n[c];if(!e)return null;o.push({type:ve.tempEntity,value:e,valueType:Cr(a,e.type)});continue}const p=n[u],d=Fs(p,c),y=n[c];if(!d||!y)return null;o.push({type:ve.attributeValue,value:d,valueType:ar(a,Ut(d.uri,p.type))}),o.push({type:ve.tempEntity,value:y,valueType:Cr(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},CE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=vt(s),d=p?fE(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?ci(a,d.type):Cr(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:or(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:ve.tempEntity,value:T,valueType:Cr(a,T.type)}),o.push({type:ve.attributeValue,value:s,valueType:E}),m=s.value;const l=ms(s);T=l&&mt(l)?n[l]:null}}return o},jE=e=>e.every((e=>{let{type:t}=e;return[ve.attributeValue,ve.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ve.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null;let DE;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(DE||(DE={}));const kE={[DE.insertAttribute]:{color:"#599E0E"},[DE.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[DE.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},FE=e=>{switch(e){case"UPDATE_ATTRIBUTE":return DE.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return DE.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return DE.deleteAttribute;default:return""}},ME="/",xE=(0,l.pipe)((0,l.split)(ME),(0,l.propSatisfies)((0,l.lte)(2),"length")),$E=(0,l.pipe)((0,l.split)(ME),(0,l.slice)(0,-2),(0,l.join)(ME)),VE=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.has)(e),(0,l.prop)(e)],[()=>xE(e),VE($E(e))]])(t))),GE=e=>(0,l.pipe)(l.keys,(0,l.any)((0,l.startsWith)(e+ME))),WE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=VE(e,t);return(0,l.isNil)(r)?GE(e)(t)?"UPDATE_ATTRIBUTE":"":r},BE=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]},YE=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(YE(e))}))}))),t},qE=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(JE,t),(0,l.propOr)([],"crosswalks",e))),e),HE=(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(HE(e))}))})),r},QE=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=QE(e);r>t&&(t=r)}))})),t+1):t},KE=(e,t)=>{if(mt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},JE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},XE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},zE=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},ZE=(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)},em=(0,l.eqBy)(JE),tm=(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)(ps,(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 rm(e){return e&&void 0!==e.uri}function nm(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 im(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 am(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(am(d.value,y.value,r)):"Reference"===g(d)?im(d,y)?o.push.apply(o,am(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 om(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)||rm(r)&&rm(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function sm(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 lm(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=um(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?cm(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=um(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 um=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),cm=(e,t,r)=>(0,l.pipe)(Ms,(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 KE(t,r)},e=>{let[t]=e;return!ss(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function pm(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 dm(e,t){return nm("UPDATE_TAGS").call(this,e,t)}function ym(e,t){return nm("UPDATE_ROLES").call(this,e,t)}function fm(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){Tm(e,t,r[t])}))}return e}function Tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Em=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=fm({},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:fm({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const mm=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?mm(t.value):[]];return e.concat(r)}),[])),hm=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,bm=e=>e?[jd(e)]:[],Om=e=>{const t=[...mm((null==e?void 0:e.attributes)||[]),...mm((null==e?void 0:e.analyticsAttributes)||[])];return e?[...bm(e),...t]:[]},vm=(e,t)=>[e,...t.map((t=>hm(e,t)))],gm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return JT(t)}))},_m=(e,t)=>{switch(e){case ge.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ge.ENTITY_ATTRIBUTE:case ge.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[Ct(t)]})(t);case ge.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ge.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,jd({uri:n,dataTenant:i}),r]})(t)}},Am=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),Nm=(0,l.curry)(((e,t)=>{const r=Eo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Nm(e,r.extendsTypeURI)):n})),Pm=(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))),Rm=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Nm(e),Pm(t))(t);function Sm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wm=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}},Im=e=>!e.deactivated,Um=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},Cm=e=>Um(e)+e.message,Lm=(0,l.unless)(l.isNil,(0,l.prop)("message")),jm=(0,l.unless)(l.isNil,(0,l.prop)("type")),Dm=(0,l.curry)(((e,t)=>Nt(t.parentUri,e))),km=(0,l.curry)(((e,t)=>t.parentUri===e)),Fm=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Nt(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Ze.TYPE_REFERENCE),(0,l.pipe)(it,(0,l.any)(Nt(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),Mm=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),xm=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),$m=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Qm,Im,Dm(e),Fm(t),(0,l.complement)(xm(e,t.uri))]))(r)},Vm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Qm,Im,km(e),Mm(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",me.missed))]))(r);return n&&n.message||""},Gm=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===me.missed))},Wm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Im,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(tE(),e))]))(t)},Bm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Im,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},Ym=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Im,Dm(t)]))(r)},qm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Im,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Hm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?LE(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 ve.attributeValue:{const e=a;if(Kt(a))return fd(o,e.dataLabelPattern);if(Jt(a)){const t=o,i=ms(t),a=rt(e),s=Cr(n,a);return mt(i)?fd(r[i],s.dataLabelPattern):t.label}return""}case ve.tempEntity:return fd(o,a.dataLabelPattern);case ve.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Cr(n,null==e?void 0:e.entityType);return`${Ed(i&&mt(i)?fd(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||pi(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){Sm(e,t,r[t])}))}return e}({},e,{label:Ed(t)})}))},Qm=e=>!e.severity||e.severity===be.ERROR,Km=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Ze.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(Km(n))}));case Ze.TYPE_REFERENCE:return!!cs(t);case Ze.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Jm=(e,t)=>e.every((0,l.complement)(Km(t))),Xm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Oo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=gs(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!ss(e.parent))))).forEach((e=>{Jm(e.attrValues,n)&&r.push(wm({type:me.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:rn().text("Attribute is required"),source:he.local}))})),r}),[])},zm=(0,l.curry)(((e,t,r)=>gs(e,t,r,!1))),Zm=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Cr(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Ht),(0,l.filter)(Jt),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(zm(e,t)));return(0,l.pipe)(r,(0,l.reject)(ms),(0,l.map)((e=>{let{uri:r}=e;return wm({type:me.missedRefEntity,uri:"",attributeTypeUri:Ut(r,t.type),parentUri:r,message:rn().text("Entity is required"),source:he.local})})))(t)},eh=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ms,mt)).flatMap((n=>{const i=ms(n),a=t[i],o=ar(e,Ut(n.uri,r.type));return th(e,t,o,a)})),th=(e,t,r,n)=>{const i=it(r),a=i.map((t=>ar(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Ze.TYPE_REFERENCE))).flatMap(ot).concat(i);return rh(e,t,n,(e=>a.some(Nt(e.uri))))},rh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=Xm(e,r,n),a=Zm(e,r),o=eh(e,t,r);return[...i,...a,...o]},nh=(e,t)=>{const r=(0,l.path)(nE(),t)||{};return Xm(e,r)},ih=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(oE()),(0,l.ifElse)(mt,(e=>t[e]),(0,l.always)(null)))(r),i=nh(e,r),a=(e=>(0,l.path)(oE(),e)?[]:[wm({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(rE(),e),parentUri:(0,l.path)(tE(),e),message:rn().text("Entity is required"),source:he.local})])(r),o=((e,t,r)=>r?rh(e,t,r):[])(e,t,n);return[...i,...a,...o]},ah=e=>(0,l.path)(["entity","uri"],e)?[]:[wm({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:rn().text("Entity is required"),source:he.local})],oh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=Xm(e,r),i=ah(t);return[...n,...i]};function sh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lh=(e,t)=>{var r,n;const i=Cr(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Ya(e)},uh=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),ch=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(uh(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},ph=(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)(hs,mt,l.not)]),(e=>{const t=(0,l.pipe)(hs,Rt)(e);return ch((e=>e.replace(t,t+dt)))(e)})),(0,l.when)((0,l.pipe)(ms,mt),(t=>{const r=ms(t),n=e[r],i=n&&yh(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){sh(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),dh=(e,t,r)=>lm(am((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),pm((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)(ph(r,e.type)),(0,l.map)(ch(Ft))))})(e))).concat(pT(e,t)),yh=(e,t)=>(0,l.evolve)({attributes:bl({valueTransformer:(0,l.pipe)(vs,ph(t),uh(Ft)),deleteEmptyComplex:!0}),uri:Ft})(e);function fh(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){Th(e,t,r[t])}))}return e}function Th(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eh=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(pt,"g"),"uri$$$$").replace(new RegExp(dt,"g"),""))),mh=e=>(0,l.pipe)((0,l.evolve)({objectUri:Eh,objectParentUri:Eh}),(e=>{return fh({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?me.missed:me.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&kt(e.objectUri),uri:e.objectUri,source:he.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),hh=(e,t)=>(0,l.map)((0,l.pipe)(mh,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Hm(t,s),p=null!=c&&c.length?c.slice(0,-1):Hm(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&ar(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ve.attributeValue&&(a=e.valueType)}return a})(o,c,e);return fh({},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&&Dt(i)){const n=(0,l.last)(a),i=n.valueType;if(Jt(i)&&st(i).includes(o)){const i=ms(n.value),o=i&&mt(i)?t[i]:null;return o?fh({},e,{parentUri:o.uri,path:a.concat({type:ve.tempEntity,value:o,valueType:Cr(r,o.type),label:""})}):e}}return e}})(t)))(e),bh=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 Oh,vh=r(33164);function gh(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"}(Oh||(Oh={}));const _h={},Ah={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"]}},Nh=e=>{if(!_h[e]){const t=Ah[e]||Ah.random0;_h[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){gh(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return _h[e]},Ph=(0,l.curry)(((e,t)=>{const r=Nh(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]})),Rh=e=>Ph(Oh.Charts,e),Sh=()=>Nh(Oh.PotentialMatches).colors,wh=e=>Ph(Oh.Random1,e),Ih=e=>(0,vh.getColor)(e)?"#FFFFFF":"#212121";var Uh=r(73116);const Ch=Array.from({length:100},((e,t)=>t/100)),Lh=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)},jh={},Dh=new Uh.Z({hash:Lh,saturation:Ch.slice(15,71),lightness:Ch.slice(50,90)}),kh=new Uh.Z({hash:Lh,saturation:Ch.slice(46,89),lightness:Ch.slice(44,58)}),Fh=(0,l.curry)(((e,t,r)=>{t in jh||(jh[t]={});const n=jh[t];r in n||(n[r]=((e,t)=>{const r=String(Lh(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),Mh=Fh(Dh,"crosswalks"),xh=Fh(Dh,"sources"),$h=Fh(Dh,"contributors"),Vh=Fh(Dh,"dataValidationFunctions"),Gh=Fh(kh,"entities");function Wh(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){Bh(e,t,r[t])}))}return e}function Bh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yh=(0,l.has)("items"),qh=e=>0===e,Hh=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)},Qh=e=>e.reduce(((e,t)=>e+t.width),0),Kh=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Jh=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Xh=e=>e.reduce(((e,t)=>e+t.height),0),zh=e=>(0,l.is)(String,e)&&e.includes("%"),Zh=e=>Boolean(e.spacer),eb=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),tb=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(Yh(t)?tb(t):t)),[]),rb=e=>({id:e.layout}),nb=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:rb;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.floor(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=zh(r.width)?eb(i,r.width):u}return Hh(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Hh(n,t,r)},o=(e,t)=>Yh(t.items[0])?p(e,t.items[0]):null,s=(t,r)=>{const o=r.items.reduce(((o,s,u)=>{const c=i(t,r,s,Yh(s)?n(s.layout):e(s.view)),d=qh(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(Yh(s))return o.concat(p(Wh({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(Wh({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Qh(o),height:Kh(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=Yh(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=qh(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(Yh(i))return r.concat(p(Wh({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(Wh({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Hh(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Hh(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Jh(i),height:Xh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=qh(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return Wh({},o,{x:t.x,y:c,width:s,height:u})},i=(e,t)=>{const r=t.reduce(((t,r,i)=>{if("string"==typeof r)t.push(n(e,t,r,i));else if("object"==typeof r){const a=Math.round(e.width/2),o=Wh({},e,{width:a}),s=Wh({},e,{x:e.x+a,width:a}),u=(0,l.has)("left",r)&&n(o,t,r.left,i),c=(0,l.has)("right",r)&&n(s,t,r.right,i),p=(0,l.propOr)(0,"height"),d=Math.max(p(u),p(c));t.push(Wh({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return Wh({},e,{height:Xh(r),items:r})},o=i(t,(0,l.propOr)([],"top",r)),s=Math.round(.66*t.width),u=(0,l.isEmpty)(o)?t.y:t.y+o.height,c=i(Wh({},t,{y:u,width:s}),(0,l.propOr)([],"center",r)),p=i({x:t.x+s,y:u,width:t.width-s},(0,l.propOr)([],"right",r)),d=o.height+Math.max(c.height,p.height),y=(0,l.pipe)((0,l.prop)("items"),l.length,(0,l.equals)(0));return Wh({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=Wh({},t,{items:(0,l.reject)(Zh,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 tb(f)},ib=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),ab=[Ge.FilteredEntitiesViewFacet,Ge.ActivitiesViewFacet,Ge.ProfileStatsFacet,Ge.FilteredSavedSearchesFacet],ob=(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=ab.includes(a.component)?8:4;return Wh({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function sb(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){lb(e,t,r[t])}))}return e}function lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ub={BarChart:Ve.BAR,BarChartGrouped:Ve.BAR,BarChartHorizontal:Ve.BAR,LineChart:Ve.LINE,Map:Ve.MAP,Pie:Ve.PIE},cb=(e,t)=>Lt(e)?wt(e,t):e,pb=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=ub[r];return sb({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},db=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return sb({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"]))},yb=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return sb({},e,{value:[Wr,Br,$r.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:qr(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Lt(t)||!r?n:(n||[]).concat((i=r,{filter:$r.EQUALS,fieldName:"type",values:[i]}));var i},fb=["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"],Tb={"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:cb(n,r),filters:yb(a,n,r),chartType:Ve.BAR,component:Ge.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:cb(n,r),filters:yb(a,n,r),chartType:Ve.BUBBLE,component:Ge.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:Ge.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 sb({id:t,count:o,canRead:u,orderType:s,attributeUri:cb(r,p),filters:yb(a,r,p),component:Ge.DashboardFacet,title:i,showOthers:!0},pb(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:cb(n,r),filters:yb(a,n,r),chartType:Ve.MAP,component:Ge.DashboardFacet,title:i,geoUrl:fb[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 sb({id:t,count:o,canRead:l,attributeUri:cb(n,r),filters:yb(a,n,r),component:Ge.DashboardFacet,title:i,geoUrl:s,chartType:Ve.MAP,projection:"geoMercator"},pb(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.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:db(i),component:Ge.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:yb(n,null,a),component:Ge.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:$r.GTE,fieldName:"matches",values:["1"]}],component:Ge.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:Ge.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:Ve.CLOUD,component:Ge.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:Ve.TREE,component:Ge.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.NotificationInboxFacet,title:n||rn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ActivitiesViewFacet,title:n||rn().text("Activity log")}}},Eb=e=>({id:e,height:10}),mb=(0,l.pipe)((0,l.map)((e=>{const t=Tb[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),hb=e=>{if("0.1"===e.version){const t=mb(e.views),r=nb(Eb,e.layout,{columns:4});return{id:e.id,margin:0,layout:ib(r,t),views:t}}return e},bb=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=>bb(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Ob(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){vb(e,t,r[t])}))}return e}function vb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gb=Ob({},We,{OldMap:"com.reltio.plugins.entity.EntityMapView",OldTree:"com.reltio.plugins.entity.TreeView"}),_b=e=>e,Ab={[gb.Attributes]:_b,[gb.HierarchyTree]:_b,[gb.HierarchyPaths]:_b,[gb.RelationsTable]:_b,[gb.Relations]:e=>Ob({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[gb.SingleAttribute]:_b,[gb.Custom]:_b,[gb.AttributeTable]:_b,[gb.Map]:_b,[gb.OldTree]:e=>Ob({},e,{class:We.HierarchyTree}),[gb.OldMap]:e=>Ob({},e,{class:We.Map}),[gb.ImageAttribute]:_b,[gb.PotentialMatches]:_b},Nb=(0,l.pipe)((0,l.map)((e=>{const t=Ab[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Pb=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===We.Map?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Rb=(e,t)=>(t||[]).map((t=>Ob({},t,Pb(e,t.id)))),Sb=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return Ob({},t,{layout:Rb(t.views,e.newLayout)});if("0.1"===e.version){const r=Nb(e.views),n=nb(Pb(r),e.layout,{columns:4});return Ob({},t,{layout:ib(n,r),views:r})}return e},wb=(e,t)=>e.class===t||e["react-class"]===t,Ib=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(wb(t,We.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 wb(t,We.SingleAttribute)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(Nt(n))||t.some(Nt(n))}},Ub=(e,t)=>e.filter((e=>t.some((t=>wb(e,t))))).map((e=>{let{id:t}=e;return t})),Cb=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Lb=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),jb=e=>(0,l.pipe)((0,l.map)((e=>Cb(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function Db(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 Fb=(0,l.curry)(((e,t)=>bb(t).map((t=>(0,l.pipe)((0,l.map)((e=>Cb(e,t))),(0,l.reject)(l.isNil),l.head)(e))).filter(l.identity))),Mb=(0,l.either)((0,l.propEq)("label","D&B Connector"),(0,l.propEq)("label","D&B Connector")),xb=(0,l.propEq)("class",We.Custom),$b=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},Vb=(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=Rb(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=>Cb(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=Fb(e,t.layout);i=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>Cb(e,t.side))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("layout"))(e),[n,i]=(0,l.partition)(Mb,null==r?void 0:r.items),a=(0,l.pipe)(Fb(e),(0,l.filter)(xb))(Db({},r,{items:n})),o=[{id:"common",views:Fb(e,Db({},r,{items:i}))}];return a.length>0&&o.push({id:"D&B",views:a}),o}})(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=Sb(Db({},t,{views:a,version:"0.1"})),u=(0,l.pipe)(jb,(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})},Gb=(e,t)=>{if("scroll"===t.layout.layout){const r=Fb(e,t.layout),n=hb(Db({},t,{views:r,version:"0.1"}));return{class:Ye.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Ye.Dashboard,views:t.views,layout:t.layout,id:t.id}},Wb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},Bb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},Yb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},qb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},Hb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},Qb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},Kb=(e,t)=>{const r=Fb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Lb(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:Ye.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}},Jb=(e,t)=>({class:Ye.Graph,id:t.id}),Xb=(e,t)=>{const r=Fb(e,t.layout)[0];return{class:Ye.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},zb=e=>t=>!!(0,l.intersection)(e,t).length,Zb=(0,l.cond)([[zb(["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"]),()=>Gb],[zb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>Wb],[zb(["com.reltio.plugins.graph.GraphView"]),()=>Jb],[zb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>Bb],[zb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>Yb],[zb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>qb],[zb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>Hb],[zb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>Qb],[zb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>Kb],[zb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Xb],[l.T,()=>(0,l.always)(void 0)]]),eO=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)($b),(0,l.map)((t=>Vb(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand","workflow"])))(e);return{class:Ye.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:qe.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:qe.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=>Cb(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Ye.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>Cb(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=Vb(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Ye.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=bb(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 Zb(o)(t,i)};function tO(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){rO(e,t,r[t])}))}return e}function rO(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=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))},iO="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var aO;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(aO||(aO={}));const oO={[Ye.DQDashboard]:`${iO}DqDashboard.svg`,[Ye.Dashboard]:`${iO}Dashboard.svg`,[Ye.Graph]:`${iO}Graph.svg`,[Ye.RelationshipSearch]:`${iO}GraphSearch.svg`,[Ye.Interactions]:`${iO}Interactions.svg`,[Ye.PotentialMatches]:`${iO}PotentialMatches.svg`,[Ye.Profile]:`${iO}Profile.svg`,[Ye.NestedProfile]:`${iO}Profile.svg`,[Ye.ProfileActivityLog]:`${iO}ActivityLog.svg`,[Ye.Relationships]:`${iO}Relationships.svg`,[Ye.Sources]:`${iO}Crosswalk.svg`,[Ye.Search]:`${iO}Search.svg`,[aO.DashboardGroup]:`${iO}DashboardGroup.svg`,[aO.ProfileGroup]:`${iO}ProfileGroup.svg`,[aO.SearchGroup]:`${iO}SearchGroup.svg`,DEFAULT:`${iO}Default.svg`},sO=e=>oO[null==e?void 0:e.class]||oO.DEFAULT,lO=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Ye.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>tO({},e,{nestedRoute:`${t+1}`})))))),uO=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},cO=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?oO[aO.ProfileGroup]:null,pO=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===oO[Ye.Dashboard]||t===oO[Ye.DQDashboard]})),(0,l.always)(oO[aO.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===oO[Ye.Search]||t===oO[Ye.RelationshipSearch]})),(0,l.always)(oO[aO.SearchGroup])],[l.T,()=>null]])(e),dO=e=>(0,l.pipe)((0,l.chain)(nO),(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=>tO({},e,{entityTypes:e["entity-types"],screen:eO(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=lO(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:sO(r),screen:uO(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=eO(t,e);return{label:t.label,icon:cO(t)||pO(r)||sO(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function yO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fO=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},TO=e=>({id:e,height:10}),EO=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)(fO),(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=mb(((e,t)=>{const r=bb(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){yO(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=nb(TO,t.layout,{columns:4});return{views:r,layout:ib(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function mO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hO=(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))),bO=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,OO=e=>(0,l.pipe)((e=>Lb(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=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){mO(e,t,r[t])}))}return e}({},t,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,["action"]))})))(e),vO=(0,l.unless)((e=>!!e&&(e.startsWith("http:")||e.startsWith("https:"))),(0,l.always)(null)),gO=(0,l.pipe)(hO("top-logo"),vO),_O=(0,l.prop)("showLookupCode"),AO=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>Cb(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=>Cb(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=>Cb(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=>Cb(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=>Cb(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=>Cb(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=>Cb(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.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>Cb(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)(hO("default-perspective"),(0,l.ifElse)(bO,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=(e=>(0,l.pipe)((0,l.map)((e=>Cb(e,"com.reltio.plugins.ui.AttributesSorting"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("strategy"))(e))(e),y=OO(e),f=(e=>hO("checkUser",e))(e),T=(e=>hO("checkIdle",e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>Cb(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),m=(e=>(0,l.pipe)((0,l.map)((e=>Cb(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),h=void 0===(b=_O(m))||b;var b;const O=null===(t=jb(e))||void 0===t?void 0:t.showEntityId,v=(e=>hO("preview",e))(e),g=gO(e),_=(e=>hO("topBackgroundColor",e))(e),A=(e=>(0,l.pipe)((0,l.map)((e=>Cb(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);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:h},validate:{levels:a,validateReadMode:o},masks:0===Object.keys(A).length?void 0:A,attributePresentations:u,attributesSorting:d,workflow:c,defaultRoute:p,customScripts:y,checkUser:f,checkIdle:T,showSwitchToClassic:E,showEntityId:O,preview:v,logo:g,headerColor:_}},NO=e=>({layout:dO(e),pivoting:EO(e),properties:AO(e)});var PO=r(58697),RO=r.n(PO);function SO(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){wO(e,t,r[t])}))}return e}function wO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IO=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}_${RO()()}`;return n[e.id].push(t),i=!0,SO({},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]++,SO({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};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}let LO={};const jO=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(LO[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))}LO=UO({},LO,{[a]:UO({},LO[a]||{},{worker:i})})}else i=LO[a].worker,LO[a].innerText&&t({task:{action:Je.SET_HTML,params:{html:LO[a].innerText}},worker:i,config:r}),i.removeEventListener("message",LO[a].onWorkerMessage);return i&&(LO[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||(LO[a].innerText=n.params.html)}},i.addEventListener("message",LO[a].onWorkerMessage)),i},DO=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),kO=(0,l.flip)(DO),FO=(0,l.curry)(((e,t)=>{if(null==t)return"";if("string"!=typeof t&&(t=String(t)),e&&t){const{thousandSeparator:r="",decimalSeparator:n=".",prefix:i="",suffix:a=""}=e,[o,s]=t.split(".");t=i+o.replace(/\B(?=(\d{3})+(?!\d))/g,r)+(s?n+s:"")+a}else!e&&t&&(t=rn().number(t));return t})),MO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?rn().number(e,"0,0.0a").toUpperCase():rn().number(e,"0,0"):""},xO=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let $O=!0;const VO=e=>$O=e,GO=(e,t)=>e!==t&&t?$O&&e?`${t} (${e})`:t:e,WO=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),BO=(e,t,r)=>{const n=WO(e,t,r);return GO(r,n)},YO=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),qO=(0,l.complement)(YO),HO=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),QO=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)},KO=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(qO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),JO=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case Ze.TYPE_NUMBER:case Ze.TYPE_FLOAT:case Ze.TYPE_DOUBLE:case Ze.TYPE_LONG:case Ze.TYPE_INT:case Ze.TYPE_COUNT:return t&&FO(o,t);case Ze.TYPE_BOOLEAN:case Ze.TYPE_BOOLEAN_RADIO:case Ze.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?rn().text("Yes"):rn().text("No");case Ze.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Du(t)?ku(t):rn().date(t,s));case Ze.TYPE_ACTIVENESS_DATE:case Ze.TYPE_LOCAL_DATE:return(t=t)&&(Du(t)?ku(t):rn().date(t,s));case Ze.TYPE_TIMESTAMP:return(t=t)&&(Du(t)?ku(t):rn().date(isNaN(t)?t:Number(t),u));case Ze.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Ze.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Ze.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)?GO((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),XO={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)"},zO=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()}},ZO=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}}throw r})))),ev=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}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(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)((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),zO,ZO);return{request:(e,n)=>{const i=s(fetch),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))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},tv="__metadata",rv=(e=>{const t=[tv,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),nv=(0,l.set)(rv),iv=(0,l.view)(rv),av=nv(Xr.NEW),ov=nv(Xr.REMOVED),sv=nv(Xr.EDITED),lv=nv(Xr.IGNORED),uv=(0,l.pipe)(iv,(0,l.equals)(Xr.REMOVED)),cv=(0,l.pipe)(iv,(0,l.equals)(Xr.NEW)),pv=(0,l.pipe)(iv,(0,l.equals)(Xr.EDITED)),dv=(0,l.pipe)(iv,(0,l.complement)(l.isNil)),yv=(0,l.pipe)(iv,(0,l.equals)(Xr.IGNORED)),fv=(0,l.omit)([tv]),Tv=(e,t)=>e===tv?void 0:t;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=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=mv(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},hv=(e,t)=>mv((0,l.propEq)("nodeId",t),e),bv=(e,t)=>mv((0,l.pathEq)(["entity","uri"],t),e),Ov=(e,t)=>{const r=hv(e,t);return r.length>1?r[r.length-2]:null},vv=(e,t)=>{const r=hv(e,t);return r.length>0?r[r.length-1]:null},gv=(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=>gv(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},_v=()=>{},Av=(e,t)=>{let{parent:r,nodeProcessing:n=_v}=t;n(e,r),e.children&&e.children.forEach((t=>Av(t,{parent:e,nodeProcessing:n})))},Nv=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ue.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 Ue.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 Ue.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){Ev(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})}}},Pv=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&&Av(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ue.addingChild||r.editingMode===Ue.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Nv({node:r,connection:n,isReversed:i}),s=mT({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ue.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Nv({node:r,isReversed:i,connection:n}),l=s?vT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):OT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Rv=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=Rv(r,t);if(e)return e}return!1},Sv=(0,l.curry)(((e,t)=>{const r=(0,l.map)(Sv(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),wv=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>Rv(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:Sv(e,n.root)}}));return(0,l.pipe)(r,n)(t)},Iv={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Uv={asc:"asc",desc:"desc"},Cv=Iv.entityLabel,Lv=Uv.asc,jv=(0,l.always)(0),Dv=e=>{let{sortField:t=Cv,sortOrder:r=Lv,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Iv.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return nN.strings.sort(t,a,o)})(n,r);case Iv.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return nN.strings.sort(e,i,a)})(r);default:return jv}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},kv=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Uv)),l.identity,(0,l.always)(Lv))),Fv=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Iv)),l.identity,(0,l.always)(Cv)));var Mv=r(91104);let xv;const $v=(e,t)=>(xv||(xv=Mv.createClient({key:t})),new Promise((t=>{xv.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)}))}))),Vv=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Gv=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(ss).flatMap((e=>{let r;return e.type==t&&(r=[Vv(e)]),(0,l.is)(Object,e.value)&&(r=(r||[]).concat(Gv(e.value,t))),r})),Wv=e=>e&&e.length>0,Bv=(e,t)=>[].concat(e&&e.attributes?Gv(e.attributes,t):[]).filter(l.identity);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,n,i,a)=>{if(e&&e.type){const t=Cr(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){Yv(e,t,r[t])}))}return e}({},e,{attributes:{[i]:[n]}}));const a=(t.geoLocationAttributes||[]).map((t=>{return r=Bv(e,t.latitude),n=Bv(e,t.longitude),Wv(r)&&Wv(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(Wv(t)&&t[0].value&&Wv(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?$v(n.label,a).catch((()=>null)):Promise.resolve(null)},Hv=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=Cr(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 qv(a,o,e,s,u,r).then((e=>!e&&a.label&&""!==a.label?$v(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)))},Qv=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=Cr(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(ar(e,r.latitude,t.type)&&ar(e,r.longitude,t.type)){const e=Bv(t,r.latitude),n=Bv(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))},Kv=(e,t,r)=>Promise.all([Qv(e,t),Hv(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 Jv(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){Xv(e,t,r[t])}))}return e}function Xv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zv=(e,t)=>t.values.map(ao(e,t.entityTypeUri)),Zv=(e,t,r)=>Ks(t.fieldName,r)||ar(e,wt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),eg=(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?GO(e,t):e}),r)},tg=(0,l.path)(["attrType","label"]),rg=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Jv({},e,{[t]:!0})),{});e[r]=e[r]?Jv({},e[r],n):n}return e}),{}),ng=(0,l.pipe)((0,l.prop)("values"),E),ig=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",En.type.name)),ag=e=>e.type===lg.NUMERIC_RANGE_FACET,og=e=>e.type===lg.DATE_RANGE_FACET,sg=(0,l.either)(ag,og),lg={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},ug=e=>{switch(null==e?void 0:e.name){case En.type.name:return lg.ENTITY_TYPE_FACET;case En.createdBy.name:case En.updatedBy.name:case En.sourceSystems.name:case En.tags.name:case En.roles.name:case En.matchRules.name:case En.MLRecommendedMatch.name:return lg.WITH_DROPDOWN_CHECKBOXES_FACET;case En.createdTime.name:case En.updatedTime.name:case En.startDate.name:case En.endDate.name:return lg.DATE_RANGE_FACET;case En.matches.name:case En.matchScore.name:return lg.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return lg.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return lg.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return lg.DATE_RANGE_FACET;default:return lg.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},cg=(0,l.pipe)(Zv,ug),pg=(0,l.pipe)((0,l.path)(["attrType","type"]),Tr),dg=(0,l.cond)([[ag,(0,l.always)($r.IN_RANGE)],[og,(0,l.always)($r.WITHIN)],[(0,l.allPass)([pg,e=>e.values.length>=2]),(0,l.always)($r.EXISTS)],[l.T,(0,l.always)($r.EQUALS)]]),yg=(0,l.cond)([[og,(0,l.prop)("values")],[ag,(0,l.prop)("values")],[pg,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 fg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tg=(0,l.pipe)((0,l.path)(["attrType","type"]),ur),Eg=(0,l.pipe)((0,l.path)(["attrType","type"]),dr),mg=(0,l.pipe)((0,l.prop)("attrType"),Xs),hg=(0,l.pipe)((0,l.prop)("attrType"),Js),bg=e=>t=>t.values.map((t=>Cr(e,t).label)).join(" , "),Og=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),vg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(rn().number),Og)),(0,l.join)(","))(e.values);return`${tg(e)}: ${t}`},gg=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Og)),(0,l.join)(","))(e.values);return`${tg(e)}: ${t}`},_g=e=>t=>`${tg(t)}: ${zv(e,t).join(", ")}`,Ag=e=>t=>{const r=eg(e,t);return`${tg(t)}: ${r.join(", ")}`},Ng=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[hg,bg(e)],[Eg,vg],[Tg,gg],[mg,_g(e)],[l.T,Ag(t)]]),r))),Pg=(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){fg(e,t,r[t])}))}return e}({},t,{attrType:Zv(e,t,n)}))),Ng(e,r))(t),Rg=new RegExp(`^${rn().text("Search")}`),Sg=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Pg(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Rg,"",u)]},wg=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Kr),Ig=e=>(e=>wg.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]=Mu(t);return e.replace(r,i).replace(n,a)}),e))(e),Ug=(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}`})),Cg={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Lg=e=>[Cg.geoPolygon,Cg.onMapMove].includes(e),jg=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Dg=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},kg=(e,t)=>Lg(e)?t.map(jg):[Dg(t)],Fg=e=>Lg(e)?rn().text("Geo Polygon"):rn().text("Geo Location"),Mg=e=>{switch(e){case Cg.geoLocation:return"geoLocation";case Cg.geoPolygon:case Cg.onMapMove:return"geoPolygon"}},xg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},$g=e=>rn().text(e),Vg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[$r.EQUALS]:"=",[$r.NOT_EQUALS]:"≠",[$r.STARTS_WITH]:"*",[$r.MISSING_VALUE]:rn().text("missing value"),[$r.HAS_ALL]:rn().text("has all"),[$r.IN_RANGE]:rn().text("in range"),[$r.FULL_TEXT]:rn().text("full text"),[$r.EXISTS]:rn().text("exists"),[$r.COUNT_EQUALS]:`${rn().text("count")} =`,[$r.COUNT_NOT_EQUALS]:`${rn().text("count")} ≠`,[$r.COUNT_LT]:`${rn().text("count")} <`,[$r.COUNT_LTE]:`${rn().text("count")} <=`,[$r.COUNT_GT]:`${rn().text("count")} >`,[$r.COUNT_RANGE]:rn().text("count range"),[$r.LT]:"<",[$r.LTE]:"<=",[$r.GT]:">",[$r.GTE]:">=",[$r.IN_FILE]:rn().text("in file"),[$r.NOT_IN_FILE]:rn().text("not in file"),[$r.CONTAINS]:"~",[Vr.LIST_EQUALS]:"=",[Vr.NOT_LIST_EQUALS]:"≠",[Vr.LIST_EQUALS_CASE_SENSITIVE]:"=",[Vr.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||rn().text(e.toLowerCase())},Gg=e=>({type:xg.operator,text:e}),Wg=e=>({type:xg.operator,text:$g(e)}),Bg=e=>({type:xg.attributeLabel,text:e}),Yg=e=>({type:xg.specialAttributeLabel,text:e}),qg=e=>({type:xg.attributeFilter,text:Vg(e)}),Hg=e=>({type:xg.attributeValue,text:e}),Qg=e=>({type:xg.entityTypeLabel,text:e}),Kg=()=>({type:xg.space,text:" "}),Jg=()=>({type:xg.bracket,text:"("}),Xg=()=>({type:xg.bracket,text:")"}),zg=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Zg=(0,l.curry)(((e,t)=>t.map(zg(e)))),e_=(0,l.curry)(((e,t,r)=>[e,...r,t])),t_=e_(Jg(),Xg()),r_=e_(Kg(),Kg()),n_=(0,l.curry)(((e,t)=>[e,...t])),i_=e=>n_(Qg(e)),a_=e=>n_(Qg(`${e}: `)),o_=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Tu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=yu(s),a=fu(s);!r&&t&&n&&(i.push(Jg()),r=!0),i.push(o),r&&a&&(i.push(Xg()),r=!1);const l=e?Wg(s):Gg(s);i.push(...r_([l]))}else i.push(o),r&&(i.push(Xg()),r=!1)}return i}},s_=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),l_=(0,l.pipe)(o_({localizable:!1}),s_),u_=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},c_=e=>{let{data:t,values:r,filter:n}=e;return t&&sc({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},p_=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(c_)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),d_=(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)&&tr(e.data.attrType)})(e)&&[$r.HAS_ALL,$r.EQUALS,$r.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:er((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})))),QO),y_=(e,t)=>(0,l.pipe)(d_,KO(t))(e),f_=(0,l.pathEq)(["data","fieldName"],En.type.name),T_=(0,l.path)(["data","entityTypeUri"]),E_=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),m_=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Ko(e)),attributes:(0,l.filter)((0,l.pipe)(T_,(0,l.anyPass)([l.isNil,Ko(e),r=>{const n=(t.entityTypes||[]).filter(Ko(e));return(n.length>1?Fr(e,n):null)===r&&!!Cr(e,r)}])))})(t))))),h_=e=>(0,l.pipe)((0,l.prop)("filter"),eu,(0,l.equals)(e)),b_=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Ks(n.fieldName)||n.attrType,s=Cu(o,i),u=JO({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>tr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?GO(a.lookupCode,a.value):BO(r,er(o),a)],[()=>Xs(s),()=>ao(e,n.entityTypeUri,a)],[()=>zs(s),()=>So(e,a)],[()=>il(s),()=>Uo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>dr(c)||Tr(c)),Su),Hg)()})),O_=(e,t,r,n)=>{const i=b_(e,t,r,n.data,n.filter);return(0,l.cond)([[h_(0),(0,l.always)([])],[(0,l.both)(h_(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[Kg(),i(r),{type:xg.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Kg(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Zg({type:xg.punctuationMark,text:", "}))(t)]}]])(n)},v_=(e,t)=>{const r=!!Ks(e.data.fieldName);return(0,l.pipe)(u_,r?Yg:Bg)(e,t)},g_=(e,t,r,n,i)=>[v_(n,i),Kg(),qg(n.filter),...O_(e,t,r,n)],__=(0,l.addIndex)(l.map),A_=(0,l.propEq)("length",1),N_=(0,l.propSatisfies)((0,l.lt)(1),"length"),P_=(0,l.complement)(l.isEmpty),R_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(hu,(0,l.filter)(c_),bu,(0,l.map)((n=>({operand:g_(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,o_()))(n)},S_=(0,l.pipe)(R_,l.flatten),w_=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Fd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=R_(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(i_),(0,l.pipe)(s(a_),(0,l.unless)((()=>A_(u)||i),t_)))(u)},I_=(e,t,r,n)=>(0,l.pipe)(hu,(0,l.filter)(p_),bu,__(((n,i,a)=>({operand:w_(e,t,r,n,A_(a)),operator:n.operator}))),o_(),l.flatten)(n),U_=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),o_(),l.flatten),C_=e=>{let{searchType:t,values:[r]}=e;return kg(t,r).join(", ")},L_=(e,t,r,n,i,a)=>{const o=(e=>e?[Yg(e.isRawFilter?rn().text("Raw filter"):rn().text("Search")),...r_([qg($r.EQUALS)]),Hg(`"${e.value}"`)]:[])(i),s=(e=>e?[Yg(Fg(e.searchType)),Kg(),Hg(C_(e))]:[])(a),u=(0,l.pipe)(I_,(0,l.when)((e=>N_(e)&&(P_(o)||P_(s))),t_))(e,t,r,n);return U_([o,s,u])},j_=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),D_=(0,l.pipe)(L_,j_),k_=(0,l.has)("attributes"),F_=Array.isArray,M_=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),x_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=$_(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)(M_(a))),t_),(0,l.concat)(r_([Gg(o)]))))(s)},$_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return k_(n)?x_(e,t,r,n,i):F_(n)?n.reduce(((n,a)=>n.concat($_(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(r_([Gg(n.operator)])))(g_(e,t,r,n,i))},V_=(e,t,r,n,i)=>(0,l.pipe)($_,l.flatten)(e,t,r,n,i);function G_(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){W_(e,t,r[t])}))}return e}function W_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const B_=(0,l.complement)(f_),Y_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(f_),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(T_),(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}},q_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=Y_(t);return(r||n)&&Eu(t)},H_=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(q_)),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(f_).some((0,l.propEq)("filter",$r.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}=Y_(r);if(q_(e))t.push(G_({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(B_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(f_,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(T_,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(B_),entityTypes:n,operator:i?a:e.operator,id:RO()()}}));t.push(...n)}var a;return t})(t))),[]))),Q_={[$r.EQUALS]:$r.ON,[$r.IN_RANGE]:$r.WITHIN,[$r.GTE]:$r.AFTER,[$r.GT]:$r.AFTER,[$r.LTE]:$r.BEFORE,[$r.LT]:$r.BEFORE},K_=(0,l.curry)((e=>Q_[e]||e)),J_=(0,l.curry)(((e,t)=>{switch(e){case $r.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case $r.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),X_=(0,l.pipe)((0,l.path)(["data","attrType","type"]),ur),z_=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>G_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return X_(e)?(0,l.evolve)({filter:K_,values:J_(t)},e):e}))})))})),Z_=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),ju),(0,l.map)(Mu))}),eA=(0,l.map)((0,l.cond)([[X_,Z_],[l.T,l.identity]])),tA=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),H_,m_(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")),eA)})),z_,(0,l.reject)(E_))(r)));function rA(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){nA(e,t,r[t])}))}return e}function nA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iA=(e,t)=>({data:{uri:Lt(e.fieldName)?wt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||dg(e),id:RO()(),values:yg(e)}),aA=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Ks(a,t,r)||ar(e,i);if(!s)return null;if(Yt(s))return rA({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Fd(e,{type:o}),i=(ir(e,wt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return rA({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),oA=(0,l.curry)(((e,t,r,n)=>tA(aA,e,n,t,r)));function sA(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){lA(e,t,r[t])}))}return e}function lA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uA=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},cA=e=>"rdmLookups.not.resolved"===e?En.notResolved.name:e,pA=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Yr?$r.IN_RANGE:qr(a),u=cA(n),c=Ks(u)||ar(e,i),p=(0,l.cond)([[()=>iu(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>sA({},e,{filename:xO(e)}))))],[()=>Tr(null==c?void 0:c.type),(0,l.map)(le)],[e=>ru(s)&&!Array.isArray(e[0])&&!ur(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:RO()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Yr?"and not":"and",filter:s,values:p}})),dA=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(pA(e,Fr(e,i)));return[{id:RO()(),operator:"or",attributes:a,entityTypes:i}]})),yA=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),fA=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([yA("from"),yA("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,()=>[]]]),TA=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return sA({},r,{values:fA(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Bs(e.fieldName,n):e.fieldName})},EA=(e,t)=>{if((0,l.has)("children")(e)){const r=TA(e,t);return e.children.reduce(((e,n)=>(e.push(EA(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return TA(e,t)},mA=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(TA(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(sA({fieldName:e.fieldName},TA(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(EA,l.flatten)],[l.T,TA]]),hA=(0,l.pipe)((0,l.map)(mA),l.flatten),bA=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},OA=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=dA(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:hA(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>sA({},t,{type:cg(e,t)}))).map((e=>sA({},e,{values:sg(e)?bA(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 iA(r,t)})),operator:"or",id:RO()(),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=>({[cA(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[sA({},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 oA(e,t,r,p)},vA=(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)(ng),(0,l.partition)(ig))(t),i=n.map((t=>rA({},t,{type:cg(e,t)}))).map((e=>iA(e))),a=r.values||[];return[{attributes:i,operator:"or",id:RO()(),entityTypes:a}]})(e,a);return oA(e,t,r,o)})(e,t,r,n):OA(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},gA=e=>"2.0"===e.version?e.keyword:uA(e),_A=e=>(0,l.pathEq)(["object","uri"],e),AA=(e,t)=>(0,l.pipe)((0,l.find)(_A(e)),(0,l.prop)("object"))(t),NA=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"),_A(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=AA(r.match,t)||n[r.match];return i?{label:Ed((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return io(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)},PA=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),RA=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),SA=(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:Ed((0,l.prop)("label",o)),matchRules:i.concat(a).map((function(t){return io(e,o.type,t)||{label:t,uri:t}}))}})))(t),wA=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)},IA=(0,l.path)(["object","uri"]),UA=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},CA=e=>e.getValue(),LA=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=LA(n[e],t),!r);e++);return r},jA=(e,t)=>{const r=[],n=(0,l.pipe)(CA,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(jA,[t]),a);return r.push.apply(r,o),r};function DA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kA(e,t,r[t])}))}return e}function kA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FA=(e,t)=>!!e[t],MA=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},xA=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||[]])},$A=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return DA({},t,{[r.uri]:DA({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:xA(null==o?void 0:o.parents,n),children:xA(null==o?void 0:o.children,i),values:xA(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},VA=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Cr(r,t)||ci(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return Mo(r,n,i).flatMap($o).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>ar(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=$A({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>$A({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},GA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!mt(e.uri)&&_t(e.type)&&_t(t)&&!t.startsWith(e.type))(n,t))return e;const i=gs(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(ss),(0,l.map)(MA))(i);return $A({structure:e,attrType:e[t].attrType,values:a})}),t)},WA=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 FA(e,r)}));return r||n?t.filter(ss).reduce(((e,t)=>WA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return FA(t,e.type)?$A({structure:t,attrType:t[e.type].attrType,values:[MA(e)]}):t}},BA=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?DA({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},YA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=gs(i,n,r)||[];return a.length?$A({structure:t,attrType:t[r].attrType,values:a.filter(ss).map(MA)}):t},qA=(e,t,r)=>{const n=Ot(e),i=Ot(t);return n===i?((e,t)=>{const r=kt(t),n=kt(e);return Nt(n,r)||((e,t)=>jt(e)&&!jt(t)&&Nt(t,e))(n,r)})(e,t):!(!r||!Dt(t))&&UE(r,i).includes(n)},HA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},QA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?wE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return qA(r,t,o)}))},KA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>KA(e,t,r)))))},JA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&HA(n,e)}},XA=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ot(n),c=IE(u,o,i,a),p=KA("children",t,l),d=KA("parents",t,l),y=p.flatMap((e=>KA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return qA(t,n,c)})).map((t=>JA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return qA(n,t,c)||Ot(t)!==u&&qA(t,n,c)})).map((t=>JA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=KA("children",t,e).map((e=>{let{attrType:t}=e;return t.uri}));return e.values.filter((e=>{let{uri:t}=e;return f.some((e=>{let{uri:n,type:i}=e;return r.includes(i)&&qA(n,t,c)}))})).map((t=>JA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return qA(t,n,c)})).map((e=>JA(r,n,e,s))),...T,...E,...f]},zA=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=JO({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=>fd(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Kt,()=>a(n)],[tr,()=>(e=>{const r=o(e),n=er(t);return Bl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return BO(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},ZA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:$r.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(eN(r,t)):i.push(tN([t],r)),i},eN=(e,t)=>{const r=qt(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=Kt(i)?eN(i,t[r]):[tN(t[r],i)];return e.push(...a),e}}),[])},tN=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Zt(t.uri),filter:t.type===Ze.TYPE_BLOB?$r.FULL_TEXT:$r.EQUALS,values:e}:{fieldName:Zt(t.uri),filter:$r.MISSING_VALUE},rN={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},nN={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=6495.js.map
|