@reltio/remotes 1.4.1091 → 1.4.1096

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/1083.js +1 -1
  2. package/6974.js +1 -1
  3. package/9497.js +1 -1
  4. package/package.json +1 -1
package/1083.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[1083],{16299:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Rs,PY2:()=>mn,Ng6:()=>mt,YJ7:()=>cn,NlI:()=>en,Xt7:()=>ft,wfT:()=>zn,EMD:()=>$n,HAc:()=>Tt,PEf:()=>gn,oA3:()=>Mn,$XE:()=>Lt,eWf:()=>On,q7e:()=>Et,KVe:()=>Zn,WVQ:()=>Lr,oZZ:()=>ui,bNA:()=>ci,Rjq:()=>pi,G39:()=>An,yn8:()=>wt,N0y:()=>St,dZX:()=>Dt,bQt:()=>yi,oS0:()=>Mt,lL_:()=>sn,Nsj:()=>dn,psV:()=>un,xPW:()=>hn,pyR:()=>qn,p8l:()=>Gn,Wkf:()=>yt,zHr:()=>dt,NIO:()=>pt,$26:()=>cO,Esk:()=>Dn,s9T:()=>Rt,MEy:()=>lu,j5E:()=>Zr,vAw:()=>xn,NMQ:()=>Fn,mNm:()=>Yn,rwv:()=>si,s_5:()=>Qn,RgZ:()=>Wn,unl:()=>li,Qy0:()=>di,pYu:()=>Ln,wIJ:()=>DO,GFH:()=>bt,S91:()=>Nn,p3$:()=>mi,wSh:()=>Z,BDP:()=>Pi,pGS:()=>Bn,ARY:()=>$t,XGc:()=>Xn,fO_:()=>$r,wwy:()=>_t,_XL:()=>pn,j2V:()=>ei,dMV:()=>Kn,NBX:()=>Ug,OXy:()=>Vt,BXd:()=>It,CJB:()=>ni,lXI:()=>Ft,nqG:()=>Ti,C68:()=>_n,yxQ:()=>fi,Yj_:()=>At,D25:()=>vt,ZIY:()=>jt,Tl4:()=>VO,lwr:()=>vn,NkU:()=>ti,Rtp:()=>Jn,YGx:()=>Ut,uTS:()=>Hn,IYE:()=>Vn,PiC:()=>oi,tJI:()=>ht,fDt:()=>Ot,cNQ:()=>ri,SwE:()=>jn,ZHR:()=>ai,lD1:()=>Rn,lVm:()=>Ct,vnX:()=>jb,$x5:()=>kb,_R1:()=>Lb,wUm:()=>Db,z7V:()=>Ei,dC6:()=>Pt,MBD:()=>gt,GmF:()=>ia,cKm:()=>kt,iP_:()=>bn,NVC:()=>Nt,tPT:()=>Zs,tZe:()=>Up,kRE:()=>Ly,psB:()=>Dy,X0$:()=>zs,zE1:()=>ll,Wm5:()=>Gs,vyX:()=>Zu,wLZ:()=>el,W4V:()=>se,EtK:()=>Ts,Wtd:()=>Xs,asT:()=>Yg,kGs:()=>ge,ewt:()=>pT,O_f:()=>tu,sOy:()=>et,Tde:()=>dr,LMI:()=>ku,skb:()=>Iv,sPt:()=>Pu,sH1:()=>Su,RPM:()=>aE,h27:()=>qu,Uqd:()=>zu,xG:()=>Wv,Z2f:()=>Zh,fgW:()=>cv,I69:()=>jv,ZxB:()=>Fv,mdt:()=>eE,Qbq:()=>Fh,rny:()=>Vi,UEY:()=>Na,Q0T:()=>Aa,Lyr:()=>Ca,sBn:()=>_a,itK:()=>ba,H9$:()=>ga,KPc:()=>va,zos:()=>Oa,ELQ:()=>La,dZs:()=>ua,Cz4:()=>la,z_L:()=>Ia,fGe:()=>sa,iuF:()=>ma,Wib:()=>ha,Hn0:()=>Ua,obS:()=>Da,E$L:()=>ca,XUh:()=>Ea,Qp_:()=>fa,_jk:()=>pa,sKE:()=>da,WmG:()=>Ta,QKx:()=>Sa,Oik:()=>Pa,s0A:()=>ya,o9m:()=>Ra,MCd:()=>wa,RsS:()=>Qu,tGK:()=>Il,lIv:()=>ul,Vg3:()=>Hi,mkC:()=>ji,xv5:()=>Ji,a14:()=>Fi,yv0:()=>Ki,Zm0:()=>ki,Nxd:()=>Di,$mM:()=>Qi,ifj:()=>jr,NWi:()=>hb,xr3:()=>mb,wNf:()=>$l,iJH:()=>bb,d89:()=>Ui,Edd:()=>Ci,Z5t:()=>Li,uGe:()=>wi,UoR:()=>Si,xvW:()=>Eb,$qe:()=>Tb,yPM:()=>oa,$cp:()=>sl,vKJ:()=>al,AID:()=>Sf,B1H:()=>wg,b7X:()=>Dh,$uE:()=>_e,keo:()=>kh,C_p:()=>GE,G27:()=>$m,JA0:()=>gy,b3T:()=>ve,oC6:()=>be,_Zs:()=>Oe,epC:()=>Ne,YYG:()=>Ae,f_2:()=>Ay,w3l:()=>pg,QHB:()=>Mm,Jso:()=>hg,RXH:()=>Rm,Vr9:()=>Hm,lMm:()=>Sh,BlA:()=>e_,fmQ:()=>ss,yRD:()=>eg,NcL:()=>HE,QK6:()=>de,ymd:()=>fp,JV_:()=>Qy,XiW:()=>qf,Yrx:()=>py,GPx:()=>Js,gjI:()=>Ks,vlo:()=>wT,E_P:()=>KT,aAL:()=>tp,NBq:()=>ls,wp9:()=>ZT,DsR:()=>Kc,MPc:()=>Lf,gWE:()=>Df,DT_:()=>jf,ipn:()=>Ff,ORg:()=>Ai,_wz:()=>kf,RYR:()=>lT,PP2:()=>fy,wS7:()=>ob,cBQ:()=>Dc,pBq:()=>yf,DsO:()=>ee,X78:()=>Ky,xZs:()=>Wy,YFy:()=>yy,Gmt:()=>xy,K$w:()=>Fy,DSj:()=>rp,k9j:()=>kc,ww$:()=>tl,WVU:()=>ky,hxF:()=>Ys,nwO:()=>n_,Mzk:()=>wc,aFF:()=>Wh,HRH:()=>pu,EZK:()=>Wp,Kxm:()=>Mp,Z9i:()=>_E,CrF:()=>wy,DNd:()=>ka,vUy:()=>Kg,lJh:()=>fu,zHo:()=>Tu,sEJ:()=>Lg,UO$:()=>bf,zeJ:()=>hr,dLR:()=>bs,JQy:()=>As,XtP:()=>ms,Ug0:()=>Jr,A1W:()=>jh,sw:()=>Gp,nv3:()=>Pb,JgD:()=>Rb,nve:()=>Dg,SkP:()=>Ns,SAs:()=>Tf,PWK:()=>jo,IM5:()=>hs,Mfk:()=>Lh,mB6:()=>rb,p6d:()=>w,o0x:()=>U,ufS:()=>Bh,k7L:()=>qh,mrB:()=>I,ncP:()=>He,Zmi:()=>We,hm5:()=>Be,ECL:()=>xr,vPL:()=>qp,qmL:()=>QT,hXd:()=>Wi,OCS:()=>Yi,p2l:()=>Ss,qF1:()=>Tp,_X$:()=>Ep,yj2:()=>IO,bzh:()=>nE,k66:()=>Bo,kiP:()=>oo,pSg:()=>ce,kz_:()=>hy,H_U:()=>Qo,t9e:()=>Wa,j2$:()=>Cp,PFL:()=>tr,aJ3:()=>tO,To9:()=>yr,wpo:()=>dd,ADq:()=>hE,UUb:()=>EE,tQX:()=>mE,xy8:()=>ar,EUG:()=>br,AFK:()=>at,X3M:()=>mr,WN0:()=>qo,kDl:()=>Os,uDV:()=>qT,IhQ:()=>gs,R$r:()=>HT,w80:()=>_o,Pfu:()=>Va,Gtj:()=>gl,fyF:()=>vl,kkq:()=>Yo,u5q:()=>Ke,O$n:()=>cd,ptG:()=>pd,f4_:()=>tm,uap:()=>em,d7q:()=>cy,liG:()=>Ty,$oF:()=>uy,avf:()=>bT,DiQ:()=>hT,cfX:()=>mT,vD3:()=>vT,Qrb:()=>ET,EJQ:()=>OT,HWy:()=>TT,y6v:()=>fT,JUW:()=>Ny,GtP:()=>pm,_kX:()=>xa,u1e:()=>Ma,sJj:()=>$h,CJp:()=>um,uKF:()=>Mh,wo0:()=>Cy,s5:()=>xo,cwx:()=>Fo,Y6b:()=>Zd,TTx:()=>Vy,UtR:()=>ey,HaQ:()=>Gy,E6I:()=>Sy,Won:()=>ry,vTU:()=>Xd,Nsy:()=>ed,KMQ:()=>Gh,Do$:()=>id,CSV:()=>Us,TMe:()=>ty,l1V:()=>mu,VQ1:()=>vu,z7d:()=>IT,Xaq:()=>Jo,Sj8:()=>zg,PJj:()=>Pl,k3T:()=>zr,PjQ:()=>Ri,s7l:()=>gc,GGR:()=>NT,j5q:()=>_T,DnY:()=>bc,RY5:()=>$T,Px$:()=>uT,KPC:()=>Rg,NIY:()=>Pc,HvW:()=>Ac,Fof:()=>Ya,BTI:()=>od,uie:()=>Kp,ChB:()=>Yp,q27:()=>fd,fAQ:()=>Zy,XkT:()=>hc,lrH:()=>ef,nt9:()=>Br,XH8:()=>ud,XH2:()=>Xr,jFi:()=>ld,qhs:()=>go,wwR:()=>ad,Uk3:()=>ot,ev7:()=>Ig,RB9:()=>vy,iFp:()=>sE,e$p:()=>uE,PcX:()=>cE,SpP:()=>lE,R6_:()=>nO,CY1:()=>pO,Ajk:()=>fc,Yiz:()=>yc,FK9:()=>sc,UOo:()=>Qh,aTW:()=>$y,uug:()=>Ml,P$2:()=>fO,XS2:()=>Ul,Hyb:()=>Xl,d3Y:()=>nc,Klp:()=>ac,WxZ:()=>TO,Gzu:()=>Eu,ZOr:()=>mc,uqV:()=>Hd,Pm4:()=>re,nVD:()=>GT,dED:()=>sy,P2h:()=>oy,jrr:()=>ro,mmY:()=>io,T6O:()=>Ho,h6J:()=>Sp,hM2:()=>vg,XR6:()=>X,jmz:()=>BT,IHt:()=>YT,NZI:()=>gE,wdF:()=>Xy,kgP:()=>zy,ZYI:()=>cp,QXK:()=>ml,efz:()=>hl,Q5d:()=>El,Ysv:()=>bl,UWq:()=>LT,ocC:()=>CT,io3:()=>Hr,Sbt:()=>No,roS:()=>Ao,Ww1:()=>Ro,QaS:()=>Ic,ERZ:()=>ug,CL1:()=>gg,idV:()=>Vp,nIW:()=>rt,fjE:()=>iO,sG0:()=>Hh,tV7:()=>Sl,g8o:()=>MO,Qy:()=>xO,t2P:()=>eO,wId:()=>fo,LS0:()=>To,bFH:()=>jd,Rgl:()=>Fd,fW1:()=>KE,Ywp:()=>Cb,pg:()=>hd,WSA:()=>xd,fed:()=>bg,tT_:()=>_s,KbL:()=>vc,JBA:()=>ut,aNC:()=>Nb,RFJ:()=>up,Zeh:()=>hf,OT5:()=>Ub,mC3:()=>pl,kR6:()=>Zg,NVY:()=>XT,k6v:()=>mp,FEC:()=>hp,Ob5:()=>Td,KUV:()=>Ed,dvH:()=>JT,V3i:()=>Xm,VD3:()=>Kr,mm2:()=>Ou,rou:()=>lf,izH:()=>$a,DK$:()=>Ga,KMp:()=>ep,c31:()=>Yt,mbo:()=>OE,gT8:()=>Qt,CZ8:()=>as,uGi:()=>ps,Poc:()=>Gt,_9k:()=>fs,ZTM:()=>us,bwT:()=>ds,tzW:()=>Kt,tF$:()=>qt,o96:()=>os,M4S:()=>ys,_vs:()=>Qc,xF8:()=>cT,HQx:()=>Yh,ATu:()=>bE,j1S:()=>gi,V3K:()=>Oi,Lmx:()=>vi,ZaZ:()=>Wt,n_1:()=>Jd,N6e:()=>Xc,SxO:()=>no,w3p:()=>zT,xU7:()=>pe,Y_p:()=>wo,$k6:()=>So,Gdl:()=>Jh,U6P:()=>Kh,OwB:()=>rO,hTh:()=>WT,xqc:()=>Mo,JvE:()=>$o,i29:()=>Vu,dzT:()=>Mi,uPS:()=>Lc,cZV:()=>Cc,n3B:()=>mv,e6O:()=>pv,s7j:()=>LO,j$Q:()=>Ry,kW2:()=>cm,tH7:()=>ko,Yxg:()=>ks,MaZ:()=>AT,nqN:()=>gT,jWj:()=>jT,o_J:()=>Xo,hgZ:()=>Bp,yW4:()=>wp,uT0:()=>Rp,C82:()=>Pp,u9Z:()=>sf,J$m:()=>Kd,j_Q:()=>uc,OaI:()=>cc,wB1:()=>Sg,SP6:()=>md,ZYr:()=>Ng,IMU:()=>lp,FoU:()=>_y,DVz:()=>tb,mxe:()=>Tv,FHr:()=>Ef,D1g:()=>uf,VO3:()=>$b,de5:()=>Mb,Uw1:()=>Te,J6q:()=>vE,XCe:()=>Za,Ir:()=>uo,XQO:()=>co,QXb:()=>Sd,P8_:()=>By,iiD:()=>Zc,MOC:()=>wd,WF:()=>Pd,xE1:()=>Ni,idW:()=>Gg,YL3:()=>Sc,Fn9:()=>T,j2U:()=>Ps,MpE:()=>Jt,kQw:()=>nr,mfm:()=>zl,vZp:()=>st,E8K:()=>Fg,VSb:()=>ns,vr_:()=>rr,Vmh:()=>Hg,FgW:()=>Jm,oDv:()=>Zo,kuw:()=>ts,eHk:()=>DT,Tt2:()=>zo,T6Y:()=>Sr,_26:()=>Hl,YkM:()=>pr,J6y:()=>Dl,njU:()=>Gl,TBP:()=>es,IT0:()=>AE,x_:()=>Vh,biM:()=>rd,TMl:()=>nd,Vkd:()=>Bl,WiY:()=>lO,_zi:()=>ql,J6D:()=>bu,Lt4:()=>gr,QEi:()=>Tr,whI:()=>Gr,KIu:()=>Yr,JhM:()=>oe,C_0:()=>Ur,qIF:()=>hv,O27:()=>E,aBi:()=>yd,xOX:()=>Vs,EdS:()=>ze,WgC:()=>Xe,eEv:()=>Zt,A4t:()=>Wl,YOQ:()=>lt,Wos:()=>Rr,jWr:()=>ja,Or$:()=>cr,lhE:()=>Qr,CwH:()=>fr,pzC:()=>xs,ymH:()=>Vl,QZu:()=>lr,rYH:()=>sO,FVt:()=>Nr,Kn2:()=>ue,jgw:()=>Zl,OXP:()=>rs,lS4:()=>Er,g5f:()=>uO,fp6:()=>Fl,Uty:()=>Zi,YkG:()=>ur,xdS:()=>Ht,kMF:()=>xf,$NE:()=>Ze,bC9:()=>Je,KVV:()=>xh,q9e:()=>Po,iIf:()=>Xh,ian:()=>Bs,m6e:()=>Cr,OFd:()=>Ms,kqr:()=>ir,fnZ:()=>Vr,VFZ:()=>qs,ZiX:()=>qe,j5n:()=>_r,zkt:()=>_,Pcm:()=>Pg,QDV:()=>Fs,M5u:()=>oO,laD:()=>Ev,mtq:()=>zt,CtB:()=>zh,CBv:()=>ae,I0t:()=>Ir,u1G:()=>ST,gk1:()=>yv,Bgb:()=>dv,uzs:()=>Wr,v0l:()=>Au,Zqp:()=>ny,j0k:()=>Do,tCm:()=>it,gmx:()=>Cl,mOr:()=>uu,TwZ:()=>$O,GyU:()=>Sb,zGm:()=>vd,bMg:()=>Gd,EyD:()=>yb,FQA:()=>fb,fZN:()=>Bd,xsF:()=>pb,Lxg:()=>db,O3l:()=>xc,Wni:()=>Fc,wRx:()=>vb,OxG:()=>Cd,uJQ:()=>Ud,qWg:()=>eb,i96:()=>bd,zhn:()=>Ob,G8q:()=>hi,Jct:()=>nT,A9Y:()=>te,Y5F:()=>tg,gxP:()=>le,c$P:()=>Ll,M7o:()=>Xu,BBN:()=>to,ZBU:()=>J,UkJ:()=>Eo,xkv:()=>Yy,z$M:()=>Wg,KAm:()=>Oy,lCl:()=>wf,rkF:()=>WE,IU6:()=>Fp,RGr:()=>h,aYu:()=>m,ije:()=>Rl,Buf:()=>zc,YLu:()=>Nl,ct9:()=>Uo,XkY:()=>Wd,T5R:()=>gd,uQS:()=>qd,wcJ:()=>Io,d$I:()=>rl,rSp:()=>td,Sx:()=>Rc,Ilm:()=>cl,Ki6:()=>Ws,VGk:()=>Hc,sFD:()=>Pm,eWN:()=>Bg,dWE:()=>CO,Lkd:()=>Qf,aDL:()=>Of,yaA:()=>Qd,lOh:()=>pf,DBr:()=>Xb,hK$:()=>wl,TZ_:()=>kp,CMB:()=>bv,FU8:()=>Nc,J$p:()=>Af,b5s:()=>_f,h2W:()=>nt,SL_:()=>nf,oUH:()=>_p,ck9:()=>_d,Xs0:()=>Al,u7I:()=>cf,rxg:()=>nu,bji:()=>iu,oCZ:()=>xE,MjG:()=>xb,FuV:()=>gp,$ju:()=>Np,t6d:()=>Ap,m5F:()=>fe,sx:()=>qg,rSc:()=>nb,U10:()=>pc,L8n:()=>jy,R9X:()=>zd,rj2:()=>Hy,_C4:()=>Lp,tCj:()=>qy,uAg:()=>dy,wx9:()=>dT,KF3:()=>Dp,ax9:()=>jp,HH7:()=>Jc,_6y:()=>jc,AJo:()=>Uc,Ixr:()=>Py,P6Y:()=>i_,Bd_:()=>DE,xkB:()=>LE,W41:()=>of,WkI:()=>af,sSE:()=>CE,GMd:()=>Fu,Bxm:()=>kE,FVh:()=>PE,U_T:()=>Md,FTe:()=>ie,VGB:()=>ne,Wfe:()=>yu,Ls5:()=>du,$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:()=>H,getStartOfDay:()=>P,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>_e,compareActivenessAttributes:()=>ve,compareAttributes:()=>be,compareImages:()=>Oe,compareRoles:()=>Ne,compareTags:()=>Ae});var o={};r.r(o),r.d(o,{addAttribute:()=>Se,editAttribute:()=>we,editEndDate:()=>je,editRoles:()=>Ce,editStartDate:()=>De,editTags:()=>Le,removeAttribute:()=>Ue});var s={};r.r(s),r.d(s,{createHistoryManager:()=>xe});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);return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)},N=e=>{const t=new Date(e);return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},R=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),P=R("startOf"),S=R("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"),D=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),x=(0,l.test)(/^[9az]+$/),M=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[x,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[x,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[D,(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")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];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)("",[M(e),r,$(n),i,V(a),o])}return e},Q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(Q)];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?Y(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)} ${H(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=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.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}`;function Ee(e){return e&&void 0!==e.uri}function me(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 he(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 be(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(be(d.value,y.value,r)):"Reference"===g(d)?he(d,y)?o.push.apply(o,be(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.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 Oe(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)||Ee(r)&&Ee(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function ve(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 ge(e,t){var r="configuration/sources/Reltio";function n(e,t){return e.crosswalk={type:t.type,value:t.value},e}function i(e){return e.removeIt=!0}var a=e.map((function(e){if(e.crosswalk)return[e];var i=t.filter((function(t){return 1===(t.attributes||t.attributeURIs||[]).filter((function(t){return t===e.uri})).length})),a=i.filter((function(e){return e.type===r})),o=i.filter((function(e){return e.type!==r})),s=[];switch(e.type){case"INSERT_ATTRIBUTE":s.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":s=s.concat(i.map((function(t){return n(e,t)})));break;case"DELETE_ATTRIBUTE":(o.length||0==a.length)&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),s=s.concat(a.map((function(t){return n({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":a.length?s=s.concat(a.map((function(t){return n({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)}))):s.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0}),o.length&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}})}return s})),o=[].concat.apply([],a),s=function(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}(o,"typeUri");for(var l in s)if("undefined"!==l){var u=s[l],c=o.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===l||"INSERT_ATTRIBUTE"===e.type&&e.uri===l})),p=u.filter((function(e){return e.crosswalk&&e.crosswalk.type===r}))[0];!c.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0]&&p&&(o.push({type:"UPDATE_ATTRIBUTE",uri:p.uri,newValue:{value:p.value},crosswalk:p.crosswalk}),c.forEach(i)),u.forEach(i)}return(o=o.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),o}function _e(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 Ae(e,t){return me("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return me("UPDATE_ROLES").call(this,e,t)}function Re(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 Pe(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Re(r[i],r[i+1],e,t));return n}function Se(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Pe(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 Se(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 we(e,t,r,n,i,a){void 0===a&&(a=0);var o=Pe(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()?(Ie(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(Ie.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=Se(e,t,r,n,i,a),s}var c=we(e,o,o.valueUri,{},i,a);we(c,t,r,n,i,a+1)}function Ie(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ue(e,t,r,n){void 0===n&&(n=0);var i=Pe(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ue(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 Ce(e,t){e.roles=t||[]}function Le(e,t){e.tags=t||[]}function De(e,t){e.startDate=t||""}function je(e,t){e.endDate=t||""}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fe(e,t,r[t])}))}return e}function Fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xe=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=ke({},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:ke({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Me=r(76665);const $e="1Tempo4rary",Ve="1Tepmo4Rel",Ge=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),We=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ye=e=>()=>We(e),Be=(e,t)=>{const r=Ge(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return We(n)},qe=e=>e&&e.includes("uri$$"),Qe=Ye("entities"),He=Ye("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Xe=(0,l.startsWith)("entities/"),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),et=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),tt=(0,l.pipe)((0,l.split)("/"),l.head),rt=(0,l.pipe)((0,l.split)("/"),l.last),nt=(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}`)),at=(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("/")},ot=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},st=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),lt=e=>5===e.split("/").length,ut=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ct=e=>e.replace(/uri\$\$/g,$e);let pt,dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Rt,Pt,St,wt,It,Ut,Ct,Lt,Dt,jt,kt,Ft;var xt;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(pt||(pt={})),function(e){e.local="local",e.validationService="validationService"}(dt||(dt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(yt||(yt={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(ft||(ft={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Tt||(Tt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(Et||(Et={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(mt||(mt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ht||(ht={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(bt||(bt={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Ot||(Ot={})),function(e){e.PROFILE="profile",e.MAP="map"}(vt||(vt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(gt||(gt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(_t||(_t={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(At||(At={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Nt||(Nt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(Rt||(Rt={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Pt||(Pt={})),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"}(St||(St={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(wt||(wt={})),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"}(It||(It={})),function(e){e.IN="in",e.OUT="out"}(Ut||(Ut={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ct||(Ct={})),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"}(Lt||(Lt={})),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"}(Dt||(Dt={})),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.SingleAttributeView="com.reltio.plugins.entity.attributes.SingleAttributeView",e.TableAttributeView="com.reltio.plugins.entity.attributes.AttributeTableView",e.CustomView="com.reltio.plugins.ui.CustomActionView",e.MapView="com.reltio.plugins.react.EntityMapView",e.ImageAttributeView="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatchesView="com.reltio.plugins.entity.PotentialMatchesView"}(jt||(jt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(kt||(kt={})),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.Search="SearchView"}(Ft||(Ft={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(xt||(xt={}));const Mt=xt;let $t,Vt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}($t||($t={})),function(e){e.Saving="Saving"}(Vt||(Vt={}));const Gt=(0,l.prop)("referencedEntityTypeURI"),Wt=(0,l.prop)("relationshipTypeURI"),Yt=(0,l.prop)("referencedAttributeURIs"),Bt=(0,l.curry)(((e,t)=>(0,l.pipe)(Yt,(0,l.filter)((0,l.startsWith)(e)))(t))),qt=Bt("configuration/relationTypes"),Qt=Bt("configuration/entityTypes"),Ht=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Kt=(0,l.filter)(Ht),Jt=(e,t)=>!t||t.some((t=>t===e.uri));function Xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,ze),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",Mt.TYPE_STRING),(0,l.propEq)("type",Mt.TYPE_BLOB))]),Zt=(0,l.has)("values"),er=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Mt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Mt.TYPE_LOOKUP)],[Zt,(0,l.always)(Mt.TYPE_ENUM)],[zt,(0,l.always)(Mt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Mt.TYPE_BOOLEAN),(0,l.always)(Mt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),tr=(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){Xt(e,t,r[t])}))}return e}({},e,{type:er(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),rr=e=>!!e&&(!!e.autoGenerated&&e.type!==Mt.TYPE_NESTED||!!e.parentAutoGenerated),nr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),ir=(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),ar=e=>nr(e)?"analyticsAttributes":"attributes",or=(0,l.propEq)("hidden",!0),sr=(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))),lr=sr(Mt.TYPE_NESTED),ur=sr(Mt.TYPE_REFERENCE),cr=sr(Mt.TYPE_IMAGE),pr=(0,l.either)(lr,ur),dr=(e,t)=>{const r=nr(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(".")},yr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),fr=(0,l.pipe)(yr,Boolean),Tr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Er=(0,l.both)(fr,(0,l.pipe)(yr,("rdm",(0,l.pipe)(tt,(0,l.equals)("rdm")))));const mr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=ar({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]||br(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:[]},hr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=mr(e,t,r);return n.length?(0,l.last)(n):null},br=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",Mt.TYPE_NESTED),(0,l.propEq)("type",Mt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Mt.TYPE_REFERENCE),(0,l.pipe)(Yt,(0,l.map)((t=>hr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Or=[Mt.TYPE_ACTIVENESS_DATE,Mt.TYPE_DATE,Mt.TYPE_TIMESTAMP,Mt.TYPE_LOCAL_DATE],vr=[Mt.TYPE_ACTIVENESS_DATE,Mt.TYPE_TIMESTAMP,Mt.TYPE_LOCAL_DATE],gr=e=>Or.includes(e),_r=e=>vr.includes(e),Ar=[Mt.TYPE_INT,Mt.TYPE_LONG,Mt.TYPE_NUMBER,Mt.TYPE_FLOAT,Mt.TYPE_DOUBLE,Mt.TYPE_COUNT],Nr=e=>Ar.includes(e),Rr=e=>[Mt.TYPE_FLOAT,Mt.TYPE_DOUBLE].includes(e),Pr=[Mt.TYPE_BOOLEAN,Mt.TYPE_BOOLEAN_RADIO,Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Sr=e=>Pr.includes(e),wr=[Mt.TYPE_URL,Mt.TYPE_BLOG_URL,Mt.TYPE_IMAGE_URL],Ir=e=>wr.includes(e),Ur=sr(Mt.TYPE_EMAIL),Cr=e=>Mt.TYPE_SSN===e;var Lr,Dr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Lr||(Lr={}));const jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Lr.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)))})),kr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Fr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),kr),xr=(0,l.pipe)((0,l.reject)(E),Fr),Mr=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),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("?")?"&":"?")+kr(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;return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f}},$r={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Vr=(0,l.equals)($r.SUGGESTING),Gr=(0,l.equals)($r.EDITING),Wr=(0,l.equals)($r.VIEWING),Yr=(0,l.either)(Gr,Vr),Br=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),qr=(0,l.curry)(((e,t)=>(0,l.pipe)(Br(e),(0,l.prop)("extendsTypeURI"))(t))),Qr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(qr(e,r)));return n(r)})),Hr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=qr(e,n);return r})),Kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Kr(e,Br(e,t.extendsTypeURI),r):void 0,Jr=(e,t)=>{const r=t.map(Hr(e));return(r.length?r.reduce(l.intersection):[])[0]},Xr=(e,t)=>Kr(e,(0,l.is)(Object,t)?t:Br(e,t),"typeImage"),zr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Qr(e,t,n.uri)?r.concat(n.uri):r),[]),Zr={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"},en={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},tn={[Zr.EQUALS]:"equals",[Zr.NOT_EQUALS]:"not",[Zr.STARTS_WITH]:"starts with",[Zr.MISSING_VALUE]:"missing value",[Zr.IN_RANGE]:"in range",[Zr.HAS_ALL]:"has all",[Zr.FULL_TEXT]:"full text",[Zr.EXISTS]:"exists",[Zr.COUNT_EQUALS]:"count equals",[Zr.COUNT_NOT_EQUALS]:"count not equal",[Zr.COUNT_LT]:"count less",[Zr.COUNT_LTE]:"count less or equal",[Zr.COUNT_GT]:"count greater",[Zr.COUNT_GTE]:"count greater or equal",[Zr.COUNT_RANGE]:"count in range",[Zr.LT]:"less than",[Zr.LTE]:"less than or equal",[Zr.GT]:"greater than",[Zr.GTE]:"greater than or equal",[Zr.IN_FILE]:"in file",[Zr.NOT_IN_FILE]:"not in file",[Zr.CONTAINS]:"contains",[Zr.ON]:"on",[Zr.BEFORE]:"before",[Zr.AFTER]:"after",[Zr.WITHIN]:"within"},rn="in",nn="notIn",an="not range",on=e=>({[rn]:Zr.EQUALS,[nn]:Zr.NOT_EQUALS}[e]||e),sn={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},ln={[sn.LAST_DAY]:"Last 24 hours",[sn.LAST_3DAYS]:"Last 3 days",[sn.LAST_WEEK]:"Last week",[sn.LAST_MONTH]:"Last month",[sn.LAST_YEAR]:"Last year",[sn.PICK_DATE]:"Pick date"},un={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},cn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},pn="<No label>",dn={IN:"in",OUT:"out"};var yn=r(87918),fn=r.n(yn);function Tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){En(e,t,r[t])}))}return e}function En(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mn={startDate:{type:Mt.TYPE_ACTIVENESS_DATE,get label(){return fn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Mt.TYPE_ACTIVENESS_DATE,get label(){return fn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},hn=Tn({id:{type:Mt.TYPE_ENTITY_ID,get label(){return fn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},mn,{roles:{type:Mt.TYPE_STRING,get label(){return fn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Mt.TYPE_STRING,get label(){return fn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),bn={workflow:{type:Mt.TYPE_STRING,get label(){return fn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Mt.TYPE_STRING,get label(){return fn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Mt.TYPE_STRING,get label(){return fn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},On={commenter:{type:Mt.TYPE_STRING,get label(){return fn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},vn={notResolved:{type:Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return fn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},gn={createdBy:{type:Mt.TYPE_STRING,get label(){return fn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Mt.TYPE_STRING,get label(){return fn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},_n={matches:{type:Mt.TYPE_COUNT,get label(){return fn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Mt.TYPE_COUNT,get label(){return fn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},An={sourceSystems:{type:Mt.TYPE_STRING,get label(){return fn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Mt.TYPE_STRING,get label(){return fn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Mt.TYPE_INT,get label(){return fn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Mt.TYPE_STRING,get label(){return fn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Nn={matchRules:{type:Mt.TYPE_STRING,get label(){return fn().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:Mt.TYPE_STRING,get label(){return fn().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Rn=Tn({},hn,bn,On,vn,gn,_n,An,Nn,{type:{type:Mt.TYPE_STRING,get label(){return fn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var Pn=r(13980),Sn=r.n(Pn);function wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){In(e,t,r[t])}))}return e}function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Un=Sn().oneOf(["mobile","tablet","desktop"]),Cn=Sn().shape({deviceTypes:Sn().oneOfType([Un,Sn().arrayOf(Un)]),roles:Sn().arrayOf(Sn().string)}),Ln=Sn().shape({value:Sn().string,lookupCode:Sn().string}),Dn=Sn().shape({link:Sn().string,filename:Sn().string}),jn=Sn().shape({displayName:Sn().string,parent:Sn().string}),kn=Sn().oneOfType([Sn().string,Sn().number,Sn().bool,Ln]),Fn=Sn().oneOfType([kn,Sn().arrayOf(kn)]),xn=Sn().shape({fieldName:Sn().string,values:Sn().arrayOf(Fn),filter:Sn().string,type:Sn().string}),Mn=Sn().shape({minValue:Sn().number,maxValue:Sn().number}),$n=Sn().shape({label:Sn().string,name:Sn().string,description:Sn().string,type:Sn().string,hidden:Sn().bool,faceted:Sn().bool,searchable:Sn().bool,uri:Sn().string,access:Sn().arrayOf(Sn().string),cardinality:Mn}),Vn=Sn().shape({label:Sn().string,uri:Sn().string,typeColor:Sn().string,direction:Sn().string,startObject:Sn().object,endObject:Sn().object}),Gn=Sn().shape({typeColor:Sn().string,typeIcon:Sn().string,typeImage:Sn().string,label:Sn().string,uri:Sn().string,attributes:Sn().arrayOf($n)}),Wn=Sn().shape({uri:Sn().string,label:Sn().string,memberTypes:Sn().array,extendsTypeUri:Sn().string,attributes:Sn().arrayOf($n)}),Yn=Sn().shape({uri:Sn().string,label:Sn().string,extendsTypeUri:Sn().string,relationshipTypeURIs:Sn().arrayOf(Sn().string)}),Bn=Sn().shape({uri:Sn().string,description:Sn().string,label:Sn().string,schemaVersion:Sn().string,entityTypes:Sn().arrayOf(Gn),roles:Sn().arrayOf(Sn().object),groupTypes:Sn().arrayOf(Sn().object),relationTypes:Sn().arrayOf(Vn),graphTypes:Sn().arrayOf(Yn),interactionTypes:Sn().arrayOf(Wn),sources:Sn().arrayOf(Sn().object)}),qn=Sn().shape({uri:Sn().string,type:Sn().string}),Qn=Sn().shape({uri:Sn().string,attributes:Sn().object,type:Sn().string,timestamp:Sn().number,members:Sn().object}),Hn=Sn().shape({uri:Sn().string,type:Sn().string}),Kn=Sn().shape({value:Sn().object,ov:Sn().bool,type:Sn().string,uri:Sn().string}),Jn=Sn().shape({refEntity:Sn().oneOfType([Sn().array,Sn().object]),refRelation:Sn().oneOfType([Sn().array,Sn().object]),value:Sn().object,ov:Sn().bool,type:Sn().string,uri:Sn().string}),Xn=Sn().oneOf((0,l.values)($r)),zn=Sn().shape({type:Sn().oneOf(Object.values(pt)).isRequired,attributeTypeUri:Sn().string.isRequired,parentUri:Sn().string.isRequired,uri:Sn().string,message:Sn().string}),Zn={attributeType:$n,showEmptyEditors:Sn().bool,lazy:Sn().bool,mode:Xn,metadata:Bn,ownError:zn,errors:Sn().arrayOf(zn),crosswalks:Sn().array,onAddAttributes:Sn().func,onAddOneMore:Sn().func,onDeleteAttribute:Sn().func,onChangeAttribute:Sn().func,additionalControlsRenderer:Sn().func,hideDeleteButton:Sn().bool,showNonOv:Sn().bool,state:Sn().oneOf(["deleted","edited"])},ei=wn({attributeValue:Kn},Zn),ti=wn({attributeValue:Jn},Zn),ri=Sn().shape({value:Sn().oneOfType([Sn().string,Sn().bool,Sn().number]),ov:Sn().bool,type:Sn().string,uri:Sn().string,lookupCode:Sn().string,lookupRawValue:Sn().string}),ni=Sn().shape({totalOvValues:Sn().number,totalValues:Sn().number}),ii=Sn().shape({inRelations:Sn().arrayOf(Sn().oneOfType([Sn().object,Sn().string])),outRelations:Sn().arrayOf(Sn().oneOfType([Sn().object,Sn().string])),groups:Sn().arrayOf(Sn().string),entityTypes:Sn().arrayOf(Sn().string),nextEntry:Sn().object}),ai=Sn().oneOf(["asc","desc"]),oi=Sn().shape({id:Sn().string,content:ii,allowOnlyCreateNew:Sn().bool,sortColumn:Sn().string,sortOrder:ai,"text-empty":Sn().string,max:Sn().number,icon:Sn().string,caption:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn,editingEnabled:Sn().bool}),si=Sn().shape({id:Sn().string,graph:Sn().shape({type:Sn().string,layout:Sn().number,deep:Sn().number,limit:Sn().number,uri:Sn().string,options:Sn().shape({reverseRelations:Sn().bool})}),sortBy:Sn().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:ai,max:Sn().number,icon:Sn().string,caption:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn}),li=Sn().shape({id:Sn().string,caption:Sn().string,pageSize:Sn().number,icon:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn,attributes:Sn().object}),ui=Sn().shape({entityUri:Sn().string,entityType:Sn().string,entityLabel:Sn().string,object:qn}),ci=Sn().shape({relationUri:Sn().string,relationType:Sn().string,relationLabel:Sn().string,direction:Sn().string,object:Hn}),pi=Sn().shape({entity:ui,relation:ci}),di=Sn().shape({value:Sn().string,isRawFilter:Sn().bool}),yi=Sn().shape({id:Sn().string,label:Sn().string,name:Sn().string,availableEntityTypes:Sn().array}),fi=Sn().shape({id:Sn().string,allowMergeAll:Sn().bool,matchActions:Sn().object,availableTabs:Sn().arrayOf(Sn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),Ti=Sn().shape({matchRules:Sn().arrayOf(Sn().string),object:qn,shortestTransitiveMatchPath:Sn().arrayOf(Sn().shape({matchRules:Sn().arrayOf(Sn().string),match:Sn().string})),direct:Sn().bool,matchScore:Sn().number}),Ei=Sn().arrayOf(Ti),mi=Sn().arrayOf(Sn().shape({uri:Sn().string,label:Sn().string})),hi=[{label:fn().text("And"),value:"and"},{label:fn().text("Or"),value:"or"},{label:fn().text("And not"),value:"and not"},{label:fn().text("Or not"),value:"or not"}];function bi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),vi=(0,l.pipe)(Oi,(0,l.propOr)("","label")),gi=(0,l.curry)(((e,t)=>{const r=Oi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),_i=(0,l.curry)(((e,t,r)=>{const[n,i]=gi(e,r);return Qr(e,n,t)||Qr(e,i,t)})),Ai=(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){bi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ni=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?dn.OUT:dn.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(dn.IN),i=r(dn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ri=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Pi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Si=(0,l.curry)(((e,t)=>e.every((e=>wi(e,t))))),wi=(0,l.curry)(((e,t)=>{const r=rr(t);return!t||(!t.access||t.access.includes(e))&&(e===Pi.READ||!r)})),Ii=(0,l.curry)(((e,t,r)=>wi(Pi.READ,r)&&(Vr(t)?wi(Pi.INITIATE_CHANGE_REQUEST,r):wi(e,r)))),Ui=Ii(Pi.CREATE),Ci=Ii(Pi.DELETE),Li=Ii(Pi.UPDATE),Di=Si([Pi.CREATE,Pi.MERGE,Pi.READ,Pi.UPDATE]),ji=Si([Pi.UPDATE,Pi.READ,Pi.CREATE]),ki=Si([Pi.UPDATE,Pi.READ]),Fi=Si([Pi.DELETE,Pi.UPDATE,Pi.READ]),xi=(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["*"])),Mi=(e,t,r)=>(0,l.pipe)((0,l.map)(xi(e,t)),(0,l.filter)(l.identity))(r),$i=(e,t,r)=>{const n=Mi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&wi(Pi.MERGE,r)},Vi=(0,l.curry)(((e,t,r,n)=>{const i=Oi(e,n),[a,o]=gi(e,n);return i&&wi(Pi.CREATE,i)&&Qr(e,a,t.type)&&Qr(e,o,r.type)})),Gi=(e,t,r,n,i)=>{const a=Br(e,n.type),o=Mi(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(Vi(e,n,i))||a.some(Vi(e,i,n))}))},Wi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Br(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:$i(o,i,a),canAddRelation:Gi(e,o,i,r,n),canMark:wi(Pi.UPDATE,a)&&wi(Pi.READ,a)}},Yi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Wi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Bi=nr,qi=(0,l.complement)(Bi),Qi=wi(Pi.READ),Hi=e=>{let{attributeType:t,mode:r}=e;return qi(t)&&Ui(r,t)&&!or(t)},Ki=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=qe(r.uri),o=Li(n),s=Ui(n);return(0,l.cond)([[Bi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Ji=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=qe(r.uri),s=Li(n),u=Ci(n),c=zi(Pi.UPDATE,n,a,r),p=zi(Pi.DELETE,n,a,r);return(0,l.cond)([[Bi,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)},Xi=(0,l.curry)(((e,t,r,n)=>{const i=br(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=>!wi(e,n)||!Xi(e,t,r[n.name],n)))))})),zi=(0,l.curry)(((e,t,r,n,i)=>Vr(t)?Xi(Pi.INITIATE_CHANGE_REQUEST,r,n,i):Xi(e,r,n,i))),Zi=(0,l.both)((0,l.complement)(or),Qi),ea="SuperUser",ta="allTenants",ra=[ta,"allCustomers"],na=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===ea})).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===ea){const e=r?ra.concat(r.map((e=>`allTenants.${e}`))):ra,n=r&&t[0]===ta?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}))},ia={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"},aa={[ia.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ia.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ia.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ia.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ia.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ia.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ia.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ia.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ia.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ia.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ia.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ia.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ia.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ia.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ia.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ia.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ia.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ia.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ia.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ia.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ia.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ia.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ia.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ia.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ia.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},oa=(0,l.curry)(((e,t,r)=>na({allowedPermissionsNames:e,permissionsNames:ia,permissionsConfig:aa}).some((e=>e(t,{params:{tenant:r}}))))),sa=oa([ia.CAN_EXPORT]),la=oa([ia.CAN_EXPORT_ACTIVITIES]),ua=oa([ia.CAN_IMPORT_ENTITIES_FROM_DT]),ca=oa([ia.CAN_READ_ENTITIES_FROM_DT]),pa=oa([ia.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),da=oa([ia.CAN_UPDATE_PROCESS_INSTANCE]),ya=oa([ia.CAN_VIEW_WORKFLOW_DEFINITION]),fa=oa([ia.CAN_CONFIG_ENVIRONMENT_REGISTER]),Ta=oa([ia.CAN_UPDATE_WORKFLOW_DATA_TASK]),Ea=oa([ia.CAN_READ_WORKFLOW_DATA_TASK]),ma=oa([ia.CAN_MANAGE_WORKFLOW_DEFINITION]),ha=oa([ia.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ba=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Oa=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),va=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ga=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),_a=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS]),Aa=oa([ia.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Na=oa([ia.CAN_CREATE_CONFIG_JAR]),Ra=oa([ia.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Pa=oa([ia.CAN_VIEW_CONFIG_JAR]),Sa=oa([ia.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),wa=oa([ia.CAN_VIEW_WORKFLOW_JOBS]),Ia=oa([ia.CAN_MAKE_BULK_UPDATE]),Ua=oa([ia.CAN_OPEN_DATA_LOADER_EXECUTE,ia.CAN_OPEN_DATA_LOADER_READ]),Ca=oa([ia.CAN_BULK_DELETE_PROFILES]),La=oa([ia.CAN_READ_MDM_DATA_ENTITIES]),Da=oa([ia.CAN_READ_DVF]),ja=oa([ia.IS_FREEMIUM_ADMIN]),ka=(0,l.reject)(or),Fa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ka,(0,l.filter)(e))(t),xa=(0,l.curry)(((e,t)=>Fa((t=>Hi({attributeType:t,mode:e})),t))),Ma=(0,l.curry)(((e,t)=>Fa((t=>Hi({attributeType:t,mode:e})||Zi(t)),t))),$a=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Zi)),Va=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Va(e)])))),Ga=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Zi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ga(e)])))),Wa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Wa(e)])))),Ya=(0,l.pipe)(Br,(0,l.converge)(l.concat,[Ga,Wa]));function Ba(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qa(e,t,r[t])}))}return e}function qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qa=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Qa(e)))},t))),Ha=e=>{var t;return Ba({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ka=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ja=(0,l.when)(Ka,(0,l.dissoc)("values")),Xa=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ba({},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})})),za=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Za=(0,Dr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Va,t).concat((0,l.chain)(Va,r)).some(za)})),eo=e=>{let t=!1;const r=Qa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ba({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},to=e=>{const t=Za(e),r=(0,l.map)((e=>Qa((0,l.pipe)(Ja,(0,l.when)((0,l.always)(e),Xa))))(t)),n=(0,l.map)(Ha),i=(0,l.map)(eo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},ro=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),no=(0,l.prop)("relationshipTypeURIs"),io=(0,l.curry)(((e,t)=>e.graphTypes.filter(ao(e,t)))),ao=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(_i(e,t))},oo=(e,t)=>(0,l.pipe)(ro,(0,l.defaultTo)({}),no,(0,l.defaultTo)([]),(0,l.chain)(gi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Br(e)))(e,t),so=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),lo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),uo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lo((0,l.complement)(so))(e)},co=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lo(so)(e)},po=(0,l.pipe)(Br,(0,l.propOr)([],"matchGroups")),yo=(e,t,r)=>(0,l.pipe)(po,(0,l.find)((0,l.propEq)("uri",r)))(e,t),fo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(yo,(0,l.propOr)(r,"label"))(e,t,r))),To=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(po,(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]})),Eo=e=>(0,l.partition)(so,e),mo=(0,l.includes)(l.__,["and","or","not"]),ho=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),bo=(0,l.includes)(l.__,["equals","notEquals","in"]),Oo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return mo(t)?Oo(r):ho(t)?r.filter(ze):bo(t)?r.map((0,l.prop)("uri")).filter(ze):[]})),l.uniq),vo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Oo),l.uniq),go=(0,l.pipe)(po,vo),_o=(0,l.pipe)(To,vo),Ao=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},No=(0,l.pipe)(Ao,Ga),Ro=(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||Qr(e,n,t)})(e,t))})(e,t)),Po=e=>!!e.required,So=(e,t,r)=>{const n=(0,l.cond)([[ze,Br(e)],[Ze,Oi(e)]])(t);return wo(e,n,r)},wo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&ze(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!rr(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Mt.TYPE_REFERENCE){const n=Wt(t),a=Yt(t);i=So(e,n,r).filter((e=>a.some(et(e.uri))))}else t.attributes&&(i=wo(e,t,r));i&&n.push(...i)}return n})):t.type===Mt.TYPE_REFERENCE?So(e,Wt(t),r):[],Io=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),Po]),e.attributes||[])},Uo=(e,t)=>{const r=Qt(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},Co=(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)?fn().text(n):n};return r(null,t)})),Lo=["label","description","abbreviation","caption","toolTip"],Do=e=>Co(Lo,e),jo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=rt(t);return r.find((e=>{let{uri:t}=e;return rt(t)===n}))})),ko=(0,l.curry)(((e,t)=>{const r=rt(t);return(0,l.pipe)(jo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Fo=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"})},xo=(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}))},Mo=(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)})),$o=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Br(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Vo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Go(e,t,r[t])}))}return e}function Go(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=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 Yo(i,e,t,r,n)},Yo=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:br(t,r)).map((e=>e.map((e=>{const r=Wo(t,e,n,i);return r.length?Vo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(pr),(0,l.prop)("children"))).filter(Zi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Bo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["attributes","analyticsAttributes"])},qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["attributes"])},Qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["analyticsAttributes"])},Ho=(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)})),Ko=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return rt(r)===e})))),Jo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Ko("LUD")),(0,l.defaultTo)(r))(t||[])},Xo=(e,t)=>{let{survivorshipStrategies:r}=e;return Ko(t,r)},zo=(0,l.allPass)([(0,l.complement)(l.isNil),wi(Pi.READ)]),Zo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),wi(Pi.READ)]),es=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),wi(Pi.CREATE)]),ts=(0,l.curryN)(2,(0,l.pipe)(Br,Zo)),rs=e=>{let{ov:t}=e;return!1!==t},ns=(e,t)=>((e,t)=>Ir(e.type)&&ae(t))(e,t)||((e,t)=>Ur(e.type)&&oe(t))(e,t),is=(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))),as=is("refEntity"),os=is("refRelation"),ss=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ls=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},us=(0,l.prop)("objectURI"),cs=(0,l.prop)("objectURI"),ps=(0,l.prop)("type"),ds=(0,l.pipe)(as,(0,l.defaultTo)({}),us),ys=(0,l.pipe)(os,(0,l.defaultTo)({}),cs),fs=(0,l.pipe)(as,(0,l.defaultTo)({}),ps),Ts=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Es=(0,l.evolve)({refEntity:re,refRelation:re}),ms=(e,t,r,n)=>{const i=mr(e,r),a=Br(e,t.type)||Oi(e,t.type);if(0===i.length)return null;const o=ar(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(!Jt(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=>Wt(e)===r.uri||Gt(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},hs=(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?hs(a.value,o):a},bs=(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 hs(e[r],i)})),Os=(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")]]),vs=(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.map)(Os),(0,l.when)((()=>i.length>0),(0,l.map)(vs(e,i))))(r)})),gs=vs(null),_s=vs(rs),As=(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=bs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ns=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ds,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Rs=Object.values(mn),Ps=(0,l.includes)(l.__,Rs),Ss=e=>Rs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function ws(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Is(e,t,r[t])}))}return e}function Is(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Us=(e,t)=>`${e}_${t}`,Cs=[Rn.matches.name,Rn.matchRules.name],Ls=(0,l.values)(bn).map((e=>e.name)),Ds=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ls)))),js=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Cs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Us(`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,Ds(r),js(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Us(`dtPotentialMatches.${t.name}`,"")))))(Rn)},Fs=(0,l.propEq)("uri",Rn.type.uri),xs=e=>(0,l.values)(Nn).some((0,l.propEq)("uri",e.uri)),Ms=(0,l.propEq)("uri",An.sourceSystems.uri),$s=Object.values(hn),Vs=(0,l.includes)(l.__,$s),Gs=e=>{let{entity:t,attributeType:r,value:n}=e;return ws({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Ws=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Ys=e=>{let{entity:t,attributeType:r,value:n}=e;return ws({},t,{[r.uri]:n})},Bs=(0,l.propEq)("uri",hn.roles.uri),qs=(0,l.propEq)("uri",hn.tags.uri);function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hs(e,t,r[t])}))}return e}function Hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ks=e=>{let{parentUri:t,attributeType:r}=e;return Qs({uri:Be(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[pr,(0,l.always)({value:{}})],[fr,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Js=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(xa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Tr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Ks({parentUri:r,attributeType:e});let s=br(n,e);s&&(e.type===Mt.TYPE_REFERENCE&&(s=Kt(s)),a.value=Js({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!Tr(e)||(o[t]=[a])}return o},Xs=e=>{let{entity:t,metadata:r}=e;return So(r,t.type,!0).filter(Tr).reduce(((e,t)=>{const n=t.name,i=ut(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ms(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:Zs({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},zs=(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===Mt.TYPE_NESTED?Qs({},e,{value:zs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Qs({},s(t),Js({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Zs=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Ks({parentUri:n,attributeType:r}),u=Os(l);return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},el=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,n.uri,Os(n),a,o,i)}))},tl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},rl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Me.ZP)(t,(e=>{Ue(e.attributes||e.value,r,n,i)}))},nl=(0,l.either)((0,l.propSatisfies)((0,l.anyPass)([e=>""===e,l.isNil]),"value"),(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity"))),il=(0,l.reject)(nl),al=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=>al({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),il)),(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 al({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Es),deleteEmptyComplex:e})},sl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(ol(e),(0,l.reject)(l.isEmpty))},ll=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Ps(r)?Gs({entity:e,attributeType:r}):Zs({entity:e,attributeType:r,parentUri:n,index:i})}),e))),ul=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Ps(r)?Ys({entity:e,attributeType:r,value:i}):tl({entity:e,attributeType:r,uri:n,value:i})})),cl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Ps(r)?Ws({entity:e,attributeType:r}):rl({entity:e,attributeType:r,uri:n})})),pl=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)},dl="UrlThumbnail",yl="CdnUrlThumbnail",fl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(rs):(0,l.head)(n);return e&&e.value}return null})),Tl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>fl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),El=Tl(["CdnUrl","Url"],!0),ml=Tl(["CdnUrlPreview","UrlPreview"],!0),hl=Tl([yl,dl],!0),bl=Tl([yl,dl]),Ol=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[ir,(0,l.always)(t)],[(0,l.both)(nr,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=ir(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Ps(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)}),[])},vl=(e,t,r)=>{const n=$a(e),i=(0,l.any)(r?l.T:rs);return Ol(n,t,i)},gl=(e,t,r,n,i,a)=>{const o=qe(null==r?void 0:r.uri)?xa(t,e):Ma(t,e);return Ol(o,r,((e,o)=>{const s=Hi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:rs,e)||ir(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let _l;const Al=e=>{_l=e};function Nl(e,t){return _l(e,t)}const Rl=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)})),Pl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return Nl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},Sl=(0,l.once)((()=>Nl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),wl=e=>Nl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Il=(e,t)=>Nl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Ul=e=>Z.fromNull(tn[e]).map(fn().text).orSome(""),Cl=(0,l.curry)(((e,t)=>`${e}_${t}`)),Ll=(0,l.split)("_"),Dl=(0,l.includes)("_"),jl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),kl=(0,l.curry)(((e,t)=>e.some(jl(t)))),Fl=kl([Zr.IN_RANGE,Zr.COUNT_RANGE,Zr.WITHIN]),xl=kl([Zr.EXISTS,Zr.MISSING_VALUE]),Ml=(0,l.cond)([[xl,(0,l.always)(0)],[Fl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),$l=(0,l.complement)(xl),Vl=kl([Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS]),Gl=kl([Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE]),Wl=kl([Zr.IN_FILE,Zr.NOT_IN_FILE]),Yl=e=>{switch(e){case Zr.COUNT_EQUALS:return Zr.EQUALS;case Zr.COUNT_NOT_EQUALS:return Zr.NOT_EQUALS;case Zr.COUNT_LT:return Zr.LT;case Zr.COUNT_LTE:return Zr.LTE;case Zr.COUNT_GT:return Zr.GT;case Zr.COUNT_GTE:return Zr.GTE;case Zr.COUNT_RANGE:return Zr.IN_RANGE}},Bl=kl([Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS]),ql=kl([Zr.WITHIN]),Ql=[[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE],[Zr.NOT_IN_FILE,Zr.IN_FILE],[Zr.EQUALS,Zr.NOT_EQUALS,Zr.HAS_ALL],[Zr.LT,Zr.LTE,Zr.GT,Zr.GTE],[Zr.MISSING_VALUE,Zr.EXISTS],[Zr.COUNT_RANGE],[Zr.IN_RANGE],[Zr.STARTS_WITH,Zr.CONTAINS],[Zr.FULL_TEXT],[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.NOT_EQUALS],[Zr.WITHIN]],Hl=(e,t)=>Ql.some((r=>r.includes(e)&&r.includes(t))),Kl=(0,l.pipe)(l.omit,l.values),Jl={OPTIONS_FOR_STRING:Kl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_DATE:[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS,Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Kl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_BLOB:Kl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_NUMBER:Kl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_LOOKUP:Kl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Zr),OPTIONS_FOR_ENUM:Kl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_ID:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.EXISTS,Zr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.EXISTS,Zr.MISSING_VALUE]},Xl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Mt.TYPE_TYPEAHEAD:case Mt.TYPE_STRING:case Mt.TYPE_PASSWORD:case Mt.TYPE_TEXT:case Mt.TYPE_CIK_ID:case Mt.TYPE_URL:case Mt.TYPE_BLOG_URL:case Mt.TYPE_IMAGE_URL:case Mt.TYPE_EMAIL:return Jl.OPTIONS_FOR_STRING;case Mt.TYPE_LOOKUP:case Mt.TYPE_DEPENDENT_LOOKUP:return Jl.OPTIONS_FOR_LOOKUP;case Mt.TYPE_ENUM:return Jl.OPTIONS_FOR_ENUM;case Mt.TYPE_DATE:case Mt.TYPE_ACTIVENESS_DATE:case Mt.TYPE_TIMESTAMP:case Mt.TYPE_LOCAL_DATE:return Jl.OPTIONS_FOR_DATE;case Mt.TYPE_BOOLEAN:case Mt.TYPE_BOOLEAN_RADIO:return Jl.OPTIONS_FOR_BOOLEAN;case Mt.TYPE_BLOB:return Jl.OPTIONS_FOR_BLOB;case Mt.TYPE_LONG:case Mt.TYPE_INT:case Mt.TYPE_FLOAT:case Mt.TYPE_DOUBLE:case Mt.TYPE_NUMBER:return Jl.OPTIONS_FOR_NUMBER;case Mt.TYPE_ENTITY_ID:return Jl.OPTIONS_FOR_ID;case Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Zr.EQUALS];case Mt.TYPE_COUNT:return Jl.OPTIONS_FOR_COUNT;case Mt.TYPE_NESTED:case Mt.TYPE_REFERENCE:case Mt.TYPE_IMAGE:return Jl.OPTIONS_FOR_COMPLEX;default:return Jl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Gl,n):n},zl=e=>[ht.and,ht.andNot].includes(e),Zl=e=>[ht.or,ht.orNot].includes(e),eu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Zl)),tu=(ru=[ht.and],e=>e.slice(0,-1).every((e=>ru.includes(e.operator))));var ru;const nu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),iu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),au=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=[ht.or,ht.orNot],n=t?[ht.and,ht.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)&&au(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},su="and",lu=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)(su,n,e),o=(e=>[ht.andNot,ht.orNot].includes(e))(a)?ou(r):r;return i?o:`${t} ${a} ${o}`}),"")}},uu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),cu=e=>Array.isArray(e)?e.map(cu).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})),du=e=>`'${e}'`,yu=e=>`"${e}"`,fu=(0,l.pipe)(cu,pu),Tu=(0,l.pipe)(fu,du),Eu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Fl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),mu=(e,t)=>Gl(t)?{type:Mt.TYPE_INT}:Wl(t)?{type:Mt.TYPE_FILE}:Bl(t)&&!ql(t)&&_r(e.type)?{type:Mt.TYPE_LOCAL_DATE}:e,hu=Object.values(sn),bu=e=>hu.includes(e),Ou=e=>fn().text(ln[e]),vu=e=>{const t=f()();switch(e){case sn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case sn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case sn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case sn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case sn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function gu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_u(e,t,r[t])}))}return e}function _u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Au=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Nu=(0,l.curry)(((e,t,r)=>{const n=r.map(Fl(e)||t.endsWith(".count")?fu:Tu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Ru=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Pu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ml(t);return(0,l.pipe)(Ru(i),(0,l.map)(Nu(t,r)),Au(" or "))(n)},Su=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Tu).join(",")})`},wu=e=>`*${e}*`,Iu=e=>`URL:${e}`,Uu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Cu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Zr.IN_FILE?r:`not ${r}`},Lu=(e,t)=>[P(e,t),S(e,t)],Du=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!ju(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Zr.ON:return gu({},e,n?{filter:Zr.EQUALS}:{filter:Zr.IN_RANGE,values:[Lu(i,n)]});case Zr.BEFORE:return gu({},e,{filter:Zr.LTE,values:[[S(i,n)]]});case Zr.AFTER:return gu({},e,{filter:Zr.GTE,values:[[P(i,n)]]});case Zr.WITHIN:return gu({},e,{filter:Zr.IN_RANGE,values:[vu(i)]})}}return e}),Pu),ju=(0,l.propSatisfies)(_r,"type"),ku=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",Zr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(Pu({filter:Zr.EQUALS,fieldName:t,values:[r]}))),new lu).build())),Au(" or "))(r)}],[(0,l.propEq)("filter",Zr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:r,filter:t,values:n.map((0,l.pipe)(cu,wu))})}],[(0,l.propEq)("filter",Zr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Pu(gu({},e,{values:(0,l.flatten)(r)})):Uu(r)?Su(gu({},e,{filter:"listEquals"})):Pu(e)}],[(0,l.propEq)("filter",Zr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ml(t);return(0,l.pipe)(Ru(i),(0,l.map)(Nu(t,r)),Au(" and "))(n)})(gu({},e,{values:(0,l.flatten)(e.values)})):ju(e)?(e=>{const{values:t}=e,r=!ju(e),[n]=t;return(new lu).addClause(Pu(gu({},e,{filter:Zr.LT,values:[P(n,r)]}))).addClause(Pu(gu({},e,{filter:Zr.GT,values:[S(n,r)]}))).orBuild()})(e):Uu(t)?Su(gu({},e,{filter:"not listEquals"})):Pu(e)}],[(0,l.propSatisfies)(Wl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:r,filter:Cu(t,r),values:n.map((0,l.prop)("link")).map(Iu)})}],[(0,l.propSatisfies)(Gl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:`${r}.count`,values:n,filter:Yl(t)})}],[(0,l.propSatisfies)(Bl,"filter"),Du],[(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 Nu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Nu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,Pu]],Fu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!$l(e)||Mu(r))},xu=e=>Array.isArray(e)?Mu(e):null!=e&&cu(e).length>0,Mu=e=>e&&e.length>0&&e.every(xu);function $u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Gu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Wu=(e,t,r)=>"children"===e?Bu(r,[...t][0],!0):r,Yu=(e,t,r)=>"values"===e?[...r,...t]:r,Bu=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)(Wu,t),e);if(!r&&Vl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Yu,t),e)}return(0,l.append)(t,e)},qu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Vu(e),r=e=>e.fieldName===t?e:r({fieldName:Gu(e),children:[e]});return r(e)})(t);return Bu(e,r)}),[]),Qu=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")),Hu=e=>{let[t]=e;return t.children?Hu(t.children):t.operator},Ku=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=Hu(t)===ht.andNot,a=n(t,!1),o=i?`not ${ou(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Hu(r)||su} ${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&&Qu(i)&&!t?r(i):n(i,a)}],...e])(o))),new lu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Ju=(0,l.pipe)((0,l.propOr)("","filter"),Dl),Xu=(0,l.map)((0,l.when)(Ju,(e=>{const[t,r]=Ll(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){$u(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),zu=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)(Fu),Xu,qu,Ku([...e,...ku],t))},Zu=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),ec=[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS],tc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.FULL_TEXT,Zr.EXISTS],rc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],nc=(e,t)=>{const r=tr(e);return(e=>{switch(e){case mn.startDate.name:case mn.endDate.name:case bn.dueDate.name:case gn.createdTime.name:case gn.updatedTime.name:case An.reltioLoadDate.name:case An.createDate.name:case An.updateDate.name:case An.deleteDate.name:case An.publishDate.name:return ec;case _n.matches.name:case An.count.name:return rc;case bn.workflow.name:case bn.assignee.name:case bn.step.name:case On.commenter.name:case gn.createdBy.name:case gn.updatedBy.name:case An.sourceSystems.name:case An.value.name:return tc;default:return null}})(t)||Xl(r)},ic=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.CONTAINS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.IN_RANGE,Zr.WITHIN,Zr.EXISTS,Zr.ON],ac=(0,l.pipe)(nc,(0,l.filter)((0,l.includes)(l.__,ic))),oc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),sc=e=>{let{query:t,body:r}=e;return t=oc(t),Nl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},lc=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)(zu(),Zu(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${xr(i)}`},uc=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=lc(e,t,r);return Nl(n)},cc=e=>Nl(`/entities/_total?${e}`),pc=(e,t)=>{const r=(0,l.pipe)((0,l.filter)(Zo),(0,l.map)((0,l.prop)("uri")))(e),n={filter:Zr.EQUALS,fieldName:"type",values:r},i={filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},a=zu()([n,i]);return Nl("/entities/_typeAheadSearch"+xr({filter:a,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,max:4}),{method:"GET"})},dc=(0,l.pipe)((0,l.reject)(l.isNil),Fr),yc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(zu(),Zu(i))(r),c=dc({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return sc({query:c,body:p})},fc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return yc({fieldName:t,searchParams:i,options:n})},Tc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Ec=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)(zu(),Zu(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Tc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${xr(i)}`},mc=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=Ec(e,t,r);return Nl(n)},hc=e=>Ac(e,{select:"secondaryLabel"}),bc=(e,t)=>{const{select:r=Tc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Nl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Oc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),qe)),vc=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=Oc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=dr(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)(zu(),Zu(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Nl(`${s}/api/${o}/${t}/_object`,m)},gc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,_c={options:"sendHidden,addRefAttrUriToCrosswalk"},Ac=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_c;return Nl(`/${e}${xr(t)}`)},Nc=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 Nl(n,r)},Rc=e=>Nl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Pc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Nl(`/entities/_events/_total${Fr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Sc=(e,t)=>Nl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),wc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Nl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},Ic=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 Nl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Fr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Uc=e=>{const t=new FormData;return t.append("file",e),Nl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,fn().text("Can't upload file"));return Promise.reject(t)}))},Cc=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 Nl(`/personal/findSavedSearches${Fr({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"}})},Lc=e=>Nl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Dc=e=>Nl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),jc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Nl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},kc=e=>{let{uri:t}=e;return Nl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Fc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),jc)(e),xc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),jc)(e);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 $c=["max","offset","filter"],Vc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Vc(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){Mc(e,t,r[t])}))}return e}({},t,(0,l.pick)($c,e)))),Gc=(0,l.omit)(["activeness"]),Wc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],mt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],mt.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Vc(e),(0,l.omit)($c))(e))),Gc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${xr({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},Yc=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Bc=(0,l.reject)(l.isNil),qc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Qc=e=>Nl(qc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Hc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,qc);return Nl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Kc=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?sl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Bc,ne,JSON.stringify);return Nl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Jc=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"),qc,n),o=be(i(t),i(r)).concat(ve(t,r));return Nl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Xc=(e,t)=>{const{url:r,options:n}=Wc(e,t);return Nl(r,n).then(Yc)},zc=(e,t)=>Nl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Zc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===dn.IN?a.inRelations=[n]:a.outRelations=[n],Nl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},ep=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Nl(`${t}/recentSearches${xr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},tp=e=>Nl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),rp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Nl(`/recentSearches${xr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ip(e,t,r[t])}))}return e}function ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ap={select:"label,secondaryLabel,name,type,startDate,endDate"},op=(0,l.reject)(l.isNil),sp=(0,l.pipe)(op,Fr),lp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=np({},ap,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Nl(`/${t}/_tree${sp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},up=e=>{let{uri:t,graphUri:r}=e;const n=np({},ap,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Nl(`/${t}/_parents${sp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=np({},ap,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Nl(`/${t}/_hops${sp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function pp(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 dp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},yp="/activities",fp=e=>{let{label:t,description:r}=e;return Nl(yp,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:dp()}})},Tp=e=>{const t=xr(e);return Nl(yp+t,{method:"GET"})},Ep=e=>Nl(`/activities/_total${xr(e)}`,{method:"GET"}),mp=e=>{const{entityUri:t}=e,r=pp(e,["entityUri"]);return Nl(`/${t}/_activities${xr(r)}`,{method:"GET"})},hp=e=>{const{entityUri:t}=e,r=pp(e,["entityUri"]);return Nl(`/${t}/_activities/_total${xr(r)}`,{method:"GET"})};function bp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Op(e,t,r[t])}))}return e}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},gp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Nl(vp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},_p=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=vp({url:r,workflowPath:t,tenant:n})),Nl(s,{method:i||"GET",body:JSON.stringify(a),headers:bp({"Content-Type":"application/json"},null!=o?o:{})})},Ap=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=vp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Nl(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)},Np=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=vp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?bp({},l,{comment:o}):l;return Nl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Rp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=vp({url:`/tasks${s?xr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(bp({objectURIs:[i]},(0,l.reject)(E,a)))};return Nl(u,bp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Pp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return Nl(vp({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Sp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return Nl(vp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},wp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Nl(vp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Nl(vp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Nl(vp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},Dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Nl(vp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Fp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Nl(vp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},xp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(rs);return a&&a[0]&&(r=n.length>0&&a[0].value?xp(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}}),""),Mp=(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=xp(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},$p=/[,\s]*$/,Vp=e=>{const t=fn().text(pn);if(!e)return t;const r=e.replace($p,"");return""===r.toString().trim()?t:r},Gp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Wp=(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=Gp(e,r.referencedEntityTypeURI);if(n)return Mp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Mp({attributes:t||{}},r.dataLabelPattern);return""},Yp=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Bp=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)}`},qp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Qp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),hl,(0,l.prop)("value"))),Hp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Qp),Kp=(e,t,r)=>{const n=Hp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(bs(e),Qp)))(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")])})(Br(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ms(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Qp))(r)})(e,r)||Xr(e,r.type);return qp(t,n)};function Jp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xp(e,t,r[t])}))}return e}function Xp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zp="DTSS/",Zp=(0,l.replace)(new RegExp("^entities/"),""),ed=e=>zp+e.dataTenant+"/"+e.uri,td=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),rd=e=>!(!e||!e.dataTenant),nd=(0,l.startsWith)(zp),id=(0,l.pipe)((0,l.ifElse)(nd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),ad=(0,l.ifElse)(rd,ed,(0,l.prop)("uri")),od=e=>e&&e.uri?e.dataTenant?ed(e):Zp(e.uri):"",sd=(0,l.curry)(((e,t,r)=>(Br(t,r.type)||{})[e]||"")),ld=sd("label"),ud=sd("typeGraphIcon"),cd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Br(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(rs)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Wp(e,o,i),uri:a.uri}})).filter(l.identity):[]},pd=(0,l.pipe)(cd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),dd=(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=dd(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):dd(e.slice(1),r)}})),yd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,fd=e=>(0,l.propOr)([],"matchRules",e),Td=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Jp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Ed=(e,t,r)=>t&&r?r.aEntity:e,md=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,sources:u,rules:c}=e;const p={max:r,deep:n,filter:s,sort:i,order:a,activeness:o,sources:u,rules:c};return Nl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Fr)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},hd=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 Nl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Fr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},bd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Nl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Od=(e,t,r)=>Promise.all(t.map((async t=>{await Nl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),vd=async(e,t)=>await Od(e,t,"NOT"),gd=async(e,t)=>await Od(e,t,"MATCH"),_d=async(e,t)=>await Promise.all(t.map((async t=>{await Nl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));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}function Rd(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 Pd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Nl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Qd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},wd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Qd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Id=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Nl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Ud=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 Id({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Cd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(rd,i);return Promise.all([s.length?bd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Id({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Ld=(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=Rd(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)}),[])),Dd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Ld),jd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Nl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Dd)},kd=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)},Fd=kd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Nl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Dd)})),xd=kd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Nl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Md=(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)}},$d=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Nl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Vd=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 $d(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Gd=Vd("NOT"),Wd=Vd("MATCH"),Yd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(rd,a);return Promise.all([Od(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return $d(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Bd=Yd("NOT"),qd=Yd("MATCH");function Qd(e){let{requestProvider:t=Nl,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}`,Ad({},Rd(s,["headers"]),{headers:Ad({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Hd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Qd({url:Ec(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Kd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Qd({url:lc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Jd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Wc(t,r);return Qd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Yc,(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)))}))))},Xd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Qd({url:`${gc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},zd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Nl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Zd=e=>{let{dtssPath:t,tenant:r}=e;return Nl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},ey=e=>{let{dtssPath:t,customerTenant:r}=e;return Nl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},ty=e=>{let{dtssPath:t,tenants:r}=e;return Nl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},ry=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Qd({url:gc(t),dataTenant:r,customerTenant:n,dtssPath:i})},ny=()=>Nl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function iy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ay(e,t,r[t])}))}return e}function ay(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=iy({},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 Nl(`${t}/api/${r}/graph/search${xr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},sy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Nl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:iy({},n,i),headers:{"Content-Type":"application/json"}})},ly=(e,t)=>`${e}/${t}/comments`,uy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Nl(`${ly(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},cy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Nl(`${ly(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},py=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Nl(ly(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},dy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Nl(`${ly(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 Nl(`${ly(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},fy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Nl(`${ly(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Ty=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=xr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Nl(`${ly(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Ey(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hy=e=>{let{tenant:t,servicesPath:r}=e;return Nl(`${r}/oauth/proxy${xr({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},by="graphExport",Oy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Ey({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:Ey({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:Ey({method:"POST"},o)})),s},vy=e=>{let{servicesPath:t,key:r}=e;return Nl(`${t}/settings${xr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},gy=e=>{let{servicesPath:t}=e;return Nl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},_y=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Nl(`${n}/plugins${xr({tenant:t,user:r})}`,{method:"GET"})},Ay=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Nl(`${n}/configService${xr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Ny=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Ay({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Ry=e=>{let{servicesPath:t,stateHash:r}=e;return Nl(`${t}/searchLink?key=${r}`,{method:"GET"})},Py=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),Nl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Sy=e=>Nl(`/${e}?showObjectsInfo=true`,{method:"GET"}),wy=e=>{let{exportPath:t,tenant:r,options:n}=e;return Nl(`${t}/${r}/activities${xr(n)}`,{method:"POST"})};function Iy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uy(e,t,r[t])}))}return e}function Uy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cy=e=>{const{entityUri:t}=e;return Nl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ly=e=>{let{entityUri:t,crosswalk:r}=e;return Nl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Dy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Nl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Iy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Iy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},jy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Nl(`/${r}/_${n}${xr({contributorURI:t})}`,{method:"POST"})},ky=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Nl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Fy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Nl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},xy=e=>{let{entityUri:t,crosswalkId:r}=e;return Nl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function My(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $y=e=>{let{entityTypeUri:t}=e;return Nl(`/dataQuality/fillRates${Fr({entityType:rt(t)})}`,{method:"GET"})},Vy=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){My(e,t,r[t])}))}return e}({},n===wt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Nl(`/entityType/${rt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},Gy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Nl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${rt(n)}`,{method:"GET",headers:{env:i}})},Wy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Nl(`/${t}${xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Yy=e=>{let{attributeUri:t,value:r}=e;return Nl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},By=e=>{let{attributeUri:t,value:r}=e;return Nl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},qy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Nl(`/${t}${xr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Qy=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=xr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=sl()([[{value:a}]]);return Nl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Hy=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Nl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Ky=e=>{let{entityUri:t,attributeName:r}=e;return Nl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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{entityUri:t}=e;return Nl(`/${t}/_historicURIs`,{method:"GET"})},zy=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 Nl(`/${t}/_changesWithTotal${xr(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Zy=(e,t)=>Nl(`/${e}/_previousChange${xr({timestamp:t})}`,{method:"GET"}),ef=(e,t)=>Nl(`/${e}${xr({time:t})}`,{method:"GET"});function tf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rf(e,t,r[t])}))}return e}function rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nf=e=>{let{url:t,method:r,data:n,headers:i}=e;return Nl(t,tf({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:tf({"Content-Type":"application/json"},null!=i?i:{})}))},af=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=xr({options:a.join(","),severity:o.join(",")});return Nl(`${t}/validate/${i}/entity/${od({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},of=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Nl(`${t}/validate/${n}/entity${xr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},sf=e=>{let{tenant:t,apiPath:r}=e;return Nl(`${r}/tenants/${t}/name`,{method:"GET"})},lf=e=>{let{tenant:t,apiPath:r}=e;return Nl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},uf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Nl(`${a}/preferences${xr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},cf=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 Nl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},pf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Nl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var df=r(29524);const yf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Qe(),s={attributes:Js({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=ms(r,e,n.uri)[0];return i&&i.value?tl({entity:e,attributeType:n,uri:i.uri,value:t}):Zs({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},ff=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ds),(0,l.filter)(qe),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),Tf=(0,l.curry)(((e,t)=>{const r=ff(e=e||{},t=t||{});return r.concat((0,l.chain)(Tf(e),r))})),Ef=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),mf=Ef((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),hf=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),qe)),bf=e=>(0,l.pipe)(mf,hf(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Of=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(mf,(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})),vf=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),qe),(0,l.omit)(["uri","timestamp"])),gf=(0,l.pipe)(vf,(0,l.evolve)({attributes:sl(!0)})),_f=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=bf(i);if(a.length>0)for(const t of a)e=Of(t,r[t].uri,e);const o=(s=await Nc(gf(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Af=async(e,t,r)=>{const n=Rf(e,t),i={};for(const t of n)i[t]=await _f(e,t,i,r);return i},Nf=(0,l.curry)(((e,t)=>{const r=df.Node(t);return bf(e[t]).forEach((t=>{const n=Nf(e,t);r.addEdge(n)})),r})),Rf=(e,t)=>(0,l.pipe)((0,l.map)(Nf(e)),(0,l.map)(df.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Pf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(vf))})),Sf=(e,t)=>{const r=Ae(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=Oe(e,t),a=ve(e,t);return[...ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},wf=(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 Of(r,n,e)}),e))))}),t)}),Pf),If=(0,l.curry)(((e,t)=>(0,l.when)(qe,(0,l.propOr)(l.__,t,e),t)));function Uf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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{parentUri:t,relation:r,entityUri:n}=e;return{type:It.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Df=e=>{let{relationUri:t}=e;return{type:It.DELETE_RELATION,parameters:{relationUri:t}}},jf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:It.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},kf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:It.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Ff=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:It.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},xf=(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))),Mf=e=>e.type===It.DELETE_RELATION,$f=e=>e.type===It.CREATE_RELATION,Vf=e=>e.type===It.REPOINT_RELATION,Gf=e=>e.type===It.UPDATE_RELATION,Wf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Yf=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case It.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Kc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case It.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Hc(e,i).then(o)};case It.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Zc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case It.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Jc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case It.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Df({relationUri:o}),Lf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Bf(n)),(0,l.map)(Yf),Wf)(s)}}},Bf=e=>t=>Uf({dcrProcessor:e},t),qf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Mr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Bf(r)),(0,l.map)(Yf),Wf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Qf=e=>t=>(0,l.map)((t=>Uf({},t,{parameters:(0,l.evolve)({parentUri:If(e),entityUri:If(e),newEntityUri:If(e)},t.parameters)})),t),Hf=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kf=(e,t)=>{const r=e.filter($f).find(xf(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Gf(o)&&xf(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Vf(o)||!xf(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(Hf({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},Jf=(e,t)=>{const r=e.filter(Vf).filter(xf(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Gf(i)||!xf(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Hf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xf=(e,t)=>{const r=e.filter(Mf).filter(xf(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!xf(t,e)))},zf=(e,t)=>{const r=e.filter(Gf).filter(xf(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Gf(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Hf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zf=e=>{const t=e.filter(Mf).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xf,e)},eT=e=>{const t=e.filter($f).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kf,e)},tT=e=>{const t=e.filter(Vf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Jf,e)},rT=e=>{const t=e.filter(Gf).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)(zf,e))(t)},nT=e=>(0,l.pipe)(Zf,eT,tT,rT)(e);function iT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aT(e,t,r[t])}))}return e}function aT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oT=e=>iT({},(0,l.path)(ET(),e),{startDate:(0,l.path)(OT(),e),endDate:(0,l.path)(vT(),e)}),sT=(e,t)=>(0,l.pipe)((0,l.path)(bT()),If(t))(e),lT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sT(e,r),i=(0,l.path)(mT(),e)===Ut.IN,a=e.parentEntityUri||n;return Lf({parentUri:i?t:a,relation:oT(e),entityUri:i?a:t})})),...o.map((t=>{const i=sT(t,r),a=(0,l.path)(mT(),t)===Ut.IN,o=i!==(0,l.pipe)((0,l.path)(ET()),a?gT:_T)(t),s=RT(e,(0,l.path)(fT(),t)),u=t.parentEntityUri||n,c=If(r,i);return o?Ff({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(ET(),t),isReversed:!1}):kf({oldRelation:(0,l.path)(ET(),s),newRelation:oT(t)})})),...i.map((e=>Df({relationUri:e}))),...s.map((e=>jf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},uT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return iT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),cT=(e,t)=>(0,l.pipe)(Oi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Rs),ka)(e,t),pT=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)}},dT=(e,t,r)=>{const n=Mp(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)},yT="relation",fT=(0,l.always)([yT,"relationUri"]),TT=(0,l.always)([yT,"relationType"]),ET=(0,l.always)([yT,"object"]),mT=(0,l.always)([yT,"direction"]),hT=(0,l.always)([yT,"object","attributes"]),bT=(0,l.always)(["entity","entityUri"]),OT=(0,l.always)([yT,"startDate"]),vT=(0,l.always)([yT,"endDate"]),gT=(0,l.path)(["startObject","objectURI"]),_T=(0,l.path)(["endObject","objectURI"]),AT=(0,l.path)(["startObject","objectTypeURI"]),NT=(0,l.path)(["endObject","objectTypeURI"]),RT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(fT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=RT(r.connections,t);if(e)return e}}},PT=(0,l.pipe)(RT,(0,l.path)(ET())),ST=(0,l.allPass)([(0,l.pipe)((0,l.path)(bT()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(TT()),(0,l.complement)(E))]),wT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=CT({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=IT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?pT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},IT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:dn.IN}:{type:t[0],direction:dn.OUT}:null},UT=e=>e.uri||e,CT=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Ui(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===dn.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Br(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Br(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(UT,Oi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(dn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(dn.OUT)),(0,l.map)(u))},t)||{}},LT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ni({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=gi(e,n.uri);return n&&(!t||Qr(e,i,t))&&(!r||Qr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Br(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Br(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(zo,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)}},DT=(0,l.curry)(((e,t,r,n,i)=>{const a=Qr(n,l.__,t.type),o=e?NT:AT,s=Qr(n,l.__,r.type),u=e?AT:NT;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),jT=(e,t,r)=>{const n=e?NT:AT,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(Qr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function kT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){FT(e,t,r[t])}))}return e}function FT(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=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kT({},t,{[r]:{parents:n,children:i}})},MT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kT({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},$T=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=ff(t,i),o=xT({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>$T(n.uri,t,[e],r)),o)},VT=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)(fT(),n),a=t?MT({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(bT(),n),s=qe(o)?[o]:[],u=xT({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>$T(t,r,[i],e)),u)}),n)},GT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return VT(r,e,t,$T(e,t))},WT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return GT(t,r,n);if(Je(e)){const t=RT(n,e);return t&&VT([t],null,r)}return r[e]?$T(e,r):void 0},YT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>YT(e,t))))},BT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>BT(e,t))))},qT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=GT(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(Je(c)){if(s=RT(i,c),!s)return null;o.push({type:Tt.relationConnection,value:s,valueType:Oi(a,(0,l.path)(TT(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:Tt.tempEntity,value:e,valueType:Br(a,e.type)});continue}const p=n[u],d=Ns(p,c),y=n[c];if(!d||!y)return null;o.push({type:Tt.attributeValue,value:d,valueType:hr(a,at(d.uri,p.type))}),o.push({type:Tt.tempEntity,value:y,valueType:Br(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},BT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?PT(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?Oi(a,d.type):Br(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:br(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:Tt.tempEntity,value:T,valueType:Br(a,T.type)}),o.push({type:Tt.attributeValue,value:s,valueType:E}),m=s.value;const l=ds(s);T=l&&qe(l)?n[l]:null}}return o},QT=e=>e.every((e=>{let{type:t}=e;return[Tt.attributeValue,Tt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Tt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,HT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?HT(t.value):[]];return e.concat(r)}),[])),KT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,JT=e=>{const t=[...HT((null==e?void 0:e.attributes)||[]),...HT((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},XT=(e,t)=>[e,...t.map((t=>KT(e,t)))],zT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},ZT=(e,t)=>{switch(e){case Et.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case Et.ENTITY_ATTRIBUTE:case Et.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[ot(t)]})(t);case Et.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case Et.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},eE=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),tE=(0,l.curry)(((e,t)=>{const r=Ao(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(tE(e,r.extendsTypeURI)):n})),rE=(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))),nE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),tE(e),rE(t))(t);function iE(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{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}},oE=e=>!e.deactivated,sE=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},lE=e=>sE(e)+e.message,uE=(0,l.unless)(l.isNil,(0,l.prop)("message")),cE=(0,l.unless)(l.isNil,(0,l.prop)("type")),pE=(0,l.curry)(((e,t)=>et(t.parentUri,e))),dE=(0,l.curry)(((e,t)=>t.parentUri===e)),yE=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),et(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Mt.TYPE_REFERENCE),(0,l.pipe)(Yt,(0,l.any)(et(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),fE=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),TE=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),EE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([AE,oE,pE(e),yE(t),(0,l.complement)(TE(e,t.uri))]))(r)},mE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([AE,oE,dE(e),fE(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",pt.missed))]))(r);return n&&n.message||""},hE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===pt.missed))},bE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(fT(),e))]))(t)},OE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},vE=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([oE,pE(t)]))(r)},gE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},_E=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?qT(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 Tt.attributeValue:{const e=a;if(lr(a))return Mp(o,e.dataLabelPattern);if(ur(a)){const t=o,i=ds(t),a=Gt(e),s=Br(n,a);return qe(i)?Mp(r[i],s.dataLabelPattern):t.label}return""}case Tt.tempEntity:return Mp(o,a.dataLabelPattern);case Tt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Br(n,null==e?void 0:e.entityType);return`${Vp(i&&qe(i)?Mp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||vi(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){iE(e,t,r[t])}))}return e}({},e,{label:Vp(t)})}))},AE=e=>!e.severity||e.severity===yt.ERROR,NE=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Mt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(NE(n))}));case Mt.TYPE_REFERENCE:return!!as(t);case Mt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),RE=(e,t)=>e.every((0,l.complement)(NE(t))),PE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=So(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ms(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!rs(e.parent))))).forEach((e=>{RE(e.attrValues,n)&&r.push(aE({type:pt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:fn().text("Attribute is required"),source:dt.local}))})),r}),[])},SE=(0,l.curry)(((e,t,r)=>ms(e,t,r,!1))),wE=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Br(e),(0,l.prop)("attributes"),(0,l.reject)(or),(0,l.filter)(ur),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(SE(e,t)));return(0,l.pipe)(r,(0,l.reject)(ds),(0,l.map)((e=>{let{uri:r}=e;return aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:at(r,t.type),parentUri:r,message:fn().text("Entity is required"),source:dt.local})})))(t)},IE=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ds,qe)).flatMap((n=>{const i=ds(n),a=t[i],o=hr(e,at(n.uri,r.type));return UE(e,t,o,a)})),UE=(e,t,r,n)=>{const i=Yt(r),a=i.map((t=>hr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Mt.TYPE_REFERENCE))).flatMap(qt).concat(i);return CE(e,t,n,(e=>a.some(et(e.uri))))},CE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=PE(e,r,n),a=wE(e,r),o=IE(e,t,r);return[...i,...a,...o]},LE=(e,t)=>{const r=(0,l.path)(ET(),t)||{};return PE(e,r)},DE=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(bT()),(0,l.ifElse)(qe,(e=>t[e]),(0,l.always)(null)))(r),i=LE(e,r),a=(e=>(0,l.path)(bT(),e)?[]:[aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(TT(),e),parentUri:(0,l.path)(fT(),e),message:fn().text("Entity is required"),source:dt.local})])(r),o=((e,t,r)=>r?CE(e,t,r):[])(e,t,n);return[...i,...a,...o]},jE=e=>(0,l.path)(["entity","uri"],e)?[]:[aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:fn().text("Entity is required"),source:dt.local})],kE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=PE(e,r),i=jE(t);return[...n,...i]};function FE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xE=(e,t)=>{var r,n;const i=Br(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Za(e)},ME=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),$E=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(ME(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},VE=(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)(ys,qe,l.not)]),(e=>{const t=(0,l.pipe)(ys,rt)(e);return $E((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(ds,qe),(t=>{const r=ds(t),n=e[r],i=n&&WE(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){FE(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),GE=(e,t,r)=>ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))).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)(VE(r,e.type)),(0,l.map)($E(ct))))})(e))),WE=(e,t)=>(0,l.evolve)({attributes:al({valueTransformer:(0,l.pipe)(Es,VE(t),ME(ct)),deleteEmptyComplex:!0}),uri:ct})(e);function YE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BE(e,t,r[t])}))}return e}function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp($e,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),QE=e=>(0,l.pipe)((0,l.evolve)({objectUri:qE,objectParentUri:qE}),(e=>{return YE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?pt.missed:pt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&ut(e.objectUri),uri:e.objectUri,source:dt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),HE=(e,t)=>(0,l.map)((0,l.pipe)(QE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=_E(t,s),p=null!=c&&c.length?c.slice(0,-1):_E(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&hr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Tt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return YE({},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&&lt(i)){const n=(0,l.last)(a),i=n.valueType;if(ur(i)&&Qt(i).includes(o)){const i=ds(n.value),o=i&&qe(i)?t[i]:null;return o?YE({},e,{parentUri:o.uri,path:a.concat({type:Tt.tempEntity,value:o,valueType:Br(r,o.type),label:""})}):e}}return e}})(t)))(e),KE=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};function JE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var XE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(XE||(XE={}));const zE={},ZE={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},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"]}},em=(0,l.curry)(((e,t)=>{const r=(e=>{if(!zE[e]){const t=ZE[e]||ZE.random0;zE[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){JE(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return zE[e]})(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]})),tm=e=>em(XE.Charts,e);var rm=r(51404),nm=r.n(rm);const im=Array.from({length:100},((e,t)=>t/100)),am=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)},om={},sm=new(nm())({hash:am,saturation:im.slice(15,71),lightness:im.slice(50,90)}),lm=(0,l.curry)(((e,t,r)=>{t in om||(om[t]={});const n=om[t];r in n||(n[r]=((e,t)=>{const r=String(am(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),um=lm(sm,"crosswalks"),cm=lm(sm,"sources"),pm=lm(sm,"contributors");function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ym(e,t,r[t])}))}return e}function ym(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fm=(0,l.has)("items"),Tm=e=>0===e,Em=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)},mm=e=>e.reduce(((e,t)=>e+t.width),0),hm=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),bm=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Om=e=>e.reduce(((e,t)=>e+t.height),0),vm=e=>(0,l.is)(String,e)&&e.includes("%"),gm=e=>Boolean(e.spacer),_m=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Am=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(fm(t)?Am(t):t)),[]),Nm=e=>({id:e.layout}),Rm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nm;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=vm(r.width)?_m(i,r.width):u}return Em(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Em(n,t,r)},o=(e,t)=>fm(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,fm(s)?n(s.layout):e(s.view)),d=Tm(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(fm(s))return o.concat(p(dm({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(dm({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:mm(o),height:hm(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=fm(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Tm(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(fm(i))return r.concat(p(dm({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(dm({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Em(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Em(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:bm(i),height:Om(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=Tm(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return dm({},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=dm({},e,{width:a}),s=dm({},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(dm({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return dm({},e,{height:Om(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(dm({},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 dm({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=dm({},t,{items:(0,l.reject)(gm,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 Am(f)},Pm=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function Sm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wm(e,t,r[t])}))}return e}function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Im={BarChart:Lt.BAR,BarChartGrouped:Lt.BAR,BarChartHorizontal:Lt.BAR,LineChart:Lt.LINE,Map:Lt.MAP,Pie:Lt.PIE},Um=(e,t)=>st(e)?nt(e,t):e,Cm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Im[r];return Sm({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Lm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Sm({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"]))},Dm=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Sm({},e,{value:[rn,nn,Zr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:on(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&st(t)||!r?n:(n||[]).concat((i=r,{filter:Zr.EQUALS,fieldName:"type",values:[i]}));var i},jm=["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"],km={"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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.BAR,component:Dt.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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.BUBBLE,component:Dt.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:Dt.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 Sm({id:t,count:o,canRead:u,orderType:s,attributeUri:Um(r,p),filters:Dm(a,r,p),component:Dt.DashboardFacet,title:i,showOthers:!0},Cm(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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.MAP,component:Dt.DashboardFacet,title:i,geoUrl:jm[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 Sm({id:t,count:o,canRead:l,attributeUri:Um(n,r),filters:Dm(a,n,r),component:Dt.DashboardFacet,title:i,geoUrl:s,chartType:Lt.MAP,projection:"geoMercator"},Cm(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.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:Lm(i),component:Dt.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:Dm(n,null,a),component:Dt.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:Zr.GTE,fieldName:"matches",values:["1"]}],component:Dt.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:Dt.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:Lt.CLOUD,component:Dt.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:Lt.TREE,component:Dt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.NotificationInboxFacet,title:n||fn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.ActivitiesViewFacet,title:n||fn().text("Activity log")}}},Fm=e=>({id:e,height:10}),xm=(0,l.pipe)((0,l.map)((e=>{const t=km[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Mm=e=>{if("0.1"===e.version){const t=xm(e.views),r=Rm(Fm,e.layout,{columns:4});return{id:e.id,margin:0,layout:Pm(r,t),views:t}}return e},$m=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=>$m(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Vm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gm(e,t,r[t])}))}return e}function Gm(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=Vm({},jt,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Ym=e=>e,Bm={[Wm.Attributes]:Ym,[Wm.HierarchyTree]:Ym,[Wm.HierarchyPaths]:Ym,[Wm.RelationsTable]:Ym,[Wm.Relations]:e=>Vm({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Wm.SingleAttributeView]:Ym,[Wm.CustomView]:Ym,[Wm.TableAttributeView]:Ym,[Wm.MapView]:Ym,[Wm.OldTreeView]:e=>Vm({},e,{class:jt.HierarchyTree}),[Wm.OldMapView]:e=>Vm({},e,{class:jt.MapView}),[Wm.ImageAttributeView]:Ym,[Wm.PotentialMatchesView]:Ym},qm=(0,l.pipe)((0,l.map)((e=>{const t=Bm[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Qm=(0,l.curry)(((e,t)=>{switch((0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)){case jt.MapView:return{id:t,height:5,minHeight:5};case jt.Relations:return{id:t,autosizing:!0,minWidth:2};default:return{id:t,autosizing:!0}}})),Hm=e=>{if("0.1"===e.version){const t=qm(e.views),r=Rm(Qm(t),e.layout,{columns:4});return{id:e.id,layout:Pm(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth,sidePanelViews:e.sidePanelViews}}return e},Km=(e,t)=>e.class===t||e["react-class"]===t,Jm=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Km(t,jt.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 Km(t,jt.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.includes(n)||t.includes(n)}},Xm=(e,t)=>e.filter((e=>t.some((t=>Km(e,t))))).map((e=>{let{id:t}=e;return t})),zm=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))};function Zm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eh(e,t,r[t])}))}return e}function eh(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=(e,t)=>$m(t).map((t=>(0,l.pipe)((0,l.map)((e=>zm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),rh=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},nh=(e,t)=>{if("scroll"===t.layout.layout){const r=th(e,t.layout),n=Mm(Zm({},t,{views:r,version:"0.1"}));return{class:Ft.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Ft.Dashboard,views:t.views,layout:t.layout,id:t.id}},ih=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},ah=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},oh=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},sh=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},lh=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},uh=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},ch=(e,t)=>{const r=th(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=((e,t)=>e.flatMap((e=>{let{extensions:t=[]}=e;return t.filter((e=>{let{point:t}=e;return"com.reltio.plugins.search.toolbar.component"===t}))})))(e).filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Ft.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"]}},ph=(e,t)=>({class:Ft.Graph,id:t.id}),dh=(e,t)=>{const r=th(e,t.layout)[0];return{class:Ft.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},yh=e=>t=>!!(0,l.intersection)(e,t).length,fh=(0,l.cond)([[yh(["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"]),()=>nh],[yh(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>ih],[yh(["com.reltio.plugins.graph.GraphView"]),()=>ph],[yh(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>ah],[yh(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>oh],[yh(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>sh],[yh(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>lh],[yh(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>uh],[yh(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>ch],[yh(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>dh],[l.T,()=>(0,l.always)(void 0)]]),Th=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(rh),(0,l.map)((t=>((e,t)=>{const r=th(e,t.layout),n=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>zm(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return $m(r.layout||{})}})(e,t),i=Hm(Zm({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:i.views,layout:i.layout,sidePanelViews:n}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews"])))(e);return{class:Ft.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:"CustomAction",config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:"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;const i=(0,l.pipe)((0,l.map)((e=>zm(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;const a=$m(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 fh(o)(t,i)},Eh=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))},mh="https://reltio-ui-files.s3.amazonaws.com/new-ui/",hh={[Ft.DQDashboard]:`${mh}DqDashboard.svg`,[Ft.Dashboard]:`${mh}Dashboard.svg`,[Ft.Graph]:`${mh}Graph.svg`,[Ft.RelationshipSearch]:`${mh}GraphSearch.svg`,[Ft.Interactions]:`${mh}Interactions.svg`,[Ft.PotentialMatches]:`${mh}PotentialMatches.svg`,[Ft.Profile]:`${mh}Profile.svg`,[Ft.ProfileActivityLog]:`${mh}ActivityLog.svg`,[Ft.Relationships]:`${mh}Relationships.svg`,[Ft.Sources]:`${mh}Crosswalk.svg`,[Ft.Search]:`${mh}Search.svg`,DEFAULT:`${mh}Default.svg`},bh=e=>hh[null==e?void 0:e.class]||hh.DEFAULT,Oh=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?hh.ProfileView:null,vh=e=>(0,l.pipe)((0,l.chain)(Eh),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>(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=>({label:e.label,icon:bh(Th(e,t)),screen:Th(e,t)}))),(0,l.filter)((e=>e.screen)))(t))(t,e),n=Th(t,e);return{label:t.label,icon:Oh(t)||bh(n),menu:r.length?{type:"side",items:r}:void 0,screen:n}}));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}const _h=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Ah=e=>({id:e,height:10}),Nh=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)(_h),(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=xm(((e,t)=>{const r=$m(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(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){gh(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Rm(Ah,t.layout,{columns:4});return{views:r,layout:Pm(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Rh=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Ph=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),r=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>zm(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),u=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),c=(e=>(0,l.pipe)((e=>((e,t)=>(e||[]).find((e=>"com.reltio.plugins.ui.Activator"===e.activator)))(e)),(0,l.prop)("default-perspective"),(0,l.ifElse)(Rh,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e);return{i18n:o,entity:{requestSettings:{defaultMaxValues:t}},image:{attributeFieldsOrder:r},lookups:{autocomplete:n},validate:{levels:i,validateReadMode:a},attributePresentations:s,workflow:{enabled:u},defaultRoute:c}},Sh=e=>({layout:vh(e),pivoting:Nh(e),properties:Ph(e)});var wh=r(58697),Ih=r.n(wh);function Uh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ch(e,t,r[t])}))}return e}function Ch(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=>{let{views:t,layout:r}=e;const n={};let i=!1;const a=t.map((e=>{if(n[e.id]){const t=`${e.id}_${Ih()()}`;return n[e.id].push(t),i=!0,Uh({},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]++,Uh({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Dh=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(Dh(e))}))}))),t},jh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Mh,t),(0,l.propOr)([],"crosswalks",e))),e),kh=(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(kh(e))}))})),r},Fh=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=Fh(e);r>t&&(t=r)}))})),t+1):t},xh=(e,t)=>{if(qe(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Mh=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},$h=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Vh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Gh=(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)},Wh=(0,l.eqBy)(Mh),Yh=(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)(os,(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)))),Bh=(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=fn().number(t));return t})),qh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?fn().number(e,"0,0.0a").toUpperCase():fn().number(e,"0,0"):""},Qh=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),Hh=(e,t)=>t&&e!==t?`${t} (${e})`:e,Kh=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Jh=(e,t,r)=>{const n=Kh(e,t,r);return Hh(r,n)},Xh=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),zh=(0,l.complement)(Xh),Zh=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),eb=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)},tb=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(zh(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),rb=(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 Mt.TYPE_NUMBER:case Mt.TYPE_FLOAT:case Mt.TYPE_DOUBLE:case Mt.TYPE_LONG:case Mt.TYPE_INT:case Mt.TYPE_COUNT:return t&&Bh(o,t);case Mt.TYPE_BOOLEAN:case Mt.TYPE_BOOLEAN_RADIO:case Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:le(t)?fn().text("yes"):fn().text("no");case Mt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),t&&(bu(t)?Ou(t):fn().date(t,s));case Mt.TYPE_ACTIVENESS_DATE:case Mt.TYPE_LOCAL_DATE:return t&&(bu(t)?Ou(t):fn().date(t,s));case Mt.TYPE_TIMESTAMP:return t&&(bu(t)?Ou(t):fn().date(isNaN(t)?t:Number(t),u));case Mt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Mt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}default:return(0,l.is)(Object,t)?Hh((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),nb={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)"},ib=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()}},ab=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})))),ob=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}=t,i=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e}):e(r)}),t.next);i(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),ib,ab);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((e=>new Promise(((t,n)=>{r({response:e,next:e=>{t(e)},abort:n})})))):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}},sb="__metadata",lb=(e=>{const t=[sb,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),ub=(0,l.set)(lb),cb=(0,l.view)(lb),pb=ub(un.NEW),db=ub(un.REMOVED),yb=ub(un.EDITED),fb=ub(un.IGNORED),Tb=(0,l.pipe)(cb,(0,l.equals)(un.REMOVED)),Eb=(0,l.pipe)(cb,(0,l.equals)(un.NEW)),mb=(0,l.pipe)(cb,(0,l.equals)(un.EDITED)),hb=(0,l.pipe)(cb,(0,l.complement)(l.isNil)),bb=(0,l.pipe)(cb,(0,l.equals)(un.IGNORED)),Ob=(0,l.omit)([sb]),vb=(e,t)=>e===sb?void 0:t;function gb(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=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=_b(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Ab=(e,t)=>_b((0,l.propEq)("nodeId",t),e),Nb=(e,t)=>_b((0,l.pathEq)(["entity","uri"],t),e),Rb=(e,t)=>{const r=Ab(e,t);return r.length>1?r[r.length-2]:null},Pb=(e,t)=>{const r=Ab(e,t);return r.length>0?r[r.length-1]:null},Sb=(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=>Sb(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},wb=()=>{},Ib=(e,t)=>{let{parent:r,nodeProcessing:n=wb}=t;n(e,r),e.children&&e.children.forEach((t=>Ib(t,{parent:e,nodeProcessing:n})))},Ub=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case _t.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 _t.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 _t.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){gb(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})}}},Cb=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&&Ib(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===_t.addingChild||r.editingMode===_t.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Ub({node:r,connection:n,isReversed:i}),s=Lf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===_t.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Ub({node:r,isReversed:i,connection:n}),l=s?Ff({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):kf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Lb={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Db={asc:"asc",desc:"desc"},jb=Lb.entityLabel,kb=Db.asc,Fb=(0,l.always)(0),xb=e=>{let{sortField:t=jb,sortOrder:r=kb,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Lb.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return i_.strings.sort(t,a,o)})(n,r);case Lb.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return i_.strings.sort(e,i,a)})(r);default:return Fb}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Mb=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Db)),l.identity,(0,l.always)(kb))),$b=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Lb)),l.identity,(0,l.always)(jb)));var Vb=r(91104);let Gb;const Wb=(e,t)=>(Gb||(Gb=Vb.createClient({key:t})),new Promise((t=>{Gb.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)}))}))),Yb=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Bb=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(rs).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Yb(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Bb(e.value,t,r))),n})),qb=e=>e&&e.length>0,Qb=(e,t)=>[].concat(e&&e.attributes?Bb(e.attributes,t):[]).filter(l.identity),Hb=(e,t,r,n,i)=>{if(e&&e.type){const t=(Br(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Qb(e,t.latitude),n=Qb(e,t.longitude),qb(r)&&qb(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(l.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(qb(t)&&t[0].value&&qb(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?Wb(n.label,i).catch((()=>null)):Promise.resolve(null)},Kb=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=Br(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=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return Hb(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Wb(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},Jb=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=Br(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(hr(e,r.latitude,t.type)&&hr(e,r.longitude,t.type)){const e=Qb(t,r.latitude),n=Qb(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))},Xb=(e,t,r)=>Promise.all([Jb(e,t),Kb(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.lon===e.point.lon))))]}));function zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zb(e,t,r[t])}))}return e}function Zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eO=(e,t)=>t.values.map(fo(e,t.entityTypeUri)),tO=(e,t,r)=>ks(t.fieldName,r)||hr(e,nt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),rO=(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?Hh(e,t):e}),r)},nO=(0,l.path)(["attrType","label"]),iO=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>zb({},e,{[t]:!0})),{});e[r]=e[r]?zb({},e[r],n):n}return e}),{}),aO=(0,l.pipe)((0,l.prop)("values"),E),oO=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Rn.type.name)),sO=e=>e.type===cO.NUMERIC_RANGE_FACET,lO=e=>e.type===cO.DATE_RANGE_FACET,uO=(0,l.either)(sO,lO),cO={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},pO=e=>{switch(null==e?void 0:e.name){case Rn.type.name:return cO.ENTITY_TYPE_FACET;case Rn.createdBy.name:case Rn.updatedBy.name:case Rn.sourceSystems.name:case Rn.tags.name:case Rn.roles.name:case Rn.matchRules.name:case Rn.MLRecommendedMatch.name:return cO.WITH_DROPDOWN_CHECKBOXES_FACET;case Rn.createdTime.name:case Rn.updatedTime.name:case Rn.startDate.name:case Rn.endDate.name:return cO.DATE_RANGE_FACET;case Rn.matches.name:case Rn.matchScore.name:return cO.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return cO.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return cO.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return cO.DATE_RANGE_FACET;default:return cO.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},dO=(0,l.pipe)(tO,pO),yO=(0,l.pipe)((0,l.path)(["attrType","type"]),Sr),fO=(0,l.cond)([[sO,(0,l.always)(Zr.IN_RANGE)],[lO,(0,l.always)(Zr.WITHIN)],[(0,l.allPass)([yO,e=>e.values.length>=2]),(0,l.always)(Zr.EXISTS)],[l.T,(0,l.always)(Zr.EQUALS)]]),TO=(0,l.cond)([[lO,(0,l.prop)("values")],[sO,(0,l.prop)("values")],[yO,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 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.pipe)((0,l.path)(["attrType","type"]),gr),hO=(0,l.pipe)((0,l.path)(["attrType","type"]),Nr),bO=(0,l.pipe)((0,l.prop)("attrType"),xs),OO=(0,l.pipe)((0,l.prop)("attrType"),Fs),vO=e=>t=>t.values.map((t=>Br(e,t).label)).join(" , "),gO=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),_O=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(fn().number),gO)),(0,l.join)(","))(e.values);return`${nO(e)}: ${t}`},AO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),gO)),(0,l.join)(","))(e.values);return`${nO(e)}: ${t}`},NO=e=>t=>`${nO(t)}: ${eO(e,t).join(", ")}`,RO=e=>t=>{const r=rO(e,t);return`${nO(t)}: ${r.join(", ")}`},PO=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[OO,vO(e)],[hO,_O],[mO,AO],[bO,NO(e)],[l.T,RO(t)]]),r))),SO=(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){EO(e,t,r[t])}))}return e}({},t,{attrType:tO(e,t,n)}))),PO(e,r))(t),wO=new RegExp(`^${fn().text("Search")}`),IO=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...SO(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(wO,"",u)]},UO=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(sn),CO=e=>(e=>UO.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]=vu(t);return e.replace(r,i).replace(n,a)}),e))(e),LO=(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}`})),DO={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},jO=e=>[DO.geoPolygon,DO.onMapMove].includes(e),kO=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},FO=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},xO=(e,t)=>jO(e)?t.map(kO):[FO(t)],MO=e=>jO(e)?fn().text("Geo Polygon"):fn().text("Geo Location"),$O=e=>{switch(e){case DO.geoLocation:return"geoLocation";case DO.geoPolygon:case DO.onMapMove:return"geoPolygon"}},VO={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},GO=e=>fn().text(e),WO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Zr.EQUALS]:"=",[Zr.NOT_EQUALS]:"≠",[Zr.STARTS_WITH]:"*",[Zr.MISSING_VALUE]:fn().text("missing value"),[Zr.HAS_ALL]:fn().text("has all"),[Zr.IN_RANGE]:fn().text("in range"),[Zr.FULL_TEXT]:fn().text("full text"),[Zr.EXISTS]:fn().text("exists"),[Zr.COUNT_EQUALS]:`${fn().text("count")} =`,[Zr.COUNT_NOT_EQUALS]:`${fn().text("count")} ≠`,[Zr.COUNT_LT]:`${fn().text("count")} <`,[Zr.COUNT_LTE]:`${fn().text("count")} <=`,[Zr.COUNT_GT]:`${fn().text("count")} >`,[Zr.COUNT_RANGE]:fn().text("count range"),[Zr.LT]:"<",[Zr.LTE]:"<=",[Zr.GT]:">",[Zr.GTE]:">=",[Zr.IN_FILE]:fn().text("in file"),[Zr.NOT_IN_FILE]:fn().text("not in file"),[Zr.CONTAINS]:"~",[en.LIST_EQUALS]:"=",[en.NOT_LIST_EQUALS]:"≠",[en.LIST_EQUALS_CASE_SENSITIVE]:"=",[en.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||fn().text(e.toLowerCase())},YO=e=>({type:VO.operator,text:e}),BO=e=>({type:VO.operator,text:GO(e)}),qO=e=>({type:VO.attributeLabel,text:e}),QO=e=>({type:VO.specialAttributeLabel,text:e}),HO=e=>({type:VO.attributeFilter,text:WO(e)}),KO=e=>({type:VO.attributeValue,text:e}),JO=e=>({type:VO.entityTypeLabel,text:e}),XO=()=>({type:VO.space,text:" "}),zO=()=>({type:VO.bracket,text:"("}),ZO=()=>({type:VO.bracket,text:")"}),ev=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),tv=(0,l.curry)(((e,t)=>t.map(ev(e)))),rv=(0,l.curry)(((e,t,r)=>[e,...r,t])),nv=rv(zO(),ZO()),iv=rv(XO(),XO()),av=(0,l.curry)(((e,t)=>[e,...t])),ov=e=>av(JO(e)),sv=e=>av(JO(`${e}: `)),lv=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=eu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=zl(s),a=Zl(s);!r&&t&&n&&(i.push(zO()),r=!0),i.push(o),r&&a&&(i.push(ZO()),r=!1);const l=e?BO(s):YO(s);i.push(...iv([l]))}else i.push(o),r&&(i.push(ZO()),r=!1)}return i}},uv=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),cv=(0,l.pipe)(lv({localizable:!1}),uv),pv=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},dv=e=>{let{data:t,values:r,filter:n}=e;return t&&Fu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},yv=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(dv)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),fv=(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)&&fr(e.data.attrType)})(e)&&[Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:yr((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})))),eb),Tv=(e,t)=>(0,l.pipe)(fv,tb(t))(e),Ev=(0,l.pathEq)(["data","fieldName"],Rn.type.name),mv=(0,l.path)(["data","entityTypeUri"]),hv=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),bv=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ts(e)),attributes:(0,l.filter)((0,l.pipe)(mv,(0,l.anyPass)([l.isNil,ts(e),r=>{const n=(t.entityTypes||[]).filter(ts(e));return(n.length>1?Jr(e,n):null)===r&&!!Br(e,r)}])))})(t))))),Ov=e=>(0,l.pipe)((0,l.prop)("filter"),Ml,(0,l.equals)(e)),vv=(0,l.curry)(((e,t,r,n,i,a)=>{const o=ks(n.fieldName)||n.attrType,s=mu(o,i),u=rb({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>fr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Hh(a.lookupCode,a.value):Jh(r,yr(o),a)],[()=>xs(s),()=>fo(e,n.entityTypeUri,a)],[()=>Ms(s),()=>ko(e,a)],[()=>Bs(s),()=>Mo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Nr(c)||Sr(c)),yu),KO)()})),gv=(e,t,r,n)=>{const i=vv(e,t,r,n.data,n.filter);return(0,l.cond)([[Ov(0),(0,l.always)([])],[(0,l.both)(Ov(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[XO(),i(r),{type:VO.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[XO(),...(0,l.pipe)(l.flatten,(0,l.map)(i),tv({type:VO.punctuationMark,text:", "}))(t)]}]])(n)},_v=(e,t)=>{const r=!!ks(e.data.fieldName);return(0,l.pipe)(pv,r?QO:qO)(e,t)},Av=(e,t,r,n,i)=>[_v(n,i),XO(),HO(n.filter),...gv(e,t,r,n)],Nv=(0,l.addIndex)(l.map),Rv=(0,l.propEq)("length",1),Pv=(0,l.propSatisfies)((0,l.lt)(1),"length"),Sv=(0,l.complement)(l.isEmpty),wv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(nu,(0,l.filter)(dv),iu,(0,l.map)((n=>({operand:Av(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,lv()))(n)},Iv=(0,l.pipe)(wv,l.flatten),Uv=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>ld(e,{type:t}))).join(", ");return r?t(r):l.identity},u=wv(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(ov),(0,l.pipe)(s(sv),(0,l.unless)((()=>Rv(u)||i),nv)))(u)},Cv=(e,t,r,n)=>(0,l.pipe)(nu,(0,l.filter)(yv),iu,Nv(((n,i,a)=>({operand:Uv(e,t,r,n,Rv(a)),operator:n.operator}))),lv(),l.flatten)(n),Lv=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),lv(),l.flatten),Dv=e=>{let{searchType:t,values:[r]}=e;return xO(t,r).join(", ")},jv=(e,t,r,n,i,a)=>{const o=(e=>e?[QO(e.isRawFilter?fn().text("Raw filter"):fn().text("Search")),...iv([HO(Zr.EQUALS)]),KO(`"${e.value}"`)]:[])(i),s=(e=>e?[QO(MO(e.searchType)),XO(),KO(Dv(e))]:[])(a),u=(0,l.pipe)(Cv,(0,l.when)((e=>Pv(e)&&(Sv(o)||Sv(s))),nv))(e,t,r,n);return Lv([o,s,u])},kv=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),Fv=(0,l.pipe)(jv,kv),xv=(0,l.has)("attributes"),Mv=Array.isArray,$v=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),Vv=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=Gv(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)($v(a))),nv),(0,l.concat)(iv([YO(o)]))))(s)},Gv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return xv(n)?Vv(e,t,r,n,i):Mv(n)?n.reduce(((n,a)=>n.concat(Gv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(iv([YO(n.operator)])))(Av(e,t,r,n,i))},Wv=(e,t,r,n,i)=>(0,l.pipe)(Gv,l.flatten)(e,t,r,n,i);function Yv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bv(e,t,r[t])}))}return e}function Bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qv=(0,l.complement)(Ev),Qv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(Ev),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(mv),(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}},Hv=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=Qv(t);return(r||n)&&tu(t)},Kv=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(Hv)),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(Ev).some((0,l.propEq)("filter",Zr.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}=Qv(r);if(Hv(e))t.push(Yv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(qv)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(Ev,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(mv,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(qv),entityTypes:n,operator:i?a:e.operator,id:Ih()()}}));t.push(...n)}var a;return t})(t))),[]))),Jv={[Zr.EQUALS]:Zr.ON,[Zr.IN_RANGE]:Zr.WITHIN,[Zr.GTE]:Zr.AFTER,[Zr.GT]:Zr.AFTER,[Zr.LTE]:Zr.BEFORE,[Zr.LT]:Zr.BEFORE},Xv=(0,l.curry)((e=>Jv[e]||e)),zv=(0,l.curry)(((e,t)=>{switch(e){case Zr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Zr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),Zv=(0,l.pipe)((0,l.path)(["data","attrType","type"]),gr),eg=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>Yv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return Zv(e)?(0,l.evolve)({filter:Xv,values:zv(t)},e):e}))})))})),tg=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),Kv,bv(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")))})),eg,(0,l.reject)(hv))(r)));function rg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ng(e,t,r[t])}))}return e}function ng(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ig=(e,t)=>({data:{uri:st(e.fieldName)?nt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||fO(e),id:Ih()(),values:TO(e)}),ag=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=ks(a,t,r)||hr(e,i);if(!s)return null;if(ir(s))return rg({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=ld(e,{type:o}),i=(mr(e,nt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return rg({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),og=(0,l.curry)(((e,t,r,n)=>tg(ag,e,n,t,r)));function sg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lg(e,t,r[t])}))}return e}function lg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ug=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},cg=e=>"rdmLookups.not.resolved"===e?Rn.notResolved.name:e,pg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===an?Zr.IN_RANGE:on(a),u=cg(n),c=ks(u)||hr(e,i),p=(0,l.cond)([[()=>Wl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>sg({},e,{filename:Qh(e)}))))],[()=>Sr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Vl(s)&&!Array.isArray(e[0])&&!gr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Ih()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===an?"and not":"and",filter:s,values:p}})),dg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(pg(e,Jr(e,i)));return[{id:Ih()(),operator:"or",attributes:a,entityTypes:i}]})),yg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),fg=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([yg("from"),yg("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,()=>[]]]),Tg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return sg({},r,{values:fg(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Us(e.fieldName,n):e.fieldName})},Eg=(e,t)=>{if((0,l.has)("children")(e)){const r=Tg(e,t);return e.children.reduce(((e,n)=>(e.push(Eg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return Tg(e,t)},mg=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(Tg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(sg({fieldName:e.fieldName},Tg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(Eg,l.flatten)],[l.T,Tg]]),hg=(0,l.pipe)((0,l.map)(mg),l.flatten),bg=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},Og=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=dg(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:hg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>sg({},t,{type:dO(e,t)}))).map((e=>sg({},e,{values:uO(e)?bg(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 ig(r,t)})),operator:"or",id:Ih()(),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=>({[cg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[sg({},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 og(e,t,r,p)},vg=(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)(aO),(0,l.partition)(oO))(t),i=n.map((t=>rg({},t,{type:dO(e,t)}))).map((e=>ig(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Ih()(),entityTypes:a}]})(e,a);return og(e,t,r,o)})(e,t,r,n):Og(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},gg=e=>"2.0"===e.version?e.keyword:ug(e),_g=e=>(0,l.pathEq)(["object","uri"],e),Ag=(e,t)=>(0,l.pipe)((0,l.find)(_g(e)),(0,l.prop)("object"))(t),Ng=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"),_g(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Ag(r.match,t)||n[r.match];return{label:Vp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return yo(e,i.type,t)||{label:t,uri:t}}))}};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)))(i)},Rg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),Pg=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Sg=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[]}=t;const a=(0,l.propOr)({},n,r);return{label:Vp((0,l.prop)("label",a)),matchRules:i.map((function(t){return yo(e,a.type,t)||{label:t,uri:t}}))}})))(t),wg=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)},Ig=(0,l.path)(["object","uri"]),Ug=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Cg=e=>e.getValue(),Lg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Lg(n[e],t),!r);e++);return r},Dg=(e,t)=>{const r=[],n=(0,l.pipe)(Cg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Dg,[t]),a);return r.push.apply(r,o),r};function jg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kg(e,t,r[t])}))}return e}function kg(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=(e,t)=>!!e[t],xg=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Mg=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||[]])},$g=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return jg({},t,{[r.uri]:jg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Mg(null==o?void 0:o.parents,n),children:Mg(null==o?void 0:o.children,i),values:Mg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Vg=e=>e.children?e.children.flatMap(Vg):e,Gg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Br(r,t)||Oi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return qo(r,n,i).flatMap(Vg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>hr(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=$g({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>$g({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},Wg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!qe(e.uri)&&ze(e.type)&&ze(t)&&!t.startsWith(e.type))(n,t))return e;const i=ms(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(rs),(0,l.map)(xg))(i);return $g({structure:e,attrType:e[t].attrType,values:a})}),t)},Yg=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 Fg(e,r)}));return r||n?t.filter(rs).reduce(((e,t)=>Yg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Fg(t,e.type)?$g({structure:t,attrType:t[e.type].attrType,values:[xg(e)]}):t}},Bg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?jg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},qg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ms(i,n,r)||[];return a.length?$g({structure:t,attrType:t[r].attrType,values:a.filter(rs).map(xg)}):t},Qg=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=ut(t),n=ut(e);return et(n,r)})(e,t):!(!r||!lt(t))&&YT(r,i).includes(n)},Hg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},Kg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?GT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Qg(r,t,o)}))},Jg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>Jg(e,t,r)))))},Xg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Hg(n,e)}},zg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=WT(u,o,i,a),p=Jg("children",t,l),d=Jg("parents",t,l),y=p.flatMap((e=>Jg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((t=>Xg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Qg(n,t,c)||Ke(t)!==u&&Qg(t,n,c)})).map((t=>Xg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=Jg("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)&&Qg(n,t,c)}))})).map((t=>Xg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Qg(t,n,c)})).map((e=>Xg(r,n,e,s))),...T,...E,...f]},Zg=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=rb({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=>Mp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[lr,()=>a(n)],[fr,()=>(e=>{const r=o(e),n=yr(t);return wl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Jh(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},e_=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Zr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(t_(r,t)):i.push(r_([t],r)),i},t_=(e,t)=>{const r=ar(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=lr(i)?t_(i,t[r]):[r_(t[r],i)];return e.push(...a),e}}),[])},r_=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:dr(t.uri),filter:t.type===Mt.TYPE_BLOB?Zr.FULL_TEXT:Zr.EQUALS,values:e}:{fieldName:dr(t.uri),filter:Zr.MISSING_VALUE},n_={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},i_={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([[1083],{16299:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Rs,PY2:()=>mn,Ng6:()=>mt,YJ7:()=>cn,NlI:()=>en,Xt7:()=>ft,wfT:()=>zn,EMD:()=>$n,HAc:()=>Tt,PEf:()=>gn,oA3:()=>Mn,$XE:()=>Lt,eWf:()=>On,q7e:()=>Et,KVe:()=>Zn,WVQ:()=>Lr,oZZ:()=>ui,bNA:()=>ci,Rjq:()=>pi,G39:()=>An,yn8:()=>wt,N0y:()=>St,dZX:()=>Dt,bQt:()=>yi,oS0:()=>Mt,lL_:()=>sn,Nsj:()=>dn,psV:()=>un,xPW:()=>hn,pyR:()=>qn,p8l:()=>Gn,Wkf:()=>yt,zHr:()=>dt,NIO:()=>pt,$26:()=>pO,Esk:()=>Dn,s9T:()=>Rt,MEy:()=>lu,j5E:()=>Zr,vAw:()=>Fn,NMQ:()=>xn,mNm:()=>Yn,rwv:()=>si,s_5:()=>Qn,RgZ:()=>Wn,unl:()=>li,Qy0:()=>di,pYu:()=>Ln,wIJ:()=>jO,GFH:()=>bt,S91:()=>Nn,p3$:()=>mi,wSh:()=>Z,BDP:()=>Pi,pGS:()=>Bn,ARY:()=>$t,XGc:()=>Xn,fO_:()=>$r,wwy:()=>_t,_XL:()=>pn,j2V:()=>ei,dMV:()=>Kn,NBX:()=>Cg,OXy:()=>Vt,BXd:()=>It,CJB:()=>ni,lXI:()=>xt,nqG:()=>Ti,C68:()=>_n,yxQ:()=>fi,Yj_:()=>At,D25:()=>vt,ZIY:()=>jt,Tl4:()=>GO,lwr:()=>vn,NkU:()=>ti,Rtp:()=>Jn,YGx:()=>Ut,uTS:()=>Hn,IYE:()=>Vn,PiC:()=>oi,tJI:()=>ht,fDt:()=>Ot,cNQ:()=>ri,SwE:()=>jn,ZHR:()=>ai,lD1:()=>Rn,lVm:()=>Ct,vnX:()=>kb,$x5:()=>xb,_R1:()=>Db,wUm:()=>jb,z7V:()=>Ei,dC6:()=>Pt,MBD:()=>gt,GmF:()=>ia,cKm:()=>kt,iP_:()=>bn,NVC:()=>Nt,tPT:()=>Zs,tZe:()=>Up,kRE:()=>Ly,psB:()=>Dy,X0$:()=>zs,zE1:()=>ll,Wm5:()=>Gs,vyX:()=>Zu,wLZ:()=>el,W4V:()=>se,EtK:()=>Ts,Wtd:()=>Xs,asT:()=>Bg,kGs:()=>ge,ewt:()=>pT,O_f:()=>tu,sOy:()=>et,Tde:()=>dr,LMI:()=>ku,skb:()=>Uv,sPt:()=>Pu,sH1:()=>Su,RPM:()=>aE,h27:()=>qu,Uqd:()=>zu,xG:()=>Yv,Z2f:()=>eb,fgW:()=>pv,I69:()=>kv,ZxB:()=>Fv,mdt:()=>eE,Qbq:()=>Fh,rny:()=>Vi,UEY:()=>Na,Q0T:()=>Aa,Lyr:()=>Ca,sBn:()=>_a,itK:()=>ba,H9$:()=>ga,KPc:()=>va,zos:()=>Oa,ELQ:()=>La,dZs:()=>ua,Cz4:()=>la,z_L:()=>Ia,fGe:()=>sa,iuF:()=>ma,Wib:()=>ha,Hn0:()=>Ua,obS:()=>Da,E$L:()=>ca,XUh:()=>Ea,Qp_:()=>fa,_jk:()=>pa,sKE:()=>da,WmG:()=>Ta,QKx:()=>Sa,Oik:()=>Pa,s0A:()=>ya,o9m:()=>Ra,MCd:()=>wa,RsS:()=>Qu,tGK:()=>Il,lIv:()=>ul,Vg3:()=>Hi,mkC:()=>ji,xv5:()=>Ji,a14:()=>xi,yv0:()=>Ki,Zm0:()=>ki,Nxd:()=>Di,$mM:()=>Qi,ifj:()=>jr,NWi:()=>bb,xr3:()=>hb,wNf:()=>$l,iJH:()=>Ob,d89:()=>Ui,Edd:()=>Ci,Z5t:()=>Li,uGe:()=>wi,UoR:()=>Si,xvW:()=>mb,$qe:()=>Eb,yPM:()=>oa,$cp:()=>sl,vKJ:()=>al,AID:()=>Sf,B1H:()=>Ig,b7X:()=>jh,$uE:()=>_e,keo:()=>xh,C_p:()=>GE,G27:()=>$m,JA0:()=>gy,b3T:()=>ve,oC6:()=>be,_Zs:()=>Oe,epC:()=>Ne,YYG:()=>Ae,f_2:()=>Ay,w3l:()=>dg,QHB:()=>Mm,Jso:()=>bg,RXH:()=>Rm,Vr9:()=>Hm,lMm:()=>wh,BlA:()=>t_,fmQ:()=>ss,yRD:()=>tg,NcL:()=>HE,QK6:()=>de,ymd:()=>fp,JV_:()=>Qy,XiW:()=>qf,Yrx:()=>py,GPx:()=>Js,gjI:()=>Ks,vlo:()=>wT,E_P:()=>KT,aAL:()=>tp,NBq:()=>ls,wp9:()=>ZT,DsR:()=>Kc,MPc:()=>Lf,gWE:()=>Df,DT_:()=>jf,ipn:()=>xf,ORg:()=>Ai,_wz:()=>kf,RYR:()=>lT,PP2:()=>fy,wS7:()=>sb,cBQ:()=>Dc,pBq:()=>yf,DsO:()=>ee,X78:()=>Ky,xZs:()=>Wy,YFy:()=>yy,Gmt:()=>Fy,K$w:()=>xy,DSj:()=>rp,k9j:()=>kc,ww$:()=>tl,WVU:()=>ky,hxF:()=>Ys,nwO:()=>i_,Mzk:()=>wc,aFF:()=>Yh,HRH:()=>pu,EZK:()=>Wp,Kxm:()=>Mp,Z9i:()=>_E,CrF:()=>wy,DNd:()=>ka,vUy:()=>Jg,lJh:()=>fu,zHo:()=>Tu,sEJ:()=>Dg,UO$:()=>bf,zeJ:()=>hr,dLR:()=>bs,JQy:()=>As,XtP:()=>ms,Ug0:()=>Jr,A1W:()=>kh,sw:()=>Gp,nv3:()=>Sb,JgD:()=>Pb,nve:()=>jg,SkP:()=>Ns,SAs:()=>Tf,PWK:()=>jo,IM5:()=>hs,Mfk:()=>Dh,mB6:()=>nb,p6d:()=>w,o0x:()=>U,ufS:()=>qh,k7L:()=>Qh,mrB:()=>I,ncP:()=>He,Zmi:()=>We,hm5:()=>Be,ECL:()=>Fr,vPL:()=>qp,qmL:()=>QT,hXd:()=>Wi,OCS:()=>Yi,p2l:()=>Ss,qF1:()=>Tp,_X$:()=>Ep,yj2:()=>UO,bzh:()=>nE,k66:()=>Bo,kiP:()=>oo,pSg:()=>ce,kz_:()=>hy,H_U:()=>Qo,t9e:()=>Wa,j2$:()=>Cp,PFL:()=>tr,aJ3:()=>rO,To9:()=>yr,wpo:()=>dd,ADq:()=>hE,UUb:()=>EE,tQX:()=>mE,xy8:()=>ar,EUG:()=>br,AFK:()=>at,X3M:()=>mr,WN0:()=>qo,kDl:()=>Os,uDV:()=>qT,IhQ:()=>gs,R$r:()=>HT,w80:()=>_o,Pfu:()=>Va,Gtj:()=>gl,fyF:()=>vl,kkq:()=>Yo,u5q:()=>Ke,O$n:()=>cd,ptG:()=>pd,f4_:()=>tm,uap:()=>em,d7q:()=>cy,liG:()=>Ty,$oF:()=>uy,avf:()=>bT,DiQ:()=>hT,cfX:()=>mT,vD3:()=>vT,Qrb:()=>ET,EJQ:()=>OT,HWy:()=>TT,y6v:()=>fT,JUW:()=>Ny,GtP:()=>pm,_kX:()=>Fa,u1e:()=>Ma,sJj:()=>Vh,CJp:()=>um,uKF:()=>$h,wo0:()=>Cy,s5:()=>Fo,cwx:()=>xo,Y6b:()=>Zd,TTx:()=>Vy,UtR:()=>ey,HaQ:()=>Gy,E6I:()=>Sy,Won:()=>ry,vTU:()=>Xd,Nsy:()=>ed,KMQ:()=>Wh,Do$:()=>id,CSV:()=>Us,TMe:()=>ty,l1V:()=>mu,VQ1:()=>vu,z7d:()=>IT,Xaq:()=>Jo,Sj8:()=>Zg,PJj:()=>Pl,k3T:()=>zr,PjQ:()=>Ri,s7l:()=>gc,GGR:()=>NT,j5q:()=>_T,DnY:()=>bc,RY5:()=>$T,Px$:()=>uT,KPC:()=>Pg,NIY:()=>Pc,HvW:()=>Ac,Fof:()=>Ya,BTI:()=>od,uie:()=>Kp,ChB:()=>Yp,q27:()=>fd,fAQ:()=>Zy,XkT:()=>hc,lrH:()=>ef,nt9:()=>Br,XH8:()=>ud,XH2:()=>Xr,jFi:()=>ld,qhs:()=>go,wwR:()=>ad,Uk3:()=>ot,ev7:()=>Ug,RB9:()=>vy,iFp:()=>sE,e$p:()=>uE,PcX:()=>cE,SpP:()=>lE,R6_:()=>iO,CY1:()=>dO,Ajk:()=>fc,Yiz:()=>yc,FK9:()=>sc,UOo:()=>Hh,aTW:()=>$y,uug:()=>Ml,P$2:()=>TO,XS2:()=>Ul,Hyb:()=>Xl,d3Y:()=>nc,Klp:()=>ac,WxZ:()=>EO,Gzu:()=>Eu,ZOr:()=>mc,uqV:()=>Hd,Pm4:()=>re,nVD:()=>GT,dED:()=>sy,P2h:()=>oy,jrr:()=>ro,mmY:()=>io,T6O:()=>Ho,h6J:()=>Sp,hM2:()=>gg,XR6:()=>X,jmz:()=>BT,IHt:()=>YT,NZI:()=>gE,wdF:()=>Xy,kgP:()=>zy,ZYI:()=>cp,QXK:()=>ml,efz:()=>hl,Q5d:()=>El,Ysv:()=>bl,UWq:()=>LT,ocC:()=>CT,io3:()=>Hr,Sbt:()=>No,roS:()=>Ao,Ww1:()=>Ro,QaS:()=>Ic,ERZ:()=>cg,CL1:()=>_g,idV:()=>Vp,nIW:()=>rt,fjE:()=>aO,sG0:()=>Kh,tV7:()=>Sl,g8o:()=>$O,Qy:()=>MO,t2P:()=>tO,wId:()=>fo,LS0:()=>To,bFH:()=>jd,Rgl:()=>xd,fW1:()=>KE,Ywp:()=>Lb,pg:()=>hd,WSA:()=>Fd,fed:()=>Og,tT_:()=>_s,KbL:()=>vc,JBA:()=>ut,aNC:()=>Rb,RFJ:()=>up,Zeh:()=>hf,OT5:()=>Cb,mC3:()=>pl,kR6:()=>e_,NVY:()=>XT,k6v:()=>mp,FEC:()=>hp,Ob5:()=>Td,KUV:()=>Ed,dvH:()=>JT,V3i:()=>Xm,VD3:()=>Kr,mm2:()=>Ou,rou:()=>lf,izH:()=>$a,DK$:()=>Ga,KMp:()=>ep,c31:()=>Yt,mbo:()=>OE,gT8:()=>Qt,CZ8:()=>as,uGi:()=>ps,Poc:()=>Gt,_9k:()=>fs,ZTM:()=>us,bwT:()=>ds,tzW:()=>Kt,tF$:()=>qt,o96:()=>os,M4S:()=>ys,_vs:()=>Qc,xF8:()=>cT,HQx:()=>Bh,ATu:()=>bE,j1S:()=>gi,V3K:()=>Oi,Lmx:()=>vi,ZaZ:()=>Wt,n_1:()=>Jd,N6e:()=>Xc,SxO:()=>no,w3p:()=>zT,xU7:()=>pe,Y_p:()=>wo,$k6:()=>So,Gdl:()=>Xh,U6P:()=>Jh,OwB:()=>nO,hTh:()=>WT,xqc:()=>Mo,JvE:()=>$o,i29:()=>Vu,dzT:()=>Mi,uPS:()=>Lc,cZV:()=>Cc,n3B:()=>hv,e6O:()=>dv,s7j:()=>DO,j$Q:()=>Ry,kW2:()=>cm,tH7:()=>ko,Yxg:()=>ks,MaZ:()=>AT,nqN:()=>gT,jWj:()=>jT,o_J:()=>Xo,hgZ:()=>Bp,yW4:()=>wp,uT0:()=>Rp,C82:()=>Pp,u9Z:()=>sf,J$m:()=>Kd,j_Q:()=>uc,OaI:()=>cc,wB1:()=>wg,SP6:()=>md,ZYr:()=>Rg,IMU:()=>lp,FoU:()=>_y,DVz:()=>rb,mxe:()=>Ev,FHr:()=>Ef,D1g:()=>uf,VO3:()=>Vb,de5:()=>$b,Uw1:()=>Te,J6q:()=>vE,XCe:()=>Za,Ir:()=>uo,XQO:()=>co,QXb:()=>Sd,P8_:()=>By,iiD:()=>Zc,MOC:()=>wd,WF:()=>Pd,xE1:()=>Ni,idW:()=>Wg,YL3:()=>Sc,Fn9:()=>T,j2U:()=>Ps,MpE:()=>Jt,kQw:()=>nr,mfm:()=>zl,vZp:()=>st,E8K:()=>Fg,VSb:()=>ns,vr_:()=>rr,Vmh:()=>Kg,FgW:()=>Jm,oDv:()=>Zo,kuw:()=>ts,eHk:()=>DT,Tt2:()=>zo,T6Y:()=>Sr,_26:()=>Hl,YkM:()=>pr,J6y:()=>Dl,njU:()=>Gl,TBP:()=>es,IT0:()=>AE,x_:()=>Gh,biM:()=>rd,TMl:()=>nd,Vkd:()=>Bl,WiY:()=>uO,_zi:()=>ql,J6D:()=>bu,Lt4:()=>gr,QEi:()=>Tr,whI:()=>Gr,KIu:()=>Yr,JhM:()=>oe,C_0:()=>Ur,qIF:()=>bv,O27:()=>E,aBi:()=>yd,xOX:()=>Vs,EdS:()=>ze,WgC:()=>Xe,eEv:()=>Zt,A4t:()=>Wl,YOQ:()=>lt,Wos:()=>Rr,jWr:()=>ja,Or$:()=>cr,lhE:()=>Qr,CwH:()=>fr,pzC:()=>Fs,ymH:()=>Vl,QZu:()=>lr,rYH:()=>lO,FVt:()=>Nr,Kn2:()=>ue,jgw:()=>Zl,OXP:()=>rs,lS4:()=>Er,g5f:()=>cO,fp6:()=>xl,Uty:()=>Zi,YkG:()=>ur,xdS:()=>Ht,kMF:()=>Ff,$NE:()=>Ze,bC9:()=>Je,KVV:()=>Mh,q9e:()=>Po,iIf:()=>zh,ian:()=>Bs,m6e:()=>Cr,OFd:()=>Ms,kqr:()=>ir,fnZ:()=>Vr,VFZ:()=>qs,ZiX:()=>qe,j5n:()=>_r,zkt:()=>_,Pcm:()=>Sg,QDV:()=>xs,M5u:()=>sO,laD:()=>mv,mtq:()=>zt,CtB:()=>Zh,CBv:()=>ae,I0t:()=>Ir,u1G:()=>ST,gk1:()=>fv,Bgb:()=>yv,uzs:()=>Wr,v0l:()=>Au,Zqp:()=>ny,j0k:()=>Do,tCm:()=>it,gmx:()=>Cl,mOr:()=>uu,TwZ:()=>VO,GyU:()=>wb,zGm:()=>vd,bMg:()=>Gd,EyD:()=>fb,FQA:()=>Tb,fZN:()=>Bd,xsF:()=>db,Lxg:()=>yb,O3l:()=>Fc,Wni:()=>xc,wRx:()=>gb,OxG:()=>Cd,uJQ:()=>Ud,qWg:()=>tb,i96:()=>bd,zhn:()=>vb,G8q:()=>hi,Jct:()=>nT,A9Y:()=>te,Y5F:()=>rg,gxP:()=>le,c$P:()=>Ll,M7o:()=>Xu,BBN:()=>to,ZBU:()=>J,UkJ:()=>Eo,xkv:()=>Yy,z$M:()=>Yg,KAm:()=>Oy,lCl:()=>wf,rkF:()=>WE,IU6:()=>xp,RGr:()=>h,aYu:()=>m,ije:()=>Rl,Buf:()=>zc,YLu:()=>Nl,ct9:()=>Uo,XkY:()=>Wd,T5R:()=>gd,uQS:()=>qd,wcJ:()=>Io,d$I:()=>rl,rSp:()=>td,Sx:()=>Rc,Ilm:()=>cl,Ki6:()=>Ws,VGk:()=>Hc,sFD:()=>Pm,eWN:()=>qg,dWE:()=>LO,Lkd:()=>Qf,aDL:()=>Of,yaA:()=>Qd,lOh:()=>pf,DBr:()=>zb,hK$:()=>wl,TZ_:()=>kp,CMB:()=>Ov,FU8:()=>Nc,J$p:()=>Af,b5s:()=>_f,h2W:()=>nt,SL_:()=>nf,oUH:()=>_p,ck9:()=>_d,Xs0:()=>Al,u7I:()=>cf,rxg:()=>nu,bji:()=>iu,oCZ:()=>FE,MjG:()=>Mb,FuV:()=>gp,$ju:()=>Np,t6d:()=>Ap,m5F:()=>fe,sx:()=>Qg,rSc:()=>ib,U10:()=>pc,L8n:()=>jy,R9X:()=>zd,rj2:()=>Hy,_C4:()=>Lp,tCj:()=>qy,uAg:()=>dy,wx9:()=>dT,KF3:()=>Dp,ax9:()=>jp,HH7:()=>Jc,_6y:()=>jc,AJo:()=>Uc,Ixr:()=>Py,P6Y:()=>a_,Bd_:()=>DE,xkB:()=>LE,W41:()=>of,WkI:()=>af,sSE:()=>CE,GMd:()=>xu,Bxm:()=>kE,FVh:()=>PE,U_T:()=>Md,FTe:()=>ie,VGB:()=>ne,Wfe:()=>yu,Ls5:()=>du,$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:()=>H,getStartOfDay:()=>P,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>_e,compareActivenessAttributes:()=>ve,compareAttributes:()=>be,compareImages:()=>Oe,compareRoles:()=>Ne,compareTags:()=>Ae});var o={};r.r(o),r.d(o,{addAttribute:()=>Se,editAttribute:()=>we,editEndDate:()=>je,editRoles:()=>Ce,editStartDate:()=>De,editTags:()=>Le,removeAttribute:()=>Ue});var s={};r.r(s),r.d(s,{createHistoryManager:()=>Fe});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);return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)},N=e=>{const t=new Date(e);return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},R=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),P=R("startOf"),S=R("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"),D=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),x=(0,l.test)(/^9+$/),F=(0,l.test)(/^[9az]+$/),M=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[F,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[F,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[D,(0,l.always)("YYYY")],[x,(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")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];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)("",[M(e),r,$(n),i,V(a),o])}return e},Q=/(9+)([^9]+)*/g,H=e=>{const t=[...e.toLowerCase().matchAll(Q)];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?Y(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)} ${H(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=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.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}`;function Ee(e){return e&&void 0!==e.uri}function me(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 he(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 be(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(be(d.value,y.value,r)):"Reference"===g(d)?he(d,y)?o.push.apply(o,be(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.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 Oe(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)||Ee(r)&&Ee(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function ve(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 ge(e,t){var r="configuration/sources/Reltio";function n(e,t){return e.crosswalk={type:t.type,value:t.value},e}function i(e){return e.removeIt=!0}var a=e.map((function(e){if(e.crosswalk)return[e];var i=t.filter((function(t){return 1===(t.attributes||t.attributeURIs||[]).filter((function(t){return t===e.uri})).length})),a=i.filter((function(e){return e.type===r})),o=i.filter((function(e){return e.type!==r})),s=[];switch(e.type){case"INSERT_ATTRIBUTE":s.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":s=s.concat(i.map((function(t){return n(e,t)})));break;case"DELETE_ATTRIBUTE":(o.length||0==a.length)&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),s=s.concat(a.map((function(t){return n({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":a.length?s=s.concat(a.map((function(t){return n({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)}))):s.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0}),o.length&&s.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}})}return s})),o=[].concat.apply([],a),s=function(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}(o,"typeUri");for(var l in s)if("undefined"!==l){var u=s[l],c=o.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===l||"INSERT_ATTRIBUTE"===e.type&&e.uri===l})),p=u.filter((function(e){return e.crosswalk&&e.crosswalk.type===r}))[0];!c.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0]&&p&&(o.push({type:"UPDATE_ATTRIBUTE",uri:p.uri,newValue:{value:p.value},crosswalk:p.crosswalk}),c.forEach(i)),u.forEach(i)}return(o=o.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),o}function _e(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 Ae(e,t){return me("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return me("UPDATE_ROLES").call(this,e,t)}function Re(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 Pe(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Re(r[i],r[i+1],e,t));return n}function Se(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Pe(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 Se(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 we(e,t,r,n,i,a){void 0===a&&(a=0);var o=Pe(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()?(Ie(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(Ie.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=Se(e,t,r,n,i,a),s}var c=we(e,o,o.valueUri,{},i,a);we(c,t,r,n,i,a+1)}function Ie(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ue(e,t,r,n){void 0===n&&(n=0);var i=Pe(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ue(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 Ce(e,t){e.roles=t||[]}function Le(e,t){e.tags=t||[]}function De(e,t){e.startDate=t||""}function je(e,t){e.endDate=t||""}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xe(e,t,r[t])}))}return e}function xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Fe=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=ke({},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:ke({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Me=r(76665);const $e="1Tempo4rary",Ve="1Tepmo4Rel",Ge=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),We=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,Ye=e=>()=>We(e),Be=(e,t)=>{const r=Ge(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return We(n)},qe=e=>e&&e.includes("uri$$"),Qe=Ye("entities"),He=Ye("relations"),Ke=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Xe=(0,l.startsWith)("entities/"),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),Ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),et=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),tt=(0,l.pipe)((0,l.split)("/"),l.head),rt=(0,l.pipe)((0,l.split)("/"),l.last),nt=(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}`)),at=(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("/")},ot=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},st=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),lt=e=>5===e.split("/").length,ut=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ct=e=>e.replace(/uri\$\$/g,$e);let pt,dt,yt,ft,Tt,Et,mt,ht,bt,Ot,vt,gt,_t,At,Nt,Rt,Pt,St,wt,It,Ut,Ct,Lt,Dt,jt,kt,xt;var Ft;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(pt||(pt={})),function(e){e.local="local",e.validationService="validationService"}(dt||(dt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(yt||(yt={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(ft||(ft={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(Tt||(Tt={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(Et||(Et={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(mt||(mt={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ht||(ht={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(bt||(bt={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Ot||(Ot={})),function(e){e.PROFILE="profile",e.MAP="map"}(vt||(vt={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(gt||(gt={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(_t||(_t={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(At||(At={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Nt||(Nt={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(Rt||(Rt={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(Pt||(Pt={})),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"}(St||(St={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(wt||(wt={})),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"}(It||(It={})),function(e){e.IN="in",e.OUT="out"}(Ut||(Ut={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Ct||(Ct={})),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"}(Lt||(Lt={})),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"}(Dt||(Dt={})),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.SingleAttributeView="com.reltio.plugins.entity.attributes.SingleAttributeView",e.TableAttributeView="com.reltio.plugins.entity.attributes.AttributeTableView",e.CustomView="com.reltio.plugins.ui.CustomActionView",e.MapView="com.reltio.plugins.react.EntityMapView",e.ImageAttributeView="com.reltio.plugins.entity.attributes.ImageAttributeView",e.PotentialMatchesView="com.reltio.plugins.entity.PotentialMatchesView"}(jt||(jt={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(kt||(kt={})),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.Search="SearchView"}(xt||(xt={})),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"}(Ft||(Ft={}));const Mt=Ft;let $t,Vt;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}($t||($t={})),function(e){e.Saving="Saving"}(Vt||(Vt={}));const Gt=(0,l.prop)("referencedEntityTypeURI"),Wt=(0,l.prop)("relationshipTypeURI"),Yt=(0,l.prop)("referencedAttributeURIs"),Bt=(0,l.curry)(((e,t)=>(0,l.pipe)(Yt,(0,l.filter)((0,l.startsWith)(e)))(t))),qt=Bt("configuration/relationTypes"),Qt=Bt("configuration/entityTypes"),Ht=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),Kt=(0,l.filter)(Ht),Jt=(e,t)=>!t||t.some((t=>t===e.uri));function Xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zt=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,ze),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",Mt.TYPE_STRING),(0,l.propEq)("type",Mt.TYPE_BLOB))]),Zt=(0,l.has)("values"),er=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Mt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Mt.TYPE_LOOKUP)],[Zt,(0,l.always)(Mt.TYPE_ENUM)],[zt,(0,l.always)(Mt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Mt.TYPE_BOOLEAN),(0,l.always)(Mt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),tr=(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){Xt(e,t,r[t])}))}return e}({},e,{type:er(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),rr=e=>!!e&&(!!e.autoGenerated&&e.type!==Mt.TYPE_NESTED||!!e.parentAutoGenerated),nr=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),ir=(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),ar=e=>nr(e)?"analyticsAttributes":"attributes",or=(0,l.propEq)("hidden",!0),sr=(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))),lr=sr(Mt.TYPE_NESTED),ur=sr(Mt.TYPE_REFERENCE),cr=sr(Mt.TYPE_IMAGE),pr=(0,l.either)(lr,ur),dr=(e,t)=>{const r=nr(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(".")},yr=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),fr=(0,l.pipe)(yr,Boolean),Tr=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),Er=(0,l.both)(fr,(0,l.pipe)(yr,("rdm",(0,l.pipe)(tt,(0,l.equals)("rdm")))));const mr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=ar({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]||br(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:[]},hr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=mr(e,t,r);return n.length?(0,l.last)(n):null},br=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",Mt.TYPE_NESTED),(0,l.propEq)("type",Mt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Mt.TYPE_REFERENCE),(0,l.pipe)(Yt,(0,l.map)((t=>hr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Or=[Mt.TYPE_ACTIVENESS_DATE,Mt.TYPE_DATE,Mt.TYPE_TIMESTAMP,Mt.TYPE_LOCAL_DATE],vr=[Mt.TYPE_ACTIVENESS_DATE,Mt.TYPE_TIMESTAMP,Mt.TYPE_LOCAL_DATE],gr=e=>Or.includes(e),_r=e=>vr.includes(e),Ar=[Mt.TYPE_INT,Mt.TYPE_LONG,Mt.TYPE_NUMBER,Mt.TYPE_FLOAT,Mt.TYPE_DOUBLE,Mt.TYPE_COUNT],Nr=e=>Ar.includes(e),Rr=e=>[Mt.TYPE_FLOAT,Mt.TYPE_DOUBLE].includes(e),Pr=[Mt.TYPE_BOOLEAN,Mt.TYPE_BOOLEAN_RADIO,Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Sr=e=>Pr.includes(e),wr=[Mt.TYPE_URL,Mt.TYPE_BLOG_URL,Mt.TYPE_IMAGE_URL],Ir=e=>wr.includes(e),Ur=sr(Mt.TYPE_EMAIL),Cr=e=>Mt.TYPE_SSN===e;var Lr,Dr=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(Lr||(Lr={}));const jr=(0,l.curry)(((e,t,r)=>{var n;const i=e===Lr.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)))})),kr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),xr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),kr),Fr=(0,l.pipe)((0,l.reject)(E),xr),Mr=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),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("?")?"&":"?")+kr(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;return{updateDCRUriFromResponse:u,enhanceUriWithDCR:d,getDCRObjectUris:y,getDCRUri:f}},$r={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Vr=(0,l.equals)($r.SUGGESTING),Gr=(0,l.equals)($r.EDITING),Wr=(0,l.equals)($r.VIEWING),Yr=(0,l.either)(Gr,Vr),Br=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),qr=(0,l.curry)(((e,t)=>(0,l.pipe)(Br(e),(0,l.prop)("extendsTypeURI"))(t))),Qr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(qr(e,r)));return n(r)})),Hr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=qr(e,n);return r})),Kr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Kr(e,Br(e,t.extendsTypeURI),r):void 0,Jr=(e,t)=>{const r=t.map(Hr(e));return(r.length?r.reduce(l.intersection):[])[0]},Xr=(e,t)=>Kr(e,(0,l.is)(Object,t)?t:Br(e,t),"typeImage"),zr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Qr(e,t,n.uri)?r.concat(n.uri):r),[]),Zr={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"},en={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},tn={[Zr.EQUALS]:"equals",[Zr.NOT_EQUALS]:"not",[Zr.STARTS_WITH]:"starts with",[Zr.MISSING_VALUE]:"missing value",[Zr.IN_RANGE]:"in range",[Zr.HAS_ALL]:"has all",[Zr.FULL_TEXT]:"full text",[Zr.EXISTS]:"exists",[Zr.COUNT_EQUALS]:"count equals",[Zr.COUNT_NOT_EQUALS]:"count not equal",[Zr.COUNT_LT]:"count less",[Zr.COUNT_LTE]:"count less or equal",[Zr.COUNT_GT]:"count greater",[Zr.COUNT_GTE]:"count greater or equal",[Zr.COUNT_RANGE]:"count in range",[Zr.LT]:"less than",[Zr.LTE]:"less than or equal",[Zr.GT]:"greater than",[Zr.GTE]:"greater than or equal",[Zr.IN_FILE]:"in file",[Zr.NOT_IN_FILE]:"not in file",[Zr.CONTAINS]:"contains",[Zr.ON]:"on",[Zr.BEFORE]:"before",[Zr.AFTER]:"after",[Zr.WITHIN]:"within"},rn="in",nn="notIn",an="not range",on=e=>({[rn]:Zr.EQUALS,[nn]:Zr.NOT_EQUALS}[e]||e),sn={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},ln={[sn.LAST_DAY]:"Last 24 hours",[sn.LAST_3DAYS]:"Last 3 days",[sn.LAST_WEEK]:"Last week",[sn.LAST_MONTH]:"Last month",[sn.LAST_YEAR]:"Last year",[sn.PICK_DATE]:"Pick date"},un={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},cn={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},pn="<No label>",dn={IN:"in",OUT:"out"};var yn=r(87918),fn=r.n(yn);function Tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){En(e,t,r[t])}))}return e}function En(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mn={startDate:{type:Mt.TYPE_ACTIVENESS_DATE,get label(){return fn().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Mt.TYPE_ACTIVENESS_DATE,get label(){return fn().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},hn=Tn({id:{type:Mt.TYPE_ENTITY_ID,get label(){return fn().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},mn,{roles:{type:Mt.TYPE_STRING,get label(){return fn().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Mt.TYPE_STRING,get label(){return fn().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),bn={workflow:{type:Mt.TYPE_STRING,get label(){return fn().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Mt.TYPE_STRING,get label(){return fn().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Mt.TYPE_STRING,get label(){return fn().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},On={commenter:{type:Mt.TYPE_STRING,get label(){return fn().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},vn={notResolved:{type:Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return fn().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},gn={createdBy:{type:Mt.TYPE_STRING,get label(){return fn().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Mt.TYPE_STRING,get label(){return fn().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},_n={matches:{type:Mt.TYPE_COUNT,get label(){return fn().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Mt.TYPE_COUNT,get label(){return fn().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},An={sourceSystems:{type:Mt.TYPE_STRING,get label(){return fn().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Mt.TYPE_STRING,get label(){return fn().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Mt.TYPE_INT,get label(){return fn().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Mt.TYPE_TIMESTAMP,get label(){return fn().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Mt.TYPE_STRING,get label(){return fn().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Nn={matchRules:{type:Mt.TYPE_STRING,get label(){return fn().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:Mt.TYPE_STRING,get label(){return fn().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Rn=Tn({},hn,bn,On,vn,gn,_n,An,Nn,{type:{type:Mt.TYPE_STRING,get label(){return fn().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var Pn=r(13980),Sn=r.n(Pn);function wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){In(e,t,r[t])}))}return e}function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Un=Sn().oneOf(["mobile","tablet","desktop"]),Cn=Sn().shape({deviceTypes:Sn().oneOfType([Un,Sn().arrayOf(Un)]),roles:Sn().arrayOf(Sn().string)}),Ln=Sn().shape({value:Sn().string,lookupCode:Sn().string}),Dn=Sn().shape({link:Sn().string,filename:Sn().string}),jn=Sn().shape({displayName:Sn().string,parent:Sn().string}),kn=Sn().oneOfType([Sn().string,Sn().number,Sn().bool,Ln]),xn=Sn().oneOfType([kn,Sn().arrayOf(kn)]),Fn=Sn().shape({fieldName:Sn().string,values:Sn().arrayOf(xn),filter:Sn().string,type:Sn().string}),Mn=Sn().shape({minValue:Sn().number,maxValue:Sn().number}),$n=Sn().shape({label:Sn().string,name:Sn().string,description:Sn().string,type:Sn().string,hidden:Sn().bool,faceted:Sn().bool,searchable:Sn().bool,uri:Sn().string,access:Sn().arrayOf(Sn().string),cardinality:Mn}),Vn=Sn().shape({label:Sn().string,uri:Sn().string,typeColor:Sn().string,direction:Sn().string,startObject:Sn().object,endObject:Sn().object}),Gn=Sn().shape({typeColor:Sn().string,typeIcon:Sn().string,typeImage:Sn().string,label:Sn().string,uri:Sn().string,attributes:Sn().arrayOf($n)}),Wn=Sn().shape({uri:Sn().string,label:Sn().string,memberTypes:Sn().array,extendsTypeUri:Sn().string,attributes:Sn().arrayOf($n)}),Yn=Sn().shape({uri:Sn().string,label:Sn().string,extendsTypeUri:Sn().string,relationshipTypeURIs:Sn().arrayOf(Sn().string)}),Bn=Sn().shape({uri:Sn().string,description:Sn().string,label:Sn().string,schemaVersion:Sn().string,entityTypes:Sn().arrayOf(Gn),roles:Sn().arrayOf(Sn().object),groupTypes:Sn().arrayOf(Sn().object),relationTypes:Sn().arrayOf(Vn),graphTypes:Sn().arrayOf(Yn),interactionTypes:Sn().arrayOf(Wn),sources:Sn().arrayOf(Sn().object)}),qn=Sn().shape({uri:Sn().string,type:Sn().string}),Qn=Sn().shape({uri:Sn().string,attributes:Sn().object,type:Sn().string,timestamp:Sn().number,members:Sn().object}),Hn=Sn().shape({uri:Sn().string,type:Sn().string}),Kn=Sn().shape({value:Sn().object,ov:Sn().bool,type:Sn().string,uri:Sn().string}),Jn=Sn().shape({refEntity:Sn().oneOfType([Sn().array,Sn().object]),refRelation:Sn().oneOfType([Sn().array,Sn().object]),value:Sn().object,ov:Sn().bool,type:Sn().string,uri:Sn().string}),Xn=Sn().oneOf((0,l.values)($r)),zn=Sn().shape({type:Sn().oneOf(Object.values(pt)).isRequired,attributeTypeUri:Sn().string.isRequired,parentUri:Sn().string.isRequired,uri:Sn().string,message:Sn().string}),Zn={attributeType:$n,showEmptyEditors:Sn().bool,lazy:Sn().bool,mode:Xn,metadata:Bn,ownError:zn,errors:Sn().arrayOf(zn),crosswalks:Sn().array,onAddAttributes:Sn().func,onAddOneMore:Sn().func,onDeleteAttribute:Sn().func,onChangeAttribute:Sn().func,additionalControlsRenderer:Sn().func,hideDeleteButton:Sn().bool,showNonOv:Sn().bool,state:Sn().oneOf(["deleted","edited"])},ei=wn({attributeValue:Kn},Zn),ti=wn({attributeValue:Jn},Zn),ri=Sn().shape({value:Sn().oneOfType([Sn().string,Sn().bool,Sn().number]),ov:Sn().bool,type:Sn().string,uri:Sn().string,lookupCode:Sn().string,lookupRawValue:Sn().string}),ni=Sn().shape({totalOvValues:Sn().number,totalValues:Sn().number}),ii=Sn().shape({inRelations:Sn().arrayOf(Sn().oneOfType([Sn().object,Sn().string])),outRelations:Sn().arrayOf(Sn().oneOfType([Sn().object,Sn().string])),groups:Sn().arrayOf(Sn().string),entityTypes:Sn().arrayOf(Sn().string),nextEntry:Sn().object}),ai=Sn().oneOf(["asc","desc"]),oi=Sn().shape({id:Sn().string,content:ii,allowOnlyCreateNew:Sn().bool,sortColumn:Sn().string,sortOrder:ai,"text-empty":Sn().string,max:Sn().number,icon:Sn().string,caption:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn,editingEnabled:Sn().bool}),si=Sn().shape({id:Sn().string,graph:Sn().shape({type:Sn().string,layout:Sn().number,deep:Sn().number,limit:Sn().number,uri:Sn().string,options:Sn().shape({reverseRelations:Sn().bool})}),sortBy:Sn().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:ai,max:Sn().number,icon:Sn().string,caption:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn}),li=Sn().shape({id:Sn().string,caption:Sn().string,pageSize:Sn().number,icon:Sn().string,canCreate:Cn,canRead:Cn,canUpdate:Cn,canDelete:Cn,attributes:Sn().object}),ui=Sn().shape({entityUri:Sn().string,entityType:Sn().string,entityLabel:Sn().string,object:qn}),ci=Sn().shape({relationUri:Sn().string,relationType:Sn().string,relationLabel:Sn().string,direction:Sn().string,object:Hn}),pi=Sn().shape({entity:ui,relation:ci}),di=Sn().shape({value:Sn().string,isRawFilter:Sn().bool}),yi=Sn().shape({id:Sn().string,label:Sn().string,name:Sn().string,availableEntityTypes:Sn().array}),fi=Sn().shape({id:Sn().string,allowMergeAll:Sn().bool,matchActions:Sn().object,availableTabs:Sn().arrayOf(Sn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),Ti=Sn().shape({matchRules:Sn().arrayOf(Sn().string),object:qn,shortestTransitiveMatchPath:Sn().arrayOf(Sn().shape({matchRules:Sn().arrayOf(Sn().string),match:Sn().string})),direct:Sn().bool,matchScore:Sn().number}),Ei=Sn().arrayOf(Ti),mi=Sn().arrayOf(Sn().shape({uri:Sn().string,label:Sn().string})),hi=[{label:fn().text("And"),value:"and"},{label:fn().text("Or"),value:"or"},{label:fn().text("And not"),value:"and not"},{label:fn().text("Or not"),value:"or not"}];function bi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oi=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),vi=(0,l.pipe)(Oi,(0,l.propOr)("","label")),gi=(0,l.curry)(((e,t)=>{const r=Oi(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),_i=(0,l.curry)(((e,t,r)=>{const[n,i]=gi(e,r);return Qr(e,n,t)||Qr(e,i,t)})),Ai=(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){bi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Ni=function(){let{reversedContextLabels:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={},r=r=>n=>{let{label:i}=n;const a=r===(e?dn.OUT:dn.IN)?"startObject":"endObject",{directionalContext:o}=n[a];return"directed"===n.direction&&1===(0,l.propOr)(0,"length",o)&&(i+=` (${o[0].labelPattern})`),!(i in t)&&(t[i]=!0,!0)},n=r(dn.IN),i=r(dn.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},Ri=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Pi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Si=(0,l.curry)(((e,t)=>e.every((e=>wi(e,t))))),wi=(0,l.curry)(((e,t)=>{const r=rr(t);return!t||(!t.access||t.access.includes(e))&&(e===Pi.READ||!r)})),Ii=(0,l.curry)(((e,t,r)=>wi(Pi.READ,r)&&(Vr(t)?wi(Pi.INITIATE_CHANGE_REQUEST,r):wi(e,r)))),Ui=Ii(Pi.CREATE),Ci=Ii(Pi.DELETE),Li=Ii(Pi.UPDATE),Di=Si([Pi.CREATE,Pi.MERGE,Pi.READ,Pi.UPDATE]),ji=Si([Pi.UPDATE,Pi.READ,Pi.CREATE]),ki=Si([Pi.UPDATE,Pi.READ]),xi=Si([Pi.DELETE,Pi.UPDATE,Pi.READ]),Fi=(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["*"])),Mi=(e,t,r)=>(0,l.pipe)((0,l.map)(Fi(e,t)),(0,l.filter)(l.identity))(r),$i=(e,t,r)=>{const n=Mi(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&wi(Pi.MERGE,r)},Vi=(0,l.curry)(((e,t,r,n)=>{const i=Oi(e,n),[a,o]=gi(e,n);return i&&wi(Pi.CREATE,i)&&Qr(e,a,t.type)&&Qr(e,o,r.type)})),Gi=(e,t,r,n,i)=>{const a=Br(e,n.type),o=Mi(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(Vi(e,n,i))||a.some(Vi(e,i,n))}))},Wi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Br(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:$i(o,i,a),canAddRelation:Gi(e,o,i,r,n),canMark:wi(Pi.UPDATE,a)&&wi(Pi.READ,a)}},Yi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Wi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Bi=nr,qi=(0,l.complement)(Bi),Qi=wi(Pi.READ),Hi=e=>{let{attributeType:t,mode:r}=e;return qi(t)&&Ui(r,t)&&!or(t)},Ki=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=qe(r.uri),o=Li(n),s=Ui(n);return(0,l.cond)([[Bi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Ji=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=qe(r.uri),s=Li(n),u=Ci(n),c=zi(Pi.UPDATE,n,a,r),p=zi(Pi.DELETE,n,a,r);return(0,l.cond)([[Bi,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)},Xi=(0,l.curry)(((e,t,r,n)=>{const i=br(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=>!wi(e,n)||!Xi(e,t,r[n.name],n)))))})),zi=(0,l.curry)(((e,t,r,n,i)=>Vr(t)?Xi(Pi.INITIATE_CHANGE_REQUEST,r,n,i):Xi(e,r,n,i))),Zi=(0,l.both)((0,l.complement)(or),Qi),ea="SuperUser",ta="allTenants",ra=[ta,"allCustomers"],na=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===ea})).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===ea){const e=r?ra.concat(r.map((e=>`allTenants.${e}`))):ra,n=r&&t[0]===ta?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}))},ia={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"},aa={[ia.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[ia.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[ia.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[ia.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[ia.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[ia.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[ia.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[ia.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[ia.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[ia.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[ia.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[ia.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[ia.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[ia.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[ia.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[ia.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[ia.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[ia.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[ia.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[ia.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[ia.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[ia.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[ia.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[ia.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[ia.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[ia.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},oa=(0,l.curry)(((e,t,r)=>na({allowedPermissionsNames:e,permissionsNames:ia,permissionsConfig:aa}).some((e=>e(t,{params:{tenant:r}}))))),sa=oa([ia.CAN_EXPORT]),la=oa([ia.CAN_EXPORT_ACTIVITIES]),ua=oa([ia.CAN_IMPORT_ENTITIES_FROM_DT]),ca=oa([ia.CAN_READ_ENTITIES_FROM_DT]),pa=oa([ia.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),da=oa([ia.CAN_UPDATE_PROCESS_INSTANCE]),ya=oa([ia.CAN_VIEW_WORKFLOW_DEFINITION]),fa=oa([ia.CAN_CONFIG_ENVIRONMENT_REGISTER]),Ta=oa([ia.CAN_UPDATE_WORKFLOW_DATA_TASK]),Ea=oa([ia.CAN_READ_WORKFLOW_DATA_TASK]),ma=oa([ia.CAN_MANAGE_WORKFLOW_DEFINITION]),ha=oa([ia.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ba=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),Oa=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),va=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ga=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),_a=oa([ia.CAN_EXECUTE_WORKFLOW_JOBS]),Aa=oa([ia.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),Na=oa([ia.CAN_CREATE_CONFIG_JAR]),Ra=oa([ia.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Pa=oa([ia.CAN_VIEW_CONFIG_JAR]),Sa=oa([ia.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),wa=oa([ia.CAN_VIEW_WORKFLOW_JOBS]),Ia=oa([ia.CAN_MAKE_BULK_UPDATE]),Ua=oa([ia.CAN_OPEN_DATA_LOADER_EXECUTE,ia.CAN_OPEN_DATA_LOADER_READ]),Ca=oa([ia.CAN_BULK_DELETE_PROFILES]),La=oa([ia.CAN_READ_MDM_DATA_ENTITIES]),Da=oa([ia.CAN_READ_DVF]),ja=oa([ia.IS_FREEMIUM_ADMIN]),ka=(0,l.reject)(or),xa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),ka,(0,l.filter)(e))(t),Fa=(0,l.curry)(((e,t)=>xa((t=>Hi({attributeType:t,mode:e})),t))),Ma=(0,l.curry)(((e,t)=>xa((t=>Hi({attributeType:t,mode:e})||Zi(t)),t))),$a=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Zi)),Va=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Va(e)])))),Ga=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Zi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ga(e)])))),Wa=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Wa(e)])))),Ya=(0,l.pipe)(Br,(0,l.converge)(l.concat,[Ga,Wa]));function Ba(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qa(e,t,r[t])}))}return e}function qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qa=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Qa(e)))},t))),Ha=e=>{var t;return Ba({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ka=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ja=(0,l.when)(Ka,(0,l.dissoc)("values")),Xa=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Ba({},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})})),za=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Za=(0,Dr.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Va,t).concat((0,l.chain)(Va,r)).some(za)})),eo=e=>{let t=!1;const r=Qa((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Ba({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},to=e=>{const t=Za(e),r=(0,l.map)((e=>Qa((0,l.pipe)(Ja,(0,l.when)((0,l.always)(e),Xa))))(t)),n=(0,l.map)(Ha),i=(0,l.map)(eo);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},ro=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),no=(0,l.prop)("relationshipTypeURIs"),io=(0,l.curry)(((e,t)=>e.graphTypes.filter(ao(e,t)))),ao=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(_i(e,t))},oo=(e,t)=>(0,l.pipe)(ro,(0,l.defaultTo)({}),no,(0,l.defaultTo)([]),(0,l.chain)(gi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Br(e)))(e,t),so=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),lo=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),uo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lo((0,l.complement)(so))(e)},co=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lo(so)(e)},po=(0,l.pipe)(Br,(0,l.propOr)([],"matchGroups")),yo=(e,t,r)=>(0,l.pipe)(po,(0,l.find)((0,l.propEq)("uri",r)))(e,t),fo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(yo,(0,l.propOr)(r,"label"))(e,t,r))),To=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(po,(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]})),Eo=e=>(0,l.partition)(so,e),mo=(0,l.includes)(l.__,["and","or","not"]),ho=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),bo=(0,l.includes)(l.__,["equals","notEquals","in"]),Oo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return mo(t)?Oo(r):ho(t)?r.filter(ze):bo(t)?r.map((0,l.prop)("uri")).filter(ze):[]})),l.uniq),vo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(Oo),l.uniq),go=(0,l.pipe)(po,vo),_o=(0,l.pipe)(To,vo),Ao=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},No=(0,l.pipe)(Ao,Ga),Ro=(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||Qr(e,n,t)})(e,t))})(e,t)),Po=e=>!!e.required,So=(e,t,r)=>{const n=(0,l.cond)([[ze,Br(e)],[Ze,Oi(e)]])(t);return wo(e,n,r)},wo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&ze(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!rr(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Mt.TYPE_REFERENCE){const n=Wt(t),a=Yt(t);i=So(e,n,r).filter((e=>a.some(et(e.uri))))}else t.attributes&&(i=wo(e,t,r));i&&n.push(...i)}return n})):t.type===Mt.TYPE_REFERENCE?So(e,Wt(t),r):[],Io=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),Po]),e.attributes||[])},Uo=(e,t)=>{const r=Qt(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},Co=(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)?fn().text(n):n};return r(null,t)})),Lo=["label","description","abbreviation","caption","toolTip"],Do=e=>Co(Lo,e),jo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=rt(t);return r.find((e=>{let{uri:t}=e;return rt(t)===n}))})),ko=(0,l.curry)(((e,t)=>{const r=rt(t);return(0,l.pipe)(jo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),xo=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"})},Fo=(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}))},Mo=(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)})),$o=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Br(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Vo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Go(e,t,r[t])}))}return e}function Go(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=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 Yo(i,e,t,r,n)},Yo=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:br(t,r)).map((e=>e.map((e=>{const r=Wo(t,e,n,i);return r.length?Vo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(pr),(0,l.prop)("children"))).filter(Zi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Bo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["attributes","analyticsAttributes"])},qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["attributes"])},Qo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Wo(e,t,r,["analyticsAttributes"])},Ho=(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)})),Ko=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return rt(r)===e})))),Jo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Ko("LUD")),(0,l.defaultTo)(r))(t||[])},Xo=(e,t)=>{let{survivorshipStrategies:r}=e;return Ko(t,r)},zo=(0,l.allPass)([(0,l.complement)(l.isNil),wi(Pi.READ)]),Zo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),wi(Pi.READ)]),es=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),wi(Pi.CREATE)]),ts=(0,l.curryN)(2,(0,l.pipe)(Br,Zo)),rs=e=>{let{ov:t}=e;return!1!==t},ns=(e,t)=>((e,t)=>Ir(e.type)&&ae(t))(e,t)||((e,t)=>Ur(e.type)&&oe(t))(e,t),is=(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))),as=is("refEntity"),os=is("refRelation"),ss=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ls=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},us=(0,l.prop)("objectURI"),cs=(0,l.prop)("objectURI"),ps=(0,l.prop)("type"),ds=(0,l.pipe)(as,(0,l.defaultTo)({}),us),ys=(0,l.pipe)(os,(0,l.defaultTo)({}),cs),fs=(0,l.pipe)(as,(0,l.defaultTo)({}),ps),Ts=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Es=(0,l.evolve)({refEntity:re,refRelation:re}),ms=(e,t,r,n)=>{const i=mr(e,r),a=Br(e,t.type)||Oi(e,t.type);if(0===i.length)return null;const o=ar(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(!Jt(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=>Wt(e)===r.uri||Gt(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},hs=(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?hs(a.value,o):a},bs=(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 hs(e[r],i)})),Os=(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")]]),vs=(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.map)(Os),(0,l.when)((()=>i.length>0),(0,l.map)(vs(e,i))))(r)})),gs=vs(null),_s=vs(rs),As=(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=bs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ns=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ds,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Rs=Object.values(mn),Ps=(0,l.includes)(l.__,Rs),Ss=e=>Rs.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function ws(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Is(e,t,r[t])}))}return e}function Is(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Us=(e,t)=>`${e}_${t}`,Cs=[Rn.matches.name,Rn.matchRules.name],Ls=(0,l.values)(bn).map((e=>e.name)),Ds=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ls)))),js=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Cs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Us(`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,Ds(r),js(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Us(`dtPotentialMatches.${t.name}`,"")))))(Rn)},xs=(0,l.propEq)("uri",Rn.type.uri),Fs=e=>(0,l.values)(Nn).some((0,l.propEq)("uri",e.uri)),Ms=(0,l.propEq)("uri",An.sourceSystems.uri),$s=Object.values(hn),Vs=(0,l.includes)(l.__,$s),Gs=e=>{let{entity:t,attributeType:r,value:n}=e;return ws({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Ws=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Ys=e=>{let{entity:t,attributeType:r,value:n}=e;return ws({},t,{[r.uri]:n})},Bs=(0,l.propEq)("uri",hn.roles.uri),qs=(0,l.propEq)("uri",hn.tags.uri);function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hs(e,t,r[t])}))}return e}function Hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ks=e=>{let{parentUri:t,attributeType:r}=e;return Qs({uri:Be(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[pr,(0,l.always)({value:{}})],[fr,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},Js=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Fa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Tr,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Ks({parentUri:r,attributeType:e});let s=br(n,e);s&&(e.type===Mt.TYPE_REFERENCE&&(s=Kt(s)),a.value=Js({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!Tr(e)||(o[t]=[a])}return o},Xs=e=>{let{entity:t,metadata:r}=e;return So(r,t.type,!0).filter(Tr).reduce(((e,t)=>{const n=t.name,i=ut(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ms(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:Zs({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},zs=(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===Mt.TYPE_NESTED?Qs({},e,{value:zs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Qs({},s(t),Js({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),Zs=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Ks({parentUri:n,attributeType:r}),u=Os(l);return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},el=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{Se(e.attributes||e.value,r,n.uri,Os(n),a,o,i)}))},tl=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Me.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},rl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Me.ZP)(t,(e=>{Ue(e.attributes||e.value,r,n,i)}))},nl=(0,l.either)((0,l.propSatisfies)((0,l.anyPass)([e=>""===e,l.isNil]),"value"),(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity"))),il=(0,l.reject)(nl),al=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=>al({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),il)),(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 al({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Es),deleteEmptyComplex:e})},sl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(ol(e),(0,l.reject)(l.isEmpty))},ll=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Ps(r)?Gs({entity:e,attributeType:r}):Zs({entity:e,attributeType:r,parentUri:n,index:i})}),e))),ul=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Ps(r)?Ys({entity:e,attributeType:r,value:i}):tl({entity:e,attributeType:r,uri:n,value:i})})),cl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Ps(r)?Ws({entity:e,attributeType:r}):rl({entity:e,attributeType:r,uri:n})})),pl=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)},dl="UrlThumbnail",yl="CdnUrlThumbnail",fl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(rs):(0,l.head)(n);return e&&e.value}return null})),Tl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>fl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),El=Tl(["CdnUrl","Url"],!0),ml=Tl(["CdnUrlPreview","UrlPreview"],!0),hl=Tl([yl,dl],!0),bl=Tl([yl,dl]),Ol=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[ir,(0,l.always)(t)],[(0,l.both)(nr,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=ir(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Ps(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)}),[])},vl=(e,t,r)=>{const n=$a(e),i=(0,l.any)(r?l.T:rs);return Ol(n,t,i)},gl=(e,t,r,n,i,a)=>{const o=qe(null==r?void 0:r.uri)?Fa(t,e):Ma(t,e);return Ol(o,r,((e,o)=>{const s=Hi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:rs,e)||ir(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let _l;const Al=e=>{_l=e};function Nl(e,t){return _l(e,t)}const Rl=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)})),Pl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return Nl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},Sl=(0,l.once)((()=>Nl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),wl=e=>Nl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Il=(e,t)=>Nl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Ul=e=>Z.fromNull(tn[e]).map(fn().text).orSome(""),Cl=(0,l.curry)(((e,t)=>`${e}_${t}`)),Ll=(0,l.split)("_"),Dl=(0,l.includes)("_"),jl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),kl=(0,l.curry)(((e,t)=>e.some(jl(t)))),xl=kl([Zr.IN_RANGE,Zr.COUNT_RANGE,Zr.WITHIN]),Fl=kl([Zr.EXISTS,Zr.MISSING_VALUE]),Ml=(0,l.cond)([[Fl,(0,l.always)(0)],[xl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),$l=(0,l.complement)(Fl),Vl=kl([Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS]),Gl=kl([Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE]),Wl=kl([Zr.IN_FILE,Zr.NOT_IN_FILE]),Yl=e=>{switch(e){case Zr.COUNT_EQUALS:return Zr.EQUALS;case Zr.COUNT_NOT_EQUALS:return Zr.NOT_EQUALS;case Zr.COUNT_LT:return Zr.LT;case Zr.COUNT_LTE:return Zr.LTE;case Zr.COUNT_GT:return Zr.GT;case Zr.COUNT_GTE:return Zr.GTE;case Zr.COUNT_RANGE:return Zr.IN_RANGE}},Bl=kl([Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS]),ql=kl([Zr.WITHIN]),Ql=[[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE],[Zr.NOT_IN_FILE,Zr.IN_FILE],[Zr.EQUALS,Zr.NOT_EQUALS,Zr.HAS_ALL],[Zr.LT,Zr.LTE,Zr.GT,Zr.GTE],[Zr.MISSING_VALUE,Zr.EXISTS],[Zr.COUNT_RANGE],[Zr.IN_RANGE],[Zr.STARTS_WITH,Zr.CONTAINS],[Zr.FULL_TEXT],[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.NOT_EQUALS],[Zr.WITHIN]],Hl=(e,t)=>Ql.some((r=>r.includes(e)&&r.includes(t))),Kl=(0,l.pipe)(l.omit,l.values),Jl={OPTIONS_FOR_STRING:Kl(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_DATE:[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS,Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Kl(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_BLOB:Kl(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_NUMBER:Kl(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_LOOKUP:Kl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Zr),OPTIONS_FOR_ENUM:Kl(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Zr),OPTIONS_FOR_ID:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.IN_FILE,Zr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Zr.COUNT_EQUALS,Zr.COUNT_NOT_EQUALS,Zr.COUNT_LT,Zr.COUNT_LTE,Zr.COUNT_GT,Zr.COUNT_GTE,Zr.COUNT_RANGE,Zr.EXISTS,Zr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Zr.EQUALS,Zr.NOT_EQUALS,Zr.EXISTS,Zr.MISSING_VALUE]},Xl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Mt.TYPE_TYPEAHEAD:case Mt.TYPE_STRING:case Mt.TYPE_PASSWORD:case Mt.TYPE_TEXT:case Mt.TYPE_CIK_ID:case Mt.TYPE_URL:case Mt.TYPE_BLOG_URL:case Mt.TYPE_IMAGE_URL:case Mt.TYPE_EMAIL:return Jl.OPTIONS_FOR_STRING;case Mt.TYPE_LOOKUP:case Mt.TYPE_DEPENDENT_LOOKUP:return Jl.OPTIONS_FOR_LOOKUP;case Mt.TYPE_ENUM:return Jl.OPTIONS_FOR_ENUM;case Mt.TYPE_DATE:case Mt.TYPE_ACTIVENESS_DATE:case Mt.TYPE_TIMESTAMP:case Mt.TYPE_LOCAL_DATE:return Jl.OPTIONS_FOR_DATE;case Mt.TYPE_BOOLEAN:case Mt.TYPE_BOOLEAN_RADIO:return Jl.OPTIONS_FOR_BOOLEAN;case Mt.TYPE_BLOB:return Jl.OPTIONS_FOR_BLOB;case Mt.TYPE_LONG:case Mt.TYPE_INT:case Mt.TYPE_FLOAT:case Mt.TYPE_DOUBLE:case Mt.TYPE_NUMBER:return Jl.OPTIONS_FOR_NUMBER;case Mt.TYPE_ENTITY_ID:return Jl.OPTIONS_FOR_ID;case Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Zr.EQUALS];case Mt.TYPE_COUNT:return Jl.OPTIONS_FOR_COUNT;case Mt.TYPE_NESTED:case Mt.TYPE_REFERENCE:case Mt.TYPE_IMAGE:return Jl.OPTIONS_FOR_COMPLEX;default:return Jl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Gl,n):n},zl=e=>[ht.and,ht.andNot].includes(e),Zl=e=>[ht.or,ht.orNot].includes(e),eu=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Zl)),tu=(ru=[ht.and],e=>e.slice(0,-1).every((e=>ru.includes(e.operator))));var ru;const nu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),iu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),au=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=[ht.or,ht.orNot],n=t?[ht.and,ht.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)&&au(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},su="and",lu=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)(su,n,e),o=(e=>[ht.andNot,ht.orNot].includes(e))(a)?ou(r):r;return i?o:`${t} ${a} ${o}`}),"")}},uu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),cu=e=>Array.isArray(e)?e.map(cu).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})),du=e=>`'${e}'`,yu=e=>`"${e}"`,fu=(0,l.pipe)(cu,pu),Tu=(0,l.pipe)(fu,du),Eu=(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))),mu=(e,t)=>Gl(t)?{type:Mt.TYPE_INT}:Wl(t)?{type:Mt.TYPE_FILE}:Bl(t)&&!ql(t)&&_r(e.type)?{type:Mt.TYPE_LOCAL_DATE}:e,hu=Object.values(sn),bu=e=>hu.includes(e),Ou=e=>fn().text(ln[e]),vu=e=>{const t=f()();switch(e){case sn.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case sn.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case sn.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case sn.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case sn.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function gu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_u(e,t,r[t])}))}return e}function _u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Au=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Nu=(0,l.curry)(((e,t,r)=>{const n=r.map(xl(e)||t.endsWith(".count")?fu:Tu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),Ru=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Pu=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ml(t);return(0,l.pipe)(Ru(i),(0,l.map)(Nu(t,r)),Au(" or "))(n)},Su=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Tu).join(",")})`},wu=e=>`*${e}*`,Iu=e=>`URL:${e}`,Uu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Cu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Zr.IN_FILE?r:`not ${r}`},Lu=(e,t)=>[P(e,t),S(e,t)],Du=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!ju(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Zr.ON:return gu({},e,n?{filter:Zr.EQUALS}:{filter:Zr.IN_RANGE,values:[Lu(i,n)]});case Zr.BEFORE:return gu({},e,{filter:Zr.LTE,values:[[S(i,n)]]});case Zr.AFTER:return gu({},e,{filter:Zr.GTE,values:[[P(i,n)]]});case Zr.WITHIN:return gu({},e,{filter:Zr.IN_RANGE,values:[vu(i)]})}}return e}),Pu),ju=(0,l.propSatisfies)(_r,"type"),ku=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",Zr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(Pu({filter:Zr.EQUALS,fieldName:t,values:[r]}))),new lu).build())),Au(" or "))(r)}],[(0,l.propEq)("filter",Zr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:r,filter:t,values:n.map((0,l.pipe)(cu,wu))})}],[(0,l.propEq)("filter",Zr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Pu(gu({},e,{values:(0,l.flatten)(r)})):Uu(r)?Su(gu({},e,{filter:"listEquals"})):Pu(e)}],[(0,l.propEq)("filter",Zr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Ml(t);return(0,l.pipe)(Ru(i),(0,l.map)(Nu(t,r)),Au(" and "))(n)})(gu({},e,{values:(0,l.flatten)(e.values)})):ju(e)?(e=>{const{values:t}=e,r=!ju(e),[n]=t;return(new lu).addClause(Pu(gu({},e,{filter:Zr.LT,values:[P(n,r)]}))).addClause(Pu(gu({},e,{filter:Zr.GT,values:[S(n,r)]}))).orBuild()})(e):Uu(t)?Su(gu({},e,{filter:"not listEquals"})):Pu(e)}],[(0,l.propSatisfies)(Wl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:r,filter:Cu(t,r),values:n.map((0,l.prop)("link")).map(Iu)})}],[(0,l.propSatisfies)(Gl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Pu({fieldName:`${r}.count`,values:n,filter:Yl(t)})}],[(0,l.propSatisfies)(Bl,"filter"),Du],[(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 Nu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Nu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,Pu]],xu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!$l(e)||Mu(r))},Fu=e=>Array.isArray(e)?Mu(e):null!=e&&cu(e).length>0,Mu=e=>e&&e.length>0&&e.every(Fu);function $u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Gu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Wu=(e,t,r)=>"children"===e?Bu(r,[...t][0],!0):r,Yu=(e,t,r)=>"values"===e?[...r,...t]:r,Bu=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)(Wu,t),e);if(!r&&Vl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Yu,t),e)}return(0,l.append)(t,e)},qu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Vu(e),r=e=>e.fieldName===t?e:r({fieldName:Gu(e),children:[e]});return r(e)})(t);return Bu(e,r)}),[]),Qu=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")),Hu=e=>{let[t]=e;return t.children?Hu(t.children):t.operator},Ku=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=Hu(t)===ht.andNot,a=n(t,!1),o=i?`not ${ou(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${Hu(r)||su} ${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&&Qu(i)&&!t?r(i):n(i,a)}],...e])(o))),new lu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},Ju=(0,l.pipe)((0,l.propOr)("","filter"),Dl),Xu=(0,l.map)((0,l.when)(Ju,(e=>{const[t,r]=Ll(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){$u(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),zu=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)(xu),Xu,qu,Ku([...e,...ku],t))},Zu=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),ec=[Zr.ON,Zr.BEFORE,Zr.AFTER,Zr.WITHIN,Zr.NOT_EQUALS,Zr.MISSING_VALUE,Zr.EXISTS],tc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.FULL_TEXT,Zr.EXISTS],rc=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.LT,Zr.LTE,Zr.GT,Zr.GTE,Zr.IN_RANGE],nc=(e,t)=>{const r=tr(e);return(e=>{switch(e){case mn.startDate.name:case mn.endDate.name:case bn.dueDate.name:case gn.createdTime.name:case gn.updatedTime.name:case An.reltioLoadDate.name:case An.createDate.name:case An.updateDate.name:case An.deleteDate.name:case An.publishDate.name:return ec;case _n.matches.name:case An.count.name:return rc;case bn.workflow.name:case bn.assignee.name:case bn.step.name:case On.commenter.name:case gn.createdBy.name:case gn.updatedBy.name:case An.sourceSystems.name:case An.value.name:return tc;default:return null}})(t)||Xl(r)},ic=[Zr.EQUALS,Zr.NOT_EQUALS,Zr.CONTAINS,Zr.STARTS_WITH,Zr.MISSING_VALUE,Zr.HAS_ALL,Zr.IN_RANGE,Zr.WITHIN,Zr.EXISTS,Zr.ON],ac=(0,l.pipe)(nc,(0,l.filter)((0,l.includes)(l.__,ic))),oc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),sc=e=>{let{query:t,body:r}=e;return t=oc(t),Nl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},lc=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)(zu(),Zu(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Fr(i)}`},uc=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=lc(e,t,r);return Nl(n)},cc=e=>Nl(`/entities/_total?${e}`),pc=(e,t)=>{const r=(0,l.pipe)((0,l.filter)(Zo),(0,l.map)((0,l.prop)("uri")))(e),n={filter:Zr.EQUALS,fieldName:"type",values:r},i={filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},a=zu()([n,i]);return Nl("/entities/_typeAheadSearch"+Fr({filter:a,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,max:4}),{method:"GET"})},dc=(0,l.pipe)((0,l.reject)(l.isNil),xr),yc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(zu(),Zu(i))(r),c=dc({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return sc({query:c,body:p})},fc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return yc({fieldName:t,searchParams:i,options:n})},Tc="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Ec=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)(zu(),Zu(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Tc,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Fr(i)}`},mc=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=Ec(e,t,r);return Nl(n)},hc=e=>Ac(e,{select:"secondaryLabel"}),bc=(e,t)=>{const{select:r=Tc,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Nl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Oc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),qe)),vc=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=Oc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=dr(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)(zu(),Zu(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Nl(`${s}/api/${o}/${t}/_object`,m)},gc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,_c={options:"sendHidden,addRefAttrUriToCrosswalk"},Ac=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_c;return Nl(`/${e}${Fr(t)}`)},Nc=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 Nl(n,r)},Rc=e=>Nl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Pc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Nl(`/entities/_events/_total${xr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Sc=(e,t)=>Nl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),wc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Nl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},Ic=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 Nl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Uc=e=>{const t=new FormData;return t.append("file",e),Nl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,fn().text("Can't upload file"));return Promise.reject(t)}))},Cc=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 Nl(`/personal/findSavedSearches${xr({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"}})},Lc=e=>Nl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Dc=e=>Nl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),jc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Nl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},kc=e=>{let{uri:t}=e;return Nl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},xc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),jc)(e),Fc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),jc)(e);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 $c=["max","offset","filter"],Vc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Vc(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){Mc(e,t,r[t])}))}return e}({},t,(0,l.pick)($c,e)))),Gc=(0,l.omit)(["activeness"]),Wc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],mt.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],mt.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Vc(e),(0,l.omit)($c))(e))),Gc,(0,l.omit)(["labels"])))(t),{url:`/${e}/_connections${Fr({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},Yc=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),Bc=(0,l.reject)(l.isNil),qc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),Qc=e=>Nl(qc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Hc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,qc);return Nl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},Kc=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?sl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(Bc,ne,JSON.stringify);return Nl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},Jc=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"),qc,n),o=be(i(t),i(r)).concat(ve(t,r));return Nl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},Xc=(e,t)=>{const{url:r,options:n}=Wc(e,t);return Nl(r,n).then(Yc)},zc=(e,t)=>Nl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Zc=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===dn.IN?a.inRelations=[n]:a.outRelations=[n],Nl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},ep=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Nl(`${t}/recentSearches${Fr({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},tp=e=>Nl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),rp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Nl(`/recentSearches${Fr({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ip(e,t,r[t])}))}return e}function ip(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ap={select:"label,secondaryLabel,name,type,startDate,endDate"},op=(0,l.reject)(l.isNil),sp=(0,l.pipe)(op,xr),lp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=np({},ap,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Nl(`/${t}/_tree${sp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},up=e=>{let{uri:t,graphUri:r}=e;const n=np({},ap,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Nl(`/${t}/_parents${sp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},cp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=np({},ap,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Nl(`/${t}/_hops${sp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function pp(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 dp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},yp="/activities",fp=e=>{let{label:t,description:r}=e;return Nl(yp,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:dp()}})},Tp=e=>{const t=Fr(e);return Nl(yp+t,{method:"GET"})},Ep=e=>Nl(`/activities/_total${Fr(e)}`,{method:"GET"}),mp=e=>{const{entityUri:t}=e,r=pp(e,["entityUri"]);return Nl(`/${t}/_activities${Fr(r)}`,{method:"GET"})},hp=e=>{const{entityUri:t}=e,r=pp(e,["entityUri"]);return Nl(`/${t}/_activities/_total${Fr(r)}`,{method:"GET"})};function bp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Op(e,t,r[t])}))}return e}function Op(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},gp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Nl(vp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},_p=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=vp({url:r,workflowPath:t,tenant:n})),Nl(s,{method:i||"GET",body:JSON.stringify(a),headers:bp({"Content-Type":"application/json"},null!=o?o:{})})},Ap=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=vp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Nl(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)},Np=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=vp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?bp({},l,{comment:o}):l;return Nl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Rp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=vp({url:`/tasks${s?Fr(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(bp({objectURIs:[i]},(0,l.reject)(E,a)))};return Nl(u,bp({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Pp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Nl(vp({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})})},Sp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Nl(vp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(bp({max:a,offset:o},i))})},wp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Nl(vp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Nl(vp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Up=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Cp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Nl(vp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},Dp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},jp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Ip({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},kp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Nl(vp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},xp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Nl(vp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Fp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(rs);return a&&a[0]&&(r=n.length>0&&a[0].value?Fp(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}}),""),Mp=(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=Fp(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},$p=/[,\s]*$/,Vp=e=>{const t=fn().text(pn);if(!e)return t;const r=e.replace($p,"");return""===r.toString().trim()?t:r},Gp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Wp=(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=Gp(e,r.referencedEntityTypeURI);if(n)return Mp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Mp({attributes:t||{}},r.dataLabelPattern);return""},Yp=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Bp=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)}`},qp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",Qp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),hl,(0,l.prop)("value"))),Hp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),Qp),Kp=(e,t,r)=>{const n=Hp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(bs(e),Qp)))(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")])})(Br(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ms(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,Qp))(r)})(e,r)||Xr(e,r.type);return qp(t,n)};function Jp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xp(e,t,r[t])}))}return e}function Xp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zp="DTSS/",Zp=(0,l.replace)(new RegExp("^entities/"),""),ed=e=>zp+e.dataTenant+"/"+e.uri,td=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),rd=e=>!(!e||!e.dataTenant),nd=(0,l.startsWith)(zp),id=(0,l.pipe)((0,l.ifElse)(nd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),ad=(0,l.ifElse)(rd,ed,(0,l.prop)("uri")),od=e=>e&&e.uri?e.dataTenant?ed(e):Zp(e.uri):"",sd=(0,l.curry)(((e,t,r)=>(Br(t,r.type)||{})[e]||"")),ld=sd("label"),ud=sd("typeGraphIcon"),cd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Br(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(rs)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Wp(e,o,i),uri:a.uri}})).filter(l.identity):[]},pd=(0,l.pipe)(cd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),dd=(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=dd(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):dd(e.slice(1),r)}})),yd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,fd=e=>(0,l.propOr)([],"matchRules",e),Td=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Jp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Ed=(e,t,r)=>t&&r?r.aEntity:e,md=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,sources:u,rules:c}=e;const p={max:r,deep:n,filter:s,sort:i,order:a,activeness:o,sources:u,rules:c};return Nl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),xr)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},hd=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 Nl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),xr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},bd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Nl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Od=(e,t,r)=>Promise.all(t.map((async t=>{await Nl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),vd=async(e,t)=>await Od(e,t,"NOT"),gd=async(e,t)=>await Od(e,t,"MATCH"),_d=async(e,t)=>await Promise.all(t.map((async t=>{await Nl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));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}function Rd(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 Pd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Nl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Sd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Qd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},wd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Qd({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Id=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Nl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Ud=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 Id({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Cd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(rd,i);return Promise.all([s.length?bd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Id({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Ld=(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=Rd(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)}),[])),Dd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Ld),jd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Nl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Dd)},kd=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)},xd=kd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Nl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Dd)})),Fd=kd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Nl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Md=(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)}},$d=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Nl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Vd=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 $d(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Gd=Vd("NOT"),Wd=Vd("MATCH"),Yd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(rd,a);return Promise.all([Od(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return $d(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},Bd=Yd("NOT"),qd=Yd("MATCH");function Qd(e){let{requestProvider:t=Nl,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}`,Ad({},Rd(s,["headers"]),{headers:Ad({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const Hd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Qd({url:Ec(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Kd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Qd({url:lc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Jd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Wc(t,r);return Qd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Yc,(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)))}))))},Xd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Qd({url:`${gc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},zd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Nl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Zd=e=>{let{dtssPath:t,tenant:r}=e;return Nl(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},ey=e=>{let{dtssPath:t,customerTenant:r}=e;return Nl(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},ty=e=>{let{dtssPath:t,tenants:r}=e;return Nl(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},ry=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Qd({url:gc(t),dataTenant:r,customerTenant:n,dtssPath:i})},ny=()=>Nl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function iy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ay(e,t,r[t])}))}return e}function ay(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=iy({},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 Nl(`${t}/api/${r}/graph/search${Fr({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},sy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Nl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:iy({},n,i),headers:{"Content-Type":"application/json"}})},ly=(e,t)=>`${e}/${t}/comments`,uy=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Nl(`${ly(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},cy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Nl(`${ly(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},py=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Nl(ly(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},dy=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Nl(`${ly(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 Nl(`${ly(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},fy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Nl(`${ly(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Ty=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Fr({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Nl(`${ly(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Ey(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hy=e=>{let{tenant:t,servicesPath:r}=e;return Nl(`${r}/oauth/proxy${Fr({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},by="graphExport",Oy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Ey({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:Ey({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Ay({servicesPath:e,tenant:t,environment:r,namespace:by,options:Ey({method:"POST"},o)})),s},vy=e=>{let{servicesPath:t,key:r}=e;return Nl(`${t}/settings${Fr({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},gy=e=>{let{servicesPath:t}=e;return Nl(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},_y=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Nl(`${n}/plugins${Fr({tenant:t,user:r})}`,{method:"GET"})},Ay=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Nl(`${n}/configService${Fr({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Ny=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Ay({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Ry=e=>{let{servicesPath:t,stateHash:r}=e;return Nl(`${t}/searchLink?key=${r}`,{method:"GET"})},Py=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),Nl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Sy=e=>Nl(`/${e}?showObjectsInfo=true`,{method:"GET"}),wy=e=>{let{exportPath:t,tenant:r,options:n}=e;return Nl(`${t}/${r}/activities${Fr(n)}`,{method:"POST"})};function Iy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uy(e,t,r[t])}))}return e}function Uy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cy=e=>{const{entityUri:t}=e;return Nl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ly=e=>{let{entityUri:t,crosswalk:r}=e;return Nl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Dy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Nl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Iy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Iy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},jy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Nl(`/${r}/_${n}${Fr({contributorURI:t})}`,{method:"POST"})},ky=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Nl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},xy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Nl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Fy=e=>{let{entityUri:t,crosswalkId:r}=e;return Nl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function My(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $y=e=>{let{entityTypeUri:t}=e;return Nl(`/dataQuality/fillRates${xr({entityType:rt(t)})}`,{method:"GET"})},Vy=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){My(e,t,r[t])}))}return e}({},n===wt.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Nl(`/entityType/${rt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},Gy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Nl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${rt(n)}`,{method:"GET",headers:{env:i}})},Wy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Nl(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},Yy=e=>{let{attributeUri:t,value:r}=e;return Nl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},By=e=>{let{attributeUri:t,value:r}=e;return Nl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},qy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Nl(`/${t}${Fr({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},Qy=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Fr({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=sl()([[{value:a}]]);return Nl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},Hy=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Nl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Ky=e=>{let{entityUri:t,attributeName:r}=e;return Nl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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{entityUri:t}=e;return Nl(`/${t}/_historicURIs`,{method:"GET"})},zy=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 Nl(`/${t}/_changesWithTotal${Fr(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){Jy(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},Zy=(e,t)=>Nl(`/${e}/_previousChange${Fr({timestamp:t})}`,{method:"GET"}),ef=(e,t)=>Nl(`/${e}${Fr({time:t})}`,{method:"GET"});function tf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rf(e,t,r[t])}))}return e}function rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nf=e=>{let{url:t,method:r,data:n,headers:i}=e;return Nl(t,tf({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:tf({"Content-Type":"application/json"},null!=i?i:{})}))},af=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Fr({options:a.join(","),severity:o.join(",")});return Nl(`${t}/validate/${i}/entity/${od({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},of=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Nl(`${t}/validate/${n}/entity${Fr({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},sf=e=>{let{tenant:t,apiPath:r}=e;return Nl(`${r}/tenants/${t}/name`,{method:"GET"})},lf=e=>{let{tenant:t,apiPath:r}=e;return Nl(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},uf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Nl(`${a}/preferences${Fr({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},cf=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 Nl(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},pf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Nl(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})};var df=r(29524);const yf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Qe(),s={attributes:Js({attributeTypes:n,parentUri:o,metadata:i,mode:a}),uri:o,type:t,timestamp:Date.now()};return r?function(e,t,r){const n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]).find((e=>!e.lookupCode&&!e.dependentLookupCode&&"String"===e.type));if(n){const i=ms(r,e,n.uri)[0];return i&&i.value?tl({entity:e,attributeType:n,uri:i.uri,value:t}):Zs({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},ff=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ds),(0,l.filter)(qe),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),Tf=(0,l.curry)(((e,t)=>{const r=ff(e=e||{},t=t||{});return r.concat((0,l.chain)(Tf(e),r))})),Ef=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),mf=Ef((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),hf=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),qe)),bf=e=>(0,l.pipe)(mf,hf(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Of=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(mf,(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})),vf=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),qe),(0,l.omit)(["uri","timestamp"])),gf=(0,l.pipe)(vf,(0,l.evolve)({attributes:sl(!0)})),_f=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=bf(i);if(a.length>0)for(const t of a)e=Of(t,r[t].uri,e);const o=(s=await Nc(gf(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Af=async(e,t,r)=>{const n=Rf(e,t),i={};for(const t of n)i[t]=await _f(e,t,i,r);return i},Nf=(0,l.curry)(((e,t)=>{const r=df.Node(t);return bf(e[t]).forEach((t=>{const n=Nf(e,t);r.addEdge(n)})),r})),Rf=(e,t)=>(0,l.pipe)((0,l.map)(Nf(e)),(0,l.map)(df.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Pf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(vf))})),Sf=(e,t)=>{const r=Ae(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=Oe(e,t),a=ve(e,t);return[...ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},wf=(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 Of(r,n,e)}),e))))}),t)}),Pf),If=(0,l.curry)(((e,t)=>(0,l.when)(qe,(0,l.propOr)(l.__,t,e),t)));function Uf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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{parentUri:t,relation:r,entityUri:n}=e;return{type:It.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Df=e=>{let{relationUri:t}=e;return{type:It.DELETE_RELATION,parameters:{relationUri:t}}},jf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:It.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},kf=e=>{let{oldRelation:t,newRelation:r}=e;return{type:It.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},xf=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:It.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Ff=(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))),Mf=e=>e.type===It.DELETE_RELATION,$f=e=>e.type===It.CREATE_RELATION,Vf=e=>e.type===It.REPOINT_RELATION,Gf=e=>e.type===It.UPDATE_RELATION,Wf=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Yf=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case It.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return Kc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case It.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Hc(e,i).then(o)};case It.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Zc(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case It.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return Jc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case It.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Df({relationUri:o}),Lf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(Bf(n)),(0,l.map)(Yf),Wf)(s)}}},Bf=e=>t=>Uf({dcrProcessor:e},t),qf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Mr({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(Bf(r)),(0,l.map)(Yf),Wf,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},Qf=e=>t=>(0,l.map)((t=>Uf({},t,{parameters:(0,l.evolve)({parentUri:If(e),entityUri:If(e),newEntityUri:If(e)},t.parameters)})),t),Hf=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},Kf=(e,t)=>{const r=e.filter($f).find(Ff(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>Gf(o)&&Ff(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!Vf(o)||!Ff(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(Hf({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},Jf=(e,t)=>{const r=e.filter(Vf).filter(Ff(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!Gf(i)||!Ff(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(Hf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},Xf=(e,t)=>{const r=e.filter(Mf).filter(Ff(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!Ff(t,e)))},zf=(e,t)=>{const r=e.filter(Gf).filter(Ff(t));let n=null;const i=e.filter((e=>!r.includes(e)||!Gf(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(Hf({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},Zf=e=>{const t=e.filter(Mf).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(Xf,e)},eT=e=>{const t=e.filter($f).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Kf,e)},tT=e=>{const t=e.filter(Vf).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(Jf,e)},rT=e=>{const t=e.filter(Gf).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)(zf,e))(t)},nT=e=>(0,l.pipe)(Zf,eT,tT,rT)(e);function iT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){aT(e,t,r[t])}))}return e}function aT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oT=e=>iT({},(0,l.path)(ET(),e),{startDate:(0,l.path)(OT(),e),endDate:(0,l.path)(vT(),e)}),sT=(e,t)=>(0,l.pipe)((0,l.path)(bT()),If(t))(e),lT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=sT(e,r),i=(0,l.path)(mT(),e)===Ut.IN,a=e.parentEntityUri||n;return Lf({parentUri:i?t:a,relation:oT(e),entityUri:i?a:t})})),...o.map((t=>{const i=sT(t,r),a=(0,l.path)(mT(),t)===Ut.IN,o=i!==(0,l.pipe)((0,l.path)(ET()),a?gT:_T)(t),s=RT(e,(0,l.path)(fT(),t)),u=t.parentEntityUri||n,c=If(r,i);return o?xf({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(ET(),t),isReversed:!1}):kf({oldRelation:(0,l.path)(ET(),s),newRelation:oT(t)})})),...i.map((e=>Df({relationUri:e}))),...s.map((e=>jf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},uT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;return iT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType}})}),{}),cT=(e,t)=>(0,l.pipe)(Oi,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Rs),ka)(e,t),pT=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)}},dT=(e,t,r)=>{const n=Mp(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)},yT="relation",fT=(0,l.always)([yT,"relationUri"]),TT=(0,l.always)([yT,"relationType"]),ET=(0,l.always)([yT,"object"]),mT=(0,l.always)([yT,"direction"]),hT=(0,l.always)([yT,"object","attributes"]),bT=(0,l.always)(["entity","entityUri"]),OT=(0,l.always)([yT,"startDate"]),vT=(0,l.always)([yT,"endDate"]),gT=(0,l.path)(["startObject","objectURI"]),_T=(0,l.path)(["endObject","objectURI"]),AT=(0,l.path)(["startObject","objectTypeURI"]),NT=(0,l.path)(["endObject","objectTypeURI"]),RT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(fT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=RT(r.connections,t);if(e)return e}}},PT=(0,l.pipe)(RT,(0,l.path)(ET())),ST=(0,l.allPass)([(0,l.pipe)((0,l.path)(bT()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(TT()),(0,l.complement)(E))]),wT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:He()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=CT({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=IT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?pT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},IT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length+t.length===1?e.length?{type:e[0],direction:dn.IN}:{type:t[0],direction:dn.OUT}:null},UT=e=>e.uri||e,CT=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Ui(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===dn.IN?"startObject":"endObject",{directionalContext:i}=t[n];return"directed"===t.direction&&1===(0,l.propOr)(0,"length",i)&&(r+=` (${i[0].labelPattern})`),!(r in o)&&(o[r]=!0,!0)}return!1},u=e=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Br(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Br(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(UT,Oi(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(dn.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(dn.OUT)),(0,l.map)(u))},t)||{}},LT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=Ni({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=gi(e,n.uri);return n&&(!t||Qr(e,i,t))&&(!r||Qr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Br(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Br(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(zo,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)}},DT=(0,l.curry)(((e,t,r,n,i)=>{const a=Qr(n,l.__,t.type),o=e?NT:AT,s=Qr(n,l.__,r.type),u=e?AT:NT;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),jT=(e,t,r)=>{const n=e?NT:AT,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(Qr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function kT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xT(e,t,r[t])}))}return e}function xT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kT({},t,{[r]:{parents:n,children:i}})},MT=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return kT({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},$T=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=ff(t,i),o=FT({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>$T(n.uri,t,[e],r)),o)},VT=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)(fT(),n),a=t?MT({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(bT(),n),s=qe(o)?[o]:[],u=FT({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>$T(t,r,[i],e)),u)}),n)},GT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return VT(r,e,t,$T(e,t))},WT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return GT(t,r,n);if(Je(e)){const t=RT(n,e);return t&&VT([t],null,r)}return r[e]?$T(e,r):void 0},YT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>YT(e,t))))},BT=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>BT(e,t))))},qT=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=Ke(t),u=GT(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(Je(c)){if(s=RT(i,c),!s)return null;o.push({type:Tt.relationConnection,value:s,valueType:Oi(a,(0,l.path)(TT(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:Tt.tempEntity,value:e,valueType:Br(a,e.type)});continue}const p=n[u],d=Ns(p,c),y=n[c];if(!d||!y)return null;o.push({type:Tt.attributeValue,value:d,valueType:hr(a,at(d.uri,p.type))}),o.push({type:Tt.tempEntity,value:y,valueType:Br(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},BT(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?PT(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?Oi(a,d.type):Br(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:br(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:Tt.tempEntity,value:T,valueType:Br(a,T.type)}),o.push({type:Tt.attributeValue,value:s,valueType:E}),m=s.value;const l=ds(s);T=l&&qe(l)?n[l]:null}}return o},QT=e=>e.every((e=>{let{type:t}=e;return[Tt.attributeValue,Tt.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===Tt.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,HT=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?HT(t.value):[]];return e.concat(r)}),[])),KT=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,JT=e=>{const t=[...HT((null==e?void 0:e.attributes)||[]),...HT((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},XT=(e,t)=>[e,...t.map((t=>KT(e,t)))],zT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},ZT=(e,t)=>{switch(e){case Et.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case Et.ENTITY_ATTRIBUTE:case Et.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[ot(t)]})(t);case Et.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case Et.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},eE=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),tE=(0,l.curry)(((e,t)=>{const r=Ao(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(tE(e,r.extendsTypeURI)):n})),rE=(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))),nE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),tE(e),rE(t))(t);function iE(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{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}},oE=e=>!e.deactivated,sE=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},lE=e=>sE(e)+e.message,uE=(0,l.unless)(l.isNil,(0,l.prop)("message")),cE=(0,l.unless)(l.isNil,(0,l.prop)("type")),pE=(0,l.curry)(((e,t)=>et(t.parentUri,e))),dE=(0,l.curry)(((e,t)=>t.parentUri===e)),yE=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),et(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Mt.TYPE_REFERENCE),(0,l.pipe)(Yt,(0,l.any)(et(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),fE=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),TE=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),EE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([AE,oE,pE(e),yE(t),(0,l.complement)(TE(e,t.uri))]))(r)},mE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([AE,oE,dE(e),fE(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",pt.missed))]))(r);return n&&n.message||""},hE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===pt.missed))},bE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(fT(),e))]))(t)},OE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},vE=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([oE,pE(t)]))(r)},gE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([oE,(0,l.propEq)("type",pt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},_E=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?qT(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 Tt.attributeValue:{const e=a;if(lr(a))return Mp(o,e.dataLabelPattern);if(ur(a)){const t=o,i=ds(t),a=Gt(e),s=Br(n,a);return qe(i)?Mp(r[i],s.dataLabelPattern):t.label}return""}case Tt.tempEntity:return Mp(o,a.dataLabelPattern);case Tt.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Br(n,null==e?void 0:e.entityType);return`${Vp(i&&qe(i)?Mp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||vi(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){iE(e,t,r[t])}))}return e}({},e,{label:Vp(t)})}))},AE=e=>!e.severity||e.severity===yt.ERROR,NE=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Mt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(NE(n))}));case Mt.TYPE_REFERENCE:return!!as(t);case Mt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),RE=(e,t)=>e.every((0,l.complement)(NE(t))),PE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=So(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ms(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!rs(e.parent))))).forEach((e=>{RE(e.attrValues,n)&&r.push(aE({type:pt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:fn().text("Attribute is required"),source:dt.local}))})),r}),[])},SE=(0,l.curry)(((e,t,r)=>ms(e,t,r,!1))),wE=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Br(e),(0,l.prop)("attributes"),(0,l.reject)(or),(0,l.filter)(ur),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(SE(e,t)));return(0,l.pipe)(r,(0,l.reject)(ds),(0,l.map)((e=>{let{uri:r}=e;return aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:at(r,t.type),parentUri:r,message:fn().text("Entity is required"),source:dt.local})})))(t)},IE=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ds,qe)).flatMap((n=>{const i=ds(n),a=t[i],o=hr(e,at(n.uri,r.type));return UE(e,t,o,a)})),UE=(e,t,r,n)=>{const i=Yt(r),a=i.map((t=>hr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Mt.TYPE_REFERENCE))).flatMap(qt).concat(i);return CE(e,t,n,(e=>a.some(et(e.uri))))},CE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=PE(e,r,n),a=wE(e,r),o=IE(e,t,r);return[...i,...a,...o]},LE=(e,t)=>{const r=(0,l.path)(ET(),t)||{};return PE(e,r)},DE=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(bT()),(0,l.ifElse)(qe,(e=>t[e]),(0,l.always)(null)))(r),i=LE(e,r),a=(e=>(0,l.path)(bT(),e)?[]:[aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(TT(),e),parentUri:(0,l.path)(fT(),e),message:fn().text("Entity is required"),source:dt.local})])(r),o=((e,t,r)=>r?CE(e,t,r):[])(e,t,n);return[...i,...a,...o]},jE=e=>(0,l.path)(["entity","uri"],e)?[]:[aE({type:pt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:fn().text("Entity is required"),source:dt.local})],kE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=PE(e,r),i=jE(t);return[...n,...i]};function xE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FE=(e,t)=>{var r,n;const i=Br(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Za(e)},ME=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),$E=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(ME(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},VE=(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)(ys,qe,l.not)]),(e=>{const t=(0,l.pipe)(ys,rt)(e);return $E((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(ds,qe),(t=>{const r=ds(t),n=e[r],i=n&&WE(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){xE(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),GE=(e,t,r)=>ge(be((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),_e((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))).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)(VE(r,e.type)),(0,l.map)($E(ct))))})(e))),WE=(e,t)=>(0,l.evolve)({attributes:al({valueTransformer:(0,l.pipe)(Es,VE(t),ME(ct)),deleteEmptyComplex:!0}),uri:ct})(e);function YE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BE(e,t,r[t])}))}return e}function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qE=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp($e,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),QE=e=>(0,l.pipe)((0,l.evolve)({objectUri:qE,objectParentUri:qE}),(e=>{return YE({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?pt.missed:pt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&ut(e.objectUri),uri:e.objectUri,source:dt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),HE=(e,t)=>(0,l.map)((0,l.pipe)(QE,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=_E(t,s),p=null!=c&&c.length?c.slice(0,-1):_E(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&hr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===Tt.attributeValue&&(a=e.valueType)}return a})(o,c,e);return YE({},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&&lt(i)){const n=(0,l.last)(a),i=n.valueType;if(ur(i)&&Qt(i).includes(o)){const i=ds(n.value),o=i&&qe(i)?t[i]:null;return o?YE({},e,{parentUri:o.uri,path:a.concat({type:Tt.tempEntity,value:o,valueType:Br(r,o.type),label:""})}):e}}return e}})(t)))(e),KE=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};function JE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var XE;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(XE||(XE={}));const zE={},ZE={random0:{granularity:3,colors:["#ffee91","#ffdc0e","#fec92f","#eab710","#f69785","#f57f27","#fccde5","#f8b6b8","#ff9acc","#ee4272","#b71137","#c4c0e1","#bd81be","#5f3577","#9fd6bf","#8accca","#12959f"]},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"]}},em=(0,l.curry)(((e,t)=>{const r=(e=>{if(!zE[e]){const t=ZE[e]||ZE.random0;zE[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){JE(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return zE[e]})(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]})),tm=e=>em(XE.Charts,e);var rm=r(51404),nm=r.n(rm);const im=Array.from({length:100},((e,t)=>t/100)),am=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)},om={},sm=new(nm())({hash:am,saturation:im.slice(15,71),lightness:im.slice(50,90)}),lm=(0,l.curry)(((e,t,r)=>{t in om||(om[t]={});const n=om[t];r in n||(n[r]=((e,t)=>{const r=String(am(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),um=lm(sm,"crosswalks"),cm=lm(sm,"sources"),pm=lm(sm,"contributors");function dm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ym(e,t,r[t])}))}return e}function ym(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fm=(0,l.has)("items"),Tm=e=>0===e,Em=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)},mm=e=>e.reduce(((e,t)=>e+t.width),0),hm=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),bm=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Om=e=>e.reduce(((e,t)=>e+t.height),0),vm=e=>(0,l.is)(String,e)&&e.includes("%"),gm=e=>Boolean(e.spacer),_m=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Am=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(fm(t)?Am(t):t)),[]),Nm=e=>({id:e.layout}),Rm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nm;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=vm(r.width)?_m(i,r.width):u}return Em(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return Em(n,t,r)},o=(e,t)=>fm(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,fm(s)?n(s.layout):e(s.view)),d=Tm(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(fm(s))return o.concat(p(dm({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(dm({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:mm(o),height:hm(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=fm(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=Tm(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(fm(i))return r.concat(p(dm({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(dm({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?Em(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?Em(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:bm(i),height:Om(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=Tm(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return dm({},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=dm({},e,{width:a}),s=dm({},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(dm({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return dm({},e,{height:Om(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(dm({},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 dm({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=dm({},t,{items:(0,l.reject)(gm,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 Am(f)},Pm=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id))));function Sm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wm(e,t,r[t])}))}return e}function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Im={BarChart:Lt.BAR,BarChartGrouped:Lt.BAR,BarChartHorizontal:Lt.BAR,LineChart:Lt.LINE,Map:Lt.MAP,Pie:Lt.PIE},Um=(e,t)=>st(e)?nt(e,t):e,Cm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Im[r];return Sm({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Lm=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Sm({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"]))},Dm=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Sm({},e,{value:[rn,nn,Zr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:on(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&st(t)||!r?n:(n||[]).concat((i=r,{filter:Zr.EQUALS,fieldName:"type",values:[i]}));var i},jm=["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"],km={"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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.BAR,component:Dt.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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.BUBBLE,component:Dt.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:Dt.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 Sm({id:t,count:o,canRead:u,orderType:s,attributeUri:Um(r,p),filters:Dm(a,r,p),component:Dt.DashboardFacet,title:i,showOthers:!0},Cm(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:Um(n,r),filters:Dm(a,n,r),chartType:Lt.MAP,component:Dt.DashboardFacet,title:i,geoUrl:jm[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 Sm({id:t,count:o,canRead:l,attributeUri:Um(n,r),filters:Dm(a,n,r),component:Dt.DashboardFacet,title:i,geoUrl:s,chartType:Lt.MAP,projection:"geoMercator"},Cm(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.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:Lm(i),component:Dt.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:Dm(n,null,a),component:Dt.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:Zr.GTE,fieldName:"matches",values:["1"]}],component:Dt.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:Dt.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:Lt.CLOUD,component:Dt.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:Lt.TREE,component:Dt.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.NotificationInboxFacet,title:n||fn().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Dt.ActivitiesViewFacet,title:n||fn().text("Activity log")}}},xm=e=>({id:e,height:10}),Fm=(0,l.pipe)((0,l.map)((e=>{const t=km[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Mm=e=>{if("0.1"===e.version){const t=Fm(e.views),r=Rm(xm,e.layout,{columns:4});return{id:e.id,margin:0,layout:Pm(r,t),views:t}}return e},$m=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=>$m(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Vm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gm(e,t,r[t])}))}return e}function Gm(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=Vm({},jt,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Ym=e=>e,Bm={[Wm.Attributes]:Ym,[Wm.HierarchyTree]:Ym,[Wm.HierarchyPaths]:Ym,[Wm.RelationsTable]:Ym,[Wm.Relations]:e=>Vm({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Wm.SingleAttributeView]:Ym,[Wm.CustomView]:Ym,[Wm.TableAttributeView]:Ym,[Wm.MapView]:Ym,[Wm.OldTreeView]:e=>Vm({},e,{class:jt.HierarchyTree}),[Wm.OldMapView]:e=>Vm({},e,{class:jt.MapView}),[Wm.ImageAttributeView]:Ym,[Wm.PotentialMatchesView]:Ym},qm=(0,l.pipe)((0,l.map)((e=>{const t=Bm[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Qm=(0,l.curry)(((e,t)=>{switch((0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)){case jt.MapView:return{id:t,height:5,minHeight:5};case jt.Relations:return{id:t,autosizing:!0,minWidth:2};default:return{id:t,autosizing:!0}}})),Hm=e=>{if("0.1"===e.version){const t=qm(e.views),r=Rm(Qm(t),e.layout,{columns:4});return{id:e.id,layout:Pm(r,t),views:t,workflow:e.workflow,maxWidth:e.maxWidth,sidePanelViews:e.sidePanelViews}}return e},Km=(e,t)=>e.class===t||e["react-class"]===t,Jm=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Km(t,jt.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 Km(t,jt.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.includes(n)||t.includes(n)}},Xm=(e,t)=>e.filter((e=>t.some((t=>Km(e,t))))).map((e=>{let{id:t}=e;return t})),zm=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Zm=(e,t)=>(e||[]).find((e=>e.activator===t));function eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 rh=(e,t)=>$m(t).map((t=>(0,l.pipe)((0,l.map)((e=>zm(e,t))),(0,l.reject)(l.isNil),l.head)(e))),nh=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},ih=(e,t)=>{if("scroll"===t.layout.layout){const r=rh(e,t.layout),n=Mm(eh({},t,{views:r,version:"0.1"}));return{class:xt.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:xt.Dashboard,views:t.views,layout:t.layout,id:t.id}},ah=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},oh=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},sh=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},lh=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},uh=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},ch=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},ph=(e,t)=>{const r=rh(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=((e,t)=>e.flatMap((e=>{let{extensions:t=[]}=e;return t.filter((e=>{let{point:t}=e;return"com.reltio.plugins.search.toolbar.component"===t}))})))(e).filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:xt.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"]}},dh=(e,t)=>({class:xt.Graph,id:t.id}),yh=(e,t)=>{const r=rh(e,t.layout)[0];return{class:xt.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},fh=e=>t=>!!(0,l.intersection)(e,t).length,Th=(0,l.cond)([[fh(["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"]),()=>ih],[fh(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>ah],[fh(["com.reltio.plugins.graph.GraphView"]),()=>dh],[fh(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>oh],[fh(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>sh],[fh(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>lh],[fh(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>uh],[fh(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>ch],[fh(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>ph],[fh(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>yh],[l.T,()=>(0,l.always)(void 0)]]),Eh=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(nh),(0,l.map)((t=>((e,t)=>{const r=rh(e,t.layout),n=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>zm(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return $m(r.layout||{})}})(e,t),i=Hm(eh({},t,{views:r,version:"0.1"}));return{entityType:t["entity-type"],views:i.views,layout:i.layout,sidePanelViews:n}})(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews"])))(e);return{class:xt.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:"CustomAction",config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:"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;const i=(0,l.pipe)((0,l.map)((e=>zm(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;const a=$m(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 Th(o)(t,i)},mh=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))},hh="https://reltio-ui-files.s3.amazonaws.com/new-ui/",bh={[xt.DQDashboard]:`${hh}DqDashboard.svg`,[xt.Dashboard]:`${hh}Dashboard.svg`,[xt.Graph]:`${hh}Graph.svg`,[xt.RelationshipSearch]:`${hh}GraphSearch.svg`,[xt.Interactions]:`${hh}Interactions.svg`,[xt.PotentialMatches]:`${hh}PotentialMatches.svg`,[xt.Profile]:`${hh}Profile.svg`,[xt.ProfileActivityLog]:`${hh}ActivityLog.svg`,[xt.Relationships]:`${hh}Relationships.svg`,[xt.Sources]:`${hh}Crosswalk.svg`,[xt.Search]:`${hh}Search.svg`,DEFAULT:`${hh}Default.svg`},Oh=e=>bh[null==e?void 0:e.class]||bh.DEFAULT,vh=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?bh.ProfileView:null,gh=e=>(0,l.pipe)((0,l.chain)(mh),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>(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=>({label:e.label,icon:Oh(Eh(e,t)),screen:Eh(e,t),canRead:e.canRead}))),(0,l.filter)((e=>e.screen)))(t))(t,e),n=Eh(t,e);return{label:t.label,icon:vh(t)||Oh(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function _h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ah=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Nh=e=>({id:e,height:10}),Rh=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)(Ah),(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=Fm(((e,t)=>{const r=$m(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(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){_h(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Rm(Nh,t.layout,{columns:4});return{views:r,layout:Pm(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Ph=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Sh=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),r=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>zm(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),u=(e=>(0,l.pipe)((0,l.map)((e=>zm(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),c=(e=>(0,l.pipe)((e=>Zm(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("default-perspective"),(0,l.ifElse)(Ph,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),p=(e=>(0,l.pipe)((e=>Zm(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkUser"))(e))(e);return{i18n:o,entity:{requestSettings:{defaultMaxValues:t}},image:{attributeFieldsOrder:r},lookups:{autocomplete:n},validate:{levels:i,validateReadMode:a},attributePresentations:s,workflow:{enabled:u},defaultRoute:c,checkUser:p}},wh=e=>({layout:gh(e),pivoting:Rh(e),properties:Sh(e)});var Ih=r(58697),Uh=r.n(Ih);function Ch(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lh(e,t,r[t])}))}return e}function Lh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dh=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}_${Uh()()}`;return n[e.id].push(t),i=!0,Ch({},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]++,Ch({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},jh=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(jh(e))}))}))),t},kh=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)($h,t),(0,l.propOr)([],"crosswalks",e))),e),xh=(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(xh(e))}))})),r},Fh=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=Fh(e);r>t&&(t=r)}))})),t+1):t},Mh=(e,t)=>{if(qe(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},$h=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Vh=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Gh=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Wh=(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)},Yh=(0,l.eqBy)($h),Bh=(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)(os,(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)))),qh=(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=fn().number(t));return t})),Qh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?fn().number(e,"0,0.0a").toUpperCase():fn().number(e,"0,0"):""},Hh=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),Kh=(e,t)=>t&&e!==t?`${t} (${e})`:e,Jh=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Xh=(e,t,r)=>{const n=Jh(e,t,r);return Kh(r,n)},zh=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Zh=(0,l.complement)(zh),eb=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),tb=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)},rb=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Zh(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),nb=(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 Mt.TYPE_NUMBER:case Mt.TYPE_FLOAT:case Mt.TYPE_DOUBLE:case Mt.TYPE_LONG:case Mt.TYPE_INT:case Mt.TYPE_COUNT:return t&&qh(o,t);case Mt.TYPE_BOOLEAN:case Mt.TYPE_BOOLEAN_RADIO:case Mt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:le(t)?fn().text("yes"):fn().text("no");case Mt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),t&&(bu(t)?Ou(t):fn().date(t,s));case Mt.TYPE_ACTIVENESS_DATE:case Mt.TYPE_LOCAL_DATE:return t&&(bu(t)?Ou(t):fn().date(t,s));case Mt.TYPE_TIMESTAMP:return t&&(bu(t)?Ou(t):fn().date(isNaN(t)?t:Number(t),u));case Mt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Mt.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}default:return(0,l.is)(Object,t)?Kh((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),ib={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)"},ab=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()}},ob=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})))),sb=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}=t,i=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e}):e(r)}),t.next);i(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),ab,ob);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((e=>new Promise(((t,n)=>{r({response:e,next:e=>{t(e)},abort:n})})))):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}},lb="__metadata",ub=(e=>{const t=[lb,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),cb=(0,l.set)(ub),pb=(0,l.view)(ub),db=cb(un.NEW),yb=cb(un.REMOVED),fb=cb(un.EDITED),Tb=cb(un.IGNORED),Eb=(0,l.pipe)(pb,(0,l.equals)(un.REMOVED)),mb=(0,l.pipe)(pb,(0,l.equals)(un.NEW)),hb=(0,l.pipe)(pb,(0,l.equals)(un.EDITED)),bb=(0,l.pipe)(pb,(0,l.complement)(l.isNil)),Ob=(0,l.pipe)(pb,(0,l.equals)(un.IGNORED)),vb=(0,l.omit)([lb]),gb=(e,t)=>e===lb?void 0:t;function _b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ab=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=Ab(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Nb=(e,t)=>Ab((0,l.propEq)("nodeId",t),e),Rb=(e,t)=>Ab((0,l.pathEq)(["entity","uri"],t),e),Pb=(e,t)=>{const r=Nb(e,t);return r.length>1?r[r.length-2]:null},Sb=(e,t)=>{const r=Nb(e,t);return r.length>0?r[r.length-1]:null},wb=(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=>wb(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Ib=()=>{},Ub=(e,t)=>{let{parent:r,nodeProcessing:n=Ib}=t;n(e,r),e.children&&e.children.forEach((t=>Ub(t,{parent:e,nodeProcessing:n})))},Cb=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case _t.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 _t.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 _t.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){_b(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})}}},Lb=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&&Ub(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===_t.addingChild||r.editingMode===_t.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=Cb({node:r,connection:n,isReversed:i}),s=Lf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===_t.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=Cb({node:r,isReversed:i,connection:n}),l=s?xf({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):kf({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Db={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},jb={asc:"asc",desc:"desc"},kb=Db.entityLabel,xb=jb.asc,Fb=(0,l.always)(0),Mb=e=>{let{sortField:t=kb,sortOrder:r=xb,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Db.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return a_.strings.sort(t,a,o)})(n,r);case Db.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return a_.strings.sort(e,i,a)})(r);default:return Fb}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},$b=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(jb)),l.identity,(0,l.always)(xb))),Vb=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Db)),l.identity,(0,l.always)(kb)));var Gb=r(91104);let Wb;const Yb=(e,t)=>(Wb||(Wb=Gb.createClient({key:t})),new Promise((t=>{Wb.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)}))}))),Bb=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},qb=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(rs).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Bb(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(qb(e.value,t,r))),n})),Qb=e=>e&&e.length>0,Hb=(e,t)=>[].concat(e&&e.attributes?qb(e.attributes,t):[]).filter(l.identity),Kb=(e,t,r,n,i)=>{if(e&&e.type){const t=(Br(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Hb(e,t.latitude),n=Hb(e,t.longitude),Qb(r)&&Qb(n)&&{lat:Number(r[0]),lng:Number(n[0])};var r,n})).filter(l.identity);if(t.length>0)return Promise.resolve(t[0])}const a=t.GeoLocation;if(a){const e=a.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(Qb(t)&&t[0].value&&Qb(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?Yb(n.label,i).catch((()=>null)):Promise.resolve(null)},Jb=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=Br(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=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return Kb(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Yb(a.label,r).catch((()=>null)):e)).then((e=>{let t=Array.isArray(e)?e:[e];return e&&t.map((e=>({id:e.id||n,label:i,entity:a,point:e})))})).catch((()=>null))}))).then((e=>e.flat(1/0).filter(l.identity)))},Xb=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=Br(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(hr(e,r.latitude,t.type)&&hr(e,r.longitude,t.type)){const e=Hb(t,r.latitude),n=Hb(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))},zb=(e,t,r)=>Promise.all([Xb(e,t),Jb(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.lon===e.point.lon))))]}));function Zb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eO(e,t,r[t])}))}return e}function eO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tO=(e,t)=>t.values.map(fo(e,t.entityTypeUri)),rO=(e,t,r)=>ks(t.fieldName,r)||hr(e,nt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),nO=(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?Kh(e,t):e}),r)},iO=(0,l.path)(["attrType","label"]),aO=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Zb({},e,{[t]:!0})),{});e[r]=e[r]?Zb({},e[r],n):n}return e}),{}),oO=(0,l.pipe)((0,l.prop)("values"),E),sO=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Rn.type.name)),lO=e=>e.type===pO.NUMERIC_RANGE_FACET,uO=e=>e.type===pO.DATE_RANGE_FACET,cO=(0,l.either)(lO,uO),pO={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},dO=e=>{switch(null==e?void 0:e.name){case Rn.type.name:return pO.ENTITY_TYPE_FACET;case Rn.createdBy.name:case Rn.updatedBy.name:case Rn.sourceSystems.name:case Rn.tags.name:case Rn.roles.name:case Rn.matchRules.name:case Rn.MLRecommendedMatch.name:return pO.WITH_DROPDOWN_CHECKBOXES_FACET;case Rn.createdTime.name:case Rn.updatedTime.name:case Rn.startDate.name:case Rn.endDate.name:return pO.DATE_RANGE_FACET;case Rn.matches.name:case Rn.matchScore.name:return pO.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return pO.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return pO.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return pO.DATE_RANGE_FACET;default:return pO.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},yO=(0,l.pipe)(rO,dO),fO=(0,l.pipe)((0,l.path)(["attrType","type"]),Sr),TO=(0,l.cond)([[lO,(0,l.always)(Zr.IN_RANGE)],[uO,(0,l.always)(Zr.WITHIN)],[(0,l.allPass)([fO,e=>e.values.length>=2]),(0,l.always)(Zr.EXISTS)],[l.T,(0,l.always)(Zr.EQUALS)]]),EO=(0,l.cond)([[uO,(0,l.prop)("values")],[lO,(0,l.prop)("values")],[fO,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 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.pipe)((0,l.path)(["attrType","type"]),gr),bO=(0,l.pipe)((0,l.path)(["attrType","type"]),Nr),OO=(0,l.pipe)((0,l.prop)("attrType"),Fs),vO=(0,l.pipe)((0,l.prop)("attrType"),xs),gO=e=>t=>t.values.map((t=>Br(e,t).label)).join(" , "),_O=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),AO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(fn().number),_O)),(0,l.join)(","))(e.values);return`${iO(e)}: ${t}`},NO=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),_O)),(0,l.join)(","))(e.values);return`${iO(e)}: ${t}`},RO=e=>t=>`${iO(t)}: ${tO(e,t).join(", ")}`,PO=e=>t=>{const r=nO(e,t);return`${iO(t)}: ${r.join(", ")}`},SO=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[vO,gO(e)],[bO,AO],[hO,NO],[OO,RO(e)],[l.T,PO(t)]]),r))),wO=(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){mO(e,t,r[t])}))}return e}({},t,{attrType:rO(e,t,n)}))),SO(e,r))(t),IO=new RegExp(`^${fn().text("Search")}`),UO=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...wO(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(IO,"",u)]},CO=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(sn),LO=e=>(e=>CO.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]=vu(t);return e.replace(r,i).replace(n,a)}),e))(e),DO=(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}`})),jO={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},kO=e=>[jO.geoPolygon,jO.onMapMove].includes(e),xO=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},FO=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},MO=(e,t)=>kO(e)?t.map(xO):[FO(t)],$O=e=>kO(e)?fn().text("Geo Polygon"):fn().text("Geo Location"),VO=e=>{switch(e){case jO.geoLocation:return"geoLocation";case jO.geoPolygon:case jO.onMapMove:return"geoPolygon"}},GO={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},WO=e=>fn().text(e),YO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Zr.EQUALS]:"=",[Zr.NOT_EQUALS]:"≠",[Zr.STARTS_WITH]:"*",[Zr.MISSING_VALUE]:fn().text("missing value"),[Zr.HAS_ALL]:fn().text("has all"),[Zr.IN_RANGE]:fn().text("in range"),[Zr.FULL_TEXT]:fn().text("full text"),[Zr.EXISTS]:fn().text("exists"),[Zr.COUNT_EQUALS]:`${fn().text("count")} =`,[Zr.COUNT_NOT_EQUALS]:`${fn().text("count")} ≠`,[Zr.COUNT_LT]:`${fn().text("count")} <`,[Zr.COUNT_LTE]:`${fn().text("count")} <=`,[Zr.COUNT_GT]:`${fn().text("count")} >`,[Zr.COUNT_RANGE]:fn().text("count range"),[Zr.LT]:"<",[Zr.LTE]:"<=",[Zr.GT]:">",[Zr.GTE]:">=",[Zr.IN_FILE]:fn().text("in file"),[Zr.NOT_IN_FILE]:fn().text("not in file"),[Zr.CONTAINS]:"~",[en.LIST_EQUALS]:"=",[en.NOT_LIST_EQUALS]:"≠",[en.LIST_EQUALS_CASE_SENSITIVE]:"=",[en.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||fn().text(e.toLowerCase())},BO=e=>({type:GO.operator,text:e}),qO=e=>({type:GO.operator,text:WO(e)}),QO=e=>({type:GO.attributeLabel,text:e}),HO=e=>({type:GO.specialAttributeLabel,text:e}),KO=e=>({type:GO.attributeFilter,text:YO(e)}),JO=e=>({type:GO.attributeValue,text:e}),XO=e=>({type:GO.entityTypeLabel,text:e}),zO=()=>({type:GO.space,text:" "}),ZO=()=>({type:GO.bracket,text:"("}),ev=()=>({type:GO.bracket,text:")"}),tv=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),rv=(0,l.curry)(((e,t)=>t.map(tv(e)))),nv=(0,l.curry)(((e,t,r)=>[e,...r,t])),iv=nv(ZO(),ev()),av=nv(zO(),zO()),ov=(0,l.curry)(((e,t)=>[e,...t])),sv=e=>ov(XO(e)),lv=e=>ov(XO(`${e}: `)),uv=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=eu(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=zl(s),a=Zl(s);!r&&t&&n&&(i.push(ZO()),r=!0),i.push(o),r&&a&&(i.push(ev()),r=!1);const l=e?qO(s):BO(s);i.push(...av([l]))}else i.push(o),r&&(i.push(ev()),r=!1)}return i}},cv=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),pv=(0,l.pipe)(uv({localizable:!1}),cv),dv=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},yv=e=>{let{data:t,values:r,filter:n}=e;return t&&xu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},fv=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(yv)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),Tv=(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)&&fr(e.data.attrType)})(e)&&[Zr.HAS_ALL,Zr.EQUALS,Zr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:yr((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})))),tb),Ev=(e,t)=>(0,l.pipe)(Tv,rb(t))(e),mv=(0,l.pathEq)(["data","fieldName"],Rn.type.name),hv=(0,l.path)(["data","entityTypeUri"]),bv=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Ov=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(ts(e)),attributes:(0,l.filter)((0,l.pipe)(hv,(0,l.anyPass)([l.isNil,ts(e),r=>{const n=(t.entityTypes||[]).filter(ts(e));return(n.length>1?Jr(e,n):null)===r&&!!Br(e,r)}])))})(t))))),vv=e=>(0,l.pipe)((0,l.prop)("filter"),Ml,(0,l.equals)(e)),gv=(0,l.curry)(((e,t,r,n,i,a)=>{const o=ks(n.fieldName)||n.attrType,s=mu(o,i),u=nb({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>fr(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Kh(a.lookupCode,a.value):Xh(r,yr(o),a)],[()=>Fs(s),()=>fo(e,n.entityTypeUri,a)],[()=>Ms(s),()=>ko(e,a)],[()=>Bs(s),()=>Mo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Nr(c)||Sr(c)),yu),JO)()})),_v=(e,t,r,n)=>{const i=gv(e,t,r,n.data,n.filter);return(0,l.cond)([[vv(0),(0,l.always)([])],[(0,l.both)(vv(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[zO(),i(r),{type:GO.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[zO(),...(0,l.pipe)(l.flatten,(0,l.map)(i),rv({type:GO.punctuationMark,text:", "}))(t)]}]])(n)},Av=(e,t)=>{const r=!!ks(e.data.fieldName);return(0,l.pipe)(dv,r?HO:QO)(e,t)},Nv=(e,t,r,n,i)=>[Av(n,i),zO(),KO(n.filter),..._v(e,t,r,n)],Rv=(0,l.addIndex)(l.map),Pv=(0,l.propEq)("length",1),Sv=(0,l.propSatisfies)((0,l.lt)(1),"length"),wv=(0,l.complement)(l.isEmpty),Iv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(nu,(0,l.filter)(yv),iu,(0,l.map)((n=>({operand:Nv(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,uv()))(n)},Uv=(0,l.pipe)(Iv,l.flatten),Cv=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>ld(e,{type:t}))).join(", ");return r?t(r):l.identity},u=Iv(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(sv),(0,l.pipe)(s(lv),(0,l.unless)((()=>Pv(u)||i),iv)))(u)},Lv=(e,t,r,n)=>(0,l.pipe)(nu,(0,l.filter)(fv),iu,Rv(((n,i,a)=>({operand:Cv(e,t,r,n,Pv(a)),operator:n.operator}))),uv(),l.flatten)(n),Dv=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),uv(),l.flatten),jv=e=>{let{searchType:t,values:[r]}=e;return MO(t,r).join(", ")},kv=(e,t,r,n,i,a)=>{const o=(e=>e?[HO(e.isRawFilter?fn().text("Raw filter"):fn().text("Search")),...av([KO(Zr.EQUALS)]),JO(`"${e.value}"`)]:[])(i),s=(e=>e?[HO($O(e.searchType)),zO(),JO(jv(e))]:[])(a),u=(0,l.pipe)(Lv,(0,l.when)((e=>Sv(e)&&(wv(o)||wv(s))),iv))(e,t,r,n);return Dv([o,s,u])},xv=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),Fv=(0,l.pipe)(kv,xv),Mv=(0,l.has)("attributes"),$v=Array.isArray,Vv=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),Gv=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=Wv(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)(Vv(a))),iv),(0,l.concat)(av([BO(o)]))))(s)},Wv=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Mv(n)?Gv(e,t,r,n,i):$v(n)?n.reduce(((n,a)=>n.concat(Wv(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(av([BO(n.operator)])))(Nv(e,t,r,n,i))},Yv=(e,t,r,n,i)=>(0,l.pipe)(Wv,l.flatten)(e,t,r,n,i);function Bv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qv(e,t,r[t])}))}return e}function qv(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=(0,l.complement)(mv),Hv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(mv),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(hv),(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}},Kv=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=Hv(t);return(r||n)&&tu(t)},Jv=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(Kv)),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(mv).some((0,l.propEq)("filter",Zr.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}=Hv(r);if(Kv(e))t.push(Bv({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(Qv)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(mv,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(hv,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(Qv),entityTypes:n,operator:i?a:e.operator,id:Uh()()}}));t.push(...n)}var a;return t})(t))),[]))),Xv={[Zr.EQUALS]:Zr.ON,[Zr.IN_RANGE]:Zr.WITHIN,[Zr.GTE]:Zr.AFTER,[Zr.GT]:Zr.AFTER,[Zr.LTE]:Zr.BEFORE,[Zr.LT]:Zr.BEFORE},zv=(0,l.curry)((e=>Xv[e]||e)),Zv=(0,l.curry)(((e,t)=>{switch(e){case Zr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Zr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),eg=(0,l.pipe)((0,l.path)(["data","attrType","type"]),gr),tg=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>Bv({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return eg(e)?(0,l.evolve)({filter:zv,values:Zv(t)},e):e}))})))})),rg=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),Jv,Ov(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")))})),tg,(0,l.reject)(bv))(r)));function ng(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ig(e,t,r[t])}))}return e}function ig(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ag=(e,t)=>({data:{uri:st(e.fieldName)?nt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||TO(e),id:Uh()(),values:EO(e)}),og=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=ks(a,t,r)||hr(e,i);if(!s)return null;if(ir(s))return ng({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=ld(e,{type:o}),i=(mr(e,nt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return ng({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),sg=(0,l.curry)(((e,t,r,n)=>rg(og,e,n,t,r)));function lg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ug(e,t,r[t])}))}return e}function ug(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},pg=e=>"rdmLookups.not.resolved"===e?Rn.notResolved.name:e,dg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===an?Zr.IN_RANGE:on(a),u=pg(n),c=ks(u)||hr(e,i),p=(0,l.cond)([[()=>Wl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>lg({},e,{filename:Hh(e)}))))],[()=>Sr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Vl(s)&&!Array.isArray(e[0])&&!gr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Uh()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===an?"and not":"and",filter:s,values:p}})),yg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(dg(e,Jr(e,i)));return[{id:Uh()(),operator:"or",attributes:a,entityTypes:i}]})),fg=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),Tg=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([fg("from"),fg("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,()=>[]]]),Eg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return lg({},r,{values:Tg(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Us(e.fieldName,n):e.fieldName})},mg=(e,t)=>{if((0,l.has)("children")(e)){const r=Eg(e,t);return e.children.reduce(((e,n)=>(e.push(mg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return Eg(e,t)},hg=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(Eg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(lg({fieldName:e.fieldName},Eg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(mg,l.flatten)],[l.T,Eg]]),bg=(0,l.pipe)((0,l.map)(hg),l.flatten),Og=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},vg=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=yg(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:bg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>lg({},t,{type:yO(e,t)}))).map((e=>lg({},e,{values:cO(e)?Og(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 ag(r,t)})),operator:"or",id:Uh()(),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=>({[pg(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[lg({},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 sg(e,t,r,p)},gg=(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)(oO),(0,l.partition)(sO))(t),i=n.map((t=>ng({},t,{type:yO(e,t)}))).map((e=>ag(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Uh()(),entityTypes:a}]})(e,a);return sg(e,t,r,o)})(e,t,r,n):vg(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},_g=e=>"2.0"===e.version?e.keyword:cg(e),Ag=e=>(0,l.pathEq)(["object","uri"],e),Ng=(e,t)=>(0,l.pipe)((0,l.find)(Ag(e)),(0,l.prop)("object"))(t),Rg=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"),Ag(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Ng(r.match,t)||n[r.match];return{label:Vp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return yo(e,i.type,t)||{label:t,uri:t}}))}};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)))(i)},Pg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),Sg=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),wg=(e,t,r)=>(0,l.pipe)((0,l.propOr)([],"shortestTransitiveMatchPath"),(0,l.map)((t=>{let{match:n,matchRules:i=[]}=t;const a=(0,l.propOr)({},n,r);return{label:Vp((0,l.prop)("label",a)),matchRules:i.map((function(t){return yo(e,a.type,t)||{label:t,uri:t}}))}})))(t),Ig=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)},Ug=(0,l.path)(["object","uri"]),Cg=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Lg=e=>e.getValue(),Dg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Dg(n[e],t),!r);e++);return r},jg=(e,t)=>{const r=[],n=(0,l.pipe)(Lg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(jg,[t]),a);return r.push.apply(r,o),r};function kg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xg(e,t,r[t])}))}return e}function xg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fg=(e,t)=>!!e[t],Mg=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},$g=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||[]])},Vg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return kg({},t,{[r.uri]:kg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:$g(null==o?void 0:o.parents,n),children:$g(null==o?void 0:o.children,i),values:$g(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},Gg=e=>e.children?e.children.flatMap(Gg):e,Wg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Br(r,t)||Oi(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return qo(r,n,i).flatMap(Gg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>hr(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=Vg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Vg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},Yg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!qe(e.uri)&&ze(e.type)&&ze(t)&&!t.startsWith(e.type))(n,t))return e;const i=ms(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(rs),(0,l.map)(Mg))(i);return Vg({structure:e,attrType:e[t].attrType,values:a})}),t)},Bg=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 Fg(e,r)}));return r||n?t.filter(rs).reduce(((e,t)=>Bg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Fg(t,e.type)?Vg({structure:t,attrType:t[e.type].attrType,values:[Mg(e)]}):t}},qg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?kg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},Qg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ms(i,n,r)||[];return a.length?Vg({structure:t,attrType:t[r].attrType,values:a.filter(rs).map(Mg)}):t},Hg=(e,t,r)=>{const n=Ke(e),i=Ke(t);return n===i?((e,t)=>{const r=ut(t),n=ut(e);return et(n,r)})(e,t):!(!r||!lt(t))&&YT(r,i).includes(n)},Kg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},Jg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?GT(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Hg(r,t,o)}))},Xg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>Xg(e,t,r)))))},zg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Kg(n,e)}},Zg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=Ke(n),c=WT(u,o,i,a),p=Xg("children",t,l),d=Xg("parents",t,l),y=p.flatMap((e=>Xg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Hg(t,n,c)})).map((t=>zg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Hg(n,t,c)||Ke(t)!==u&&Hg(t,n,c)})).map((t=>zg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=Xg("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)&&Hg(n,t,c)}))})).map((t=>zg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Hg(t,n,c)})).map((e=>zg(r,n,e,s))),...T,...E,...f]},e_=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=nb({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=>Mp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[lr,()=>a(n)],[fr,()=>(e=>{const r=o(e),n=yr(t);return wl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return Xh(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},t_=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Zr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(r_(r,t)):i.push(n_([t],r)),i},r_=(e,t)=>{const r=ar(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=lr(i)?r_(i,t[r]):[n_(t[r],i)];return e.push(...a),e}}),[])},n_=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:dr(t.uri),filter:t.type===Mt.TYPE_BLOB?Zr.FULL_TEXT:Zr.EQUALS,values:e}:{fieldName:dr(t.uri),filter:Zr.MISSING_VALUE},i_={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},a_={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:()=>{}}]);