@reltio/remotes 1.4.966 → 1.4.970

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/264.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[264],{67075:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Us,PY2:()=>Ut,Ng6:()=>ir,YJ7:()=>Nt,Xt7:()=>tr,wfT:()=>Br,EMD:()=>jr,HAc:()=>rr,PEf:()=>kt,oA3:()=>Cr,$XE:()=>Er,eWf:()=>Lt,q7e:()=>nr,KVe:()=>qr,WVQ:()=>ii,oZZ:()=>rn,bNA:()=>nn,Rjq:()=>an,G39:()=>Ft,dZX:()=>mr,bQt:()=>sn,oS0:()=>vt,lL_:()=>Ot,Nsj:()=>Pt,psV:()=>_t,xPW:()=>Ct,pyR:()=>Mr,p8l:()=>Dr,Wkf:()=>er,zHr:()=>Zt,NIO:()=>zt,$26:()=>Xh,Esk:()=>Rr,s9T:()=>pr,MEy:()=>xl,j5E:()=>ct,vAw:()=>Ur,NMQ:()=>Ir,mNm:()=>xr,rwv:()=>en,s_5:()=>Vr,RgZ:()=>kr,unl:()=>tn,Qy0:()=>on,pYu:()=>Pr,wIJ:()=>gb,GFH:()=>or,S91:()=>Mt,p3$:()=>pn,wSh:()=>z,BDP:()=>vi,pGS:()=>Fr,ARY:()=>Or,XGc:()=>Yr,fO_:()=>Kt,wwy:()=>lr,_XL:()=>At,j2V:()=>Kr,dMV:()=>Gr,NBX:()=>_g,OXy:()=>gr,BXd:()=>yr,CJB:()=>Qr,nqG:()=>un,C68:()=>xt,yxQ:()=>ln,Yj_:()=>ur,ZIY:()=>hr,Tl4:()=>wb,lwr:()=>Dt,NkU:()=>Hr,Rtp:()=>Wr,YGx:()=>fr,uTS:()=>$r,IYE:()=>Lr,PiC:()=>Zr,tJI:()=>ar,cNQ:()=>Jr,SwE:()=>wr,ZHR:()=>zr,lD1:()=>Vt,lVm:()=>Tr,vnX:()=>vh,$x5:()=>_h,_R1:()=>Oh,wUm:()=>gh,z7V:()=>cn,dC6:()=>dr,MBD:()=>sr,GmF:()=>Zi,cKm:()=>br,iP_:()=>jt,NVC:()=>cr,tPT:()=>vs,tZe:()=>rp,kRE:()=>Zd,psB:()=>ey,X0$:()=>gs,Wm5:()=>Bs,vyX:()=>Ru,wLZ:()=>_s,W4V:()=>oe,EtK:()=>as,Wtd:()=>Os,asT:()=>kg,kGs:()=>ge,ewt:()=>sf,O_f:()=>zb,sOy:()=>Ze,Tde:()=>xn,LMI:()=>pu,skb:()=>vO,sPt:()=>ru,sH1:()=>nu,RPM:()=>zf,h27:()=>gu,Uqd:()=>Pu,xG:()=>DO,Z2f:()=>Gm,fgW:()=>rO,I69:()=>RO,ZxB:()=>SO,mdt:()=>Kf,Qbq:()=>Pm,rny:()=>ki,UEY:()=>ba,Q0T:()=>ha,Lyr:()=>Pa,sBn:()=>ma,itK:()=>ya,H9$:()=>Ea,KPc:()=>Ta,zos:()=>fa,ELQ:()=>Ra,dZs:()=>ia,Cz4:()=>na,z_L:()=>Na,fGe:()=>ra,iuF:()=>pa,Wib:()=>da,Hn0:()=>Aa,XUh:()=>ca,Qp_:()=>la,_jk:()=>aa,sKE:()=>oa,WmG:()=>ua,QKx:()=>va,Oik:()=>ga,s0A:()=>sa,o9m:()=>Oa,MCd:()=>_a,tGK:()=>Tl,Vg3:()=>Wi,mkC:()=>Ii,xv5:()=>Bi,a14:()=>Ci,yv0:()=>Yi,Zm0:()=>Ui,Nxd:()=>Si,$mM:()=>Gi,ifj:()=>oi,NWi:()=>oh,xr3:()=>ah,wNf:()=>Al,d89:()=>Pi,Edd:()=>Ri,Z5t:()=>wi,uGe:()=>Ni,UoR:()=>_i,xvW:()=>ih,$qe:()=>nh,yPM:()=>ta,$cp:()=>Is,vKJ:()=>ws,AID:()=>$y,B1H:()=>gg,b7X:()=>_m,$uE:()=>ve,keo:()=>Am,C_p:()=>DT,G27:()=>DE,JA0:()=>Bd,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,w3l:()=>ng,QHB:()=>LE,Jso:()=>cg,RXH:()=>OE,Vr9:()=>WE,lMm:()=>mm,fmQ:()=>Xo,yRD:()=>qO,NcL:()=>$T,QK6:()=>pe,ymd:()=>Mc,JV_:()=>dy,XiW:()=>Zy,Yrx:()=>Ld,GPx:()=>bs,gjI:()=>hs,vlo:()=>Af,E_P:()=>Gf,aAL:()=>Pc,NBq:()=>zo,wp9:()=>qf,DsR:()=>gc,MPc:()=>qy,gWE:()=>Ky,ipn:()=>Jy,ORg:()=>bi,_wz:()=>Hy,RYR:()=>af,PP2:()=>xd,wS7:()=>Jm,cBQ:()=>oc,pBq:()=>Py,DsO:()=>Z,X78:()=>fy,xZs:()=>ly,YFy:()=>kd,Gmt:()=>iy,K$w:()=>ny,DSj:()=>Rc,k9j:()=>lc,ww$:()=>Ns,WVU:()=>ry,hxF:()=>Ks,nwO:()=>Bg,Mzk:()=>tc,aFF:()=>Cm,HRH:()=>Vl,EZK:()=>fp,Kxm:()=>cp,Z9i:()=>ET,CrF:()=>Jd,DNd:()=>Sa,vUy:()=>$g,lJh:()=>Wl,zHo:()=>Yl,sEJ:()=>Ag,UO$:()=>Cy,zeJ:()=>Wn,dLR:()=>us,JQy:()=>fs,XtP:()=>ss,Ug0:()=>di,A1W:()=>Nm,sw:()=>yp,nv3:()=>fh,JgD:()=>yh,nve:()=>Pg,SkP:()=>Ts,SAs:()=>wy,PWK:()=>wo,IM5:()=>ls,Mfk:()=>vm,mB6:()=>Bm,p6d:()=>w,o0x:()=>I,ufS:()=>Lm,k7L:()=>Dm,mrB:()=>S,ncP:()=>Ke,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Bt,vPL:()=>mp,qmL:()=>Vf,hXd:()=>Fi,OCS:()=>Mi,p2l:()=>js,qF1:()=>Vc,_X$:()=>$c,yj2:()=>mb,bzh:()=>Qf,k66:()=>ko,kiP:()=>Za,pSg:()=>ue,kz_:()=>Gd,H_U:()=>Fo,t9e:()=>ka,j2$:()=>np,PFL:()=>Pn,aJ3:()=>Gh,To9:()=>Fn,wpo:()=>Mp,ADq:()=>pT,UUb:()=>uT,tQX:()=>cT,xy8:()=>In,EUG:()=>Yn,AFK:()=>it,X3M:()=>Gn,WN0:()=>xo,kDl:()=>cs,uDV:()=>Mf,IhQ:()=>ds,R$r:()=>$f,w80:()=>Eo,Pfu:()=>La,Gtj:()=>sl,fyF:()=>ol,u5q:()=>He,O$n:()=>xp,ptG:()=>Fp,f4_:()=>HT,uap:()=>KT,d7q:()=>jd,liG:()=>Fd,$oF:()=>Cd,avf:()=>Tf,DiQ:()=>ff,cfX:()=>yf,vD3:()=>mf,Qrb:()=>df,EJQ:()=>Ef,HWy:()=>pf,y6v:()=>cf,GtP:()=>aE,_kX:()=>Ua,u1e:()=>Ca,sJj:()=>Sm,CJp:()=>nE,uKF:()=>wm,wo0:()=>zd,cwx:()=>Io,TTx:()=>oy,HaQ:()=>sy,E6I:()=>Hd,vTU:()=>Nd,Nsy:()=>Sp,KMQ:()=>Um,CSV:()=>ks,l1V:()=>ql,VQ1:()=>Ql,z7d:()=>Pf,Xaq:()=>$o,Sj8:()=>Yg,PJj:()=>dl,PjQ:()=>gi,s7l:()=>Ju,GGR:()=>gf,j5q:()=>bf,DnY:()=>Bu,RY5:()=>jf,SvV:()=>hg,NIY:()=>Zu,HvW:()=>Qu,Fof:()=>xa,BTI:()=>jp,uie:()=>Op,ChB:()=>Tp,q27:()=>$p,fAQ:()=>hy,XkT:()=>Yu,lrH:()=>by,nt9:()=>si,XH8:()=>kp,XH2:()=>yi,jFi:()=>Dp,qhs:()=>To,wwR:()=>Cp,Uk3:()=>at,ev7:()=>vg,zsW:()=>Hu,RB9:()=>Yd,iFp:()=>eT,e$p:()=>rT,PcX:()=>nT,SpP:()=>tT,R6_:()=>Yh,CY1:()=>zh,Ajk:()=>Vu,Yiz:()=>Mu,FK9:()=>Du,UOo:()=>km,aTW:()=>ay,uug:()=>Nl,P$2:()=>tb,XS2:()=>El,Hyb:()=>kl,d3Y:()=>Uu,Klp:()=>ju,WxZ:()=>rb,Gzu:()=>Bl,ZOr:()=>Wu,uqV:()=>gd,Pm4:()=>te,nVD:()=>Df,dED:()=>Id,P2h:()=>Sd,jrr:()=>Ja,mmY:()=>Xa,T6O:()=>Mo,h6J:()=>Zc,hM2:()=>yg,XR6:()=>Q,jmz:()=>Ff,IHt:()=>xf,NZI:()=>TT,wdF:()=>Ey,kgP:()=>my,ZYI:()=>Dc,QXK:()=>rl,efz:()=>nl,Q5d:()=>tl,Ysv:()=>il,ocC:()=>wf,io3:()=>ci,Sbt:()=>ho,roS:()=>mo,Ww1:()=>bo,QaS:()=>rc,ERZ:()=>tg,CL1:()=>fg,idV:()=>dp,nIW:()=>tt,fjE:()=>Bh,sG0:()=>xm,tV7:()=>yl,g8o:()=>Pb,Qy:()=>Ab,t2P:()=>$h,wId:()=>oo,LS0:()=>so,bFH:()=>ld,Rgl:()=>cd,fW1:()=>GT,Ywp:()=>bh,pg:()=>Bp,WSA:()=>pd,fed:()=>pg,tT_:()=>ys,KbL:()=>Ku,JBA:()=>lt,aNC:()=>dh,RFJ:()=>Lc,Zeh:()=>Uy,OT5:()=>hh,mC3:()=>Qs,NVY:()=>Yf,k6v:()=>Gc,FEC:()=>Wc,Ob5:()=>Gp,KUV:()=>Wp,dvH:()=>Wf,V3i:()=>qE,VD3:()=>pi,mm2:()=>Jl,izH:()=>ja,DK$:()=>Da,KMp:()=>Ac,c31:()=>Tn,mbo:()=>yT,gT8:()=>hn,CZ8:()=>Jo,uGi:()=>ts,Poc:()=>yn,_9k:()=>is,ZTM:()=>Zo,bwT:()=>rs,tzW:()=>On,tF$:()=>mn,o96:()=>Qo,M4S:()=>ns,_vs:()=>bc,xF8:()=>of,HQx:()=>jm,ATu:()=>dT,j1S:()=>mi,V3K:()=>Ti,Lmx:()=>Ei,ZaZ:()=>fn,n_1:()=>_d,N6e:()=>_c,SxO:()=>Qa,w3p:()=>Bf,xU7:()=>ce,Y_p:()=>vo,$k6:()=>go,Gdl:()=>Mm,U6P:()=>Fm,OwB:()=>Wh,hTh:()=>kf,xqc:()=>Uo,JvE:()=>Co,i29:()=>Eu,dzT:()=>Li,uPS:()=>ac,cZV:()=>ic,Uz2:()=>Ap,xz3:()=>Np,AET:()=>_p,n3B:()=>uO,e6O:()=>nO,s7j:()=>Ob,kW2:()=>iE,tH7:()=>So,Yxg:()=>Ms,MaZ:()=>Of,nqN:()=>hf,o_J:()=>Go,hgZ:()=>Ep,yW4:()=>ep,uT0:()=>Xc,C82:()=>zc,J$m:()=>vd,j_Q:()=>xu,wB1:()=>Og,SP6:()=>Yp,ZYr:()=>mg,IMU:()=>jc,FoU:()=>qd,DVz:()=>Ym,mxe:()=>sO,FHr:()=>Sy,VO3:()=>Rh,de5:()=>Ph,Uw1:()=>fe,J6q:()=>fT,XCe:()=>qa,Ir:()=>ro,XQO:()=>no,QXb:()=>td,P8_:()=>cy,MOC:()=>rd,WF:()=>ed,xE1:()=>Oi,idW:()=>Lg,YL3:()=>ec,Fn9:()=>T,j2U:()=>Cs,MpE:()=>gn,kQw:()=>wn,mfm:()=>Jb,vZp:()=>ot,E8K:()=>Sg,VSb:()=>Ko,vr_:()=>Rn,Vmh:()=>Vg,FgW:()=>BE,oDv:()=>Yo,kuw:()=>Bo,Tt2:()=>Wo,T6Y:()=>Zn,_26:()=>jl,YkM:()=>kn,J6y:()=>bl,njU:()=>Rl,IT0:()=>mT,x_:()=>Im,biM:()=>Up,Vkd:()=>Il,WiY:()=>Jh,_zi:()=>Ul,J6D:()=>Hl,Lt4:()=>Kn,QEi:()=>Vn,whI:()=>Jt,KIu:()=>Xt,JhM:()=>ae,C_0:()=>ri,qIF:()=>cO,O27:()=>E,aBi:()=>Vp,xOX:()=>Ys,EdS:()=>Xe,WgC:()=>Qe,eEv:()=>Nn,A4t:()=>wl,hnu:()=>st,Wos:()=>Xn,jWr:()=>wa,Or$:()=>Dn,lhE:()=>ui,CwH:()=>Mn,pzC:()=>$s,ymH:()=>Pl,QZu:()=>jn,rYH:()=>Hh,FVt:()=>Qn,Kn2:()=>le,OXP:()=>qo,lS4:()=>$n,g5f:()=>Qh,fp6:()=>vl,Uty:()=>Hi,YkG:()=>Ln,xdS:()=>bn,$NE:()=>ze,bC9:()=>Je,KVV:()=>Rm,q9e:()=>Oo,iIf:()=>Vm,ian:()=>Hs,m6e:()=>ni,OFd:()=>Gs,kqr:()=>Sn,fnZ:()=>Ht,VFZ:()=>Js,ZiX:()=>Be,j5n:()=>Hn,zkt:()=>v,Pcm:()=>bg,QDV:()=>Vs,M5u:()=>Kh,laD:()=>lO,mtq:()=>_n,CtB:()=>$m,CBv:()=>ie,I0t:()=>ti,u1G:()=>Nf,gk1:()=>aO,Bgb:()=>iO,uzs:()=>Qt,v0l:()=>Zl,Zqp:()=>Pd,j0k:()=>Ro,tCm:()=>nt,gmx:()=>ml,mOr:()=>Fl,TwZ:()=>Rb,GyU:()=>Th,zGm:()=>Hp,bMg:()=>Td,EyD:()=>rh,fZN:()=>hd,xsF:()=>eh,Lxg:()=>th,O3l:()=>cc,Wni:()=>uc,wRx:()=>lh,OxG:()=>ad,uJQ:()=>id,qWg:()=>Wm,i96:()=>qp,zhn:()=>sh,G8q:()=>dn,A9Y:()=>ee,Y5F:()=>KO,gxP:()=>se,c$P:()=>hl,BBN:()=>Ha,ZBU:()=>J,UkJ:()=>lo,xkv:()=>uy,z$M:()=>Dg,KAm:()=>Wd,lCl:()=>Gy,rkF:()=>kT,IU6:()=>lp,aYu:()=>m,ije:()=>pl,Buf:()=>Nc,YLu:()=>cl,ct9:()=>No,XkY:()=>Ed,T5R:()=>Jp,uQS:()=>bd,wcJ:()=>_o,d$I:()=>As,rSp:()=>Ip,Sx:()=>zu,Ki6:()=>qs,VGk:()=>Oc,sFD:()=>gE,eWN:()=>xg,dWE:()=>bb,Lkd:()=>ef,aDL:()=>jy,yaA:()=>Od,DBr:()=>Fh,hK$:()=>fl,TZ_:()=>sp,CMB:()=>pO,FU8:()=>Xu,J$p:()=>xy,b5s:()=>ky,h2W:()=>rt,SL_:()=>vy,oUH:()=>Hc,ck9:()=>Qp,Xs0:()=>ul,oCZ:()=>UT,MjG:()=>Ah,FuV:()=>Kc,$ju:()=>Qc,t6d:()=>Jc,m5F:()=>ye,sx:()=>Fg,rSc:()=>qm,L8n:()=>ty,R9X:()=>Ad,rj2:()=>yy,_C4:()=>ip,tCj:()=>py,uAg:()=>Dd,wx9:()=>lf,KF3:()=>ap,ax9:()=>op,HH7:()=>vc,_6y:()=>sc,AJo:()=>nc,Ixr:()=>Kd,P6Y:()=>qg,Bd_:()=>RT,xkB:()=>PT,W41:()=>Ny,WkI:()=>_y,sSE:()=>AT,GMd:()=>du,Bxm:()=>ST,FVh:()=>OT,U_T:()=>dd,FTe:()=>ne,VGB:()=>re,Wfe:()=>Gl,Ls5:()=>$l});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:()=>I,formatTime:()=>S,getEndOfDay:()=>R,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>H,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>P,isToday:()=>v,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>J,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>ve,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Re,editAttribute:()=>we,editEndDate:()=>Le,editRoles:()=>Ue,editStartDate:()=>je,editTags:()=>Ce,removeAttribute:()=>Ie});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=>e&&e.isValid(),b=(0,l.either)(h,l.isNil),O=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),v=e=>f()(e).isSame(Date.now(),"day"),_=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)},A=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),P=A("startOf"),R=A("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),S=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${w(e)} ${S(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),j=(0,l.equals)("9999"),L=(0,l.test)(/^[az][az][az]$/),D=(0,l.test)(/^[az][az][az][az]$/),k=(0,l.test)(/^9+$/),x=(0,l.test)(/^[9az]+$/),F=(0,l.cond)([[U,(0,l.always)("M")],[C,(0,l.always)("MM")],[L,(0,l.always)("MMM")],[D,(0,l.always)("MMMM")],[x,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),M=(0,l.cond)([[U,(0,l.always)("D")],[C,(0,l.always)("DD")],[x,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),$=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),U),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),C),(0,l.always)("hh")],[U,(0,l.always)("H")],[C,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),G=(0,l.cond)([[U,(0,l.always)("m")],[C,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[U,(0,l.always)("s")],[C,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,B=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[F(e),r,M(n),i,V(a),o])}return e},q=/(9+)([^9]+)*/g,K=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,[$(e,s),r,G(n),i,a?W(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},H=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${K(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Q=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",X=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:X,None:()=>X(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)}},Z=(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)}},ee=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},te=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),re=e=>Array.isArray(e)?e:[e],ne=e=>[e],ie=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),ae=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),oe=e=>(e=(e||"").toLowerCase(),ae(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),se=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),le=e=>null!=e&&["object","function"].includes(typeof e),ue=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)),le(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},ce=(e,t)=>{let r;return r="object"==typeof e&&e?"errorMessage"in e?e.errorMessage:t||e:e,r||t},pe=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)},de=/[\n\r%#()<>?[\\\]^`{}|]/g,ye=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(de,encodeURIComponent)}`,fe=e=>`data:image/gif;base64,${e}`;function Te(e){return e&&void 0!==e.uri}function Ee(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 me(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 he(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"===v(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(he(d.value,y.value,r)):"Reference"===v(d)?me(d,y)?o.push.apply(o,he(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(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&&(le(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),g(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 g(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,g(e.value)}))}function v(e){var t=e.value;if(le(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 be(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)||Te(r)&&Te(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Oe(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 ve(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 _e(e,t){return Ee("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return Ee("UPDATE_ROLES").call(this,e,t)}function Ae(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(Ae(r[i],r[i+1],e,t));return n}function Re(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 Re(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()?(Se(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(Se.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=Re(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 Se(e,t){le(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ie(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&&Ie(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 Ue(e,t){e.roles=t||[]}function Ce(e,t){e.tags=t||[]}function je(e,t){e.startDate=t||""}function Le(e,t){e.endDate=t||""}function De(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ke(e,t,r[t])}))}return e}function ke(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(le(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:le(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(le(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){le(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=De({},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:De({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Fe=r(15729);const Me="1Tempo4rary",Ve="1Tepmo4Rel",$e=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Ge=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,We=e=>()=>Ge(e),Ye=(e,t)=>{const r=$e(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),Ke=We("relations"),He=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Qe=(0,l.startsWith)("entities/"),Xe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ze=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),et=(0,l.pipe)((0,l.split)("/"),l.head),tt=(0,l.pipe)((0,l.split)("/"),l.last),rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},nt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),it=(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("/")},at=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},ot=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Me),ct={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"},pt="listEquals",dt="not listEquals",yt="listEqualsCaseSensitive",ft="not listEqualsCaseSensitive",Tt={[ct.EQUALS]:"equals",[ct.NOT_EQUALS]:"not",[ct.STARTS_WITH]:"starts with",[ct.MISSING_VALUE]:"missing value",[ct.IN_RANGE]:"in range",[ct.HAS_ALL]:"has all",[ct.FULL_TEXT]:"full text",[ct.EXISTS]:"exists",[ct.COUNT_EQUALS]:"count equals",[ct.COUNT_NOT_EQUALS]:"count not equal",[ct.COUNT_LT]:"count less",[ct.COUNT_LTE]:"count less or equal",[ct.COUNT_GT]:"count greater",[ct.COUNT_GTE]:"count greater or equal",[ct.COUNT_RANGE]:"count in range",[ct.LT]:"less than",[ct.LTE]:"less than or equal",[ct.GT]:"greater than",[ct.GTE]:"greater than or equal",[ct.IN_FILE]:"in file",[ct.NOT_IN_FILE]:"not in file",[ct.CONTAINS]:"contains",[ct.ON]:"on",[ct.BEFORE]:"before",[ct.AFTER]:"after",[ct.WITHIN]:"within"},Et="in",mt="notIn",ht="not range",bt=e=>({[Et]:ct.EQUALS,[mt]:ct.NOT_EQUALS}[e]||e),Ot={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},gt={[Ot.LAST_DAY]:"Last 24 hours",[Ot.LAST_3DAYS]:"Last 3 days",[Ot.LAST_WEEK]:"Last week",[Ot.LAST_MONTH]:"Last month",[Ot.LAST_YEAR]:"Last year",[Ot.PICK_DATE]:"Pick date"},vt={TYPE_STRING:"String",TYPE_TEXT:"Text",TYPE_PASSWORD:"Password",TYPE_LONG:"Long",TYPE_INT:"Int",TYPE_DOLLAR:"Dollar",TYPE_FLOAT:"Float",TYPE_DOUBLE:"Double",TYPE_NUMBER:"Number",TYPE_BOOLEAN:"Boolean",TYPE_BOOLEAN_RADIO:"Boolean_Radio",TYPE_DATE:"Date",TYPE_TIMESTAMP:"Timestamp",TYPE_ACTIVENESS_DATE:"ActivenessDate",TYPE_LOCAL_DATE:"LocalDate",TYPE_BLOB:"Blob",TYPE_ENUM:"Enum",TYPE_CIK_ID:"cik id",TYPE_LOOKUP:"Lookup",TYPE_TYPEAHEAD:"Typeahead",TYPE_URL:"URL",TYPE_BLOG_URL:"Blog URL",TYPE_IMAGE_URL:"Image URL",TYPE_EMAIL:"Email",TYPE_DEPENDENT_LOOKUP:"DependentLookup",TYPE_ENTITY_ID:"EntityId",TYPE_RDM_LOOKUPS_NOT_RESOLVED:"RdmLookupsNotResolved",TYPE_COUNT:"Count",TYPE_FILE:"File",TYPE_SELECT:"Select",TYPE_NESTED:"Nested",TYPE_REFERENCE:"Reference",TYPE_IMAGE:"Image",TYPE_SSN:"SSN"},_t={NEW:"new",REMOVED:"removed",EDITED:"edited"},Nt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},At="<No label>",Pt={IN:"in",OUT:"out"};var Rt=r(87918),wt=r.n(Rt);function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){It(e,t,r[t])}))}return e}function It(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ut={startDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ct=St({id:{type:vt.TYPE_ENTITY_ID,get label(){return wt().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Ut,{roles:{type:vt.TYPE_STRING,get label(){return wt().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:vt.TYPE_STRING,get label(){return wt().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),jt={workflow:{type:vt.TYPE_STRING,get label(){return wt().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:vt.TYPE_STRING,get label(){return wt().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:vt.TYPE_STRING,get label(){return wt().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Lt={commenter:{type:vt.TYPE_STRING,get label(){return wt().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Dt={notResolved:{type:vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return wt().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},kt={createdBy:{type:vt.TYPE_STRING,get label(){return wt().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:vt.TYPE_STRING,get label(){return wt().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},xt={matches:{type:vt.TYPE_COUNT,get label(){return wt().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:vt.TYPE_COUNT,get label(){return wt().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Ft={sourceSystems:{type:vt.TYPE_STRING,get label(){return wt().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:vt.TYPE_STRING,get label(){return wt().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:vt.TYPE_INT,get label(){return wt().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:vt.TYPE_STRING,get label(){return wt().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Mt={matchRules:{type:vt.TYPE_STRING,get label(){return wt().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:vt.TYPE_STRING,get label(){return wt().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Vt=St({},Ct,jt,Lt,Dt,kt,xt,Ft,Mt,{type:{type:vt.TYPE_STRING,get label(){return wt().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var $t=r(13980),Gt=r.n($t);const Wt=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Yt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Wt),Bt=(0,l.pipe)((0,l.reject)(E),Yt),qt=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("?")?"&":"?")+Wt(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}},Kt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Ht=(0,l.equals)(Kt.SUGGESTING),Jt=(0,l.equals)(Kt.EDITING),Qt=(0,l.equals)(Kt.VIEWING),Xt=(0,l.either)(Jt,Ht);let zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,gr;function vr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_r(e,t,r[t])}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(zt||(zt={})),function(e){e.local="local",e.validationService="validationService"}(Zt||(Zt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(er||(er={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",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"}(tr||(tr={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(rr||(rr={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(nr||(nr={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ir||(ir={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ar||(ar={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(or||(or={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(sr||(sr={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(lr||(lr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(ur||(ur={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(cr||(cr={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(pr||(pr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(dr||(dr={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION"}(yr||(yr={})),function(e){e.IN="in",e.OUT="out"}(fr||(fr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),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"}(hr||(hr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(br||(br={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Or||(Or={})),function(e){e.Saving="Saving"}(gr||(gr={}));const Nr=Gt().oneOf(["mobile","tablet","desktop"]),Ar=Gt().shape({deviceTypes:Gt().oneOfType([Nr,Gt().arrayOf(Nr)]),roles:Gt().arrayOf(Gt().string)}),Pr=Gt().shape({value:Gt().string,lookupCode:Gt().string}),Rr=Gt().shape({link:Gt().string,filename:Gt().string}),wr=Gt().shape({displayName:Gt().string,parent:Gt().string}),Sr=Gt().oneOfType([Gt().string,Gt().number,Gt().bool,Pr]),Ir=Gt().oneOfType([Sr,Gt().arrayOf(Sr)]),Ur=Gt().shape({fieldName:Gt().string,values:Gt().arrayOf(Ir),filter:Gt().string,type:Gt().string}),Cr=Gt().shape({minValue:Gt().number,maxValue:Gt().number}),jr=Gt().shape({label:Gt().string,name:Gt().string,description:Gt().string,type:Gt().string,hidden:Gt().bool,faceted:Gt().bool,searchable:Gt().bool,uri:Gt().string,access:Gt().arrayOf(Gt().string),cardinality:Cr}),Lr=Gt().shape({label:Gt().string,uri:Gt().string,typeColor:Gt().string,direction:Gt().string,startObject:Gt().object,endObject:Gt().object}),Dr=Gt().shape({typeColor:Gt().string,typeIcon:Gt().string,typeImage:Gt().string,label:Gt().string,uri:Gt().string,attributes:Gt().arrayOf(jr)}),kr=Gt().shape({uri:Gt().string,label:Gt().string,memberTypes:Gt().array,extendsTypeUri:Gt().string,attributes:Gt().arrayOf(jr)}),xr=Gt().shape({uri:Gt().string,label:Gt().string,extendsTypeUri:Gt().string,relationshipTypeURIs:Gt().arrayOf(Gt().string)}),Fr=Gt().shape({uri:Gt().string,description:Gt().string,label:Gt().string,schemaVersion:Gt().string,entityTypes:Gt().arrayOf(Dr),roles:Gt().arrayOf(Gt().object),groupTypes:Gt().arrayOf(Gt().object),relationTypes:Gt().arrayOf(Lr),graphTypes:Gt().arrayOf(xr),interactionTypes:Gt().arrayOf(kr),sources:Gt().arrayOf(Gt().object)}),Mr=Gt().shape({uri:Gt().string,type:Gt().string}),Vr=Gt().shape({uri:Gt().string,attributes:Gt().object,type:Gt().string,timestamp:Gt().number,members:Gt().object}),$r=Gt().shape({uri:Gt().string,type:Gt().string}),Gr=Gt().shape({value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Wr=Gt().shape({refEntity:Gt().oneOfType([Gt().array,Gt().object]),refRelation:Gt().oneOfType([Gt().array,Gt().object]),value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Yr=Gt().oneOf((0,l.values)(Kt)),Br=Gt().shape({type:Gt().oneOf(Object.values(zt)).isRequired,attributeTypeUri:Gt().string.isRequired,parentUri:Gt().string.isRequired,uri:Gt().string,message:Gt().string}),qr={attributeType:jr,showEmptyEditors:Gt().bool,lazy:Gt().bool,mode:Yr,metadata:Fr,ownError:Br,errors:Gt().arrayOf(Br),crosswalks:Gt().array,onAddAttributes:Gt().func,onAddOneMore:Gt().func,onDeleteAttribute:Gt().func,onChangeAttribute:Gt().func,additionalControlsRenderer:Gt().func,hideDeleteButton:Gt().bool,showNonOv:Gt().bool,state:Gt().oneOf(["deleted","edited"])},Kr=vr({attributeValue:Gr},qr),Hr=vr({attributeValue:Wr},qr),Jr=Gt().shape({value:Gt().oneOfType([Gt().string,Gt().bool,Gt().number]),ov:Gt().bool,type:Gt().string,uri:Gt().string,lookupCode:Gt().string,lookupRawValue:Gt().string}),Qr=Gt().shape({totalOvValues:Gt().number,totalValues:Gt().number}),Xr=Gt().shape({inRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),outRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),groups:Gt().arrayOf(Gt().string),entityTypes:Gt().arrayOf(Gt().string),nextEntry:Gt().object}),zr=Gt().oneOf(["asc","desc"]),Zr=Gt().shape({id:Gt().string,content:Xr,allowOnlyCreateNew:Gt().bool,sortColumn:Gt().string,sortOrder:zr,"text-empty":Gt().string,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,editingEnabled:Gt().bool}),en=Gt().shape({id:Gt().string,graph:Gt().shape({type:Gt().string,layout:Gt().number,deep:Gt().number,limit:Gt().number,uri:Gt().string,options:Gt().shape({reverseRelations:Gt().bool})}),sortBy:Gt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:zr,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar}),tn=Gt().shape({id:Gt().string,caption:Gt().string,pageSize:Gt().number,icon:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,attributes:Gt().object}),rn=Gt().shape({entityUri:Gt().string,entityType:Gt().string,entityLabel:Gt().string,object:Mr}),nn=Gt().shape({relationUri:Gt().string,relationType:Gt().string,relationLabel:Gt().string,direction:Gt().string,object:$r}),an=Gt().shape({entity:rn,relation:nn}),on=Gt().shape({value:Gt().string,isRawFilter:Gt().bool}),sn=Gt().shape({id:Gt().string,label:Gt().string,name:Gt().string,availableEntityTypes:Gt().array}),ln=Gt().shape({id:Gt().string,allowMergeAll:Gt().bool,matchActions:Gt().object,availableTabs:Gt().arrayOf(Gt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),un=Gt().shape({matchRules:Gt().arrayOf(Gt().string),object:Mr,shortestTransitiveMatchPath:Gt().arrayOf(Gt().shape({matchRules:Gt().arrayOf(Gt().string),match:Gt().string})),direct:Gt().bool,matchScore:Gt().number}),cn=Gt().arrayOf(un),pn=Gt().arrayOf(Gt().shape({uri:Gt().string,label:Gt().string})),dn=[{label:wt().text("And"),value:"and"},{label:wt().text("Or"),value:"or"},{label:wt().text("And not"),value:"and not"},{label:wt().text("Or not"),value:"or not"}],yn=(0,l.prop)("referencedEntityTypeURI"),fn=(0,l.prop)("relationshipTypeURI"),Tn=(0,l.prop)("referencedAttributeURIs"),En=(0,l.curry)(((e,t)=>(0,l.pipe)(Tn,(0,l.filter)((0,l.startsWith)(e)))(t))),mn=En("configuration/relationTypes"),hn=En("configuration/entityTypes"),bn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),On=(0,l.filter)(bn),gn=(e,t)=>!t||t.some((t=>t===e.uri));function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _n=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",vt.TYPE_STRING),(0,l.propEq)("type",vt.TYPE_BLOB))]),Nn=(0,l.has)("values"),An=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(vt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(vt.TYPE_LOOKUP)],[Nn,(0,l.always)(vt.TYPE_ENUM)],[_n,(0,l.always)(vt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",vt.TYPE_BOOLEAN),(0,l.always)(vt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Pn=(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){vn(e,t,r[t])}))}return e}({},e,{type:An(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Rn=e=>!!e&&(!!e.autoGenerated&&e.type!==vt.TYPE_NESTED||!!e.parentAutoGenerated),wn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Sn=(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),In=e=>wn(e)?"analyticsAttributes":"attributes",Un=(0,l.propEq)("hidden",!0),Cn=(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))),jn=Cn(vt.TYPE_NESTED),Ln=Cn(vt.TYPE_REFERENCE),Dn=Cn(vt.TYPE_IMAGE),kn=(0,l.either)(jn,Ln),xn=(e,t)=>{const r=wn(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(".")},Fn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Mn=(0,l.pipe)(Fn,Boolean),Vn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),$n=(0,l.both)(Mn,(0,l.pipe)(Fn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Gn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=In({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]||Yn(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:[]},Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Gn(e,t,r);return n.length?(0,l.last)(n):null},Yn=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",vt.TYPE_NESTED),(0,l.propEq)("type",vt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.map)((t=>Wn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Bn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],qn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Kn=e=>Bn.includes(e),Hn=e=>qn.includes(e),Jn=[vt.TYPE_INT,vt.TYPE_LONG,vt.TYPE_NUMBER,vt.TYPE_FLOAT,vt.TYPE_DOUBLE,vt.TYPE_COUNT],Qn=e=>Jn.includes(e),Xn=e=>[vt.TYPE_FLOAT,vt.TYPE_DOUBLE].includes(e),zn=[vt.TYPE_BOOLEAN,vt.TYPE_BOOLEAN_RADIO,vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Zn=e=>zn.includes(e),ei=[vt.TYPE_URL,vt.TYPE_BLOG_URL,vt.TYPE_IMAGE_URL],ti=e=>ei.includes(e),ri=Cn(vt.TYPE_EMAIL),ni=e=>vt.TYPE_SSN===e;var ii,ai=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ii||(ii={}));const oi=(0,l.curry)(((e,t,r)=>{var n;const i=null===(n=r[e])||void 0===n?void 0:n.roles;return!i||i.some((e=>t.includes(e)))})),si=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),li=(0,l.curry)(((e,t)=>(0,l.pipe)(si(e),(0,l.prop)("extendsTypeURI"))(t))),ui=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(li(e,r)));return n(r)})),ci=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=li(e,n);return r})),pi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?pi(e,si(e,t.extendsTypeURI),r):void 0,di=(e,t)=>{const r=t.map(ci(e));return(r.length?r.reduce(l.intersection):[])[0]},yi=(e,t)=>pi(e,(0,l.is)(Object,t)?t:si(e,t),"typeImage");function fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ti=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ei=(0,l.pipe)(Ti,(0,l.propOr)("","label")),mi=(0,l.curry)(((e,t)=>{const r=Ti(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),hi=(0,l.curry)(((e,t,r)=>{const[n,i]=mi(e,r);return ui(e,n,t)||ui(e,i,t)})),bi=(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){fi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Oi=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?Pt.OUT:Pt.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(Pt.IN),i=r(Pt.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},gi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),vi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},_i=(0,l.curry)(((e,t)=>e.every((e=>Ni(e,t))))),Ni=(0,l.curry)(((e,t)=>{const r=Rn(t);return!t||(!t.access||t.access.includes(e))&&(e===vi.READ||!r)})),Ai=(0,l.curry)(((e,t,r)=>Ni(vi.READ,r)&&(Ht(t)?Ni(vi.INITIATE_CHANGE_REQUEST,r):Ni(e,r)))),Pi=Ai(vi.CREATE),Ri=Ai(vi.DELETE),wi=Ai(vi.UPDATE),Si=_i([vi.CREATE,vi.MERGE,vi.READ,vi.UPDATE]),Ii=_i([vi.UPDATE,vi.READ,vi.CREATE]),Ui=_i([vi.UPDATE,vi.READ]),Ci=_i([vi.DELETE,vi.UPDATE,vi.READ]),ji=(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["*"])),Li=(e,t,r)=>(0,l.pipe)((0,l.map)(ji(e,t)),(0,l.filter)(l.identity))(r),Di=(e,t,r)=>{const n=Li(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ni(vi.MERGE,r)},ki=(0,l.curry)(((e,t,r,n)=>{const i=Ti(e,n),[a,o]=mi(e,n);return i&&Ni(vi.CREATE,i)&&ui(e,a,t.type)&&ui(e,o,r.type)})),xi=(e,t,r,n,i)=>{const a=si(e,n.type),o=Li(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(ki(e,n,i))||a.some(ki(e,i,n))}))},Fi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=si(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Di(o,i,a),canAddRelation:xi(e,o,i,r,n),canMark:Ni(vi.UPDATE,a)&&Ni(vi.READ,a)}},Mi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Fi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Vi=wn,$i=(0,l.complement)(Vi),Gi=Ni(vi.READ),Wi=e=>{let{attributeType:t,mode:r}=e;return $i(t)&&Pi(r,t)&&!Un(t)},Yi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=wi(n),s=Pi(n);return(0,l.cond)([[Vi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Be(r.uri),s=wi(n),u=Ri(n),c=Ki(vi.UPDATE,n,a,r),p=Ki(vi.DELETE,n,a,r);return(0,l.cond)([[Vi,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)},qi=(0,l.curry)(((e,t,r,n)=>{const i=Yn(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=>!Ni(e,n)||!qi(e,t,r[n.name],n)))))})),Ki=(0,l.curry)(((e,t,r,n,i)=>Ht(t)?qi(vi.INITIATE_CHANGE_REQUEST,r,n,i):qi(e,r,n,i))),Hi=(0,l.both)((0,l.complement)(Un),Gi),Ji="SuperUser",Qi="allTenants",Xi=[Qi,"allCustomers"],zi=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===Ji})).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===Ji){const e=r?Xi.concat(r.map((e=>`allTenants.${e}`))):Xi,n=r&&t[0]===Qi?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},Zi={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_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"},ea={[Zi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Zi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activityLog"],privileges:["EXECUTE"]},[Zi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Zi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Zi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Zi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Zi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Zi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Zi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Zi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Zi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Zi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Zi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Zi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Zi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Zi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Zi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Zi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Zi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Zi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Zi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Zi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Zi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]}},ta=(0,l.curry)(((e,t,r)=>zi({allowedPermissionsNames:e,permissionsNames:Zi,permissionsConfig:ea}).some((e=>e(t,{params:{tenant:r}}))))),ra=ta([Zi.CAN_EXPORT]),na=ta([Zi.CAN_EXPORT_ACTIVITIES]),ia=ta([Zi.CAN_IMPORT_ENTITIES_FROM_DT]),aa=ta([Zi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),oa=ta([Zi.CAN_UPDATE_PROCESS_INSTANCE]),sa=ta([Zi.CAN_VIEW_WORKFLOW_DEFINITION]),la=ta([Zi.CAN_CONFIG_ENVIRONMENT_REGISTER]),ua=ta([Zi.CAN_UPDATE_WORKFLOW_DATA_TASK]),ca=ta([Zi.CAN_READ_WORKFLOW_DATA_TASK]),pa=ta([Zi.CAN_MANAGE_WORKFLOW_DEFINITION]),da=ta([Zi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ya=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),fa=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ta=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ea=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ma=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS]),ha=ta([Zi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),ba=ta([Zi.CAN_CREATE_CONFIG_JAR]),Oa=ta([Zi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ga=ta([Zi.CAN_VIEW_CONFIG_JAR]),va=ta([Zi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),_a=ta([Zi.CAN_VIEW_WORKFLOW_JOBS]),Na=ta([Zi.CAN_MAKE_BULK_UPDATE]),Aa=ta([Zi.CAN_OPEN_DATA_LOADER_EXECUTE,Zi.CAN_OPEN_DATA_LOADER_READ]),Pa=ta([Zi.CAN_BULK_DELETE_PROFILES]),Ra=ta([Zi.CAN_READ_MDM_DATA_ENTITIES]),wa=ta([Zi.IS_FREEMIUM_ADMIN]),Sa=(0,l.reject)(Un),Ia=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Sa,(0,l.filter)(e))(t),Ua=(0,l.curry)(((e,t)=>Ia((t=>Wi({attributeType:t,mode:e})),t))),Ca=(0,l.curry)(((e,t)=>Ia((t=>Wi({attributeType:t,mode:e})||Hi(t)),t))),ja=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Hi)),La=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...La(e)])))),Da=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Hi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Da(e)])))),ka=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...ka(e)])))),xa=(0,l.pipe)(si,(0,l.converge)(l.concat,[Da,ka]));function Fa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ma(e,t,r[t])}))}return e}function Ma(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Va=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Va(e)))},t))),$a=e=>{var t;return Fa({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ga=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Wa=(0,l.when)(Ga,(0,l.dissoc)("values")),Ya=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Fa({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),Ba=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},qa=(0,ai.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(La,t).concat((0,l.chain)(La,r)).some(Ba)})),Ka=e=>{let t=!1;const r=Va((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Fa({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ha=e=>{const t=qa(e),r=(0,l.map)((e=>Va((0,l.pipe)(Wa,(0,l.when)((0,l.always)(e),Ya))))(t)),n=(0,l.map)($a),i=(0,l.map)(Ka);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Ja=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Qa=(0,l.prop)("relationshipTypeURIs"),Xa=(0,l.curry)(((e,t)=>e.graphTypes.filter(za(e,t)))),za=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(hi(e,t))},Za=(e,t)=>(0,l.pipe)(Ja,(0,l.defaultTo)({}),Qa,(0,l.defaultTo)([]),(0,l.chain)(mi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(si(e)))(e,t),eo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),to=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ro=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return to((0,l.complement)(eo))(e)},no=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return to(eo)(e)},io=(0,l.pipe)(si,(0,l.propOr)([],"matchGroups")),ao=(e,t,r)=>(0,l.pipe)(io,(0,l.find)((0,l.propEq)("uri",r)))(e,t),oo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ao,(0,l.propOr)(r,"label"))(e,t,r))),so=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(io,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),lo=e=>(0,l.partition)(eo,e),uo=(0,l.includes)(l.__,["and","or","not"]),co=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),po=(0,l.includes)(l.__,["equals","notEquals","in"]),yo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return uo(t)?yo(r):co(t)?r.filter(Xe):po(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),fo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(yo),l.uniq),To=(0,l.pipe)(io,fo),Eo=(0,l.pipe)(so,fo),mo=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},ho=(0,l.pipe)(mo,Da),bo=(e,t)=>e.interactionTypes.filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||ui(e,n,t)})(e,t))})(e,t)),Oo=e=>!!e.required,go=(e,t,r)=>{const n=(0,l.cond)([[Xe,si(e)],[ze,Ti(e)]])(t);return vo(e,n,r)},vo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Xe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Rn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===vt.TYPE_REFERENCE){const n=fn(t),a=Tn(t);i=go(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=vo(e,t,r));i&&n.push(...i)}return n})):t.type===vt.TYPE_REFERENCE?go(e,fn(t),r):[],_o=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),Oo]),e.attributes||[])},No=(e,t)=>{const r=hn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},Ao=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?wt().text(n):n};return r(null,t)})),Po=["label","description","abbreviation","caption","toolTip"],Ro=e=>Ao(Po,e),wo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),So=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(wo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Io=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"})},Uo=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Co=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=si(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function jo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lo(e,t,r[t])}))}return e}function Lo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Do=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return z.fromNull(i&&i.length?i:Yn(e,t)).map((t=>t.map((t=>{const i=Do(e,t,r,n);return i.length?jo({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(kn),(0,l.prop)("children"))).filter(Hi).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes","analyticsAttributes"])},xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["analyticsAttributes"])},Mo=(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)})),Vo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),$o=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Vo("LUD")),(0,l.defaultTo)(r))(t||[])},Go=(e,t)=>{let{survivorshipStrategies:r}=e;return Vo(t,r)},Wo=(0,l.allPass)([(0,l.complement)(l.isNil),Ni(vi.READ)]),Yo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ni(vi.READ)]),Bo=(0,l.curryN)(2,(0,l.pipe)(si,Yo)),qo=e=>{let{ov:t}=e;return!1!==t},Ko=(e,t)=>((e,t)=>ti(e.type)&&ie(t))(e,t)||((e,t)=>ri(e.type)&&ae(t))(e,t),Ho=(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))),Jo=Ho("refEntity"),Qo=Ho("refRelation"),Xo=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],zo=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Zo=(0,l.prop)("objectURI"),es=(0,l.prop)("objectURI"),ts=(0,l.prop)("type"),rs=(0,l.pipe)(Jo,(0,l.defaultTo)({}),Zo),ns=(0,l.pipe)(Qo,(0,l.defaultTo)({}),es),is=(0,l.pipe)(Jo,(0,l.defaultTo)({}),ts),as=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},os=(0,l.evolve)({refEntity:te,refRelation:te}),ss=(e,t,r,n)=>{const i=Gn(e,r),a=si(e,t.type)||Ti(e,t.type);if(0===i.length)return null;const o=In(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(!gn(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=>fn(e)===r.uri||yn(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},ls=(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?ls(a.value,o):a},us=(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 ls(e[r],i)})),cs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]]),ps=(0,l.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)(cs),(0,l.when)((()=>i.length>0),(0,l.map)(ps(e,i))))(r)})),ds=ps(null),ys=ps(qo),fs=(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=us(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ts=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(rs,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function Es(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hs=e=>{let{parentUri:t,attributeType:r}=e;return Es({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[kn,(0,l.always)({value:{}})],[Mn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},bs=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ua(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Vn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=hs({parentUri:r,attributeType:e});let s=Yn(n,e);s&&(e.type===vt.TYPE_REFERENCE&&(s=On(s)),a.value=bs({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!Vn(e)||(o[t]=[a])}return o},Os=e=>{let{entity:t,metadata:r}=e;return go(r,t.type,!0).filter(Vn).reduce(((e,t)=>{const n=t.name,i=lt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ss(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:vs({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},gs=(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===vt.TYPE_NESTED?Es({},e,{value:gs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Es({},s(t),bs({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),vs=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=hs({parentUri:n,attributeType:r}),u=cs(l);return(0,Fe.ZP)(t,(e=>{Re(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},_s=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{Re(e.attributes||e.value,r,n.uri,cs(n),a,o,i)}))},Ns=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},As=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Fe.ZP)(t,(e=>{Ie(e.attributes||e.value,r,n,i)}))},Ps=(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"))),Rs=(0,l.reject)(Ps),ws=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=>ws({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Rs)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Ss=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ws({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),os),deleteEmptyComplex:e})},Is=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Ss(e),(0,l.reject)(l.isEmpty))},Us=Object.values(Ut),Cs=(0,l.includes)(l.__,Us),js=e=>Us.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ls(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ds(e,t,r[t])}))}return e}function Ds(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,t)=>`${e}_${t}`,xs=[Vt.matches.name,Vt.matchRules.name],Fs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,xs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ks(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Ms=(e,t)=>(0,l.pipe)(l.values,Fs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ks(`dtPotentialMatches.${t.name}`,"")))))(Vt),Vs=(0,l.propEq)("uri",Vt.type.uri),$s=e=>(0,l.values)(Mt).some((0,l.propEq)("uri",e.uri)),Gs=(0,l.propEq)("uri",Ft.sourceSystems.uri),Ws=Object.values(Ct),Ys=(0,l.includes)(l.__,Ws),Bs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:void 0===n?r.defaultValue:n})},qs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Ks=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:n})},Hs=(0,l.propEq)("uri",Ct.roles.uri),Js=(0,l.propEq)("uri",Ct.tags.uri),Qs=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)},Xs="UrlThumbnail",zs="CdnUrlThumbnail",Zs=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(qo):(0,l.head)(n);return e&&e.value}return null})),el=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Zs(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),tl=el(["CdnUrl","Url"],!0),rl=el(["CdnUrlPreview","UrlPreview"],!0),nl=el([zs,Xs],!0),il=el([zs,Xs]),al=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Sn,(0,l.always)(t)],[(0,l.both)(wn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Sn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Cs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),re)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},ol=(e,t,r)=>{const n=ja(e),i=(0,l.any)(r?l.T:qo);return al(n,t,i)},sl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?Ua(t,e):Ca(t,e);return al(o,r,((e,o)=>{const s=Wi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:qo,e)||Sn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let ll;const ul=e=>{ll=e};function cl(e,t){return ll(e,t)}const pl=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)})),dl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return cl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},yl=(0,l.once)((()=>cl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),fl=e=>cl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Tl=(e,t)=>cl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),El=e=>z.fromNull(Tt[e]).map(wt().text).orSome(""),ml=(0,l.curry)(((e,t)=>`${e}_${t}`)),hl=(0,l.split)("_"),bl=(0,l.includes)("_"),Ol=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),gl=(0,l.curry)(((e,t)=>e.some(Ol(t)))),vl=gl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),_l=gl([ct.EXISTS,ct.MISSING_VALUE]),Nl=(0,l.cond)([[_l,(0,l.always)(0)],[vl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Al=(0,l.complement)(_l),Pl=gl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),Rl=gl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),wl=gl([ct.IN_FILE,ct.NOT_IN_FILE]),Sl=e=>{switch(e){case ct.COUNT_EQUALS:return ct.EQUALS;case ct.COUNT_NOT_EQUALS:return ct.NOT_EQUALS;case ct.COUNT_LT:return ct.LT;case ct.COUNT_LTE:return ct.LTE;case ct.COUNT_GT:return ct.GT;case ct.COUNT_GTE:return ct.GTE;case ct.COUNT_RANGE:return ct.IN_RANGE}},Il=gl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),Ul=gl([ct.WITHIN]),Cl=[[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE],[ct.NOT_IN_FILE,ct.IN_FILE],[ct.EQUALS,ct.NOT_EQUALS,ct.HAS_ALL],[ct.LT,ct.LTE,ct.GT,ct.GTE],[ct.MISSING_VALUE,ct.EXISTS],[ct.COUNT_RANGE],[ct.IN_RANGE],[ct.STARTS_WITH,ct.CONTAINS],[ct.FULL_TEXT],[ct.ON,ct.BEFORE,ct.AFTER,ct.NOT_EQUALS],[ct.WITHIN]],jl=(e,t)=>Cl.some((r=>r.includes(e)&&r.includes(t))),Ll=(0,l.pipe)(l.omit,l.values),Dl={OPTIONS_FOR_STRING:Ll(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_DATE:[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS,ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Ll(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_BLOB:Ll(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:Ll(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:Ll(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:Ll(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_ID:[ct.EQUALS,ct.NOT_EQUALS,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],OPTIONS_FOR_COMPLEX:[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.EXISTS,ct.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ct.EQUALS,ct.NOT_EQUALS,ct.EXISTS,ct.MISSING_VALUE]},kl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case vt.TYPE_TYPEAHEAD:case vt.TYPE_STRING:case vt.TYPE_PASSWORD:case vt.TYPE_TEXT:case vt.TYPE_CIK_ID:case vt.TYPE_URL:case vt.TYPE_BLOG_URL:case vt.TYPE_IMAGE_URL:case vt.TYPE_EMAIL:return Dl.OPTIONS_FOR_STRING;case vt.TYPE_LOOKUP:case vt.TYPE_DEPENDENT_LOOKUP:return Dl.OPTIONS_FOR_LOOKUP;case vt.TYPE_ENUM:return Dl.OPTIONS_FOR_ENUM;case vt.TYPE_DATE:case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_TIMESTAMP:case vt.TYPE_LOCAL_DATE:return Dl.OPTIONS_FOR_DATE;case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:return Dl.OPTIONS_FOR_BOOLEAN;case vt.TYPE_BLOB:return Dl.OPTIONS_FOR_BLOB;case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_NUMBER:return Dl.OPTIONS_FOR_NUMBER;case vt.TYPE_ENTITY_ID:return Dl.OPTIONS_FOR_ID;case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case vt.TYPE_COUNT:return Dl.OPTIONS_FOR_COUNT;case vt.TYPE_NESTED:case vt.TYPE_REFERENCE:case vt.TYPE_IMAGE:return Dl.OPTIONS_FOR_COMPLEX;default:return Dl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Rl,n):n},xl=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=t.length>0?`${t} ${r}`:r;return n===this.clauses.length-1?i:`${i} ${(0,l.propOr)("and",n,e)}`}),"")}},Fl=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Ml=e=>Array.isArray(e)?e.map(Ml).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Vl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),$l=e=>`'${e}'`,Gl=e=>`"${e}"`,Wl=(0,l.pipe)(Ml,Vl),Yl=(0,l.pipe)(Wl,$l),Bl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(vl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),ql=(e,t)=>Rl(t)?{type:vt.TYPE_INT}:wl(t)?{type:vt.TYPE_FILE}:Il(t)&&!Ul(t)&&Hn(e.type)?{type:vt.TYPE_LOCAL_DATE}:e,Kl=Object.values(Ot),Hl=e=>Kl.includes(e),Jl=e=>wt().text(gt[e]),Ql=e=>{const t=f()();switch(e){case Ot.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Ot.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case Ot.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Ot.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Ot.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function Xl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zl(e,t,r[t])}))}return e}function zl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zl=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),eu=(0,l.curry)(((e,t,r)=>{const n=r.map(vl(e)||t.endsWith(".count")?Wl:Yl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),tu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},ru=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Nl(t);return(0,l.pipe)(tu(i),(0,l.map)(eu(t,r)),Zl(" or "))(n)},nu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Yl).join(",")})`},iu=e=>`*${e}*`,au=e=>`URL:${e}`,ou=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,su=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},lu=(e,t)=>[P(e,t),R(e,t)],uu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!cu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return Xl({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[lu(i,n)]});case ct.BEFORE:return Xl({},e,{filter:ct.LTE,values:[[R(i,n)]]});case ct.AFTER:return Xl({},e,{filter:ct.GTE,values:[[P(i,n)]]});case ct.WITHIN:return Xl({},e,{filter:ct.IN_RANGE,values:[Ql(i)]})}}return e}),ru),cu=(0,l.propSatisfies)(Hn,"type"),pu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",ct.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(ru({filter:ct.EQUALS,fieldName:t,values:[r]}))),new xl).build())),Zl(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:r,filter:t,values:n.map((0,l.pipe)(Ml,iu))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?ru(Xl({},e,{values:(0,l.flatten)(r)})):ou(r)?nu(Xl({},e,{filter:"listEquals"})):ru(e)}],[(0,l.propEq)("filter",ct.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Nl(t);return(0,l.pipe)(tu(i),(0,l.map)(eu(t,r)),Zl(" and "))(n)})(Xl({},e,{values:(0,l.flatten)(e.values)})):cu(e)?(e=>{const{values:t}=e,r=!cu(e),[n]=t;return(new xl).addClause(ru(Xl({},e,{filter:ct.LT,values:[P(n,r)]}))).addClause(ru(Xl({},e,{filter:ct.GT,values:[R(n,r)]}))).orBuild()})(e):ou(t)?nu(Xl({},e,{filter:"not listEquals"})):ru(e)}],[(0,l.propSatisfies)(wl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:r,filter:su(t,r),values:n.map((0,l.prop)("link")).map(au)})}],[(0,l.propSatisfies)(Rl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:`${r}.count`,values:n,filter:Sl(t)})}],[(0,l.propSatisfies)(Il,"filter"),uu],[(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 eu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return eu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,ru]],du=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Al(e)||fu(r))},yu=e=>Array.isArray(e)?fu(e):null!=e&&Ml(e).length>0,fu=e=>e&&e.length>0&&e.every(yu);function Tu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},mu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),hu=(e,t,r)=>"children"===e?Ou(r,[...t][0],!0):r,bu=(e,t,r)=>"values"===e?[...r,...t]:r,Ou=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)(hu,t),e);if(!r&&Pl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(bu,t),e)}return(0,l.append)(t,e)},gu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Eu(e),r=e=>e.fieldName===t?e:r({fieldName:mu(e),children:[e]});return r(e)})(t);return Ou(e,r)}),[]),vu=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")),_u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function r(n){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.reduce(((n,a)=>n.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:n}=e;return i&&vu(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new xl).buildWithOperators(n.map((0,l.prop)("operator")))}},Nu=(0,l.pipe)((0,l.propOr)("","filter"),bl),Au=(0,l.map)((0,l.when)(Nu,(e=>{const[t,r]=hl(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Pu=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)(du),Au,gu,_u([...e,...pu],t))},Ru=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),wu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],Su=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],Iu=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],Uu=(e,t)=>{const r=Pn(e);return(e=>{switch(e){case Ut.startDate.name:case Ut.endDate.name:case jt.dueDate.name:case kt.createdTime.name:case kt.updatedTime.name:case Ft.reltioLoadDate.name:case Ft.createDate.name:case Ft.updateDate.name:case Ft.deleteDate.name:case Ft.publishDate.name:return wu;case xt.matches.name:case Ft.count.name:return Iu;case jt.workflow.name:case jt.assignee.name:case jt.step.name:case Lt.commenter.name:case kt.createdBy.name:case kt.updatedBy.name:case Ft.sourceSystems.name:case Ft.value.name:return Su;default:return null}})(t)||kl(r)},Cu=[ct.EQUALS,ct.NOT_EQUALS,ct.CONTAINS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.IN_RANGE,ct.WITHIN,ct.EXISTS,ct.ON],ju=(0,l.pipe)(Uu,(0,l.filter)((0,l.includes)(l.__,Cu))),Lu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Du=e=>{let{query:t,body:r}=e;return t=Lu(t),cl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},ku=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)(Pu(),Ru(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Bt(i)}`},xu=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=ku(e,t,r);return cl(n)},Fu=(0,l.pipe)((0,l.reject)(l.isNil),Yt),Mu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Pu(),Ru(i))(r),c=Fu({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return Du({query:c,body:p})},Vu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Mu({fieldName:t,searchParams:i,options:n})},$u="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Gu=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)(Pu(),Ru(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||$u,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Bt(i)}`},Wu=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=Gu(e,t,r);return cl(n)},Yu=e=>cl(`/${e}?select=secondaryLabel`),Bu=(e,t)=>{const{select:r=$u,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),cl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},qu=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),Ku=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=qu(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=xn(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)(Pu(),Ru(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),cl(`${s}/api/${o}/${t}/_object`,m)},Hu=e=>`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,Ju=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Qu=e=>cl(Hu(e)),Xu=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 cl(n,r)},zu=e=>cl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Zu=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return cl(`/entities/_events/_total${Yt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ec=(e,t)=>cl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),tc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return cl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},rc=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 cl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},nc=e=>{const t=new FormData;return t.append("file",e),cl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,wt().text("Can't upload file"));return Promise.reject(t)}))},ic=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 cl(`/personal/findSavedSearches${Yt({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"}})},ac=e=>cl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),oc=e=>cl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return cl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},lc=e=>{let{uri:t}=e;return cl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},uc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),sc)(e),cc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),sc)(e);function pc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dc=["max","offset","filter"],yc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:yc(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){pc(e,t,r[t])}))}return e}({},t,(0,l.pick)(dc,e)))),fc=(0,l.omit)(["activeness"]),Tc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ir.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ir.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(yc(e),(0,l.omit)(dc))(e))),fc))(t),{url:`/${e}/_connections${Bt({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},Ec=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),mc=(0,l.reject)(l.isNil),hc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),bc=e=>cl(hc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Oc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,hc);return cl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},gc=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?Is()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(mc,re,JSON.stringify);return cl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},vc=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"),hc,n),o=he(i(t),i(r)).concat(Oe(t,r));return cl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},_c=(e,t)=>{const{url:r,options:n}=Tc(e,t);return cl(r,n).then(Ec)},Nc=(e,t)=>cl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Ac=(e,t)=>cl(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),Pc=e=>cl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Rc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return cl(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function wc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sc(e,t,r[t])}))}return e}function Sc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ic={select:"label,secondaryLabel,name,type,startDate,endDate"},Uc=(0,l.reject)(l.isNil),Cc=(0,l.pipe)(Uc,Yt),jc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=wc({},Ic,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{});return cl(`/${t}/_tree${Cc(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Lc=e=>{let{uri:t,graphUri:r}=e;const n=wc({},Ic,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return cl(`/${t}/_parents${Cc(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Dc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1}=e;const o=wc({},Ic,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},{filterLastLevel:i,deep:a});return cl(`/${t}/_hops${Cc(o)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function kc(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 xc=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Fc="/activities",Mc=e=>{let{label:t,description:r}=e;return cl(Fc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:xc()}})},Vc=e=>{const t=Bt(e);return cl(Fc+t,{method:"GET"})},$c=e=>cl(`/activities/_total${Bt(e)}`,{method:"GET"}),Gc=e=>{const{entityUri:t}=e,r=kc(e,["entityUri"]);return cl(`/${t}/_activities${Bt(r)}`,{method:"GET"})},Wc=e=>{const{entityUri:t}=e,r=kc(e,["entityUri"]);return cl(`/${t}/_activities/_total${Bt(r)}`,{method:"GET"})};function Yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bc(e,t,r[t])}))}return e}function Bc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qc=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Kc=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return cl(qc({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Hc=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=qc({url:r,workflowPath:t,tenant:n})),cl(s,{method:i||"GET",body:JSON.stringify(a),headers:Yc({"Content-Type":"application/json"},null!=o?o:{})})},Jc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=qc({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return cl(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)},Qc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=qc({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Yc({},l,{comment:o}):l;return cl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Xc=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=qc({url:`/tasks${s?Bt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Yc({objectURIs:[i]},(0,l.reject)(E,a)))};return cl(u,Yc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},zc=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return cl(qc({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Zc=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return cl(qc({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},ep=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return cl(qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},tp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return cl(qc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},rp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return tp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},np=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return cl(qc({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return tp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return tp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},op=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return tp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return cl(qc({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},lp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return cl(qc({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},up=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(qo);return a&&a[0]&&(r=n.length>0&&a[0].value?up(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}}),""),cp=(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=up(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},pp=/[,\s]*$/,dp=e=>{const t=wt().text(At);if(!e)return t;const r=e.replace(pp,"");return""===r.toString().trim()?t:r},yp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},fp=(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=yp(e,r.referencedEntityTypeURI);if(n)return cp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return cp({attributes:t||{}},r.dataLabelPattern);return""},Tp=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},Ep=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},mp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",hp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),nl,(0,l.prop)("value"))),bp=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),hp),Op=(e,t,r)=>{const n=bp(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(us(e),hp)))(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")])})(si(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ss(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,hp))(r)})(e,r)||yi(e,r.type);return mp(t,n)};var gp=void 0;const vp={50:"#E0233A",80:"#F5A623",100:"#62A61B"},_p=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return r.map((r=>{r="/"===r[0]?r:"/"+r;const n=t.type+r+"/analyticsAttributes/score",i=t.type+r+"/analyticsAttributes/updatedDate",a=Wn(e,n);return{label:a&&(a.label||a.name),uri:n,value:a&&Np(e,t,n)||"-",updatedDate:a&&Np(e,t,i)||0}}),gp).filter((e=>null!=e.label&&("-"===e.value||e.value>=0&&e.value<=100)))},Np=(e,t,r)=>{const n=ss(e,t,r);return n&&n[0]&&n[0].value},Ap=(e,t,r)=>{const n=r&&r[e]||vp,i=Object.keys(n).map((e=>({value:+e,color:n[e]}))).filter((e=>!isNaN(e.value))).sort(((e,t)=>e.value-t.value)).map(((e,t,r)=>({start:0===t?0:r[t-1].value,end:e.value,color:e.color}))).find((e=>t>=e.start&&t<=e.end));return i&&i.color||"#666666"};function Pp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rp(e,t,r[t])}))}return e}function Rp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wp=(0,l.replace)(new RegExp("^entities/"),""),Sp=e=>"DTSS/"+e.dataTenant+"/"+e.uri,Ip=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Up=e=>!(!e||!e.dataTenant),Cp=(0,l.ifElse)(Up,Sp,(0,l.prop)("uri")),jp=e=>e&&e.uri?e.dataTenant?Sp(e):wp(e.uri):"",Lp=(0,l.curry)(((e,t,r)=>(si(t,r.type)||{})[e]||"")),Dp=Lp("label"),kp=Lp("typeGraphIcon"),xp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=si(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(qo)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:fp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Fp=(0,l.pipe)(xp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Mp=(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=Mp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Mp(e.slice(1),r)}})),Vp=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,$p=e=>(0,l.propOr)([],"matchRules",e),Gp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Pp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Wp=(e,t,r)=>t&&r?r.aEntity:e,Yp=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 cl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Yt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Bp=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 cl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},qp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return cl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Kp=(e,t,r)=>Promise.all(t.map((async t=>{await cl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),Hp=async(e,t)=>await Kp(e,t,"NOT"),Jp=async(e,t)=>await Kp(e,t,"MATCH"),Qp=async(e,t)=>await Promise.all(t.map((async t=>{await cl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function Xp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zp(e,t,r[t])}))}return e}function zp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zp(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 ed=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return cl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},td=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Od({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},rd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return Od({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},nd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return cl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},id=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 nd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},ad=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Up,i);return Promise.all([s.length?qp(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return nd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},od=(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=Zp(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)}),[])),sd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),od),ld=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return cl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(sd)},ud=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)},cd=ud((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return cl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(sd)})),pd=ud((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return cl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),dd=(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)}},yd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return cl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},fd=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 yd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Td=fd("NOT"),Ed=fd("MATCH"),md=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Up,a);return Promise.all([Kp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return yd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},hd=md("NOT"),bd=md("MATCH");function Od(e){let{requestProvider:t=cl,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}`,Xp({},Zp(s,["headers"]),{headers:Xp({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const gd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Od({url:Gu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},vd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return Od({url:ku(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},_d=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Tc(t,r);return Od({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Ec,(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)))}))))},Nd=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return Od({url:`${Ju(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Ad=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return cl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Pd=()=>cl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET",headers:{"Content-Type":"application/json"}});function Rd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wd(e,t,r[t])}))}return e}function wd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sd=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=Rd({},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 cl(`${t}/api/${r}/graph/search${Bt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Id=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return cl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:Rd({},n,i),headers:{"Content-Type":"application/json"}})},Ud=(e,t)=>`${e}/${t}/comments`,Cd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return cl(`${Ud(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},jd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return cl(`${Ud(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ld=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return cl(Ud(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Dd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return cl(`${Ud(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},kd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return cl(`${Ud(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},xd=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return cl(`${Ud(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Fd=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Bt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return cl(`${Ud(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vd(e,t,r[t])}))}return e}function Vd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $d=(e,t)=>{const[r]=e.split("/ui/");return`${r}/services${t.startsWith("/")?t:`/${t}`}`},Gd=(e,t)=>{const r=Yt({url:"/oauth/users/tenant/{0}",params:e});return cl($d(t,`oauth/proxy${r}`),{method:"GET",headers:{"Content-Type":"application/json"}})},Wd=async(e,t,r,n,i)=>{const a=$d(e,`/configService?tenant=${t}&environment=${r}&namespace=graphExport`);let o;try{const{data:e={}}=await cl(a,{method:"GET",headers:{"Content-Type":"application/json"}});o=e}catch(e){o={}}const s={body:JSON.stringify(Md({},o,{[n]:i})),headers:{"Content-Type":"application/json"}};let l;try{l=await cl(a,Md({method:"PUT"},s))}catch(e){l=null}return l||(l=await cl(a,Md({method:"POST"},s))),l},Yd=(e,t)=>cl($d(e,`/settings?key=${t}`),{method:"GET",headers:{"Content-Type":"application/json"}}),Bd=e=>cl($d(e,"/version/collect"),{method:"POST",headers:{"Content-Type":"application/json"}}),qd=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return cl(`${n}/plugins${Bt({tenant:t,user:r})}`,{method:"GET"})},Kd=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),cl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Hd=e=>cl(`/${e}?showObjectsInfo=true`,{method:"GET"}),Jd=e=>{let{exportPath:t,options:r}=e;return cl(`${t}/activities${Bt(r)}`,{method:"POST"})};function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xd(e,t,r[t])}))}return e}function Xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zd=e=>{const{entityUri:t}=e;return cl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Zd=e=>{let{entityUri:t,crosswalk:r}=e;return cl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ey=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return cl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Qd({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Qd({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},ty=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return cl(`/${r}/_${n}${Bt({contributorURI:t})}`,{method:"POST"})},ry=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return cl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},ny=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return cl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},iy=e=>{let{entityUri:t,crosswalkId:r}=e;return cl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},ay=e=>{let{entityTypeUri:t}=e;return cl(`/dataQuality/fillRates${Yt({entityType:tt(t)})}`,{method:"GET"})},oy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return cl(`/dataQuality/statistic${Yt({entityType:tt(t),attribute:r})}`,{method:"GET"})},sy=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n}=e;return cl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET"})},ly=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return cl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},uy=e=>{let{attributeUri:t,value:r}=e;return cl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},cy=e=>{let{attributeUri:t,value:r}=e;return cl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},py=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return cl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},dy=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Bt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Is()([[{value:a}]]);return cl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},yy=e=>{let{entityUri:t,attributeName:r,value:n}=e;return cl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},fy=e=>{let{entityUri:t,attributeName:r}=e;return cl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function Ty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ey=e=>{let{entityUri:t}=e;return cl(`/${t}/_historicURIs`,{method:"GET"})},my=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 cl(`/${t}/_changesWithTotal${Bt(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){Ty(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},hy=(e,t)=>cl(`/${e}/_previousChange${Bt({timestamp:t})}`,{method:"GET"}),by=(e,t)=>cl(`/${e}${Bt({time:t})}`,{method:"GET"});function Oy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gy(e,t,r[t])}))}return e}function gy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vy=e=>{let{url:t,method:r,data:n,headers:i}=e;return cl(t,Oy({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:Oy({"Content-Type":"application/json"},null!=i?i:{})}))},_y=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Bt({options:a.join(","),severity:o.join(",")});return cl(`${t}/validate/${i}/entity/${jp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Ny=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return cl(`${t}/validate/${n}/entity${Bt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})};var Ay=r(47485);const Py=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:bs({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=ss(r,e,n.uri)[0];return i&&i.value?Ns({entity:e,attributeType:n,uri:i.uri,value:t}):vs({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Ry=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(rs),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),wy=(0,l.curry)(((e,t)=>{const r=Ry(e=e||{},t=t||{});return r.concat((0,l.chain)(wy(e),r))})),Sy=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),Iy=Sy((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Uy=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),Cy=e=>(0,l.pipe)(Iy,Uy(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),jy=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Iy,(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})),Ly=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),Dy=(0,l.pipe)(Ly,(0,l.evolve)({attributes:Is(!0)})),ky=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=Cy(i);if(a.length>0)for(const t of a)e=jy(t,r[t].uri,e);const o=(s=await Xu(Dy(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},xy=async(e,t,r)=>{const n=My(e,t),i={};for(const t of n)i[t]=await ky(e,t,i,r);return i},Fy=(0,l.curry)(((e,t)=>{const r=Ay.Node(t);return Cy(e[t]).forEach((t=>{const n=Fy(e,t);r.addEdge(n)})),r})),My=(e,t)=>(0,l.pipe)((0,l.map)(Fy(e)),(0,l.map)(Ay.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Vy=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Ly))})),$y=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ve((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},Gy=(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 jy(r,n,e)}),e))))}),t)}),Vy),Wy=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function Yy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){By(e,t,r[t])}))}return e}function By(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qy=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:yr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Ky=e=>{let{relationUri:t}=e;return{type:yr.DELETE_RELATION,parameters:{relationUri:t}}},Hy=e=>{let{oldRelation:t,newRelation:r}=e;return{type:yr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Jy=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:yr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},Qy=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Xy=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case yr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return gc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case yr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Oc(e,i).then(o)};case yr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return vc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case yr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Ky({relationUri:o}),qy({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(zy(n)),(0,l.map)(Xy),Qy)(s)}}},zy=e=>t=>Yy({dcrProcessor:e},t),Zy=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=qt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(zy(r)),(0,l.map)(Xy),Qy,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},ef=e=>t=>(0,l.map)((t=>Yy({},t,{parameters:(0,l.evolve)({parentUri:Wy(e),entityUri:Wy(e),newEntityUri:Wy(e)},t.parameters)})),t);function tf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rf=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){tf(e,t,r[t])}))}return e}({},(0,l.path)(df(),e),{startDate:(0,l.path)(Ef(),e),endDate:(0,l.path)(mf(),e)}),nf=(e,t)=>(0,l.pipe)((0,l.path)(Tf()),Wy(t))(e),af=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[]}=t;return[...a.map((e=>{const t=nf(e,r),i=(0,l.path)(yf(),e)===fr.IN,a=e.parentEntityUri||n;return qy({parentUri:i?t:a,relation:rf(e),entityUri:i?a:t})})),...o.map((t=>{const i=nf(t,r),a=(0,l.path)(yf(),t),o=i!==(0,l.pipe)((0,l.path)(df()),a===fr.IN?hf:bf)(t),s=vf(e,(0,l.path)(cf(),t));return o?Jy({entityUri:t.parentEntityUri||n,newEntityUri:Wy(r,i),relation:(0,l.path)(df(),t),isReversed:!1}):Hy({oldRelation:(0,l.path)(df(),s),newRelation:rf(t)})})),...i.map((e=>Ky({relationUri:e})))]},of=(e,t)=>(0,l.pipe)(Ti,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Us),Sa)(e,t),sf=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)}},lf=(e,t,r)=>{const n=cp(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)},uf="relation",cf=(0,l.always)([uf,"relationUri"]),pf=(0,l.always)([uf,"relationType"]),df=(0,l.always)([uf,"object"]),yf=(0,l.always)([uf,"direction"]),ff=(0,l.always)([uf,"object","attributes"]),Tf=(0,l.always)(["entity","entityUri"]),Ef=(0,l.always)([uf,"startDate"]),mf=(0,l.always)([uf,"endDate"]),hf=(0,l.path)(["startObject","objectURI"]),bf=(0,l.path)(["endObject","objectURI"]),Of=(0,l.path)(["startObject","objectTypeURI"]),gf=(0,l.path)(["endObject","objectTypeURI"]),vf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(cf()),(0,l.equals)(t))(r))return r;if(r.connections){const e=vf(r.connections,t);if(e)return e}}},_f=(0,l.pipe)(vf,(0,l.path)(df())),Nf=(0,l.allPass)([(0,l.pipe)((0,l.path)(Tf()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(pf()),(0,l.complement)(E))]),Af=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ke()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=wf({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=Pf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?sf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},Pf=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:Pt.IN}:{type:t[0],direction:Pt.OUT}:null},Rf=e=>e.uri||e,wf=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Pi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Pt.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"],si(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],si(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Rf,Ti(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pt.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Pt.OUT)),(0,l.map)(u))},t)||{}};function Sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){If(e,t,r[t])}))}return e}function If(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Sf({},t,{[r]:{parents:n,children:i}})},Cf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Sf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},jf=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=Ry(t,i),o=Uf({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>jf(n.uri,t,[e],r)),o)},Lf=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)(cf(),n),a=t?Cf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(Tf(),n),s=Be(o)?[o]:[],u=Uf({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>jf(t,r,[i],e)),u)}),n)},Df=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Lf(r,e,t,jf(e,t))},kf=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return Df(t,r,n);if(Je(e)){const t=vf(n,e);return t&&Lf([t],null,r)}return r[e]?jf(e,r):void 0},xf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>xf(e,t))))},Ff=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Ff(e,t))))},Mf=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=He(t),u=Df(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=vf(i,c),!s)return null;o.push({type:rr.relationConnection,value:s,valueType:Ti(a,(0,l.path)(pf(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:rr.tempEntity,value:e,valueType:si(a,e.type)});continue}const p=n[u],d=Ts(p,c),y=n[c];if(!d||!y)return null;o.push({type:rr.attributeValue,value:d,valueType:Wn(a,it(d.uri,p.type))}),o.push({type:rr.tempEntity,value:y,valueType:si(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Ff(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?_f(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?Ti(a,d.type):si(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Yn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,g;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===(g=O[E.name])||void 0===g?void 0:g.find(t),s=i||r;if(!s)return null;i&&o.push({type:rr.tempEntity,value:T,valueType:si(a,T.type)}),o.push({type:rr.attributeValue,value:s,valueType:E}),m=s.value;const l=rs(s);T=l&&Be(l)?n[l]:null}}return o},Vf=e=>e.every((e=>{let{type:t}=e;return[rr.attributeValue,rr.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===rr.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,$f=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?$f(t.value):[]];return e.concat(r)}),[])),Gf=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Wf=e=>{const t=[...$f((null==e?void 0:e.attributes)||[]),...$f((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},Yf=(e,t)=>[e,...t.map((t=>Gf(e,t)))],Bf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},qf=(e,t)=>{switch(e){case nr.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case nr.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case nr.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case nr.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},Kf=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),Hf=(0,l.curry)(((e,t)=>{const r=mo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Hf(e,r.extendsTypeURI)):n})),Jf=(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))),Qf=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Hf(e),Jf(t))(t);function Xf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zf=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}},Zf=e=>!e.deactivated,eT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},tT=e=>eT(e)+e.message,rT=(0,l.unless)(l.isNil,(0,l.prop)("message")),nT=(0,l.unless)(l.isNil,(0,l.prop)("type")),iT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),aT=(0,l.curry)(((e,t)=>t.parentUri===e)),oT=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Ze(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),sT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),lT=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),uT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([mT,Zf,iT(e),oT(t),(0,l.complement)(lT(e,t.uri))]))(r)},cT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([mT,Zf,aT(e),sT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",zt.missed))]))(r);return n&&n.message||""},pT=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===zt.missed))},dT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Zf,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(cf(),e))]))(t)},yT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Zf,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},fT=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([Zf,iT(t)]))(r)},TT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([Zf,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},ET=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?Mf(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 rr.attributeValue:{const e=a;if(jn(a))return cp(o,e.dataLabelPattern);if(Ln(a)){const t=o,i=rs(t),a=yn(e),s=si(n,a);return Be(i)?cp(r[i],s.dataLabelPattern):t.label}return""}case rr.tempEntity:return cp(o,a.dataLabelPattern);case rr.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=si(n,null==e?void 0:e.entityType);return`${dp(i&&Be(i)?cp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ei(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){Xf(e,t,r[t])}))}return e}({},e,{label:dp(t)})}))},mT=e=>!e.severity||e.severity===er.ERROR,hT=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case vt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(hT(n))}));case vt.TYPE_REFERENCE:return!!Jo(t);case vt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),bT=(e,t)=>e.every((0,l.complement)(hT(t))),OT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=go(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ss(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!qo(e.parent))))).forEach((e=>{bT(e.attrValues,n)&&r.push(zf({type:zt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:wt().text("Attribute is required"),source:Zt.local}))})),r}),[])},gT=(0,l.curry)(((e,t,r)=>ss(e,t,r,!1))),vT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),si(e),(0,l.prop)("attributes"),(0,l.reject)(Un),(0,l.filter)(Ln),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(gT(e,t)));return(0,l.pipe)(r,(0,l.reject)(rs),(0,l.map)((e=>{let{uri:r}=e;return zf({type:zt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:wt().text("Entity is required"),source:Zt.local})})))(t)},_T=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(rs,Be)).flatMap((n=>{const i=rs(n),a=t[i],o=Wn(e,it(n.uri,r.type));return NT(e,t,o,a)})),NT=(e,t,r,n)=>{const i=Tn(r),a=i.map((t=>Wn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",vt.TYPE_REFERENCE))).flatMap(mn).concat(i);return AT(e,t,n,(e=>a.some(Ze(e.uri))))},AT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=OT(e,r,n),a=vT(e,r),o=_T(e,t,r);return[...i,...a,...o]},PT=(e,t)=>{const r=(0,l.path)(df(),t)||{};return OT(e,r)},RT=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(Tf()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=PT(e,r),a=(e=>(0,l.path)(Tf(),e)?[]:[zf({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(pf(),e),parentUri:(0,l.path)(cf(),e),message:wt().text("Entity is required"),source:Zt.local})])(r),o=((e,t,r)=>r?AT(e,t,r):[])(e,t,n);return[...i,...a,...o]},wT=e=>(0,l.path)(["entity","uri"],e)?[]:[zf({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:wt().text("Entity is required"),source:Zt.local})],ST=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=OT(e,r),i=wT(t);return[...n,...i]};function IT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UT=(e,t)=>{var r,n;const i=si(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||qa(e)},CT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),jT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(CT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},LT=(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)(ns,Be,l.not)]),(e=>{const t=(0,l.pipe)(ns,tt)(e);return jT((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(rs,Be),(t=>{const r=rs(t),n=e[r],i=n&&kT(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){IT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),DT=(e,t,r)=>ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ve((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)(LT(r,e.type)),(0,l.map)(jT(ut))))})(e))),kT=(e,t)=>(0,l.evolve)({attributes:ws({valueTransformer:(0,l.pipe)(os,LT(t),CT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function xT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 MT=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),VT=e=>(0,l.pipe)((0,l.evolve)({objectUri:MT,objectParentUri:MT}),(e=>{return xT({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?zt.missed:zt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&lt(e.objectUri),uri:e.objectUri,source:Zt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),$T=(e,t)=>(0,l.map)((0,l.pipe)(VT,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=ET(t,s),p=null!=c&&c.length?c.slice(0,-1):ET(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Wn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===rr.attributeValue&&(a=e.valueType)}return a})(o,c,e);return xT({},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&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(Ln(i)&&hn(i).includes(o)){const i=rs(n.value),o=i&&Be(i)?t[i]:null;return o?xT({},e,{parentUri:o.uri,path:a.concat({type:rr.tempEntity,value:o,valueType:si(r,o.type),label:""})}):e}}return e}})(t)))(e),GT=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 WT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var YT;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(YT||(YT={}));const BT={},qT={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"]}},KT=(0,l.curry)(((e,t)=>{const r=(e=>{if(!BT[e]){const t=qT[e]||qT.random0;BT[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){WT(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return BT[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]})),HT=e=>KT(YT.Charts,e);var JT=r(51404),QT=r.n(JT);const XT=Array.from({length:100},((e,t)=>t/100)),zT=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)},ZT={},eE=new(QT())({hash:zT,saturation:XT.slice(15,71),lightness:XT.slice(50,90)}),tE=(0,l.curry)(((e,t)=>{const[r,n,i]=e,[a,o,s]=t;return(Math.abs(r-a)<=27||(r+27>=360||a+27>=360)&&Math.abs(r-a-360)<=27)&&Math.abs(n-o)<=.3&&Math.abs(i-s)<=.2})),rE=(0,l.curry)(((e,t,r)=>{t in ZT||(ZT[t]={});const n=ZT[t];r in n||(n[r]=((e,t,r)=>{const n=Object.values(t);let i;for(let t=0,a=r;t<35&&(i=e.hsl(a),n.some(tE(i)));t++,a=String(zT(a)));return i})(e,n,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),nE=rE(eE,"crosswalks"),iE=rE(eE,"sources"),aE=rE(eE,"contributors");function oE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sE(e,t,r[t])}))}return e}function sE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lE=(0,l.has)("items"),uE=e=>0===e,cE=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)},pE=e=>e.reduce(((e,t)=>e+t.width),0),dE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),yE=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),fE=e=>e.reduce(((e,t)=>e+t.height),0),TE=e=>(0,l.is)(String,e)&&e.includes("%"),EE=e=>Boolean(e.spacer),mE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),hE=e=>e.items.reduce(((e,t)=>e.concat(lE(t)?hE(t):t)),[]),bE=e=>({id:e.layout}),OE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bE;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=TE(r.width)?mE(i,r.width):u}return cE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return cE(n,t,r)},o=(e,t)=>lE(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,lE(s)?n(s.layout):e(s.view)),d=uE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(lE(s))return o.concat(p(oE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(oE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:pE(o),height:dE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=lE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=uE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(lE(i))return r.concat(p(oE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(oE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?cE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?cE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:yE(i),height:fE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=uE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return oE({},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=oE({},e,{width:a}),s=oE({},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(oE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return oE({},e,{height:fE(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(oE({},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 oE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=oE({},t,{items:(0,l.reject)(EE,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 hE(f)},gE=(e,t)=>e.filter((e=>t.some((t=>t.id===e.id))));function vE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_E(e,t,r[t])}))}return e}function _E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NE={BarChart:Er.BAR,BarChartGrouped:Er.BAR,BarChartHorizontal:Er.BAR,LineChart:Er.LINE,Map:Er.MAP,Pie:Er.PIE},AE=(e,t)=>ot(e)?rt(e,t):e,PE=e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return vE({},e,{value:[Et,mt,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:bt(t),fieldName:r,values:n?re(n):void 0}})),RE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=NE[r];return vE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},wE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return vE({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"]))},SE=(e,t)=>{const r=PE(e);return t?(r||[]).concat((n=t,{filter:ct.EQUALS,fieldName:"type",values:[n]})):r;var n},IE=["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"],UE={"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:AE(n,r),filters:PE(a),chartType:Er.BAR,component:mr.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:AE(n,r),filters:PE(a),chartType:Er.BUBBLE,component:mr.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:mr.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=re(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return vE({id:t,count:o,canRead:u,orderType:s,attributeUri:AE(r,p),filters:PE(a),component:mr.DashboardFacet,title:i,showOthers:!0},RE(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:AE(n,r),filters:PE(a),chartType:Er.MAP,component:mr.DashboardFacet,title:i,geoUrl:IE[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 vE({id:t,count:o,canRead:l,attributeUri:AE(n,r),filters:PE(a),component:mr.DashboardFacet,title:i,geoUrl:s,chartType:Er.MAP,projection:"geoMercator"},RE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.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:wE(i),component:mr.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:SE(n,a),component:mr.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:ct.GTE,fieldName:"matches",values:["1"]}],component:mr.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:mr.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:Er.CLOUD,component:mr.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:Er.TREE,component:mr.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.NotificationInboxFacet,title:n||wt().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.ActivitiesViewFacet,title:n||wt().text("Activity log")}}},CE=e=>({id:e,height:10}),jE=(0,l.pipe)((0,l.map)((e=>{const t=UE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),LE=e=>{if("0.1"===e.version){const t=jE(e.views),r=OE(CE,e.layout,{columns:4});return{id:e.id,margin:0,layout:gE(r,t),views:t}}return e},DE=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"),re)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>DE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function kE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xE(e,t,r[t])}))}return e}function xE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FE=kE({},hr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),ME=e=>e,VE={[FE.Attributes]:ME,[FE.HierarchyTree]:ME,[FE.HierarchyPaths]:ME,[FE.RelationsTable]:ME,[FE.Relations]:e=>kE({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[FE.SingleAttributeView]:ME,[FE.CustomView]:ME,[FE.TableAttributeView]:ME,[FE.MapView]:ME,[FE.OldTreeView]:e=>kE({},e,{class:hr.HierarchyTree}),[FE.OldMapView]:e=>kE({},e,{class:hr.MapView}),[FE.ImageAttributeView]:ME,[FE.PotentialMatchesView]:ME},$E=(0,l.pipe)((0,l.map)((e=>{const t=VE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),GE=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===hr.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),WE=e=>{if("0.1"===e.version){const t=$E(e.views),r=OE(GE(t),e.layout,{columns:4});return{id:e.id,layout:gE(r,t),views:t,profileBand:e.profileBand,workflow:e.workflow,maxWidth:e.maxWidth}}return e},YE=(e,t)=>e.class===t||e["react-class"]===t,BE=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(YE(t,hr.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 YE(t,hr.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)}},qE=(e,t)=>e.filter((e=>t.some((t=>YE(e,t))))).map((e=>{let{id:t}=e;return t})),KE=(e,t)=>{let{extensions:r}=e;return r.find((e=>e.id===t))};function HE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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}const QE=(e,t)=>DE(t).map((t=>(0,l.pipe)((0,l.map)((e=>KE(e,t))),(0,l.reject)(l.isNil),l.head)(e))),XE=(e,t)=>{if("scroll"===t.layout.layout){const r=QE(e,t.layout),n=LE(HE({},t,{views:r,version:"0.1"}));return{class:"DashboardView",views:n.views,layout:n.layout}}return{class:"DashboardView",views:t.views,layout:t.layout}},zE=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"DQDashboardView",viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},ZE=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"RelationshipSearch",options:r.options,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp}},em=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"InteractionsView",sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},tm=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"RelationshipsView",canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},rm=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"SourcesView",canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},nm=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"PotentialMatchesView",availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},im=(e,t)=>{const r=QE(e,t.layout)[0];return{class:"SearchView",scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead}},am=()=>({class:"GraphView"}),om=()=>({class:"ProfileActivityLogView"}),sm=e=>t=>!!(0,l.intersection)(e,t).length,lm=(0,l.cond)([[sm(["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"]),()=>XE],[sm(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>zE],[sm(["com.reltio.plugins.graph.GraphView"]),()=>am],[sm(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>ZE],[sm(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>em],[sm(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>tm],[sm(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>rm],[sm(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>nm],[sm(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>im],[sm(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>om],[l.T,()=>(0,l.always)(void 0)]]),um=(e,t)=>{const r=(e=>e.perspective?e.perspective:"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]?e.id:void 0)(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>KE(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=DE(n.layout),a=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return t.filter((e=>i.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return n["entity-type"]?((e,t)=>{if("scroll"===t.layout.layout){const r=QE(e,t.layout),n=WE(HE({},t,{views:r,version:"0.1"}));return{class:"ProfileView",views:n.views,layout:n.layout}}return{class:"ProfileView",views:t.views,layout:t.layout}})(t,n):lm(a)(t,n)},cm=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))},pm=e=>(0,l.pipe)((0,l.chain)(cm),(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.map)((e=>({label:e.label,icon:e.icon,screen:um(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:um(t,e)}}));function dm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ym=e=>{let{extensions:t}=e;return t.filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},fm=e=>({id:e,height:10}),Tm=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)(ym),(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=jE(((e,t)=>DE(t).map((t=>(0,l.pipe)((0,l.map)((e=>KE(e,t))),(0,l.pluck)("views"),l.flatten,l.head,(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){dm(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=OE(fm,t.layout,{columns:4});return{views:r,layout:gE(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},Em=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>KE(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=>KE(e,"com.reltio.plugins.entity.RangeColors"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("colors"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>KE(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>KE(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>KE(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>KE(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>KE(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:t}},general:{colors:r},image:{attributeFieldsOrder:n},lookups:{autocomplete:i},validate:{levels:a,validateReadMode:o}}},mm=e=>({layout:pm(e),pivoting:Tm(e),properties:Em(e)});var hm=r(58697),bm=r.n(hm);function Om(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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 vm=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}_${bm()()}`;return n[e.id].push(t),i=!0,Om({},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]++,Om({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},_m=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(_m(e))}))}))),t},Nm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(wm,t),(0,l.propOr)([],"crosswalks",e))),e),Am=(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(Am(e))}))})),r},Pm=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=Pm(e);r>t&&(t=r)}))})),t+1):t},Rm=(e,t)=>{if(Be(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},wm=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Sm=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Im=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},Um=(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)},Cm=(0,l.eqBy)(wm),jm=(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)(Qo,(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)))),Lm=(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=wt().number(t));return t})),Dm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?wt().number(e,"0,0.0a").toUpperCase():wt().number(e,"0,0"):""},km=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),xm=(e,t)=>t&&e!==t?`${t} (${e})`:e,Fm=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),Mm=(e,t,r)=>{const n=Fm(e,t,r);return xm(r,n)},Vm=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),$m=(0,l.complement)(Vm),Gm=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Wm=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)},Ym=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter($m(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Bm=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?B(i):"L",u=a?H(a):"L LTS";switch(n.type){case vt.TYPE_NUMBER:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_COUNT:return t&&Lm(o,t);case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?wt().text("yes"):wt().text("no");case vt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(Hl(t)?Jl(t):wt().date(t,s));case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_LOCAL_DATE:return t&&(Hl(t)?Jl(t):wt().date(t,s));case vt.TYPE_TIMESTAMP:return t&&(Hl(t)?Jl(t):wt().date(isNaN(t)?t:Number(t),u));case vt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case vt.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)?xm((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),qm={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)",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"}},Km=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()}},Hm=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})))),Jm=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.slice().reverse().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.slice().reverse().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),Km,Hm);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}},Qm="__metadata",Xm=(e=>{const t=[Qm,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),zm=(0,l.set)(Xm),Zm=(0,l.view)(Xm),eh=zm(_t.NEW),th=zm(_t.REMOVED),rh=zm(_t.EDITED),nh=(0,l.pipe)(Zm,(0,l.equals)(_t.REMOVED)),ih=(0,l.pipe)(Zm,(0,l.equals)(_t.NEW)),ah=(0,l.pipe)(Zm,(0,l.equals)(_t.EDITED)),oh=(0,l.pipe)(Zm,(0,l.complement)(l.isNil)),sh=(0,l.omit)([Qm]),lh=(e,t)=>e===Qm?void 0:t;function uh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ch=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=ch(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},ph=(e,t)=>ch((0,l.propEq)("nodeId",t),e),dh=(e,t)=>ch((0,l.pathEq)(["entity","uri"],t),e),yh=(e,t)=>{const r=ph(e,t);return r.length>1?r[r.length-2]:null},fh=(e,t)=>{const r=ph(e,t);return r.length>0?r[r.length-1]:null},Th=(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=>Th(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Eh=()=>{},mh=(e,t)=>{let{parent:r,nodeProcessing:n=Eh}=t;n(e,r),e.children&&e.children.forEach((t=>mh(t,{parent:e,nodeProcessing:n})))},hh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case lr.addingParent:return{entityUri:n?r.entity.uri:t.relatedEntity.uri,relation:r.relation,parentEntityUri:n?t.relatedEntity.uri:r.entity.uri};case lr.addingChild:return{entityUri:n?t.relatedEntity.uri:r.entity.uri,relation:r.relation,parentEntityUri:n?r.entity.uri:t.relatedEntity.uri};case lr.editing:{const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=t.entity.uri,a=r.entity.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){uh(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},bh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;mh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===lr.addingChild||r.editingMode===lr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=hh({node:r,connection:n,isReversed:i}),s=qy({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===lr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=hh({node:r,isReversed:i,connection:n}),l=s?Jy({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Hy({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Oh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},gh={asc:"asc",desc:"desc"},vh=Oh.entityLabel,_h=gh.asc,Nh=(0,l.always)(0),Ah=e=>{let{sortField:t=vh,sortOrder:r=_h,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Oh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return qg.strings.sort(t,a,o)})(n,r);case Oh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return qg.strings.sort(e,i,a)})(r);default:return Nh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Ph=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(gh)),l.identity,(0,l.always)(_h))),Rh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Oh)),l.identity,(0,l.always)(vh)));var wh=r(91104);let Sh;const Ih=(e,t)=>(Sh||(Sh=wh.createClient({key:t})),new Promise((t=>{Sh.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)}))}))),Uh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},Ch=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(qo).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Uh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(Ch(e.value,t,r))),n})),jh=e=>e&&e.length>0,Lh=(e,t)=>[].concat(e&&e.attributes?Ch(e.attributes,t):[]).filter(l.identity),Dh=(e,t,r,n,i)=>{if(e&&e.type){const t=(si(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Lh(e,t.latitude),n=Lh(e,t.longitude),jh(r)&&jh(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(jh(t)&&t[0].value&&jh(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?Ih(n.label,i).catch((()=>null)):Promise.resolve(null)},kh=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=>"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||si(e,t.type).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})))))))));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return Dh(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Ih(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)))},xh=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=si(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Wn(e,r.latitude,t.type)&&Wn(e,r.longitude,t.type)){const e=Lh(t,r.latitude),n=Lh(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))},Fh=(e,t,r)=>Promise.all([xh(e,t),kh(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 Mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vh(e,t,r[t])}))}return e}function Vh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $h=(e,t)=>t.values.map(oo(e,t.entityTypeUri)),Gh=(e,t,r)=>Ms(t.fieldName,r)||Wn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Wh=(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?xm(e,t):e}),r)},Yh=(0,l.path)(["attrType","label"]),Bh=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Mh({},e,{[t]:!0})),{});e[r]=e[r]?Mh({},e[r],n):n}return e}),{}),qh=(0,l.pipe)((0,l.prop)("values"),E),Kh=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Vt.type.name)),Hh=e=>e.type===Xh.NUMERIC_RANGE_FACET,Jh=e=>e.type===Xh.DATE_RANGE_FACET,Qh=(0,l.either)(Hh,Jh),Xh={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},zh=e=>{switch(null==e?void 0:e.name){case Vt.type.name:return Xh.ENTITY_TYPE_FACET;case Vt.createdBy.name:case Vt.updatedBy.name:case Vt.sourceSystems.name:case Vt.tags.name:case Vt.roles.name:case Vt.matchRules.name:case Vt.MLRecommendedMatch.name:return Xh.WITH_DROPDOWN_CHECKBOXES_FACET;case Vt.createdTime.name:case Vt.updatedTime.name:case Vt.startDate.name:case Vt.endDate.name:return Xh.DATE_RANGE_FACET;case Vt.matches.name:case Vt.matchScore.name:return Xh.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return Xh.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return Xh.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return Xh.DATE_RANGE_FACET;default:return Xh.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Zh=(0,l.pipe)(Gh,zh),eb=(0,l.pipe)((0,l.path)(["attrType","type"]),Zn),tb=(0,l.cond)([[Hh,(0,l.always)(ct.IN_RANGE)],[Jh,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([eb,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),rb=(0,l.cond)([[Jh,(0,l.prop)("values")],[Hh,(0,l.prop)("values")],[eb,e=>1===e.values.length?e.values.map(se):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function nb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ib=(0,l.pipe)((0,l.path)(["attrType","type"]),Kn),ab=(0,l.pipe)((0,l.path)(["attrType","type"]),Qn),ob=(0,l.pipe)((0,l.prop)("attrType"),$s),sb=(0,l.pipe)((0,l.prop)("attrType"),Vs),lb=e=>t=>t.values.map((t=>si(e,t).label)).join(" , "),ub=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),cb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(wt().number),ub)),(0,l.join)(","))(e.values);return`${Yh(e)}: ${t}`},pb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),ub)),(0,l.join)(","))(e.values);return`${Yh(e)}: ${t}`},db=e=>t=>`${Yh(t)}: ${$h(e,t).join(", ")}`,yb=e=>t=>{const r=Wh(e,t);return`${Yh(t)}: ${r.join(", ")}`},fb=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[sb,lb(e)],[ab,cb],[ib,pb],[ob,db(e)],[l.T,yb(t)]]),r))),Tb=(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){nb(e,t,r[t])}))}return e}({},t,{attrType:Gh(e,t,n)}))),fb(e,r))(t),Eb=new RegExp(`^${wt().text("Search")}`),mb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Tb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Eb,"",u)]},hb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Ot),bb=e=>(e=>hb.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]=Ql(t);return e.replace(r,i).replace(n,a)}),e))(e),Ob=(0,l.curry)(((e,t)=>`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`)),gb={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},vb=e=>[gb.geoPolygon,gb.onMapMove].includes(e),_b=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Nb=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Ab=(e,t)=>vb(e)?t.map(_b):[Nb(t)],Pb=e=>vb(e)?wt().text("Geo Polygon"):wt().text("Geo Location"),Rb=e=>{switch(e){case gb.geoLocation:return"geoLocation";case gb.geoPolygon:case gb.onMapMove:return"geoPolygon"}},wb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Sb=e=>wt().text(e),Ib=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:wt().text("missing value"),[ct.HAS_ALL]:wt().text("has all"),[ct.IN_RANGE]:wt().text("in range"),[ct.FULL_TEXT]:wt().text("full text"),[ct.EXISTS]:wt().text("exists"),[ct.COUNT_EQUALS]:`${wt().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${wt().text("count")} ≠`,[ct.COUNT_LT]:`${wt().text("count")} <`,[ct.COUNT_LTE]:`${wt().text("count")} <=`,[ct.COUNT_GT]:`${wt().text("count")} >`,[ct.COUNT_RANGE]:wt().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:wt().text("in file"),[ct.NOT_IN_FILE]:wt().text("not in file"),[ct.CONTAINS]:"~",[pt]:"=",[dt]:"≠",[yt]:"=",[ft]:"≠"}[e]||wt().text(e.toLowerCase())},Ub=e=>({type:wb.operator,text:e}),Cb=e=>({type:wb.operator,text:Sb(e)}),jb=e=>({type:wb.attributeLabel,text:e}),Lb=e=>({type:wb.specialAttributeLabel,text:e}),Db=e=>({type:wb.attributeFilter,text:Ib(e)}),kb=e=>({type:wb.attributeValue,text:e}),xb=e=>({type:wb.entityTypeLabel,text:e}),Fb=()=>({type:wb.space,text:" "}),Mb=()=>({type:wb.bracket,text:"("}),Vb=()=>({type:wb.bracket,text:")"}),$b=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),Gb=(0,l.curry)(((e,t)=>t.map($b(e)))),Wb=(0,l.curry)(((e,t,r)=>[e,...r,t])),Yb=Wb(Mb(),Vb()),Bb=Wb(Fb(),Fb()),qb=(0,l.curry)(((e,t)=>[e,...t])),Kb=e=>qb(xb(e)),Hb=e=>qb(xb(`${e}: `)),Jb=e=>["and","and not"].includes(e),Qb=e=>["or","or not"].includes(e),Xb=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),Qb)),zb=(Zb=["and"],e=>e.slice(0,-1).every((e=>Zb.includes(e.operator))));var Zb;const eO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=Xb(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Jb(s),a=Qb(s);!r&&t&&n&&(i.push(Mb()),r=!0),i.push(o),r&&a&&(i.push(Vb()),r=!1);const l=e?Cb(s):Ub(s);i.push(...Bb([l]))}else i.push(o),r&&(i.push(Vb()),r=!1)}return i}},tO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),rO=(0,l.pipe)(eO({localizable:!1}),tO),nO=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},iO=e=>{let{data:t,values:r,filter:n}=e;return t&&du({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},aO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(iO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),oO=(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)&&Mn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Fn((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})))),Wm),sO=(e,t)=>(0,l.pipe)(oO,Ym(t))(e),lO=(0,l.pathEq)(["data","fieldName"],Vt.type.name),uO=(0,l.path)(["data","entityTypeUri"]),cO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),pO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Bo(e)),attributes:(0,l.filter)((0,l.pipe)(uO,(0,l.anyPass)([l.isNil,Bo(e),r=>{const n=(t.entityTypes||[]).filter(Bo(e));return(n.length>1?di(e,n):null)===r&&!!si(e,r)}])))})(t))))),dO=e=>(0,l.pipe)((0,l.prop)("filter"),Nl,(0,l.equals)(e)),yO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Ms(n.fieldName)||n.attrType,s=ql(o,i),u=Bm({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Mn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?xm(a.lookupCode,a.value):Mm(r,Fn(o),a)],[()=>$s(s),()=>oo(e,n.entityTypeUri,a)],[()=>Gs(s),()=>So(e,a)],[()=>Hs(s),()=>Uo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Qn(c)||Zn(c)),Gl),kb)()})),fO=(e,t,r,n)=>{const i=yO(e,t,r,n.data,n.filter);return(0,l.cond)([[dO(0),(0,l.always)([])],[(0,l.both)(dO(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[Fb(),i(r),{type:wb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Fb(),...(0,l.pipe)(l.flatten,(0,l.map)(i),Gb({type:wb.punctuationMark,text:", "}))(t)]}]])(n)},TO=(e,t)=>{const r=!!Ms(e.data.fieldName);return(0,l.pipe)(nO,r?Lb:jb)(e,t)},EO=(e,t,r,n,i)=>[TO(n,i),Fb(),Db(n.filter),...fO(e,t,r,n)],mO=(0,l.addIndex)(l.map),hO=(0,l.propEq)("length",1),bO=(0,l.propSatisfies)((0,l.lt)(1),"length"),OO=(0,l.complement)(l.isEmpty),gO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(iO),(0,l.map)((n=>({operand:EO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,eO()))(n)},vO=(0,l.pipe)(gO,l.flatten),_O=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Dp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=gO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(Kb),(0,l.pipe)(s(Hb),(0,l.unless)((()=>hO(u)||i),Yb)))(u)},NO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(aO),mO(((n,i,a)=>({operand:_O(e,t,r,n,hO(a)),operator:n.operator}))),eO(),l.flatten)(n),AO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),eO(),l.flatten),PO=e=>{let{searchType:t,values:[r]}=e;return Ab(t,r).join(", ")},RO=(e,t,r,n,i,a)=>{const o=(e=>e?[Lb(e.isRawFilter?wt().text("Raw filter"):wt().text("Search")),...Bb([Db(ct.EQUALS)]),kb(`"${e.value}"`)]:[])(i),s=(e=>e?[Lb(Pb(e.searchType)),Fb(),kb(PO(e))]:[])(a),u=(0,l.pipe)(NO,(0,l.when)((e=>bO(e)&&(OO(o)||OO(s))),Yb))(e,t,r,n);return AO([o,s,u])},wO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),SO=(0,l.pipe)(RO,wO),IO=(0,l.has)("attributes"),UO=Array.isArray,CO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),jO=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=LO(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)(CO(a))),Yb),(0,l.concat)(Bb([Ub(o)]))))(s)},LO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return IO(n)?jO(e,t,r,n,i):UO(n)?n.reduce(((n,a)=>n.concat(LO(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(Bb([Ub(n.operator)])))(EO(e,t,r,n,i))},DO=(e,t,r,n,i)=>(0,l.pipe)(LO,l.flatten)(e,t,r,n,i);function kO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xO(e,t,r[t])}))}return e}function xO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FO=(0,l.complement)(lO),MO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(lO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(uO),(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}},VO=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=MO(t);return(r||n)&&zb(t)},$O=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(VO)),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(lO).some((0,l.propEq)("filter",ct.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}=MO(r);if(VO(e))t.push(kO({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(FO)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(lO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(uO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(FO),entityTypes:n,operator:i?a:e.operator,id:bm()()}}));t.push(...n)}var a;return t})(t))),[]))),GO={[ct.EQUALS]:ct.ON,[ct.IN_RANGE]:ct.WITHIN,[ct.GTE]:ct.AFTER,[ct.GT]:ct.AFTER,[ct.LTE]:ct.BEFORE,[ct.LT]:ct.BEFORE},WO=(0,l.curry)((e=>GO[e]||e)),YO=(0,l.curry)(((e,t)=>{switch(e){case ct.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ct.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),BO=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Kn),qO=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>kO({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return BO(e)?(0,l.evolve)({filter:WO,values:YO(t)},e):e}))})))})),KO=(0,l.curryN)(3,((e,t,r,n)=>(0,l.pipe)((0,l.defaultTo)([]),$O,pO(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")))})),qO,(0,l.reject)(cO))(r)));function HO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JO(e,t,r[t])}))}return e}function JO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QO=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||tb(e),id:bm()(),values:rb(e)}),XO=(0,l.curry)(((e,t,r)=>{const{uri:n,fieldName:i,entityTypeUri:a}=r,o=Ms(i,t)||Wn(e,n);if(!o)return null;if(Sn(o))return HO({},r,{attrType:o,title:o.label});{const t=o.label||o.name,n=Dp(e,{type:a}),s=(Gn(e,rt(i,a),a)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return HO({},r,{attrType:o,title:t,pathToTitle:Array.isArray(s)?[n,...(0,l.chain)((0,l.prop)("label"),s),t]:[n,t]})}})),zO=(0,l.curry)(((e,t,r)=>KO(XO,e,r,t)));function ZO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eg(e,t,r[t])}))}return e}function eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tg=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},rg=e=>"rdmLookups.not.resolved"===e?Vt.notResolved.name:e,ng=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===ht?ct.IN_RANGE:bt(a),u=rg(n),c=Ms(u)||Wn(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=>ZO({},e,{filename:km(e)}))))],[()=>Zn(null==c?void 0:c.type),(0,l.map)(se)],[e=>Pl(s)&&!Array.isArray(e[0])&&!Kn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:bm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===ht?"and not":"and",filter:s,values:p}})),ig=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(ng(e,di(e,i)));return[{id:bm()(),operator:"or",attributes:a,entityTypes:i}]})),ag=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),og=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([ag("from"),ag("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,()=>[]]]),sg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return ZO({},r,{values:og(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ks(e.fieldName,n):e.fieldName})},lg=(e,t)=>{if((0,l.has)("children")(e)){const r=sg(e,t);return e.children.reduce(((e,n)=>(e.push(lg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return sg(e,t)},ug=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(sg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(ZO({fieldName:e.fieldName},sg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(lg,l.flatten)],[l.T,sg]]),cg=(0,l.pipe)((0,l.map)(ug),l.flatten),pg=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},dg=(e,t,r)=>{const{facets:n=[],advanced:i={},model:a}=r,[o]=ig(e,i),[s]=((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:cg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>ZO({},t,{type:Zh(e,t)}))).map((e=>ZO({},e,{values:Qh(e)?pg(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 QO(r,t)})),operator:"or",id:bm()(),entityTypes:i}]})(e,n),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[rg(t)]:e[t]}))),l.mergeAll)(e)}(a),c=[ZO({},s,{entityTypes:null!=u&&u.type?(0,l.uniq)([...s.entityTypes,...o.entityTypes]):[],attributes:[...s.attributes,...o.attributes].filter((e=>{let{data:{fieldName:t}}=e;return u[t]}))})];return zO(e,t,c)},yg=(e,t,r)=>{try{return"2.0"==r.version?((e,t,r)=>{const{advanced:n=[],facets:i={}}=r,a=n.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?n:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(qh),(0,l.partition)(Kh))(t),i=n.map((t=>HO({},t,{type:Zh(e,t)}))).map((e=>QO(e))),a=r.values||[];return[{attributes:i,operator:"or",id:bm()(),entityTypes:a}]})(e,i);return zO(e,t,a)})(e,t,r):dg(e,t,r)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},fg=e=>"2.0"===e.version?e.keyword:tg(e),Tg=e=>(0,l.pathEq)(["object","uri"],e),Eg=(e,t)=>(0,l.pipe)((0,l.find)(Tg(e)),(0,l.prop)("object"))(t),mg=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"),Tg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Eg(r.match,t)||n[r.match];return{label:dp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ao(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)},hg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),bg=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Og=(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:dp((0,l.prop)("label",a)),matchRules:i.map((function(t){return ao(e,a.type,t)||{label:t,uri:t}}))}})))(t),gg=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)},vg=(0,l.path)(["object","uri"]),_g=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},Ng=e=>e.getValue(),Ag=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Ag(n[e],t),!r);e++);return r},Pg=(e,t)=>{const r=[],n=(0,l.pipe)(Ng,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Pg,[t]),a);return r.push.apply(r,o),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){wg(e,t,r[t])}))}return e}function wg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sg=(e,t)=>!!e[t],Ig=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Ug=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||[]])},Cg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Rg({},t,{[r.uri]:Rg({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Ug(null==o?void 0:o.parents,n),children:Ug(null==o?void 0:o.children,i),values:Ug(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},jg=e=>e.children?e.children.flatMap(jg):e,Lg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=si(r,t)||Ti(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return xo(r,n,i).flatMap(jg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Wn(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=Cg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Cg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},Dg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Be(e.uri)&&Xe(e.type)&&Xe(t)&&!t.startsWith(e.type))(n,t))return e;const i=ss(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(qo),(0,l.map)(Ig))(i);return Cg({structure:e,attrType:e[t].attrType,values:a})}),t)},kg=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 Sg(e,r)}));return r||n?t.filter(qo).reduce(((e,t)=>kg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return Sg(t,e.type)?Cg({structure:t,attrType:t[e.type].attrType,values:[Ig(e)]}):t}},xg=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Rg({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},Fg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ss(i,n,r)||[];return a.length?Cg({structure:t,attrType:t[r].attrType,values:a.filter(qo).map(Ig)}):t},Mg=(e,t,r)=>{const n=He(e),i=He(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&xf(r,i).includes(n)},Vg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},$g=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?Df(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Mg(r,t,o)}))},Gg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>Gg(e,t,r)))))},Wg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Vg(n,e)}},Yg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=He(n),c=kf(u,o,i,a),p=Gg("children",t,l),d=Gg("parents",t,l),y=p.flatMap((e=>Gg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Mg(t,n,c)})).map((t=>Wg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Mg(n,t,c)||He(t)!==u&&Mg(t,n,c)})).map((t=>Wg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=Gg("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)&&Mg(n,t,c)}))})).map((t=>Wg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Mg(t,n,c)})).map((e=>Wg(r,n,e,s))),...T,...E,...f]},Bg={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},qg={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},47485:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
1
+ (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[264],{67075:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Us,PY2:()=>Ut,Ng6:()=>ir,YJ7:()=>Nt,Xt7:()=>tr,wfT:()=>Br,EMD:()=>jr,HAc:()=>rr,PEf:()=>kt,oA3:()=>Cr,$XE:()=>Er,eWf:()=>Lt,q7e:()=>nr,KVe:()=>qr,WVQ:()=>ii,oZZ:()=>rn,bNA:()=>nn,Rjq:()=>an,G39:()=>Ft,dZX:()=>mr,bQt:()=>sn,oS0:()=>vt,lL_:()=>Ot,Nsj:()=>Rt,psV:()=>_t,xPW:()=>Ct,pyR:()=>Mr,p8l:()=>Dr,Wkf:()=>er,zHr:()=>Zt,NIO:()=>zt,$26:()=>tb,Esk:()=>Pr,s9T:()=>pr,MEy:()=>xl,j5E:()=>ct,vAw:()=>Ur,NMQ:()=>Ir,mNm:()=>xr,rwv:()=>en,s_5:()=>Vr,RgZ:()=>kr,unl:()=>tn,Qy0:()=>on,pYu:()=>Rr,wIJ:()=>Ab,GFH:()=>or,S91:()=>Mt,p3$:()=>pn,wSh:()=>z,BDP:()=>vi,pGS:()=>Fr,ARY:()=>Or,XGc:()=>Yr,fO_:()=>Kt,wwy:()=>lr,_XL:()=>At,j2V:()=>Kr,dMV:()=>Gr,NBX:()=>Pg,OXy:()=>gr,BXd:()=>yr,CJB:()=>Qr,nqG:()=>un,C68:()=>xt,yxQ:()=>ln,Yj_:()=>ur,ZIY:()=>hr,Tl4:()=>Cb,lwr:()=>Dt,NkU:()=>Hr,Rtp:()=>Wr,YGx:()=>fr,uTS:()=>$r,IYE:()=>Lr,PiC:()=>Zr,tJI:()=>ar,cNQ:()=>Jr,SwE:()=>wr,ZHR:()=>zr,lD1:()=>Vt,lVm:()=>Tr,vnX:()=>Rh,$x5:()=>Ph,_R1:()=>Nh,wUm:()=>Ah,z7V:()=>cn,dC6:()=>dr,MBD:()=>sr,GmF:()=>Zi,cKm:()=>br,iP_:()=>jt,NVC:()=>cr,tPT:()=>vs,tZe:()=>np,kRE:()=>ey,psB:()=>ty,X0$:()=>gs,Wm5:()=>Bs,vyX:()=>Pu,wLZ:()=>_s,W4V:()=>oe,EtK:()=>as,Wtd:()=>Os,asT:()=>Vg,kGs:()=>ge,ewt:()=>uf,O_f:()=>rO,sOy:()=>Ze,Tde:()=>xn,LMI:()=>pu,skb:()=>RO,sPt:()=>ru,sH1:()=>nu,RPM:()=>eT,h27:()=>gu,Uqd:()=>Ru,xG:()=>MO,Z2f:()=>Ym,fgW:()=>oO,I69:()=>UO,ZxB:()=>jO,mdt:()=>Jf,Qbq:()=>wm,rny:()=>ki,UEY:()=>ba,Q0T:()=>ha,Lyr:()=>Ra,sBn:()=>ma,itK:()=>ya,H9$:()=>Ea,KPc:()=>Ta,zos:()=>fa,ELQ:()=>Pa,dZs:()=>ia,Cz4:()=>na,z_L:()=>Na,fGe:()=>ra,iuF:()=>pa,Wib:()=>da,Hn0:()=>Aa,XUh:()=>ca,Qp_:()=>la,_jk:()=>aa,sKE:()=>oa,WmG:()=>ua,QKx:()=>va,Oik:()=>ga,s0A:()=>sa,o9m:()=>Oa,MCd:()=>_a,tGK:()=>Tl,Vg3:()=>Wi,mkC:()=>Ii,xv5:()=>Bi,a14:()=>Ci,yv0:()=>Yi,Zm0:()=>Ui,Nxd:()=>Si,$mM:()=>Gi,ifj:()=>oi,NWi:()=>uh,xr3:()=>lh,wNf:()=>Al,iJH:()=>ch,d89:()=>Ri,Edd:()=>Pi,Z5t:()=>wi,uGe:()=>Ni,UoR:()=>_i,xvW:()=>sh,$qe:()=>oh,yPM:()=>ta,$cp:()=>Is,vKJ:()=>ws,AID:()=>Gy,B1H:()=>Ag,b7X:()=>Am,$uE:()=>ve,keo:()=>Pm,C_p:()=>xT,G27:()=>xE,JA0:()=>qd,b3T:()=>Oe,oC6:()=>he,_Zs:()=>be,epC:()=>Ne,YYG:()=>_e,w3l:()=>sg,QHB:()=>kE,Jso:()=>fg,RXH:()=>vE,Vr9:()=>BE,lMm:()=>bm,fmQ:()=>Xo,yRD:()=>QO,NcL:()=>WT,QK6:()=>pe,ymd:()=>Vc,JV_:()=>yy,XiW:()=>tf,Yrx:()=>Dd,GPx:()=>bs,gjI:()=>hs,vlo:()=>Pf,E_P:()=>Yf,aAL:()=>Pc,NBq:()=>zo,wp9:()=>Hf,DsR:()=>gc,MPc:()=>Ky,gWE:()=>Hy,DT_:()=>Jy,ipn:()=>Xy,ORg:()=>bi,_wz:()=>Qy,RYR:()=>sf,PP2:()=>Fd,wS7:()=>Xm,cBQ:()=>oc,pBq:()=>Py,DsO:()=>Z,X78:()=>Ty,xZs:()=>uy,YFy:()=>xd,Gmt:()=>ay,K$w:()=>iy,DSj:()=>wc,k9j:()=>lc,ww$:()=>Ns,WVU:()=>ny,hxF:()=>Ks,nwO:()=>Jg,Mzk:()=>tc,aFF:()=>Lm,HRH:()=>Vl,EZK:()=>Tp,Kxm:()=>pp,Z9i:()=>hT,CrF:()=>Qd,DNd:()=>Sa,vUy:()=>Bg,lJh:()=>Wl,zHo:()=>Yl,sEJ:()=>Sg,UO$:()=>jy,zeJ:()=>Wn,dLR:()=>us,JQy:()=>fs,XtP:()=>ss,Ug0:()=>di,A1W:()=>Rm,sw:()=>fp,nv3:()=>hh,JgD:()=>mh,nve:()=>Ig,SkP:()=>Ts,SAs:()=>Sy,PWK:()=>wo,IM5:()=>ls,Mfk:()=>Nm,mB6:()=>Km,p6d:()=>w,o0x:()=>I,ufS:()=>km,k7L:()=>xm,mrB:()=>S,ncP:()=>Ke,Zmi:()=>Ge,hm5:()=>Ye,ECL:()=>Bt,vPL:()=>hp,qmL:()=>Gf,hXd:()=>Fi,OCS:()=>Mi,p2l:()=>js,qF1:()=>$c,_X$:()=>Gc,yj2:()=>gb,bzh:()=>zf,k66:()=>ko,kiP:()=>Za,pSg:()=>ue,kz_:()=>Wd,H_U:()=>Fo,t9e:()=>ka,j2$:()=>ip,PFL:()=>Rn,aJ3:()=>qh,To9:()=>Fn,wpo:()=>Vp,ADq:()=>yT,UUb:()=>pT,tQX:()=>dT,xy8:()=>In,EUG:()=>Yn,AFK:()=>it,X3M:()=>Gn,WN0:()=>xo,kDl:()=>cs,uDV:()=>$f,IhQ:()=>ds,R$r:()=>Wf,w80:()=>Eo,Pfu:()=>La,Gtj:()=>sl,fyF:()=>ol,u5q:()=>He,O$n:()=>Fp,ptG:()=>Mp,f4_:()=>QT,uap:()=>JT,d7q:()=>Ld,liG:()=>Md,$oF:()=>jd,avf:()=>mf,DiQ:()=>Ef,cfX:()=>Tf,vD3:()=>bf,Qrb:()=>ff,EJQ:()=>hf,HWy:()=>yf,y6v:()=>df,GtP:()=>sE,_kX:()=>Ua,u1e:()=>Ca,sJj:()=>Um,CJp:()=>aE,uKF:()=>Im,wo0:()=>Zd,cwx:()=>Io,TTx:()=>sy,HaQ:()=>ly,E6I:()=>Jd,vTU:()=>Ad,Nsy:()=>Ip,KMQ:()=>jm,CSV:()=>ks,l1V:()=>ql,VQ1:()=>Ql,z7d:()=>wf,Xaq:()=>$o,Sj8:()=>Hg,PJj:()=>dl,PjQ:()=>gi,s7l:()=>Ju,GGR:()=>_f,j5q:()=>gf,DnY:()=>Bu,RY5:()=>Df,SvV:()=>vg,NIY:()=>Zu,HvW:()=>Qu,Fof:()=>xa,BTI:()=>Lp,uie:()=>gp,ChB:()=>Ep,q27:()=>Gp,fAQ:()=>by,XkT:()=>Yu,lrH:()=>Oy,nt9:()=>si,XH8:()=>xp,XH2:()=>yi,jFi:()=>kp,qhs:()=>To,wwR:()=>jp,Uk3:()=>at,ev7:()=>Rg,zsW:()=>Hu,RB9:()=>Bd,iFp:()=>rT,e$p:()=>iT,PcX:()=>aT,SpP:()=>nT,R6_:()=>Hh,CY1:()=>rb,Ajk:()=>Vu,Yiz:()=>Mu,FK9:()=>Du,UOo:()=>Fm,aTW:()=>oy,uug:()=>Nl,P$2:()=>ab,XS2:()=>El,Hyb:()=>kl,d3Y:()=>Uu,Klp:()=>ju,WxZ:()=>ob,Gzu:()=>Bl,ZOr:()=>Wu,uqV:()=>vd,Pm4:()=>te,nVD:()=>xf,dED:()=>Ud,P2h:()=>Id,jrr:()=>Ja,mmY:()=>Xa,T6O:()=>Mo,h6J:()=>ep,hM2:()=>mg,XR6:()=>Q,jmz:()=>Vf,IHt:()=>Mf,NZI:()=>mT,wdF:()=>my,kgP:()=>hy,ZYI:()=>kc,QXK:()=>rl,efz:()=>nl,Q5d:()=>tl,Ysv:()=>il,ocC:()=>If,io3:()=>ci,Sbt:()=>ho,roS:()=>mo,Ww1:()=>bo,QaS:()=>rc,ERZ:()=>ag,CL1:()=>hg,idV:()=>yp,nIW:()=>tt,fjE:()=>Jh,sG0:()=>Mm,tV7:()=>yl,g8o:()=>Ib,Qy:()=>Sb,t2P:()=>Bh,wId:()=>oo,LS0:()=>so,bFH:()=>ud,Rgl:()=>pd,fW1:()=>YT,Ywp:()=>_h,pg:()=>qp,WSA:()=>dd,fed:()=>Tg,tT_:()=>ys,KbL:()=>Ku,JBA:()=>lt,aNC:()=>Eh,RFJ:()=>Dc,Zeh:()=>Cy,OT5:()=>vh,mC3:()=>Qs,NVY:()=>qf,k6v:()=>Wc,FEC:()=>Yc,Ob5:()=>Wp,KUV:()=>Yp,dvH:()=>Bf,V3i:()=>HE,VD3:()=>pi,mm2:()=>Jl,izH:()=>ja,DK$:()=>Da,KMp:()=>Rc,c31:()=>Tn,mbo:()=>TT,gT8:()=>hn,CZ8:()=>Jo,uGi:()=>ts,Poc:()=>yn,_9k:()=>is,ZTM:()=>Zo,bwT:()=>rs,tzW:()=>On,tF$:()=>mn,o96:()=>Qo,M4S:()=>ns,_vs:()=>bc,xF8:()=>lf,HQx:()=>Dm,ATu:()=>fT,j1S:()=>mi,V3K:()=>Ti,Lmx:()=>Ei,ZaZ:()=>fn,n_1:()=>Nd,N6e:()=>_c,SxO:()=>Qa,w3p:()=>Kf,xU7:()=>ce,Y_p:()=>vo,$k6:()=>go,Gdl:()=>$m,U6P:()=>Vm,OwB:()=>Kh,hTh:()=>Ff,xqc:()=>Uo,JvE:()=>Co,i29:()=>Eu,dzT:()=>Li,uPS:()=>ac,cZV:()=>ic,Uz2:()=>Rp,xz3:()=>Ap,AET:()=>Np,n3B:()=>yO,e6O:()=>sO,s7j:()=>Nb,kW2:()=>oE,tH7:()=>So,Yxg:()=>Ms,MaZ:()=>vf,nqN:()=>Of,o_J:()=>Go,hgZ:()=>mp,yW4:()=>tp,uT0:()=>zc,C82:()=>Zc,J$m:()=>_d,j_Q:()=>xu,wB1:()=>Ng,SP6:()=>Bp,ZYr:()=>gg,IMU:()=>Lc,FoU:()=>Kd,DVz:()=>qm,mxe:()=>pO,FHr:()=>Iy,VO3:()=>Uh,de5:()=>Ih,Uw1:()=>fe,J6q:()=>ET,XCe:()=>qa,Ir:()=>ro,XQO:()=>no,QXb:()=>rd,P8_:()=>py,iiD:()=>Ac,MOC:()=>nd,WF:()=>td,xE1:()=>Oi,idW:()=>Fg,YL3:()=>ec,Fn9:()=>T,j2U:()=>Cs,MpE:()=>gn,kQw:()=>wn,mfm:()=>Zb,vZp:()=>ot,E8K:()=>jg,VSb:()=>Ko,vr_:()=>Pn,Vmh:()=>Yg,FgW:()=>KE,oDv:()=>Yo,kuw:()=>Bo,Tt2:()=>Wo,T6Y:()=>Zn,_26:()=>jl,YkM:()=>kn,J6y:()=>bl,njU:()=>Pl,IT0:()=>bT,x_:()=>Cm,biM:()=>Cp,Vkd:()=>Il,WiY:()=>Zh,_zi:()=>Ul,J6D:()=>Hl,Lt4:()=>Kn,QEi:()=>Vn,whI:()=>Jt,KIu:()=>Xt,JhM:()=>ae,C_0:()=>ri,qIF:()=>fO,O27:()=>E,aBi:()=>$p,xOX:()=>Ys,EdS:()=>Xe,WgC:()=>Qe,eEv:()=>Nn,A4t:()=>wl,hnu:()=>st,Wos:()=>Xn,jWr:()=>wa,Or$:()=>Dn,lhE:()=>ui,CwH:()=>Mn,pzC:()=>$s,ymH:()=>Rl,QZu:()=>jn,rYH:()=>zh,FVt:()=>Qn,Kn2:()=>le,OXP:()=>qo,lS4:()=>$n,g5f:()=>eb,fp6:()=>vl,Uty:()=>Hi,YkG:()=>Ln,xdS:()=>bn,$NE:()=>ze,bC9:()=>Je,KVV:()=>Sm,q9e:()=>Oo,iIf:()=>Gm,ian:()=>Hs,m6e:()=>ni,OFd:()=>Gs,kqr:()=>Sn,fnZ:()=>Ht,VFZ:()=>Js,ZiX:()=>Be,j5n:()=>Hn,zkt:()=>v,Pcm:()=>_g,QDV:()=>Vs,M5u:()=>Xh,laD:()=>dO,mtq:()=>_n,CtB:()=>Wm,CBv:()=>ie,I0t:()=>ti,u1G:()=>Rf,gk1:()=>uO,Bgb:()=>lO,uzs:()=>Qt,v0l:()=>Zl,Zqp:()=>Pd,j0k:()=>Po,tCm:()=>nt,gmx:()=>ml,mOr:()=>Fl,TwZ:()=>Ub,GyU:()=>bh,zGm:()=>Jp,bMg:()=>Ed,EyD:()=>ih,FQA:()=>ah,fZN:()=>bd,xsF:()=>rh,Lxg:()=>nh,O3l:()=>cc,Wni:()=>uc,wRx:()=>dh,OxG:()=>od,uJQ:()=>ad,qWg:()=>Bm,i96:()=>Kp,zhn:()=>ph,G8q:()=>dn,A9Y:()=>ee,Y5F:()=>XO,gxP:()=>se,c$P:()=>hl,BBN:()=>Ha,ZBU:()=>J,UkJ:()=>lo,xkv:()=>cy,z$M:()=>Mg,KAm:()=>Yd,lCl:()=>Wy,rkF:()=>FT,IU6:()=>up,aYu:()=>m,ije:()=>pl,Buf:()=>Nc,YLu:()=>cl,ct9:()=>No,XkY:()=>md,T5R:()=>Qp,uQS:()=>Od,wcJ:()=>_o,d$I:()=>As,rSp:()=>Up,Sx:()=>zu,Ki6:()=>qs,VGk:()=>Oc,sFD:()=>_E,eWN:()=>$g,dWE:()=>_b,Lkd:()=>rf,aDL:()=>Ly,yaA:()=>gd,DBr:()=>Gh,hK$:()=>fl,TZ_:()=>lp,CMB:()=>TO,FU8:()=>Xu,J$p:()=>Fy,b5s:()=>xy,h2W:()=>rt,SL_:()=>_y,oUH:()=>Jc,ck9:()=>Xp,Xs0:()=>ul,oCZ:()=>jT,MjG:()=>Sh,FuV:()=>Hc,$ju:()=>Xc,t6d:()=>Qc,m5F:()=>ye,sx:()=>Gg,rSc:()=>Hm,L8n:()=>ry,R9X:()=>Rd,rj2:()=>fy,_C4:()=>ap,tCj:()=>dy,uAg:()=>kd,wx9:()=>cf,KF3:()=>op,ax9:()=>sp,HH7:()=>vc,_6y:()=>sc,AJo:()=>nc,Ixr:()=>Hd,P6Y:()=>Qg,Bd_:()=>ST,xkB:()=>wT,W41:()=>Ay,WkI:()=>Ny,sSE:()=>PT,GMd:()=>du,Bxm:()=>UT,FVh:()=>vT,U_T:()=>yd,FTe:()=>ne,VGB:()=>re,Wfe:()=>Gl,Ls5:()=>$l});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:()=>I,formatTime:()=>S,getEndOfDay:()=>P,getMomentFormatFromDateMask:()=>B,getMomentFormatFromDateTimeMask:()=>H,getMomentFormatFromTimeMask:()=>K,getStartOfDay:()=>R,isToday:()=>v,isValidMomentDate:()=>h,isValidMomentDateOrNull:()=>b,momentToDate:()=>O,parseTimestamp:()=>J,toLocalDate:()=>_,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{applyCrosswalks:()=>ge,collectCrosswalksFromAttributes:()=>ve,compareActivenessAttributes:()=>Oe,compareAttributes:()=>he,compareImages:()=>be,compareRoles:()=>Ne,compareTags:()=>_e});var o={};r.r(o),r.d(o,{addAttribute:()=>Pe,editAttribute:()=>we,editEndDate:()=>Le,editRoles:()=>Ue,editStartDate:()=>je,editTags:()=>Ce,removeAttribute:()=>Ie});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=>e&&e.isValid(),b=(0,l.either)(h,l.isNil),O=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),v=e=>f()(e).isSame(Date.now(),"day"),_=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)},A=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=A("startOf"),P=A("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),S=e=>f()(e).format(f().localeData().longDateFormat("LTS")),I=e=>`${w(e)} ${S(e)}`,U=(0,l.equals)("9"),C=(0,l.equals)("99"),j=(0,l.equals)("9999"),L=(0,l.test)(/^[az][az][az]$/),D=(0,l.test)(/^[az][az][az][az]$/),k=(0,l.test)(/^9+$/),x=(0,l.test)(/^[9az]+$/),F=(0,l.cond)([[U,(0,l.always)("M")],[C,(0,l.always)("MM")],[L,(0,l.always)("MMM")],[D,(0,l.always)("MMMM")],[x,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),M=(0,l.cond)([[U,(0,l.always)("D")],[C,(0,l.always)("DD")],[x,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[U,(0,l.always)("y")],[C,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[k,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),$=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),U),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),C),(0,l.always)("hh")],[U,(0,l.always)("H")],[C,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),G=(0,l.cond)([[U,(0,l.always)("m")],[C,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),W=(0,l.cond)([[U,(0,l.always)("s")],[C,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),Y=/([9az]+)([^9az]+)*/g,B=e=>{const t=[...e.toLowerCase().matchAll(Y)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[F(e),r,M(n),i,V(a),o])}return e},q=/(9+)([^9]+)*/g,K=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,[$(e,s),r,G(n),i,a?W(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},H=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${B(t)} ${K(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Q=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",X=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:X,None:()=>X(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)}},Z=(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)}},ee=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},te=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),re=e=>Array.isArray(e)?e:[e],ne=e=>[e],ie=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),ae=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),oe=e=>(e=(e||"").toLowerCase(),ae(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),se=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),le=e=>null!=e&&["object","function"].includes(typeof e),ue=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)),le(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},ce=(e,t)=>{let r;return r="object"==typeof e&&e?"errorMessage"in e?e.errorMessage:t||e:e,r||t},pe=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)},de=/[\n\r%#()<>?[\\\]^`{}|]/g,ye=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(de,encodeURIComponent)}`,fe=e=>`data:image/gif;base64,${e}`;function Te(e){return e&&void 0!==e.uri}function Ee(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 me(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 he(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"===v(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(he(d.value,y.value,r)):"Reference"===v(d)?me(d,y)?o.push.apply(o,he(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(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&&(le(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),g(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 g(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,g(e.value)}))}function v(e){var t=e.value;if(le(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 be(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)||Te(r)&&Te(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function Oe(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 ve(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 _e(e,t){return Ee("UPDATE_TAGS").call(this,e,t)}function Ne(e,t){return Ee("UPDATE_ROLES").call(this,e,t)}function Ae(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 Re(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Ae(r[i],r[i+1],e,t));return n}function Pe(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Re(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 Pe(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=Re(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()?(Se(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(Se.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=Pe(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 Se(e,t){le(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ie(e,t,r,n){void 0===n&&(n=0);var i=Re(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ie(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 Ue(e,t){e.roles=t||[]}function Ce(e,t){e.tags=t||[]}function je(e,t){e.startDate=t||""}function Le(e,t){e.endDate=t||""}function De(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ke(e,t,r[t])}))}return e}function ke(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(le(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:le(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(le(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){le(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=De({},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:De({},n,{roles:s,tags:u}),roles:i,tags:l}}}},Fe=r(15729);const Me="1Tempo4rary",Ve="1Tepmo4Rel",$e=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),Ge=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,We=e=>()=>Ge(e),Ye=(e,t)=>{const r=$e(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return Ge(n)},Be=e=>e&&e.includes("uri$$"),qe=We("entities"),Ke=We("relations"),He=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),Je=(0,l.startsWith)("relations/"),Qe=(0,l.startsWith)("entities/"),Xe=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),ze=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),Ze=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),et=(0,l.pipe)((0,l.split)("/"),l.head),tt=(0,l.pipe)((0,l.split)("/"),l.last),rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},nt=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),it=(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("/")},at=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},ot=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),st=e=>5===e.split("/").length,lt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},ut=e=>e.replace(/uri\$\$/g,Me),ct={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"},pt="listEquals",dt="not listEquals",yt="listEqualsCaseSensitive",ft="not listEqualsCaseSensitive",Tt={[ct.EQUALS]:"equals",[ct.NOT_EQUALS]:"not",[ct.STARTS_WITH]:"starts with",[ct.MISSING_VALUE]:"missing value",[ct.IN_RANGE]:"in range",[ct.HAS_ALL]:"has all",[ct.FULL_TEXT]:"full text",[ct.EXISTS]:"exists",[ct.COUNT_EQUALS]:"count equals",[ct.COUNT_NOT_EQUALS]:"count not equal",[ct.COUNT_LT]:"count less",[ct.COUNT_LTE]:"count less or equal",[ct.COUNT_GT]:"count greater",[ct.COUNT_GTE]:"count greater or equal",[ct.COUNT_RANGE]:"count in range",[ct.LT]:"less than",[ct.LTE]:"less than or equal",[ct.GT]:"greater than",[ct.GTE]:"greater than or equal",[ct.IN_FILE]:"in file",[ct.NOT_IN_FILE]:"not in file",[ct.CONTAINS]:"contains",[ct.ON]:"on",[ct.BEFORE]:"before",[ct.AFTER]:"after",[ct.WITHIN]:"within"},Et="in",mt="notIn",ht="not range",bt=e=>({[Et]:ct.EQUALS,[mt]:ct.NOT_EQUALS}[e]||e),Ot={LAST_DAY:"lastDay",LAST_3DAYS:"last3Days",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},gt={[Ot.LAST_DAY]:"Last 24 hours",[Ot.LAST_3DAYS]:"Last 3 days",[Ot.LAST_WEEK]:"Last week",[Ot.LAST_MONTH]:"Last month",[Ot.LAST_YEAR]:"Last year",[Ot.PICK_DATE]:"Pick date"},vt={TYPE_STRING:"String",TYPE_TEXT:"Text",TYPE_PASSWORD:"Password",TYPE_LONG:"Long",TYPE_INT:"Int",TYPE_DOLLAR:"Dollar",TYPE_FLOAT:"Float",TYPE_DOUBLE:"Double",TYPE_NUMBER:"Number",TYPE_BOOLEAN:"Boolean",TYPE_BOOLEAN_RADIO:"Boolean_Radio",TYPE_DATE:"Date",TYPE_TIMESTAMP:"Timestamp",TYPE_ACTIVENESS_DATE:"ActivenessDate",TYPE_LOCAL_DATE:"LocalDate",TYPE_BLOB:"Blob",TYPE_ENUM:"Enum",TYPE_CIK_ID:"cik id",TYPE_LOOKUP:"Lookup",TYPE_TYPEAHEAD:"Typeahead",TYPE_URL:"URL",TYPE_BLOG_URL:"Blog URL",TYPE_IMAGE_URL:"Image URL",TYPE_EMAIL:"Email",TYPE_DEPENDENT_LOOKUP:"DependentLookup",TYPE_ENTITY_ID:"EntityId",TYPE_RDM_LOOKUPS_NOT_RESOLVED:"RdmLookupsNotResolved",TYPE_COUNT:"Count",TYPE_FILE:"File",TYPE_SELECT:"Select",TYPE_NESTED:"Nested",TYPE_REFERENCE:"Reference",TYPE_IMAGE:"Image",TYPE_SSN:"SSN"},_t={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Nt={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},At="<No label>",Rt={IN:"in",OUT:"out"};var Pt=r(87918),wt=r.n(Pt);function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){It(e,t,r[t])}))}return e}function It(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ut={startDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:vt.TYPE_ACTIVENESS_DATE,get label(){return wt().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},Ct=St({id:{type:vt.TYPE_ENTITY_ID,get label(){return wt().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},Ut,{roles:{type:vt.TYPE_STRING,get label(){return wt().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:vt.TYPE_STRING,get label(){return wt().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),jt={workflow:{type:vt.TYPE_STRING,get label(){return wt().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:vt.TYPE_STRING,get label(){return wt().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:vt.TYPE_STRING,get label(){return wt().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},Lt={commenter:{type:vt.TYPE_STRING,get label(){return wt().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},Dt={notResolved:{type:vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return wt().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},kt={createdBy:{type:vt.TYPE_STRING,get label(){return wt().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:vt.TYPE_STRING,get label(){return wt().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},xt={matches:{type:vt.TYPE_COUNT,get label(){return wt().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:vt.TYPE_COUNT,get label(){return wt().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},Ft={sourceSystems:{type:vt.TYPE_STRING,get label(){return wt().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:vt.TYPE_STRING,get label(){return wt().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:vt.TYPE_INT,get label(){return wt().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:vt.TYPE_TIMESTAMP,get label(){return wt().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:vt.TYPE_STRING,get label(){return wt().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}},Mt={matchRules:{type:vt.TYPE_STRING,get label(){return wt().text("Match Rules")},uri:"matchRules",name:"matchRules",faceted:!0,hideForDataTenant:!0},MLRecommendedMatch:{type:vt.TYPE_STRING,get label(){return wt().text("Match IQ")},uri:"MLRecommendedMatch",name:"MLRecommendedMatch",faceted:!0,hideForDataTenant:!0}},Vt=St({},Ct,jt,Lt,Dt,kt,xt,Ft,Mt,{type:{type:vt.TYPE_STRING,get label(){return wt().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}});var $t=r(13980),Gt=r.n($t);const Wt=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),Yt=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),Wt),Bt=(0,l.pipe)((0,l.reject)(E),Yt),qt=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("?")?"&":"?")+Wt(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}},Kt={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Ht=(0,l.equals)(Kt.SUGGESTING),Jt=(0,l.equals)(Kt.EDITING),Qt=(0,l.equals)(Kt.VIEWING),Xt=(0,l.either)(Jt,Ht);let zt,Zt,er,tr,rr,nr,ir,ar,or,sr,lr,ur,cr,pr,dr,yr,fr,Tr,Er,mr,hr,br,Or,gr;function vr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_r(e,t,r[t])}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(zt||(zt={})),function(e){e.local="local",e.validationService="validationService"}(Zt||(Zt={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(er||(er={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",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"}(tr||(tr={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(rr||(rr={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch"}(nr||(nr={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(ir||(ir={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(ar||(ar={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(or||(or={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(sr||(sr={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(lr||(lr={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(ur||(ur={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(cr||(cr={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(pr||(pr={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(dr||(dr={})),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"}(yr||(yr={})),function(e){e.IN="in",e.OUT="out"}(fr||(fr={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}(Tr||(Tr={})),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"}(Er||(Er={})),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"}(mr||(mr={})),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"}(hr||(hr={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(br||(br={})),function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(Or||(Or={})),function(e){e.Saving="Saving"}(gr||(gr={}));const Nr=Gt().oneOf(["mobile","tablet","desktop"]),Ar=Gt().shape({deviceTypes:Gt().oneOfType([Nr,Gt().arrayOf(Nr)]),roles:Gt().arrayOf(Gt().string)}),Rr=Gt().shape({value:Gt().string,lookupCode:Gt().string}),Pr=Gt().shape({link:Gt().string,filename:Gt().string}),wr=Gt().shape({displayName:Gt().string,parent:Gt().string}),Sr=Gt().oneOfType([Gt().string,Gt().number,Gt().bool,Rr]),Ir=Gt().oneOfType([Sr,Gt().arrayOf(Sr)]),Ur=Gt().shape({fieldName:Gt().string,values:Gt().arrayOf(Ir),filter:Gt().string,type:Gt().string}),Cr=Gt().shape({minValue:Gt().number,maxValue:Gt().number}),jr=Gt().shape({label:Gt().string,name:Gt().string,description:Gt().string,type:Gt().string,hidden:Gt().bool,faceted:Gt().bool,searchable:Gt().bool,uri:Gt().string,access:Gt().arrayOf(Gt().string),cardinality:Cr}),Lr=Gt().shape({label:Gt().string,uri:Gt().string,typeColor:Gt().string,direction:Gt().string,startObject:Gt().object,endObject:Gt().object}),Dr=Gt().shape({typeColor:Gt().string,typeIcon:Gt().string,typeImage:Gt().string,label:Gt().string,uri:Gt().string,attributes:Gt().arrayOf(jr)}),kr=Gt().shape({uri:Gt().string,label:Gt().string,memberTypes:Gt().array,extendsTypeUri:Gt().string,attributes:Gt().arrayOf(jr)}),xr=Gt().shape({uri:Gt().string,label:Gt().string,extendsTypeUri:Gt().string,relationshipTypeURIs:Gt().arrayOf(Gt().string)}),Fr=Gt().shape({uri:Gt().string,description:Gt().string,label:Gt().string,schemaVersion:Gt().string,entityTypes:Gt().arrayOf(Dr),roles:Gt().arrayOf(Gt().object),groupTypes:Gt().arrayOf(Gt().object),relationTypes:Gt().arrayOf(Lr),graphTypes:Gt().arrayOf(xr),interactionTypes:Gt().arrayOf(kr),sources:Gt().arrayOf(Gt().object)}),Mr=Gt().shape({uri:Gt().string,type:Gt().string}),Vr=Gt().shape({uri:Gt().string,attributes:Gt().object,type:Gt().string,timestamp:Gt().number,members:Gt().object}),$r=Gt().shape({uri:Gt().string,type:Gt().string}),Gr=Gt().shape({value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Wr=Gt().shape({refEntity:Gt().oneOfType([Gt().array,Gt().object]),refRelation:Gt().oneOfType([Gt().array,Gt().object]),value:Gt().object,ov:Gt().bool,type:Gt().string,uri:Gt().string}),Yr=Gt().oneOf((0,l.values)(Kt)),Br=Gt().shape({type:Gt().oneOf(Object.values(zt)).isRequired,attributeTypeUri:Gt().string.isRequired,parentUri:Gt().string.isRequired,uri:Gt().string,message:Gt().string}),qr={attributeType:jr,showEmptyEditors:Gt().bool,lazy:Gt().bool,mode:Yr,metadata:Fr,ownError:Br,errors:Gt().arrayOf(Br),crosswalks:Gt().array,onAddAttributes:Gt().func,onAddOneMore:Gt().func,onDeleteAttribute:Gt().func,onChangeAttribute:Gt().func,additionalControlsRenderer:Gt().func,hideDeleteButton:Gt().bool,showNonOv:Gt().bool,state:Gt().oneOf(["deleted","edited"])},Kr=vr({attributeValue:Gr},qr),Hr=vr({attributeValue:Wr},qr),Jr=Gt().shape({value:Gt().oneOfType([Gt().string,Gt().bool,Gt().number]),ov:Gt().bool,type:Gt().string,uri:Gt().string,lookupCode:Gt().string,lookupRawValue:Gt().string}),Qr=Gt().shape({totalOvValues:Gt().number,totalValues:Gt().number}),Xr=Gt().shape({inRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),outRelations:Gt().arrayOf(Gt().oneOfType([Gt().object,Gt().string])),groups:Gt().arrayOf(Gt().string),entityTypes:Gt().arrayOf(Gt().string),nextEntry:Gt().object}),zr=Gt().oneOf(["asc","desc"]),Zr=Gt().shape({id:Gt().string,content:Xr,allowOnlyCreateNew:Gt().bool,sortColumn:Gt().string,sortOrder:zr,"text-empty":Gt().string,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,editingEnabled:Gt().bool}),en=Gt().shape({id:Gt().string,graph:Gt().shape({type:Gt().string,layout:Gt().number,deep:Gt().number,limit:Gt().number,uri:Gt().string,options:Gt().shape({reverseRelations:Gt().bool})}),sortBy:Gt().oneOf(["relationTypeLabel","entityLabel"]),sortOrder:zr,max:Gt().number,icon:Gt().string,caption:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar}),tn=Gt().shape({id:Gt().string,caption:Gt().string,pageSize:Gt().number,icon:Gt().string,canCreate:Ar,canRead:Ar,canUpdate:Ar,canDelete:Ar,attributes:Gt().object}),rn=Gt().shape({entityUri:Gt().string,entityType:Gt().string,entityLabel:Gt().string,object:Mr}),nn=Gt().shape({relationUri:Gt().string,relationType:Gt().string,relationLabel:Gt().string,direction:Gt().string,object:$r}),an=Gt().shape({entity:rn,relation:nn}),on=Gt().shape({value:Gt().string,isRawFilter:Gt().bool}),sn=Gt().shape({id:Gt().string,label:Gt().string,name:Gt().string,availableEntityTypes:Gt().array}),ln=Gt().shape({id:Gt().string,allowMergeAll:Gt().bool,matchActions:Gt().object,availableTabs:Gt().arrayOf(Gt().oneOf(["findMatches","potentialMatches","notAMatch"]))}),un=Gt().shape({matchRules:Gt().arrayOf(Gt().string),object:Mr,shortestTransitiveMatchPath:Gt().arrayOf(Gt().shape({matchRules:Gt().arrayOf(Gt().string),match:Gt().string})),direct:Gt().bool,matchScore:Gt().number}),cn=Gt().arrayOf(un),pn=Gt().arrayOf(Gt().shape({uri:Gt().string,label:Gt().string})),dn=[{label:wt().text("And"),value:"and"},{label:wt().text("Or"),value:"or"},{label:wt().text("And not"),value:"and not"},{label:wt().text("Or not"),value:"or not"}],yn=(0,l.prop)("referencedEntityTypeURI"),fn=(0,l.prop)("relationshipTypeURI"),Tn=(0,l.prop)("referencedAttributeURIs"),En=(0,l.curry)(((e,t)=>(0,l.pipe)(Tn,(0,l.filter)((0,l.startsWith)(e)))(t))),mn=En("configuration/relationTypes"),hn=En("configuration/entityTypes"),bn=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),On=(0,l.filter)(bn),gn=(e,t)=>!t||t.some((t=>t===e.uri));function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _n=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,Xe),"uri"),(0,l.prop)("faceted"),(0,l.either)((0,l.propEq)("type",vt.TYPE_STRING),(0,l.propEq)("type",vt.TYPE_BLOB))]),Nn=(0,l.has)("values"),An=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(vt.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(vt.TYPE_LOOKUP)],[Nn,(0,l.always)(vt.TYPE_ENUM)],[_n,(0,l.always)(vt.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",vt.TYPE_BOOLEAN),(0,l.always)(vt.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),Rn=(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){vn(e,t,r[t])}))}return e}({},e,{type:An(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Pn=e=>!!e&&(!!e.autoGenerated&&e.type!==vt.TYPE_NESTED||!!e.parentAutoGenerated),wn=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Sn=(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),In=e=>wn(e)?"analyticsAttributes":"attributes",Un=(0,l.propEq)("hidden",!0),Cn=(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))),jn=Cn(vt.TYPE_NESTED),Ln=Cn(vt.TYPE_REFERENCE),Dn=Cn(vt.TYPE_IMAGE),kn=(0,l.either)(jn,Ln),xn=(e,t)=>{const r=wn(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(".")},Fn=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Mn=(0,l.pipe)(Fn,Boolean),Vn=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),$n=(0,l.both)(Mn,(0,l.pipe)(Fn,("rdm",(0,l.pipe)(et,(0,l.equals)("rdm")))));const Gn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=In({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]||Yn(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:[]},Wn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Gn(e,t,r);return n.length?(0,l.last)(n):null},Yn=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",vt.TYPE_NESTED),(0,l.propEq)("type",vt.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.map)((t=>Wn(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},Bn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],qn=[vt.TYPE_ACTIVENESS_DATE,vt.TYPE_TIMESTAMP,vt.TYPE_LOCAL_DATE],Kn=e=>Bn.includes(e),Hn=e=>qn.includes(e),Jn=[vt.TYPE_INT,vt.TYPE_LONG,vt.TYPE_NUMBER,vt.TYPE_FLOAT,vt.TYPE_DOUBLE,vt.TYPE_COUNT],Qn=e=>Jn.includes(e),Xn=e=>[vt.TYPE_FLOAT,vt.TYPE_DOUBLE].includes(e),zn=[vt.TYPE_BOOLEAN,vt.TYPE_BOOLEAN_RADIO,vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED],Zn=e=>zn.includes(e),ei=[vt.TYPE_URL,vt.TYPE_BLOG_URL,vt.TYPE_IMAGE_URL],ti=e=>ei.includes(e),ri=Cn(vt.TYPE_EMAIL),ni=e=>vt.TYPE_SSN===e;var ii,ai=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(ii||(ii={}));const oi=(0,l.curry)(((e,t,r)=>{var n;const i=null===(n=r[e])||void 0===n?void 0:n.roles;return!i||i.some((e=>t.includes(e)))})),si=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),li=(0,l.curry)(((e,t)=>(0,l.pipe)(si(e),(0,l.prop)("extendsTypeURI"))(t))),ui=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(li(e,r)));return n(r)})),ci=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=li(e,n);return r})),pi=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?pi(e,si(e,t.extendsTypeURI),r):void 0,di=(e,t)=>{const r=t.map(ci(e));return(r.length?r.reduce(l.intersection):[])[0]},yi=(e,t)=>pi(e,(0,l.is)(Object,t)?t:si(e,t),"typeImage");function fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ti=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ei=(0,l.pipe)(Ti,(0,l.propOr)("","label")),mi=(0,l.curry)(((e,t)=>{const r=Ti(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),hi=(0,l.curry)(((e,t,r)=>{const[n,i]=mi(e,r);return ui(e,n,t)||ui(e,i,t)})),bi=(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){fi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),Oi=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?Rt.OUT:Rt.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(Rt.IN),i=r(Rt.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},gi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),vi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},_i=(0,l.curry)(((e,t)=>e.every((e=>Ni(e,t))))),Ni=(0,l.curry)(((e,t)=>{const r=Pn(t);return!t||(!t.access||t.access.includes(e))&&(e===vi.READ||!r)})),Ai=(0,l.curry)(((e,t,r)=>Ni(vi.READ,r)&&(Ht(t)?Ni(vi.INITIATE_CHANGE_REQUEST,r):Ni(e,r)))),Ri=Ai(vi.CREATE),Pi=Ai(vi.DELETE),wi=Ai(vi.UPDATE),Si=_i([vi.CREATE,vi.MERGE,vi.READ,vi.UPDATE]),Ii=_i([vi.UPDATE,vi.READ,vi.CREATE]),Ui=_i([vi.UPDATE,vi.READ]),Ci=_i([vi.DELETE,vi.UPDATE,vi.READ]),ji=(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["*"])),Li=(e,t,r)=>(0,l.pipe)((0,l.map)(ji(e,t)),(0,l.filter)(l.identity))(r),Di=(e,t,r)=>{const n=Li(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ni(vi.MERGE,r)},ki=(0,l.curry)(((e,t,r,n)=>{const i=Ti(e,n),[a,o]=mi(e,n);return i&&Ni(vi.CREATE,i)&&ui(e,a,t.type)&&ui(e,o,r.type)})),xi=(e,t,r,n,i)=>{const a=si(e,n.type),o=Li(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(ki(e,n,i))||a.some(ki(e,i,n))}))},Fi=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=si(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Di(o,i,a),canAddRelation:xi(e,o,i,r,n),canMark:Ni(vi.UPDATE,a)&&Ni(vi.READ,a)}},Mi=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Fi(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Vi=wn,$i=(0,l.complement)(Vi),Gi=Ni(vi.READ),Wi=e=>{let{attributeType:t,mode:r}=e;return $i(t)&&Ri(r,t)&&!Un(t)},Yi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Be(r.uri),o=wi(n),s=Ri(n);return(0,l.cond)([[Vi,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Bi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Be(r.uri),s=wi(n),u=Pi(n),c=Ki(vi.UPDATE,n,a,r),p=Ki(vi.DELETE,n,a,r);return(0,l.cond)([[Vi,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)},qi=(0,l.curry)(((e,t,r,n)=>{const i=Yn(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=>!Ni(e,n)||!qi(e,t,r[n.name],n)))))})),Ki=(0,l.curry)(((e,t,r,n,i)=>Ht(t)?qi(vi.INITIATE_CHANGE_REQUEST,r,n,i):qi(e,r,n,i))),Hi=(0,l.both)((0,l.complement)(Un),Gi),Ji="SuperUser",Qi="allTenants",Xi=[Qi,"allCustomers"],zi=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===Ji})).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===Ji){const e=r?Xi.concat(r.map((e=>`allTenants.${e}`))):Xi,n=r&&t[0]===Qi?t.slice(0,2):t.slice(0,1);return e.map((e=>e.split("."))).some((e=>(0,l.startsWith)(n,e)))}})(i,o,n)})).some((e=>{const n=i[e];return r.privileges.every((e=>{const r=n[e],i=Array.isArray(r);return t?Array.isArray(r)&&r.some((e=>t=>t===e||"SuperUser:*"===t||t.startsWith("SuperUser:allTenants"))(t)):i}))}))})(e,n.tenant,t,i)}:l.F}var t}))},Zi={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_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"},ea={[Zi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Zi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activityLog"],privileges:["EXECUTE"]},[Zi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Zi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Zi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Zi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Zi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Zi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Zi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Zi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Zi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Zi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Zi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Zi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Zi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Zi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Zi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Zi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Zi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Zi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Zi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Zi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Zi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Zi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]}},ta=(0,l.curry)(((e,t,r)=>zi({allowedPermissionsNames:e,permissionsNames:Zi,permissionsConfig:ea}).some((e=>e(t,{params:{tenant:r}}))))),ra=ta([Zi.CAN_EXPORT]),na=ta([Zi.CAN_EXPORT_ACTIVITIES]),ia=ta([Zi.CAN_IMPORT_ENTITIES_FROM_DT]),aa=ta([Zi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),oa=ta([Zi.CAN_UPDATE_PROCESS_INSTANCE]),sa=ta([Zi.CAN_VIEW_WORKFLOW_DEFINITION]),la=ta([Zi.CAN_CONFIG_ENVIRONMENT_REGISTER]),ua=ta([Zi.CAN_UPDATE_WORKFLOW_DATA_TASK]),ca=ta([Zi.CAN_READ_WORKFLOW_DATA_TASK]),pa=ta([Zi.CAN_MANAGE_WORKFLOW_DEFINITION]),da=ta([Zi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),ya=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),fa=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),Ta=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),Ea=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),ma=ta([Zi.CAN_EXECUTE_WORKFLOW_JOBS]),ha=ta([Zi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),ba=ta([Zi.CAN_CREATE_CONFIG_JAR]),Oa=ta([Zi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),ga=ta([Zi.CAN_VIEW_CONFIG_JAR]),va=ta([Zi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),_a=ta([Zi.CAN_VIEW_WORKFLOW_JOBS]),Na=ta([Zi.CAN_MAKE_BULK_UPDATE]),Aa=ta([Zi.CAN_OPEN_DATA_LOADER_EXECUTE,Zi.CAN_OPEN_DATA_LOADER_READ]),Ra=ta([Zi.CAN_BULK_DELETE_PROFILES]),Pa=ta([Zi.CAN_READ_MDM_DATA_ENTITIES]),wa=ta([Zi.IS_FREEMIUM_ADMIN]),Sa=(0,l.reject)(Un),Ia=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Sa,(0,l.filter)(e))(t),Ua=(0,l.curry)(((e,t)=>Ia((t=>Wi({attributeType:t,mode:e})),t))),Ca=(0,l.curry)(((e,t)=>Ia((t=>Wi({attributeType:t,mode:e})||Hi(t)),t))),ja=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Hi)),La=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...La(e)])))),Da=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Hi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Da(e)])))),ka=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...ka(e)])))),xa=(0,l.pipe)(si,(0,l.converge)(l.concat,[Da,ka]));function Fa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ma(e,t,r[t])}))}return e}function Ma(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Va=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Va(e)))},t))),$a=e=>{var t;return Fa({},e,{matchGroups:(e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[])})},Ga=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Wa=(0,l.when)(Ga,(0,l.dissoc)("values")),Ya=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Fa({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["lookupCode"]),{dependentLookupCode:t})})),Ba=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},qa=(0,ai.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(La,t).concat((0,l.chain)(La,r)).some(Ba)})),Ka=e=>{let t=!1;const r=Va((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Fa({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ha=e=>{const t=qa(e),r=(0,l.map)((e=>Va((0,l.pipe)(Wa,(0,l.when)((0,l.always)(e),Ya))))(t)),n=(0,l.map)($a),i=(0,l.map)(Ka);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Ja=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Qa=(0,l.prop)("relationshipTypeURIs"),Xa=(0,l.curry)(((e,t)=>e.graphTypes.filter(za(e,t)))),za=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return n.some(hi(e,t))},Za=(e,t)=>(0,l.pipe)(Ja,(0,l.defaultTo)({}),Qa,(0,l.defaultTo)([]),(0,l.chain)(mi(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(si(e)))(e,t),eo=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),to=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),ro=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return to((0,l.complement)(eo))(e)},no=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return to(eo)(e)},io=(0,l.pipe)(si,(0,l.propOr)([],"matchGroups")),ao=(e,t,r)=>(0,l.pipe)(io,(0,l.find)((0,l.propEq)("uri",r)))(e,t),oo=(0,l.curry)(((e,t,r)=>(0,l.pipe)(ao,(0,l.propOr)(r,"label"))(e,t,r))),so=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(io,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),lo=e=>(0,l.partition)(eo,e),uo=(0,l.includes)(l.__,["and","or","not"]),co=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),po=(0,l.includes)(l.__,["equals","notEquals","in"]),yo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return uo(t)?yo(r):co(t)?r.filter(Xe):po(t)?r.map((0,l.prop)("uri")).filter(Xe):[]})),l.uniq),fo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(yo),l.uniq),To=(0,l.pipe)(io,fo),Eo=(0,l.pipe)(so,fo),mo=(e,t)=>{let{interactionTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},ho=(0,l.pipe)(mo,Da),bo=(e,t)=>e.interactionTypes.filter(((e,t)=>r=>{let{memberTypes:n}=r;return n.some(((e,t)=>r=>{let{objectTypeURI:n}=r;return n===t||ui(e,n,t)})(e,t))})(e,t)),Oo=e=>!!e.required,go=(e,t,r)=>{const n=(0,l.cond)([[Xe,si(e)],[ze,Ti(e)]])(t);return vo(e,n,r)},vo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&Xe(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Pn(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===vt.TYPE_REFERENCE){const n=fn(t),a=Tn(t);i=go(e,n,r).filter((e=>a.some(Ze(e.uri))))}else t.attributes&&(i=vo(e,t,r));i&&n.push(...i)}return n})):t.type===vt.TYPE_REFERENCE?go(e,fn(t),r):[],_o=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),Oo]),e.attributes||[])},No=(e,t)=>{const r=hn(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},Ao=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?wt().text(n):n};return r(null,t)})),Ro=["label","description","abbreviation","caption","toolTip"],Po=e=>Ao(Ro,e),wo=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=tt(t);return r.find((e=>{let{uri:t}=e;return tt(t)===n}))})),So=(0,l.curry)(((e,t)=>{const r=tt(t);return(0,l.pipe)(wo(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Io=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"})},Uo=(0,l.curry)(((e,t)=>{let{roles:r}=e;return(0,l.pipe)((0,l.find)((0,l.propEq)("uri",t)),(0,l.prop)("label"))(r)})),Co=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=si(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function jo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lo(e,t,r[t])}))}return e}function Lo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Do=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["attributes"];const i=n.reduce(((e,r)=>e.concat(t[r]||[])),[]);return z.fromNull(i&&i.length?i:Yn(e,t)).map((t=>t.map((t=>{const i=Do(e,t,r,n);return i.length?jo({},t,{children:i}):t})))).orSome([]).filter((0,l.either)((0,l.complement)(kn),(0,l.prop)("children"))).filter(Hi).filter(r).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes","analyticsAttributes"])},xo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["attributes"])},Fo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Do(e,t,r,["analyticsAttributes"])},Mo=(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)})),Vo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return tt(r)===e})))),$o=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Vo("LUD")),(0,l.defaultTo)(r))(t||[])},Go=(e,t)=>{let{survivorshipStrategies:r}=e;return Vo(t,r)},Wo=(0,l.allPass)([(0,l.complement)(l.isNil),Ni(vi.READ)]),Yo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ni(vi.READ)]),Bo=(0,l.curryN)(2,(0,l.pipe)(si,Yo)),qo=e=>{let{ov:t}=e;return!1!==t},Ko=(e,t)=>((e,t)=>ti(e.type)&&ie(t))(e,t)||((e,t)=>ri(e.type)&&ae(t))(e,t),Ho=(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))),Jo=Ho("refEntity"),Qo=Ho("refRelation"),Xo=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],zo=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},Zo=(0,l.prop)("objectURI"),es=(0,l.prop)("objectURI"),ts=(0,l.prop)("type"),rs=(0,l.pipe)(Jo,(0,l.defaultTo)({}),Zo),ns=(0,l.pipe)(Qo,(0,l.defaultTo)({}),es),is=(0,l.pipe)(Jo,(0,l.defaultTo)({}),ts),as=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},os=(0,l.evolve)({refEntity:te,refRelation:te}),ss=(e,t,r,n)=>{const i=Gn(e,r),a=si(e,t.type)||Ti(e,t.type);if(0===i.length)return null;const o=In(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(!gn(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=>fn(e)===r.uri||yn(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},ls=(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?ls(a.value,o):a},us=(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 ls(e[r],i)})),cs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value"])],[l.T,(0,l.prop)("value")]]),ps=(0,l.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)(cs),(0,l.when)((()=>i.length>0),(0,l.map)(ps(e,i))))(r)})),ds=ps(null),ys=ps(qo),fs=(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=us(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ts=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(rs,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{});function Es(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hs=e=>{let{parentUri:t,attributeType:r}=e;return Es({uri:Ye(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[kn,(0,l.always)({value:{}})],[Mn,()=>t?{value:"",lookupCode:t}:{value:""}],[l.T,(0,l.always)({value:t})]])(e)})(r))},bs=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ua(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),Vn,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=hs({parentUri:r,attributeType:e});let s=Yn(n,e);s&&(e.type===vt.TYPE_REFERENCE&&(s=On(s)),a.value=bs({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(0,l.isEmpty)(a.value)&&!Vn(e)||(o[t]=[a])}return o},Os=e=>{let{entity:t,metadata:r}=e;return go(r,t.type,!0).filter(Vn).reduce(((e,t)=>{const n=t.name,i=lt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:ss(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:vs({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},gs=(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===vt.TYPE_NESTED?Es({},e,{value:gs({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Es({},s(t),bs({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),vs=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=hs({parentUri:n,attributeType:r}),u=cs(l);return(0,Fe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},_s=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{Pe(e.attributes||e.value,r,n.uri,cs(n),a,o,i)}))},Ns=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Fe.ZP)(t,(e=>{we(e.attributes||e.value,r,n,i,a,o)}))},As=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Fe.ZP)(t,(e=>{Ie(e.attributes||e.value,r,n,i)}))},Rs=(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"))),Ps=(0,l.reject)(Rs),ws=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=>ws({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),Ps)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},Ss=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ws({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),os),deleteEmptyComplex:e})},Is=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(Ss(e),(0,l.reject)(l.isEmpty))},Us=Object.values(Ut),Cs=(0,l.includes)(l.__,Us),js=e=>Us.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ls(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ds(e,t,r[t])}))}return e}function Ds(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,t)=>`${e}_${t}`,xs=[Vt.matches.name,Vt.matchRules.name],Fs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,xs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ks(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Ms=(e,t)=>(0,l.pipe)(l.values,Fs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ks(`dtPotentialMatches.${t.name}`,"")))))(Vt),Vs=(0,l.propEq)("uri",Vt.type.uri),$s=e=>(0,l.values)(Mt).some((0,l.propEq)("uri",e.uri)),Gs=(0,l.propEq)("uri",Ft.sourceSystems.uri),Ws=Object.values(Ct),Ys=(0,l.includes)(l.__,Ws),Bs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:void 0===n?r.defaultValue:n})},qs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Ks=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:n})},Hs=(0,l.propEq)("uri",Ct.roles.uri),Js=(0,l.propEq)("uri",Ct.tags.uri),Qs=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)},Xs="UrlThumbnail",zs="CdnUrlThumbnail",Zs=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(qo):(0,l.head)(n);return e&&e.value}return null})),el=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Zs(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),tl=el(["CdnUrl","Url"],!0),rl=el(["CdnUrlPreview","UrlPreview"],!0),nl=el([zs,Xs],!0),il=el([zs,Xs]),al=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Sn,(0,l.always)(t)],[(0,l.both)(wn,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Sn(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Cs(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),re)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},ol=(e,t,r)=>{const n=ja(e),i=(0,l.any)(r?l.T:qo);return al(n,t,i)},sl=(e,t,r,n,i,a)=>{const o=Be(null==r?void 0:r.uri)?Ua(t,e):Ca(t,e);return al(o,r,((e,o)=>{const s=Wi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:qo,e)||Sn(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let ll;const ul=e=>{ll=e};function cl(e,t){return ll(e,t)}const pl=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)})),dl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=50}=e;return cl("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i}),headers:{"Content-Type":"application/json"}})},yl=(0,l.once)((()=>cl("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),fl=e=>cl("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Tl=(e,t)=>cl("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),El=e=>z.fromNull(Tt[e]).map(wt().text).orSome(""),ml=(0,l.curry)(((e,t)=>`${e}_${t}`)),hl=(0,l.split)("_"),bl=(0,l.includes)("_"),Ol=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),gl=(0,l.curry)(((e,t)=>e.some(Ol(t)))),vl=gl([ct.IN_RANGE,ct.COUNT_RANGE,ct.WITHIN]),_l=gl([ct.EXISTS,ct.MISSING_VALUE]),Nl=(0,l.cond)([[_l,(0,l.always)(0)],[vl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Al=(0,l.complement)(_l),Rl=gl([ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS]),Pl=gl([ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE]),wl=gl([ct.IN_FILE,ct.NOT_IN_FILE]),Sl=e=>{switch(e){case ct.COUNT_EQUALS:return ct.EQUALS;case ct.COUNT_NOT_EQUALS:return ct.NOT_EQUALS;case ct.COUNT_LT:return ct.LT;case ct.COUNT_LTE:return ct.LTE;case ct.COUNT_GT:return ct.GT;case ct.COUNT_GTE:return ct.GTE;case ct.COUNT_RANGE:return ct.IN_RANGE}},Il=gl([ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS]),Ul=gl([ct.WITHIN]),Cl=[[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE],[ct.NOT_IN_FILE,ct.IN_FILE],[ct.EQUALS,ct.NOT_EQUALS,ct.HAS_ALL],[ct.LT,ct.LTE,ct.GT,ct.GTE],[ct.MISSING_VALUE,ct.EXISTS],[ct.COUNT_RANGE],[ct.IN_RANGE],[ct.STARTS_WITH,ct.CONTAINS],[ct.FULL_TEXT],[ct.ON,ct.BEFORE,ct.AFTER,ct.NOT_EQUALS],[ct.WITHIN]],jl=(e,t)=>Cl.some((r=>r.includes(e)&&r.includes(t))),Ll=(0,l.pipe)(l.omit,l.values),Dl={OPTIONS_FOR_STRING:Ll(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_DATE:[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS,ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:Ll(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_BLOB:Ll(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_NUMBER:Ll(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_LOOKUP:Ll(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],ct),OPTIONS_FOR_ENUM:Ll(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],ct),OPTIONS_FOR_ID:[ct.EQUALS,ct.NOT_EQUALS,ct.IN_FILE,ct.NOT_IN_FILE],OPTIONS_FOR_COUNT:[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],OPTIONS_FOR_COMPLEX:[ct.COUNT_EQUALS,ct.COUNT_NOT_EQUALS,ct.COUNT_LT,ct.COUNT_LTE,ct.COUNT_GT,ct.COUNT_GTE,ct.COUNT_RANGE,ct.EXISTS,ct.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[ct.EQUALS,ct.NOT_EQUALS,ct.EXISTS,ct.MISSING_VALUE]},kl=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case vt.TYPE_TYPEAHEAD:case vt.TYPE_STRING:case vt.TYPE_PASSWORD:case vt.TYPE_TEXT:case vt.TYPE_CIK_ID:case vt.TYPE_URL:case vt.TYPE_BLOG_URL:case vt.TYPE_IMAGE_URL:case vt.TYPE_EMAIL:return Dl.OPTIONS_FOR_STRING;case vt.TYPE_LOOKUP:case vt.TYPE_DEPENDENT_LOOKUP:return Dl.OPTIONS_FOR_LOOKUP;case vt.TYPE_ENUM:return Dl.OPTIONS_FOR_ENUM;case vt.TYPE_DATE:case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_TIMESTAMP:case vt.TYPE_LOCAL_DATE:return Dl.OPTIONS_FOR_DATE;case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:return Dl.OPTIONS_FOR_BOOLEAN;case vt.TYPE_BLOB:return Dl.OPTIONS_FOR_BLOB;case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_NUMBER:return Dl.OPTIONS_FOR_NUMBER;case vt.TYPE_ENTITY_ID:return Dl.OPTIONS_FOR_ID;case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[ct.EQUALS];case vt.TYPE_COUNT:return Dl.OPTIONS_FOR_COUNT;case vt.TYPE_NESTED:case vt.TYPE_REFERENCE:case vt.TYPE_IMAGE:return Dl.OPTIONS_FOR_COMPLEX;default:return Dl.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Pl,n):n},xl=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=t.length>0?`${t} ${r}`:r;return n===this.clauses.length-1?i:`${i} ${(0,l.propOr)("and",n,e)}`}),"")}},Fl=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Ml=e=>Array.isArray(e)?e.map(Ml).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),Vl=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),$l=e=>`'${e}'`,Gl=e=>`"${e}"`,Wl=(0,l.pipe)(Ml,Vl),Yl=(0,l.pipe)(Wl,$l),Bl=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(vl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),ql=(e,t)=>Pl(t)?{type:vt.TYPE_INT}:wl(t)?{type:vt.TYPE_FILE}:Il(t)&&!Ul(t)&&Hn(e.type)?{type:vt.TYPE_LOCAL_DATE}:e,Kl=Object.values(Ot),Hl=e=>Kl.includes(e),Jl=e=>wt().text(gt[e]),Ql=e=>{const t=f()();switch(e){case Ot.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Ot.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()];case Ot.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Ot.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Ot.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()]}return e};function Xl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zl(e,t,r[t])}))}return e}function zl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zl=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),eu=(0,l.curry)(((e,t,r)=>{const n=r.map(vl(e)||t.endsWith(".count")?Wl:Yl).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),tu=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},ru=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Nl(t);return(0,l.pipe)(tu(i),(0,l.map)(eu(t,r)),Zl(" or "))(n)},nu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(Yl).join(",")})`},iu=e=>`*${e}*`,au=e=>`URL:${e}`,ou=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,su=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===ct.IN_FILE?r:`not ${r}`},lu=(e,t)=>[R(e,t),P(e,t)],uu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!cu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case ct.ON:return Xl({},e,n?{filter:ct.EQUALS}:{filter:ct.IN_RANGE,values:[lu(i,n)]});case ct.BEFORE:return Xl({},e,{filter:ct.LTE,values:[[P(i,n)]]});case ct.AFTER:return Xl({},e,{filter:ct.GTE,values:[[R(i,n)]]});case ct.WITHIN:return Xl({},e,{filter:ct.IN_RANGE,values:[Ql(i)]})}}return e}),ru),cu=(0,l.propSatisfies)(Hn,"type"),pu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",ct.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(ru({filter:ct.EQUALS,fieldName:t,values:[r]}))),new xl).build())),Zl(" or "))(r)}],[(0,l.propEq)("filter",ct.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:r,filter:t,values:n.map((0,l.pipe)(Ml,iu))})}],[(0,l.propEq)("filter",ct.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?ru(Xl({},e,{values:(0,l.flatten)(r)})):ou(r)?nu(Xl({},e,{filter:"listEquals"})):ru(e)}],[(0,l.propEq)("filter",ct.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Nl(t);return(0,l.pipe)(tu(i),(0,l.map)(eu(t,r)),Zl(" and "))(n)})(Xl({},e,{values:(0,l.flatten)(e.values)})):cu(e)?(e=>{const{values:t}=e,r=!cu(e),[n]=t;return(new xl).addClause(ru(Xl({},e,{filter:ct.LT,values:[R(n,r)]}))).addClause(ru(Xl({},e,{filter:ct.GT,values:[P(n,r)]}))).orBuild()})(e):ou(t)?nu(Xl({},e,{filter:"not listEquals"})):ru(e)}],[(0,l.propSatisfies)(wl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:r,filter:su(t,r),values:n.map((0,l.prop)("link")).map(au)})}],[(0,l.propSatisfies)(Pl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ru({fieldName:`${r}.count`,values:n,filter:Sl(t)})}],[(0,l.propSatisfies)(Il,"filter"),uu],[(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 eu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return eu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,ru]],du=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Al(e)||fu(r))},yu=e=>Array.isArray(e)?fu(e):null!=e&&Ml(e).length>0,fu=e=>e&&e.length>0&&e.every(yu);function Tu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eu=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},mu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),hu=(e,t,r)=>"children"===e?Ou(r,[...t][0],!0):r,bu=(e,t,r)=>"values"===e?[...r,...t]:r,Ou=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)(hu,t),e);if(!r&&Rl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(bu,t),e)}return(0,l.append)(t,e)},gu=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Eu(e),r=e=>e.fieldName===t?e:r({fieldName:mu(e),children:[e]});return r(e)})(t);return Ou(e,r)}),[]),vu=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")),_u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function r(n){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n.reduce(((n,a)=>n.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:n}=e;return i&&vu(n)&&!t?`inSameAttributeValue(${r(n,!1)})`:r(n,i)}],...e])(a))),new xl).buildWithOperators(n.map((0,l.prop)("operator")))}},Nu=(0,l.pipe)((0,l.propOr)("","filter"),bl),Au=(0,l.map)((0,l.when)(Nu,(e=>{const[t,r]=hl(e.filter);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),Ru=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)(du),Au,gu,_u([...e,...pu],t))},Pu=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),wu=[ct.ON,ct.BEFORE,ct.AFTER,ct.WITHIN,ct.NOT_EQUALS,ct.MISSING_VALUE,ct.EXISTS],Su=[ct.EQUALS,ct.NOT_EQUALS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.FULL_TEXT,ct.EXISTS],Iu=[ct.EQUALS,ct.NOT_EQUALS,ct.LT,ct.LTE,ct.GT,ct.GTE,ct.IN_RANGE],Uu=(e,t)=>{const r=Rn(e);return(e=>{switch(e){case Ut.startDate.name:case Ut.endDate.name:case jt.dueDate.name:case kt.createdTime.name:case kt.updatedTime.name:case Ft.reltioLoadDate.name:case Ft.createDate.name:case Ft.updateDate.name:case Ft.deleteDate.name:case Ft.publishDate.name:return wu;case xt.matches.name:case Ft.count.name:return Iu;case jt.workflow.name:case jt.assignee.name:case jt.step.name:case Lt.commenter.name:case kt.createdBy.name:case kt.updatedBy.name:case Ft.sourceSystems.name:case Ft.value.name:return Su;default:return null}})(t)||kl(r)},Cu=[ct.EQUALS,ct.NOT_EQUALS,ct.CONTAINS,ct.STARTS_WITH,ct.MISSING_VALUE,ct.HAS_ALL,ct.IN_RANGE,ct.WITHIN,ct.EXISTS,ct.ON],ju=(0,l.pipe)(Uu,(0,l.filter)((0,l.includes)(l.__,Cu))),Lu=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Du=e=>{let{query:t,body:r}=e;return t=Lu(t),cl(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},ku=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)(Ru(),Pu(t.globalFilter))(n),activeness:t.activityFilter||"active"};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${Bt(i)}`},xu=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=ku(e,t,r);return cl(n)},Fu=(0,l.pipe)((0,l.reject)(l.isNil),Yt),Mu=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s}=n,u=(0,l.pipe)(Ru(),Pu(i))(r),c=Fu({filter:u||null,activeness:a||"active",options:o||null}),p=[{fieldName:t,pageSize:s||20,pageNo:1,orderType:n.orderType||"reversedCount"}];return Du({query:c,body:p})},Vu=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return Mu({fieldName:t,searchParams:i,options:n})},$u="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Gu=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)(Ru(),Pu(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||$u,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${Bt(i)}`},Wu=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=Gu(e,t,r);return cl(n)},Yu=e=>cl(`/${e}?select=secondaryLabel`),Bu=(e,t)=>{const{select:r=$u,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),cl("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},qu=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Be)),Ku=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=qu(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=xn(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)(Ru(),Pu(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),cl(`${s}/api/${o}/${t}/_object`,m)},Hu=e=>`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,Ju=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Qu=e=>cl(Hu(e)),Xu=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 cl(n,r)},zu=e=>cl(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Zu=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return cl(`/entities/_events/_total${Yt({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ec=(e,t)=>cl(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),tc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return cl(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},rc=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 cl(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},nc=e=>{const t=new FormData;return t.append("file",e),cl("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=ce(e,wt().text("Can't upload file"));return Promise.reject(t)}))},ic=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 cl(`/personal/findSavedSearches${Yt({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"}})},ac=e=>cl(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),oc=e=>cl("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return cl(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},lc=e=>{let{uri:t}=e;return cl(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},uc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),sc)(e),cc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),sc)(e);function pc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dc=["max","offset","filter"],yc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:yc(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){pc(e,t,r[t])}))}return e}({},t,(0,l.pick)(dc,e)))),fc=(0,l.omit)(["activeness"]),Tc=(e,t)=>{const r=(e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],ir.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],ir.ALL,e)))return!1})(t);return t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(yc(e),(0,l.omit)(dc))(e))),fc))(t),{url:`/${e}/_connections${Bt({limitCreditsConsumption:!0,activeness_enabled:r})}`,options:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}},Ec=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),mc=(0,l.reject)(l.isNil),hc=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),bc=e=>cl(hc(e),{method:"GET",headers:{"Content-Type":"application/json"}}),Oc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,hc);return cl(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},gc=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?Is()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(mc,re,JSON.stringify);return cl(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},vc=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"),hc,n),o=he(i(t),i(r)).concat(Oe(t,r));return cl(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},_c=(e,t)=>{const{url:r,options:n}=Tc(e,t);return cl(r,n).then(Ec)},Nc=(e,t)=>cl(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Ac=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Rt.IN?a.inRelations=[n]:a.outRelations=[n],cl(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Rc=(e,t)=>cl(`/recentSearches/?environment=${e}&tenant=${t}`,{method:"GET",application:"explorer",headers:{"Content-Type":"application/json"}}),Pc=e=>cl("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),wc=e=>{let{environment:t,tenant:r,createdDate:n}=e;return cl(`/recentSearches?environment=${t}&tenant=${r}&createdDate=${n}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function Sc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ic(e,t,r[t])}))}return e}function Ic(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uc={select:"label,secondaryLabel,name,type,startDate,endDate"},Cc=(0,l.reject)(l.isNil),jc=(0,l.pipe)(Cc,Yt),Lc=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=Sc({},Uc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{});return cl(`/${t}/_tree${jc(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Dc=e=>{let{uri:t,graphUri:r}=e;const n=Sc({},Uc,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return cl(`/${t}/_parents${jc(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},kc=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1}=e;const o=Sc({},Uc,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},{filterLastLevel:i,deep:a});return cl(`/${t}/_hops${jc(o)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function xc(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 Fc=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Mc="/activities",Vc=e=>{let{label:t,description:r}=e;return cl(Mc,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:Fc()}})},$c=e=>{const t=Bt(e);return cl(Mc+t,{method:"GET"})},Gc=e=>cl(`/activities/_total${Bt(e)}`,{method:"GET"}),Wc=e=>{const{entityUri:t}=e,r=xc(e,["entityUri"]);return cl(`/${t}/_activities${Bt(r)}`,{method:"GET"})},Yc=e=>{const{entityUri:t}=e,r=xc(e,["entityUri"]);return cl(`/${t}/_activities/_total${Bt(r)}`,{method:"GET"})};function Bc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qc(e,t,r[t])}))}return e}function qc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kc=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Hc=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return cl(Kc({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},Jc=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=Kc({url:r,workflowPath:t,tenant:n})),cl(s,{method:i||"GET",body:JSON.stringify(a),headers:Bc({"Content-Type":"application/json"},null!=o?o:{})})},Qc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Kc({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return cl(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)},Xc=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Kc({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Bc({},l,{comment:o}):l;return cl(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},zc=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Kc({url:`/tasks${s?Bt(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Bc({objectURIs:[i]},(0,l.reject)(E,a)))};return cl(u,Bc({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Zc=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i}=e;const a={assignee:i};return cl(Kc({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ep=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i}=e;return cl(Kc({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:JSON.stringify(i)})},tp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return cl(Kc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},rp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return cl(Kc({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},np=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return rp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},ip=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return cl(Kc({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},ap=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return rp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},op=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return rp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},sp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return rp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},lp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return cl(Kc({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},up=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return cl(Kc({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},cp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(qo);return a&&a[0]&&(r=n.length>0&&a[0].value?cp(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}}),""),pp=(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=cp(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},dp=/[,\s]*$/,yp=e=>{const t=wt().text(At);if(!e)return t;const r=e.replace(dp,"");return""===r.toString().trim()?t:r},fp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},Tp=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=fp(e,r.referencedEntityTypeURI);if(n)return pp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return pp({attributes:t||{}},r.dataLabelPattern);return""},Ep=e=>{let{uiPath:t,uri:r}=e;return`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},mp=e=>{let{uiPath:t,tag:r,entityUri:n}=e;return`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},hp=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",bp=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),nl,(0,l.prop)("value"))),Op=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),bp),gp=(e,t,r)=>{const n=Op(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(us(e),bp)))(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")])})(si(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>ss(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,bp))(r)})(e,r)||yi(e,r.type);return hp(t,n)};var vp=void 0;const _p={50:"#E0233A",80:"#F5A623",100:"#62A61B"},Np=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return r.map((r=>{r="/"===r[0]?r:"/"+r;const n=t.type+r+"/analyticsAttributes/score",i=t.type+r+"/analyticsAttributes/updatedDate",a=Wn(e,n);return{label:a&&(a.label||a.name),uri:n,value:a&&Ap(e,t,n)||"-",updatedDate:a&&Ap(e,t,i)||0}}),vp).filter((e=>null!=e.label&&("-"===e.value||e.value>=0&&e.value<=100)))},Ap=(e,t,r)=>{const n=ss(e,t,r);return n&&n[0]&&n[0].value},Rp=(e,t,r)=>{const n=r&&r[e]||_p,i=Object.keys(n).map((e=>({value:+e,color:n[e]}))).filter((e=>!isNaN(e.value))).sort(((e,t)=>e.value-t.value)).map(((e,t,r)=>({start:0===t?0:r[t-1].value,end:e.value,color:e.color}))).find((e=>t>=e.start&&t<=e.end));return i&&i.color||"#666666"};function Pp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wp(e,t,r[t])}))}return e}function wp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sp=(0,l.replace)(new RegExp("^entities/"),""),Ip=e=>"DTSS/"+e.dataTenant+"/"+e.uri,Up=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),Cp=e=>!(!e||!e.dataTenant),jp=(0,l.ifElse)(Cp,Ip,(0,l.prop)("uri")),Lp=e=>e&&e.uri?e.dataTenant?Ip(e):Sp(e.uri):"",Dp=(0,l.curry)(((e,t,r)=>(si(t,r.type)||{})[e]||"")),kp=Dp("label"),xp=Dp("typeGraphIcon"),Fp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=si(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(qo)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:Tp(e,o,i),uri:a.uri}})).filter(l.identity):[]},Mp=(0,l.pipe)(Fp,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Vp=(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=Vp(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Vp(e.slice(1),r)}})),$p=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Gp=e=>(0,l.propOr)([],"matchRules",e),Wp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?Pp({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Yp=(e,t,r)=>t&&r?r.aEntity:e,Bp=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 cl(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),Yt)(p)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},qp=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 cl(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),Yt)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Kp=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return cl("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},Hp=(e,t,r)=>Promise.all(t.map((async t=>{await cl(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})}))),Jp=async(e,t)=>await Hp(e,t,"NOT"),Qp=async(e,t)=>await Hp(e,t,"MATCH"),Xp=async(e,t)=>await Promise.all(t.map((async t=>{await cl(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})})));function zp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zp(e,t,r[t])}))}return e}function Zp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ed(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 td=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return cl(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},rd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return gd({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},nd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return gd({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 cl(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},ad=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})})))},od=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(Cp,i);return Promise.all([s.length?Kp(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})}))])},sd=(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=ed(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)}),[])),ld=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),sd),ud=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return cl(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(ld)},cd=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)},pd=cd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return cl(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(ld)})),dd=cd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return cl(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),yd=(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)}},fd=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return cl(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},Td=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 fd(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},Ed=Td("NOT"),md=Td("MATCH"),hd=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(Cp,a);return Promise.all([Hp(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return fd(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},bd=hd("NOT"),Od=hd("MATCH");function gd(e){let{requestProvider:t=cl,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}`,zp({},ed(s,["headers"]),{headers:zp({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const vd=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return gd({url:Gu(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},_d=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return gd({url:ku(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},Nd=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a}=e;const{options:o}=Tc(t,r);return gd({url:`entities/_connections/_getConnections?dataEntityUri=${t}`,options:o,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(Ec,(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)))}))))},Ad=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return gd({url:`${Ju(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},Rd=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return cl(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},Pd=()=>cl("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET",headers:{"Content-Type":"application/json"}});function wd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sd(e,t,r[t])}))}return e}function Sd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Id=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=wd({},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 cl(`${t}/api/${r}/graph/search${Bt({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},Ud=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return cl(`${t}/api/${r}/graph/search/count`,{method:"POST",body:wd({},n,i),headers:{"Content-Type":"application/json"}})},Cd=(e,t)=>`${e}/${t}/comments`,jd=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return cl(`${Cd(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Ld=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return cl(`${Cd(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Dd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return cl(Cd(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},kd=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return cl(`${Cd(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},xd=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return cl(`${Cd(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Fd=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return cl(`${Cd(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Md=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=Bt({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return cl(`${Cd(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Vd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$d(e,t,r[t])}))}return e}function $d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gd=(e,t)=>{const[r]=e.split("/ui/");return`${r}/services${t.startsWith("/")?t:`/${t}`}`},Wd=(e,t)=>{const r=Yt({url:"/oauth/users/tenant/{0}",params:e});return cl(Gd(t,`oauth/proxy${r}`),{method:"GET",headers:{"Content-Type":"application/json"}})},Yd=async(e,t,r,n,i)=>{const a=Gd(e,`/configService?tenant=${t}&environment=${r}&namespace=graphExport`);let o;try{const{data:e={}}=await cl(a,{method:"GET",headers:{"Content-Type":"application/json"}});o=e}catch(e){o={}}const s={body:JSON.stringify(Vd({},o,{[n]:i})),headers:{"Content-Type":"application/json"}};let l;try{l=await cl(a,Vd({method:"PUT"},s))}catch(e){l=null}return l||(l=await cl(a,Vd({method:"POST"},s))),l},Bd=(e,t)=>cl(Gd(e,`/settings?key=${t}`),{method:"GET",headers:{"Content-Type":"application/json"}}),qd=e=>cl(Gd(e,"/version/collect"),{method:"POST",headers:{"Content-Type":"application/json"}}),Kd=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return cl(`${n}/plugins${Bt({tenant:t,user:r})}`,{method:"GET"})},Hd=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),cl(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Jd=e=>cl(`/${e}?showObjectsInfo=true`,{method:"GET"}),Qd=e=>{let{exportPath:t,options:r}=e;return cl(`${t}/activities${Bt(r)}`,{method:"POST"})};function Xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zd(e,t,r[t])}))}return e}function zd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zd=e=>{const{entityUri:t}=e;return cl(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},ey=e=>{let{entityUri:t,crosswalk:r}=e;return cl(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},ty=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return cl("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Xd({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Xd({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},ry=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return cl(`/${r}/_${n}${Bt({contributorURI:t})}`,{method:"POST"})},ny=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return cl(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},iy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return cl(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},ay=e=>{let{entityUri:t,crosswalkId:r}=e;return cl(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},oy=e=>{let{entityTypeUri:t}=e;return cl(`/dataQuality/fillRates${Yt({entityType:tt(t)})}`,{method:"GET"})},sy=e=>{let{entityTypeUri:t,attributeFieldName:r}=e;return cl(`/dataQuality/statistic${Yt({entityType:tt(t),attribute:r})}`,{method:"GET"})},ly=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n}=e;return cl(`${t}/api/${r}/dataValidationFunctions/entityTypes/${tt(n)}`,{method:"GET"})},uy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return cl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},cy=e=>{let{attributeUri:t,value:r}=e;return cl(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},py=e=>{let{attributeUri:t,value:r}=e;return cl(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},dy=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return cl(`/${t}${Bt({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},yy=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=Bt({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=Is()([[{value:a}]]);return cl(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},fy=e=>{let{entityUri:t,attributeName:r,value:n}=e;return cl(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},Ty=e=>{let{entityUri:t,attributeName:r}=e;return cl(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function Ey(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const my=e=>{let{entityUri:t}=e;return cl(`/${t}/_historicURIs`,{method:"GET"})},hy=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 cl(`/${t}/_changesWithTotal${Bt(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){Ey(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},by=(e,t)=>cl(`/${e}/_previousChange${Bt({timestamp:t})}`,{method:"GET"}),Oy=(e,t)=>cl(`/${e}${Bt({time:t})}`,{method:"GET"});function gy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vy(e,t,r[t])}))}return e}function vy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _y=e=>{let{url:t,method:r,data:n,headers:i}=e;return cl(t,gy({method:r||"GET"},n?{body:JSON.stringify(n)}:{},{headers:gy({"Content-Type":"application/json"},null!=i?i:{})}))},Ny=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=Bt({options:a.join(","),severity:o.join(",")});return cl(`${t}/validate/${i}/entity/${Lp({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Ay=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return cl(`${t}/validate/${n}/entity${Bt({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})};var Ry=r(47485);const Py=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=qe(),s={attributes:bs({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=ss(r,e,n.uri)[0];return i&&i.value?Ns({entity:e,attributeType:n,uri:i.uri,value:t}):vs({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},wy=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(rs),(0,l.filter)(Be),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))(t.attributes||{}),Sy=(0,l.curry)(((e,t)=>{const r=wy(e=e||{},t=t||{});return r.concat((0,l.chain)(Sy(e),r))})),Iy=(0,l.curry)(((e,t)=>(0,l.pipe)(ue,(0,l.filter)(e))(t))),Uy=Iy((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Cy=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Be)),jy=e=>(0,l.pipe)(Uy,Cy(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Ly=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Uy,(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})),Dy=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Be),(0,l.omit)(["uri","timestamp"])),ky=(0,l.pipe)(Dy,(0,l.evolve)({attributes:Is(!0)})),xy=async(e,t,r,n)=>{const i=e[t];if(!i)return null;const a=jy(i);if(a.length>0)for(const t of a)e=Ly(t,r[t].uri,e);const o=(s=await Xu(ky(e[t]),null==n?void 0:n.enhanceUriWithDCR),(0,l.pathOr)(s,[0,"object"],s));var s;return null==n||n.updateDCRUriFromResponse(o),o},Fy=async(e,t,r)=>{const n=Vy(e,t),i={};for(const t of n)i[t]=await xy(e,t,i,r);return i},My=(0,l.curry)(((e,t)=>{const r=Ry.Node(t);return jy(e[t]).forEach((t=>{const n=My(e,t);r.addEdge(n)})),r})),Vy=(e,t)=>(0,l.pipe)((0,l.map)(My(e)),(0,l.map)(Ry.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),$y=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(Dy))})),Gy=(e,t)=>{const r=_e(e.tags||[],t.tags||[]),n=Ne(e.roles||[],t.roles||[]),i=be(e,t),a=Oe(e,t);return[...ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),ve((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks))),...r,...n,...i,...a]},Wy=(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 Ly(r,n,e)}),e))))}),t)}),$y),Yy=(0,l.curry)(((e,t)=>(0,l.when)(Be,(0,l.propOr)(l.__,t,e),t)));function By(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qy(e,t,r[t])}))}return e}function qy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ky=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:yr.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},Hy=e=>{let{relationUri:t}=e;return{type:yr.DELETE_RELATION,parameters:{relationUri:t}}},Jy=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:yr.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},Qy=e=>{let{oldRelation:t,newRelation:r}=e;return{type:yr.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},Xy=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:yr.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},zy=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),Zy=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case yr.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return gc({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case yr.DELETE_RELATION:return()=>{const{relationUri:e}=r;return Oc(e,i).then(o)};case yr.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return Ac(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case yr.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return vc({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case yr.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[Hy({relationUri:o}),Ky({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(ef(n)),(0,l.map)(Zy),zy)(s)}}},ef=e=>t=>By({dcrProcessor:e},t),tf=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=qt({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(ef(r)),(0,l.map)(Zy),zy,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},rf=e=>t=>(0,l.map)((t=>By({},t,{parameters:(0,l.evolve)({parentUri:Yy(e),entityUri:Yy(e),newEntityUri:Yy(e)},t.parameters)})),t);function nf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const af=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){nf(e,t,r[t])}))}return e}({},(0,l.path)(ff(),e),{startDate:(0,l.path)(hf(),e),endDate:(0,l.path)(bf(),e)}),of=(e,t)=>(0,l.pipe)((0,l.path)(mf()),Yy(t))(e),sf=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=of(e,r),i=(0,l.path)(Tf(),e)===fr.IN,a=e.parentEntityUri||n;return Ky({parentUri:i?t:a,relation:af(e),entityUri:i?a:t})})),...o.map((t=>{const i=of(t,r),a=(0,l.path)(Tf(),t),o=i!==(0,l.pipe)((0,l.path)(ff()),a===fr.IN?Of:gf)(t),s=Nf(e,(0,l.path)(df(),t));return o?Xy({entityUri:t.parentEntityUri||n,newEntityUri:Yy(r,i),relation:(0,l.path)(ff(),t),isReversed:!1}):Qy({oldRelation:(0,l.path)(ff(),s),newRelation:af(t)})})),...i.map((e=>Hy({relationUri:e}))),...s.map((e=>Jy({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},lf=(e,t)=>(0,l.pipe)(Ti,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Us),Sa)(e,t),uf=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)}},cf=(e,t,r)=>{const n=pp(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)},pf="relation",df=(0,l.always)([pf,"relationUri"]),yf=(0,l.always)([pf,"relationType"]),ff=(0,l.always)([pf,"object"]),Tf=(0,l.always)([pf,"direction"]),Ef=(0,l.always)([pf,"object","attributes"]),mf=(0,l.always)(["entity","entityUri"]),hf=(0,l.always)([pf,"startDate"]),bf=(0,l.always)([pf,"endDate"]),Of=(0,l.path)(["startObject","objectURI"]),gf=(0,l.path)(["endObject","objectURI"]),vf=(0,l.path)(["startObject","objectTypeURI"]),_f=(0,l.path)(["endObject","objectTypeURI"]),Nf=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(df()),(0,l.equals)(t))(r))return r;if(r.connections){const e=Nf(r.connections,t);if(e)return e}}},Af=(0,l.pipe)(Nf,(0,l.path)(ff())),Rf=(0,l.allPass)([(0,l.pipe)((0,l.path)(mf()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(yf()),(0,l.complement)(E))]),Pf=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:Ke()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=If({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=wf(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?uf(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},wf=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:Rt.IN}:{type:t[0],direction:Rt.OUT}:null},Sf=e=>e.uri||e,If=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Ri(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Rt.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"],si(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],si(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(Sf,Ti(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Rt.OUT)),(0,l.map)(u))},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 jf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Uf({},t,{[r]:{parents:n,children:i}})},Lf=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return Uf({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},Df=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=wy(t,i),o=jf({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>Df(n.uri,t,[e],r)),o)},kf=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)(df(),n),a=t?Lf({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(mf(),n),s=Be(o)?[o]:[],u=jf({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>Df(t,r,[i],e)),u)}),n)},xf=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return kf(r,e,t,Df(e,t))},Ff=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return xf(t,r,n);if(Je(e)){const t=Nf(n,e);return t&&kf([t],null,r)}return r[e]?Df(e,r):void 0},Mf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>Mf(e,t))))},Vf=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>Vf(e,t))))},$f=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=He(t),u=xf(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=Nf(i,c),!s)return null;o.push({type:rr.relationConnection,value:s,valueType:Ti(a,(0,l.path)(yf(),s))});continue}if(Je(u)){const e=n[c];if(!e)return null;o.push({type:rr.tempEntity,value:e,valueType:si(a,e.type)});continue}const p=n[u],d=Ts(p,c),y=n[c];if(!d||!y)return null;o.push({type:rr.attributeValue,value:d,valueType:Wn(a,it(d.uri,p.type))}),o.push({type:rr.tempEntity,value:y,valueType:si(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},Vf(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=Je(s),d=p?Af(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?Ti(a,d.type):si(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:Yn(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,g;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===(g=O[E.name])||void 0===g?void 0:g.find(t),s=i||r;if(!s)return null;i&&o.push({type:rr.tempEntity,value:T,valueType:si(a,T.type)}),o.push({type:rr.attributeValue,value:s,valueType:E}),m=s.value;const l=rs(s);T=l&&Be(l)?n[l]:null}}return o},Gf=e=>e.every((e=>{let{type:t}=e;return[rr.attributeValue,rr.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===rr.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,Wf=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?Wf(t.value):[]];return e.concat(r)}),[])),Yf=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,Bf=e=>{const t=[...Wf((null==e?void 0:e.attributes)||[]),...Wf((null==e?void 0:e.analyticsAttributes)||[])];return e?[e.uri,...t]:[]},qf=(e,t)=>[e,...t.map((t=>Yf(e,t)))],Kf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return t.relationUri}))},Hf=(e,t)=>{switch(e){case nr.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case nr.ENTITY_ATTRIBUTE:return(e=>{let{uri:t}=e;return[at(t)]})(t);case nr.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case nr.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n}}}=e;return[t,n,r]})(t)}},Jf=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),Qf=(0,l.curry)(((e,t)=>{const r=mo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(Qf(e,r.extendsTypeURI)):n})),Xf=(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))),zf=(e,t)=>(0,l.pipe)((0,l.prop)("type"),Qf(e),Xf(t))(t);function Zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eT=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}},tT=e=>!e.deactivated,rT=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},nT=e=>rT(e)+e.message,iT=(0,l.unless)(l.isNil,(0,l.prop)("message")),aT=(0,l.unless)(l.isNil,(0,l.prop)("type")),oT=(0,l.curry)(((e,t)=>Ze(t.parentUri,e))),sT=(0,l.curry)(((e,t)=>t.parentUri===e)),lT=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),Ze(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",vt.TYPE_REFERENCE),(0,l.pipe)(Tn,(0,l.any)(Ze(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),uT=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),cT=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),pT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([bT,tT,oT(e),lT(t),(0,l.complement)(cT(e,t.uri))]))(r)},dT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([bT,tT,sT(e),uT(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",zt.missed))]))(r);return n&&n.message||""},yT=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===zt.missed))},fT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([tT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(df(),e))]))(t)},TT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([tT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ET=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([tT,oT(t)]))(r)},mT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([tT,(0,l.propEq)("type",zt.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},hT=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?$f(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 rr.attributeValue:{const e=a;if(jn(a))return pp(o,e.dataLabelPattern);if(Ln(a)){const t=o,i=rs(t),a=yn(e),s=si(n,a);return Be(i)?pp(r[i],s.dataLabelPattern):t.label}return""}case rr.tempEntity:return pp(o,a.dataLabelPattern);case rr.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=si(n,null==e?void 0:e.entityType);return`${yp(i&&Be(i)?pp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||Ei(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){Zf(e,t,r[t])}))}return e}({},e,{label:yp(t)})}))},bT=e=>!e.severity||e.severity===er.ERROR,OT=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case vt.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(OT(n))}));case vt.TYPE_REFERENCE:return!!Jo(t);case vt.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),gT=(e,t)=>e.every((0,l.complement)(OT(t))),vT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=go(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=ss(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!qo(e.parent))))).forEach((e=>{gT(e.attrValues,n)&&r.push(eT({type:zt.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:wt().text("Attribute is required"),source:Zt.local}))})),r}),[])},_T=(0,l.curry)(((e,t,r)=>ss(e,t,r,!1))),NT=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),si(e),(0,l.prop)("attributes"),(0,l.reject)(Un),(0,l.filter)(Ln),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(_T(e,t)));return(0,l.pipe)(r,(0,l.reject)(rs),(0,l.map)((e=>{let{uri:r}=e;return eT({type:zt.missedRefEntity,uri:"",attributeTypeUri:it(r,t.type),parentUri:r,message:wt().text("Entity is required"),source:Zt.local})})))(t)},AT=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(rs,Be)).flatMap((n=>{const i=rs(n),a=t[i],o=Wn(e,it(n.uri,r.type));return RT(e,t,o,a)})),RT=(e,t,r,n)=>{const i=Tn(r),a=i.map((t=>Wn(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",vt.TYPE_REFERENCE))).flatMap(mn).concat(i);return PT(e,t,n,(e=>a.some(Ze(e.uri))))},PT=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=vT(e,r,n),a=NT(e,r),o=AT(e,t,r);return[...i,...a,...o]},wT=(e,t)=>{const r=(0,l.path)(ff(),t)||{};return vT(e,r)},ST=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(mf()),(0,l.ifElse)(Be,(e=>t[e]),(0,l.always)(null)))(r),i=wT(e,r),a=(e=>(0,l.path)(mf(),e)?[]:[eT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(yf(),e),parentUri:(0,l.path)(df(),e),message:wt().text("Entity is required"),source:Zt.local})])(r),o=((e,t,r)=>r?PT(e,t,r):[])(e,t,n);return[...i,...a,...o]},IT=e=>(0,l.path)(["entity","uri"],e)?[]:[eT({type:zt.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:wt().text("Entity is required"),source:Zt.local})],UT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=vT(e,r),i=IT(t);return[...n,...i]};function CT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jT=(e,t)=>{var r,n;const i=si(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||qa(e)},LT=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),DT=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(LT(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},kT=(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)(ns,Be,l.not)]),(e=>{const t=(0,l.pipe)(ns,tt)(e);return DT((e=>e.replace(t,t+Ve)))(e)})),(0,l.when)((0,l.pipe)(rs,Be),(t=>{const r=rs(t),n=e[r],i=n&&FT(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){CT(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),xT=(e,t,r)=>ge(he((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),ve((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)(kT(r,e.type)),(0,l.map)(DT(ut))))})(e))),FT=(e,t)=>(0,l.evolve)({attributes:ws({valueTransformer:(0,l.pipe)(os,kT(t),LT(ut)),deleteEmptyComplex:!0}),uri:ut})(e);function MT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VT(e,t,r[t])}))}return e}function VT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $T=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(Me,"g"),"uri$$$$").replace(new RegExp(Ve,"g"),""))),GT=e=>(0,l.pipe)((0,l.evolve)({objectUri:$T,objectParentUri:$T}),(e=>{return MT({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?zt.missed:zt.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&lt(e.objectUri),uri:e.objectUri,source:Zt.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),WT=(e,t)=>(0,l.map)((0,l.pipe)(GT,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=hT(t,s),p=null!=c&&c.length?c.slice(0,-1):hT(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&Wn(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===rr.attributeValue&&(a=e.valueType)}return a})(o,c,e);return MT({},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&&st(i)){const n=(0,l.last)(a),i=n.valueType;if(Ln(i)&&hn(i).includes(o)){const i=rs(n.value),o=i&&Be(i)?t[i]:null;return o?MT({},e,{parentUri:o.uri,path:a.concat({type:rr.tempEntity,value:o,valueType:si(r,o.type),label:""})}):e}}return e}})(t)))(e),YT=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 BT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qT;!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(qT||(qT={}));const KT={},HT={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"]}},JT=(0,l.curry)(((e,t)=>{const r=(e=>{if(!KT[e]){const t=HT[e]||HT.random0;KT[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){BT(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return KT[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]})),QT=e=>JT(qT.Charts,e);var XT=r(51404),zT=r.n(XT);const ZT=Array.from({length:100},((e,t)=>t/100)),eE=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)},tE={},rE=new(zT())({hash:eE,saturation:ZT.slice(15,71),lightness:ZT.slice(50,90)}),nE=(0,l.curry)(((e,t)=>{const[r,n,i]=e,[a,o,s]=t;return(Math.abs(r-a)<=27||(r+27>=360||a+27>=360)&&Math.abs(r-a-360)<=27)&&Math.abs(n-o)<=.3&&Math.abs(i-s)<=.2})),iE=(0,l.curry)(((e,t,r)=>{t in tE||(tE[t]={});const n=tE[t];r in n||(n[r]=((e,t,r)=>{const n=Object.values(t);let i;for(let t=0,a=r;t<35&&(i=e.hsl(a),n.some(nE(i)));t++,a=String(eE(a)));return i})(e,n,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),aE=iE(rE,"crosswalks"),oE=iE(rE,"sources"),sE=iE(rE,"contributors");function lE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uE(e,t,r[t])}))}return e}function uE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cE=(0,l.has)("items"),pE=e=>0===e,dE=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)},yE=e=>e.reduce(((e,t)=>e+t.width),0),fE=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),TE=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),EE=e=>e.reduce(((e,t)=>e+t.height),0),mE=e=>(0,l.is)(String,e)&&e.includes("%"),hE=e=>Boolean(e.spacer),bE=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),OE=e=>e.items.reduce(((e,t)=>e.concat(cE(t)?OE(t):t)),[]),gE=e=>({id:e.layout}),vE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:gE;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=mE(r.width)?bE(i,r.width):u}return dE(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return dE(n,t,r)},o=(e,t)=>cE(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,cE(s)?n(s.layout):e(s.view)),d=pE(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(cE(s))return o.concat(p(lE({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(lE({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:yE(o),height:fE(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=cE(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=pE(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(cE(i))return r.concat(p(lE({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(lE({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?dE(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?dE(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:TE(i),height:EE(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=pE(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return lE({},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=lE({},e,{width:a}),s=lE({},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(lE({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return lE({},e,{height:EE(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(lE({},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 lE({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=lE({},t,{items:(0,l.reject)(hE,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 OE(f)},_E=(e,t)=>e.filter((e=>t.some((t=>t.id===e.id))));function NE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){AE(e,t,r[t])}))}return e}function AE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RE={BarChart:Er.BAR,BarChartGrouped:Er.BAR,BarChartHorizontal:Er.BAR,LineChart:Er.LINE,Map:Er.MAP,Pie:Er.PIE},PE=(e,t)=>ot(e)?rt(e,t):e,wE=e=>e&&re(e).map((e=>{const{type:t,value:r}=e;return NE({},e,{value:[Et,mt,ct.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:bt(t),fieldName:r,values:n?re(n):void 0}})),SE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=RE[r];return NE({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},IE=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return NE({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"]))},UE=(e,t)=>{const r=wE(e);return t?(r||[]).concat((n=t,{filter:ct.EQUALS,fieldName:"type",values:[n]})):r;var n},CE=["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"],jE={"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:PE(n,r),filters:wE(a),chartType:Er.BAR,component:mr.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:PE(n,r),filters:wE(a),chartType:Er.BUBBLE,component:mr.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:mr.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=re(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return NE({id:t,count:o,canRead:u,orderType:s,attributeUri:PE(r,p),filters:wE(a),component:mr.DashboardFacet,title:i,showOthers:!0},SE(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:PE(n,r),filters:wE(a),chartType:Er.MAP,component:mr.DashboardFacet,title:i,geoUrl:CE[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 NE({id:t,count:o,canRead:l,attributeUri:PE(n,r),filters:wE(a),component:mr.DashboardFacet,title:i,geoUrl:s,chartType:Er.MAP,projection:"geoMercator"},SE(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.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:IE(i),component:mr.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:UE(n,a),component:mr.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:ct.GTE,fieldName:"matches",values:["1"]}],component:mr.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:mr.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:Er.CLOUD,component:mr.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:Er.TREE,component:mr.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.NotificationInboxFacet,title:n||wt().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:mr.ActivitiesViewFacet,title:n||wt().text("Activity log")}}},LE=e=>({id:e,height:10}),DE=(0,l.pipe)((0,l.map)((e=>{const t=jE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),kE=e=>{if("0.1"===e.version){const t=DE(e.views),r=vE(LE,e.layout,{columns:4});return{id:e.id,margin:0,layout:_E(r,t),views:t}}return e},xE=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"),re)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>xE(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function FE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ME(e,t,r[t])}))}return e}function ME(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VE=FE({},hr,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),$E=e=>e,GE={[VE.Attributes]:$E,[VE.HierarchyTree]:$E,[VE.HierarchyPaths]:$E,[VE.RelationsTable]:$E,[VE.Relations]:e=>FE({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[VE.SingleAttributeView]:$E,[VE.CustomView]:$E,[VE.TableAttributeView]:$E,[VE.MapView]:$E,[VE.OldTreeView]:e=>FE({},e,{class:hr.HierarchyTree}),[VE.OldMapView]:e=>FE({},e,{class:hr.MapView}),[VE.ImageAttributeView]:$E,[VE.PotentialMatchesView]:$E},WE=(0,l.pipe)((0,l.map)((e=>{const t=GE[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),YE=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===hr.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),BE=e=>{if("0.1"===e.version){const t=WE(e.views),r=vE(YE(t),e.layout,{columns:4});return{id:e.id,layout:_E(r,t),views:t,profileBand:e.profileBand,workflow:e.workflow,maxWidth:e.maxWidth}}return e},qE=(e,t)=>e.class===t||e["react-class"]===t,KE=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(qE(t,hr.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 qE(t,hr.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)}},HE=(e,t)=>e.filter((e=>t.some((t=>qE(e,t))))).map((e=>{let{id:t}=e;return t})),JE=(e,t)=>{let{extensions:r}=e;return r.find((e=>e.id===t))};function QE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){XE(e,t,r[t])}))}return e}function XE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zE=(e,t)=>xE(t).map((t=>(0,l.pipe)((0,l.map)((e=>JE(e,t))),(0,l.reject)(l.isNil),l.head)(e))),ZE=(e,t)=>{if("scroll"===t.layout.layout){const r=zE(e,t.layout),n=kE(QE({},t,{views:r,version:"0.1"}));return{class:"DashboardView",views:n.views,layout:n.layout}}return{class:"DashboardView",views:t.views,layout:t.layout}},em=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"DQDashboardView",viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},tm=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"RelationshipSearch",options:r.options,scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp}},rm=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"InteractionsView",sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},nm=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"RelationshipsView",canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},im=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"SourcesView",canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},am=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"PotentialMatchesView",availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},om=(e,t)=>{const r=zE(e,t.layout)[0];return{class:"SearchView",scoresToShow:r.scoresToShow,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead}},sm=()=>({class:"GraphView"}),lm=()=>({class:"ProfileActivityLogView"}),um=e=>t=>!!(0,l.intersection)(e,t).length,cm=(0,l.cond)([[um(["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"]),()=>ZE],[um(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>em],[um(["com.reltio.plugins.graph.GraphView"]),()=>sm],[um(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>tm],[um(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>rm],[um(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>nm],[um(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>im],[um(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>am],[um(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>om],[um(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>lm],[l.T,()=>(0,l.always)(void 0)]]),pm=(e,t)=>{const r=(e=>e.perspective?e.perspective:"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]?e.id:void 0)(e);if((0,l.isNil)(r))return;const n=(0,l.pipe)((0,l.map)((e=>JE(e,r))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(n))return;const i=xE(n.layout),a=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return t.filter((e=>i.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return n["entity-type"]?((e,t)=>{if("scroll"===t.layout.layout){const r=zE(e,t.layout),n=BE(QE({},t,{views:r,version:"0.1"}));return{class:"ProfileView",views:n.views,layout:n.layout}}return{class:"ProfileView",views:t.views,layout:t.layout}})(t,n):cm(a)(t,n)},dm=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))},ym=e=>(0,l.pipe)((0,l.chain)(dm),(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.map)((e=>({label:e.label,icon:e.icon,screen:pm(e,t)}))))(t))(t,e);return{label:t.label,icon:t.icon,menu:r.length?{type:"side",items:r}:void 0,screen:pm(t,e)}}));function fm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tm=e=>{let{extensions:t}=e;return t.filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Em=e=>({id:e,height:10}),mm=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)(Tm),(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=DE(((e,t)=>xE(t).map((t=>(0,l.pipe)((0,l.map)((e=>JE(e,t))),(0,l.pluck)("views"),l.flatten,l.head,(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){fm(e,t,r[t])}))}return e}({},e,{id:t})))(e))))(e,t.layout)),n=vE(Em,t.layout,{columns:4});return{views:r,layout:_E(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))},hm=e=>{const t=(e=>(0,l.pipe)((0,l.map)((e=>JE(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=>JE(e,"com.reltio.plugins.entity.RangeColors"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("colors"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>JE(e,"com.reltio.plugins.imageattribute.fieldsorder"))),(0,l.reject)(l.isNil),l.head,(0,l.omit)(["point","id"]))(e))(e),i=(e=>(0,l.pipe)((0,l.map)((e=>JE(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>JE(e,"com.reltio.plugins.entity.ValidationServiceLevels"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("levels"))(e))(e),o=(e=>(0,l.pipe)((0,l.map)((e=>JE(e,"com.reltio.plugins.entity.Validation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("validateReadMode"))(e))(e),s=(e=>(0,l.pipe)((0,l.map)((e=>JE(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:t}},general:{colors:r},image:{attributeFieldsOrder:n},lookups:{autocomplete:i},validate:{levels:a,validateReadMode:o}}},bm=e=>({layout:ym(e),pivoting:mm(e),properties:hm(e)});var Om=r(58697),gm=r.n(Om);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){_m(e,t,r[t])}))}return e}function _m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nm=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}_${gm()()}`;return n[e.id].push(t),i=!0,vm({},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]++,vm({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}},Am=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(Am(e))}))}))),t},Rm=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(Im,t),(0,l.propOr)([],"crosswalks",e))),e),Pm=(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(Pm(e))}))})),r},wm=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=wm(e);r>t&&(t=r)}))})),t+1):t},Sm=(e,t)=>{if(Be(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},Im=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},Um=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},Cm=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},jm=(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)},Lm=(0,l.eqBy)(Im),Dm=(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)(Qo,(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)))),km=(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=wt().number(t));return t})),xm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?wt().number(e,"0,0.0a").toUpperCase():wt().number(e,"0,0"):""},Fm=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last)),Mm=(e,t)=>t&&e!==t?`${t} (${e})`:e,Vm=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),$m=(e,t,r)=>{const n=Vm(e,t,r);return Mm(r,n)},Gm=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),Wm=(0,l.complement)(Gm),Ym=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),Bm=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)},qm=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(Wm(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),Km=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?B(i):"L",u=a?H(a):"L LTS";switch(n.type){case vt.TYPE_NUMBER:case vt.TYPE_FLOAT:case vt.TYPE_DOUBLE:case vt.TYPE_LONG:case vt.TYPE_INT:case vt.TYPE_COUNT:return t&&km(o,t);case vt.TYPE_BOOLEAN:case vt.TYPE_BOOLEAN_RADIO:case vt.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.isNil)(t)?t:se(t)?wt().text("yes"):wt().text("no");case vt.TYPE_DATE:return(0,l.is)(Number,t)&&(t=_(Number(t)).getTime()),t&&(Hl(t)?Jl(t):wt().date(t,s));case vt.TYPE_ACTIVENESS_DATE:case vt.TYPE_LOCAL_DATE:return t&&(Hl(t)?Jl(t):wt().date(t,s));case vt.TYPE_TIMESTAMP:return t&&(Hl(t)?Jl(t):wt().date(isNaN(t)?t:Number(t),u));case vt.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case vt.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)?Mm((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),Hm={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)",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)"},Jm=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()}},Qm=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})))),Xm=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.slice().reverse().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.slice().reverse().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),Jm,Qm);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}},zm="__metadata",Zm=(e=>{const t=[zm,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),eh=(0,l.set)(Zm),th=(0,l.view)(Zm),rh=eh(_t.NEW),nh=eh(_t.REMOVED),ih=eh(_t.EDITED),ah=eh(_t.IGNORED),oh=(0,l.pipe)(th,(0,l.equals)(_t.REMOVED)),sh=(0,l.pipe)(th,(0,l.equals)(_t.NEW)),lh=(0,l.pipe)(th,(0,l.equals)(_t.EDITED)),uh=(0,l.pipe)(th,(0,l.complement)(l.isNil)),ch=(0,l.pipe)(th,(0,l.equals)(_t.IGNORED)),ph=(0,l.omit)([zm]),dh=(e,t)=>e===zm?void 0:t;function yh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fh=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=fh(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},Th=(e,t)=>fh((0,l.propEq)("nodeId",t),e),Eh=(e,t)=>fh((0,l.pathEq)(["entity","uri"],t),e),mh=(e,t)=>{const r=Th(e,t);return r.length>1?r[r.length-2]:null},hh=(e,t)=>{const r=Th(e,t);return r.length>0?r[r.length-1]:null},bh=(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=>bh(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},Oh=()=>{},gh=(e,t)=>{let{parent:r,nodeProcessing:n=Oh}=t;n(e,r),e.children&&e.children.forEach((t=>gh(t,{parent:e,nodeProcessing:n})))},vh=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case lr.addingParent:return{entityUri:n?r.entity.uri:t.relatedEntity.uri,relation:r.relation,parentEntityUri:n?t.relatedEntity.uri:r.entity.uri};case lr.addingChild:return{entityUri:n?t.relatedEntity.uri:r.entity.uri,relation:r.relation,parentEntityUri:n?r.entity.uri:t.relatedEntity.uri};case lr.editing:{const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=t.entity.uri,a=r.entity.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){yh(e,t,r[t])}))}return e}({},e,i===a?{}:{entityUri:i,newEntityUri:a})}}},_h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;gh(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===lr.addingChild||r.editingMode===lr.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=vh({node:r,connection:n,isReversed:i}),s=Ky({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===lr.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=vh({node:r,isReversed:i,connection:n}),l=s?Xy({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):Qy({oldRelation:e,newRelation:a});t.push(l)}}})})),t},Nh={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},Ah={asc:"asc",desc:"desc"},Rh=Nh.entityLabel,Ph=Ah.asc,wh=(0,l.always)(0),Sh=e=>{let{sortField:t=Rh,sortOrder:r=Ph,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case Nh.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return Qg.strings.sort(t,a,o)})(n,r);case Nh.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return Qg.strings.sort(e,i,a)})(r);default:return wh}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},Ih=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(Ah)),l.identity,(0,l.always)(Ph))),Uh=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(Nh)),l.identity,(0,l.always)(Rh)));var Ch=r(91104);let jh;const Lh=(e,t)=>(jh||(jh=Ch.createClient({key:t})),new Promise((t=>{jh.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)}))}))),Dh=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},kh=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(qo).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[Dh(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(kh(e.value,t,r))),n})),xh=e=>e&&e.length>0,Fh=(e,t)=>[].concat(e&&e.attributes?kh(e.attributes,t):[]).filter(l.identity),Mh=(e,t,r,n,i)=>{if(e&&e.type){const t=(si(r,e.type).geoLocationAttributes||[]).map((t=>{return r=Fh(e,t.latitude),n=Fh(e,t.longitude),xh(r)&&xh(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(xh(t)&&t[0].value&&xh(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?Lh(n.label,i).catch((()=>null)):Promise.resolve(null)},Vh=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=>"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||si(e,t.type).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})))))))));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return Mh(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?Lh(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)))},$h=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=si(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(Wn(e,r.latitude,t.type)&&Wn(e,r.longitude,t.type)){const e=Fh(t,r.latitude),n=Fh(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))},Gh=(e,t,r)=>Promise.all([$h(e,t),Vh(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 Wh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yh(e,t,r[t])}))}return e}function Yh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bh=(e,t)=>t.values.map(oo(e,t.entityTypeUri)),qh=(e,t,r)=>Ms(t.fieldName,r)||Wn(e,rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Kh=(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?Mm(e,t):e}),r)},Hh=(0,l.path)(["attrType","label"]),Jh=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>Wh({},e,{[t]:!0})),{});e[r]=e[r]?Wh({},e[r],n):n}return e}),{}),Qh=(0,l.pipe)((0,l.prop)("values"),E),Xh=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",Vt.type.name)),zh=e=>e.type===tb.NUMERIC_RANGE_FACET,Zh=e=>e.type===tb.DATE_RANGE_FACET,eb=(0,l.either)(zh,Zh),tb={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},rb=e=>{switch(null==e?void 0:e.name){case Vt.type.name:return tb.ENTITY_TYPE_FACET;case Vt.createdBy.name:case Vt.updatedBy.name:case Vt.sourceSystems.name:case Vt.tags.name:case Vt.roles.name:case Vt.matchRules.name:case Vt.MLRecommendedMatch.name:return tb.WITH_DROPDOWN_CHECKBOXES_FACET;case Vt.createdTime.name:case Vt.updatedTime.name:case Vt.startDate.name:case Vt.endDate.name:return tb.DATE_RANGE_FACET;case Vt.matches.name:case Vt.matchScore.name:return tb.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return tb.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return tb.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return tb.DATE_RANGE_FACET;default:return tb.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},nb=(0,l.pipe)(qh,rb),ib=(0,l.pipe)((0,l.path)(["attrType","type"]),Zn),ab=(0,l.cond)([[zh,(0,l.always)(ct.IN_RANGE)],[Zh,(0,l.always)(ct.WITHIN)],[(0,l.allPass)([ib,e=>e.values.length>=2]),(0,l.always)(ct.EXISTS)],[l.T,(0,l.always)(ct.EQUALS)]]),ob=(0,l.cond)([[Zh,(0,l.prop)("values")],[zh,(0,l.prop)("values")],[ib,e=>1===e.values.length?e.values.map(se):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function sb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lb=(0,l.pipe)((0,l.path)(["attrType","type"]),Kn),ub=(0,l.pipe)((0,l.path)(["attrType","type"]),Qn),cb=(0,l.pipe)((0,l.prop)("attrType"),$s),pb=(0,l.pipe)((0,l.prop)("attrType"),Vs),db=e=>t=>t.values.map((t=>si(e,t).label)).join(" , "),yb=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),fb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(wt().number),yb)),(0,l.join)(","))(e.values);return`${Hh(e)}: ${t}`},Tb=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),yb)),(0,l.join)(","))(e.values);return`${Hh(e)}: ${t}`},Eb=e=>t=>`${Hh(t)}: ${Bh(e,t).join(", ")}`,mb=e=>t=>{const r=Kh(e,t);return`${Hh(t)}: ${r.join(", ")}`},hb=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[pb,db(e)],[ub,fb],[lb,Tb],[cb,Eb(e)],[l.T,mb(t)]]),r))),bb=(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){sb(e,t,r[t])}))}return e}({},t,{attrType:qh(e,t,n)}))),hb(e,r))(t),Ob=new RegExp(`^${wt().text("Search")}`),gb=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...bb(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Ob,"",u)]},vb=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Ot),_b=e=>(e=>vb.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]=Ql(t);return e.replace(r,i).replace(n,a)}),e))(e),Nb=(0,l.curry)(((e,t)=>`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`)),Ab={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Rb=e=>[Ab.geoPolygon,Ab.onMapMove].includes(e),Pb=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},wb=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Sb=(e,t)=>Rb(e)?t.map(Pb):[wb(t)],Ib=e=>Rb(e)?wt().text("Geo Polygon"):wt().text("Geo Location"),Ub=e=>{switch(e){case Ab.geoLocation:return"geoLocation";case Ab.geoPolygon:case Ab.onMapMove:return"geoPolygon"}},Cb={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},jb=e=>wt().text(e),Lb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[ct.EQUALS]:"=",[ct.NOT_EQUALS]:"≠",[ct.STARTS_WITH]:"*",[ct.MISSING_VALUE]:wt().text("missing value"),[ct.HAS_ALL]:wt().text("has all"),[ct.IN_RANGE]:wt().text("in range"),[ct.FULL_TEXT]:wt().text("full text"),[ct.EXISTS]:wt().text("exists"),[ct.COUNT_EQUALS]:`${wt().text("count")} =`,[ct.COUNT_NOT_EQUALS]:`${wt().text("count")} ≠`,[ct.COUNT_LT]:`${wt().text("count")} <`,[ct.COUNT_LTE]:`${wt().text("count")} <=`,[ct.COUNT_GT]:`${wt().text("count")} >`,[ct.COUNT_RANGE]:wt().text("count range"),[ct.LT]:"<",[ct.LTE]:"<=",[ct.GT]:">",[ct.GTE]:">=",[ct.IN_FILE]:wt().text("in file"),[ct.NOT_IN_FILE]:wt().text("not in file"),[ct.CONTAINS]:"~",[pt]:"=",[dt]:"≠",[yt]:"=",[ft]:"≠"}[e]||wt().text(e.toLowerCase())},Db=e=>({type:Cb.operator,text:e}),kb=e=>({type:Cb.operator,text:jb(e)}),xb=e=>({type:Cb.attributeLabel,text:e}),Fb=e=>({type:Cb.specialAttributeLabel,text:e}),Mb=e=>({type:Cb.attributeFilter,text:Lb(e)}),Vb=e=>({type:Cb.attributeValue,text:e}),$b=e=>({type:Cb.entityTypeLabel,text:e}),Gb=()=>({type:Cb.space,text:" "}),Wb=()=>({type:Cb.bracket,text:"("}),Yb=()=>({type:Cb.bracket,text:")"}),Bb=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),qb=(0,l.curry)(((e,t)=>t.map(Bb(e)))),Kb=(0,l.curry)(((e,t,r)=>[e,...r,t])),Hb=Kb(Wb(),Yb()),Jb=Kb(Gb(),Gb()),Qb=(0,l.curry)(((e,t)=>[e,...t])),Xb=e=>Qb($b(e)),zb=e=>Qb($b(`${e}: `)),Zb=e=>["and","and not"].includes(e),eO=e=>["or","or not"].includes(e),tO=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),eO)),rO=(nO=["and"],e=>e.slice(0,-1).every((e=>nO.includes(e.operator))));var nO;const iO=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=tO(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=Zb(s),a=eO(s);!r&&t&&n&&(i.push(Wb()),r=!0),i.push(o),r&&a&&(i.push(Yb()),r=!1);const l=e?kb(s):Db(s);i.push(...Jb([l]))}else i.push(o),r&&(i.push(Yb()),r=!1)}return i}},aO=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),oO=(0,l.pipe)(iO({localizable:!1}),aO),sO=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},lO=e=>{let{data:t,values:r,filter:n}=e;return t&&du({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},uO=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(lO)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),cO=(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)&&Mn(e.data.attrType)})(e)&&[ct.HAS_ALL,ct.EQUALS,ct.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:Fn((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})))),Bm),pO=(e,t)=>(0,l.pipe)(cO,qm(t))(e),dO=(0,l.pathEq)(["data","fieldName"],Vt.type.name),yO=(0,l.path)(["data","entityTypeUri"]),fO=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),TO=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Bo(e)),attributes:(0,l.filter)((0,l.pipe)(yO,(0,l.anyPass)([l.isNil,Bo(e),r=>{const n=(t.entityTypes||[]).filter(Bo(e));return(n.length>1?di(e,n):null)===r&&!!si(e,r)}])))})(t))))),EO=e=>(0,l.pipe)((0,l.prop)("filter"),Nl,(0,l.equals)(e)),mO=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Ms(n.fieldName)||n.attrType,s=ql(o,i),u=Km({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Mn(s),()=>(0,l.is)(Object,a)&&a.lookupCode?Mm(a.lookupCode,a.value):$m(r,Fn(o),a)],[()=>$s(s),()=>oo(e,n.entityTypeUri,a)],[()=>Gs(s),()=>So(e,a)],[()=>Hs(s),()=>Uo(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>Qn(c)||Zn(c)),Gl),Vb)()})),hO=(e,t,r,n)=>{const i=mO(e,t,r,n.data,n.filter);return(0,l.cond)([[EO(0),(0,l.always)([])],[(0,l.both)(EO(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[Gb(),i(r),{type:Cb.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[Gb(),...(0,l.pipe)(l.flatten,(0,l.map)(i),qb({type:Cb.punctuationMark,text:", "}))(t)]}]])(n)},bO=(e,t)=>{const r=!!Ms(e.data.fieldName);return(0,l.pipe)(sO,r?Fb:xb)(e,t)},OO=(e,t,r,n,i)=>[bO(n,i),Gb(),Mb(n.filter),...hO(e,t,r,n)],gO=(0,l.addIndex)(l.map),vO=(0,l.propEq)("length",1),_O=(0,l.propSatisfies)((0,l.lt)(1),"length"),NO=(0,l.complement)(l.isEmpty),AO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)((0,l.filter)(lO),(0,l.map)((n=>({operand:OO(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,iO()))(n)},RO=(0,l.pipe)(AO,l.flatten),PO=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>kp(e,{type:t}))).join(", ");return r?t(r):l.identity},u=AO(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(Xb),(0,l.pipe)(s(zb),(0,l.unless)((()=>vO(u)||i),Hb)))(u)},wO=(e,t,r,n)=>(0,l.pipe)((0,l.filter)(uO),gO(((n,i,a)=>({operand:PO(e,t,r,n,vO(a)),operator:n.operator}))),iO(),l.flatten)(n),SO=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),iO(),l.flatten),IO=e=>{let{searchType:t,values:[r]}=e;return Sb(t,r).join(", ")},UO=(e,t,r,n,i,a)=>{const o=(e=>e?[Fb(e.isRawFilter?wt().text("Raw filter"):wt().text("Search")),...Jb([Mb(ct.EQUALS)]),Vb(`"${e.value}"`)]:[])(i),s=(e=>e?[Fb(Ib(e.searchType)),Gb(),Vb(IO(e))]:[])(a),u=(0,l.pipe)(wO,(0,l.when)((e=>_O(e)&&(NO(o)||NO(s))),Hb))(e,t,r,n);return SO([o,s,u])},CO=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),jO=(0,l.pipe)(UO,CO),LO=(0,l.has)("attributes"),DO=Array.isArray,kO=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),xO=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=FO(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)(kO(a))),Hb),(0,l.concat)(Jb([Db(o)]))))(s)},FO=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return LO(n)?xO(e,t,r,n,i):DO(n)?n.reduce(((n,a)=>n.concat(FO(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(Jb([Db(n.operator)])))(OO(e,t,r,n,i))},MO=(e,t,r,n,i)=>(0,l.pipe)(FO,l.flatten)(e,t,r,n,i);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){$O(e,t,r[t])}))}return e}function $O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GO=(0,l.complement)(dO),WO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(dO),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(yO),(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}},YO=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=WO(t);return(r||n)&&rO(t)},BO=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(YO)),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(dO).some((0,l.propEq)("filter",ct.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}=WO(r);if(YO(e))t.push(VO({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(GO)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(dO,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(yO,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(GO),entityTypes:n,operator:i?a:e.operator,id:gm()()}}));t.push(...n)}var a;return t})(t))),[]))),qO={[ct.EQUALS]:ct.ON,[ct.IN_RANGE]:ct.WITHIN,[ct.GTE]:ct.AFTER,[ct.GT]:ct.AFTER,[ct.LTE]:ct.BEFORE,[ct.LT]:ct.BEFORE},KO=(0,l.curry)((e=>qO[e]||e)),HO=(0,l.curry)(((e,t)=>{switch(e){case ct.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case ct.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),JO=(0,l.pipe)((0,l.path)(["data","attrType","type"]),Kn),QO=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>VO({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return JO(e)?(0,l.evolve)({filter:KO,values:HO(t)},e):e}))})))})),XO=(0,l.curryN)(3,((e,t,r,n)=>(0,l.pipe)((0,l.defaultTo)([]),BO,TO(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")))})),QO,(0,l.reject)(fO))(r)));function zO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ZO(e,t,r[t])}))}return e}function ZO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eg=(e,t)=>({data:{uri:ot(e.fieldName)?rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||ab(e),id:gm()(),values:ob(e)}),tg=(0,l.curry)(((e,t,r)=>{const{uri:n,fieldName:i,entityTypeUri:a}=r,o=Ms(i,t)||Wn(e,n);if(!o)return null;if(Sn(o))return zO({},r,{attrType:o,title:o.label});{const t=o.label||o.name,n=kp(e,{type:a}),s=(Gn(e,rt(i,a),a)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return zO({},r,{attrType:o,title:t,pathToTitle:Array.isArray(s)?[n,...(0,l.chain)((0,l.prop)("label"),s),t]:[n,t]})}})),rg=(0,l.curry)(((e,t,r)=>XO(tg,e,r,t)));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=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},og=e=>"rdmLookups.not.resolved"===e?Vt.notResolved.name:e,sg=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===ht?ct.IN_RANGE:bt(a),u=og(n),c=Ms(u)||Wn(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=>ng({},e,{filename:Fm(e)}))))],[()=>Zn(null==c?void 0:c.type),(0,l.map)(se)],[e=>Rl(s)&&!Array.isArray(e[0])&&!Kn(null==c?void 0:c.type),ne],[l.T,l.identity]])(o);return{id:gm()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===ht?"and not":"and",filter:s,values:p}})),lg=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(sg(e,di(e,i)));return[{id:gm()(),operator:"or",attributes:a,entityTypes:i}]})),ug=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),cg=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([ug("from"),ug("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,()=>[]]]),pg=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return ng({},r,{values:cg(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ks(e.fieldName,n):e.fieldName})},dg=(e,t)=>{if((0,l.has)("children")(e)){const r=pg(e,t);return e.children.reduce(((e,n)=>(e.push(dg(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return pg(e,t)},yg=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(pg(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(ng({fieldName:e.fieldName},pg(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(dg,l.flatten)],[l.T,pg]]),fg=(0,l.pipe)((0,l.map)(yg),l.flatten),Tg=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},Eg=(e,t,r)=>{const{facets:n=[],advanced:i={},model:a}=r,[o]=lg(e,i),[s]=((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:fg(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>ng({},t,{type:nb(e,t)}))).map((e=>ng({},e,{values:eb(e)?Tg(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 eg(r,t)})),operator:"or",id:gm()(),entityTypes:i}]})(e,n),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[og(t)]:e[t]}))),l.mergeAll)(e)}(a),c=[ng({},s,{entityTypes:null!=u&&u.type?(0,l.uniq)([...s.entityTypes,...o.entityTypes]):[],attributes:[...s.attributes,...o.attributes].filter((e=>{let{data:{fieldName:t}}=e;return u[t]}))})];return rg(e,t,c)},mg=(e,t,r)=>{try{return"2.0"==r.version?((e,t,r)=>{const{advanced:n=[],facets:i={}}=r,a=n.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?n:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(Qh),(0,l.partition)(Xh))(t),i=n.map((t=>zO({},t,{type:nb(e,t)}))).map((e=>eg(e))),a=r.values||[];return[{attributes:i,operator:"or",id:gm()(),entityTypes:a}]})(e,i);return rg(e,t,a)})(e,t,r):Eg(e,t,r)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},hg=e=>"2.0"===e.version?e.keyword:ag(e),bg=e=>(0,l.pathEq)(["object","uri"],e),Og=(e,t)=>(0,l.pipe)((0,l.find)(bg(e)),(0,l.prop)("object"))(t),gg=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"),bg(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=Og(r.match,t)||n[r.match];return{label:yp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return ao(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)},vg=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),_g=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),Ng=(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:yp((0,l.prop)("label",a)),matchRules:i.map((function(t){return ao(e,a.type,t)||{label:t,uri:t}}))}})))(t),Ag=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)},Rg=(0,l.path)(["object","uri"]),Pg=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},wg=e=>e.getValue(),Sg=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Sg(n[e],t),!r);e++);return r},Ig=(e,t)=>{const r=[],n=(0,l.pipe)(wg,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(Ig,[t]),a);return r.push.apply(r,o),r};function Ug(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cg(e,t,r[t])}))}return e}function Cg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jg=(e,t)=>!!e[t],Lg=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},Dg=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||[]])},kg=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Ug({},t,{[r.uri]:Ug({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:Dg(null==o?void 0:o.parents,n),children:Dg(null==o?void 0:o.children,i),values:Dg(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},xg=e=>e.children?e.children.flatMap(xg):e,Fg=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=si(r,t)||Ti(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return xo(r,n,i).flatMap(xg).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>Wn(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=kg({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>kg({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},Mg=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Be(e.uri)&&Xe(e.type)&&Xe(t)&&!t.startsWith(e.type))(n,t))return e;const i=ss(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(qo),(0,l.map)(Lg))(i);return kg({structure:e,attrType:e[t].attrType,values:a})}),t)},Vg=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 jg(e,r)}));return r||n?t.filter(qo).reduce(((e,t)=>Vg({structure:e,attributeValue:t})),e):e}),t);{const e=r;return jg(t,e.type)?kg({structure:t,attrType:t[e.type].attrType,values:[Lg(e)]}):t}},$g=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Ug({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},Gg=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=ss(i,n,r)||[];return a.length?kg({structure:t,attrType:t[r].attrType,values:a.filter(qo).map(Lg)}):t},Wg=(e,t,r)=>{const n=He(e),i=He(t);return n===i?((e,t)=>{const r=lt(t),n=lt(e);return Ze(n,r)})(e,t):!(!r||!st(t))&&Mf(r,i).includes(n)},Yg=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},Bg=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?xf(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return Wg(r,t,o)}))},qg=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>qg(e,t,r)))))},Kg=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&Yg(n,e)}},Hg=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=He(n),c=Ff(u,o,i,a),p=qg("children",t,l),d=qg("parents",t,l),y=p.flatMap((e=>qg("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Wg(t,n,c)})).map((t=>Kg(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return Wg(n,t,c)||He(t)!==u&&Wg(t,n,c)})).map((t=>Kg(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=qg("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)&&Wg(n,t,c)}))})).map((t=>Kg(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return Wg(t,n,c)})).map((e=>Kg(r,n,e,s))),...T,...E,...f]},Jg={AttributesDiff:a,AttributesEditor:o,HistoryManager:s},Qg={Colors:r(29504),DependencyManager:r(47485),strings:n,dates:i}},29504:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},47485:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);