@reltio/remotes 1.4.1321 → 1.4.1323

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/2247.js CHANGED
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2247],{82389:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Is,IL3:()=>Np,PY2:()=>rn,Ng6:()=>Ne,YJ7:()=>Kr,NlI:()=>xr,Xt7:()=>Oe,wfT:()=>$n,EMD:()=>Sn,HAc:()=>ve,PEf:()=>ln,oA3:()=>Rn,$XE:()=>Ve,eWf:()=>on,q7e:()=>ge,KVe:()=>Vn,WVQ:()=>hr,oZZ:()=>Jn,bNA:()=>Xn,Rjq:()=>zn,G39:()=>cn,W0P:()=>Qe,X1H:()=>He,yn8:()=>Fe,N0y:()=>ke,dZX:()=>Ge,bQt:()=>ei,oS0:()=>Xe,lL_:()=>Br,oZt:()=>qr,Nsj:()=>Xr,psV:()=>Qr,xPW:()=>nn,pyR:()=>jn,p8l:()=>In,Wkf:()=>be,zHr:()=>he,NIO:()=>me,$26:()=>vv,Esk:()=>gn,s9T:()=>je,MEy:()=>fu,j5E:()=>Mr,vAw:()=>Pn,NMQ:()=>Nn,mNm:()=>Cn,s_5:()=>Dn,RgZ:()=>Un,unl:()=>Kn,Qy0:()=>Zn,pYu:()=>vn,wIJ:()=>Bv,GFH:()=>Re,Ury:()=>pn,S91:()=>dn,p3$:()=>ii,wSh:()=>Z,BDP:()=>fi,pGS:()=>Ln,ARY:()=>ze,XGc:()=>xn,fO_:()=>Nr,wwy:()=>Ue,h_8:()=>fn,_XL:()=>Jr,j2V:()=>Gn,dMV:()=>Fn,NBX:()=>Y_,OXy:()=>Ze,BXd:()=>Me,KM9:()=>Ae,CJB:()=>Bn,lXI:()=>Be,nqG:()=>ri,C68:()=>un,yxQ:()=>ti,Yj_:()=>Ce,D25:()=>we,ZIY:()=>We,Tl4:()=>zv,lwr:()=>sn,NkU:()=>Wn,Rtp:()=>Mn,YGx:()=>xe,uTS:()=>kn,MCv:()=>_e,IYE:()=>wn,PiC:()=>Qn,MVv:()=>Ke,h_m:()=>qe,tJI:()=>Pe,fDt:()=>Se,cNQ:()=>Yn,SwE:()=>_n,ZHR:()=>Hn,lD1:()=>yn,lVm:()=>$e,vnX:()=>qO,$x5:()=>HO,_R1:()=>YO,wUm:()=>BO,z7V:()=>ni,dC6:()=>De,MBD:()=>Ie,GmF:()=>qi,cKm:()=>Ye,iP_:()=>an,NVC:()=>Le,tPT:()=>nl,tZe:()=>Gp,kRE:()=>Ky,psB:()=>Jy,X0$:()=>rl,zE1:()=>yl,Wm5:()=>qs,vyX:()=>sc,wLZ:()=>il,W4V:()=>se,EtK:()=>ys,Wtd:()=>tl,asT:()=>nA,kGs:()=>UE,ewt:()=>UT,O_f:()=>su,sOy:()=>_t,Tde:()=>Xt,LMI:()=>Yu,skb:()=>Vg,sPt:()=>Du,sH1:()=>ku,RPM:()=>XE,h27:()=>ec,Uqd:()=>oc,xG:()=>e_,Z2f:()=>sO,fgW:()=>vg,I69:()=>qg,ZxB:()=>Qg,mdt:()=>qE,Qbq:()=>mE,rny:()=>wi,UEY:()=>ya,Q0T:()=>da,Lyr:()=>Oa,sBn:()=>pa,itK:()=>sa,H9$:()=>ca,KPc:()=>ua,zos:()=>la,ELQ:()=>va,dZs:()=>Xi,Cz4:()=>Ji,z_L:()=>ha,fGe:()=>Ki,iuF:()=>aa,Wib:()=>oa,Hn0:()=>ba,obS:()=>ga,E$L:()=>zi,XUh:()=>ia,Qp_:()=>ra,_jk:()=>Zi,sKE:()=>ea,WmG:()=>na,QKx:()=>Ea,Oik:()=>Ta,s0A:()=>ta,o9m:()=>fa,MCd:()=>ma,RsS:()=>tc,tGK:()=>kl,lIv:()=>fl,Vg3:()=>ki,mkC:()=>_i,xv5:()=>Mi,a14:()=>Ni,yv0:()=>Fi,Zm0:()=>Ai,Nxd:()=>gi,$mM:()=>Di,ifj:()=>Or,NWi:()=>PO,xr3:()=>NO,wNf:()=>ql,iJH:()=>RO,d89:()=>bi,Edd:()=>Oi,Z5t:()=>vi,uGe:()=>Ei,UoR:()=>Ti,xvW:()=>AO,$qe:()=>_O,yPM:()=>Qi,$cp:()=>dl,vKJ:()=>cl,VtG:()=>Dc,AID:()=>qf,B1H:()=>G_,b7X:()=>fE,$uE:()=>jE,keo:()=>EE,C_p:()=>jm,G27:()=>Mh,JA0:()=>My,b3T:()=>IE,oC6:()=>SE,_Zs:()=>wE,epC:()=>kE,YYG:()=>DE,f_2:()=>$y,w3l:()=>A_,QHB:()=>Fh,Jso:()=>U_,RXH:()=>gh,Vr9:()=>qh,lMm:()=>xb,BlA:()=>yA,fmQ:()=>as,yRD:()=>p_,NcL:()=>$m,QK6:()=>de,ymd:()=>Ap,JV_:()=>pf,XiW:()=>cT,Yrx:()=>Ny,GPx:()=>el,gjI:()=>Zs,vlo:()=>KT,E_P:()=>VE,aAL:()=>pp,NBq:()=>os,wp9:()=>BE,DsR:()=>ap,MPc:()=>Xf,gWE:()=>zf,DT_:()=>Zf,ipn:()=>tT,ORg:()=>pi,_wz:()=>eT,RYR:()=>PT,PP2:()=>Iy,wS7:()=>fO,cBQ:()=>Wc,pBq:()=>Uf,DsO:()=>ee,X78:()=>yf,xZs:()=>sf,YFy:()=>Ry,Gmt:()=>ef,K$w:()=>Zy,DSj:()=>dp,Mfr:()=>Sy,k9j:()=>Bc,ww$:()=>al,WVU:()=>zy,hxF:()=>Qs,E7G:()=>Id,nwO:()=>EA,Mzk:()=>Mc,aFF:()=>_E,HRH:()=>mu,EZK:()=>ed,Kxm:()=>Jp,Z9i:()=>Tm,CrF:()=>By,DNd:()=>Aa,vUy:()=>lA,lJh:()=>Ou,zHo:()=>vu,sEJ:()=>q_,UO$:()=>Ff,zeJ:()=>nr,dLR:()=>ms,JQy:()=>Rs,XtP:()=>Ts,Ug0:()=>Dr,A1W:()=>TE,sw:()=>Zp,nv3:()=>DO,JgD:()=>jO,nve:()=>H_,SkP:()=>Ss,SAs:()=>Lf,i5L:()=>ws,PWK:()=>_o,IM5:()=>Es,Mfk:()=>Yb,mB6:()=>cO,p6d:()=>w,o0x:()=>U,ufS:()=>Xb,k7L:()=>zb,mrB:()=>I,ncP:()=>mt,Zmi:()=>dt,hm5:()=>ft,ECL:()=>_r,vPL:()=>nd,qmL:()=>yE,hPi:()=>wf,hXd:()=>Ui,OCS:()=>Ci,p2l:()=>Cs,qF1:()=>Pp,_X$:()=>Rp,yj2:()=>Vv,bzh:()=>KE,k66:()=>Lo,kiP:()=>Qa,pSg:()=>ce,kz_:()=>jy,H_U:()=>Do,t9e:()=>Ua,j2$:()=>Wp,PFL:()=>$t,aJ3:()=>dv,To9:()=>zt,wpo:()=>_d,ADq:()=>cm,UUb:()=>lm,tQX:()=>um,xy8:()=>Yt,EUG:()=>ir,AFK:()=>wt,X3M:()=>rr,WN0:()=>jo,kDl:()=>hs,uDV:()=>dE,IhQ:()=>_s,pfb:()=>Ns,R$r:()=>$E,w80:()=>co,Pfu:()=>wa,Gtj:()=>Rl,fyF:()=>Pl,kkq:()=>Co,u5q:()=>ht,O$n:()=>vd,ptG:()=>gd,f4_:()=>Qm,uap:()=>Hm,d7q:()=>Ay,liG:()=>Uy,$oF:()=>_y,avf:()=>xT,DiQ:()=>MT,cfX:()=>FT,vD3:()=>VT,Qrb:()=>kT,EJQ:()=>$T,HWy:()=>DT,gjS:()=>wT,y6v:()=>jT,JUW:()=>Vy,GtP:()=>oh,_kX:()=>Pa,u1e:()=>Ra,sJj:()=>OE,CJp:()=>ih,uKF:()=>bE,wo0:()=>Qy,s5:()=>Po,cwx:()=>No,Y6b:()=>yy,TTx:()=>nf,UtR:()=>fy,HaQ:()=>af,E6I:()=>Yy,Won:()=>Ey,vTU:()=>py,Nsy:()=>pd,KMQ:()=>gE,Do$:()=>Td,CSV:()=>Ds,TMe:()=>Ty,l1V:()=>_u,VQ1:()=>wu,u5O:()=>Su,z7d:()=>JT,Xaq:()=>Mo,Sj8:()=>pA,PJj:()=>Ll,k3T:()=>Fr,PjQ:()=>yi,s7l:()=>Ic,jLA:()=>sh,GGR:()=>BT,j5q:()=>WT,DnY:()=>Rc,RY5:()=>oE,Px$:()=>RT,KPC:()=>x_,NIY:()=>kc,HvW:()=>Cc,Fof:()=>Ca,BTI:()=>md,uie:()=>od,ChB:()=>td,q27:()=>Nd,vrC:()=>ib,fAQ:()=>mf,XkT:()=>Pc,lrH:()=>hf,nt9:()=>Ir,XH8:()=>Od,XH2:()=>kr,jFi:()=>bd,qhs:()=>uo,wwR:()=>Ed,Uk3:()=>It,ev7:()=>W_,RB9:()=>Fy,iFp:()=>ZE,e$p:()=>tm,PcX:()=>rm,SpP:()=>em,R6_:()=>fv,CY1:()=>gv,Ajk:()=>gc,Yiz:()=>vc,FK9:()=>Tc,UOo:()=>Zb,aTW:()=>rf,uug:()=>Bl,P$2:()=>Nv,XS2:()=>Fl,Hyb:()=>nu,d3Y:()=>pc,Klp:()=>yc,WxZ:()=>Pv,Gzu:()=>gu,ZOr:()=>Nc,uqV:()=>ly,Pm4:()=>re,hWO:()=>Pt,nHA:()=>Jm,nVD:()=>lE,dED:()=>vy,P2h:()=>Oy,jrr:()=>Ya,mmY:()=>qa,T6O:()=>ko,h6J:()=>xp,hM2:()=>j_,XR6:()=>X,jmz:()=>pE,IHt:()=>cE,NZI:()=>fm,wdF:()=>Tf,kgP:()=>Ef,ZYI:()=>Op,QXK:()=>gl,efz:()=>_l,Q5d:()=>vl,Ysv:()=>Al,UWq:()=>ZT,ocC:()=>zT,io3:()=>Lr,Sbt:()=>yo,roS:()=>po,Ww1:()=>fo,QaS:()=>xc,ERZ:()=>g_,CL1:()=>D_,idV:()=>zp,nIW:()=>Nt,fjE:()=>Tv,sG0:()=>rO,tV7:()=>jl,g8o:()=>Jv,Qy:()=>Kv,t2P:()=>pv,KbW:()=>Za,wId:()=>to,LS0:()=>ro,bFH:()=>Kd,Rgl:()=>Xd,fW1:()=>Vm,GFW:()=>of,Ywp:()=>$O,pg:()=>Cd,WSA:()=>zd,fed:()=>C_,tT_:()=>As,BgZ:()=>Ps,KbL:()=>wc,JBA:()=>jt,aNC:()=>LO,RFJ:()=>bp,Zeh:()=>kf,OT5:()=>xO,mC3:()=>El,kR6:()=>dA,NVY:()=>WE,k6v:()=>Sp,FEC:()=>wp,Ob5:()=>Pd,KUV:()=>Rd,dvH:()=>GE,V3i:()=>Kh,VD3:()=>jr,mm2:()=>Ru,rou:()=>Nf,izH:()=>Sa,DK$:()=>Ia,KMp:()=>cp,c31:()=>rt,mbo:()=>dm,gT8:()=>at,CZ8:()=>ns,uGi:()=>us,Poc:()=>et,_9k:()=>ds,ZTM:()=>ss,bwT:()=>cs,tzW:()=>st,tF$:()=>it,o96:()=>is,M4S:()=>ps,_vs:()=>np,xF8:()=>IT,HQx:()=>AE,ATu:()=>pm,j1S:()=>ui,V3K:()=>si,Lmx:()=>li,ZaZ:()=>tt,n_1:()=>cy,N6e:()=>sp,SxO:()=>Ba,w3p:()=>YE,xU7:()=>pe,Y_p:()=>mo,$k6:()=>Eo,Gdl:()=>iO,U6P:()=>nO,OwB:()=>yv,hTh:()=>uE,xqc:()=>Ro,JvE:()=>So,i29:()=>Ku,dzT:()=>Ri,uPS:()=>Gc,cZV:()=>Vc,n3B:()=>Sg,e6O:()=>gg,s7j:()=>Yv,j$Q:()=>Gy,kW2:()=>ah,tH7:()=>Ao,Yxg:()=>$s,MaZ:()=>YT,nqN:()=>GT,jWj:()=>tE,o_J:()=>xo,hgZ:()=>rd,yW4:()=>$p,uT0:()=>Fp,C82:()=>Mp,bsH:()=>Km,u9Z:()=>Af,J$m:()=>uy,j_Q:()=>mc,OaI:()=>hc,wB1:()=>V_,SP6:()=>Ud,ZYr:()=>M_,IMU:()=>hp,FoU:()=>xy,DVz:()=>uO,mxe:()=>Pg,FHr:()=>jf,D1g:()=>Pf,VO3:()=>XO,de5:()=>JO,Uw1:()=>Te,J6q:()=>ym,XCe:()=>Va,fbl:()=>VO,Ir:()=>Xa,XQO:()=>za,QXb:()=>Gd,P8_:()=>uf,iiD:()=>up,MOC:()=>Wd,WF:()=>Vd,xE1:()=>di,idW:()=>tA,QWZ:()=>Qb,YL3:()=>Fc,Fn9:()=>T,j2U:()=>Us,MpE:()=>lt,kQw:()=>Gt,mfm:()=>iu,vZp:()=>Ut,E8K:()=>J_,VSb:()=>ts,vr_:()=>Vt,Vmh:()=>sA,FgW:()=>Qh,oDv:()=>Vo,fGG:()=>Kb,kuw:()=>Wo,eHk:()=>eE,Tt2:()=>$o,oZ7:()=>Jb,T6Y:()=>yr,_26:()=>eu,YkM:()=>Jt,J6y:()=>$l,njU:()=>Ql,TBP:()=>Go,IT0:()=>Em,x_:()=>vE,biM:()=>yd,TMl:()=>fd,Vkd:()=>Xl,WiY:()=>bv,_zi:()=>zl,J6D:()=>Pu,Lt4:()=>sr,QEi:()=>er,whI:()=>Rr,KIu:()=>wr,JhM:()=>oe,C_0:()=>Er,lzc:()=>wd,qIF:()=>wg,O27:()=>E,aBi:()=>Ad,xOX:()=>Bs,EdS:()=>vt,WgC:()=>Ot,eEv:()=>Mt,A4t:()=>Kl,YOQ:()=>Lt,Wos:()=>pr,jWr:()=>_a,Or$:()=>Kt,lhE:()=>Cr,CwH:()=>Zt,pzC:()=>Gs,ymH:()=>Hl,QZu:()=>Ht,rYH:()=>hv,FVt:()=>cr,Kn2:()=>ue,jgw:()=>au,Qgr:()=>Nu,OXP:()=>es,lS4:()=>tr,g5f:()=>Ov,fp6:()=>Wl,Uty:()=>Vi,YkG:()=>Qt,xdS:()=>ot,kMF:()=>rT,$NE:()=>gt,bC9:()=>bt,Ian:()=>ci,KVV:()=>hE,q9e:()=>To,iIf:()=>aO,ian:()=>Ks,m6e:()=>mr,OFd:()=>Ws,kqr:()=>Wt,fnZ:()=>Pr,VFZ:()=>Js,ZiX:()=>Tt,j5n:()=>lr,zkt:()=>_,Pcm:()=>$_,QDV:()=>Vs,M5u:()=>mv,laD:()=>Rg,mtq:()=>Ft,CtB:()=>oO,CBv:()=>ae,I0t:()=>Tr,u1G:()=>QT,gk1:()=>Ag,Bgb:()=>_g,uzs:()=>Sr,v0l:()=>Cu,Zqp:()=>my,j0k:()=>go,tCm:()=>St,gmx:()=>Ml,mOr:()=>Tu,TwZ:()=>Xv,GyU:()=>kO,zGm:()=>Dd,bMg:()=>ry,EyD:()=>vO,FQA:()=>gO,fZN:()=>ay,xsF:()=>bO,Lxg:()=>OO,O3l:()=>Hc,Wni:()=>qc,wRx:()=>wO,OxG:()=>qd,uJQ:()=>Bd,qWg:()=>lO,i96:()=>Ld,zhn:()=>SO,G8q:()=>ai,Jct:()=>vT,A9Y:()=>te,Y5F:()=>f_,gxP:()=>le,c$P:()=>xl,M7o:()=>ac,BBN:()=>Wa,ZBU:()=>J,UkJ:()=>no,xkv:()=>lf,z$M:()=>rA,KAm:()=>ky,lCl:()=>Hf,rkF:()=>Dm,IU6:()=>Qp,RGr:()=>h,aYu:()=>m,ije:()=>Ul,Buf:()=>lp,YLu:()=>Il,ct9:()=>bo,XkY:()=>ny,T5R:()=>kd,uQS:()=>oy,wcJ:()=>ho,d$I:()=>ol,rSp:()=>dd,Sx:()=>jc,Ilm:()=>Tl,Ki6:()=>Hs,VGk:()=>ip,sFD:()=>_h,eWN:()=>iA,dWE:()=>Wv,Lkd:()=>pT,aDL:()=>Mf,yaA:()=>sy,lOh:()=>Sf,DBr:()=>lv,hK$:()=>Dl,TZ_:()=>Hp,CMB:()=>Ig,FU8:()=>Lc,J$p:()=>Gf,b5s:()=>Vf,h2W:()=>Rt,SL_:()=>vf,oUH:()=>jp,ck9:()=>Fd,nL:()=>tO,k$p:()=>Nh,Xs0:()=>wl,u7I:()=>Rf,rxg:()=>uu,bji:()=>cu,oCZ:()=>Im,MjG:()=>KO,FuV:()=>Lp,$ju:()=>kp,t6d:()=>Dp,m5F:()=>fe,sx:()=>aA,rSc:()=>pO,U10:()=>bc,L8n:()=>Xy,R9X:()=>dy,rj2:()=>df,_C4:()=>Yp,tCj:()=>cf,uAg:()=>Py,wx9:()=>CT,KF3:()=>Bp,ax9:()=>qp,HH7:()=>op,ufV:()=>wy,_6y:()=>Yc,XTh:()=>WO,AJo:()=>$c,Ixr:()=>Wy,P6Y:()=>mA,Bd_:()=>Pm,xkB:()=>Nm,W41:()=>_f,WkI:()=>gf,sSE:()=>Am,GMd:()=>Bu,jtL:()=>qu,Bxm:()=>Sm,FVh:()=>bm,U_T:()=>Zd,FTe:()=>ie,VGB:()=>ne,Wfe:()=>bu,Ls5:()=>hu,$bd:()=>du});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>qo,editAttribute:()=>Ho,editEndDate:()=>Zo,editRoles:()=>Jo,editStartDate:()=>zo,editTags:()=>Xo,removeAttribute:()=>Ko});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>UE,collectCrosswalksFromAttributes:()=>jE,compareActivenessAttributes:()=>IE,compareAttributes:()=>SE,compareImages:()=>wE,compareRoles:()=>kE,compareTags:()=>DE});var s={};r.r(s),r.d(s,{createHistoryManager:()=>xE});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),L=(0,l.equals)("99"),j=(0,l.equals)("9999"),D=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[D,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[j,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,Q=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?Y(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},ee=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;var Ee=r(76665);let me,he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,je,De,ke,Fe,Me,xe,$e,Ve,Ge,We,Ye,Be,qe,He,Qe,Ke;var Je;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(me||(me={})),function(e){e.local="local",e.validationService="validationService"}(he||(he={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(be||(be={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Oe||(Oe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ve||(ve={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ge||(ge={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(_e||(_e={})),function(e){e.asc="asc",e.desc="desc"}(Ae||(Ae={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ne||(Ne={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Pe||(Pe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Re||(Re={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Se||(Se={})),function(e){e.PROFILE="profile",e.MAP="map"}(we||(we={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ie||(Ie={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ue||(Ue={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ce||(Ce={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(je||(je={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(De||(De={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(ke||(ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Fe||(Fe={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Me||(Me={})),function(e){e.IN="in",e.OUT="out"}(xe||(xe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}($e||($e={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ve||(Ve={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(Ge||(Ge={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.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"}(We||(We={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Ye||(Ye={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting"}(Be||(Be={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(qe||(qe={})),function(e){e.NEW="new",e.CLASSIC="classic"}(He||(He={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(Qe||(Qe={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Ke||(Ke={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Je||(Je={}));const Xe=Je;let ze,Ze;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(ze||(ze={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(Ze||(Ze={}));const et=(0,l.prop)("referencedEntityTypeURI"),tt=(0,l.prop)("relationshipTypeURI"),rt=(0,l.prop)("referencedAttributeURIs"),nt=(0,l.curry)(((e,t)=>(0,l.pipe)(rt,(0,l.filter)((0,l.startsWith)(e)))(t))),it=nt("configuration/relationTypes"),at=nt("configuration/entityTypes"),ot=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),st=(0,l.filter)(ot),lt=(e,t)=>!t||t.some((t=>t===e.uri)),ut="1Tempo4rary",ct="1Tepmo4Rel",pt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),dt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,yt=e=>()=>dt(e),ft=(e,t)=>{const r=pt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return dt(n)},Tt=e=>e&&e.includes("uri$$"),Et=yt("entities"),mt=yt("relations"),ht=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),bt=(0,l.startsWith)("relations/"),Ot=(0,l.startsWith)("entities/"),vt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),gt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),_t=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),At=(0,l.pipe)((0,l.split)("/"),l.head),Nt=(0,l.pipe)((0,l.split)("/"),l.last),Pt=e=>e.split(".").slice(0,2).join("."),Rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},St=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),wt=(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("/")},It=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Ut=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),Ct=e=>2===e.split("/").length,Lt=e=>5===e.split("/").length,jt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},Dt=e=>e.replace(/uri\$\$/g,ut);function kt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ft=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,vt),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Xe.TYPE_STRING)]),Mt=(0,l.has)("values"),xt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Xe.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Xe.TYPE_LOOKUP)],[Mt,(0,l.always)(Xe.TYPE_ENUM)],[Ft,(0,l.always)(Xe.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Xe.TYPE_BOOLEAN),(0,l.always)(Xe.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),$t=(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){kt(e,t,r[t])}))}return e}({},e,{type:xt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Vt=e=>!!e&&(!!e.autoGenerated&&e.type!==Xe.TYPE_NESTED||!!e.parentAutoGenerated),Gt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Wt=(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),Yt=e=>Gt(e)?"analyticsAttributes":"attributes",Bt=(0,l.propEq)("hidden",!0),qt=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Ht=qt(Xe.TYPE_NESTED),Qt=qt(Xe.TYPE_REFERENCE),Kt=qt(Xe.TYPE_IMAGE),Jt=(0,l.either)(Ht,Qt),Xt=(e,t)=>{const r=Gt(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(".")},zt=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Zt=(0,l.pipe)(zt,Boolean),er=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),tr=(0,l.both)(Zt,(0,l.pipe)(zt,("rdm",(0,l.pipe)(At,(0,l.equals)("rdm")))));const rr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Yt({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]||ir(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:[]},nr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=rr(e,t,r);return n.length?(0,l.last)(n):null},ir=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",Xe.TYPE_NESTED),(0,l.propEq)("type",Xe.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Xe.TYPE_REFERENCE),(0,l.pipe)(rt,(0,l.map)((t=>nr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},ar=[Xe.TYPE_ACTIVENESS_DATE,Xe.TYPE_DATE,Xe.TYPE_TIMESTAMP,Xe.TYPE_LOCAL_DATE],or=[Xe.TYPE_ACTIVENESS_DATE,Xe.TYPE_TIMESTAMP,Xe.TYPE_LOCAL_DATE],sr=e=>ar.includes(e),lr=e=>or.includes(e),ur=[Xe.TYPE_INT,Xe.TYPE_LONG,Xe.TYPE_NUMBER,Xe.TYPE_FLOAT,Xe.TYPE_DOUBLE,Xe.TYPE_COUNT],cr=e=>ur.includes(e),pr=e=>[Xe.TYPE_FLOAT,Xe.TYPE_DOUBLE].includes(e),dr=[Xe.TYPE_BOOLEAN,Xe.TYPE_BOOLEAN_RADIO,Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED],yr=e=>dr.includes(e),fr=[Xe.TYPE_URL,Xe.TYPE_BLOG_URL,Xe.TYPE_IMAGE_URL],Tr=e=>fr.includes(e),Er=qt(Xe.TYPE_EMAIL),mr=e=>Xe.TYPE_SSN===e;var hr,br=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(hr||(hr={}));const Or=(0,l.curry)(((e,t,r)=>{var n;const i=e===hr.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),vr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),gr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),vr),_r=(0,l.pipe)((0,l.reject)(E),gr),Ar=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("?")?"&":"?")+vr(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}},Nr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Pr=(0,l.equals)(Nr.SUGGESTING),Rr=(0,l.equals)(Nr.EDITING),Sr=(0,l.equals)(Nr.VIEWING),wr=(0,l.either)(Rr,Pr),Ir=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ur=(0,l.curry)(((e,t)=>(0,l.pipe)(Ir(e),(0,l.prop)("extendsTypeURI"))(t))),Cr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Ur(e,r)));return n(r)})),Lr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Ur(e,n);return r})),jr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?jr(e,Ir(e,t.extendsTypeURI),r):void 0,Dr=(e,t)=>{const r=t.map(Lr(e));return(r.length?r.reduce(l.intersection):[])[0]},kr=(e,t)=>jr(e,(0,l.is)(Object,t)?t:Ir(e,t),"typeImage"),Fr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Cr(e,t,n.uri)?r.concat(n.uri):r),[]),Mr={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"},xr={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},$r={[Mr.EQUALS]:"equals",[Mr.NOT_EQUALS]:"not",[Mr.STARTS_WITH]:"starts with",[Mr.MISSING_VALUE]:"missing value",[Mr.IN_RANGE]:"in range",[Mr.HAS_ALL]:"has all",[Mr.FULL_TEXT]:"full text",[Mr.EXISTS]:"exists",[Mr.COUNT_EQUALS]:"count equals",[Mr.COUNT_NOT_EQUALS]:"count not equal",[Mr.COUNT_LT]:"count less",[Mr.COUNT_LTE]:"count less or equal",[Mr.COUNT_GT]:"count greater",[Mr.COUNT_GTE]:"count greater or equal",[Mr.COUNT_RANGE]:"count in range",[Mr.LT]:"less than",[Mr.LTE]:"less than or equal",[Mr.GT]:"greater than",[Mr.GTE]:"greater than or equal",[Mr.IN_FILE]:"in file",[Mr.NOT_IN_FILE]:"not in file",[Mr.CONTAINS]:"contains",[Mr.ON]:"on",[Mr.BEFORE]:"before",[Mr.AFTER]:"after",[Mr.WITHIN]:"within"},Vr="in",Gr="notIn",Wr="not range",Yr=e=>({[Vr]:Mr.EQUALS,[Gr]:Mr.NOT_EQUALS}[e]||e),Br={LAST_DAY:"lastDay",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_6MONTHS:"last6Months",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},qr={LAST_3DAYS:"last3Days"},Hr={[Br.LAST_DAY]:"Last 24 hours",[Br.LAST_WEEK]:"Last 7 days",[Br.LAST_MONTH]:"Last 30 days",[Br.LAST_6MONTHS]:"Last 6 months",[Br.LAST_YEAR]:"Last year",[Br.PICK_DATE]:"Pick date"},Qr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Kr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Jr="<No label>",Xr={IN:"in",OUT:"out"};var zr=r(87918),Zr=r.n(zr);function en(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tn(e,t,r[t])}))}return e}function tn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rn={startDate:{type:Xe.TYPE_ACTIVENESS_DATE,get label(){return Zr().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Xe.TYPE_ACTIVENESS_DATE,get label(){return Zr().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},nn=en({id:{type:Xe.TYPE_ENTITY_ID,get label(){return Zr().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},rn,{roles:{type:Xe.TYPE_STRING,get label(){return Zr().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Xe.TYPE_STRING,get label(){return Zr().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),an={workflow:{type:Xe.TYPE_STRING,get label(){return Zr().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Xe.TYPE_STRING,get label(){return Zr().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Xe.TYPE_STRING,get label(){return Zr().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},on={commenter:{type:Xe.TYPE_STRING,get label(){return Zr().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},sn={notResolved:{type:Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return Zr().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},ln={createdBy:{type:Xe.TYPE_STRING,get label(){return Zr().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Xe.TYPE_STRING,get label(){return Zr().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},un={matches:{type:Xe.TYPE_COUNT,get label(){return Zr().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Xe.TYPE_COUNT,get label(){return Zr().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},cn={sourceSystems:{type:Xe.TYPE_STRING,get label(){return Zr().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Xe.TYPE_STRING,get label(){return Zr().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Xe.TYPE_INT,get label(){return Zr().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Xe.TYPE_TIMESTAMP,get label(){return Zr().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Xe.TYPE_STRING,get label(){return Zr().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let pn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(pn||(pn={}));const dn={[pn.matchRules]:{type:Xe.TYPE_STRING,get label(){return Zr().text("Match Rules")},uri:pn.matchRules,name:pn.matchRules,faceted:!0,hideForDataTenant:!0},[pn.MLRecommendedMatch]:{type:Xe.TYPE_STRING,get label(){return Zr().text("Match IQ")},uri:pn.MLRecommendedMatch,name:pn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},yn=en({},nn,an,on,sn,ln,un,cn,dn,{type:{type:Xe.TYPE_STRING,get label(){return Zr().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),fn="NOT_MATCH";var Tn=r(13980),En=r.n(Tn);function mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hn(e,t,r[t])}))}return e}function hn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bn=En().oneOf(["mobile","tablet","desktop"]),On=En().shape({deviceTypes:En().oneOfType([bn,En().arrayOf(bn)]),roles:En().arrayOf(En().string)}),vn=En().shape({value:En().string,lookupCode:En().string}),gn=En().shape({link:En().string,filename:En().string}),_n=En().shape({displayName:En().string,parent:En().string}),An=En().oneOfType([En().string,En().number,En().bool,vn]),Nn=En().oneOfType([An,En().arrayOf(An)]),Pn=En().shape({fieldName:En().string,values:En().arrayOf(Nn),filter:En().string,type:En().string}),Rn=En().shape({minValue:En().number,maxValue:En().number}),Sn=En().shape({label:En().string,name:En().string,description:En().string,type:En().string,hidden:En().bool,faceted:En().bool,searchable:En().bool,uri:En().string,access:En().arrayOf(En().string),cardinality:Rn}),wn=En().shape({label:En().string,uri:En().string,typeColor:En().string,direction:En().string,startObject:En().object,endObject:En().object}),In=En().shape({typeColor:En().string,typeIcon:En().string,typeImage:En().string,label:En().string,uri:En().string,attributes:En().arrayOf(Sn)}),Un=En().shape({uri:En().string,label:En().string,memberTypes:En().array,extendsTypeUri:En().string,attributes:En().arrayOf(Sn)}),Cn=En().shape({uri:En().string,label:En().string,extendsTypeUri:En().string,relationshipTypeURIs:En().arrayOf(En().string)}),Ln=En().shape({uri:En().string,description:En().string,label:En().string,schemaVersion:En().string,entityTypes:En().arrayOf(In),roles:En().arrayOf(En().object),groupTypes:En().arrayOf(En().object),relationTypes:En().arrayOf(wn),graphTypes:En().arrayOf(Cn),interactionTypes:En().arrayOf(Un),sources:En().arrayOf(En().object)}),jn=En().shape({uri:En().string,type:En().string}),Dn=En().shape({uri:En().string,attributes:En().object,type:En().string,timestamp:En().number,members:En().object}),kn=En().shape({uri:En().string,type:En().string}),Fn=En().shape({value:En().object,ov:En().bool,type:En().string,uri:En().string}),Mn=En().shape({refEntity:En().oneOfType([En().array,En().object]),refRelation:En().oneOfType([En().array,En().object]),value:En().object,ov:En().bool,type:En().string,uri:En().string}),xn=En().oneOf((0,l.values)(Nr)),$n=En().shape({type:En().oneOf(Object.values(me)).isRequired,attributeTypeUri:En().string.isRequired,parentUri:En().string.isRequired,uri:En().string,message:En().string}),Vn={attributeType:Sn,showEmptyEditors:En().bool,lazy:En().bool,mode:xn,metadata:Ln,ownError:$n,errors:En().arrayOf($n),crosswalks:En().array,onAddAttributes:En().func,onAddOneMore:En().func,onDeleteAttribute:En().func,onChangeAttribute:En().func,additionalControlsRenderer:En().func,hideDeleteButton:En().bool,showNonOv:En().bool,state:En().oneOf(["deleted","edited"]),expanded:En().bool},Gn=mn({attributeValue:Fn},Vn),Wn=mn({attributeValue:Mn},Vn),Yn=En().shape({value:En().oneOfType([En().string,En().bool,En().number]),ov:En().bool,type:En().string,uri:En().string,lookupCode:En().string,lookupRawValue:En().string}),Bn=En().shape({totalOvValues:En().number,totalValues:En().number}),qn=En().shape({inRelations:En().arrayOf(En().oneOfType([En().object,En().string])),outRelations:En().arrayOf(En().oneOfType([En().object,En().string])),groups:En().arrayOf(En().string),entityTypes:En().arrayOf(En().string),nextEntry:En().object}),Hn=En().oneOf(["asc","desc"]),Qn=En().shape({id:En().string,content:qn,allowOnlyCreateNew:En().bool,sortColumn:En().string,sortOrder:Hn,"text-empty":En().string,max:En().number,icon:En().string,caption:En().string,canCreate:On,canRead:On,canUpdate:On,canDelete:On,editingEnabled:En().bool}),Kn=En().shape({id:En().string,caption:En().string,pageSize:En().number,icon:En().string,canCreate:On,canRead:On,canUpdate:On,canDelete:On,attributes:En().object}),Jn=En().shape({entityUri:En().string,entityType:En().string,entityLabel:En().string,object:jn}),Xn=En().shape({relationUri:En().string,relationType:En().string,relationLabel:En().string,direction:En().string,object:kn}),zn=En().shape({entity:Jn,relation:Xn}),Zn=En().shape({value:En().string,isRawFilter:En().bool}),ei=En().shape({id:En().string,label:En().string,name:En().string,availableEntityTypes:En().array}),ti=En().shape({id:En().string,allowMergeAll:En().bool,matchActions:En().object,availableTabs:En().arrayOf(En().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ri=En().shape({matchRules:En().arrayOf(En().string),object:jn,shortestTransitiveMatchPath:En().arrayOf(En().shape({matchRules:En().arrayOf(En().string),match:En().string})),direct:En().bool,matchScore:En().number}),ni=En().arrayOf(ri),ii=En().arrayOf(En().shape({uri:En().string,label:En().string})),ai=[{label:Zr().text("And"),value:"and"},{label:Zr().text("Or"),value:"or"},{label:Zr().text("And not"),value:"and not"},{label:Zr().text("Or not"),value:"or not"}];function oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const si=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),li=(0,l.pipe)(si,(0,l.propOr)("","label")),ui=(0,l.curry)(((e,t)=>{const r=si(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),ci=(0,l.curry)(((e,t,r)=>{const[n,i]=ui(e,r);return Cr(e,n,t)||Cr(e,i,t)})),pi=(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){oi(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),di=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?Xr.OUT:Xr.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(Xr.IN),i=r(Xr.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},yi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),fi={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ti=(0,l.curry)(((e,t)=>e.every((e=>Ei(e,t))))),Ei=(0,l.curry)(((e,t)=>{const r=Vt(t);return mi(e,t)&&(e===fi.READ||!r)})),mi=(e,t)=>!t||!t.access||t.access.includes(e),hi=(0,l.curry)(((e,t,r)=>Ei(fi.READ,r)&&(Pr(t)?Ei(fi.INITIATE_CHANGE_REQUEST,r):Ei(e,r)))),bi=hi(fi.CREATE),Oi=hi(fi.DELETE),vi=hi(fi.UPDATE),gi=Ti([fi.CREATE,fi.MERGE,fi.READ,fi.UPDATE]),_i=Ti([fi.UPDATE,fi.READ,fi.CREATE]),Ai=Ti([fi.UPDATE,fi.READ]),Ni=Ti([fi.DELETE,fi.UPDATE,fi.READ]),Pi=(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["*"])),Ri=(e,t,r)=>(0,l.pipe)((0,l.map)(Pi(e,t)),(0,l.filter)(l.identity))(r),Si=(e,t,r)=>{const n=Ri(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&Ei(fi.MERGE,r)},wi=(0,l.curry)(((e,t,r,n)=>{const i=si(e,n),[a,o]=ui(e,n);return i&&Ei(fi.CREATE,i)&&Cr(e,a,t.type)&&Cr(e,o,r.type)})),Ii=(e,t,r,n,i)=>{const a=Ir(e,n.type),o=Ri(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(wi(e,n,i))||a.some(wi(e,i,n))}))},Ui=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ir(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:Si(o,i,a),canAddRelation:Ii(e,o,i,r,n),canMark:Ei(fi.UPDATE,a)&&Ei(fi.READ,a)}},Ci=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Ui(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Li=Gt,ji=(0,l.complement)(Li),Di=Ei(fi.READ),ki=e=>{let{attributeType:t,mode:r}=e;return ji(t)&&bi(r,t)&&!Bt(t)},Fi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Tt(r.uri),o=vi(n),s=bi(n);return(0,l.cond)([[Li,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},Mi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Tt(r.uri),s=vi(n),u=Oi(n),c=$i(fi.UPDATE,n,a,r),p=$i(fi.DELETE,n,a,r);return(0,l.cond)([[Li,l.F],[(0,l.always)(o),l.T],[(0,l.always)(i),(0,l.allPass)([u,p])],[l.T,(0,l.allPass)([s,u,c,p])]])(t)},xi=(0,l.curry)(((e,t,r,n)=>{const i=ir(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!mi(e,n)||!xi(e,t,r[n.name],n)))))})),$i=(0,l.curry)(((e,t,r,n,i)=>Pr(t)?xi(fi.INITIATE_CHANGE_REQUEST,r,n,i):xi(e,r,n,i))),Vi=(0,l.both)((0,l.complement)(Bt),Di),Gi="SuperUser",Wi="allTenants",Yi=[Wi,"allCustomers"],Bi=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===Gi})).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===Gi){const e=r?Yi.concat(r.map((e=>`allTenants.${e}`))):Yi,n=r&&t[0]===Wi?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}))},qi={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},Hi={[qi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[qi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[qi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[qi.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[qi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[qi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[qi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[qi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[qi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[qi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[qi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[qi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[qi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[qi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[qi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[qi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[qi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[qi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[qi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[qi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[qi.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Qi=(0,l.curry)(((e,t,r)=>Bi({allowedPermissionsNames:e,permissionsNames:qi,permissionsConfig:Hi}).some((e=>e(t,{params:{tenant:r}}))))),Ki=Qi([qi.CAN_EXPORT]),Ji=Qi([qi.CAN_EXPORT_ACTIVITIES]),Xi=Qi([qi.CAN_IMPORT_ENTITIES_FROM_DT]),zi=Qi([qi.CAN_READ_ENTITIES_FROM_DT]),Zi=Qi([qi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ea=Qi([qi.CAN_UPDATE_PROCESS_INSTANCE]),ta=Qi([qi.CAN_VIEW_WORKFLOW_DEFINITION]),ra=Qi([qi.CAN_CONFIG_ENVIRONMENT_REGISTER]),na=Qi([qi.CAN_UPDATE_WORKFLOW_DATA_TASK]),ia=Qi([qi.CAN_READ_WORKFLOW_DATA_TASK]),aa=Qi([qi.CAN_MANAGE_WORKFLOW_DEFINITION]),oa=Qi([qi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),sa=Qi([qi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),la=Qi([qi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ua=Qi([qi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),ca=Qi([qi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),pa=Qi([qi.CAN_EXECUTE_WORKFLOW_JOBS]),da=Qi([qi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),ya=Qi([qi.CAN_CREATE_CONFIG_JAR]),fa=Qi([qi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ta=Qi([qi.CAN_VIEW_CONFIG_JAR]),Ea=Qi([qi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ma=Qi([qi.CAN_VIEW_WORKFLOW_JOBS]),ha=Qi([qi.CAN_MAKE_BULK_UPDATE]),ba=Qi([qi.CAN_OPEN_DATA_LOADER_EXECUTE,qi.CAN_OPEN_DATA_LOADER_READ]),Oa=Qi([qi.CAN_BULK_DELETE_PROFILES]),va=Qi([qi.CAN_READ_MDM_DATA_ENTITIES]),ga=Qi([qi.CAN_READ_DVF]),_a=Qi([qi.IS_FREEMIUM_ADMIN]),Aa=(0,l.reject)(Bt),Na=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Aa,(0,l.filter)(e))(t),Pa=(0,l.curry)(((e,t)=>Na((t=>ki({attributeType:t,mode:e})),t))),Ra=(0,l.curry)(((e,t)=>Na((t=>ki({attributeType:t,mode:e})||Vi(t)),t))),Sa=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Vi)),wa=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...wa(e)])))),Ia=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Vi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ia(e)])))),Ua=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ua(e)])))),Ca=(0,l.pipe)(Ir,(0,l.converge)(l.concat,[Ia,Ua]));function La(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ja(e,t,r[t])}))}return e}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Da=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,Da(e)))},t))),ka=e=>{var t;return La({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},Fa=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),Ma=(0,l.when)(Fa,(0,l.dissoc)("values")),xa=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return La({},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})})),$a=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Va=(0,br.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(wa,t).concat((0,l.chain)(wa,r)).some($a)})),Ga=e=>{let t=!1;const r=Da((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?La({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Wa=e=>{const t=Va(e),r=(0,l.map)((e=>Da((0,l.pipe)(Ma,(0,l.when)((0,l.always)(e),xa))))(t)),n=(0,l.map)(ka),i=(0,l.map)(Ga);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Ya=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ba=(0,l.prop)("relationshipTypeURIs"),qa=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Ha(e,t)))||[]})),Ha=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(ci(e,t))},Qa=(e,t)=>(0,l.pipe)(Ya,(0,l.defaultTo)({}),Ba,(0,l.defaultTo)([]),(0,l.chain)(ui(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Ir(e)))(e,t),Ka=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Ja=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),Xa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ja((0,l.complement)(Ka))(e)},za=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ja(Ka)(e)},Za=(0,l.pipe)(Ir,(0,l.propOr)([],"matchGroups")),eo=(e,t,r)=>(0,l.pipe)(Za,(0,l.find)((0,l.propEq)("uri",r)))(e,t),to=(0,l.curry)(((e,t,r)=>(0,l.pipe)(eo,(0,l.propOr)(r,"label"))(e,t,r))),ro=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Za,(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),(0,l.includes)(l.__,r))))(e,t),i=(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.without)(l.__,r),(0,l.map)((e=>({uri:e,label:e}))))(n);return[...n,...i]})),no=e=>(0,l.partition)(Ka,e),io=(0,l.includes)(l.__,["and","or","not"]),ao=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),oo=(0,l.includes)(l.__,["equals","notEquals","in"]),so=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return io(t)?so(r):ao(t)?r.filter(vt):oo(t)?r.map((0,l.prop)("uri")).filter(vt):[]})),l.uniq),lo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(so),l.uniq),uo=(0,l.pipe)(Za,lo),co=(0,l.pipe)(ro,lo),po=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},yo=(0,l.pipe)(po,Ia),fo=(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||Cr(e,n,t)})(e,t))})(e,t)),To=e=>!!e.required,Eo=(e,t,r)=>{const n=(0,l.cond)([[vt,Ir(e)],[gt,si(e)]])(t);return mo(e,n,r)},mo=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&vt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Vt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Xe.TYPE_REFERENCE){const n=tt(t),a=rt(t);i=Eo(e,n,r).filter((e=>a.some(_t(e.uri))))}else t.attributes&&(i=mo(e,t,r));i&&n.push(...i)}return n})):t.type===Xe.TYPE_REFERENCE?Eo(e,tt(t),r):[],ho=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),To]),e.attributes||[])},bo=(e,t)=>{const r=at(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},Oo=(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)?Zr().text(n):n};return r(null,t)})),vo=["label","description","abbreviation","caption","toolTip"],go=e=>Oo(vo,e),_o=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Nt(t);return r.find((e=>{let{uri:t}=e;return Nt(t)===n}))})),Ao=(0,l.curry)(((e,t)=>{const r=Nt(t);return(0,l.pipe)(_o(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),No=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"})},Po=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},Ro=(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)})),So=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ir(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Io(e,t,r[t])}))}return e}function Io(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uo=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 Co(i,e,t,r,n)},Co=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:ir(t,r)).map((e=>e.map((e=>{const r=Uo(t,e,n,i);return r.length?wo({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Jt),(0,l.prop)("children"))).filter(Vi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Lo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Uo(e,t,r,["attributes","analyticsAttributes"])},jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Uo(e,t,r,["attributes"])},Do=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Uo(e,t,r,["analyticsAttributes"])},ko=(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)})),Fo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Nt(r)===e})))),Mo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Fo("LUD")),(0,l.defaultTo)(r))(t||[])},xo=(e,t)=>{let{survivorshipStrategies:r}=e;return Fo(t,r)},$o=(0,l.allPass)([(0,l.complement)(l.isNil),Ei(fi.READ)]),Vo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),Ei(fi.READ)]),Go=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([Ei(fi.CREATE),Ei(fi.INITIATE_CHANGE_REQUEST)])]),Wo=(0,l.curryN)(2,(0,l.pipe)(Ir,Vo));function Yo(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 Bo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Yo(r[i],r[i+1],e,t));return n}function qo(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=Bo(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 qo(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 Ho(e,t,r,n,i,a){void 0===a&&(a=0);var o=Bo(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()?(Qo(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(Qo.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=qo(e,t,r,n,i,a),s}var c=Ho(e,o,o.valueUri,{},i,a);Ho(c,t,r,n,i,a+1)}function Qo(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Ko(e,t,r,n){void 0===n&&(n=0);var i=Bo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Ko(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 Jo(e,t){e.roles=t||[]}function Xo(e,t){e.tags=t||[]}function zo(e,t){e.startDate=t||""}function Zo(e,t){e.endDate=t||""}const es=e=>{let{ov:t}=e;return!1!==t},ts=(e,t)=>((e,t)=>Tr(e.type)&&ae(t))(e,t)||((e,t)=>Er(e.type)&&oe(t))(e,t),rs=(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))),ns=rs("refEntity"),is=rs("refRelation"),as=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],os=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},ss=(0,l.prop)("objectURI"),ls=(0,l.prop)("objectURI"),us=(0,l.prop)("type"),cs=(0,l.pipe)(ns,(0,l.defaultTo)({}),ss),ps=(0,l.pipe)(is,(0,l.defaultTo)({}),ls),ds=(0,l.pipe)(ns,(0,l.defaultTo)({}),us),ys=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},fs=(0,l.evolve)({refEntity:re,refRelation:re}),Ts=(e,t,r,n)=>{const i=rr(e,r),a=Ir(e,t.type)||si(e,t.type);if(0===i.length)return null;const o=Yt(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(!lt(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=>tt(e)===r.uri||et(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},Es=(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?Es(a.value,o):a},ms=(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 Es(e[r],i)})),hs=(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")]]),bs=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),Os=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(Os(e,i)))))(r)})),vs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(vs(e)),e)(t))),gs=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(Os(e,r),vs(t))(n))),_s=gs(null,hs),As=gs(es,hs),Ns=gs(null,bs),Ps=gs(es,bs),Rs=(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=ms(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},Ss=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(cs,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),ws=(e,t)=>{const r=jt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Rs(e,r,n)},Is=Object.values(rn),Us=(0,l.includes)(l.__,Is),Cs=e=>Is.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){js(e,t,r[t])}))}return e}function js(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ds=(e,t)=>`${e}_${t}`,ks=[yn.matches.name,yn.matchRules.name],Fs=(0,l.values)(an).map((e=>e.name)),Ms=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Fs)))),xs=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,ks)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>Ds(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),$s=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,Ms(r),xs(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(Ds(`dtPotentialMatches.${t.name}`,"")))))(yn)},Vs=(0,l.propEq)("uri",yn.type.uri),Gs=e=>(0,l.values)(dn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),Ws=(0,l.propEq)("uri",cn.sourceSystems.uri),Ys=Object.values(nn),Bs=(0,l.includes)(l.__,Ys),qs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:void 0===n?r.defaultValue:n})},Hs=e=>{let{entity:t,attributeType:r}=e;return(0,l.dissoc)(r.uri,t)},Qs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ls({},t,{[r.uri]:n})},Ks=(0,l.propEq)("uri",nn.roles.uri),Js=(0,l.propEq)("uri",nn.tags.uri);function Xs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zs(e,t,r[t])}))}return e}function zs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zs=e=>{let{parentUri:t,attributeType:r}=e;return Xs({uri:ft(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[Jt,(0,l.always)({value:{}})],[Zt,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),sr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},el=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Pa(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),er,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=Zs({parentUri:r,attributeType:e});let s=ir(n,e);s&&(e.type===Xe.TYPE_REFERENCE&&(s=st(s)),a.value=el({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||er(e))&&(o[t]=[a])}return o},tl=e=>{let{entity:t,metadata:r}=e;return Eo(r,t.type,!0).filter(er).reduce(((e,t)=>{const n=t.name,i=jt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Ts(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:nl({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},rl=(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===Xe.TYPE_NESTED?Xs({},e,{value:rl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return Xs({},s(t),el({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),nl=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=Zs({parentUri:n,attributeType:r}),u=hs(l);return(0,Ee.ZP)(t,(e=>{qo(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},il=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{qo(e.attributes||e.value,r,n.uri,hs(n),a,o,i)}))},al=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{Ho(e.attributes||e.value,r,n,i,a,o)}))},ol=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ee.ZP)(t,(e=>{Ko(e.attributes||e.value,r,n,i)}))},sl=e=>""===e,ll=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([sl,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([sl,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),ul=(0,l.reject)(ll),cl=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=>cl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),ul)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},pl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return cl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),fs),deleteEmptyComplex:e})},dl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(pl(e),(0,l.reject)(l.isEmpty))},yl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Us(r)?qs({entity:e,attributeType:r}):nl({entity:e,attributeType:r,parentUri:n,index:i})}),e))),fl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Us(r)?Qs({entity:e,attributeType:r,value:i}):al({entity:e,attributeType:r,uri:n,value:i})})),Tl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Us(r)?Hs({entity:e,attributeType:r}):ol({entity:e,attributeType:r,uri:n})})),El=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)},ml="UrlThumbnail",hl="CdnUrlThumbnail",bl=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(es):(0,l.head)(n);return e&&e.value}return null})),Ol=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>bl(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),vl=Ol(["CdnUrl","Url"],!0),gl=Ol(["CdnUrlPreview","UrlPreview"],!0),_l=Ol([hl,ml],!0),Al=Ol([hl,ml]),Nl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Wt,(0,l.always)(t)],[(0,l.both)(Gt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Wt(a)?"uri":"name",u=(0,l.pipe)((0,l.prop)(a[s]),(0,l.when)((0,l.both)((0,l.always)(Us(a)),(e=>null===e)),(0,l.always)([""])),(0,l.defaultTo)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Pl=(e,t,r)=>{const n=Sa(e),i=(0,l.any)(r?l.T:es);return Nl(n,t,i)},Rl=(e,t,r,n,i,a)=>{const o=Tt(null==r?void 0:r.uri)?Pa(t,e):Ra(t,e);return Nl(o,r,((e,o)=>{const s=ki({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:es,e)||Wt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let Sl;const wl=e=>{Sl=e};function Il(e,t){return Sl(e,t)}const Ul=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)})),Cl=50,Ll=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Cl,offset:a=0}=e;return Il("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},jl=(0,l.once)((()=>Il("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),Dl=e=>Il("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),kl=(e,t)=>Il("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Fl=e=>Z.fromNull($r[e]).map(Zr().text).orSome(""),Ml=(0,l.curry)(((e,t)=>`${e}_${t}`)),xl=(0,l.split)("_"),$l=(0,l.includes)("_"),Vl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Gl=(0,l.curry)(((e,t)=>e.some(Vl(t)))),Wl=Gl([Mr.IN_RANGE,Mr.COUNT_RANGE,Mr.WITHIN]),Yl=Gl([Mr.EXISTS,Mr.MISSING_VALUE]),Bl=(0,l.cond)([[Yl,(0,l.always)(0)],[Wl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),ql=(0,l.complement)(Yl),Hl=Gl([Mr.HAS_ALL,Mr.EQUALS,Mr.NOT_EQUALS]),Ql=Gl([Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE]),Kl=Gl([Mr.IN_FILE,Mr.NOT_IN_FILE]),Jl=e=>{switch(e){case Mr.COUNT_EQUALS:return Mr.EQUALS;case Mr.COUNT_NOT_EQUALS:return Mr.NOT_EQUALS;case Mr.COUNT_LT:return Mr.LT;case Mr.COUNT_LTE:return Mr.LTE;case Mr.COUNT_GT:return Mr.GT;case Mr.COUNT_GTE:return Mr.GTE;case Mr.COUNT_RANGE:return Mr.IN_RANGE}},Xl=Gl([Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS]),zl=Gl([Mr.WITHIN]),Zl=[[Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE],[Mr.NOT_IN_FILE,Mr.IN_FILE],[Mr.EQUALS,Mr.NOT_EQUALS,Mr.HAS_ALL],[Mr.LT,Mr.LTE,Mr.GT,Mr.GTE],[Mr.MISSING_VALUE,Mr.EXISTS],[Mr.COUNT_RANGE],[Mr.IN_RANGE],[Mr.STARTS_WITH,Mr.CONTAINS],[Mr.FULL_TEXT],[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.NOT_EQUALS],[Mr.WITHIN]],eu=(e,t)=>Zl.some((r=>r.includes(e)&&r.includes(t))),tu=(0,l.pipe)(l.omit,l.values),ru={OPTIONS_FOR_STRING:tu(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_DATE:[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS,Mr.MISSING_VALUE,Mr.EXISTS,Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE,Mr.IN_FILE,Mr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:tu(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_BLOB:tu(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_NUMBER:tu(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_LOOKUP:tu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Mr),OPTIONS_FOR_ENUM:tu(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_ID:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.IN_FILE,Mr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.LT,Mr.LTE,Mr.GT,Mr.GTE,Mr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE,Mr.EXISTS,Mr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.EXISTS,Mr.MISSING_VALUE]},nu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Xe.TYPE_TYPEAHEAD:case Xe.TYPE_STRING:case Xe.TYPE_PASSWORD:case Xe.TYPE_TEXT:case Xe.TYPE_CIK_ID:case Xe.TYPE_URL:case Xe.TYPE_BLOG_URL:case Xe.TYPE_IMAGE_URL:case Xe.TYPE_EMAIL:return ru.OPTIONS_FOR_STRING;case Xe.TYPE_LOOKUP:case Xe.TYPE_DEPENDENT_LOOKUP:return ru.OPTIONS_FOR_LOOKUP;case Xe.TYPE_ENUM:return ru.OPTIONS_FOR_ENUM;case Xe.TYPE_DATE:case Xe.TYPE_ACTIVENESS_DATE:case Xe.TYPE_TIMESTAMP:case Xe.TYPE_LOCAL_DATE:return ru.OPTIONS_FOR_DATE;case Xe.TYPE_BOOLEAN:case Xe.TYPE_BOOLEAN_RADIO:return ru.OPTIONS_FOR_BOOLEAN;case Xe.TYPE_BLOB:return ru.OPTIONS_FOR_BLOB;case Xe.TYPE_LONG:case Xe.TYPE_INT:case Xe.TYPE_FLOAT:case Xe.TYPE_DOUBLE:case Xe.TYPE_NUMBER:return ru.OPTIONS_FOR_NUMBER;case Xe.TYPE_ENTITY_ID:return ru.OPTIONS_FOR_ID;case Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Mr.EQUALS];case Xe.TYPE_COUNT:return ru.OPTIONS_FOR_COUNT;case Xe.TYPE_NESTED:case Xe.TYPE_REFERENCE:case Xe.TYPE_IMAGE:return ru.OPTIONS_FOR_COMPLEX;default:return ru.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Ql,n):n},iu=e=>[Pe.and,Pe.andNot].includes(e),au=e=>[Pe.or,Pe.orNot].includes(e),ou=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),au)),su=(lu=[Pe.and],e=>e.slice(0,-1).every((e=>lu.includes(e.operator))));var lu;const uu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),cu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),pu=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},du=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Pe.or,Pe.orNot],n=t?[Pe.and,Pe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&pu(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},yu="and",fu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(yu,n,e),o=(e=>[Pe.andNot,Pe.orNot].includes(e))(a)?du(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Tu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),Eu=e=>Array.isArray(e)?e.map(Eu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),mu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),hu=e=>`'${e}'`,bu=e=>`"${e}"`,Ou=(0,l.pipe)(Eu,mu),vu=(0,l.pipe)(Ou,hu),gu=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Wl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),_u=(e,t)=>Ql(t)?{type:Xe.TYPE_INT}:Kl(t)?{type:Xe.TYPE_FILE}:Xl(t)&&!zl(t)&&lr(e.type)?{type:Xe.TYPE_LOCAL_DATE}:e,Au=Object.values(Br),Nu=e=>Object.values(qr).includes(e),Pu=e=>Au.includes(e),Ru=e=>Zr().text(Hr[e]),Su=e=>{switch(e){case Br.LAST_DAY:return"1_day";case Br.LAST_WEEK:return"1_week";case Br.LAST_MONTH:return"1_month";case Br.LAST_6MONTHS:return"6_months";case Br.LAST_YEAR:return"1_year"}return e},wu=e=>{const t=f()();switch(e){case Br.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Br.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Br.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Br.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Br.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case qr.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()]}return e};function Iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uu(e,t,r[t])}))}return e}function Uu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cu=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Lu=(0,l.curry)(((e,t,r)=>{const n=r.map(Wl(e)||t.endsWith(".count")?Ou:vu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),ju=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},Du=e=>{let{filter:t,fieldName:r,values:n}=e;const i=Bl(t);return(0,l.pipe)(ju(i),(0,l.map)(Lu(t,r)),Cu(" or "))(n)},ku=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(vu).join(",")})`},Fu=e=>`*${e}*`,Mu=e=>`URL:${e}`,xu=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,$u=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Mr.IN_FILE?r:`not ${r}`},Vu=(e,t)=>[R(e,t),S(e,t)],Gu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Wu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Mr.ON:return Iu({},e,n?{filter:Mr.EQUALS}:{filter:Mr.IN_RANGE,values:[Vu(i,n)]});case Mr.BEFORE:return Iu({},e,{filter:Mr.LTE,values:[[S(i,n)]]});case Mr.AFTER:return Iu({},e,{filter:Mr.GTE,values:[[R(i,n)]]});case Mr.WITHIN:return Iu({},e,{filter:Mr.IN_RANGE,values:[wu(i)]})}}return e}),Du),Wu=(0,l.propSatisfies)(lr,"type"),Yu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",Mr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(Du({filter:Mr.EQUALS,fieldName:t,values:[r]}))),new fu).build())),Cu(" or "))(r)}],[(0,l.propEq)("filter",Mr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return Du({fieldName:r,filter:t,values:n.map((0,l.pipe)(Eu,Fu))})}],[(0,l.propEq)("filter",Mr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?Du(Iu({},e,{values:(0,l.flatten)(r)})):xu(r)?ku(Iu({},e,{filter:"listEquals"})):Du(e)}],[(0,l.propEq)("filter",Mr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=Bl(t);return(0,l.pipe)(ju(i),(0,l.map)(Lu(t,r)),Cu(" and "))(n)})(Iu({},e,{values:(0,l.flatten)(e.values)})):Wu(e)?(e=>{const{values:t}=e,r=!Wu(e),[n]=t;return(new fu).addClause(Du(Iu({},e,{filter:Mr.LT,values:[R(n,r)]}))).addClause(Du(Iu({},e,{filter:Mr.GT,values:[S(n,r)]}))).orBuild()})(e):xu(t)?ku(Iu({},e,{filter:"not listEquals"})):Du(e)}],[(0,l.propSatisfies)(Kl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Du({fieldName:r,filter:$u(t,r),values:n.map((0,l.prop)("link")).map(Mu)})}],[(0,l.propSatisfies)(Ql,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return Du({fieldName:`${r}.count`,values:n,filter:Jl(t)})}],[(0,l.propSatisfies)(Xl,"filter"),Gu],[(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 Lu(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Lu(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,Du]],Bu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!ql(e)||Hu(e,r))},qu=(e,t)=>Array.isArray(t)?Hu(e,t):e===Mr.WITHIN?Pu(t)||Number.isInteger(t):!(0,l.isNil)(t)&&Eu(t).length>0,Hu=(e,t)=>t&&t.length>0&&t.every((t=>qu(e,t)));function Qu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ku=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Ju=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),Xu=(e,t,r)=>"children"===e?Zu(r,[...t][0],!0):r,zu=(e,t,r)=>"values"===e?[...r,...t]:r,Zu=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)(Xu,t),e);if(!r&&Hl(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(zu,t),e)}return(0,l.append)(t,e)},ec=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Ku(e),r=e=>e.fieldName===t?e:r({fieldName:Ju(e),children:[e]});return r(e)})(t);return Zu(e,r)}),[]),tc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),rc=e=>{let[t]=e;return t.children?rc(t.children):t.operator},nc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=rc(t)===Pe.andNot,a=n(t,!1),o=i?`not ${du(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${rc(r)||yu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&tc(i)&&!t?r(i):n(i,a)}],...e])(o))),new fu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},ic=(0,l.pipe)((0,l.propOr)("","filter"),$l),ac=(0,l.map)((0,l.when)(ic,(e=>{const[t,r]=xl(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){Qu(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),oc=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)(Bu),ac,ec,nc([...e,...Yu],t))},sc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),lc=[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS,Mr.MISSING_VALUE,Mr.EXISTS],uc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.STARTS_WITH,Mr.MISSING_VALUE,Mr.HAS_ALL,Mr.FULL_TEXT,Mr.EXISTS],cc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.LT,Mr.LTE,Mr.GT,Mr.GTE,Mr.IN_RANGE],pc=(e,t)=>{const r=$t(e);return(e=>{switch(e){case rn.startDate.name:case rn.endDate.name:case an.dueDate.name:case ln.createdTime.name:case ln.updatedTime.name:case cn.reltioLoadDate.name:case cn.createDate.name:case cn.updateDate.name:case cn.deleteDate.name:case cn.publishDate.name:return lc;case un.matches.name:case cn.count.name:return cc;case an.workflow.name:case an.assignee.name:case an.step.name:case on.commenter.name:case ln.createdBy.name:case ln.updatedBy.name:case cn.sourceSystems.name:case cn.value.name:return uc;default:return null}})(t)||nu(r)},dc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.CONTAINS,Mr.STARTS_WITH,Mr.MISSING_VALUE,Mr.HAS_ALL,Mr.IN_RANGE,Mr.WITHIN,Mr.EXISTS,Mr.ON],yc=(0,l.pipe)(pc,(0,l.filter)((0,l.includes)(l.__,dc))),fc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Tc=e=>{let{query:t,body:r}=e;return t=fc(t),Il(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},Ec=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=[...e];r&&n.push({filter:"containsWordStartingWith",fieldName:"attributes",values:[r]});const i={filter:(0,l.pipe)(oc(),sc(t.globalFilter))(n),activeness:t.activityFilter||Kr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${_r(i)}`},mc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=Ec(e,t,r);return Il(n)},hc=e=>Il(`/entities/_total?${e}`),bc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(Vo),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Mr.EQUALS,fieldName:"type",values:n},a={filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(oc(),sc(r.globalFilter))([i,a]),s=_r({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Kr.ACTIVE_ONLY,max:r.max||4});return Il("/entities/_typeAheadSearch"+s,{method:"GET"})},Oc=(0,l.pipe)((0,l.reject)(l.isNil),gr),vc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(oc(),sc(i))(r),p=Oc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Tc({query:p,body:d})},gc=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return vc({fieldName:t,searchParams:i,options:n})},_c="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Ac=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)(oc(),sc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||_c,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${_r(i)}`},Nc=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=Ac(e,t,r);return Il(n)},Pc=e=>Cc(e,{select:"secondaryLabel"}),Rc=(e,t)=>{const{select:r=_c,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Il("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},Sc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Tt)),wc=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=Sc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Xt(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)(oc(),sc(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Il(`${s}/api/${o}/${t}/_object`,m)},Ic=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Uc={options:"sendHidden,addRefAttrUriToCrosswalk"},Cc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uc;return Il(`/${e}${_r(t)}`)},Lc=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 Il(n,r)},jc=e=>Il(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),Dc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Il(`/${e}/_clone${_r({executeLCA:!1,valuesToCopy:r})}`,n)},kc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Il(`/entities/_events/_total${gr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Fc=(e,t)=>Il(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),Mc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Il(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},xc=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 Il(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),gr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},$c=e=>{const t=new FormData;return t.append("file",e),Il("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,Zr().text("Can't upload file"));return Promise.reject(t)}))},Vc=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 Il(`/personal/findSavedSearches${gr({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"}})},Gc=e=>Il(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Wc=e=>Il("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Yc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Il(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},Bc=e=>{let{uri:t}=e;return Il(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},qc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Yc)(e),Hc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Yc)(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=["max","offset","filter"],Jc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Jc(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){Qc(e,t,r[t])}))}return e}({},t,(0,l.pick)(Kc,e)))),Xc=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ne.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ne.ALL,e)))return!1},zc=(0,l.omit)(["activeness"]),Zc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Xc(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Jc(e),(0,l.omit)(Kc))(e))),zc,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${_r(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},ep=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),tp=(0,l.reject)(l.isNil),rp=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),np=e=>Il(rp(e),{method:"GET",headers:{"Content-Type":"application/json"}}),ip=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,rp);return Il(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},ap=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?dl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(tp,ne,JSON.stringify);return Il(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},op=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"),rp,n),o=SE(i(t),i(r)).concat(IE(t,r));return Il(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},sp=(e,t,r)=>{const{url:n,options:i}=Zc(e,t,r);return Il(n,i).then(ep)},lp=(e,t)=>Il(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),up=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===Xr.IN?a.inRelations=[n]:a.outRelations=[n],Il(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},cp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Il(`${t}/recentSearches${_r({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},pp=e=>Il("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),dp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Il(`/recentSearches${_r({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function yp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fp(e,t,r[t])}))}return e}function fp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tp={select:"label,secondaryLabel,name,type,startDate,endDate"},Ep=(0,l.reject)(l.isNil),mp=(0,l.pipe)(Ep,gr),hp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=yp({},Tp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Il(`/${t}/_tree${mp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},bp=e=>{let{uri:t,graphUri:r}=e;const n=yp({},Tp,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Il(`/${t}/_parents${mp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Op=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=yp({},Tp,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Il(`/${t}/_hops${mp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function vp(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 gp=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},_p="/activities",Ap=e=>{let{label:t,description:r}=e;return Il(_p,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:gp()}})};var Np;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Np||(Np={}));const Pp=e=>{const t=_r(e);return Il(_p+t,{method:"GET"})},Rp=e=>Il(`/activities/_total${_r(e)}`,{method:"GET"}),Sp=e=>{const{entityUri:t}=e,r=vp(e,["entityUri"]);return Il(`/${t}/_activities${_r(r)}`,{method:"GET"})},wp=e=>{const{entityUri:t}=e,r=vp(e,["entityUri"]);return Il(`/${t}/_activities/_total${_r(r)}`,{method:"GET"})};function Ip(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Up(e,t,r[t])}))}return e}function Up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Lp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Il(Cp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},jp=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=Cp({url:r,workflowPath:t,tenant:n})),Il(s,{method:i||"GET",body:JSON.stringify(a),headers:Ip({"Content-Type":"application/json"},null!=o?o:{})})},Dp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Cp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Il(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)},kp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Cp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Ip({},l,{comment:o}):l;return Il(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Fp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Cp({url:`/tasks${s?_r(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Ip({objectURIs:[i]},(0,l.reject)(E,a)))};return Il(u,Ip({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},Mp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Il(Cp({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},xp=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Il(Cp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(Ip({max:a,offset:o},i))})},$p=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Il(Cp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Vp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Il(Cp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Gp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Vp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Wp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Il(Cp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Yp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Vp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},Bp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Vp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},qp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Vp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Hp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Il(Cp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Qp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Il(Cp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Kp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(es);return a&&a[0]&&(r=n.length>0&&a[0].value?Kp(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}}),""),Jp=(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=Kp(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},Xp=/[,\s]*$/,zp=e=>{const t=Zr().text(Jr);if(!e)return t;const r=e.replace(Xp,"");return""===r.toString().trim()?t:r},Zp=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},ed=(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=Zp(e,r.referencedEntityTypeURI);if(n)return Jp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Jp({attributes:t||{}},r.dataLabelPattern);return""},td=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},rd=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},nd=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",id=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),_l,(0,l.prop)("value"))),ad=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),id),od=(e,t,r)=>{const n=ad(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(ms(e),id)))(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")])})(Ir(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Ts(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,id))(r)})(e,r)||kr(e,r.type);return nd(t,n)};function sd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ld(e,t,r[t])}))}return e}function ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ud="DTSS/",cd=(0,l.replace)(new RegExp("^entities/"),""),pd=e=>ud+e.dataTenant+"/"+e.uri,dd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),yd=e=>!(!e||!e.dataTenant),fd=(0,l.startsWith)(ud),Td=(0,l.pipe)((0,l.ifElse)(fd,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),Ed=(0,l.ifElse)(yd,pd,(0,l.prop)("uri")),md=e=>e&&e.uri?e.dataTenant?pd(e):cd(e.uri):"",hd=(0,l.curry)(((e,t,r)=>(Ir(t,r.type)||{})[e]||"")),bd=hd("label"),Od=hd("typeGraphIcon"),vd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ir(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(es)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:ed(e,o,i),uri:a.uri}})).filter(l.identity):[]},gd=(0,l.pipe)(vd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),_d=(0,l.curry)(((e,t)=>{if(!t)return[];if(1===e.length){return t[e[0]]||[]}{const r=t[e[0]];return Array.isArray(r)?r.reduce(((t,r)=>{if((0,l.is)(Object,r.value)){const n=_d(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):_d(e.slice(1),r)}})),Ad=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Nd=e=>(0,l.propOr)([],"matchRules",e),Pd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?sd({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Rd=(e,t,r)=>t&&r?r.aEntity:e,Sd=(0,l.evolve)({attributes:dl(!0)}),wd=(0,l.pipe)(Sd,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Id=e=>(0,l.assoc)("dataTenant",e),Ud=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Il(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),gr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Cd=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 Il(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),gr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ld=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Il("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},jd=(e,t,r)=>Promise.all(t.map((async t=>await Il(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),Dd=async(e,t)=>await jd(e,t,"NOT"),kd=async(e,t)=>await jd(e,t,"MATCH"),Fd=async(e,t)=>await Promise.all(t.map((async t=>await Il(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",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){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}function $d(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 Vd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Il(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Gd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return sy({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Wd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return sy({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Yd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Il(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Bd=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 Yd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},qd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(yd,i);return Promise.all([s.length?Ld(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Yd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Hd=(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=$d(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)}),[])),Qd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Hd),Kd=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Il(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Qd)},Jd=e=>t=>{let{dtssPath:r,dataTenants:n=[],customerTenant:i,entity:a}=t;return Promise.all(n.map((t=>{let{id:n}=t;return e({dtssPath:r,dataTenant:n,customerTenant:i,entity:a}).then((0,l.map)((0,l.assocPath)(["object","dataTenant"],n))).catch((e=>(console.log(e),[])))}))).then(l.flatten)},Xd=Jd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Il(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Qd)})),zd=Jd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Il(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),Zd=(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)}},ey=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Il(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},ty=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 ey(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},ry=ty("NOT"),ny=ty("MATCH"),iy=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(yd,a);return Promise.all([jd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return ey(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},ay=iy("NOT"),oy=iy("MATCH");function sy(e){let{requestProvider:t=Il,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}`,Md({},$d(s,["headers"]),{headers:Md({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const ly=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return sy({url:Ac(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},uy=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return sy({url:Ec(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},cy=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=Zc(t,r);return sy({url:`entities/_connections/_getConnections${_r({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(ep,(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)))}))))},py=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return sy({url:`${Ic(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},dy=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Il(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},yy=e=>{let{dtssPath:t,tenant:r}=e;return Il(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},fy=e=>{let{dtssPath:t,customerTenant:r}=e;return Il(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},Ty=e=>{let{dtssPath:t,tenants:r}=e;return Il(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},Ey=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return sy({url:Ic(t),dataTenant:r,customerTenant:n,dtssPath:i})},my=()=>Il("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});function hy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 Oy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=hy({},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 Il(`${t}/api/${r}/graph/search${_r({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},vy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Il(`${t}/api/${r}/graph/search/count`,{method:"POST",body:hy({},n,i),headers:{"Content-Type":"application/json"}})},gy=(e,t)=>`${e}/${t}/comments`,_y=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Il(`${gy(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Ay=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Il(`${gy(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ny=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Il(gy(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Py=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Il(`${gy(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Ry=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Il(`${gy(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Sy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Il(`${gy(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},wy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Il(`${gy(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Iy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Il(`${gy(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Uy=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=_r({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Il(`${gy(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Cy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ly(e,t,r[t])}))}return e}function Ly(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jy=e=>{let{tenant:t,servicesPath:r}=e;return Il(`${r}/oauth/proxy${_r({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Dy="graphExport",ky=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await $y({servicesPath:e,tenant:t,environment:r,namespace:Dy,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Cy({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await $y({servicesPath:e,tenant:t,environment:r,namespace:Dy,options:Cy({method:"PUT"},o)})}catch(e){s=null}return s||(s=await $y({servicesPath:e,tenant:t,environment:r,namespace:Dy,options:Cy({method:"POST"},o)})),s},Fy=e=>{let{servicesPath:t,key:r}=e;return Il(`${t}/settings${_r({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},My=e=>{let{servicesPath:t}=e;return Il(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},xy=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Il(`${n}/plugins${_r({tenant:t,user:r})}`,{method:"GET"})},$y=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Il(`${n}/configService${_r({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Vy=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return $y({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Gy=e=>{let{servicesPath:t,stateHash:r}=e;return Il(`${t}/searchLink?key=${r}`,{method:"GET"})},Wy=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),Il(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},Yy=e=>Il(`/${e}?showObjectsInfo=true`,{method:"GET"}),By=e=>{let{exportPath:t,tenant:r,options:n}=e;return Il(`${t}/${r}/activities${_r(n)}`,{method:"POST"})};function qy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hy(e,t,r[t])}))}return e}function Hy(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=>{const{entityUri:t}=e;return Il(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ky=e=>{let{entityUri:t,crosswalk:r}=e;return Il(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Jy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Il("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[qy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),qy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},Xy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Il(`/${r}/_${n}${_r({contributorURI:t})}`,{method:"POST"})},zy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Il(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},Zy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Il(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},ef=e=>{let{entityUri:t,crosswalkId:r}=e;return Il(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};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=>{let{entityTypeUri:t}=e;return Il(`/dataQuality/fillRates${gr({entityType:Nt(t)})}`,{method:"GET"})},nf=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tf(e,t,r[t])}))}return e}({},n===Fe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Il(`/entityType/${Nt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},af=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Il(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Nt(n)}`,{method:"GET",headers:{env:i}})},of=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Fe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return Il(`${t}/${r}/entityType/${Nt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},sf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Il(`/${t}${_r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},lf=e=>{let{attributeUri:t,value:r}=e;return Il(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},uf=e=>{let{attributeUri:t,value:r}=e;return Il(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},cf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Il(`/${t}${_r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},pf=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=_r({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=dl()([[{value:a}]]);return Il(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},df=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Il(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},yf=e=>{let{entityUri:t,attributeName:r}=e;return Il(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};function ff(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Tf=e=>{let{entityUri:t}=e;return Il(`/${t}/_historicURIs`,{method:"GET"})},Ef=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 Il(`/${t}/_changesWithTotal${_r(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){ff(e,t,r[t])}))}return e}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},mf=(e,t)=>Il(`/${e}/_previousChange${_r({timestamp:t})}`,{method:"GET"}),hf=(e,t)=>Il(`/${e}${_r({time:t})}`,{method:"GET"});function bf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Of(e,t,r[t])}))}return e}function Of(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return Il(t,{method:r||"GET",body:n,headers:bf({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},gf=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=_r({options:a.join(","),severity:o.join(",")});return Il(`${t}/validate/${i}/entity/${md({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},_f=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Il(`${t}/validate/${n}/entity${_r({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Af=e=>{let{tenant:t,apiPath:r}=e;return Il(`${r}/tenants/${t}/name`,{method:"GET"})},Nf=e=>{let{tenant:t,apiPath:r}=e;return Il(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Pf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Il(`${a}/preferences${_r({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Rf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return Il(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},Sf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Il(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},wf=e=>{const{servicesPath:t}=e;return Il(`${t}/getTokenForWorker`,{method:"GET"})};var If=r(29524);const Uf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Et(),s={attributes:el({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=Ts(r,e,n.uri)[0];return i&&i.value?al({entity:e,attributeType:n,uri:i.uri,value:t}):nl({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Cf=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(cs),(0,l.filter)(Tt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Lf=(0,l.curry)(((e,t)=>{const r=Cf(e=e||{},t=t||{});return r.concat((0,l.chain)(Lf(e),r))})),jf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),Df=jf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),kf=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Tt)),Ff=e=>(0,l.pipe)(Df,kf(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),Mf=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(Df,(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})),xf=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Tt),(0,l.omit)(["uri","timestamp"])),$f=(0,l.pipe)(xf,Sd),Vf=async(e,t,r)=>{if(!e)return null;const n=Ff(e);if(n.length>0)for(const r of n)e=Mf(r,t[r],e);const i=await Lc($f(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Gf=async(e,t,r)=>{const n=Yf(e,t),i={};for(const t of n)i[t]=await Vf(e[t],i,r);return i},Wf=(0,l.curry)(((e,t)=>{const r=If.Node(t);return Ff(e[t]).forEach((t=>{const n=Wf(e,t);r.addEdge(n)})),r})),Yf=(e,t)=>(0,l.pipe)((0,l.map)(Wf(e)),(0,l.map)(If.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),Bf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)(xf))})),qf=(e,t)=>{const r=DE(e.tags||[],t.tags||[]),n=kE(e.roles||[],t.roles||[]),i=wE(e,t),a=IE(e,t);return[...UE(SE((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),jE((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...r,...n,...i,...a]},Hf=(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 Mf(r,n,e)}),e))))}),t)}),Bf),Qf=(0,l.curry)(((e,t)=>(0,l.when)(Tt,(0,l.propOr)(l.__,t,e),t)));function Kf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jf(e,t,r[t])}))}return e}function Jf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Me.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},zf=e=>{let{relationUri:t}=e;return{type:Me.DELETE_RELATION,parameters:{relationUri:t}}},Zf=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Me.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},eT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Me.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},tT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Me.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},rT=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),nT=e=>e.type===Me.DELETE_RELATION,iT=e=>e.type===Me.CREATE_RELATION,aT=e=>e.type===Me.REPOINT_RELATION,oT=e=>e.type===Me.UPDATE_RELATION,sT=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),lT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Me.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return ap({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Me.DELETE_RELATION:return()=>{const{relationUri:e}=r;return ip(e,i).then(o)};case Me.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return up(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Me.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return op({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Me.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[zf({relationUri:o}),Xf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(uT(n)),(0,l.map)(lT),sT)(s)}}},uT=e=>t=>Kf({dcrProcessor:e},t),cT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Ar({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(uT(r)),(0,l.map)(lT),sT,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},pT=e=>t=>(0,l.map)((t=>Kf({},t,{parameters:(0,l.evolve)({parentUri:Qf(e),entityUri:Qf(e),newEntityUri:Qf(e)},t.parameters)})),t),dT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},yT=(e,t)=>{const r=e.filter(iT).find(rT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>oT(o)&&rT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!aT(o)||!rT(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(dT({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},fT=(e,t)=>{const r=e.filter(aT).filter(rT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!oT(i)||!rT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(dT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},TT=(e,t)=>{const r=e.filter(nT).filter(rT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!rT(t,e)))},ET=(e,t)=>{const r=e.filter(oT).filter(rT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!oT(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(dT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},mT=e=>{const t=e.filter(nT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(TT,e)},hT=e=>{const t=e.filter(iT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(yT,e)},bT=e=>{const t=e.filter(aT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(fT,e)},OT=e=>{const t=e.filter(oT).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(ET,e))(t)},vT=e=>(0,l.pipe)(mT,hT,bT,OT)(e);function gT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_T(e,t,r[t])}))}return e}function _T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AT=e=>gT({},(0,l.path)(kT(),e),{startDate:(0,l.path)($T(),e),endDate:(0,l.path)(VT(),e)}),NT=(e,t)=>(0,l.pipe)((0,l.path)(xT()),Qf(t))(e),PT=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=NT(e,r),i=(0,l.path)(FT(),e)===xe.IN,a=e.parentEntityUri||n;return Xf({parentUri:i?t:a,relation:AT(e),entityUri:i?a:t})})),...o.map((t=>{const i=NT(t,r),a=(0,l.path)(FT(),t)===xe.IN,o=i!==(0,l.pipe)((0,l.path)(kT()),a?GT:WT)(t),s=qT(e,(0,l.path)(jT(),t)),u=t.parentEntityUri||n,c=Qf(r,i);return o?tT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(kT(),t),isReversed:!1}):eT({oldRelation:(0,l.path)(kT(),s),newRelation:AT(t)})})),...i.map((e=>zf({relationUri:e}))),...s.map((e=>Zf({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},RT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return gT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),ST=(0,l.has)("dataTenant"),wT=(0,l.ifElse)(ST,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),IT=(e,t)=>(0,l.pipe)(si,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Is),Aa)(e,t),UT=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)}},CT=(e,t,r)=>{const n=Jp(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)},LT="relation",jT=(0,l.always)([LT,"relationUri"]),DT=(0,l.always)([LT,"relationType"]),kT=(0,l.always)([LT,"object"]),FT=(0,l.always)([LT,"direction"]),MT=(0,l.always)([LT,"object","attributes"]),xT=(0,l.always)(["entity","entityUri"]),$T=(0,l.always)([LT,"startDate"]),VT=(0,l.always)([LT,"endDate"]),GT=(0,l.path)(["startObject","objectURI"]),WT=(0,l.path)(["endObject","objectURI"]),YT=(0,l.path)(["startObject","objectTypeURI"]),BT=(0,l.path)(["endObject","objectTypeURI"]),qT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(jT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=qT(r.connections,t);if(e)return e}}},HT=(0,l.pipe)(qT,(0,l.path)(kT())),QT=(0,l.allPass)([(0,l.pipe)((0,l.path)(xT()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(DT()),(0,l.complement)(E))]),KT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:mt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=zT({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=JT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?UT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},JT=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:Xr.IN}:{type:t[0],direction:Xr.OUT}:null},XT=e=>e.uri||e,zT=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&bi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===Xr.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"],Ir(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ir(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(XT,si(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Xr.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(Xr.OUT)),(0,l.map)(u))},t)||{}},ZT=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=di({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=ui(e,n.uri);return n&&(!t||Cr(e,i,t))&&(!r||Cr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ir(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ir(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)($o,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},eE=(0,l.curry)(((e,t,r,n,i)=>{const a=Cr(n,l.__,t.type),o=e?BT:YT,s=Cr(n,l.__,r.type),u=e?YT:BT;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),tE=(e,t,r)=>{const n=e?BT:YT,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(Cr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function rE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nE(e,t,r[t])}))}return e}function nE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return rE({},t,{[r]:{parents:n,children:i}})},aE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return rE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},oE=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=Cf(t,i),o=iE({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>oE(n.uri,t,[e],r)),o)},sE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.reduce(((e,n)=>{const i=(0,l.path)(jT(),n),a=t?aE({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(xT(),n),s=Tt(o)?[o]:[],u=iE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>oE(t,r,[i],e)),u)}),n)},lE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return sE(r,e,t,oE(e,t))},uE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return lE(t,r,n);if(bt(e)){const t=qT(n,e);return t&&sE([t],null,r)}return r[e]?oE(e,r):void 0},cE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>cE(e,t))))},pE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>pE(e,t))))},dE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=ht(t),u=lE(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(bt(c)){if(s=qT(i,c),!s)return null;o.push({type:ve.relationConnection,value:s,valueType:si(a,(0,l.path)(DT(),s))});continue}if(bt(u)){const e=n[c];if(!e)return null;o.push({type:ve.tempEntity,value:e,valueType:Ir(a,e.type)});continue}const p=n[u],d=Ss(p,c),y=n[c];if(!d||!y)return null;o.push({type:ve.attributeValue,value:d,valueType:nr(a,wt(d.uri,p.type))}),o.push({type:ve.tempEntity,value:y,valueType:Ir(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},pE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=bt(s),d=p?HT(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?si(a,d.type):Ir(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ir(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:ve.tempEntity,value:T,valueType:Ir(a,T.type)}),o.push({type:ve.attributeValue,value:s,valueType:E}),m=s.value;const l=cs(s);T=l&&Tt(l)?n[l]:null}}return o},yE=e=>e.every((e=>{let{type:t}=e;return[ve.attributeValue,ve.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ve.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,fE=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(fE(e))}))}))),t},TE=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(bE,t),(0,l.propOr)([],"crosswalks",e))),e),EE=(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(EE(e))}))})),r},mE=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=mE(e);r>t&&(t=r)}))})),t+1):t},hE=(e,t)=>{if(Tt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},bE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},OE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},vE=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},gE=(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)},_E=(0,l.eqBy)(bE),AE=(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)(is,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function NE(e){return e&&void 0!==e.uri}function PE(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 RE(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 SE(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(SE(d.value,y.value,r)):"Reference"===g(d)?RE(d,y)?o.push.apply(o,SE(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function wE(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)||NE(r)&&NE(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function IE(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 UE(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=CE(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?LE(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=CE(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const CE=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),LE=(e,t,r)=>(0,l.pipe)(ws,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return hE(t,r)},e=>{let[t]=e;return!es(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function jE(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 DE(e,t){return PE("UPDATE_TAGS").call(this,e,t)}function kE(e,t){return PE("UPDATE_ROLES").call(this,e,t)}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}var xE=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ue(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=FE({},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:FE({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const $E=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?$E(t.value):[]];return e.concat(r)}),[])),VE=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,GE=e=>{const t=[...$E((null==e?void 0:e.attributes)||[]),...$E((null==e?void 0:e.analyticsAttributes)||[])];return e?[Ed(e),...t]:[]},WE=(e,t)=>[e,...t.map((t=>VE(e,t)))],YE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return wT(t)}))},BE=(e,t)=>{switch(e){case ge.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ge.ENTITY_ATTRIBUTE:case ge.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[It(t)]})(t);case ge.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ge.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,Ed({uri:n,dataTenant:i}),r]})(t)}},qE=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),HE=(0,l.curry)(((e,t)=>{const r=po(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(HE(e,r.extendsTypeURI)):n})),QE=(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))),KE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),HE(e),QE(t))(t);function JE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const XE=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}},zE=e=>!e.deactivated,ZE=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},em=e=>ZE(e)+e.message,tm=(0,l.unless)(l.isNil,(0,l.prop)("message")),rm=(0,l.unless)(l.isNil,(0,l.prop)("type")),nm=(0,l.curry)(((e,t)=>_t(t.parentUri,e))),im=(0,l.curry)(((e,t)=>t.parentUri===e)),am=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),_t(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Xe.TYPE_REFERENCE),(0,l.pipe)(rt,(0,l.any)(_t(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),om=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),sm=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),lm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([Em,zE,nm(e),am(t),(0,l.complement)(sm(e,t.uri))]))(r)},um=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([Em,zE,im(e),om(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",me.missed))]))(r);return n&&n.message||""},cm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===me.missed))},pm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zE,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(jT(),e))]))(t)},dm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zE,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},ym=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([zE,nm(t)]))(r)},fm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([zE,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},Tm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?dE(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case ve.attributeValue:{const e=a;if(Ht(a))return Jp(o,e.dataLabelPattern);if(Qt(a)){const t=o,i=cs(t),a=et(e),s=Ir(n,a);return Tt(i)?Jp(r[i],s.dataLabelPattern):t.label}return""}case ve.tempEntity:return Jp(o,a.dataLabelPattern);case ve.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ir(n,null==e?void 0:e.entityType);return`${zp(i&&Tt(i)?Jp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||li(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){JE(e,t,r[t])}))}return e}({},e,{label:zp(t)})}))},Em=e=>!e.severity||e.severity===be.ERROR,mm=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Xe.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(mm(n))}));case Xe.TYPE_REFERENCE:return!!ns(t);case Xe.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),hm=(e,t)=>e.every((0,l.complement)(mm(t))),bm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=Eo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Ts(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!es(e.parent))))).forEach((e=>{hm(e.attrValues,n)&&r.push(XE({type:me.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:Zr().text("Attribute is required"),source:he.local}))})),r}),[])},Om=(0,l.curry)(((e,t,r)=>Ts(e,t,r,!1))),vm=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Ir(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Bt),(0,l.filter)(Qt),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(Om(e,t)));return(0,l.pipe)(r,(0,l.reject)(cs),(0,l.map)((e=>{let{uri:r}=e;return XE({type:me.missedRefEntity,uri:"",attributeTypeUri:wt(r,t.type),parentUri:r,message:Zr().text("Entity is required"),source:he.local})})))(t)},gm=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(cs,Tt)).flatMap((n=>{const i=cs(n),a=t[i],o=nr(e,wt(n.uri,r.type));return _m(e,t,o,a)})),_m=(e,t,r,n)=>{const i=rt(r),a=i.map((t=>nr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Xe.TYPE_REFERENCE))).flatMap(it).concat(i);return Am(e,t,n,(e=>a.some(_t(e.uri))))},Am=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=bm(e,r,n),a=vm(e,r),o=gm(e,t,r);return[...i,...a,...o]},Nm=(e,t)=>{const r=(0,l.path)(kT(),t)||{};return bm(e,r)},Pm=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(xT()),(0,l.ifElse)(Tt,(e=>t[e]),(0,l.always)(null)))(r),i=Nm(e,r),a=(e=>(0,l.path)(xT(),e)?[]:[XE({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(DT(),e),parentUri:(0,l.path)(jT(),e),message:Zr().text("Entity is required"),source:he.local})])(r),o=((e,t,r)=>r?Am(e,t,r):[])(e,t,n);return[...i,...a,...o]},Rm=e=>(0,l.path)(["entity","uri"],e)?[]:[XE({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:Zr().text("Entity is required"),source:he.local})],Sm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=bm(e,r),i=Rm(t);return[...n,...i]};function wm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Im=(e,t)=>{var r,n;const i=Ir(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Va(e)},Um=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Cm=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Um(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},Lm=(e,t)=>(0,l.when)((0,l.prop)("refEntity"),(0,l.pipe)((0,l.when)((0,l.allPass)([(0,l.prop)("refRelation"),(0,l.always)("INSERT_ATTRIBUTE"===t),(0,l.pipe)(ps,Tt,l.not)]),(e=>{const t=(0,l.pipe)(ps,Nt)(e);return Cm((e=>e.replace(t,t+ct)))(e)})),(0,l.when)((0,l.pipe)(cs,Tt),(t=>{const r=cs(t),n=e[r],i=n&&Dm(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){wm(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),jm=(e,t,r)=>UE(SE((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),jE((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(Lm(r,e.type)),(0,l.map)(Cm(Dt))))})(e))),Dm=(e,t)=>(0,l.evolve)({attributes:cl({valueTransformer:(0,l.pipe)(fs,Lm(t),Um(Dt)),deleteEmptyComplex:!0}),uri:Dt})(e);function km(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Fm(e,t,r[t])}))}return e}function Fm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mm=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(ut,"g"),"uri$$$$").replace(new RegExp(ct,"g"),""))),xm=e=>(0,l.pipe)((0,l.evolve)({objectUri:Mm,objectParentUri:Mm}),(e=>{return km({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?me.missed:me.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&jt(e.objectUri),uri:e.objectUri,source:he.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),$m=(e,t)=>(0,l.map)((0,l.pipe)(xm,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=Tm(t,s),p=null!=c&&c.length?c.slice(0,-1):Tm(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&nr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ve.attributeValue&&(a=e.valueType)}return a})(o,c,e);return km({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&Lt(i)){const n=(0,l.last)(a),i=n.valueType;if(Qt(i)&&at(i).includes(o)){const i=cs(n.value),o=i&&Tt(i)?t[i]:null;return o?km({},e,{parentUri:o.uri,path:a.concat({type:ve.tempEntity,value:o,valueType:Ir(r,o.type),label:""})}):e}}return e}})(t)))(e),Vm=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var Gm,Wm=r(33164);function Ym(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(Gm||(Gm={}));const Bm={},qm={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"]}},Hm=(0,l.curry)(((e,t)=>{const r=(e=>{if(!Bm[e]){const t=qm[e]||qm.random0;Bm[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){Ym(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Bm[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]})),Qm=e=>Hm(Gm.Charts,e),Km=e=>Hm(Gm.Random1,e),Jm=e=>(0,Wm.getColor)(e)?"#FFFFFF":"#212121";var Xm=r(51404),zm=r.n(Xm);const Zm=Array.from({length:100},((e,t)=>t/100)),eh=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)},th={},rh=new(zm())({hash:eh,saturation:Zm.slice(15,71),lightness:Zm.slice(50,90)}),nh=(0,l.curry)(((e,t,r)=>{t in th||(th[t]={});const n=th[t];r in n||(n[r]=((e,t)=>{const r=String(eh(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),ih=nh(rh,"crosswalks"),ah=nh(rh,"sources"),oh=nh(rh,"contributors"),sh=nh(rh,"dataValidationFunctions");function lh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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=(0,l.has)("items"),ph=e=>0===e,dh=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)},yh=e=>e.reduce(((e,t)=>e+t.width),0),fh=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),Th=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),Eh=e=>e.reduce(((e,t)=>e+t.height),0),mh=e=>(0,l.is)(String,e)&&e.includes("%"),hh=e=>Boolean(e.spacer),bh=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),Oh=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(ch(t)?Oh(t):t)),[]),vh=e=>({id:e.layout}),gh=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vh;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=mh(r.width)?bh(i,r.width):u}return dh(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return dh(n,t,r)},o=(e,t)=>ch(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,ch(s)?n(s.layout):e(s.view)),d=ph(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(ch(s))return o.concat(p(lh({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(lh({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:yh(o),height:fh(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=ch(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=ph(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(ch(i))return r.concat(p(lh({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(lh({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?dh(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?dh(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:Th(i),height:Eh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=ph(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return lh({},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=lh({},e,{width:a}),s=lh({},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(lh({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return lh({},e,{height:Eh(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(lh({},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 lh({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=lh({},t,{items:(0,l.reject)(hh,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 Oh(f)},_h=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Ah=[Ge.FilteredEntitiesViewFacet,Ge.ActivitiesViewFacet,Ge.ProfileStatsFacet,Ge.FilteredSavedSearchesFacet],Nh=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Ah.includes(a.component)?8:4;return lh({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Ph(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rh(e,t,r[t])}))}return e}function Rh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sh={BarChart:Ve.BAR,BarChartGrouped:Ve.BAR,BarChartHorizontal:Ve.BAR,LineChart:Ve.LINE,Map:Ve.MAP,Pie:Ve.PIE},wh=(e,t)=>Ut(e)?Rt(e,t):e,Ih=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Sh[r];return Ph({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Uh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Ph({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"]))},Ch=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Ph({},e,{value:[Vr,Gr,Mr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Yr(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Ut(t)||!r?n:(n||[]).concat((i=r,{filter:Mr.EQUALS,fieldName:"type",values:[i]}));var i},Lh=["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"],jh={"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:wh(n,r),filters:Ch(a,n,r),chartType:Ve.BAR,component:Ge.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:wh(n,r),filters:Ch(a,n,r),chartType:Ve.BUBBLE,component:Ge.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:Ge.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Ph({id:t,count:o,canRead:u,orderType:s,attributeUri:wh(r,p),filters:Ch(a,r,p),component:Ge.DashboardFacet,title:i,showOthers:!0},Ih(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:wh(n,r),filters:Ch(a,n,r),chartType:Ve.MAP,component:Ge.DashboardFacet,title:i,geoUrl:Lh[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 Ph({id:t,count:o,canRead:l,attributeUri:wh(n,r),filters:Ch(a,n,r),component:Ge.DashboardFacet,title:i,geoUrl:s,chartType:Ve.MAP,projection:"geoMercator"},Ih(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:Uh(i),component:Ge.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:Ch(n,null,a),component:Ge.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:Mr.GTE,fieldName:"matches",values:["1"]}],component:Ge.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:Ge.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ve.CLOUD,component:Ge.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ve.TREE,component:Ge.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.NotificationInboxFacet,title:n||Zr().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ActivitiesViewFacet,title:n||Zr().text("Activity log")}}},Dh=e=>({id:e,height:10}),kh=(0,l.pipe)((0,l.map)((e=>{const t=jh[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Fh=e=>{if("0.1"===e.version){const t=kh(e.views),r=gh(Dh,e.layout,{columns:4});return{id:e.id,margin:0,layout:_h(r,t),views:t}}return e},Mh=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>Mh(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function xh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$h(e,t,r[t])}))}return e}function $h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vh=xh({},We,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Gh=e=>e,Wh={[Vh.Attributes]:Gh,[Vh.HierarchyTree]:Gh,[Vh.HierarchyPaths]:Gh,[Vh.RelationsTable]:Gh,[Vh.Relations]:e=>xh({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Vh.SingleAttributeView]:Gh,[Vh.CustomView]:Gh,[Vh.TableAttributeView]:Gh,[Vh.MapView]:Gh,[Vh.OldTreeView]:e=>xh({},e,{class:We.HierarchyTree}),[Vh.OldMapView]:e=>xh({},e,{class:We.MapView}),[Vh.ImageAttributeView]:Gh,[Vh.PotentialMatchesView]:Gh},Yh=(0,l.pipe)((0,l.map)((e=>{const t=Wh[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Bh=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===We.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),qh=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return xh({},t,{layout:e.newLayout});if("0.1"===e.version){const r=Yh(e.views),n=gh(Bh(r),e.layout,{columns:4});return xh({},t,{layout:_h(n,r),views:r})}return e},Hh=(e,t)=>e.class===t||e["react-class"]===t,Qh=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Hh(t,We.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return Hh(t,We.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(_t(n))||t.some(_t(n))}},Kh=(e,t)=>e.filter((e=>t.some((t=>Hh(e,t))))).map((e=>{let{id:t}=e;return t})),Jh=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Xh=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),zh=(e,t)=>(e||[]).find((e=>e.activator===t)),Zh=e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function eb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tb(e,t,r[t])}))}return e}function tb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rb=(e,t)=>Mh(t).map((t=>(0,l.pipe)((0,l.map)((e=>Jh(e,t))),(0,l.reject)(l.isNil),l.head)(e))),nb=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},ib=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];if("2.0"===r&&t.newLayout){const{newLayout:e}=t;return(0,l.pipe)((0,l.pick)(["views","sidePanelViews","profileBand"]),(0,l.mergeRight)({entityType:n,layout:e}),(0,l.reject)(l.isNil))(t)}const i=rb(e,t.layout),a=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>Jh(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return Mh(r.layout||{})}})(e,t),o=qh(eb({},t,{views:i,version:"0.1"})),s=(0,l.pipe)(Zh,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:o.views,layout:o.layout,sidePanelViews:a,profileBand:s})},ab=(e,t)=>{if("scroll"===t.layout.layout){const r=rb(e,t.layout),n=Fh(eb({},t,{views:r,version:"0.1"}));return{class:Be.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Be.Dashboard,views:t.views,layout:t.layout,id:t.id}},ob=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},sb=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},lb=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},ub=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},cb=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},pb=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},db=(e,t)=>{const r=rb(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Xh(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Be.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},yb=(e,t)=>({class:Be.Graph,id:t.id}),fb=(e,t)=>{const r=rb(e,t.layout)[0];return{class:Be.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},Tb=e=>t=>!!(0,l.intersection)(e,t).length,Eb=(0,l.cond)([[Tb(["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"]),()=>ab],[Tb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>ob],[Tb(["com.reltio.plugins.graph.GraphView"]),()=>yb],[Tb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>sb],[Tb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>lb],[Tb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>ub],[Tb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>cb],[Tb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>pb],[Tb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>db],[Tb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>fb],[l.T,()=>(0,l.always)(void 0)]]),mb=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(nb),(0,l.map)((t=>ib(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand"])))(e);return{class:Be.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:qe.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:qe.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>Jh(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Be.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>Jh(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=ib(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Be.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=Mh(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return Eb(o)(t,i)};function hb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bb(e,t,r[t])}))}return e}function bb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ob=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},vb="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var gb;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(gb||(gb={}));const _b={[Be.DQDashboard]:`${vb}DqDashboard.svg`,[Be.Dashboard]:`${vb}Dashboard.svg`,[Be.Graph]:`${vb}Graph.svg`,[Be.RelationshipSearch]:`${vb}GraphSearch.svg`,[Be.Interactions]:`${vb}Interactions.svg`,[Be.PotentialMatches]:`${vb}PotentialMatches.svg`,[Be.Profile]:`${vb}Profile.svg`,[Be.NestedProfile]:`${vb}Profile.svg`,[Be.ProfileActivityLog]:`${vb}ActivityLog.svg`,[Be.Relationships]:`${vb}Relationships.svg`,[Be.Sources]:`${vb}Crosswalk.svg`,[Be.Search]:`${vb}Search.svg`,[gb.DashboardGroup]:`${vb}DashboardGroup.svg`,[gb.ProfileGroup]:`${vb}ProfileGroup.svg`,[gb.SearchGroup]:`${vb}SearchGroup.svg`,DEFAULT:`${vb}Default.svg`},Ab=e=>_b[null==e?void 0:e.class]||_b.DEFAULT,Nb=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Be.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>hb({},e,{nestedRoute:`${t+1}`})))))),Pb=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},Rb=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?_b[gb.ProfileGroup]:null,Sb=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===_b[Be.Dashboard]||t===_b[Be.DQDashboard]})),(0,l.always)(_b[gb.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===_b[Be.Search]||t===_b[Be.RelationshipSearch]})),(0,l.always)(_b[gb.SearchGroup])],[l.T,()=>null]])(e),wb=e=>(0,l.pipe)((0,l.chain)(Ob),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>hb({},e,{entityTypes:e["entity-types"],screen:mb(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=Nb(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:Ab(r),screen:Pb(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=mb(t,e);return{label:t.label,icon:Rb(t)||Sb(r)||Ab(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Ib(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ub=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Cb=e=>({id:e,height:10}),Lb=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)(Ub),(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=kh(((e,t)=>{const r=Mh(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ib(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=gh(Cb,t.layout,{columns:4});return{views:r,layout:_h(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function jb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Db=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,kb=e=>(0,l.pipe)((e=>Xh(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jb(e,t,r[t])}))}return e}({},t,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["action"]))})))(e),Fb=(0,l.prop)("showLookupCode"),Mb=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>Jh(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=>Jh(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>Jh(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=>Jh(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=>Jh(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),p=(e=>(0,l.pipe)((e=>zh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("default-perspective"),(0,l.ifElse)(Db,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=kb(e),y=(e=>(0,l.pipe)((e=>zh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkUser"))(e))(e),f=(e=>(0,l.pipe)((e=>zh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkIdle"))(e))(e),T=(e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>Jh(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),m=void 0===(h=Fb(E))||h;var h;const b=null===(t=Zh(e))||void 0===t?void 0:t.showEntityId,O=(e=>(0,l.pipe)((e=>zh(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("preview"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:m},validate:{levels:a,validateReadMode:o},attributePresentations:u,workflow:{enabled:c},defaultRoute:p,customScripts:d,checkUser:y,checkIdle:f,showSwitchToClassic:T,showEntityId:b,preview:O}},xb=e=>({layout:wb(e),pivoting:Lb(e),properties:Mb(e)});var $b=r(58697),Vb=r.n($b);function Gb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wb(e,t,r[t])}))}return e}function Wb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yb=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}_${Vb()()}`;return n[e.id].push(t),i=!0,Gb({},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]++,Gb({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Bb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qb(e,t,r[t])}))}return e}function qb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Hb={};const Qb=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(Hb[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}Hb=Bb({},Hb,{[a]:Bb({},Hb[a]||{},{worker:i})})}else i=Hb[a].worker,Hb[a].innerText&&t({task:{action:Qe.SET_HTML,params:{html:Hb[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Hb[a].onWorkerMessage);return i&&(Hb[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(Hb[a].innerText=n.params.html)}},i.addEventListener("message",Hb[a].onWorkerMessage)),i},Kb=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),Jb=(0,l.flip)(Kb),Xb=(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=Zr().number(t));return t})),zb=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?Zr().number(e,"0,0.0a").toUpperCase():Zr().number(e,"0,0"):""},Zb=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let eO=!0;const tO=e=>eO=e,rO=(e,t)=>e!==t&&t?eO&&e?`${t} (${e})`:t:e,nO=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),iO=(e,t,r)=>{const n=nO(e,t,r);return rO(r,n)},aO=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),oO=(0,l.complement)(aO),sO=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),lO=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)},uO=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(oO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),cO=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case Xe.TYPE_NUMBER:case Xe.TYPE_FLOAT:case Xe.TYPE_DOUBLE:case Xe.TYPE_LONG:case Xe.TYPE_INT:case Xe.TYPE_COUNT:return t&&Xb(o,t);case Xe.TYPE_BOOLEAN:case Xe.TYPE_BOOLEAN_RADIO:case Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?Zr().text("Yes"):Zr().text("No");case Xe.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Pu(t)?Ru(t):Zr().date(t,s));case Xe.TYPE_ACTIVENESS_DATE:case Xe.TYPE_LOCAL_DATE:return(t=t)&&(Pu(t)?Ru(t):Zr().date(t,s));case Xe.TYPE_TIMESTAMP:return(t=t)&&(Pu(t)?Ru(t):Zr().date(isNaN(t)?t:Number(t),u));case Xe.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Xe.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Xe.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?rO((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),pO={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},dO=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()}},yO=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})))),fO=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),dO,yO);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},TO="__metadata",EO=(e=>{const t=[TO,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),mO=(0,l.set)(EO),hO=(0,l.view)(EO),bO=mO(Qr.NEW),OO=mO(Qr.REMOVED),vO=mO(Qr.EDITED),gO=mO(Qr.IGNORED),_O=(0,l.pipe)(hO,(0,l.equals)(Qr.REMOVED)),AO=(0,l.pipe)(hO,(0,l.equals)(Qr.NEW)),NO=(0,l.pipe)(hO,(0,l.equals)(Qr.EDITED)),PO=(0,l.pipe)(hO,(0,l.complement)(l.isNil)),RO=(0,l.pipe)(hO,(0,l.equals)(Qr.IGNORED)),SO=(0,l.omit)([TO]),wO=(e,t)=>e===TO?void 0:t;function IO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UO=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=UO(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},CO=(e,t)=>UO((0,l.propEq)("nodeId",t),e),LO=(e,t)=>UO((0,l.pathEq)(["entity","uri"],t),e),jO=(e,t)=>{const r=CO(e,t);return r.length>1?r[r.length-2]:null},DO=(e,t)=>{const r=CO(e,t);return r.length>0?r[r.length-1]:null},kO=(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=>kO(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},FO=()=>{},MO=(e,t)=>{let{parent:r,nodeProcessing:n=FO}=t;n(e,r),e.children&&e.children.forEach((t=>MO(t,{parent:e,nodeProcessing:n})))},xO=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ue.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Ue.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Ue.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){IO(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},$O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&MO(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ue.addingChild||r.editingMode===Ue.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=xO({node:r,connection:n,isReversed:i}),s=Xf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ue.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=xO({node:r,isReversed:i,connection:n}),l=s?tT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):eT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},VO=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=VO(r,t);if(e)return e}return!1},GO=(0,l.curry)(((e,t)=>{const r=(0,l.map)(GO(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),WO=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>VO(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:GO(e,n.root)}}));return(0,l.pipe)(r,n)(t)},YO={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},BO={asc:"asc",desc:"desc"},qO=YO.entityLabel,HO=BO.asc,QO=(0,l.always)(0),KO=e=>{let{sortField:t=qO,sortOrder:r=HO,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case YO.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return mA.strings.sort(t,a,o)})(n,r);case YO.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return mA.strings.sort(e,i,a)})(r);default:return QO}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},JO=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(BO)),l.identity,(0,l.always)(HO))),XO=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(YO)),l.identity,(0,l.always)(qO)));var zO=r(91104);let ZO;const ev=(e,t)=>(ZO||(ZO=zO.createClient({key:t})),new Promise((t=>{ZO.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)}))}))),tv=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},rv=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(es).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[tv(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(rv(e.value,t,r))),n})),nv=e=>e&&e.length>0,iv=(e,t)=>[].concat(e&&e.attributes?rv(e.attributes,t):[]).filter(l.identity),av=(e,t,r,n,i)=>{if(e&&e.type){const t=(Ir(r,e.type).geoLocationAttributes||[]).map((t=>{return r=iv(e,t.latitude),n=iv(e,t.longitude),nv(r)&&nv(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(nv(t)&&t[0].value&&nv(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?ev(n.label,i).catch((()=>null)):Promise.resolve(null)},ov=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=Ir(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return av(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?ev(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)))},sv=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=Ir(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(nr(e,r.latitude,t.type)&&nr(e,r.longitude,t.type)){const e=iv(t,r.latitude),n=iv(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))},lv=(e,t,r)=>Promise.all([sv(e,t),ov(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 uv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cv(e,t,r[t])}))}return e}function cv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pv=(e,t)=>t.values.map(to(e,t.entityTypeUri)),dv=(e,t,r)=>$s(t.fieldName,r)||nr(e,Rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),yv=(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?rO(e,t):e}),r)},fv=(0,l.path)(["attrType","label"]),Tv=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>uv({},e,{[t]:!0})),{});e[r]=e[r]?uv({},e[r],n):n}return e}),{}),Ev=(0,l.pipe)((0,l.prop)("values"),E),mv=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",yn.type.name)),hv=e=>e.type===vv.NUMERIC_RANGE_FACET,bv=e=>e.type===vv.DATE_RANGE_FACET,Ov=(0,l.either)(hv,bv),vv={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},gv=e=>{switch(null==e?void 0:e.name){case yn.type.name:return vv.ENTITY_TYPE_FACET;case yn.createdBy.name:case yn.updatedBy.name:case yn.sourceSystems.name:case yn.tags.name:case yn.roles.name:case yn.matchRules.name:case yn.MLRecommendedMatch.name:return vv.WITH_DROPDOWN_CHECKBOXES_FACET;case yn.createdTime.name:case yn.updatedTime.name:case yn.startDate.name:case yn.endDate.name:return vv.DATE_RANGE_FACET;case yn.matches.name:case yn.matchScore.name:return vv.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return vv.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return vv.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return vv.DATE_RANGE_FACET;default:return vv.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},_v=(0,l.pipe)(dv,gv),Av=(0,l.pipe)((0,l.path)(["attrType","type"]),yr),Nv=(0,l.cond)([[hv,(0,l.always)(Mr.IN_RANGE)],[bv,(0,l.always)(Mr.WITHIN)],[(0,l.allPass)([Av,e=>e.values.length>=2]),(0,l.always)(Mr.EXISTS)],[l.T,(0,l.always)(Mr.EQUALS)]]),Pv=(0,l.cond)([[bv,(0,l.prop)("values")],[hv,(0,l.prop)("values")],[Av,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function Rv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sv=(0,l.pipe)((0,l.path)(["attrType","type"]),sr),wv=(0,l.pipe)((0,l.path)(["attrType","type"]),cr),Iv=(0,l.pipe)((0,l.prop)("attrType"),Gs),Uv=(0,l.pipe)((0,l.prop)("attrType"),Vs),Cv=e=>t=>t.values.map((t=>Ir(e,t).label)).join(" , "),Lv=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),jv=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(Zr().number),Lv)),(0,l.join)(","))(e.values);return`${fv(e)}: ${t}`},Dv=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),Lv)),(0,l.join)(","))(e.values);return`${fv(e)}: ${t}`},kv=e=>t=>`${fv(t)}: ${pv(e,t).join(", ")}`,Fv=e=>t=>{const r=yv(e,t);return`${fv(t)}: ${r.join(", ")}`},Mv=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[Uv,Cv(e)],[wv,jv],[Sv,Dv],[Iv,kv(e)],[l.T,Fv(t)]]),r))),xv=(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){Rv(e,t,r[t])}))}return e}({},t,{attrType:dv(e,t,n)}))),Mv(e,r))(t),$v=new RegExp(`^${Zr().text("Search")}`),Vv=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...xv(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)($v,"",u)]},Gv=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values,(0,l.concat)((0,l.values)(qr)))(Br),Wv=e=>(e=>Gv.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]=wu(t);return e.replace(r,i).replace(n,a)}),e))(e),Yv=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),Bv={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},qv=e=>[Bv.geoPolygon,Bv.onMapMove].includes(e),Hv=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Qv=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Kv=(e,t)=>qv(e)?t.map(Hv):[Qv(t)],Jv=e=>qv(e)?Zr().text("Geo Polygon"):Zr().text("Geo Location"),Xv=e=>{switch(e){case Bv.geoLocation:return"geoLocation";case Bv.geoPolygon:case Bv.onMapMove:return"geoPolygon"}},zv={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},Zv=e=>Zr().text(e),eg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Mr.EQUALS]:"=",[Mr.NOT_EQUALS]:"≠",[Mr.STARTS_WITH]:"*",[Mr.MISSING_VALUE]:Zr().text("missing value"),[Mr.HAS_ALL]:Zr().text("has all"),[Mr.IN_RANGE]:Zr().text("in range"),[Mr.FULL_TEXT]:Zr().text("full text"),[Mr.EXISTS]:Zr().text("exists"),[Mr.COUNT_EQUALS]:`${Zr().text("count")} =`,[Mr.COUNT_NOT_EQUALS]:`${Zr().text("count")} ≠`,[Mr.COUNT_LT]:`${Zr().text("count")} <`,[Mr.COUNT_LTE]:`${Zr().text("count")} <=`,[Mr.COUNT_GT]:`${Zr().text("count")} >`,[Mr.COUNT_RANGE]:Zr().text("count range"),[Mr.LT]:"<",[Mr.LTE]:"<=",[Mr.GT]:">",[Mr.GTE]:">=",[Mr.IN_FILE]:Zr().text("in file"),[Mr.NOT_IN_FILE]:Zr().text("not in file"),[Mr.CONTAINS]:"~",[xr.LIST_EQUALS]:"=",[xr.NOT_LIST_EQUALS]:"≠",[xr.LIST_EQUALS_CASE_SENSITIVE]:"=",[xr.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||Zr().text(e.toLowerCase())},tg=e=>({type:zv.operator,text:e}),rg=e=>({type:zv.operator,text:Zv(e)}),ng=e=>({type:zv.attributeLabel,text:e}),ig=e=>({type:zv.specialAttributeLabel,text:e}),ag=e=>({type:zv.attributeFilter,text:eg(e)}),og=e=>({type:zv.attributeValue,text:e}),sg=e=>({type:zv.entityTypeLabel,text:e}),lg=()=>({type:zv.space,text:" "}),ug=()=>({type:zv.bracket,text:"("}),cg=()=>({type:zv.bracket,text:")"}),pg=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),dg=(0,l.curry)(((e,t)=>t.map(pg(e)))),yg=(0,l.curry)(((e,t,r)=>[e,...r,t])),fg=yg(ug(),cg()),Tg=yg(lg(),lg()),Eg=(0,l.curry)(((e,t)=>[e,...t])),mg=e=>Eg(sg(e)),hg=e=>Eg(sg(`${e}: `)),bg=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=ou(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=iu(s),a=au(s);!r&&t&&n&&(i.push(ug()),r=!0),i.push(o),r&&a&&(i.push(cg()),r=!1);const l=e?rg(s):tg(s);i.push(...Tg([l]))}else i.push(o),r&&(i.push(cg()),r=!1)}return i}},Og=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),vg=(0,l.pipe)(bg({localizable:!1}),Og),gg=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},_g=e=>{let{data:t,values:r,filter:n}=e;return t&&Bu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},Ag=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(_g)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),Ng=(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)&&Zt(e.data.attrType)})(e)&&[Mr.HAS_ALL,Mr.EQUALS,Mr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:zt((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})))),lO),Pg=(e,t)=>(0,l.pipe)(Ng,uO(t))(e),Rg=(0,l.pathEq)(["data","fieldName"],yn.type.name),Sg=(0,l.path)(["data","entityTypeUri"]),wg=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Ig=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Wo(e)),attributes:(0,l.filter)((0,l.pipe)(Sg,(0,l.anyPass)([l.isNil,Wo(e),r=>{const n=(t.entityTypes||[]).filter(Wo(e));return(n.length>1?Dr(e,n):null)===r&&!!Ir(e,r)}])))})(t))))),Ug=e=>(0,l.pipe)((0,l.prop)("filter"),Bl,(0,l.equals)(e)),Cg=(0,l.curry)(((e,t,r,n,i,a)=>{const o=$s(n.fieldName)||n.attrType,s=_u(o,i),u=cO({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Zt(s),()=>(0,l.is)(Object,a)&&a.lookupCode?rO(a.lookupCode,a.value):iO(r,zt(o),a)],[()=>Gs(s),()=>to(e,n.entityTypeUri,a)],[()=>Ws(s),()=>Ao(e,a)],[()=>Ks(s),()=>Ro(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>cr(c)||yr(c)),bu),og)()})),Lg=(e,t,r,n)=>{const i=Cg(e,t,r,n.data,n.filter);return(0,l.cond)([[Ug(0),(0,l.always)([])],[(0,l.both)(Ug(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[lg(),i(r),{type:zv.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[lg(),...(0,l.pipe)(l.flatten,(0,l.map)(i),dg({type:zv.punctuationMark,text:", "}))(t)]}]])(n)},jg=(e,t)=>{const r=!!$s(e.data.fieldName);return(0,l.pipe)(gg,r?ig:ng)(e,t)},Dg=(e,t,r,n,i)=>[jg(n,i),lg(),ag(n.filter),...Lg(e,t,r,n)],kg=(0,l.addIndex)(l.map),Fg=(0,l.propEq)("length",1),Mg=(0,l.propSatisfies)((0,l.lt)(1),"length"),xg=(0,l.complement)(l.isEmpty),$g=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(uu,(0,l.filter)(_g),cu,(0,l.map)((n=>({operand:Dg(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,bg()))(n)},Vg=(0,l.pipe)($g,l.flatten),Gg=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>bd(e,{type:t}))).join(", ");return r?t(r):l.identity},u=$g(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(mg),(0,l.pipe)(s(hg),(0,l.unless)((()=>Fg(u)||i),fg)))(u)},Wg=(e,t,r,n)=>(0,l.pipe)(uu,(0,l.filter)(Ag),cu,kg(((n,i,a)=>({operand:Gg(e,t,r,n,Fg(a)),operator:n.operator}))),bg(),l.flatten)(n),Yg=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),bg(),l.flatten),Bg=e=>{let{searchType:t,values:[r]}=e;return Kv(t,r).join(", ")},qg=(e,t,r,n,i,a)=>{const o=(e=>e?[ig(e.isRawFilter?Zr().text("Raw filter"):Zr().text("Search")),...Tg([ag(Mr.EQUALS)]),og(`"${e.value}"`)]:[])(i),s=(e=>e?[ig(Jv(e.searchType)),lg(),og(Bg(e))]:[])(a),u=(0,l.pipe)(Wg,(0,l.when)((e=>Mg(e)&&(xg(o)||xg(s))),fg))(e,t,r,n);return Yg([o,s,u])},Hg=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),Qg=(0,l.pipe)(qg,Hg),Kg=(0,l.has)("attributes"),Jg=Array.isArray,Xg=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),zg=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=Zg(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)(Xg(a))),fg),(0,l.concat)(Tg([tg(o)]))))(s)},Zg=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Kg(n)?zg(e,t,r,n,i):Jg(n)?n.reduce(((n,a)=>n.concat(Zg(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(Tg([tg(n.operator)])))(Dg(e,t,r,n,i))},e_=(e,t,r,n,i)=>(0,l.pipe)(Zg,l.flatten)(e,t,r,n,i);function t_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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}const n_=(0,l.complement)(Rg),i_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(Rg),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(Sg),(0,l.reject)(l.isNil),l.uniq)(e),n=0===r.length,i=1===r.length&&(0===t.length||(0,l.equals)(r,t));return{entityTypesFromSpecialAttributes:t,entityTypesFromAttributes:r,areOnlySpecialAttributes:n,areAttributesFromOneEntityType:i}},a_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=i_(t);return(r||n)&&su(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)(a_)),n=e.filter((e=>{let{attributes:t=[]}=e;return t.length>0}));if(0===r.length||1===r.length&&1===n.length||t.push("Can't convert more than one complex transition advanced search group"),e.some((e=>(e.attributes||[]).filter(Rg).some((0,l.propEq)("filter",Mr.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}=i_(r);if(a_(e))t.push(t_({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(n_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(Rg,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(Sg,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(n_),entityTypes:n,operator:i?a:e.operator,id:Vb()()}}));t.push(...n)}var a;return t})(t))),[]))),s_={[Mr.EQUALS]:Mr.ON,[Mr.IN_RANGE]:Mr.WITHIN,[Mr.GTE]:Mr.AFTER,[Mr.GT]:Mr.AFTER,[Mr.LTE]:Mr.BEFORE,[Mr.LT]:Mr.BEFORE},l_=(0,l.curry)((e=>s_[e]||e)),u_=(0,l.curry)(((e,t)=>{switch(e){case Mr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Mr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),c_=(0,l.pipe)((0,l.path)(["data","attrType","type"]),sr),p_=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>t_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return c_(e)?(0,l.evolve)({filter:l_,values:u_(t)},e):e}))})))})),d_=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Nu),(0,l.map)(wu))}),y_=(0,l.map)((0,l.cond)([[c_,d_],[l.T,l.identity]])),f_=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),o_,Ig(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),y_)})),p_,(0,l.reject)(wg))(r)));function T_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){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 m_=(e,t)=>({data:{uri:Ut(e.fieldName)?Rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||Nv(e),id:Vb()(),values:Pv(e)}),h_=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=$s(a,t,r)||nr(e,i);if(!s)return null;if(Wt(s))return T_({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=bd(e,{type:o}),i=(rr(e,Rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return T_({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),b_=(0,l.curry)(((e,t,r,n)=>f_(h_,e,n,t,r)));function O_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){v_(e,t,r[t])}))}return e}function v_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g_=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},__=e=>"rdmLookups.not.resolved"===e?yn.notResolved.name:e,A_=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Wr?Mr.IN_RANGE:Yr(a),u=__(n),c=$s(u)||nr(e,i),p=(0,l.cond)([[()=>Kl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>O_({},e,{filename:Zb(e)}))))],[()=>yr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Hl(s)&&!Array.isArray(e[0])&&!sr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Vb()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Wr?"and not":"and",filter:s,values:p}})),N_=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(A_(e,Dr(e,i)));return[{id:Vb()(),operator:"or",attributes:a,entityTypes:i}]})),P_=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),R_=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([P_("from"),P_("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,()=>[]]]),S_=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return O_({},r,{values:R_(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?Ds(e.fieldName,n):e.fieldName})},w_=(e,t)=>{if((0,l.has)("children")(e)){const r=S_(e,t);return e.children.reduce(((e,n)=>(e.push(w_(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return S_(e,t)},I_=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(S_(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(O_({fieldName:e.fieldName},S_(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(w_,l.flatten)],[l.T,S_]]),U_=(0,l.pipe)((0,l.map)(I_),l.flatten),C_=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},L_=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=N_(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:U_(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>O_({},t,{type:_v(e,t)}))).map((e=>O_({},e,{values:Ov(e)?C_(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 m_(r,t)})),operator:"or",id:Vb()(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[__(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[O_({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return b_(e,t,r,p)},j_=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(Ev),(0,l.partition)(mv))(t),i=n.map((t=>T_({},t,{type:_v(e,t)}))).map((e=>m_(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Vb()(),entityTypes:a}]})(e,a);return b_(e,t,r,o)})(e,t,r,n):L_(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},D_=e=>"2.0"===e.version?e.keyword:g_(e),k_=e=>(0,l.pathEq)(["object","uri"],e),F_=(e,t)=>(0,l.pipe)((0,l.find)(k_(e)),(0,l.prop)("object"))(t),M_=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"),k_(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=F_(r.match,t)||n[r.match];return i?{label:zp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return eo(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},x_=e=>e.reduce(((e,t)=>{let{object:r}=t;return e[r.uri]=(0,l.pick)(["uri","type","label"],r),e}),{}),$_=(0,l.allPass)([(0,l.has)("shortestTransitiveMatchPath"),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)]),V_=(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:zp((0,l.prop)("label",a)),matchRules:i.map((function(t){return eo(e,a.type,t)||{label:t,uri:t}}))}})))(t),G_=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)},W_=(0,l.path)(["object","uri"]),Y_=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},B_=e=>e.getValue(),q_=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=q_(n[e],t),!r);e++);return r},H_=(e,t)=>{const r=[],n=(0,l.pipe)(B_,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(H_,[t]),a);return r.push.apply(r,o),r};function Q_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){K_(e,t,r[t])}))}return e}function K_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const J_=(e,t)=>!!e[t],X_=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},z_=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||[]])},Z_=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return Q_({},t,{[r.uri]:Q_({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:z_(null==o?void 0:o.parents,n),children:z_(null==o?void 0:o.children,i),values:z_(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},eA=e=>e.children?e.children.flatMap(eA):e,tA=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ir(r,t)||si(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return jo(r,n,i).flatMap(eA).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>nr(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=Z_({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>Z_({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},rA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Tt(e.uri)&&vt(e.type)&&vt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Ts(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(es),(0,l.map)(X_))(i);return Z_({structure:e,attrType:e[t].attrType,values:a})}),t)},nA=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 J_(e,r)}));return r||n?t.filter(es).reduce(((e,t)=>nA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return J_(t,e.type)?Z_({structure:t,attrType:t[e.type].attrType,values:[X_(e)]}):t}},iA=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?Q_({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},aA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Ts(i,n,r)||[];return a.length?Z_({structure:t,attrType:t[r].attrType,values:a.filter(es).map(X_)}):t},oA=(e,t,r)=>{const n=ht(e),i=ht(t);return n===i?((e,t)=>{const r=jt(t),n=jt(e);return _t(n,r)||((e,t)=>Ct(e)&&!Ct(t)&&_t(t,e))(n,r)})(e,t):!(!r||!Lt(t))&&cE(r,i).includes(n)},sA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},lA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?lE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return oA(r,t,o)}))},uA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>uA(e,t,r)))))},cA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&sA(n,e)}},pA=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=ht(n),c=uE(u,o,i,a),p=uA("children",t,l),d=uA("parents",t,l),y=p.flatMap((e=>uA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return oA(t,n,c)})).map((t=>cA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return oA(n,t,c)||ht(t)!==u&&oA(t,n,c)})).map((t=>cA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=uA("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)&&oA(n,t,c)}))})).map((t=>cA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return oA(t,n,c)})).map((e=>cA(r,n,e,s))),...T,...E,...f]},dA=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=cO({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>Jp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Ht,()=>a(n)],[Zt,()=>(e=>{const r=o(e),n=zt(t);return Dl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return iO(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},yA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Mr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(fA(r,t)):i.push(TA([t],r)),i},fA=(e,t)=>{const r=Yt(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Ht(i)?fA(i,t[r]):[TA(t[r],i)];return e.push(...a),e}}),[])},TA=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Xt(t.uri),filter:t.type===Xe.TYPE_BLOB?Mr.FULL_TEXT:Mr.EQUALS,values:e}:{fieldName:Xt(t.uri),filter:Mr.MISSING_VALUE},EA={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},mA={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
1
+ (self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2247],{82389:(e,t,r)=>{"use strict";r.d(t,{ViP:()=>Us,IL3:()=>Pp,PY2:()=>nn,Ng6:()=>Ne,YJ7:()=>Jr,NlI:()=>xr,XYV:()=>Hr,Xt7:()=>Oe,wfT:()=>Vn,EMD:()=>wn,HAc:()=>ve,PEf:()=>un,oA3:()=>Sn,$XE:()=>Ve,eWf:()=>sn,q7e:()=>ge,KVe:()=>Gn,WVQ:()=>hr,oZZ:()=>Xn,bNA:()=>zn,Rjq:()=>Zn,G39:()=>pn,W0P:()=>Qe,X1H:()=>He,yn8:()=>Fe,N0y:()=>ke,dZX:()=>Ge,bQt:()=>ti,oS0:()=>Xe,lL_:()=>Br,Nsj:()=>zr,psV:()=>Kr,xPW:()=>an,pyR:()=>jn,p8l:()=>Un,Wkf:()=>be,zHr:()=>he,NIO:()=>me,$26:()=>_v,Esk:()=>_n,s9T:()=>De,MEy:()=>Tu,j5E:()=>Mr,vAw:()=>Rn,NMQ:()=>Pn,mNm:()=>Ln,s_5:()=>kn,RgZ:()=>Cn,unl:()=>Jn,Qy0:()=>ei,pYu:()=>gn,wIJ:()=>Hv,GFH:()=>Re,Ury:()=>dn,S91:()=>yn,p3$:()=>ai,wSh:()=>Z,BDP:()=>Ti,pGS:()=>Dn,ARY:()=>ze,XGc:()=>$n,fO_:()=>Nr,wwy:()=>Ue,h_8:()=>Tn,_XL:()=>Xr,j2V:()=>Wn,dMV:()=>Mn,NBX:()=>q_,OXy:()=>Ze,BXd:()=>Me,KM9:()=>Ae,CJB:()=>qn,lXI:()=>Be,nqG:()=>ni,C68:()=>cn,yxQ:()=>ri,Yj_:()=>Ce,D25:()=>we,ZIY:()=>We,Tl4:()=>eg,lwr:()=>ln,NkU:()=>Yn,Rtp:()=>xn,YGx:()=>xe,uTS:()=>Fn,MCv:()=>_e,IYE:()=>In,PiC:()=>Kn,MVv:()=>Ke,h_m:()=>qe,DUe:()=>qr,tJI:()=>Pe,fDt:()=>Se,cNQ:()=>Bn,SwE:()=>An,ZHR:()=>Qn,lD1:()=>fn,lVm:()=>$e,vnX:()=>QO,$x5:()=>KO,_R1:()=>qO,wUm:()=>HO,z7V:()=>ii,dC6:()=>je,MBD:()=>Ie,GmF:()=>Hi,cKm:()=>Ye,iP_:()=>on,NVC:()=>Le,tPT:()=>il,tZe:()=>Wp,kRE:()=>Jy,psB:()=>Xy,X0$:()=>nl,zE1:()=>fl,Wm5:()=>Hs,vyX:()=>lc,wLZ:()=>al,W4V:()=>se,EtK:()=>fs,Wtd:()=>rl,asT:()=>aA,kGs:()=>LE,ewt:()=>LT,O_f:()=>lu,sOy:()=>_t,Tde:()=>Xt,LMI:()=>Bu,skb:()=>Wg,sPt:()=>ku,sH1:()=>Fu,RPM:()=>ZE,h27:()=>tc,Uqd:()=>sc,xG:()=>r_,Z2f:()=>uO,fgW:()=>_g,I69:()=>Qg,ZxB:()=>Jg,mdt:()=>QE,Qbq:()=>bE,rny:()=>Ii,UEY:()=>fa,Q0T:()=>ya,Lyr:()=>va,sBn:()=>da,itK:()=>la,H9$:()=>pa,KPc:()=>ca,zos:()=>ua,ELQ:()=>ga,dZs:()=>zi,Cz4:()=>Xi,z_L:()=>ba,fGe:()=>Ji,iuF:()=>oa,Wib:()=>sa,Hn0:()=>Oa,obS:()=>_a,E$L:()=>Zi,XUh:()=>aa,Qp_:()=>na,_jk:()=>ea,sKE:()=>ta,WmG:()=>ia,QKx:()=>ma,Oik:()=>Ea,s0A:()=>ra,o9m:()=>Ta,MCd:()=>ha,RsS:()=>rc,tGK:()=>Fl,lIv:()=>Tl,Vg3:()=>Fi,mkC:()=>Ai,xv5:()=>xi,a14:()=>Pi,yv0:()=>Mi,Zm0:()=>Ni,Nxd:()=>_i,$mM:()=>ki,ifj:()=>Or,NWi:()=>SO,xr3:()=>RO,wNf:()=>Hl,iJH:()=>wO,d89:()=>Oi,Edd:()=>vi,Z5t:()=>gi,uGe:()=>mi,UoR:()=>Ei,xvW:()=>PO,$qe:()=>NO,yPM:()=>Ki,$cp:()=>yl,vKJ:()=>pl,VtG:()=>kc,AID:()=>Qf,B1H:()=>Y_,b7X:()=>EE,$uE:()=>kE,keo:()=>hE,C_p:()=>km,G27:()=>$h,JA0:()=>xy,b3T:()=>CE,oC6:()=>IE,_Zs:()=>UE,epC:()=>ME,YYG:()=>FE,f_2:()=>Vy,w3l:()=>P_,QHB:()=>xh,Jso:()=>L_,RXH:()=>Ah,Vr9:()=>Qh,lMm:()=>Vb,BlA:()=>TA,fmQ:()=>os,yRD:()=>y_,NcL:()=>Gm,QK6:()=>de,ymd:()=>Np,JV_:()=>df,XiW:()=>dT,Yrx:()=>Py,GPx:()=>tl,gjI:()=>el,vlo:()=>XT,E_P:()=>WE,aAL:()=>dp,NBq:()=>ss,wp9:()=>HE,DsR:()=>op,MPc:()=>Zf,gWE:()=>eT,DT_:()=>tT,ipn:()=>nT,ORg:()=>di,_wz:()=>rT,RYR:()=>ST,PP2:()=>Uy,wS7:()=>EO,cBQ:()=>Yc,pBq:()=>Cf,DsO:()=>ee,X78:()=>ff,xZs:()=>lf,YFy:()=>Sy,Gmt:()=>tf,K$w:()=>ef,DSj:()=>yp,Mfr:()=>wy,k9j:()=>qc,ww$:()=>ol,WVU:()=>Zy,hxF:()=>Ks,E7G:()=>Ud,nwO:()=>hA,Mzk:()=>xc,aFF:()=>NE,HRH:()=>hu,EZK:()=>td,Kxm:()=>Xp,Z9i:()=>mm,CrF:()=>qy,DNd:()=>Na,vUy:()=>cA,lJh:()=>vu,zHo:()=>gu,sEJ:()=>Q_,UO$:()=>Mf,zeJ:()=>nr,dLR:()=>hs,JQy:()=>Ss,XtP:()=>Es,Ug0:()=>jr,A1W:()=>mE,sw:()=>ed,nv3:()=>FO,JgD:()=>kO,nve:()=>K_,SkP:()=>ws,SAs:()=>Df,i5L:()=>Is,PWK:()=>Ao,IM5:()=>ms,Mfk:()=>qb,mB6:()=>dO,p6d:()=>w,o0x:()=>U,ufS:()=>Zb,k7L:()=>eO,mrB:()=>I,ncP:()=>mt,Zmi:()=>dt,hm5:()=>ft,ECL:()=>_r,vPL:()=>id,qmL:()=>TE,hPi:()=>If,hXd:()=>Ci,OCS:()=>Li,p2l:()=>Ls,qF1:()=>Rp,_X$:()=>Sp,yj2:()=>Wv,bzh:()=>XE,k66:()=>Do,kiP:()=>Ka,pSg:()=>ce,kz_:()=>jy,H_U:()=>ko,t9e:()=>Ca,j2$:()=>Yp,PFL:()=>$t,aJ3:()=>fv,To9:()=>zt,wpo:()=>Ad,ADq:()=>dm,UUb:()=>cm,tQX:()=>pm,xy8:()=>Yt,EUG:()=>ir,AFK:()=>wt,X3M:()=>rr,WN0:()=>jo,kDl:()=>bs,uDV:()=>fE,IhQ:()=>As,pfb:()=>Ps,R$r:()=>GE,w80:()=>po,Pfu:()=>Ia,Gtj:()=>Sl,fyF:()=>Rl,kkq:()=>Lo,u5q:()=>ht,O$n:()=>gd,ptG:()=>_d,f4_:()=>Jm,uap:()=>Km,d7q:()=>Ny,liG:()=>Cy,$oF:()=>Ay,avf:()=>VT,DiQ:()=>$T,cfX:()=>xT,vD3:()=>WT,Qrb:()=>MT,EJQ:()=>GT,HWy:()=>FT,gjS:()=>UT,y6v:()=>kT,JUW:()=>Gy,GtP:()=>lh,_kX:()=>Ra,u1e:()=>Sa,sJj:()=>gE,CJp:()=>oh,uKF:()=>vE,wo0:()=>Ky,s5:()=>Ro,cwx:()=>Po,Y6b:()=>fy,TTx:()=>af,UtR:()=>Ty,HaQ:()=>of,E6I:()=>By,Won:()=>my,vTU:()=>dy,Nsy:()=>dd,KMQ:()=>AE,Do$:()=>Ed,CSV:()=>ks,TMe:()=>Ey,l1V:()=>Au,VQ1:()=>Iu,u5O:()=>wu,z7d:()=>zT,Xaq:()=>xo,Sj8:()=>yA,PJj:()=>Dl,k3T:()=>Fr,PjQ:()=>fi,s7l:()=>Uc,jLA:()=>uh,GGR:()=>HT,j5q:()=>BT,DnY:()=>Sc,RY5:()=>lE,Px$:()=>wT,KPC:()=>V_,NIY:()=>Fc,HvW:()=>Lc,Fof:()=>La,BTI:()=>hd,uie:()=>sd,ChB:()=>rd,q27:()=>Pd,vrC:()=>ob,fAQ:()=>hf,XkT:()=>Rc,lrH:()=>bf,nt9:()=>Ir,XH8:()=>vd,XH2:()=>kr,jFi:()=>Od,qhs:()=>co,wwR:()=>md,Uk3:()=>It,ev7:()=>B_,RB9:()=>My,iFp:()=>tm,e$p:()=>nm,PcX:()=>im,SpP:()=>rm,R6_:()=>Ev,CY1:()=>Av,Ajk:()=>_c,Yiz:()=>gc,FK9:()=>Ec,UOo:()=>tO,aTW:()=>nf,uug:()=>ql,P$2:()=>Rv,XS2:()=>Ml,Hyb:()=>iu,d3Y:()=>dc,Klp:()=>fc,WxZ:()=>Sv,Gzu:()=>_u,ZOr:()=>Pc,uqV:()=>uy,Pm4:()=>re,hWO:()=>Pt,nHA:()=>zm,nVD:()=>cE,dED:()=>gy,P2h:()=>vy,jrr:()=>Ba,mmY:()=>Ha,T6O:()=>Fo,h6J:()=>$p,hM2:()=>k_,XR6:()=>X,jmz:()=>yE,IHt:()=>dE,NZI:()=>Em,wdF:()=>Ef,kgP:()=>mf,ZYI:()=>vp,QXK:()=>_l,efz:()=>Al,Q5d:()=>gl,Ysv:()=>Nl,UWq:()=>tE,ocC:()=>eE,io3:()=>Lr,Sbt:()=>fo,roS:()=>yo,Ww1:()=>To,QaS:()=>$c,ERZ:()=>A_,CL1:()=>F_,idV:()=>Zp,nIW:()=>Nt,fjE:()=>mv,sG0:()=>iO,tV7:()=>jl,g8o:()=>zv,Qy:()=>Xv,t2P:()=>yv,KbW:()=>eo,wId:()=>ro,LS0:()=>no,bFH:()=>Jd,Rgl:()=>zd,fW1:()=>Wm,GFW:()=>sf,Ywp:()=>GO,pg:()=>Ld,WSA:()=>Zd,fed:()=>D_,tT_:()=>Ns,BgZ:()=>Rs,KbL:()=>Ic,JBA:()=>Dt,aNC:()=>jO,RFJ:()=>Op,Zeh:()=>Ff,OT5:()=>VO,mC3:()=>ml,kR6:()=>fA,NVY:()=>BE,k6v:()=>wp,FEC:()=>Ip,Ob5:()=>Rd,KUV:()=>Sd,dvH:()=>YE,V3i:()=>Xh,VD3:()=>Dr,mm2:()=>Su,rou:()=>Pf,izH:()=>wa,DK$:()=>Ua,KMp:()=>pp,c31:()=>rt,mbo:()=>fm,gT8:()=>at,CZ8:()=>is,uGi:()=>cs,Poc:()=>et,_9k:()=>ys,ZTM:()=>ls,bwT:()=>ps,tzW:()=>st,tF$:()=>it,o96:()=>as,M4S:()=>ds,_vs:()=>ip,xF8:()=>CT,HQx:()=>PE,ATu:()=>ym,j1S:()=>ci,V3K:()=>li,Lmx:()=>ui,ZaZ:()=>tt,n_1:()=>py,N6e:()=>lp,SxO:()=>qa,w3p:()=>qE,xU7:()=>pe,Y_p:()=>ho,$k6:()=>mo,Gdl:()=>oO,U6P:()=>aO,OwB:()=>Tv,hTh:()=>pE,xqc:()=>So,JvE:()=>wo,i29:()=>Ju,dzT:()=>Si,uPS:()=>Wc,cZV:()=>Gc,n3B:()=>Ig,e6O:()=>Ag,s7j:()=>qv,j$Q:()=>Wy,kW2:()=>sh,tH7:()=>No,Yxg:()=>Vs,MaZ:()=>qT,nqN:()=>YT,jWj:()=>nE,o_J:()=>$o,hgZ:()=>nd,yW4:()=>Vp,uT0:()=>Mp,C82:()=>xp,bsH:()=>Xm,u9Z:()=>Nf,J$m:()=>cy,j_Q:()=>hc,OaI:()=>bc,wB1:()=>W_,SP6:()=>Cd,ZYr:()=>$_,IMU:()=>bp,FoU:()=>$y,DVz:()=>pO,mxe:()=>Sg,FHr:()=>jf,D1g:()=>Rf,VO3:()=>ZO,de5:()=>zO,Uw1:()=>Te,J6q:()=>Tm,XCe:()=>Ga,fbl:()=>WO,Ir:()=>za,XQO:()=>Za,QXb:()=>Wd,P8_:()=>cf,iiD:()=>cp,MOC:()=>Yd,WF:()=>Gd,xE1:()=>yi,idW:()=>nA,QWZ:()=>Jb,YL3:()=>Mc,Fn9:()=>T,j2U:()=>Cs,MpE:()=>lt,kQw:()=>Gt,mfm:()=>au,vZp:()=>Ut,E8K:()=>z_,VSb:()=>rs,vr_:()=>Vt,Vmh:()=>uA,FgW:()=>Jh,oDv:()=>Go,fGG:()=>Xb,kuw:()=>Yo,eHk:()=>rE,Tt2:()=>Vo,oZ7:()=>zb,T6Y:()=>yr,_26:()=>tu,YkM:()=>Jt,J6y:()=>Vl,njU:()=>Kl,TBP:()=>Wo,IT0:()=>hm,x_:()=>_E,biM:()=>fd,TMl:()=>Td,Vkd:()=>zl,WiY:()=>vv,_zi:()=>Zl,J6D:()=>Ru,Lt4:()=>sr,QEi:()=>er,whI:()=>Rr,KIu:()=>wr,JhM:()=>oe,C_0:()=>Er,lzc:()=>Id,qIF:()=>Ug,O27:()=>E,aBi:()=>Nd,xOX:()=>qs,EdS:()=>vt,WgC:()=>Ot,eEv:()=>Mt,A4t:()=>Jl,YOQ:()=>Lt,Wos:()=>pr,jWr:()=>Aa,Or$:()=>Kt,lhE:()=>Cr,CwH:()=>Zt,pzC:()=>Ws,ymH:()=>Ql,QZu:()=>Ht,rYH:()=>Ov,FVt:()=>cr,Kn2:()=>ue,jgw:()=>ou,Qgr:()=>Pu,OXP:()=>ts,lS4:()=>tr,g5f:()=>gv,fp6:()=>Yl,Uty:()=>Gi,YkG:()=>Qt,xdS:()=>ot,kMF:()=>iT,$NE:()=>gt,bC9:()=>bt,Ian:()=>pi,KVV:()=>OE,q9e:()=>Eo,iIf:()=>sO,ian:()=>Js,m6e:()=>mr,OFd:()=>Ys,kqr:()=>Wt,fnZ:()=>Pr,VFZ:()=>Xs,ZiX:()=>Tt,j5n:()=>lr,zkt:()=>_,Pcm:()=>G_,QDV:()=>Gs,M5u:()=>bv,laD:()=>wg,mtq:()=>Ft,CtB:()=>lO,CBv:()=>ae,I0t:()=>Tr,u1G:()=>JT,gk1:()=>Pg,Bgb:()=>Ng,uzs:()=>Sr,v0l:()=>Lu,Zqp:()=>hy,j0k:()=>_o,tCm:()=>St,gmx:()=>xl,mOr:()=>Eu,TwZ:()=>Zv,GyU:()=>MO,zGm:()=>kd,bMg:()=>ny,EyD:()=>_O,FQA:()=>AO,fZN:()=>oy,xsF:()=>vO,Lxg:()=>gO,O3l:()=>Qc,Wni:()=>Hc,wRx:()=>UO,OxG:()=>Hd,uJQ:()=>qd,qWg:()=>cO,i96:()=>Dd,zhn:()=>IO,G8q:()=>oi,Jct:()=>_T,A9Y:()=>te,Y5F:()=>E_,gxP:()=>le,c$P:()=>$l,M7o:()=>oc,BBN:()=>Ya,ZBU:()=>J,UkJ:()=>io,xkv:()=>uf,z$M:()=>iA,KAm:()=>Fy,lCl:()=>Kf,rkF:()=>Fm,IU6:()=>Kp,RGr:()=>h,aYu:()=>m,ije:()=>Cl,Buf:()=>up,YLu:()=>Ul,ct9:()=>Oo,XkY:()=>iy,T5R:()=>Fd,uQS:()=>sy,wcJ:()=>bo,d$I:()=>sl,rSp:()=>yd,Sx:()=>jc,Ilm:()=>El,Ki6:()=>Qs,VGk:()=>ap,sFD:()=>Nh,eWN:()=>oA,dWE:()=>Bv,Lkd:()=>yT,aDL:()=>xf,yaA:()=>ly,lOh:()=>wf,DBr:()=>cv,hK$:()=>kl,TZ_:()=>Qp,CMB:()=>Cg,FU8:()=>Dc,J$p:()=>Wf,b5s:()=>Gf,h2W:()=>Rt,SL_:()=>gf,oUH:()=>jp,ck9:()=>Md,nL:()=>nO,k$p:()=>Rh,Xs0:()=>Il,u7I:()=>Sf,rxg:()=>cu,bji:()=>pu,oCZ:()=>Cm,MjG:()=>XO,FuV:()=>Dp,$ju:()=>Fp,t6d:()=>kp,m5F:()=>fe,sx:()=>sA,rSc:()=>yO,U10:()=>Oc,L8n:()=>zy,R9X:()=>yy,rj2:()=>yf,_C4:()=>Bp,tCj:()=>pf,uAg:()=>Ry,wx9:()=>DT,KF3:()=>qp,ax9:()=>Hp,HH7:()=>sp,ufV:()=>Iy,_6y:()=>Bc,XTh:()=>BO,AJo:()=>Vc,Ixr:()=>Yy,P6Y:()=>bA,Bd_:()=>Sm,xkB:()=>Rm,W41:()=>Af,WkI:()=>_f,sSE:()=>Pm,GMd:()=>qu,jtL:()=>Hu,Bxm:()=>Im,FVh:()=>vm,U_T:()=>ey,FTe:()=>ie,VGB:()=>ne,Wfe:()=>Ou,Ls5:()=>bu,$bd:()=>yu});var n={};r.r(n),r.d(n,{normalize:()=>u,removeLineBreaks:()=>d,search:()=>c,sort:()=>p});var i={};r.r(i),r.d(i,{clearDateTime:()=>g,formatDate:()=>w,formatDateTime:()=>U,formatTime:()=>I,getEndOfDay:()=>S,getMomentFormatFromDateMask:()=>q,getMomentFormatFromDateTimeMask:()=>K,getMomentFormatFromTimeMask:()=>Q,getStartOfDay:()=>R,isToday:()=>_,isValidMomentDate:()=>b,isValidMomentDateOrNull:()=>O,momentToDate:()=>v,parseTimestamp:()=>J,toLocalDate:()=>A,toUtcDate:()=>N});var a={};r.r(a),r.d(a,{addAttribute:()=>Ho,editAttribute:()=>Qo,editEndDate:()=>es,editRoles:()=>Xo,editStartDate:()=>Zo,editTags:()=>zo,removeAttribute:()=>Jo});var o={};r.r(o),r.d(o,{applyCrosswalks:()=>LE,collectCrosswalksFromAttributes:()=>kE,compareActivenessAttributes:()=>CE,compareAttributes:()=>IE,compareImages:()=>UE,compareRoles:()=>ME,compareTags:()=>FE});var s={};r.r(s),r.d(s,{createHistoryManager:()=>VE});var l=r(17440);const u=e=>"string"==typeof e&&"function"==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,c=(e,t)=>(t=(u(t)||"").toLowerCase(),(e=(u(e)||"").toLowerCase()).includes(t)),p=(0,l.curry)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n="asc"===e.toLowerCase();return t=t.toLowerCase(),r=r.toLowerCase(),t<r?n?-1:1:t>r?n?1:-1:0})),d=(0,l.replace)(/(\r\n|\n|\r)/gm,"");var y=r(95038),f=r.n(y);const T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{startDate:t,endDate:r}=e,n=Date.now();return!(r&&r<n||t&&t>n)},E=(0,l.anyPass)([l.isEmpty,l.isNil]),m=e=>()=>new Promise(e),h=e=>Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e}))).catch((e=>({status:"rejected",reason:e})))))),b=e=>e&&e.isValid(),O=(0,l.either)(b,l.isNil),v=e=>e&&e.toDate(),g=e=>(e&&e.setHours(0,0,0,0),e),_=e=>f()(e).isSame(Date.now(),"day"),A=e=>{const t=new Date(e),r=new Date;return r.setFullYear(t.getUTCFullYear()),r.setDate(t.getUTCDate()),r.setMonth(t.getUTCMonth()),r.setHours(t.getUTCHours()),r.setMinutes(t.getUTCMinutes()),r.setSeconds(t.getUTCSeconds()),r.setMilliseconds(t.getUTCMilliseconds()),r},N=e=>{const t=new Date(e),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());return new Date(r)},P=e=>(t,r)=>(r?f().utc(t):f()(t))[e]("day").valueOf(),R=P("startOf"),S=P("endOf"),w=e=>f()(e).format(f().localeData().longDateFormat("L")),I=e=>f()(e).format(f().localeData().longDateFormat("LTS")),U=e=>`${w(e)} ${I(e)}`,C=(0,l.equals)("9"),L=(0,l.equals)("99"),D=(0,l.equals)("9999"),j=(0,l.test)(/^[az][az][az]$/),k=(0,l.test)(/^[az][az][az][az]$/),F=(0,l.test)(/^9+$/),M=(0,l.test)(/^[9az]+$/),x=(0,l.cond)([[C,(0,l.always)("M")],[L,(0,l.always)("MM")],[j,(0,l.always)("MMM")],[k,(0,l.always)("MMMM")],[M,(0,l.always)("Mo")],[l.T,(0,l.always)("MM")]]),$=(0,l.cond)([[C,(0,l.always)("D")],[L,(0,l.always)("DD")],[M,(0,l.always)("Do")],[l.T,(0,l.always)("DD")]]),V=(0,l.cond)([[C,(0,l.always)("y")],[L,(0,l.always)("YY")],[D,(0,l.always)("YYYY")],[F,(0,l.always)("YYYYYY")],[l.T,(0,l.always)("YYYY")]]),G=(e,t)=>(0,l.cond)([[(0,l.both)((0,l.always)(t),C),(0,l.always)("h")],[(0,l.both)((0,l.always)(t),L),(0,l.always)("hh")],[C,(0,l.always)("H")],[L,(0,l.always)("HH")],[l.T,(0,l.always)(t?"hh":"HH")]])(e),W=(0,l.cond)([[C,(0,l.always)("m")],[L,(0,l.always)("mm")],[l.T,(0,l.always)("mm")]]),Y=(0,l.cond)([[C,(0,l.always)("s")],[L,(0,l.always)("ss")],[l.T,(0,l.always)("ss")]]),B=/([9az]+)([^9az]+)*/g,q=e=>{const t=[...e.toLowerCase().matchAll(B)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t);return(0,l.join)("",[x(e),r,$(n),i,V(a),o])}return e},H=/(9+)([^9]+)*/g,Q=e=>{const t=[...e.toLowerCase().matchAll(H)];if(E(e)||t.length>0){const[,e="",r=""]=(0,l.propOr)([],0,t),[,n="",i=""]=(0,l.propOr)([],1,t),[,a="",o=""]=(0,l.propOr)([],2,t),s=(0,l.pipe)(l.last,(0,l.propOr)("",2),(0,l.test)(/^[^9]+$/))(t),u=(0,l.reject)(l.isEmpty,[G(e,s),r,W(n),i,a?Y(a):"",o]),c=s?" A":"",p=(0,l.pipe)(l.init,(0,l.append)(c));return(0,l.pipe)((0,l.when)((0,l.always)(s),p),(0,l.join)(""))(u)}return e},K=e=>{const[t="",r=""]=(0,l.pipe)((0,l.indexOf)(" "),l.inc,(0,l.splitAt)(l.__,e),(0,l.map)(l.trim))(e);return`${q(t)} ${Q(r)}`},J=e=>{const t=Number(e);return Number.isNaN(t)?e:t},X=e=>e&&0!=e.length?e.split("").map((e=>e.charCodeAt())).reduce(((e,t)=>0|(e=(e<<5)-e+t)),0)+"":"0",z=e=>({isNone:()=>(0,l.isNil)(e),extract:()=>e,orSome:t=>(0,l.isNil)(e)?t:e,map:t=>(0,l.isNil)(e)?Z.None():Z.Some(t(e))}),Z={Some:z,None:()=>z(null),chain:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce(((e,t)=>e.map(t)),e)},fromFalsy:function(e){return e?Z.Some(e):Z.None()},fromNull:function(e){return null==e?Z.None():Z.Some(e)},fromUndefined:function(e){return void 0===e?Z.None():Z.Some(e)},fromEmpty:function(e){return E(e)?Z.None():Z.Some(e)}},ee=(e,t)=>{let r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=()=>{e.apply(this,i),r=null};r&&clearTimeout(r),r=setTimeout(o,t)}},te=(e,t)=>(r,n)=>{const i=t?(0,l.prop)(t):l.identity;return e.indexOf(i(r))-e.indexOf(i(n))},re=(0,l.when)((0,l.is)(Array),(0,l.prop)(0)),ne=e=>Array.isArray(e)?e:[e],ie=e=>[e],ae=e=>!!e&&["www.","http://","https://","ftp://","ftps://","smb://","data:"].some((t=>String(e).toLowerCase().startsWith(t))),oe=e=>/^\S+@\S+\.\S+$/.test(String(e).toLowerCase()),se=e=>(e=(e||"").toLowerCase(),oe(e)?`mailto:${e}`:!e.includes("://")&&(e.startsWith("www.")||e.split(".").length>2)?`http://${e}`:e),le=(0,l.when)((0,l.is)(String),(e=>""===e?void 0:"true"===e.toLowerCase())),ue=e=>null!=e&&["object","function"].includes(typeof e),ce=function(e){const t=[],r=(e,n)=>{n=n||[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Array.isArray(e)&&(i=parseInt(i,10)),ue(e[i])?r(e[i],n.concat(i)):t.push(n.concat(i)))};return r(e),t},pe=(e,t,r)=>{const n=[r,"errorDetailMessage","errorMessage","error"];return(0,l.cond)([...n.map((e=>[(0,l.prop)(e),(0,l.prop)(e)])),[(0,l.always)(t),(0,l.always)(t)],[l.T,(0,l.always)(e)]])(e)},de=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(0,l.sum)(e);if(0===r)return[];const n=e=>+e.toFixed(t),i=e.map(((e,t)=>{const i=e/r*100,a=n(i);return{index:t,percent:a,diff:a-i}})),a=i.reduce(((e,t)=>{let{percent:r}=t;return e+r}),0);let o=n(100-a);if(0===o)return(0,l.pluck)("percent",i);const s=Math.sign(o),u=i.sort(((e,t)=>(e.diff-t.diff)*s||e.index-t.index)),c=(0===t?1:1/Math.pow(10,t))*s;for(let e=0;0!==o&&e<u.length;e++)u[e].percent=n(u[e].percent+c),o=n(o-c);return(0,l.pipe)((0,l.sortBy)((0,l.prop)("index")),(0,l.pluck)("percent"))(u)},ye=/[\n\r%#()<>?[\\\]^`{}|]/g,fe=e=>`data:image/svg+xml;utf8,${e.replace(/["']\);{0,}$/,"").replace(/'/g,'"').replace(/>\s{1,}</g,"><").replace(/\s{2,}/g," ").replace(ye,encodeURIComponent)}`,Te=e=>`data:image/gif;base64,${e}`;var Ee=r(76665);let me,he,be,Oe,ve,ge,_e,Ae,Ne,Pe,Re,Se,we,Ie,Ue,Ce,Le,De,je,ke,Fe,Me,xe,$e,Ve,Ge,We,Ye,Be,qe,He,Qe,Ke;var Je;!function(e){e.missed="missed",e.missedRefEntity="missedRefEntity",e.invalid="invalid"}(me||(me={})),function(e){e.local="local",e.validationService="validationService"}(he||(he={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING"}(be||(be={})),function(e){e[e.OBJECT_NOT_FOUND=101]="OBJECT_NOT_FOUND",e[e.CROSSWALK_NOT_FOUND=102]="CROSSWALK_NOT_FOUND",e[e.TENANT_NOT_CONFIGURED=127]="TENANT_NOT_CONFIGURED",e[e.ACCESS_DENIED=403]="ACCESS_DENIED",e[e.DVF_NOT_CONFIGURED=902]="DVF_NOT_CONFIGURED",e[e.DCR_ALREADY_EXISTS=10015]="DCR_ALREADY_EXISTS",e[e.WORKFLOW_IS_NOT_REGISTERED_ERROR=10061]="WORKFLOW_IS_NOT_REGISTERED_ERROR"}(Oe||(Oe={})),function(e){e.attributeValue="attributeValue",e.tempEntity="tempEntity",e.relationConnection="relationConnection"}(ve||(ve={})),function(e){e.ENTITY_ATTRIBUTE="entityAttribute",e.ENTITY="entity",e.RELATION="relation",e.POTENTIAL_MATCH="potentialMatch",e.RELATION_ATTRIBUTE="relationAttribute"}(ge||(ge={})),function(e){e.directed="directed",e.undirected="undirected",e.bidirectional="bidirectional"}(_e||(_e={})),function(e){e.asc="asc",e.desc="desc"}(Ae||(Ae={})),function(e){e.ACTIVE_ONLY="active",e.INACTIVE_ONLY="not_active",e.ALL="all"}(Ne||(Ne={})),function(e){e.or="or",e.orNot="or not",e.and="and",e.andNot="and not"}(Pe||(Pe={})),function(e){e.geoPolygon="geoPolygon",e.geoLocation="geoLocation",e.onMapMove="onMapMove"}(Re||(Re={})),function(e){e.TABLE="table",e.List="list",e.MAP="map"}(Se||(Se={})),function(e){e.PROFILE="profile",e.MAP="map"}(we||(we={})),function(e){e.Unmerge="unmerge",e.TreeUnmerge="treeUnmerge"}(Ie||(Ie={})),function(e){e.editing="editing",e.addingParent="addingParent",e.addingChild="addingChild"}(Ue||(Ue={})),function(e){e.potentialMatchReview="potentialMatchReview",e.dataChangeRequestReview="dataChangeRequestReview",e.recommendForDelete="recommendForDelete"}(Ce||(Ce={})),function(e){e[e.low=1]="low",e[e.medium=50]="medium",e[e.high=100]="high",e[e.urgent=1e3]="urgent"}(Le||(Le={})),function(e){e.EXISTS="exists",e.MISSING="missing"}(De||(De={})),function(e){e.UNIQUE="unique",e.NOT_UNIQUE="notUnique"}(je||(je={})),function(e){e.FILL_RATE="fillRate",e.LENGTH_STATISTIC="lengthStatistics",e.VALUE_DISTRIBUTION="valueDistribution",e.CROSSWALK_ANALYSIS="crosswalkAnalysis",e.DATA_VALIDATION="dataValidationFunctions",e.FREQUENCY="frequency",e.UNIQUENESS="uniqueness",e.PATTERN="pattern",e.CONSOLIDATION_RATE="consolidationRate"}(ke||(ke={})),function(e){e.ENTITY_TYPE="entityLevel",e.ATTRIBUTE_TYPE="attributeLevel"}(Fe||(Fe={})),function(e){e.DELETE_RELATION="DELETE_RELATION",e.CREATE_RELATION="CREATE_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REPOINT_RELATION="REPOINT_RELATION",e.IGNORE_RELATION="IGNORE_RELATION"}(Me||(Me={})),function(e){e.IN="in",e.OUT="out"}(xe||(xe={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE"}($e||($e={})),function(e){e.BAR="bar",e.DONUT="donut",e.PIE="pie",e.TREE="tree",e.TABLE="table",e.BUBBLE="bubble",e.LINE="line",e.MAP="map",e.CLOUD="cloud"}(Ve||(Ve={})),function(e){e.ActivitiesViewFacet="ActivitiesViewFacet",e.CustomActionViewFacet="CustomActionViewFacet",e.DashboardFacet="DashboardFacet",e.EntitiesByTypeViewFacet="EntitiesByTypeViewFacet",e.FilteredSavedSearchesFacet="FilteredSavedSearchesFacet",e.FilteredEntitiesViewFacet="FilteredEntitiesViewFacet",e.NotificationInboxFacet="NotificationInboxFacet",e.ProfileStatsFacet="ProfileStatsFacet"}(Ge||(Ge={})),function(e){e.Attributes="com.reltio.plugins.entity.attributes.AttributesView",e.HierarchyTree="com.reltio.plugins.react.ReactHierarchyTreeView",e.HierarchyPaths="com.reltio.plugins.entity.HierarchyPathsView",e.RelationsTable="com.reltio.plugins.react.ReactRelationshipTableView",e.Relations="com.reltio.plugins.entity.relations.RelationsView",e.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"}(We||(We={})),function(e){e.preserveURIs="preserveURIs",e.updateAttributeUpdateDates="updateAttributeUpdateDates",e.validateDataPermissions="validateDataPermissions"}(Ye||(Ye={})),function(e){e.DQDashboard="DQDashboardView",e.Dashboard="DashboardView",e.RelationshipSearch="RelationshipSearch",e.ProfileActivityLog="ProfileActivityLogView",e.Interactions="InteractionsView",e.Graph="GraphView",e.Relationships="RelationshipsView",e.PotentialMatches="PotentialMatchesView",e.Sources="SourcesView",e.Profile="ProfileView",e.NestedProfile="NestedProfileView",e.Search="SearchView",e.Tags="Tags",e.Pivoting="Pivoting"}(Be||(Be={})),function(e){e.CustomAction="CustomAction",e.ConsoleAppAction="ConsoleAppAction"}(qe||(qe={})),function(e){e.NEW="new",e.CLASSIC="classic"}(He||(He={})),function(e){e.SET_HTML="setHtml",e.SHOW_POPUP="showPopup",e.HIDE_POPUP="hidePopup",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request",e.EVENT="event"}(Qe||(Qe={})),function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission",e.RELOAD_PAGE="reloadPage"}(Ke||(Ke={})),function(e){e.TYPE_STRING="String",e.TYPE_TEXT="Text",e.TYPE_PASSWORD="Password",e.TYPE_LONG="Long",e.TYPE_INT="Int",e.TYPE_DOLLAR="Dollar",e.TYPE_FLOAT="Float",e.TYPE_DOUBLE="Double",e.TYPE_NUMBER="Number",e.TYPE_BOOLEAN="Boolean",e.TYPE_BOOLEAN_RADIO="Boolean_Radio",e.TYPE_DATE="Date",e.TYPE_TIMESTAMP="Timestamp",e.TYPE_ACTIVENESS_DATE="ActivenessDate",e.TYPE_LOCAL_DATE="LocalDate",e.TYPE_BLOB="Blob",e.TYPE_ENUM="Enum",e.TYPE_CIK_ID="cik id",e.TYPE_LOOKUP="Lookup",e.TYPE_TYPEAHEAD="Typeahead",e.TYPE_URL="URL",e.TYPE_BLOG_URL="Blog URL",e.TYPE_IMAGE_URL="Image URL",e.TYPE_EMAIL="Email",e.TYPE_DEPENDENT_LOOKUP="DependentLookup",e.TYPE_ENTITY_ID="EntityId",e.TYPE_RDM_LOOKUPS_NOT_RESOLVED="RdmLookupsNotResolved",e.TYPE_COUNT="Count",e.TYPE_FILE="File",e.TYPE_SELECT="Select",e.TYPE_NESTED="Nested",e.TYPE_REFERENCE="Reference",e.TYPE_IMAGE="Image",e.TYPE_SSN="SSN"}(Je||(Je={}));const Xe=Je;let ze,Ze;!function(e){e.Viewing="Viewing",e.Editing="Editing",e.Suggesting="Suggesting"}(ze||(ze={})),function(e){e.Saving="Saving",e.Cloning="Cloning"}(Ze||(Ze={}));const et=(0,l.prop)("referencedEntityTypeURI"),tt=(0,l.prop)("relationshipTypeURI"),rt=(0,l.prop)("referencedAttributeURIs"),nt=(0,l.curry)(((e,t)=>(0,l.pipe)(rt,(0,l.filter)((0,l.startsWith)(e)))(t))),it=nt("configuration/relationTypes"),at=nt("configuration/entityTypes"),ot=(0,l.pipe)((0,l.prop)("uri"),(0,l.startsWith)("configuration/relationTypes")),st=(0,l.filter)(ot),lt=(e,t)=>!t||t.some((t=>t===e.uri)),ut="1Tempo4rary",ct="1Tepmo4Rel",pt=(0,l.cond)([[l.isNil,(0,l.always)("")],[(0,l.test)(/[^/]$/),(0,l.concat)(l.__,"/")]]),dt=e=>`${e}/uri$$${Date.now()+Math.round(1e3*Math.random())}`,yt=e=>()=>dt(e),ft=(e,t)=>{const r=pt(e),n=r+(r.includes("/attributes/")?"":"attributes/")+t;return dt(n)},Tt=e=>e&&e.includes("uri$$"),Et=yt("entities"),mt=yt("relations"),ht=(0,l.pipe)((0,l.split)("/attributes/"),(0,l.prop)("0")),bt=(0,l.startsWith)("relations/"),Ot=(0,l.startsWith)("entities/"),vt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/entityTypes/")),gt=(0,l.pipe)((0,l.defaultTo)(""),(0,l.startsWith)("configuration/relationTypes/")),_t=(0,l.curry)(((e,t)=>e===t||(e||"").startsWith(`${t||""}/`))),At=(0,l.pipe)((0,l.split)("/"),l.head),Nt=(0,l.pipe)((0,l.split)("/"),l.last),Pt=e=>e.split(".").slice(0,2).join("."),Rt=(e,t)=>{const[r,...n]=e.split("."),i=n.join(`/${r}/`);return`${t||""}/${r+(i&&`/${i}`)}`},St=(0,l.curry)(((e,t)=>`${e}/attributes/${t}`)),wt=(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("/")},It=e=>{var t;return null===(t=e.match(/.+?(?=\/attributes|\/analyticsAttributes)/gm))||void 0===t?void 0:t[0]},Ut=(0,l.either)((0,l.startsWith)("attributes."),(0,l.startsWith)("analyticsAttributes.")),Ct=e=>2===e.split("/").length,Lt=e=>5===e.split("/").length,Dt=e=>{const t=e.startsWith("configuration/")?3:2,r=e.split("/"),n=r.length<=5?t:-2;return r.slice(0,n).join("/")},jt=e=>e.replace(/uri\$\$/g,ut);function kt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ft=(0,l.allPass)([(0,l.propSatisfies)((0,l.either)(l.isNil,vt),"uri"),(0,l.prop)("faceted"),(0,l.propEq)("type",Xe.TYPE_STRING)]),Mt=(0,l.has)("values"),xt=(0,l.cond)([[(0,l.has)("dependentLookupCode"),(0,l.always)(Xe.TYPE_DEPENDENT_LOOKUP)],[(0,l.has)("lookupCode"),(0,l.always)(Xe.TYPE_LOOKUP)],[Mt,(0,l.always)(Xe.TYPE_ENUM)],[Ft,(0,l.always)(Xe.TYPE_TYPEAHEAD)],[(0,l.propEq)("type",Xe.TYPE_BOOLEAN),(0,l.always)(Xe.TYPE_BOOLEAN_RADIO)],[l.T,(0,l.prop)("type")]]),$t=(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){kt(e,t,r[t])}))}return e}({},e,{type:xt(e)})),(0,l.pick)(["type","values","lookupCode","uri","dependentLookupCode","singleValue"])),Vt=e=>!!e&&(!!e.autoGenerated&&e.type!==Xe.TYPE_NESTED||!!e.parentAutoGenerated),Gt=(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("uri")),(0,l.test)(/\/analyticsAttributes\//)),Wt=(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),Yt=e=>Gt(e)?"analyticsAttributes":"attributes",Bt=(0,l.propEq)("hidden",!0),qt=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.when)((0,l.pipe)(l.type,(0,l.test)(/Object/)),(0,l.prop)("type")),(0,l.equals)(e))(t))),Ht=qt(Xe.TYPE_NESTED),Qt=qt(Xe.TYPE_REFERENCE),Kt=qt(Xe.TYPE_IMAGE),Jt=(0,l.either)(Ht,Qt),Xt=(e,t)=>{const r=Gt(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(".")},zt=(0,l.either)((0,l.prop)("lookupCode"),(0,l.prop)("dependentLookupCode")),Zt=(0,l.pipe)(zt,Boolean),er=(0,l.pipe)((0,l.prop)("dependentLookupCode"),Boolean),tr=(0,l.both)(Zt,(0,l.pipe)(zt,("rdm",(0,l.pipe)(At,(0,l.equals)("rdm")))));const rr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Yt({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]||ir(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:[]},nr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=rr(e,t,r);return n.length?(0,l.last)(n):null},ir=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",Xe.TYPE_NESTED),(0,l.propEq)("type",Xe.TYPE_IMAGE)]),(0,l.prop)("attributes")],[(0,l.propEq)("type",Xe.TYPE_REFERENCE),(0,l.pipe)(rt,(0,l.map)((t=>nr(e,t))),(0,l.reject)(l.isNil))],[l.T,(0,l.always)(null)]])(t)},ar=[Xe.TYPE_ACTIVENESS_DATE,Xe.TYPE_DATE,Xe.TYPE_TIMESTAMP,Xe.TYPE_LOCAL_DATE],or=[Xe.TYPE_ACTIVENESS_DATE,Xe.TYPE_TIMESTAMP,Xe.TYPE_LOCAL_DATE],sr=e=>ar.includes(e),lr=e=>or.includes(e),ur=[Xe.TYPE_INT,Xe.TYPE_LONG,Xe.TYPE_NUMBER,Xe.TYPE_FLOAT,Xe.TYPE_DOUBLE,Xe.TYPE_COUNT],cr=e=>ur.includes(e),pr=e=>[Xe.TYPE_FLOAT,Xe.TYPE_DOUBLE].includes(e),dr=[Xe.TYPE_BOOLEAN,Xe.TYPE_BOOLEAN_RADIO,Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED],yr=e=>dr.includes(e),fr=[Xe.TYPE_URL,Xe.TYPE_BLOG_URL,Xe.TYPE_IMAGE_URL],Tr=e=>fr.includes(e),Er=qt(Xe.TYPE_EMAIL),mr=e=>Xe.TYPE_SSN===e;var hr,br=r(36631);!function(e){e.CREATE="canCreate",e.READ="canRead",e.UPDATE="canUpdate",e.DELETE="canDelete"}(hr||(hr={}));const Or=(0,l.curry)(((e,t,r)=>{var n;const i=e===hr.READ?["ROLE_UI_ALL","ROLE_UI_ALL_READONLY"]:["ROLE_UI_ALL"],a=null===(n=r[e])||void 0===n?void 0:n.roles;return!a||a.concat(i).some((e=>t.includes(e)))})),vr=(0,l.compose)((0,l.join)("&"),(0,l.map)((0,l.join)("=")),(0,l.map)((0,l.map)(encodeURIComponent)),l.toPairs),gr=(0,l.compose)((0,l.unless)(l.isEmpty,(e=>`?${e}`)),vr),_r=(0,l.pipe)((0,l.reject)(E),gr),Ar=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("?")?"&":"?")+vr(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}},Nr={EDITING:"Editing",SUGGESTING:"Suggesting",VIEWING:"Viewing"},Pr=(0,l.equals)(Nr.SUGGESTING),Rr=(0,l.equals)(Nr.EDITING),Sr=(0,l.equals)(Nr.VIEWING),wr=(0,l.either)(Rr,Pr),Ir=(0,l.curry)(((e,t)=>{let{entityTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),Ur=(0,l.curry)(((e,t)=>(0,l.pipe)(Ir(e),(0,l.prop)("extendsTypeURI"))(t))),Cr=(0,l.curry)(((e,t,r)=>{const n=r=>!!r&&(r===t||n(Ur(e,r)));return n(r)})),Lr=(0,l.curry)(((e,t)=>{const r=[];let n=t;for(;n;)r.push(n),n=Ur(e,n);return r})),Dr=(e,t,r)=>(0,l.prop)(r,t)?t[r]:(0,l.prop)("extendsTypeURI",t)?Dr(e,Ir(e,t.extendsTypeURI),r):void 0,jr=(e,t)=>{const r=t.map(Lr(e));return(r.length?r.reduce(l.intersection):[])[0]},kr=(e,t)=>Dr(e,(0,l.is)(Object,t)?t:Ir(e,t),"typeImage"),Fr=(e,t)=>e.entityTypes.reduce(((r,n)=>n.uri!==t&&Cr(e,t,n.uri)?r.concat(n.uri):r),[]),Mr={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"},xr={LIST_EQUALS:"listEquals",NOT_LIST_EQUALS:"not listEquals",LIST_EQUALS_CASE_SENSITIVE:"listEqualsCaseSensitive",NOT_LIST_EQUALS_CASE_SENSITIVE:"not listEqualsCaseSensitive"},$r={[Mr.EQUALS]:"equals",[Mr.NOT_EQUALS]:"not",[Mr.STARTS_WITH]:"starts with",[Mr.MISSING_VALUE]:"missing value",[Mr.IN_RANGE]:"in range",[Mr.HAS_ALL]:"has all",[Mr.FULL_TEXT]:"full text",[Mr.EXISTS]:"exists",[Mr.COUNT_EQUALS]:"count equals",[Mr.COUNT_NOT_EQUALS]:"count not equal",[Mr.COUNT_LT]:"count less",[Mr.COUNT_LTE]:"count less or equal",[Mr.COUNT_GT]:"count greater",[Mr.COUNT_GTE]:"count greater or equal",[Mr.COUNT_RANGE]:"count in range",[Mr.LT]:"less than",[Mr.LTE]:"less than or equal",[Mr.GT]:"greater than",[Mr.GTE]:"greater than or equal",[Mr.IN_FILE]:"in file",[Mr.NOT_IN_FILE]:"not in file",[Mr.CONTAINS]:"contains",[Mr.ON]:"on",[Mr.BEFORE]:"before",[Mr.AFTER]:"after",[Mr.WITHIN]:"within"},Vr="in",Gr="notIn",Wr="not range",Yr=e=>({[Vr]:Mr.EQUALS,[Gr]:Mr.NOT_EQUALS}[e]||e),Br={LAST_DAY:"lastDay",LAST_WEEK:"lastWeek",LAST_MONTH:"lastMonth",LAST_6MONTHS:"last6Months",LAST_YEAR:"lastYear",PICK_DATE:"pickDate"},qr={LAST_3DAYS:"last3Days"},Hr=["LAST_DAY","LAST_3DAYS","LAST_WEEK","LAST_MONTH","LAST_6MONTHS","LAST_YEAR","PICK_DATE"].reduce(((e,t)=>(e[t]=Br[t]||qr[t],e)),{}),Qr={[Br.LAST_DAY]:"Last 24 hours",[qr.LAST_3DAYS]:"Last 3 days",[Br.LAST_WEEK]:"Last 7 days",[Br.LAST_MONTH]:"Last 30 days",[Br.LAST_6MONTHS]:"Last 6 months",[Br.LAST_YEAR]:"Last year",[Br.PICK_DATE]:"Pick date"},Kr={NEW:"new",REMOVED:"removed",EDITED:"edited",IGNORED:"ignored"},Jr={ACTIVE_ONLY:"active",INACTIVE_ONLY:"not_active",ALL:"all"},Xr="<No label>",zr={IN:"in",OUT:"out"};var Zr=r(87918),en=r.n(Zr);function tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rn(e,t,r[t])}))}return e}function rn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nn={startDate:{type:Xe.TYPE_ACTIVENESS_DATE,get label(){return en().text("Start date")},uri:"startDate",name:"activeness.startDate",defaultValue:null,singleValue:!0,faceted:!0},endDate:{type:Xe.TYPE_ACTIVENESS_DATE,get label(){return en().text("End date")},uri:"endDate",name:"activeness.endDate",defaultValue:null,singleValue:!0,faceted:!0}},an=tn({id:{type:Xe.TYPE_ENTITY_ID,get label(){return en().text("Entity ID")},uri:"id",name:"id",singleValue:!0}},nn,{roles:{type:Xe.TYPE_STRING,get label(){return en().text("Roles")},uri:"roles",name:"roles",faceted:!0},tags:{type:Xe.TYPE_STRING,get label(){return en().text("Tags")},uri:"tags",name:"tags",faceted:!0}}),on={workflow:{type:Xe.TYPE_STRING,get label(){return en().text("Workflow")},uri:"workflow",name:"businessProcessData.businessProcessName",faceted:!0},assignee:{type:Xe.TYPE_STRING,get label(){return en().text("Assignee")},uri:"assignee",name:"businessProcessData.tasks.taskAssignee",faceted:!0},step:{type:Xe.TYPE_STRING,get label(){return en().text("Step")},uri:"step",name:"businessProcessData.tasks.taskName",faceted:!0},dueDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Due Date")},uri:"dueDate",name:"businessProcessData.tasks.taskDueDate"}},sn={commenter:{type:Xe.TYPE_STRING,get label(){return en().text("Commenter")},uri:"commenter",name:"attributes.Commenters",faceted:!0}},ln={notResolved:{type:Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED,get label(){return en().text("Records with RDM Transcode Error")},uri:"notResolved",name:"rdmLookups.resolved"}},un={createdBy:{type:Xe.TYPE_STRING,get label(){return en().text("Created by")},uri:"createdBy",name:"createdBy",singleValue:!0,faceted:!0},updatedBy:{type:Xe.TYPE_STRING,get label(){return en().text("Updated by")},uri:"updatedBy",name:"updatedBy",singleValue:!0,faceted:!0},createdTime:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Created time")},uri:"createdTime",name:"createdTime",singleValue:!0,faceted:!0},updatedTime:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Updated time")},uri:"updatedTime",name:"updatedTime",singleValue:!0,faceted:!0}},cn={matches:{type:Xe.TYPE_COUNT,get label(){return en().text("Potential Matches")},uri:"matches",name:"matches",singleValue:!0,hideForDataTenant:!0,faceted:!0},matchScore:{type:Xe.TYPE_COUNT,get label(){return en().text("Match scores")},uri:"matchScore",name:"potentialMatches.matchScore",singleValue:!0,hideForDataTenant:!0,faceted:!0}},pn={sourceSystems:{type:Xe.TYPE_STRING,get label(){return en().text("Source System Name")},uri:"sourceSystems",name:"sourceSystems",singleValue:!0,faceted:!0},value:{type:Xe.TYPE_STRING,get label(){return en().text("ID Value")},uri:"value",name:"crosswalks.value"},count:{type:Xe.TYPE_INT,get label(){return en().text("Crosswalk Count")},uri:"count",name:"crosswalks_count"},reltioLoadDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Reltio Load Date")},uri:"reltioLoadDate",name:"crosswalks.reltioLoadDate"},createDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Create Date")},uri:"createDate",name:"crosswalks.createDate"},updateDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Update Date")},uri:"updateDate",name:"crosswalks.updateDate"},deleteDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Delete Date")},uri:"deleteDate",name:"crosswalks.deleteDate"},publishDate:{type:Xe.TYPE_TIMESTAMP,get label(){return en().text("Publish Date")},uri:"publishDate",name:"crosswalks.sourcePublishDate"},sourceTable:{type:Xe.TYPE_STRING,get label(){return en().text("Source Table")},uri:"sourceTable",name:"crosswalks.sourceTable"}};let dn;!function(e){e.matchRules="matchRules",e.MLRecommendedMatch="MLRecommendedMatch"}(dn||(dn={}));const yn={[dn.matchRules]:{type:Xe.TYPE_STRING,get label(){return en().text("Match Rules")},uri:dn.matchRules,name:dn.matchRules,faceted:!0,hideForDataTenant:!0},[dn.MLRecommendedMatch]:{type:Xe.TYPE_STRING,get label(){return en().text("Match IQ")},uri:dn.MLRecommendedMatch,name:dn.MLRecommendedMatch,faceted:!0,hideForDataTenant:!0}},fn=tn({},an,on,sn,ln,un,cn,pn,yn,{type:{type:Xe.TYPE_STRING,get label(){return en().text("Type")},uri:"type",name:"type",singleValue:!0,faceted:!0}}),Tn="NOT_MATCH";var En=r(13980),mn=r.n(En);function hn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bn(e,t,r[t])}))}return e}function bn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const On=mn().oneOf(["mobile","tablet","desktop"]),vn=mn().shape({deviceTypes:mn().oneOfType([On,mn().arrayOf(On)]),roles:mn().arrayOf(mn().string)}),gn=mn().shape({value:mn().string,lookupCode:mn().string}),_n=mn().shape({link:mn().string,filename:mn().string}),An=mn().shape({displayName:mn().string,parent:mn().string}),Nn=mn().oneOfType([mn().string,mn().number,mn().bool,gn]),Pn=mn().oneOfType([Nn,mn().arrayOf(Nn)]),Rn=mn().shape({fieldName:mn().string,values:mn().arrayOf(Pn),filter:mn().string,type:mn().string}),Sn=mn().shape({minValue:mn().number,maxValue:mn().number}),wn=mn().shape({label:mn().string,name:mn().string,description:mn().string,type:mn().string,hidden:mn().bool,faceted:mn().bool,searchable:mn().bool,uri:mn().string,access:mn().arrayOf(mn().string),cardinality:Sn}),In=mn().shape({label:mn().string,uri:mn().string,typeColor:mn().string,direction:mn().string,startObject:mn().object,endObject:mn().object}),Un=mn().shape({typeColor:mn().string,typeIcon:mn().string,typeImage:mn().string,label:mn().string,uri:mn().string,attributes:mn().arrayOf(wn)}),Cn=mn().shape({uri:mn().string,label:mn().string,memberTypes:mn().array,extendsTypeUri:mn().string,attributes:mn().arrayOf(wn)}),Ln=mn().shape({uri:mn().string,label:mn().string,extendsTypeUri:mn().string,relationshipTypeURIs:mn().arrayOf(mn().string)}),Dn=mn().shape({uri:mn().string,description:mn().string,label:mn().string,schemaVersion:mn().string,entityTypes:mn().arrayOf(Un),roles:mn().arrayOf(mn().object),groupTypes:mn().arrayOf(mn().object),relationTypes:mn().arrayOf(In),graphTypes:mn().arrayOf(Ln),interactionTypes:mn().arrayOf(Cn),sources:mn().arrayOf(mn().object)}),jn=mn().shape({uri:mn().string,type:mn().string}),kn=mn().shape({uri:mn().string,attributes:mn().object,type:mn().string,timestamp:mn().number,members:mn().object}),Fn=mn().shape({uri:mn().string,type:mn().string}),Mn=mn().shape({value:mn().object,ov:mn().bool,type:mn().string,uri:mn().string}),xn=mn().shape({refEntity:mn().oneOfType([mn().array,mn().object]),refRelation:mn().oneOfType([mn().array,mn().object]),value:mn().object,ov:mn().bool,type:mn().string,uri:mn().string}),$n=mn().oneOf((0,l.values)(Nr)),Vn=mn().shape({type:mn().oneOf(Object.values(me)).isRequired,attributeTypeUri:mn().string.isRequired,parentUri:mn().string.isRequired,uri:mn().string,message:mn().string}),Gn={attributeType:wn,showEmptyEditors:mn().bool,lazy:mn().bool,mode:$n,metadata:Dn,ownError:Vn,errors:mn().arrayOf(Vn),crosswalks:mn().array,onAddAttributes:mn().func,onAddOneMore:mn().func,onDeleteAttribute:mn().func,onChangeAttribute:mn().func,additionalControlsRenderer:mn().func,hideDeleteButton:mn().bool,showNonOv:mn().bool,state:mn().oneOf(["deleted","edited"]),expanded:mn().bool},Wn=hn({attributeValue:Mn},Gn),Yn=hn({attributeValue:xn},Gn),Bn=mn().shape({value:mn().oneOfType([mn().string,mn().bool,mn().number]),ov:mn().bool,type:mn().string,uri:mn().string,lookupCode:mn().string,lookupRawValue:mn().string}),qn=mn().shape({totalOvValues:mn().number,totalValues:mn().number}),Hn=mn().shape({inRelations:mn().arrayOf(mn().oneOfType([mn().object,mn().string])),outRelations:mn().arrayOf(mn().oneOfType([mn().object,mn().string])),groups:mn().arrayOf(mn().string),entityTypes:mn().arrayOf(mn().string),nextEntry:mn().object}),Qn=mn().oneOf(["asc","desc"]),Kn=mn().shape({id:mn().string,content:Hn,allowOnlyCreateNew:mn().bool,sortColumn:mn().string,sortOrder:Qn,"text-empty":mn().string,max:mn().number,icon:mn().string,caption:mn().string,canCreate:vn,canRead:vn,canUpdate:vn,canDelete:vn,editingEnabled:mn().bool}),Jn=mn().shape({id:mn().string,caption:mn().string,pageSize:mn().number,icon:mn().string,canCreate:vn,canRead:vn,canUpdate:vn,canDelete:vn,attributes:mn().object}),Xn=mn().shape({entityUri:mn().string,entityType:mn().string,entityLabel:mn().string,object:jn}),zn=mn().shape({relationUri:mn().string,relationType:mn().string,relationLabel:mn().string,direction:mn().string,object:Fn}),Zn=mn().shape({entity:Xn,relation:zn}),ei=mn().shape({value:mn().string,isRawFilter:mn().bool}),ti=mn().shape({id:mn().string,label:mn().string,name:mn().string,availableEntityTypes:mn().array}),ri=mn().shape({id:mn().string,allowMergeAll:mn().bool,matchActions:mn().object,availableTabs:mn().arrayOf(mn().oneOf(["findMatches","potentialMatches","notAMatch"]))}),ni=mn().shape({matchRules:mn().arrayOf(mn().string),object:jn,shortestTransitiveMatchPath:mn().arrayOf(mn().shape({matchRules:mn().arrayOf(mn().string),match:mn().string})),direct:mn().bool,matchScore:mn().number}),ii=mn().arrayOf(ni),ai=mn().arrayOf(mn().shape({uri:mn().string,label:mn().string})),oi=[{label:en().text("And"),value:"and"},{label:en().text("Or"),value:"or"},{label:en().text("And not"),value:"and not"},{label:en().text("Or not"),value:"or not"}];function si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const li=(0,l.curry)(((e,t)=>{let{relationTypes:r}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),ui=(0,l.pipe)(li,(0,l.propOr)("","label")),ci=(0,l.curry)(((e,t)=>{const r=li(e,t);return[(0,l.path)(["startObject","objectTypeURI"],r),(0,l.path)(["endObject","objectTypeURI"],r)]})),pi=(0,l.curry)(((e,t,r)=>{const[n,i]=ci(e,r);return Cr(e,n,t)||Cr(e,i,t)})),di=(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){si(e,t,r[t])}))}return e}({},e,{[r]:n})}),{})),yi=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?zr.OUT:zr.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(zr.IN),i=r(zr.OUT);return{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}},fi=(0,l.pathOr)("",["directionalContext",0,"labelPattern"]),Ti={CREATE:"CREATE",READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",INITIATE_CHANGE_REQUEST:"INITIATE_CHANGE_REQUEST",MERGE:"MERGE",UNMERGE:"UNMERGE"},Ei=(0,l.curry)(((e,t)=>e.every((e=>mi(e,t))))),mi=(0,l.curry)(((e,t)=>{const r=Vt(t);return hi(e,t)&&(e===Ti.READ||!r)})),hi=(e,t)=>!t||!t.access||t.access.includes(e),bi=(0,l.curry)(((e,t,r)=>mi(Ti.READ,r)&&(Pr(t)?mi(Ti.INITIATE_CHANGE_REQUEST,r):mi(e,r)))),Oi=bi(Ti.CREATE),vi=bi(Ti.DELETE),gi=bi(Ti.UPDATE),_i=Ei([Ti.CREATE,Ti.MERGE,Ti.READ,Ti.UPDATE]),Ai=Ei([Ti.UPDATE,Ti.READ,Ti.CREATE]),Ni=Ei([Ti.UPDATE,Ti.READ]),Pi=Ei([Ti.DELETE,Ti.UPDATE,Ti.READ]),Ri=(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["*"])),Si=(e,t,r)=>(0,l.pipe)((0,l.map)(Ri(e,t)),(0,l.filter)(l.identity))(r),wi=(e,t,r)=>{const n=Si(e,r,t);return(0===n.length||n.some((e=>{let{allowMerge:t}=e;return!1!==t})))&&mi(Ti.MERGE,r)},Ii=(0,l.curry)(((e,t,r,n)=>{const i=li(e,n),[a,o]=ci(e,n);return i&&mi(Ti.CREATE,i)&&Cr(e,a,t.type)&&Cr(e,o,r.type)})),Ui=(e,t,r,n,i)=>{const a=Ir(e,n.type),o=Si(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(Ii(e,n,i))||a.some(Ii(e,i,n))}))},Ci=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=Ir(e,r.type),o=(0,l.propOr)({},"matchActions",t);return{canMerge:wi(o,i,a),canAddRelation:Ui(e,o,i,r,n),canMark:mi(Ti.UPDATE,a)&&mi(Ti.READ,a)}},Li=(e,t,r,n)=>(0,l.pipe)((0,l.map)((n=>Ci(e,t,n.object,r,n.matchRules))),(0,l.reduce)((0,l.mergeWith)(l.and),{}))(n),Di=Gt,ji=(0,l.complement)(Di),ki=mi(Ti.READ),Fi=e=>{let{attributeType:t,mode:r}=e;return ji(t)&&Oi(r,t)&&!Bt(t)},Mi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0}=e;const a=Tt(r.uri),o=gi(n),s=Oi(n);return(0,l.cond)([[Di,l.F],[(0,l.always)(a),l.T],[(0,l.always)(i),o],[l.T,(0,l.allPass)([o,s])]])(t)},xi=e=>{let{attributeType:t,attributeValue:r,mode:n,isReltioCrosswalk:i=!0,metadata:a}=e;const o=Tt(r.uri),s=gi(n),u=vi(n),c=Vi(Ti.UPDATE,n,a,r),p=Vi(Ti.DELETE,n,a,r);return(0,l.cond)([[Di,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)},$i=(0,l.curry)(((e,t,r,n)=>{const i=ir(t,n);return!i||!(0,l.pipe)((0,l.unless)(Array.isArray,l.of),(0,l.map)((0,l.prop)("value")))(r).some((r=>i.filter((e=>r&&!!r[e.name])).some((n=>!hi(e,n)||!$i(e,t,r[n.name],n)))))})),Vi=(0,l.curry)(((e,t,r,n,i)=>Pr(t)?$i(Ti.INITIATE_CHANGE_REQUEST,r,n,i):$i(e,r,n,i))),Gi=(0,l.both)((0,l.complement)(Bt),ki),Wi="SuperUser",Yi="allTenants",Bi=[Yi,"allCustomers"],qi=e=>{let{allowedPermissionsNames:t,permissionsNames:r,permissionsConfig:n,superUserEnvironments:i}=e;return t.map((e=>{switch(e){case r.NON_SECURED:return l.T;case r.SECURED:return e=>void 0!==e.userPermissions;default:return(t=n[e])?(e,r)=>{let{params:n}=r;return((e,t,r,n)=>{const i=(0,l.path)(["userPermissions","permissions"],e)||{};return Object.keys(i).filter((e=>{const t=e.split(":"),[n]=t;return n===r.serviceId||n===Wi})).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===Wi){const e=r?Bi.concat(r.map((e=>`allTenants.${e}`))):Bi,n=r&&t[0]===Yi?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}))},Hi={NON_SECURED:"NON_SECURED",SECURED:"SECURED",CAN_EXPORT:"CAN_EXPORT",CAN_EXPORT_ACTIVITIES:"CAN_EXPORT_ACTIVITIES",CAN_IMPORT_ENTITIES_FROM_DT:"CAN_IMPORT_ENTITIES_FROM_DT",CAN_READ_ENTITIES_FROM_DT:"CAN_READ_ENTITIES_FROM_DT",CAN_START_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_START_PROCESS_INSTANCE_SEARCH_QUERY",CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY:"CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY",CAN_CREATE_ENVIRONMENT_CONFIG_JAR:"CAN_CREATE_ENVIRONMENT_CONFIG_JAR",CAN_CREATE_CONFIG_JAR:"CAN_CREATE_CONFIG_JAR",CAN_VIEW_ENVIRONMENT_CONFIG_JAR:"CAN_VIEW_ENVIRONMENT_CONFIG_JAR",CAN_VIEW_CONFIG_JAR:"CAN_VIEW_CONFIG_JAR",CAN_MANAGE_WORKFLOW_DEFINITION:"CAN_MANAGE_WORKFLOW_DEFINITION",CAN_VIEW_WORKFLOW_DEFINITION:"CAN_VIEW_WORKFLOW_DEFINITION",CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION:"CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION",CAN_UPDATE_WORKFLOW_DATA_TASK:"CAN_UPDATE_WORKFLOW_DATA_TASK",CAN_READ_WORKFLOW_DATA_TASK:"CAN_READ_WORKFLOW_DATA_TASK",CAN_CONFIG_ENVIRONMENT_REGISTER:"CAN_CONFIG_ENVIRONMENT_REGISTER",CAN_UPDATE_PROCESS_INSTANCE:"CAN_UPDATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS:"CAN_EXECUTE_WORKFLOW_JOBS",CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE:"CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE",CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS:"CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS",CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA:"CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA",CAN_VIEW_WORKFLOW_JOBS:"CAN_VIEW_WORKFLOW_JOBS",CAN_MAKE_BULK_UPDATE:"CAN_MAKE_BULK_UPDATE",CAN_OPEN_DATA_LOADER_EXECUTE:"CAN_OPEN_DATA_LOADER_EXECUTE",CAN_OPEN_DATA_LOADER_READ:"CAN_OPEN_DATA_LOADER_READ",CAN_BULK_DELETE_PROFILES:"CAN_BULK_DELETE_PROFILES",CAN_READ_MDM_DATA_ENTITIES:"CAN_READ_MDM_DATA_ENTITIES",IS_FREEMIUM_ADMIN:"IS_FREEMIUM_ADMIN",CAN_READ_DVF:"CAN_READ_DVF"},Qi={[Hi.CAN_EXPORT]:{serviceId:"export",resourcePath:["data","entities"],privileges:["EXECUTE"]},[Hi.CAN_EXPORT_ACTIVITIES]:{serviceId:"export",resourcePath:["data","activities"],privileges:["EXECUTE"]},[Hi.CAN_IMPORT_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ","UPDATE"]},[Hi.CAN_READ_ENTITIES_FROM_DT]:{serviceId:"dtss",resourcePath:["data","entities"],privileges:["READ"]},[Hi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["CREATE"]},[Hi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["READ"]},[Hi.CAN_CREATE_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["CREATE","DELETE"]},[Hi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["CREATE","DELETE"]},[Hi.CAN_VIEW_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["config","jar"],privileges:["READ"]},[Hi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]:{serviceId:"workflow",resourcePath:["environment","config","jar"],privileges:["READ"]},[Hi.CAN_MANAGE_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["CREATE","DELETE"]},[Hi.CAN_VIEW_WORKFLOW_DEFINITION]:{serviceId:"workflow",resourcePath:["config","definition"],privileges:["READ"]},[Hi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]:{serviceId:"workflow",resourcePath:["environment","config","definition"],privileges:["CREATE","DELETE"]},[Hi.CAN_UPDATE_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["UPDATE"]},[Hi.CAN_READ_WORKFLOW_DATA_TASK]:{serviceId:"workflow",resourcePath:["data","tasks"],privileges:["READ"]},[Hi.CAN_CONFIG_ENVIRONMENT_REGISTER]:{serviceId:"workflow",resourcePath:["environment","config","register"],privileges:["CREATE","DELETE"]},[Hi.CAN_UPDATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["data","process"],privileges:["UPDATE","DELETE"]},[Hi.CAN_EXECUTE_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["EXECUTE"]},[Hi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]:{serviceId:"workflow",resourcePath:["jobs","terminateProcessInstances"],privileges:["EXECUTE"]},[Hi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","updateTasks"],privileges:["EXECUTE"]},[Hi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]:{serviceId:"workflow",resourcePath:["jobs","validateTasks"],privileges:["EXECUTE"]},[Hi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]:{serviceId:"workflow",resourcePath:["jobs","syncBusinessProcessData"],privileges:["EXECUTE"]},[Hi.CAN_VIEW_WORKFLOW_JOBS]:{serviceId:"workflow",resourcePath:["jobs"],privileges:["READ"]},[Hi.CAN_MAKE_BULK_UPDATE]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["EXECUTE"]},[Hi.CAN_OPEN_DATA_LOADER_EXECUTE]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["EXECUTE"]},[Hi.CAN_OPEN_DATA_LOADER_READ]:{serviceId:"dataloader",resourcePath:["tasks","jobs"],privileges:["READ"]},[Hi.CAN_BULK_DELETE_PROFILES]:{serviceId:"MDM",resourcePath:["tasks","bulk"],privileges:["DELETE"]},[Hi.IS_FREEMIUM_ADMIN]:{serviceId:"pms",resourcePath:["config","freetier","user"],privileges:["CREATE","DELETE","UPDATE"]},[Hi.CAN_READ_MDM_DATA_ENTITIES]:{serviceId:"MDM",resourcePath:["data","entities"],privileges:["READ"]},[Hi.CAN_READ_DVF]:{serviceId:"DVF",resourcePath:["functionsManagement"],privileges:["READ"]}},Ki=(0,l.curry)(((e,t,r)=>qi({allowedPermissionsNames:e,permissionsNames:Hi,permissionsConfig:Qi}).some((e=>e(t,{params:{tenant:r}}))))),Ji=Ki([Hi.CAN_EXPORT]),Xi=Ki([Hi.CAN_EXPORT_ACTIVITIES]),zi=Ki([Hi.CAN_IMPORT_ENTITIES_FROM_DT]),Zi=Ki([Hi.CAN_READ_ENTITIES_FROM_DT]),ea=Ki([Hi.CAN_START_PROCESS_INSTANCE_SEARCH_QUERY]),ta=Ki([Hi.CAN_UPDATE_PROCESS_INSTANCE]),ra=Ki([Hi.CAN_VIEW_WORKFLOW_DEFINITION]),na=Ki([Hi.CAN_CONFIG_ENVIRONMENT_REGISTER]),ia=Ki([Hi.CAN_UPDATE_WORKFLOW_DATA_TASK]),aa=Ki([Hi.CAN_READ_WORKFLOW_DATA_TASK]),oa=Ki([Hi.CAN_MANAGE_WORKFLOW_DEFINITION]),sa=Ki([Hi.CAN_MANAGE_WORKFLOW_ENVIRONMENT_DEFINITION]),la=Ki([Hi.CAN_EXECUTE_WORKFLOW_JOBS_SYNC_BUSINESS_PROCESS_DATA]),ua=Ki([Hi.CAN_EXECUTE_WORKFLOW_JOBS_VALIDATE_TASKS]),ca=Ki([Hi.CAN_EXECUTE_WORKFLOW_JOBS_UPDATE_TASKS]),pa=Ki([Hi.CAN_EXECUTE_WORKFLOW_JOBS_TERMINATE_PROCESS_INSTANCE]),da=Ki([Hi.CAN_EXECUTE_WORKFLOW_JOBS]),ya=Ki([Hi.CAN_CREATE_ENVIRONMENT_CONFIG_JAR]),fa=Ki([Hi.CAN_CREATE_CONFIG_JAR]),Ta=Ki([Hi.CAN_VIEW_ENVIRONMENT_CONFIG_JAR]),Ea=Ki([Hi.CAN_VIEW_CONFIG_JAR]),ma=Ki([Hi.CAN_VIEW_PROCESS_INSTANCE_SEARCH_QUERY]),ha=Ki([Hi.CAN_VIEW_WORKFLOW_JOBS]),ba=Ki([Hi.CAN_MAKE_BULK_UPDATE]),Oa=Ki([Hi.CAN_OPEN_DATA_LOADER_EXECUTE,Hi.CAN_OPEN_DATA_LOADER_READ]),va=Ki([Hi.CAN_BULK_DELETE_PROFILES]),ga=Ki([Hi.CAN_READ_MDM_DATA_ENTITIES]),_a=Ki([Hi.CAN_READ_DVF]),Aa=Ki([Hi.IS_FREEMIUM_ADMIN]),Na=(0,l.reject)(Bt),Pa=(e,t)=>(0,l.pipe)((0,l.defaultTo)([]),Na,(0,l.filter)(e))(t),Ra=(0,l.curry)(((e,t)=>Pa((t=>Fi({attributeType:t,mode:e})),t))),Sa=(0,l.curry)(((e,t)=>Pa((t=>Fi({attributeType:t,mode:e})||Gi(t)),t))),wa=(0,l.pipe)((0,l.defaultTo)([]),(0,l.filter)(Gi)),Ia=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ia(e)])))),Ua=(0,l.pipe)((0,l.propOr)([],"attributes"),(0,l.filter)(Gi),(0,l.chain)((0,l.when)((0,l.has)("attributes"),(e=>[e,...Ua(e)])))),Ca=(0,l.pipe)((0,l.propOr)([],"analyticsAttributes"),(0,l.chain)((0,l.when)((0,l.has)("analyticsAttributes"),(e=>[e,...Ca(e)])))),La=(0,l.pipe)(Ir,(0,l.converge)(l.concat,[Ua,Ca]));function Da(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ja(e,t,r[t])}))}return e}function ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ka=(0,l.curry)(((e,t)=>(0,l.evolve)({attributes:(0,l.map)((0,l.pipe)(e,ka(e)))},t))),Fa=e=>{var t;return Da({},e,{matchGroups:(0,l.uniq)((e.matchGroups||[]).concat((null===(t=e.hidden)||void 0===t?void 0:t.matchGroups)||[]))})},Ma=(0,l.both)((0,l.has)("values"),(0,l.has)("lookupCode")),xa=(0,l.when)(Ma,(0,l.dissoc)("values")),$a=(0,l.when)((0,l.has)("lookupCode"),(e=>{let{lookupCode:t}=e;return Da({},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})})),Va=e=>{let{hidden:t,dependentLookupAttributes:r}=e;return!t&&r},Ga=(0,br.Z)((e=>{const{entityTypes:t=[],relationTypes:r=[]}=e;return(0,l.chain)(Ia,t).concat((0,l.chain)(Ia,r)).some(Va)})),Wa=e=>{let t=!1;const r=ka((e=>e.cardinality&&(t=!0,e.cardinality.minValue)?Da({},e,{required:!0}):e))(e);return t&&(r.forceValidate=!0),r},Ya=e=>{const t=Ga(e),r=(0,l.map)((e=>ka((0,l.pipe)(xa,(0,l.when)((0,l.always)(e),$a))))(t)),n=(0,l.map)(Fa),i=(0,l.map)(Wa);return(0,l.evolve)({entityTypes:(0,l.pipe)(r,n,i),relationTypes:(0,l.pipe)(r,i)},e)},Ba=(0,l.curry)(((e,t)=>{let{graphTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)})),qa=(0,l.prop)("relationshipTypeURIs"),Ha=(0,l.curry)(((e,t)=>{var r;return(null===(r=e.graphTypes)||void 0===r?void 0:r.filter(Qa(e,t)))||[]})),Qa=(e,t)=>r=>{let{relationshipTypeURIs:n}=r;return null==n?void 0:n.some(pi(e,t))},Ka=(e,t)=>(0,l.pipe)(Ba,(0,l.defaultTo)({}),qa,(0,l.defaultTo)([]),(0,l.chain)(ci(e)),(0,l.reject)(l.isNil),l.uniq,(0,l.map)(Ir(e)))(e,t),Ja=(0,l.allPass)([(0,l.propEq)("matchMethod","match_iq"),(0,l.anyPass)([(0,l.propEq)("scope","ALL"),(0,l.propEq)("scope","INTERNAL")])]),Xa=e=>(0,l.pipe)((0,l.defaultTo)({}),(0,l.prop)("matchGroups"),(0,l.defaultTo)([]),(0,l.any)(e)),za=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xa((0,l.complement)(Ja))(e)},Za=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xa(Ja)(e)},eo=(0,l.pipe)(Ir,(0,l.propOr)([],"matchGroups")),to=(e,t,r)=>(0,l.pipe)(eo,(0,l.find)((0,l.propEq)("uri",r)))(e,t),ro=(0,l.curry)(((e,t,r)=>(0,l.pipe)(to,(0,l.propOr)(r,"label"))(e,t,r))),no=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(eo,(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]})),io=e=>(0,l.partition)(Ja,e),ao=(0,l.includes)(l.__,["and","or","not"]),oo=(0,l.includes)(l.__,(0,l.values)({EXACT:"exact",EXACT_OR_NULL:"exactOrNull",EXACT_OR_ALL_NULL:"exactOrAllNull",NOT_EXACT_SAME:"notExactSame",FUZZY:"fuzzy"})),so=(0,l.includes)(l.__,["equals","notEquals","in"]),lo=(0,l.pipe)(l.toPairs,(0,l.chain)((e=>{let[t,r]=e;return ao(t)?lo(r):oo(t)?r.filter(vt):so(t)?r.map((0,l.prop)("uri")).filter(vt):[]})),l.uniq),uo=(0,l.pipe)((0,l.pluck)("rule"),(0,l.chain)(lo),l.uniq),co=(0,l.pipe)(eo,uo),po=(0,l.pipe)(no,uo),yo=(e,t)=>{let{interactionTypes:r=[]}=e;return(0,l.find)((0,l.propEq)("uri",t),r)},fo=(0,l.pipe)(yo,Ua),To=(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||Cr(e,n,t)})(e,t))})(e,t)),Eo=e=>!!e.required,mo=(e,t,r)=>{const n=(0,l.cond)([[vt,Ir(e)],[gt,li(e)]])(t);return ho(e,n,r)},ho=(e,t,r)=>!t||t.hidden&&!(e=>e.uri&&vt(e.uri)&&3===e.uri.split("/").length)(t)?[]:t.attributes?t.attributes.filter((e=>!e.hidden&&!Vt(e))).flatMap((t=>{const n=t.required?[t]:[];if(r){let i;if(t.type===Xe.TYPE_REFERENCE){const n=tt(t),a=rt(t);i=mo(e,n,r).filter((e=>a.some(_t(e.uri))))}else t.attributes&&(i=ho(e,t,r));i&&n.push(...i)}return n})):t.type===Xe.TYPE_REFERENCE?mo(e,tt(t),r):[],bo=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),Eo]),e.attributes||[])},Oo=(e,t)=>{const r=at(e);return(0,l.pipe)((0,l.filter)((e=>r.includes(e.uri))),(0,l.sort)((n=r,(e,t)=>n.indexOf(e.uri)-n.indexOf(t.uri))))(t.attributes||[]);var n},vo=(0,l.curry)(((e,t)=>{const r=(t,n)=>{if(Array.isArray(n))return n.map((e=>r(t,e)));if(n&&"object"==typeof n){const e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=r(t,n[t]));return e}return"string"==typeof n&&e.includes(t)?en().text(n):n};return r(null,t)})),go=["label","description","abbreviation","caption","toolTip"],_o=e=>vo(go,e),Ao=(0,l.curry)(((e,t)=>{const{sources:r}=e,n=Nt(t);return r.find((e=>{let{uri:t}=e;return Nt(t)===n}))})),No=(0,l.curry)(((e,t)=>{const r=Nt(t);return(0,l.pipe)(Ao(l.__,t),(0,l.unless)(l.isNil,(0,l.propOr)(r,"label")))(e)})),Po=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"})},Ro=(e,t)=>{let{sources:r=[]}=e;return r.find((e=>{let{uri:r,label:n}=e;return r===t||n===t||r.substring(r.lastIndexOf("/")+1)===t}))},So=(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)})),wo=(e,t)=>(e.roles||[]).filter((r=>{var n;return((null===(n=Ir(e,t))||void 0===n?void 0:n.entityTypeRoleURIs)||[]).includes(r.uri)}));function Io(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Uo(e,t,r[t])}))}return e}function Uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Co=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 Lo(i,e,t,r,n)},Lo=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["attributes"];return Z.fromNull(e&&e.length?e:ir(t,r)).map((e=>e.map((e=>{const r=Co(t,e,n,i);return r.length?Io({},e,{children:r}):e})))).orSome([]).filter((0,l.either)((0,l.complement)(Jt),(0,l.prop)("children"))).filter(Gi).filter(n).filter((0,l.either)((0,l.prop)("label"),(0,l.prop)("name")))},Do=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Co(e,t,r,["attributes","analyticsAttributes"])},jo=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Co(e,t,r,["attributes"])},ko=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;return Co(e,t,r,["analyticsAttributes"])},Fo=(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)})),Mo=(0,l.curry)(((e,t)=>(t||[]).find((t=>{let{uri:r}=t;return Nt(r)===e})))),xo=e=>{let{survivorshipStrategies:t}=e;const[r]=t||[];return(0,l.pipe)((0,l.either)((0,l.find)((0,l.propEq)("default",!0)),Mo("LUD")),(0,l.defaultTo)(r))(t||[])},$o=(e,t)=>{let{survivorshipStrategies:r}=e;return Mo(t,r)},Vo=(0,l.allPass)([(0,l.complement)(l.isNil),mi(Ti.READ)]),Go=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),mi(Ti.READ)]),Wo=(0,l.allPass)([(0,l.complement)(l.isNil),(0,l.complement)((0,l.prop)("abstract")),(0,l.complement)((0,l.propEq)("uiConfigHiddenType",!0)),(0,l.anyPass)([mi(Ti.CREATE),mi(Ti.INITIATE_CHANGE_REQUEST)])]),Yo=(0,l.curryN)(2,(0,l.pipe)(Ir,Go));function Bo(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 qo(e,t){for(var r=e.substr(e.indexOf("/attributes/")+12).split("/"),n=[],i=0;i<r.length;i+=2)n.push(Bo(r[i],r[i+1],e,t));return n}function Ho(e,t,r,n,i,a,o){void 0===a&&(a=0);var s=qo(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 Ho(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 Qo(e,t,r,n,i,a){void 0===a&&(a=0);var o=qo(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()?(Ko(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(Ko.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=Ho(e,t,r,n,i,a),s}var c=Qo(e,o,o.valueUri,{},i,a);Qo(c,t,r,n,i,a+1)}function Ko(e,t){ue(e)?(t.value=e.value,t.lookupCode=e.lookupCode):(t.value=e,t.lookupCode&&(t.lookupCode=e))}function Jo(e,t,r,n){void 0===n&&(n=0);var i=qo(r)[n];if(i.hasChildren){var a=(e[i.name]||[]).filter((function(e){return e.uri===i.valueUri}))[0];a&&Jo(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 Xo(e,t){e.roles=t||[]}function zo(e,t){e.tags=t||[]}function Zo(e,t){e.startDate=t||""}function es(e,t){e.endDate=t||""}const ts=e=>{let{ov:t}=e;return!1!==t},rs=(e,t)=>((e,t)=>Tr(e.type)&&ae(t))(e,t)||((e,t)=>Er(e.type)&&oe(t))(e,t),ns=(0,l.curry)(((e,t)=>(0,l.cond)([[l.isNil,(0,l.always)(null)],[(0,l.pipe)((0,l.prop)(e),Array.isArray),(0,l.path)([e,0])],[l.T,(0,l.prop)(e)]])(t))),is=ns("refEntity"),as=ns("refRelation"),os=e=>(0,l.isEmpty)(e)?[]:[{objectURI:e.uri,type:e.type}],ss=e=>{let{uri:t}=e;return[{type:"configuration/sources/Reltio",objectURI:`relations/${(0,l.pipe)((0,l.split)("/"),l.last)(t)}`}]},ls=(0,l.prop)("objectURI"),us=(0,l.prop)("objectURI"),cs=(0,l.prop)("type"),ps=(0,l.pipe)(is,(0,l.defaultTo)({}),ls),ds=(0,l.pipe)(as,(0,l.defaultTo)({}),us),ys=(0,l.pipe)(is,(0,l.defaultTo)({}),cs),fs=(e,t)=>{const r=(t&&t.crosswalks||[]).map((e=>({attributes:e.attributeURIs||[],type:e.type})));return(e||[]).concat(r)},Ts=(0,l.evolve)({refEntity:re,refRelation:re}),Es=(e,t,r,n)=>{const i=rr(e,r),a=Ir(e,t.type)||li(e,t.type);if(0===i.length)return null;const o=Yt(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(!lt(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=>tt(e)===r.uri||et(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},ms=(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?ms(a.value,o):a},hs=(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 ms(e[r],i)})),bs=(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")]]),Os=(0,l.cond)([[(0,l.has)("lookupCode"),(0,l.pick)(["value","lookupCode","ov"])],[(0,l.has)("refEntity"),(0,l.pick)(["refEntity","label","value","ov"])],[l.T,(0,l.pick)(["value","ov"])]]),vs=(0,l.curry)(((e,t,r)=>{const[n,...i]=t;return(0,l.pipe)((0,l.defaultTo)({}),(0,l.propOr)([],n),(t=>e?t.filter(e):t),(0,l.when)((()=>i.length>0),(0,l.pipe)((0,l.map)((0,l.prop)("value")),(0,l.map)(vs(e,i)))))(r)})),gs=(0,l.curry)(((e,t)=>(0,l.ifElse)((0,l.is)(Array),(0,l.map)(gs(e)),e)(t))),_s=(0,l.curry)(((e,t,r,n)=>(0,l.pipe)(vs(e,r),gs(t))(n))),As=_s(null,bs),Ns=_s(ts,bs),Ps=_s(null,Os),Rs=_s(ts,Os),Ss=(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=hs(e,t))||void 0===i||null===(a=i.value)||void 0===a?void 0:a[r]},ws=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.find)((0,l.pipe)(ps,(0,l.equals)(t))))((null==e?void 0:e.attributes)||{}),Is=(e,t)=>{const r=Dt(t),n=(0,l.pipe)((0,l.split)("/"),(0,l.dropLast)(1),l.last)(t);return Ss(e,r,n)},Us=Object.values(nn),Cs=(0,l.includes)(l.__,Us),Ls=e=>Us.reduce(((t,r)=>{let{uri:n}=r;return void 0!==e[n]?(0,l.assoc)(n,e[n],t):t}),{});function Ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){js(e,t,r[t])}))}return e}function js(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}`,Fs=[fn.matches.name,fn.matchRules.name],Ms=(0,l.values)(on).map((e=>e.name)),xs=e=>(0,l.when)((0,l.always)(!e),(0,l.reject)((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Ms)))),$s=(0,l.curry)(((e,t)=>{const r=t.filter((0,l.pipe)((0,l.prop)("name"),(0,l.includes)(l.__,Fs)));return(e||[]).flatMap((e=>r.map((0,l.evolve)({label:(0,l.concat)(`${e.label} `),name:t=>ks(`dtPotentialMatches.${t}`,e.id)})))).concat(t)})),Vs=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,l.pipe)(l.values,xs(r),$s(t),(0,l.find)((0,l.either)((0,l.propEq)("name",e),t?l.F:t=>e.startsWith(ks(`dtPotentialMatches.${t.name}`,"")))))(fn)},Gs=(0,l.propEq)("uri",fn.type.uri),Ws=e=>(0,l.values)(yn).some((0,l.propEq)("uri",null==e?void 0:e.uri)),Ys=(0,l.propEq)("uri",pn.sourceSystems.uri),Bs=Object.values(an),qs=(0,l.includes)(l.__,Bs),Hs=e=>{let{entity:t,attributeType:r,value:n}=e;return Ds({},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 Ds({},t,{[r.uri]:n})},Js=(0,l.propEq)("uri",an.roles.uri),Xs=(0,l.propEq)("uri",an.tags.uri);function zs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zs(e,t,r[t])}))}return e}function Zs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const el=e=>{let{parentUri:t,attributeType:r}=e;return zs({uri:ft(t,r.name),ov:!0,type:r.uri},(e=>{const t=(0,l.propOr)("","defaultValue",e);return(0,l.cond)([[Jt,(0,l.always)({value:{}})],[Zt,()=>t?{value:"",lookupCode:t}:{value:""}],[(0,l.both)((0,l.propEq)("defaultValue","now"),(0,l.pipe)((0,l.prop)("type"),sr)),(0,l.always)({value:Date.now()})],[l.T,(0,l.always)({value:t})]])(e)})(r))},tl=e=>{let{attributeTypes:t,parentUri:r,metadata:n,mode:i}=e;const a=(0,l.pipe)(Ra(i),(0,l.filter)((0,l.anyPass)([(0,l.has)("defaultValue"),er,(0,l.propEq)("required",!0)])))(t),o={};for(const e of a){const{name:t}=e,a=el({parentUri:r,attributeType:e});let s=ir(n,e);s&&(e.type===Xe.TYPE_REFERENCE&&(s=st(s)),a.value=tl({parentUri:a.uri,attributeTypes:s,metadata:n,mode:i})),(!(0,l.isEmpty)(a.value)||Boolean(a.lookupCode)||er(e))&&(o[t]=[a])}return o},rl=e=>{let{entity:t,metadata:r}=e;return mo(r,t.type,!0).filter(er).reduce(((e,t)=>{const n=t.name,i=Dt(t.uri);return(i===e.type?[{parentUri:e.uri,attributes:e.attributes}]:Es(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:il({entity:e,attributeType:t,parentUri:i,index:0})}),e)}),t)},nl=(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===Xe.TYPE_NESTED?zs({},e,{value:nl({attributeTypes:o,parentUri:n,metadata:r,mode:a},t)}):e}))}));return zs({},s(t),tl({attributeTypes:o,parentUri:i,metadata:r,mode:a}))})),il=e=>{let{entity:t,attributeType:r,parentUri:n,index:i,crosswalks:a,value:o,nestingLevel:s}=e;const l=el({parentUri:n,attributeType:r}),u=bs(l);return(0,Ee.ZP)(t,(e=>{Ho(e.attributes||e.value,r,l.uri,void 0!==o?o:u,a,s,i)}))},al=e=>{let{entity:t,attributeType:r,newAttribute:n,index:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{Ho(e.attributes||e.value,r,n.uri,bs(n),a,o,i)}))},ol=e=>{let{entity:t,attributeType:r,uri:n,value:i,crosswalks:a,nestingLevel:o}=e;return(0,Ee.ZP)(t,(e=>{Qo(e.attributes||e.value,r,n,i,a,o)}))},sl=e=>{let{entity:t,attributeType:r,uri:n,nestingLevel:i}=e;return(0,Ee.ZP)(t,(e=>{Jo(e.attributes||e.value,r,n,i)}))},ll=e=>""===e,ul=(0,l.cond)([[(0,l.propSatisfies)((0,l.complement)((0,l.anyPass)([ll,l.isNil])),"lookupCode"),l.F],[(0,l.propSatisfies)((0,l.anyPass)([ll,l.isNil]),"value"),l.T],[(0,l.both)((0,l.propSatisfies)(l.isEmpty,"value"),(0,l.propSatisfies)((0,l.either)(l.isNil,l.isEmpty),"refEntity")),l.T],[l.T,l.F]]),cl=(0,l.reject)(ul),pl=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=>pl({deleteEmptyComplex:t,valueTransformer:r})(e)))}))),cl)),(0,l.when)((0,l.always)(t),(0,l.reject)(l.isEmpty)))},dl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return pl({valueTransformer:(0,l.pipe)((0,l.omit)(["type","uri"]),Ts),deleteEmptyComplex:e})},yl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,l.pipe)(dl(e),(0,l.reject)(l.isEmpty))},fl=(0,l.curry)(((e,t)=>t.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:i}=t;return Cs(r)?Hs({entity:e,attributeType:r}):il({entity:e,attributeType:r,parentUri:n,index:i})}),e))),Tl=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n,value:i}=t;return Cs(r)?Ks({entity:e,attributeType:r,value:i}):ol({entity:e,attributeType:r,uri:n,value:i})})),El=(0,l.curry)(((e,t)=>{const{attributeType:r,uri:n}=t;return Cs(r)?Qs({entity:e,attributeType:r}):sl({entity:e,attributeType:r,uri:n})})),ml=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)},hl="UrlThumbnail",bl="CdnUrlThumbnail",Ol=(0,l.curry)(((e,t,r)=>{const n=(0,l.prop)(e,t);if(Array.isArray(n)){const e=r?n.find(ts):(0,l.head)(n);return e&&e.value}return null})),vl=(e,t)=>(0,l.pipe)((0,l.propOr)({},"value"),(r=>e.map((e=>Ol(e,r,t)))),(0,l.filter)(l.identity),l.head,(0,l.defaultTo)("")),gl=vl(["CdnUrl","Url"],!0),_l=vl(["CdnUrlPreview","UrlPreview"],!0),Al=vl([bl,hl],!0),Nl=vl([bl,hl]),Pl=(e,t,r)=>{const{attributes:n={}}=t,{analyticsAttributes:i={}}=t;return e.reduce(((e,a)=>{const o=(0,l.cond)([[Wt,(0,l.always)(t)],[(0,l.both)(Gt,(0,l.always)(i)),(0,l.always)(i)],[l.T,(0,l.always)(n)]])(a),s=Wt(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)([]),ne)(o);return(0,l.when)((0,l.always)(r(u,a)),(0,l.append)({attrType:a,values:u}),e)}),[])},Rl=(e,t,r)=>{const n=wa(e),i=(0,l.any)(r?l.T:ts);return Pl(n,t,i)},Sl=(e,t,r,n,i,a)=>{const o=Tt(null==r?void 0:r.uri)?Ra(t,e):Sa(t,e);return Pl(o,r,((e,o)=>{const s=Fi({attributeType:o,mode:t});return n&&s||o.required&&s||(0,l.any)(i?l.T:ts,e)||Wt(o)&&(0,l.has)(o.uri,r)||(null==a?void 0:a.includes(o.uri))}))};let wl;const Il=e=>{wl=e};function Ul(e,t){return wl(e,t)}const Cl=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)})),Ll=50,Dl=e=>{let{type:t,parents:r=[],displayNamePrefix:n,max:i=Ll,offset:a=0}=e;return Ul("/lookups/list",{method:"POST",body:JSON.stringify({type:t,parents:r,displayNamePrefix:n,max:i,offset:a}),headers:{"Content-Type":"application/json"}})},jl=(0,l.once)((()=>Ul("/lookups",{method:"GET",headers:{"Content-Type":"application/json"}}))),kl=e=>Ul("/lookups/resolveList",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),Fl=(e,t)=>Ul("/lookups/cascadeUpdate",{method:"POST",body:JSON.stringify({state:e,updatedValue:t}),headers:{"Content-Type":"application/json"}}),Ml=e=>Z.fromNull($r[e]).map(en().text).orSome(""),xl=(0,l.curry)(((e,t)=>`${e}_${t}`)),$l=(0,l.split)("_"),Vl=(0,l.includes)("_"),Gl=(0,l.curry)(((e,t)=>e&&(e===t||e.endsWith(`_${t}`)))),Wl=(0,l.curry)(((e,t)=>e.some(Gl(t)))),Yl=Wl([Mr.IN_RANGE,Mr.COUNT_RANGE,Mr.WITHIN]),Bl=Wl([Mr.EXISTS,Mr.MISSING_VALUE]),ql=(0,l.cond)([[Bl,(0,l.always)(0)],[Yl,(0,l.always)(2)],[l.T,(0,l.always)(1)]]),Hl=(0,l.complement)(Bl),Ql=Wl([Mr.HAS_ALL,Mr.EQUALS,Mr.NOT_EQUALS]),Kl=Wl([Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE]),Jl=Wl([Mr.IN_FILE,Mr.NOT_IN_FILE]),Xl=e=>{switch(e){case Mr.COUNT_EQUALS:return Mr.EQUALS;case Mr.COUNT_NOT_EQUALS:return Mr.NOT_EQUALS;case Mr.COUNT_LT:return Mr.LT;case Mr.COUNT_LTE:return Mr.LTE;case Mr.COUNT_GT:return Mr.GT;case Mr.COUNT_GTE:return Mr.GTE;case Mr.COUNT_RANGE:return Mr.IN_RANGE}},zl=Wl([Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS]),Zl=Wl([Mr.WITHIN]),eu=[[Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE],[Mr.NOT_IN_FILE,Mr.IN_FILE],[Mr.EQUALS,Mr.NOT_EQUALS,Mr.HAS_ALL],[Mr.LT,Mr.LTE,Mr.GT,Mr.GTE],[Mr.MISSING_VALUE,Mr.EXISTS],[Mr.COUNT_RANGE],[Mr.IN_RANGE],[Mr.STARTS_WITH,Mr.CONTAINS],[Mr.FULL_TEXT],[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.NOT_EQUALS],[Mr.WITHIN]],tu=(e,t)=>eu.some((r=>r.includes(e)&&r.includes(t))),ru=(0,l.pipe)(l.omit,l.values),nu={OPTIONS_FOR_STRING:ru(["IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_DATE:[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS,Mr.MISSING_VALUE,Mr.EXISTS,Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE,Mr.IN_FILE,Mr.NOT_IN_FILE],OPTIONS_FOR_BOOLEAN:ru(["STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","FULL_TEXT","LT","LTE","GT","GTE","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_BLOB:ru(["EQUALS","NOT_EQUALS","STARTS_WITH","IN","NOT_IN","HAS_ALL","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_NUMBER:ru(["STARTS_WITH","FULL_TEXT","CONTAINS","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_LOOKUP:ru(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN","CONTAINS"],Mr),OPTIONS_FOR_ENUM:ru(["STARTS_WITH","FULL_TEXT","IN_RANGE","LT","LTE","GT","GTE","ON","BEFORE","AFTER","WITHIN"],Mr),OPTIONS_FOR_ID:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.IN_FILE,Mr.NOT_IN_FILE],OPTIONS_FOR_COUNT:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.LT,Mr.LTE,Mr.GT,Mr.GTE,Mr.IN_RANGE],OPTIONS_FOR_COMPLEX:[Mr.COUNT_EQUALS,Mr.COUNT_NOT_EQUALS,Mr.COUNT_LT,Mr.COUNT_LTE,Mr.COUNT_GT,Mr.COUNT_GTE,Mr.COUNT_RANGE,Mr.EXISTS,Mr.MISSING_VALUE],OPTIONS_FOR_UNKNOWN_TYPE:[Mr.EQUALS,Mr.NOT_EQUALS,Mr.EXISTS,Mr.MISSING_VALUE]},iu=e=>{const{type:t,singleValue:r=!1}=e,n=(e=>{switch(e){case Xe.TYPE_TYPEAHEAD:case Xe.TYPE_STRING:case Xe.TYPE_PASSWORD:case Xe.TYPE_TEXT:case Xe.TYPE_CIK_ID:case Xe.TYPE_URL:case Xe.TYPE_BLOG_URL:case Xe.TYPE_IMAGE_URL:case Xe.TYPE_EMAIL:return nu.OPTIONS_FOR_STRING;case Xe.TYPE_LOOKUP:case Xe.TYPE_DEPENDENT_LOOKUP:return nu.OPTIONS_FOR_LOOKUP;case Xe.TYPE_ENUM:return nu.OPTIONS_FOR_ENUM;case Xe.TYPE_DATE:case Xe.TYPE_ACTIVENESS_DATE:case Xe.TYPE_TIMESTAMP:case Xe.TYPE_LOCAL_DATE:return nu.OPTIONS_FOR_DATE;case Xe.TYPE_BOOLEAN:case Xe.TYPE_BOOLEAN_RADIO:return nu.OPTIONS_FOR_BOOLEAN;case Xe.TYPE_BLOB:return nu.OPTIONS_FOR_BLOB;case Xe.TYPE_LONG:case Xe.TYPE_INT:case Xe.TYPE_FLOAT:case Xe.TYPE_DOUBLE:case Xe.TYPE_NUMBER:return nu.OPTIONS_FOR_NUMBER;case Xe.TYPE_ENTITY_ID:return nu.OPTIONS_FOR_ID;case Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return[Mr.EQUALS];case Xe.TYPE_COUNT:return nu.OPTIONS_FOR_COUNT;case Xe.TYPE_NESTED:case Xe.TYPE_REFERENCE:case Xe.TYPE_IMAGE:return nu.OPTIONS_FOR_COMPLEX;default:return nu.OPTIONS_FOR_UNKNOWN_TYPE}})(t);return r?(0,l.reject)(Kl,n):n},au=e=>[Pe.and,Pe.andNot].includes(e),ou=e=>[Pe.or,Pe.orNot].includes(e),su=e=>e.slice(0,-1).some((0,l.pipe)((0,l.prop)("operator"),ou)),lu=(uu=[Pe.and],e=>e.slice(0,-1).every((e=>uu.includes(e.operator))));var uu;const cu=e=>e.map(((e,t,r)=>{const n=0===t;return(0,l.assoc)("operator",n?null:r[t-1].operator,e)}),[]),pu=e=>e.map(((e,t,r)=>{const n=t===r.length-1;return(0,l.assoc)("operator",n?null:r[t+1].operator,e)}),[]),du=e=>{const t=[],r={"{":"}","[":"]","(":")"},n=(0,l.invertObj)(r);for(let i=0;i<e.length;i++){const a=e[i];if(r[a])t.push(a);else if(n[a]&&r[t.pop()]!==a)return!1}return 0===t.length},yu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[Pe.or,Pe.orNot],n=t?[Pe.and,Pe.andNot,...r]:r,i=n.map((e=>` ${e} `)).some((t=>e.includes(t))),a=e.startsWith("not"),o="("===(0,l.head)(e)&&")"===(0,l.last)(e)&&du(e.slice(1,-1));return!i&&!a||o?e:`(${e})`},fu="and",Tu=class{constructor(){this.clauses=[]}addClause(e){return e&&(this.clauses=this.clauses.concat(e)),this}build(){return this.clauses.join(" and ")}orBuild(){return`(${this.clauses.join(" or ")})`}buildWithOperators(e){return this.clauses.reduce(((t,r,n)=>{const i=0===t.length,a=(0,l.propOr)(fu,n,e),o=(e=>[Pe.andNot,Pe.orNot].includes(e))(a)?yu(r):r;return i?o:`${t} ${a} ${o}`}),"")}},Eu=(0,l.curry)(((e,t)=>{const r=(0,l.unless)(l.isNil,e);return Array.isArray(t)?t.map(r):r(t)})),mu=e=>Array.isArray(e)?e.map(mu).toString():"object"==typeof e&&"lookupCode"in e?e.lookupCode:e.toString().trim(),hu=(0,l.replace)(/./g,(e=>{switch(e){case"\\":e="\\\\";break;case"'":e="\\'";break;case'"':e='\\"'}return e})),bu=e=>`'${e}'`,Ou=e=>`"${e}"`,vu=(0,l.pipe)(mu,hu),gu=(0,l.pipe)(vu,bu),_u=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.allPass)([(0,l.always)(Yl(e)),Array.isArray]),()=>`${t[0]} - ${t[1]}`],[Array.isArray,()=>t.join(", ")],[l.T,l.identity]])(t))),Au=(e,t)=>Kl(t)?{type:Xe.TYPE_INT}:Jl(t)?{type:Xe.TYPE_FILE}:zl(t)&&!Zl(t)&&lr(e.type)?{type:Xe.TYPE_LOCAL_DATE}:e,Nu=Object.values(Hr),Pu=e=>!Object.values(Hr).includes(e),Ru=e=>Nu.includes(e),Su=e=>en().text(Qr[e]),wu=e=>{switch(e){case Br.LAST_DAY:return"1_day";case Br.LAST_WEEK:return"1_week";case Br.LAST_MONTH:return"1_month";case Br.LAST_6MONTHS:return"6_months";case Br.LAST_YEAR:return"1_year"}return e},Iu=e=>{const t=f()();switch(e){case Br.LAST_DAY:return[f()(t).subtract(1,"day").valueOf(),t.valueOf()];case Br.LAST_WEEK:return[f()(t).subtract(1,"week").valueOf(),t.valueOf()];case Br.LAST_MONTH:return[f()(t).subtract(1,"month").valueOf(),t.valueOf()];case Br.LAST_6MONTHS:return[f()(t).subtract(6,"months").valueOf(),t.valueOf()];case Br.LAST_YEAR:return[f()(t).subtract(1,"year").valueOf(),t.valueOf()];case qr.LAST_3DAYS:return[f()(t).subtract(3,"day").valueOf(),t.valueOf()]}return e};function Uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cu(e,t,r[t])}))}return e}function Cu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lu=(0,l.curry)(((e,t)=>t.length>1?`(${t.join(e)})`:t.toString())),Du=(0,l.curry)(((e,t,r)=>{const n=r.map(Yl(e)||t.endsWith(".count")?vu:gu).join(",");return n?`${e}(${t},${n})`:`${e}(${t})`})),ju=e=>t=>{switch(e){case 0:return[[]];case 1:return t.map((e=>[e]));default:return t}},ku=e=>{let{filter:t,fieldName:r,values:n}=e;const i=ql(t);return(0,l.pipe)(ju(i),(0,l.map)(Du(t,r)),Lu(" or "))(n)},Fu=e=>{let{filter:t,fieldName:r,values:n}=e;return`${t}(${r},${(0,l.flatten)(n).map(gu).join(",")})`},Mu=e=>`*${e}*`,xu=e=>`URL:${e}`,$u=e=>e.length>1||Array.isArray(e[0])&&e[0].length>1,Vu=(e,t)=>{const r="id"===t?"listEqualsCaseSensitive":"listEquals";return e===Mr.IN_FILE?r:`not ${r}`},Gu=(e,t)=>[R(e,t),S(e,t)],Wu=(0,l.pipe)((e=>{const{values:t,filter:r}=e,n=!Yu(e);if(!(0,l.isEmpty)(t)){const[i]=t;switch(r){case Mr.ON:return Uu({},e,n?{filter:Mr.EQUALS}:{filter:Mr.IN_RANGE,values:[Gu(i,n)]});case Mr.BEFORE:return Uu({},e,{filter:Mr.LTE,values:[[S(i,n)]]});case Mr.AFTER:return Uu({},e,{filter:Mr.GTE,values:[[R(i,n)]]});case Mr.WITHIN:return Uu({},e,{filter:Mr.IN_RANGE,values:[Iu(i)]})}}return e}),ku),Yu=(0,l.propSatisfies)(lr,"type"),Bu=[[(0,l.prop)("rawFilter"),(0,l.prop)("rawFilter")],[(0,l.propEq)("filter",Mr.HAS_ALL),e=>{let{fieldName:t,values:r}=e;return(0,l.pipe)((0,l.map)((e=>e.reduce(((e,r)=>e.addClause(ku({filter:Mr.EQUALS,fieldName:t,values:[r]}))),new Tu).build())),Lu(" or "))(r)}],[(0,l.propEq)("filter",Mr.CONTAINS),e=>{let{filter:t,fieldName:r,values:n}=e;return ku({fieldName:r,filter:t,values:n.map((0,l.pipe)(mu,Mu))})}],[(0,l.propEq)("filter",Mr.EQUALS),e=>{const{fieldName:t,values:r}=e;return"type"===t?ku(Uu({},e,{values:(0,l.flatten)(r)})):$u(r)?Fu(Uu({},e,{filter:"listEquals"})):ku(e)}],[(0,l.propEq)("filter",Mr.NOT_EQUALS),e=>{const{values:t}=e;return"type"===e.fieldName?(e=>{let{filter:t,fieldName:r,values:n}=e;const i=ql(t);return(0,l.pipe)(ju(i),(0,l.map)(Du(t,r)),Lu(" and "))(n)})(Uu({},e,{values:(0,l.flatten)(e.values)})):Yu(e)?(e=>{const{values:t}=e,r=!Yu(e),[n]=t;return(new Tu).addClause(ku(Uu({},e,{filter:Mr.LT,values:[R(n,r)]}))).addClause(ku(Uu({},e,{filter:Mr.GT,values:[S(n,r)]}))).orBuild()})(e):$u(t)?Fu(Uu({},e,{filter:"not listEquals"})):ku(e)}],[(0,l.propSatisfies)(Jl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ku({fieldName:r,filter:Vu(t,r),values:n.map((0,l.prop)("link")).map(xu)})}],[(0,l.propSatisfies)(Kl,"filter"),e=>{let{filter:t,fieldName:r,values:n}=e;return ku({fieldName:`${r}.count`,values:n,filter:Xl(t)})}],[(0,l.propSatisfies)(zl,"filter"),Wu],[(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 Du(t,n,[])}],[(0,l.propEq)("fieldName","geoLocation"),e=>{let{fieldName:t,values:[[r,n,i]],filter:a}=e;return Du(a,`${t},'${r},${n}',0,${i}`,[])}],[l.T,ku]],qu=function(){let{filter:e,fieldName:t,values:r,rawFilter:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n||e&&t&&(!Hl(e)||Qu(e,r))},Hu=(e,t)=>Array.isArray(t)?Qu(e,t):e===Mr.WITHIN?Ru(t)||Number.isInteger(t):!(0,l.isNil)(t)&&mu(t).length>0,Qu=(e,t)=>t&&t.length>0&&t.every((t=>Hu(e,t)));function Ku(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ju=e=>{let{fieldName:t=""}=e;const r=t.split("."),n=r.indexOf("attributes");return n>=0?r.slice(0,n+2).join("."):t},Xu=(0,l.pipe)((0,l.propOr)("","fieldName"),(0,l.split)("."),(0,l.slice)(0,-1),(0,l.join)(".")),zu=(e,t,r)=>"children"===e?ec(r,[...t][0],!0):r,Zu=(e,t,r)=>"values"===e?[...r,...t]:r,ec=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)(zu,t),e);if(!r&&Ql(t.filter)&&t.filter===i.filter)return(0,l.adjust)(n,(0,l.mergeDeepWithKey)(Zu,t),e)}return(0,l.append)(t,e)},tc=(0,l.reduce)(((e,t)=>{const r=(e=>{const t=Ju(e),r=e=>e.fieldName===t?e:r({fieldName:Xu(e),children:[e]});return r(e)})(t);return ec(e,r)}),[]),rc=e=>e&&e.length>1&&!e.some((e=>{let{fieldName:t}=e;return null==t?void 0:t.startsWith("parent.")}))&&!e.every((0,l.has)("rawFilter")),nc=e=>{let[t]=e;return t.children?nc(t.children):t.operator},ic=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(e){const[t,r]=(0,l.splitAt)(1,e),i=nc(t)===Pe.andNot,a=n(t,!1),o=i?`not ${yu(a)}`:a,s=n(r,!1);return`inSameAttributeValue(${o} ${nc(r)||fu} ${s})`}function n(i){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return i.reduce(((i,o)=>i.addClause((0,l.cond)([[(0,l.has)("children"),e=>{let{children:i}=e;return a&&rc(i)&&!t?r(i):n(i,a)}],...e])(o))),new Tu).buildWithOperators(i.map((0,l.prop)("operator")))}return n},ac=(0,l.pipe)((0,l.propOr)("","filter"),Vl),oc=(0,l.map)((0,l.when)(ac,(e=>{const[t,r]=$l(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){Ku(e,t,r[t])}))}return e}({},e,{fieldName:`${e.fieldName}.${t}`,filter:r})}))),sc=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)(qu),oc,tc,ic([...e,...Bu],t))},lc=(0,l.curry)(((e,t)=>(e&&(t=t?`(${t}) and (${e})`:e),t))),uc=[Mr.ON,Mr.BEFORE,Mr.AFTER,Mr.WITHIN,Mr.NOT_EQUALS,Mr.MISSING_VALUE,Mr.EXISTS],cc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.STARTS_WITH,Mr.MISSING_VALUE,Mr.HAS_ALL,Mr.FULL_TEXT,Mr.EXISTS],pc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.LT,Mr.LTE,Mr.GT,Mr.GTE,Mr.IN_RANGE],dc=(e,t)=>{const r=$t(e);return(e=>{switch(e){case nn.startDate.name:case nn.endDate.name:case on.dueDate.name:case un.createdTime.name:case un.updatedTime.name:case pn.reltioLoadDate.name:case pn.createDate.name:case pn.updateDate.name:case pn.deleteDate.name:case pn.publishDate.name:return uc;case cn.matches.name:case pn.count.name:return pc;case on.workflow.name:case on.assignee.name:case on.step.name:case sn.commenter.name:case un.createdBy.name:case un.updatedBy.name:case pn.sourceSystems.name:case pn.value.name:return cc;default:return null}})(t)||iu(r)},yc=[Mr.EQUALS,Mr.NOT_EQUALS,Mr.CONTAINS,Mr.STARTS_WITH,Mr.MISSING_VALUE,Mr.HAS_ALL,Mr.IN_RANGE,Mr.WITHIN,Mr.EXISTS,Mr.ON],fc=(0,l.pipe)(dc,(0,l.filter)((0,l.includes)(l.__,yc))),Tc=(0,l.unless)((0,l.startsWith)("?"),(0,l.concat)("?")),Ec=e=>{let{query:t,body:r}=e;return t=Tc(t),Ul(`/entities/_facets${t}`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}})},mc=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)(sc(),lc(t.globalFilter))(n),activeness:t.activityFilter||Jr.ACTIVE_ONLY};return t.searchOptions&&(i.options=t.searchOptions),`/entities/_total${_r(i)}`},hc=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=mc(e,t,r);return Ul(n)},bc=e=>Ul(`/entities/_total?${e}`),Oc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,l.pipe)((0,l.filter)(Go),(0,l.map)((0,l.prop)("uri")))(e),i={filter:Mr.EQUALS,fieldName:"type",values:n},a=r.isRawFilter?{rawFilter:t}:{filter:"containsWordStartingWith",fieldName:"attributes",values:[t]},o=(0,l.pipe)(sc(),lc(r.globalFilter))([i,a]),s=_r({filter:o,select:"uri,label,type,roles,secondaryLabel,defaultProfilePicValue",scoreEnabled:!0,activeness:r.activityFilter||Jr.ACTIVE_ONLY,max:r.max||4});return Ul("/entities/_typeAheadSearch"+s,{method:"GET"})},vc=(0,l.pipe)((0,l.reject)(l.isNil),gr),gc=e=>{let{fieldName:t,searchParams:r=[],options:n={}}=e;const{globalFilter:i,activityFilter:a,searchOptions:o,max:s,pageNo:u}=n,c=(0,l.pipe)(sc(),lc(i))(r),p=vc({filter:c||null,activeness:a||"active",options:o||null}),d=[{fieldName:t,pageSize:s||20,pageNo:u||1,orderType:n.orderType||"reversedCount"}];return Ec({query:p,body:d})},_c=e=>{let{fieldName:t,searchValue:r="",options:n}=e;const i=r.length?[{filter:"containsWordStartingWith",fieldName:t,values:[r]}]:[];return gc({fieldName:t,searchParams:i,options:n})},Ac="uri,label,type,roles,secondaryLabel,defaultProfilePicValue",Nc=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)(sc(),lc(t.globalFilter))(n),max:t.max||5,offset:t.offset,activeness:t.activityFilter||"active",select:t.select||Ac,scoreEnabled:null==t.scoreEnabled||t.scoreEnabled,sort:t.sort||null,order:t.order||null};return t.searchOptions&&(i.options=t.searchOptions),`/entities${_r(i)}`},Pc=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=Nc(e,t,r);return Ul(n)},Rc=e=>Lc(e,{select:"secondaryLabel"}),Sc=(e,t)=>{const{select:r=Ac,searchOptions:n,defaultMaxValues:i}=t||{},a={select:r,uris:e,options:n};return i&&(a.defaultMaxValues=i),Ul("/entities/_byUris",{method:"POST",body:a,headers:{"Content-Type":"application/json"}})},wc=(0,l.filter)((0,l.pipe)((0,l.prop)("uri"),Tt)),Ic=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=wc(n).length,T={[r]:{max:a,offset:(0,l.isNil)(i)?y-f:i}},E=Xt(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)(sc(),lc(d.globalFilter))(h);return b&&(m.data.filter=b),p&&(m.data.sort=p.field,m.data.order=p.order),Ul(`${s}/api/${o}/${t}/_object`,m)},Uc=e=>`entities?filter=equals(uri,'${e}')&offset=0`,Cc={options:"sendHidden,addRefAttrUriToCrosswalk"},Lc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cc;return Ul(`/${e}${_r(t)}`)},Dc=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 Ul(n,r)},jc=e=>Ul(`/${e}?options=sendHidden,addRefAttrUriToCrosswalk`,{method:"DELETE"}),kc=(e,t,r)=>{const n={method:"POST",body:JSON.stringify(t)};return Ul(`/${e}/_clone${_r({executeLCA:!1,valuesToCopy:r})}`,n)},Fc=e=>{let{facet:t,startTime:r,endTime:n,types:i}=e;return Ul(`/entities/_events/_total${gr({facet:t,startTime:r,endTime:n,types:i})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Mc=(e,t)=>Ul(`/${e}/_setDefaultProfilePicByAttributeValueURI`,{method:"PUT",data:t}),xc=e=>{let{uri:t,diff:r,uriPreprocessor:n=l.identity}=e;return Ul(n(`/${t}/_update?options=sendHidden,updateAttributeUpdateDates,addRefAttrUriToCrosswalk`),{method:"POST",data:r})},$c=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 Ul(`/${t}/_interactions${(0,l.pipe)((0,l.reject)(E),gr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Vc=e=>{const t=new FormData;return t.append("file",e),Ul("/valueList",{method:"POST",headers:{"Content-Type":null},body:t}).catch((e=>{const t=pe(e,en().text("Can't upload file"));return Promise.reject(t)}))},Gc=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 Ul(`/personal/findSavedSearches${gr({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"}})},Wc=e=>Ul(`/personal/savedSearches/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),Yc=e=>Ul("/personal/savedSearches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Bc=e=>{const{uri:t}=e,r=(0,l.pick)(["description","isFavorite","isPublic","name","query","uiState"]);return Ul(`/personal/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r(e))})},qc=e=>{let{uri:t}=e;return Ul(`/personal/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Hc=(e,t)=>(0,l.pipe)((0,l.evolve)({isPublic:(0,l.always)(t)}),Bc)(e),Qc=(e,t)=>(0,l.pipe)((0,l.evolve)({isFavorite:(0,l.always)(t)}),Bc)(e);function Kc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Jc=["max","offset","filter"],Xc=(0,l.curry)(((e,t)=>t.nextEntry?(0,l.evolve)({nextEntry:Xc(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){Kc(e,t,r[t])}))}return e}({},t,(0,l.pick)(Jc,e)))),zc=e=>{if(1===e.length&&((0,l.pathEq)([0,"activeness","entity"],Ne.ALL,e)||(0,l.pathEq)([0,"activeness","relation"],Ne.ALL,e)))return!1},Zc=(0,l.omit)(["activeness"]),ep=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=zc(t),{searchByOv:i}=r;t=(0,l.map)((0,l.pipe)((0,l.when)((0,l.prop)("nextEntry"),(e=>(0,l.pipe)(Xc(e),(0,l.omit)(Jc))(e))),Zc,(0,l.omit)(["labels"])))(t);const a={limitCreditsConsumption:!0,activeness_enabled:n,options:i?"searchByOv":void 0},o=`/${e}/_connections${_r(a)}`,s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)};return{url:o,options:s}},tp=(0,l.map)((e=>{let t=e;for(;t&&t.nextEntry;)t=t.nextEntry;return t})),rp=(0,l.reject)(l.isNil),np=(0,l.unless)((0,l.startsWith)("/"),(0,l.concat)("/")),ip=e=>Ul(np(e),{method:"GET",headers:{"Content-Type":"application/json"}}),ap=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.identity;const r=(0,l.pipe)(t,np);return Ul(r(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})},op=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?yl()(i):null,startDate:a,endDate:o},c=(0,l.pipe)(rp,ne,JSON.stringify);return Ul(s("/relations"),{method:"POST",headers:{"Content-Type":"application/json"},body:c(u)})},sp=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"),np,n),o=IE(i(t),i(r)).concat(CE(t,r));return Ul(a(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},lp=(e,t,r)=>{const{url:n,options:i}=ep(e,t,r);return Ul(n,i).then(tp)},up=(e,t)=>Ul(`/${e}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),cp=(e,t)=>{let{relatedEntityUri:r,relationType:n,relationDirection:i}=t;const a={uri:r};return i===zr.IN?a.inRelations=[n]:a.outRelations=[n],Ul(`/${e}/_ignoreSuggestedRelationship`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},pp=e=>{let{servicesPath:t="",environment:r,tenant:n,application:i}=e;return Ul(`${t}/recentSearches${_r({environment:r,tenant:n})}`,{method:"GET",application:i,headers:{"Content-Type":"application/json"}})},dp=e=>Ul("/recentSearches",{method:"POST",application:"explorer",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),yp=e=>{let{environment:t,tenant:r,createdDate:n}=e;return Ul(`/recentSearches${_r({environment:t,tenant:r,createdDate:n})}`,{method:"DELETE",application:"explorer",headers:{"Content-Type":"application/json"}})};function fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tp(e,t,r[t])}))}return e}function Tp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ep={select:"label,secondaryLabel,name,type,startDate,endDate"},mp=(0,l.reject)(l.isNil),hp=(0,l.pipe)(mp,gr),bp=e=>{let{uri:t,graphTypes:r,activenessDate:n,isReversed:i}=e;const a=fp({},Ep,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},i?{options:"reverseRelations"}:{},{limitCreditsConsumption:!0});return Ul(`/${t}/_tree${hp(a)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Op=e=>{let{uri:t,graphUri:r}=e;const n=fp({},Ep,r?{graphTypeURIs:r}:{},{select:"label,secondaryLabel,name,type"});return Ul(`/${t}/_parents${hp(n)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},vp=e=>{let{uri:t,graphTypes:r,activenessDate:n,filterLastLevel:i=!1,deep:a=1,limitCreditsConsumption:o,max:s}=e;const l=fp({},Ep,r?{graphTypeURIs:r}:{},n?{activeness_date:n}:{},o?{limitCreditsConsumption:o}:{},s?{max:s}:{},{filterLastLevel:i,deep:a});return Ul(`/${t}/_hops${hp(l)}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function gp(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const _p=()=>{function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+"-"+e()+"-"+e()+e()},Ap="/activities",Np=e=>{let{label:t,description:r}=e;return Ul(Ap,{method:"POST",body:{label:t,description:r},headers:{"Content-Type":"application/json",ActivityID:_p()}})};var Pp;!function(e){e.userSearch="USER_SEARCH",e.profileView="USER_PROFILE_VIEW"}(Pp||(Pp={}));const Rp=e=>{const t=_r(e);return Ul(Ap+t,{method:"GET"})},Sp=e=>Ul(`/activities/_total${_r(e)}`,{method:"GET"}),wp=e=>{const{entityUri:t}=e,r=gp(e,["entityUri"]);return Ul(`/${t}/_activities${_r(r)}`,{method:"GET"})},Ip=e=>{const{entityUri:t}=e,r=gp(e,["entityUri"]);return Ul(`/${t}/_activities/_total${_r(r)}`,{method:"GET"})};function Up(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cp(e,t,r[t])}))}return e}function Cp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lp=e=>{let{workflowPath:t,tenant:r,url:n}=e;return`${t}/workflow/${r?`${r}${n}`:n}`},Dp=e=>{let{workflowPath:t,processType:r,searchString:n,tenant:i,environment:a}=e;const o={processType:r,searchString:n};return Ul(Lp({url:"/processInstances/_generateFromQuery?background=true",workflowPath:t,tenant:i}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(o)})},jp=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=Lp({url:r,workflowPath:t,tenant:n})),Ul(s,{method:i||"GET",body:JSON.stringify(a),headers:Up({"Content-Type":"application/json"},null!=o?o:{})})},kp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a}=e;const o=Lp({url:"/processInstances",workflowPath:t,tenant:i}),s=(0,l.curry)(((e,t,r)=>{const n={processType:t,objectURIs:r};return Ul(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)},Fp=e=>{let{workflowPath:t,processType:r,objectURIs:n,tenant:i,environment:a,comment:o}=e;const s=Lp({url:"/processInstances",workflowPath:t,tenant:i}),l={processType:r,objectURIs:n},u=o?Up({},l,{comment:o}):l;return Ul(s,{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:a},body:JSON.stringify(u)})},Mp=e=>{let{workflowPath:t,environment:r,tenant:n,entityUri:i,filter:a={},includeClosed:o}=e;const s=o;o&&(a.objectURI=i);const u=Lp({url:`/tasks${s?_r(a):""}`,workflowPath:t,tenant:n}),c=s?{}:{body:JSON.stringify(Up({objectURIs:[i]},(0,l.reject)(E,a)))};return Ul(u,Up({method:s?"GET":"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r}},c))},xp=e=>{let{workflowPath:t,environment:r,tenant:n,assignee:i,max:a,offset:o}=e;return Ul(Lp({url:"/tasks",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)({assignee:i,max:a,offset:o})})},$p=e=>{let{workflowPath:t,environment:r,tenant:n,filters:i,max:a,offset:o}=e;return Ul(Lp({url:"/groupTasks",workflowPath:t,tenant:n}),{method:"POST",headers:{EnvironmentURL:r},body:(0,l.pipe)((0,l.reject)(l.isNil),JSON.stringify)(Up({max:a,offset:o},i))})},Vp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;return Ul(Lp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:r}})},Gp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,body:a}=e;return Ul(Lp({url:`/tasks/${i}`,workflowPath:t,tenant:n}),{method:"PUT",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Wp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,comment:a}=e;return Gp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{processInstanceComment:a}})},Yp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i}=e;const a={tasks:[i]};return Ul(Lp({url:"/assignee",workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify(a)})},Bp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,assignee:a}=e;return Gp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{assignee:a}})},qp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,dueDate:a}=e;return Gp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{dueDate:a}})},Hp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,priority:a}=e;return Gp({workflowPath:t,environment:r,tenant:n,taskId:i,body:{priority:a}})},Qp=e=>{let{workflowPath:t,environment:r,tenant:n,taskId:i,action:a}=e;return Ul(Lp({url:`/tasks/${i}/_action`,workflowPath:t,tenant:n}),{method:"POST",headers:{"Content-Type":"application/json",EnvironmentURL:r},body:JSON.stringify({action:a})})},Kp=e=>{let{workflowPath:t,tenant:r,environment:n}=e;return Ul(Lp({url:"/processDefinitions",workflowPath:t,tenant:r}),{method:"GET",headers:{"Content-Type":"application/json",EnvironmentURL:n}})},Jp=(e,t)=>t.map((t=>{let r;const n=t.split("."),i=n.shift(),a=(e[i]||[]).filter(ts);return a&&a[0]&&(r=n.length>0&&a[0].value?Jp(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}}),""),Xp=(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=Jp(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},zp=/[,\s]*$/,Zp=e=>{const t=en().text(Xr);if(!e)return t;const r=e.replace(zp,"");return""===r.toString().trim()?t:r},ed=(e,t)=>{let{entityTypes:r}=e;const n=r.find((e=>{let{uri:r}=e;return r.endsWith(t)}));return n&&n.dataLabelPattern},td=(e,t,r)=>{if("string"==typeof t)return t;if("Reference"!==r.type&&"Nested"!==r.type&&"Image"!==r.type)return"";if("Reference"===r.type){const n=ed(e,r.referencedEntityTypeURI);if(n)return Xp({attributes:t||{}},n)}else if(("Nested"===r.type||"Image"===r.type)&&r.dataLabelPattern)return Xp({attributes:t||{}},r.dataLabelPattern);return""},rd=e=>{let{uiPath:t,uri:r}=e;const n=new URL(t),[,i]=n.pathname.split("/");return"nui"===i?`${t}profile?entityUri=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.entity.default.DefaultPerspective_e~${r}`},nd=e=>{let{uiPath:t,tag:r,entityUri:n}=e;const i=new URL(t),[,a]=i.pathname.split("/");return"nui"===a?`${t}tags?entityUri=${encodeURIComponent(n)}&tag=${encodeURIComponent(r)}`:`${t}#p~com.reltio.plugins.tags.TagPerspective_e~${encodeURIComponent(n)}_tag~${encodeURIComponent(r)}`},id=(e,t)=>t?t.startsWith("http:")||t.startsWith("https:")?t:e+"/"+t.replace(/^\/+/,""):"",ad=(0,l.when)((0,l.is)(Object),(0,l.ifElse)((0,l.pipe)((0,l.prop)("value"),(0,l.is)(Object)),Al,(0,l.prop)("value"))),od=(0,l.pipe)((0,l.prop)("defaultProfilePicValue"),ad),sd=(e,t,r)=>{const n=od(r)||(e=>(0,l.pipe)((0,l.prop)("defaultProfilePic"),(0,l.when)(l.identity,(0,l.pipe)(hs(e),ad)))(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")])})(Ir(e,t.type));return(0,l.pipe)((0,l.map)((0,l.pipe)((r=>Es(e,t,r)),(0,l.defaultTo)([]),l.head)),(0,l.reject)(l.isNil),l.head,(0,l.when)(l.identity,ad))(r)})(e,r)||kr(e,r.type);return id(t,n)};function ld(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ud(e,t,r[t])}))}return e}function ud(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cd="DTSS/",pd=(0,l.replace)(new RegExp("^entities/"),""),dd=e=>cd+e.dataTenant+"/"+e.uri,yd=(0,l.replace)(new RegExp("^DTSS/.+?/"),""),fd=e=>!(!e||!e.dataTenant),Td=(0,l.startsWith)(cd),Ed=(0,l.pipe)((0,l.ifElse)(Td,(0,l.pipe)((0,l.split)("/"),(0,l.nth)(1)),(0,l.always)(null))),md=(0,l.ifElse)(fd,dd,(0,l.prop)("uri")),hd=e=>e&&e.uri?e.dataTenant?dd(e):pd(e.uri):"",bd=(0,l.curry)(((e,t,r)=>(Ir(t,r.type)||{})[e]||"")),Od=bd("label"),vd=bd("typeGraphIcon"),gd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Ir(e,t.type)||{},n=(r.attributes||[]).reduce(((e,t)=>(e[t.uri]=t,e[t.name]=t,e)),{});return t.attributes&&r.businessCardAttributeURIs?r.businessCardAttributeURIs.map((r=>{const i=n[r];if(!i)return null;let a=t.attributes[i.name];if(!a)return null;Array.isArray(a)&&(a=a.find(ts)||"");const o=null!=a.label?(a.relationshipLabel?a.relationshipLabel+", ":"")+a.label:a.value;return{text:td(e,o,i),uri:a.uri}})).filter(l.identity):[]},_d=(0,l.pipe)(gd,(0,l.map)((0,l.prop)("text")),(0,l.join)(", ")),Ad=(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=Ad(e.slice(1),r.value);n&&(Array.isArray(n)?t=t.concat(n):t.push(n))}return t}),[]):Ad(e.slice(1),r)}})),Nd=e=>!!e&&!!e.ctSubscribedUris&&e.ctSubscribedUris.length>0,Pd=e=>(0,l.propOr)([],"matchRules",e),Rd=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t&&r?ld({},r.aEntity,{attributes:n.attributes||{},roles:n.roles||[],tags:n.tags||[]}):e},Sd=(e,t,r)=>t&&r?r.aEntity:e,wd=(0,l.evolve)({attributes:yl(!0)}),Id=(0,l.pipe)(wd,(0,l.props)(["attributes","startDate","endDate","roles","tags"]),(0,l.all)(E)),Ud=e=>(0,l.assoc)("dataTenant",e),Cd=e=>{let{entityUri:t,max:r,deep:n,sort:i,order:a,activeness:o,filter:s,markMatchedValues:u,sources:c,rules:p}=e;const d={max:r,deep:n,filter:s,markMatchedValues:u,sort:i,order:a,activeness:o,sources:c,rules:p};return Ul(`/${t}/_transitiveMatches${(0,l.pipe)((0,l.reject)(E),gr)(d)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Ld=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 Ul(`/${t}/_notMatch${(0,l.pipe)((0,l.reject)(E),gr)(s)}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Dd=(e,t)=>{const r=(0,l.map)((0,l.prop)("uri"))(t);return Ul("/entities/_same",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.concat(e))})},jd=(e,t,r)=>Promise.all(t.map((async t=>await Ul(`/${t.uri}/_notMatch?uri=${e}`,{method:"NOT"===r?"POST":"DELETE",headers:{"Content-Type":"application/json"}})))),kd=async(e,t)=>await jd(e,t,"NOT"),Fd=async(e,t)=>await jd(e,t,"MATCH"),Md=async(e,t)=>await Promise.all(t.map((async t=>await Ul(`/${t.uri}/_setAMatch?uri=${e}`,{method:"POST",headers:{"Content-Type":"application/json"}}))));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){$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}function Vd(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 Gd=e=>{let{dtssPath:t,customerTenant:r,entity:{dataTenant:n,uri:i}}=e;return Ul(`${t}entities/_import?dataEntityUri=${i}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},Wd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return ly({url:`entities/_connections/_hasNonImported?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Yd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,entityUri:i,content:a}=e;return ly({url:`entities/_connections/_import?customerEntityUri=${i}`,dataTenant:n,customerTenant:r,dtssPath:t,options:{method:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(a)}})},Bd=e=>{let{dtssPath:t,customerTenant:r,dataTenant:n,dataEntityUri:i,customerEntityUri:a}=e;return Ul(`${t}entities/_merge?dataEntityUri=${i}&customerEntityUri=${a}`,{method:"POST",headers:{DataTenant:n,CustomerTenant:r,"Content-Type":"application/json"}})},qd=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 Bd({dtssPath:t,customerTenant:r,dataTenant:a,customerEntityUri:n,dataEntityUri:o})})))},Hd=e=>{let{dtssPath:t,customerTenant:r,entity:n,entities:i}=e;const{uri:a}=n,[o,s]=(0,l.partition)(fd,i);return Promise.all([s.length?Dd(a,s):Promise.resolve(),...o.map((e=>{let{uri:n,dataTenant:i}=e;return Bd({dtssPath:t,customerTenant:r,dataTenant:i,customerEntityUri:a,dataEntityUri:n})}))])},Qd=(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=Vd(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)}),[])),Kd=(0,l.pipe)((0,l.find)((0,l.propEq)("index",0)),(0,l.propOr)({},"object"),Qd),Jd=e=>{let{dtssPath:t,customerTenant:r,entity:n}=e;const{uri:i,dataTenant:a}=n;return Ul(`${t}entities/_matchesForDtEntities?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:a,CustomerTenant:r,"Content-Type":"application/json"},body:JSON.stringify([i])}).then(Kd)},Xd=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)},zd=Xd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a,type:o}=i;return Ul(`${t}entities/_matches?skipAllImportedEntities=true`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{uri:a,type:o}])}).then(Kd)})),Zd=Xd((e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,entity:i}=e;const{uri:a}=i;return Ul(`${t}entities/_notMatch?returnObjects=true&customerEntityUri=${a}`,{method:"GET",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"}})})),ey=(e,t)=>{let{dtssPath:r,dataTenants:n=[],entity:i,customerTenant:a,dtssRequest:o}=e;return function(){if(r&&n&&n.length){const e=o({dtssPath:r,dataTenants:n,entity:i,customerTenant:a});return Promise.all([t(...arguments),e]).then(l.flatten)}return t(...arguments)}},ty=e=>t=>{let{dtssPath:r,customerTenant:n,dataTenant:i,dataEntityUri:a,customerEntityUri:o}=t;return Ul(`${r}entities/_notMatch?dataEntityUri=${a}&customerEntityUri=${o}`,{method:"NOT"===e?"POST":"DELETE",headers:{DataTenant:i,CustomerTenant:n,"Content-Type":"application/json"}})},ry=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 ty(e)({dtssPath:r,customerTenant:n,dataTenant:o,customerEntityUri:i,dataEntityUri:s})})))},ny=ry("NOT"),iy=ry("MATCH"),ay=e=>t=>{let{dtssPath:r,customerTenant:n,entity:i,entities:a}=t;const{uri:o}=i,[s,u]=(0,l.partition)(fd,a);return Promise.all([jd(o,u,e),...s.map((t=>{let{uri:i,dataTenant:a}=t;return ty(e)({dtssPath:r,customerTenant:n,dataTenant:a,customerEntityUri:o,dataEntityUri:i})}))])},oy=ay("NOT"),sy=ay("MATCH");function ly(e){let{requestProvider:t=Ul,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}`,xd({},Vd(s,["headers"]),{headers:xd({},l,{SearchMetadata:"AUTO",DataTenant:i,customerTenant:a})}))}const uy=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return ly({url:Nc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},cy=e=>{let{filters:t,options:r,value:n="",dataTenant:i,customerTenant:a,dtssPath:o}=e;return ly({url:mc(t,r,n),dataTenant:i,customerTenant:a,dtssPath:o})},py=e=>{let{entityUri:t,configs:r,dataTenant:n,customerTenant:i,dtssPath:a,options:o}=e;const{searchByOv:s}=o,{options:u}=ep(t,r);return ly({url:`entities/_connections/_getConnections${_r({dataEntityUri:t,options:s?"searchByOv":void 0})}`,options:u,dataTenant:n,customerTenant:i,dtssPath:a}).then((0,l.pipe)(tp,(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)))}))))},dy=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return ly({url:`${Uc(t)}&select=secondaryLabel`,dataTenant:r,customerTenant:n,dtssPath:i})},yy=e=>{let{dtssPath:t,dataTenant:r,customerTenant:n,value:i,type:a,sourceTable:o}=e;return Ul(`${t}entities/_unmerge`,{method:"POST",headers:{DataTenant:r,CustomerTenant:n,"Content-Type":"application/json"},body:JSON.stringify([{value:i,type:a,sourceTable:o}])})},fy=e=>{let{dtssPath:t,tenant:r}=e;return Ul(`${t}tenants/customerTenants?id=${r}&useCache=true`,{method:"GET"})},Ty=e=>{let{dtssPath:t,customerTenant:r}=e;return Ul(`${t}subscriptions?useCache=true`,{method:"GET",headers:{CustomerTenant:r}})},Ey=e=>{let{dtssPath:t,tenants:r}=e;return Ul(`${t}tenants/dataTenants?id=${r}&useCache=true`,{method:"GET"})},my=e=>{let{entityUri:t,dataTenant:r,customerTenant:n,dtssPath:i}=e;return ly({url:Uc(t),dataTenant:r,customerTenant:n,dtssPath:i})},hy=()=>Ul("/configuration?options=showAccess&showHiddenMatchRules=true",{method:"GET"});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){Oy(e,t,r[t])}))}return e}function Oy(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{apiPath:t,tenant:r,searchBody:n,options:i}=e;const{select:a}=i,o=by({},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 Ul(`${t}/api/${r}/graph/search${_r({select:a})}`,{method:"POST",body:o,headers:{"Content-Type":"application/json"}})},gy=e=>{let{apiPath:t,tenant:r,searchBody:n,options:i={}}=e;return Ul(`${t}/api/${r}/graph/search/count`,{method:"POST",body:by({},n,i),headers:{"Content-Type":"application/json"}})},_y=(e,t)=>`${e}/${t}/comments`,Ay=e=>{let{collaborationPath:t,tenant:r,uris:n}=e;return Ul(`${_y(t,r)}/count`,{method:"POST",body:n,headers:{"Content-Type":"application/json"}})},Ny=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Ul(`${_y(t,r)}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})},Py=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Ul(_y(t,r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([n])})},Ry=e=>{let{collaborationPath:t,tenant:r,data:n}=e;return Ul(`${_y(t,r)}/${n.commentId}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},Sy=e=>{let{collaborationPath:t,tenant:r,commentId:n}=e;return Ul(`${_y(t,r)}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},wy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i}=e;return Ul(`${_y(t,r)}/${n}/replies/${i}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},Iy=e=>{let{collaborationPath:t,tenant:r,commentId:n,replyId:i,data:a}=e;return Ul(`${_y(t,r)}/${n}/replies/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})},Uy=e=>{let{collaborationPath:t,tenant:r,commentId:n,data:i}=e;return Ul(`${_y(t,r)}/${n}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([i])})},Cy=e=>{let{collaborationPath:t,tenant:r,maxResults:n=10,relatedObjectUri:i,sort:a="modifiedTime",order:o="desc",pageToken:s=null}=e;const l=_r({maxResults:n,relatedObjectUri:i,sort:a,order:o,pageToken:s});return Ul(`${_y(t,r)}${l}`,{method:"GET",headers:{"Content-Type":"application/json"}})};function Ly(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Dy(e,t,r[t])}))}return e}function Dy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jy=e=>{let{tenant:t,servicesPath:r}=e;return Ul(`${r}/oauth/proxy${_r({url:"/oauth/users/tenant/{0}",params:t})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},ky="graphExport",Fy=async(e,t,r,n,i)=>{let a;try{const{data:n={}}=await Vy({servicesPath:e,tenant:t,environment:r,namespace:ky,options:{method:"GET",headers:{"Content-Type":"application/json"}}});a=n}catch(e){a={}}const o={body:JSON.stringify(Ly({},a,{[n]:i})),headers:{"Content-Type":"application/json"}};let s;try{s=await Vy({servicesPath:e,tenant:t,environment:r,namespace:ky,options:Ly({method:"PUT"},o)})}catch(e){s=null}return s||(s=await Vy({servicesPath:e,tenant:t,environment:r,namespace:ky,options:Ly({method:"POST"},o)})),s},My=e=>{let{servicesPath:t,key:r}=e;return Ul(`${t}/settings${_r({key:r})}`,{method:"GET",headers:{"Content-Type":"application/json"}})},xy=e=>{let{servicesPath:t}=e;return Ul(`${t}/version/collect`,{method:"POST",headers:{"Content-Type":"application/json"}})},$y=e=>{let{tenant:t,userName:r,servicesPath:n}=e;return Ul(`${n}/plugins${_r({tenant:t,user:r})}`,{method:"GET"})},Vy=e=>{let{tenant:t,environment:r,servicesPath:n,options:i,namespace:a,projection:o}=e;return Ul(`${n}/configService${_r({tenant:t,environment:r,namespace:a,projection:o})}`,i)},Gy=e=>{let{tenant:t,environment:r,servicesPath:n}=e;return Vy({tenant:t,environment:r,servicesPath:n,projection:"apps",options:{method:"GET"}})},Wy=e=>{let{servicesPath:t,stateHash:r}=e;return Ul(`${t}/searchLink?key=${r}`,{method:"GET"})},Yy=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),Ul(`${t}/${r}/${n}`,{body:a,method:"POST",application:"common",headers:{"Content-Type":null}})},By=e=>Ul(`/${e}?showObjectsInfo=true`,{method:"GET"}),qy=e=>{let{exportPath:t,tenant:r,options:n}=e;return Ul(`${t}/${r}/activities${_r(n)}`,{method:"POST"})};function Hy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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=>{const{entityUri:t}=e;return Ul(`/${t}/_crosswalkTree`,{method:"GET",headers:{"Content-Type":"application/json"}})},Jy=e=>{let{entityUri:t,crosswalk:r}=e;return Ul(`/${t}/crosswalks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r])})},Xy=e=>{let{entityTypeUri:t,contributorCrosswalkType:r,contributorCrosswalkValue:n,contributorCrosswalkSourceTable:i,crosswalkType:a,crosswalkValue:o,crosswalkSourceTable:s,crosswalkDeleteDate:l}=e;return Ul("/entities?options=partialOverride",{method:"POST",headers:{"Content-Type":"application/json"},noReltioSourceSystem:!0,body:JSON.stringify([{attributes:{},crosswalks:[Hy({type:r,value:n,dataProvider:!1,contributorProvider:!0},i&&{sourceTable:i}),Hy({type:a,value:o,dataProvider:!0},s&&{sourceTable:s},l&&{deleteDate:l})],type:t}])})},zy=e=>{const{contributorUri:t,entityUri:r,operationType:n}=e;return Ul(`/${r}/_${n}${_r({contributorURI:t})}`,{method:"POST"})},Zy=e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:i}=e;return Ul(`/${t}/crosswalks/${r}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})})},ef=e=>{let{entityUri:t,crosswalkId:r,attributeName:n}=e;return Ul(`/${t}/crosswalks/${r}/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})},tf=e=>{let{entityUri:t,crosswalkId:r}=e;return Ul(`/${t}/crosswalks/${r}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})};function rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nf=e=>{let{entityTypeUri:t}=e;return Ul(`/dataQuality/fillRates${gr({entityType:Nt(t)})}`,{method:"GET"})},af=e=>{let{entityTypeUri:t,attributes:r,dataLevel:n,metrics:i}=e;const a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rf(e,t,r[t])}))}return e}({},n===Fe.ATTRIBUTE_TYPE?{attributes:r}:{},i?{metrics:i}:{});return Ul(`/entityType/${Nt(t)}/dataQuality/${n}`,{method:"POST",body:JSON.stringify(a)})},of=e=>{let{dvfPath:t,tenant:r,entityTypeUri:n,env:i}=e;return Ul(`${t}/api/${r}/dataValidationFunctions/entityTypes/${Nt(n)}`,{method:"GET",headers:{env:i}})},sf=e=>{let{mlDqPath:t,tenant:r,entityTypeUri:n,attribute:i,viewMultiplier:a=1,dataLevel:o=Fe.ATTRIBUTE_TYPE,metrics:s=[],startDate:l,endDate:u}=e;const c={attribute:i,metrics:s,viewMultiplier:a,startDate:l,endDate:u};return Ul(`${t}/${r}/entityType/${Nt(n)}/ml/dataQuality/v1/${o}/timeSeries/`,{method:"POST",body:JSON.stringify(c)})},lf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i}=e;return Ul(`/${t}${_r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"DELETE",headers:r?{"Source-System":r}:{}})},uf=e=>{let{attributeUri:t,value:r}=e;return Ul(`/${t}/pin`,{method:"PUT",body:JSON.stringify({value:r})})},cf=e=>{let{attributeUri:t,value:r}=e;return Ul(`/${t}/ignore`,{method:"PUT",body:JSON.stringify({value:r})})},pf=e=>{let{attributeUri:t,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:i,value:a}=e;return Ul(`/${t}${_r({crosswalkValue:n,crosswalkSourceTable:i})}`,{method:"PUT",headers:r?{"Source-System":r}:{},body:JSON.stringify({value:a})})},df=e=>{let{attributeUri:t,crosswalkValue:r,crosswalkSourceTable:n,sourceUri:i,value:a}=e;const o=_r({crosswalkValue:r,crosswalkSourceTable:n}),s=t.split("/").slice(0,-1).join("/"),[l]=yl()([[{value:a}]]);return Ul(`/${s}${o}`,{method:"POST",headers:i?{"Source-System":i}:{},body:JSON.stringify(l)})},yf=e=>{let{entityUri:t,attributeName:r,value:n}=e;return Ul(`/${t}/activeness`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[r]:n})})},ff=e=>{let{entityUri:t,attributeName:r}=e;return Ul(`/${t}/activeness/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})};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 Ef=e=>{let{entityUri:t}=e;return Ul(`/${t}/_historicURIs`,{method:"GET"})},mf=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 Ul(`/${t}/_changesWithTotal${_r(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}({},n,{historicURIs:null==r?void 0:r.join(",")}))}`,{method:"GET"})},hf=(e,t)=>Ul(`/${e}/_previousChange${_r({timestamp:t})}`,{method:"GET"}),bf=(e,t)=>Ul(`/${e}${_r({time:t})}`,{method:"GET"});function Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vf(e,t,r[t])}))}return e}function vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gf=e=>{let{url:t,method:r,data:n,headers:i,noRequestProcessor:a}=e;return Ul(t,{method:r||"GET",body:n,headers:Of({"Content-Type":"application/json"},null!=i?i:{}),noRequestProcessor:a})},_f=e=>{let{validationServicePath:t,uri:r,diff:n,tenant:i,options:a=[],severity:o=[]}=e;const s=_r({options:a.join(","),severity:o.join(",")});return Ul(`${t}/validate/${i}/entity/${hd({uri:r})}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:n})},Af=e=>{let{validationServicePath:t,entity:r,tenant:n,options:i=[],severity:a=[]}=e;return Ul(`${t}/validate/${n}/entity${_r({options:i.join(","),severity:a.join(",")})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r})},Nf=e=>{let{tenant:t,apiPath:r}=e;return Ul(`${r}/tenants/${t}/name`,{method:"GET"})},Pf=e=>{let{tenant:t,apiPath:r}=e;return Ul(`${r}/tenants/${t}/_rdmTenants`,{method:"GET"})},Rf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e;return Ul(`${a}/preferences${_r({name:t,tenant:r,environment:n,user:i})}`,{method:"GET"})},Sf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a,value:o}=e,s={name:t,tenant:r,environment:n,user:i,values:[JSON.stringify(o)]};return Ul(`${a}/preferences`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})},wf=e=>{const{name:t,tenant:r,environment:n,user:i,servicesPath:a}=e,o={name:t,tenant:r,environment:n,user:i};return Ul(`${a}/preferences`,{method:"DELETE",body:JSON.stringify(o)})},If=e=>{const{servicesPath:t}=e;return Ul(`${t}/getTokenForWorker`,{method:"GET"})};var Uf=r(29524);const Cf=e=>{let{entityTypeUri:t,initValue:r,attributeTypes:n,metadata:i,mode:a}=e;const o=Et(),s={attributes:tl({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=Es(r,e,n.uri)[0];return i&&i.value?ol({entity:e,attributeType:n,uri:i.uri,value:t}):il({entity:e,attributeType:n,parentUri:e.uri,value:t,index:0})}return e}(s,r,i,n):s},Lf=(e,t)=>(0,l.pipe)(l.values,l.flatten,(0,l.filter)((0,l.has)("refEntity")),(0,l.map)(ps),(0,l.filter)(Tt),(0,l.map)((t=>e[t])),(0,l.reject)(l.isNil))((null==t?void 0:t.attributes)||{}),Df=(0,l.curry)(((e,t)=>{const r=Lf(e=e||{},t=t||{});return r.concat((0,l.chain)(Df(e),r))})),jf=(0,l.curry)(((e,t)=>(0,l.pipe)(ce,(0,l.filter)(e))(t))),kf=jf((e=>"objectURI"===e[e.length-1]&&e.includes("refEntity"))),Ff=e=>(0,l.filter)((0,l.pipe)((t=>(0,l.path)(t,e)),Tt)),Mf=e=>(0,l.pipe)(kf,Ff(e),(0,l.map)((t=>(0,l.path)(t,e))))(e),xf=(0,l.curry)(((e,t,r)=>{const n=(0,l.pipe)(kf,(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})),$f=(0,l.when)((0,l.pipe)((0,l.prop)("uri"),Tt),(0,l.omit)(["uri","timestamp"])),Vf=(0,l.pipe)($f,wd),Gf=async(e,t,r)=>{if(!e)return null;const n=Mf(e);if(n.length>0)for(const r of n)e=xf(r,t[r],e);const i=await Dc(Vf(e),null==r?void 0:r.enhanceUriWithDCR),a=(e=>(0,l.path)([0,"errors"],e))(i);if(a)throw a;if((0,l.has)("changes",i))return null==r||r.updateDCRUriFromResponse(i),((e,t)=>(0,l.pipe)((0,l.prop)("changes"),l.keys,(0,l.find)((e=>!(0,l.values)(t).includes(e))))(e))(i,t);const o=(e=>(0,l.pathOr)(e,[0,"object"],e))(i);return o.uri},Wf=async(e,t,r)=>{const n=Bf(e,t),i={};for(const t of n)i[t]=await Gf(e[t],i,r);return i},Yf=(0,l.curry)(((e,t)=>{const r=Uf.Node(t);return Mf(e[t]).forEach((t=>{const n=Yf(e,t);r.addEdge(n)})),r})),Bf=(e,t)=>(0,l.pipe)((0,l.map)(Yf(e)),(0,l.map)(Uf.getDependencyOrder),l.flatten,(0,l.map)((e=>e.getInfo())))(t),qf=(0,l.map)((0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.map)($f))})),Hf=(e,t)=>[...FE(e.tags||[],t.tags||[]),...ME(e.roles||[],t.roles||[]),...UE(e,t),...CE(e,t)],Qf=(e,t)=>[...LE(IE((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!1),kE((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e),...Hf(e,t)],Kf=(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 xf(r,n,e)}),e))))}),t)}),qf),Jf=(0,l.curry)(((e,t)=>(0,l.when)(Tt,(0,l.propOr)(l.__,t,e),t)));function Xf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zf(e,t,r[t])}))}return e}function zf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zf=e=>{let{parentUri:t,relation:r,entityUri:n}=e;return{type:Me.CREATE_RELATION,parameters:{parentUri:t,relation:r,entityUri:n}}},eT=e=>{let{relationUri:t}=e;return{type:Me.DELETE_RELATION,parameters:{relationUri:t}}},tT=e=>{let{parentUri:t,entityUri:r,relationType:n,relationDirection:i}=e;return{type:Me.IGNORE_RELATION,parameters:{parentUri:t,entityUri:r,relationType:n,relationDirection:i}}},rT=e=>{let{oldRelation:t,newRelation:r}=e;return{type:Me.UPDATE_RELATION,parameters:{oldRelation:t,newRelation:r}}},nT=e=>{let{entityUri:t,newEntityUri:r,relation:n,isReversed:i}=e;return{type:Me.REPOINT_RELATION,parameters:{entityUri:t,newEntityUri:r,relation:n,isReversed:i}}},iT=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pathEq)(["parameters","relation","uri"],e),l.T],[(0,l.pathEq)(["parameters","relationUri"],e),l.T],[(0,l.pathEq)(["parameters","oldRelation","uri"],e),l.T],[(0,l.pathEq)(["parameters","newRelation","uri"],e),l.T],[l.T,l.F]])(t))),aT=e=>e.type===Me.DELETE_RELATION,oT=e=>e.type===Me.CREATE_RELATION,sT=e=>e.type===Me.REPOINT_RELATION,lT=e=>e.type===Me.UPDATE_RELATION,uT=e=>e.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve()),cT=e=>{let{type:t,parameters:r,dcrProcessor:n}=e;const{enhanceUriWithDCR:i,updateDCRUriFromResponse:a}=n,o=e=>(a(e),e);switch(t){case Me.CREATE_RELATION:return()=>{const{parentUri:e,relation:t,entityUri:n}=r,{type:a,attributes:s,startDate:l,endDate:u}=t;return op({startEntityUri:e,endEntityUri:n,relationType:a,attributes:s,startDate:l,endDate:u,uriPreprocessor:i}).then(o)};case Me.DELETE_RELATION:return()=>{const{relationUri:e}=r;return ap(e,i).then(o)};case Me.IGNORE_RELATION:return()=>{const{entityUri:e,parentUri:t,relationType:n,relationDirection:i}=r;return cp(t,{relatedEntityUri:e,relationType:n,relationDirection:i}).then(o)};case Me.UPDATE_RELATION:return()=>{const{oldRelation:e,newRelation:t}=r;return sp({oldRelation:e,newRelation:t,uriPreprocessor:i}).then(o)};case Me.REPOINT_RELATION:return()=>{const{entityUri:e,newEntityUri:t,relation:i,isReversed:a}=r,{uri:o}=i,s=[eT({relationUri:o}),Zf({parentUri:a?e:t,relation:i,entityUri:a?t:e})];return(0,l.pipe)((0,l.map)(pT(n)),(0,l.map)(cT),uT)(s)}}},pT=e=>t=>Xf({dcrProcessor:e},t),dT=function(){let{alwaysCreateDCR:e=!1,dcrUri:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{alwaysCreateDCR:!1,dcrUri:null};const r=Ar({alwaysCreateDCR:e,dcrUri:t});return{commandExecutor:(0,l.pipe)(l.flatten,(0,l.map)(pT(r)),(0,l.map)(cT),uT,(0,l.otherwise)((e=>({errorMessage:e})))),dcrProcessor:r}},yT=e=>t=>(0,l.map)((t=>Xf({},t,{parameters:(0,l.evolve)({parentUri:Jf(e),entityUri:Jf(e),newEntityUri:Jf(e)},t.parameters)})),t),fT=e=>{let{condition:t,updater:r}=e;return e=>t(e)?r(e):e},TT=(e,t)=>{const r=e.filter(oT).find(iT(t));let n=null,i=null,a=null;const o=e.filter(((o,s)=>lT(o)&&iT(t,o)?(s>e.indexOf(r)&&(n=o.parameters.newRelation),!1):!sT(o)||!iT(t,o)||(s>e.indexOf(r)&&(n=o.parameters.relation,i=o.parameters.isReversed?o.parameters.entityUri:o.parameters.newEntityUri,a=o.parameters.isReversed?o.parameters.newEntityUri:o.parameters.entityUri),!1)));return n?o.map(fT({condition:e=>r===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n),parentUri:e=>i||e,entityUri:e=>a||e})})(e)})):o},ET=(e,t)=>{const r=e.filter(sT).filter(iT(t));let n=null;const i=e.filter(((i,a)=>r.includes(i)?(0,l.last)(r)===i:!lT(i)||!iT(t,i)||(a>e.indexOf((0,l.last)(r))&&(n=i.parameters.newRelation),!1)));return n?i.map(fT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({relation:(0,l.always)(n)})})(e)})):i},mT=(e,t)=>{const r=e.filter(aT).filter(iT(t));return e.filter((e=>r.includes(e)?(0,l.last)(r)===e:!iT(t,e)))},hT=(e,t)=>{const r=e.filter(lT).filter(iT(t));let n=null;const i=e.filter((e=>!r.includes(e)||!lT(e)||(n=n||e.parameters.oldRelation,(0,l.last)(r)===e)));return n?i.map(fT({condition:e=>(0,l.last)(r)===e,updater:e=>(0,l.evolve)({parameters:(0,l.evolve)({oldRelation:(0,l.always)(n)})})(e)})):i},bT=e=>{const t=e.filter(aT).map((e=>{let{parameters:{relationUri:t}}=e;return t}));return(0,l.uniq)(t).reduce(mT,e)},OT=e=>{const t=e.filter(oT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(TT,e)},vT=e=>{const t=e.filter(sT).map((e=>{let{parameters:{relation:{uri:t}}}=e;return t}));return(0,l.uniq)(t).reduce(ET,e)},gT=e=>{const t=e.filter(lT).map((e=>{let{parameters:{newRelation:{uri:t}}}=e;return t}));return(0,l.pipe)((0,l.filter)((e=>(0,l.count)((0,l.equals)(e),t)>1)),l.uniq,(0,l.reduce)(hT,e))(t)},_T=e=>(0,l.pipe)(bT,OT,vT,gT)(e);function AT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){NT(e,t,r[t])}))}return e}function NT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PT=e=>AT({},(0,l.path)(MT(),e),{startDate:(0,l.path)(GT(),e),endDate:(0,l.path)(WT(),e)}),RT=(e,t)=>(0,l.pipe)((0,l.path)(VT()),Jf(t))(e),ST=(e,t,r,n)=>{let{removedUris:i=[],addedConnections:a=[],editedConnections:o=[],ignoredRelationData:s=[]}=t;return[...a.map((e=>{const t=RT(e,r),i=(0,l.path)(xT(),e)===xe.IN,a=e.parentEntityUri||n;return Zf({parentUri:i?t:a,relation:PT(e),entityUri:i?a:t})})),...o.map((t=>{const i=RT(t,r),a=(0,l.path)(xT(),t)===xe.IN,o=i!==(0,l.pipe)((0,l.path)(MT()),a?YT:BT)(t),s=QT(e,(0,l.path)(kT(),t)),u=t.parentEntityUri||n,c=Jf(r,i);return o?nT({entityUri:a?u:c,newEntityUri:a?c:u,relation:(0,l.path)(MT(),t),isReversed:!1}):rT({oldRelation:(0,l.path)(MT(),s),newRelation:PT(t)})})),...i.map((e=>eT({relationUri:e}))),...s.map((e=>tT({parentUri:n,entityUri:e.entityUri,relationType:e.relationType,relationDirection:e.relationDirection})))]},wT=e=>(e||[]).reduce(((e,t)=>{let{entity:r}=t;const n=r.dataTenant;return AT({},e,{[r.entityUri]:{uri:r.entityUri,label:r.entityLabel,type:r.entityType,dataTenant:n}})}),{}),IT=(0,l.has)("dataTenant"),UT=(0,l.ifElse)(IT,(e=>{let{relationUri:t,dataTenant:r}=e;return`DTSS/${r}/${t}`}),(0,l.prop)("relationUri")),CT=(e,t)=>(0,l.pipe)(li,(0,l.defaultTo)({}),(0,l.propOr)([],"attributes"),(0,l.concat)(Us),Na)(e,t),LT=e=>{let{type:{uri:t,label:r},direction:n}=e;return e=>{const i=e.relationUri;return(0,l.pipe)((0,l.assoc)("relationType",t),(0,l.assoc)("relationLabel",r),(0,l.assoc)("object",{type:t,attributes:{},uri:i}),(0,l.assoc)("direction",n))(e)}},DT=(e,t,r)=>{const n=Xp(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)},jT="relation",kT=(0,l.always)([jT,"relationUri"]),FT=(0,l.always)([jT,"relationType"]),MT=(0,l.always)([jT,"object"]),xT=(0,l.always)([jT,"direction"]),$T=(0,l.always)([jT,"object","attributes"]),VT=(0,l.always)(["entity","entityUri"]),GT=(0,l.always)([jT,"startDate"]),WT=(0,l.always)([jT,"endDate"]),YT=(0,l.path)(["startObject","objectURI"]),BT=(0,l.path)(["endObject","objectURI"]),qT=(0,l.path)(["startObject","objectTypeURI"]),HT=(0,l.path)(["endObject","objectTypeURI"]),QT=(e,t)=>{for(const r of e){if((0,l.pipe)((0,l.path)(kT()),(0,l.equals)(t))(r))return r;if(r.connections){const e=QT(r.connections,t);if(e)return e}}},KT=(0,l.pipe)(QT,(0,l.path)(MT())),JT=(0,l.allPass)([(0,l.pipe)((0,l.path)(VT()),(0,l.complement)(E)),(0,l.pipe)((0,l.path)(FT()),(0,l.complement)(E))]),XT=e=>{let{config:t,mode:r,metadata:n,parentEntityUri:i}=e;const a={relation:{relationUri:mt()},entity:{},isNew:!0},{relationType:o,direction:s}=a.relation,{inRelations:u,outRelations:c}=eE({content:i?t.contentSecondLevel:t.content,direction:s,relationType:o,mode:r,metadata:n}),p=zT(u,c);return(0,l.pipe)((0,l.evolve)({relation:p?LT(p):l.identity}),(0,l.defaultTo)({}),(0,l.when)((0,l.always)(i),(0,l.assoc)("parentEntityUri",i)))(a)},zT=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:zr.IN}:{type:t[0],direction:zr.OUT}:null},ZT=e=>e.uri||e,eE=e=>{let{content:t,direction:r,relationType:n,mode:i,metadata:a}=e;const o={},s=e=>t=>{const a=t&&Oi(i,t),s=t&&n===t.uri&&r===e;if(a||s){let{label:r}=t;const n=e===zr.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"],Ir(a,e.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ir(a,e.endObject.objectTypeURI)))(e),c=(0,l.pipe)(ZT,li(a));return(0,l.evolve)({inRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(zr.IN)),(0,l.map)(u)),outRelations:(0,l.pipe)((0,l.map)(c),(0,l.filter)(s(zr.OUT)),(0,l.map)(u))},t)||{}},tE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const{isNotDuplicatedInRelation:n,isNotDuplicatedOutRelation:i}=yi({reversedContextLabels:!0}),a=(0,l.curry)(((e,t,r,n)=>{const[i,a]=ci(e,n.uri);return n&&(!t||Cr(e,i,t))&&(!r||Cr(e,a,r))})),o=t=>(0,l.pipe)((0,l.assocPath)(["startObject","objectType"],Ir(e,t.startObject.objectTypeURI)),(0,l.assocPath)(["endObject","objectType"],Ir(e,t.endObject.objectTypeURI)))(t),s=(e.relationTypes||[]).filter((0,l.both)(Vo,r));return{inRelations:(0,l.pipe)((0,l.filter)(a(e,null,t)),(0,l.filter)(n),(0,l.map)(o))(s),outRelations:(0,l.pipe)((0,l.filter)(a(e,t,null)),(0,l.filter)(i),(0,l.map)(o))(s)}},rE=(0,l.curry)(((e,t,r,n,i)=>{const a=Cr(n,l.__,t.type),o=e?HT:qT,s=Cr(n,l.__,r.type),u=e?qT:HT;return(0,l.both)((0,l.pipe)(o,a),(0,l.pipe)(u,s))(i)})),nE=(e,t,r)=>{const n=e?HT:qT,i=(0,l.pipe)((0,l.map)(n),l.uniq)(r);return(0,l.pipe)((0,l.filter)((e=>{let{uri:r}=e;return i.some(Cr(t,l.__,r))})),(0,l.reject)((0,l.prop)("abstract")),(0,l.map)((0,l.prop)("uri")))(t.entityTypes||[])};function iE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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 oE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return iE({},t,{[r]:{parents:n,children:i}})},sE=e=>{let{hierarchy:t,uri:r,parents:n=[],children:i=[]}=e;return iE({},t,{[r]:{parents:t[r].parents.concat(n),children:t[r].children.concat(i)}})},lE=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=Lf(t,i),o=oE({hierarchy:n,uri:e,children:a.map((0,l.prop)("uri")),parents:r});return a.reduce(((r,n)=>lE(n.uri,t,[e],r)),o)},uE=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)(kT(),n),a=t?sE({hierarchy:e,uri:t,children:[i]}):e,o=(0,l.path)(VT(),n),s=Tt(o)?[o]:[],u=oE({hierarchy:a,uri:i,children:s,parents:t?[t]:[]});return s.reduce(((e,t)=>lE(t,r,[i],e)),u)}),n)},cE=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return uE(r,e,t,lE(e,t))},pE=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return cE(t,r,n);if(bt(e)){const t=QT(n,e);return t&&uE([t],null,r)}return r[e]?lE(e,r):void 0},dE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.children)||[];return n.concat(n.flatMap((t=>dE(e,t))))},yE=(e,t)=>{var r;const n=(null===(r=e[t])||void 0===r?void 0:r.parents)||[];return n.concat(n.flatMap((t=>yE(e,t))))},fE=(e,t)=>{let{entityUri:r,entitiesMap:n={},connections:i=[],metadata:a}=e;const o=[],s=ht(t),u=cE(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(bt(c)){if(s=QT(i,c),!s)return null;o.push({type:ve.relationConnection,value:s,valueType:li(a,(0,l.path)(FT(),s))});continue}if(bt(u)){const e=n[c];if(!e)return null;o.push({type:ve.tempEntity,value:e,valueType:Ir(a,e.type)});continue}const p=n[u],d=ws(p,c),y=n[c];if(!d||!y)return null;o.push({type:ve.attributeValue,value:d,valueType:nr(a,wt(d.uri,p.type))}),o.push({type:ve.tempEntity,value:y,valueType:Ir(a,y.type)})}return o})({entitiesMap:n,connections:i,metadata:a},yE(u,s).reverse(),s);if(!c)return null;o.push(...c);const p=bt(s),d=p?KT(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?li(a,d.type):Ir(a,d.type),m=d.attributes;for(let e=0;e<y.length;e++){const t=0===e?E.attributes:ir(a,E);if(E=null==t?void 0:t.find((0,l.propEq)("name",y[e])),!E)return null;{var h,b,O,v;const t=t=>{let{uri:r}=t;return r.endsWith(`/${f[e]}`)},r=null===(h=m[E.name])||void 0===h?void 0:h.find(t),i=null===(b=T)||void 0===b||null===(O=b.attributes)||void 0===O||null===(v=O[E.name])||void 0===v?void 0:v.find(t),s=i||r;if(!s)return null;i&&o.push({type:ve.tempEntity,value:T,valueType:Ir(a,T.type)}),o.push({type:ve.attributeValue,value:s,valueType:E}),m=s.value;const l=ps(s);T=l&&Tt(l)?n[l]:null}}return o},TE=e=>e.every((e=>{let{type:t}=e;return[ve.attributeValue,ve.tempEntity].includes(t)}))?e.filter((e=>{let{type:t}=e;return t===ve.attributeValue})).reduce(((e,t)=>{const r=t.value.uri;return e?`${e}/${r.split("/").slice(-2).join("/")}`:r}),""):null,EE=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(EE(e))}))}))),t},mE=(e,t)=>(0,l.find)((e=>(0,l.find)((0,l.eqBy)(vE,t),(0,l.propOr)([],"crosswalks",e))),e),hE=(e,t)=>{let r=e.crosswalks||[];var n;return t||null===(n=e.merges)||void 0===n||n.forEach((e=>{var t;null===(t=e.losers)||void 0===t||t.forEach((e=>{r=r.concat(hE(e))}))})),r},bE=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=bE(e);r>t&&(t=r)}))})),t+1):t},OE=(e,t)=>{if(Tt(t.uri))return!0;const r=(e||[]).find((e=>e.attributes&&e.attributes.includes(t.uri)));return!r||"configuration/sources/Reltio"===r.type},vE=e=>{let{sourceTable:t,type:r,value:n}=e;return`${t||""}/${r}/${n}`},gE=e=>{const t="attributes"in e&&e.attributes,r="attributeURIs"in e&&e.attributeURIs;return t||r||[]},_E=e=>{let{deleteDate:t}=e;return!!t&&f().utc(t).valueOf()<Date.now()},AE=(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)},NE=(0,l.eqBy)(vE),PE=(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)(as,(0,l.propOr)([],"crosswalks"),(0,l.map)((0,l.when)((0,l.pipe)((0,l.prop)("attributeURIs"),E),(0,l.assoc)("attributeURIs",[e.uri]))))(e))));function RE(e){return e&&void 0!==e.uri}function SE(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 wE(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 IE(e,t,r){var n,i,a,o=[];for(var s in e)if(e.hasOwnProperty(s)){if("paging"===s)continue;var u=e[s];if(void 0===t[s])for(var c in u)u.hasOwnProperty(c)&&o.push.apply(o,m(u[c]));else for(var p in u)if(u.hasOwnProperty(p)){var d=u[p],y=_(d,t[s]);void 0===y?o.push.apply(o,m(d)):d.value===y.value||d.lookupCode&&d.lookupCode===y.lookupCode?d.ignored!==y.ignored&&o.push.apply(o,b(y)):null==y.value||""===y.value?o.push.apply(o,m(d)):"Nested"===g(d)?d.ignored!==y.ignored&&(0,l.equals)(d.value,y.value)?o.push.apply(o,b(y)):o=o.concat(IE(d.value,y.value,r)):"Reference"===g(d)?wE(d,y)?o.push.apply(o,IE(d.value,y.value,r)):(o.push.apply(o,m(d)),o.push(O([y]))):""!==y.value&&(!1===y.ov?o.push.apply(o,(void 0,void 0,i=(n=y).uri.lastIndexOf("/"),a=n.uri.substr(0,i),[{type:"_UPDATE_NON_OV_ATTRIBUTE",uri:n.uri,typeUri:a,value:n.lookupCode||n.value}])):o.push.apply(o,h(y)))}}for(var f in t)if(t.hasOwnProperty(f)){if("paging"===f)continue;var T=(t[f]||[]).filter((function(t){return void 0===_(t,e[f])}));(T=E((0,l.clone)(T))).length&&o.push(O(T))}return o;function E(e){return e?e.map((function(e){var t;if(e){var r=e.value;return null!=r&&(ue(r)?Object.keys(r).forEach((function(e){var n=E(r[e]);n.length>0?r[e]=n:delete r[e],t||(t=0!==n.length)})):t=null!=r&&""!==r),t||e.lookupCode||e.refEntity?e:null}})).filter((function(e){return null!=e})):[]}function m(e){return[{type:"DELETE_ATTRIBUTE",uri:e.uri}]}function h(e){return[{type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:{value:e.lookupCode||e.value}}]}function b(e){return e&&(e.ignored?function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}]}(e):function(e){return[{type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!1}}]}(e))}function O(e){var t=e[0].uri,n=t.lastIndexOf("/"),i={type:"INSERT_ATTRIBUTE",uri:t=t.substr(0,n),newValue:e.map((function(e){var t,n={value:JSON.parse(JSON.stringify(e.lookupCode||e.value))};return r&&(n.uri=e.uri),v(n.value),e.refEntity&&(t=e.refEntity,Array.isArray(t)&&(t=t[0]),n.refEntity=t),e.refRelation&&(t=e.refRelation,Array.isArray(t)&&(t=t[0]),r||delete t.objectURI,n.refRelation=t),n}))};return i}function v(e){if(null!==e&&"[object Object]"===e.toString())for(var t in e)e.hasOwnProperty(t)&&"paging"!==t&&e[t].forEach((function(e){delete e.crosswalks,delete e.type,r||delete e.uri,v(e.value)}))}function g(e){var t=e.value;if(ue(t))return e.hasOwnProperty("refEntity")?"Reference":"Nested"}function _(e,t){if(void 0!==t)return t.filter((function(t){return t.uri===e.uri}))[0]}}function UE(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)||RE(r)&&RE(n)&&r.uri===n.uri||i.push({type:"UPDATE_PROFILE_PIC_BY_URL",newValue:{value:t.defaultProfilePicValue}}),i}function CE(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 LE(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var n="configuration/sources/Reltio",i="configuration/sources/ReltioCleanser";function a(e,t){return e.crosswalk={type:t.type,value:t.value},e}function o(e,t){return e.reduce((function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e}),{})}function s(e){return e.removeIt=!0}var l=e.map((function(e){if(e.crosswalk)return[e];var o=DE(t,e.uri),s=o.filter((function(e){return e.type===n})),l=o.filter((function(e){return e.type!==n})),u=[];switch(e.type){case"INSERT_ATTRIBUTE":u.push(e);break;case"_UPDATE_NON_OV_ATTRIBUTE":u=u.concat(o.map((function(t){return a(e,t)})));break;case"DELETE_ATTRIBUTE":(l.length||0==s.length)&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}}),u=u.concat(s.map((function(t){return a({type:"DELETE_ATTRIBUTE",uri:e.uri},t)})));break;case"UPDATE_ATTRIBUTE":{const o=l.some((e=>{let{type:t}=e;return t===i}))&&r?jE(r,t,e.uri):null;if(o||s.length){if(s.length)u=u.concat(s.map((function(t){return a({type:"UPDATE_ATTRIBUTE",uri:e.uri,newValue:e.newValue},t)})));else if(o){var c=DE(t,o.uri).filter((e=>{let{type:t}=e;return t===n}));u=u.concat(c.map((t=>a({type:"UPDATE_ATTRIBUTE",uri:o.uri,newValue:e.newValue},t))))}}else u.push({type:"INSERT_ATTRIBUTE",uri:e.uri.substr(0,e.uri.lastIndexOf("/")),newValue:[e.newValue],insteadOfUpdate:!0});l.length&&u.push({type:"IGNORE_ATTRIBUTE",uri:e.uri,newValue:{value:!0}});break}}return u})),u=[].concat.apply([],l),c=o(u,"typeUri");for(var p in c)if("undefined"!==p){var d=c[p],y=u.filter((function(e){return"_UPDATE_NON_OV_ATTRIBUTE"!==e.type})).filter((function(e){return e.uri.substr(0,e.uri.lastIndexOf("/"))===p||"INSERT_ATTRIBUTE"===e.type&&e.uri===p})),f=d.filter((function(e){return e.crosswalk&&e.crosswalk.type===n}))[0],T=y.filter((function(e){return"UPDATE_ATTRIBUTE"===e.type}))[0];!T&&f&&(u.push({type:"UPDATE_ATTRIBUTE",uri:f.uri,newValue:{value:f.value},crosswalk:f.crosswalk}),y.forEach(s)),d.forEach(s)}return(u=u.filter((function(e){return!e.removeIt}))).forEach((function(e){delete e.insteadOfUpdate})),u}const DE=(e,t)=>e.filter((function(e){return 1===(e.attributes||e.attributeURIs||[]).filter((function(e){return e===t})).length})),jE=(e,t,r)=>(0,l.pipe)(Is,(0,l.defaultTo)([]),(0,l.reject)((0,l.propEq)("uri",r)),(0,l.ifElse)((0,l.allPass)([e=>1===e.length,e=>{let[r]=e;return OE(t,r)},e=>{let[t]=e;return!ts(t)}]),(0,l.prop)(0),(0,l.always)(null)))(e,r);function kE(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 FE(e,t){return SE("UPDATE_TAGS").call(this,e,t)}function ME(e,t){return SE("UPDATE_ROLES").call(this,e,t)}function xE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$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}var VE=function(e){var t=function(e,r,n,i){if(e&&r)if(n||(n=null),i=!!i,Array.isArray(e))for(var a=0;a<e.length;a++)r.call(n,a,e[a],e),i&&t(e[a],r,n,i);else if(ue(e))for(var o in e)r.call(n,o,e[o],e),i&&t(e[o],r,n,i)},r=function(e,t,r){return function(n){var i=-1!==n.uri.lastIndexOf("/")?n.uri.substring(0,n.uri.lastIndexOf("/")):"";e[i]||(e[i]=[]),e[i].push(n.type),t[n.uri]=n.type,"IGNORE_ATTRIBUTE"===n.type&&r.push(n.uri)}},n=function(e,t,r){var n=[],i=Object.keys(e).filter((function(t){return-1!==e[t].indexOf("IGNORE_ATTRIBUTE")&&-1!==e[t].indexOf("INSERT_ATTRIBUTE")}));return Object.keys(t).filter((function(e){var t=-1!==e.lastIndexOf("/")?e.substring(0,e.lastIndexOf("/")):null;return-1!==i.indexOf(t)})).forEach((function(e){-1!==r.indexOf(e)&&n.push(e),t[e]="UPDATE_ATTRIBUTE"})),{appearance:t,ignored:n}},i=function(e,t){var r=Array.isArray(t),n=r?[]:{};return r?(e=e||[]).some((function(e){return e.uri}))?n=function(e,t){var r=e.map((function(e){return e.uri})),n=e.map((function(e){var r,n,a=(n=t.filter((function(t){return t.uri===e.uri}))[0]||{},(r=e)&&n&&r.ignored!==n.ignored&&(delete r.ignored,delete n.ignored,r.ov=!0,n.ov=!0),{a:r,b:n});return i(a.a,a.b)})),a=t.filter((function(e){return-1===r.indexOf(e.uri)}));return n.concat(a)}(e,t):(n=n.concat(e),t.forEach((function(t,r){void 0===n[r]?n[r]=t:ue(t)?n[r]=i(e[r],t):-1===e.indexOf(t)&&n.push(t)}))):(ue(e)&&Object.keys(e).forEach((function(t){n[t]=e[t]})),Object.keys(t).forEach((function(r){ue(t[r])&&e[r]?n[r]=i(e[r],t[r]):n[r]=t[r]}))),n},a=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var s=JSON.parse(JSON.stringify(a)),l=JSON.parse(JSON.stringify(o)),u=i(a,o),c={},p={},d=[],y=r(p,c,d);e.compareAttributes(u,l).map((function(e){return"IGNORE_ATTRIBUTE"===e.type&&!1===e.newValue.value&&(e.type="UNDO_IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)})),e.compareAttributes(u,s).map((function(e){return"DELETE_ATTRIBUTE"===e.type&&(e.type="INSERT_ATTRIBUTE"),"IGNORE_ATTRIBUTE"===e.type&&(e.type=e.newValue.value?"UNDO_IGNORE_ATTRIBUTE":"IGNORE_ATTRIBUTE"),e})).forEach((function(e){y(e)}));var f=n(p,c,d);return t(u,(function(e,t){t&&-1!==this.indexOf(t.uri)&&(t.ignored=!0,delete t.ov,t.hidden=!0)}),f.ignored,!0),{attributes:u,appearance:f.appearance}};const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,l.difference)(t,e),n=(0,l.difference)(e,t),i=n.concat(t),a=(e,t)=>(0,l.pipe)((0,l.map)((t=>[t,e])),l.fromPairs)(t),o=xE({},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:xE({},n,{roles:s,tags:u}),roles:i,tags:l}}}};const GE=(0,l.pipe)(l.values,l.flatten,(0,l.reduce)(((e,t)=>{const r=[t.uri,...(0,l.is)(Object,t.value)?GE(t.value):[]];return e.concat(r)}),[])),WE=(e,t)=>t>e?`${t}-${e}`:`${e}-${t}`,YE=e=>{const t=[...GE((null==e?void 0:e.attributes)||[]),...GE((null==e?void 0:e.analyticsAttributes)||[])];return e?[md(e),...t]:[]},BE=(e,t)=>[e,...t.map((t=>WE(e,t)))],qE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{let{relation:t}=e;return UT(t)}))},HE=(e,t)=>{switch(e){case ge.ENTITY:return(e=>{let{entityUri:t}=e;return[t]})(t);case ge.ENTITY_ATTRIBUTE:case ge.RELATION_ATTRIBUTE:return(e=>{let{uri:t}=e;return[It(t)]})(t);case ge.POTENTIAL_MATCH:return(e=>{let{entityUri:t,matchEntityUri:r}=e;return[t,r]})(t);case ge.RELATION:return(e=>{let{entityUri:t,connection:{relation:{relationType:r},entity:{entityUri:n,dataTenant:i}}}=e;return[t,md({uri:n,dataTenant:i}),r]})(t)}},QE=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),KE=(0,l.curry)(((e,t)=>{const r=yo(e,t),n=(0,l.pipe)((0,l.prop)("memberTypes"),(0,l.chain)((0,l.prop)("name")))(r);return r.extendsTypeURI?n.concat(KE(e,r.extendsTypeURI)):n})),JE=(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))),XE=(e,t)=>(0,l.pipe)((0,l.prop)("type"),KE(e),JE(t))(t);function zE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZE=e=>{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}},em=e=>!e.deactivated,tm=e=>{let{attributeTypeUri:t,uri:r,parentUri:n}=e;return`${t}-${r}-${n}`},rm=e=>tm(e)+e.message,nm=(0,l.unless)(l.isNil,(0,l.prop)("message")),im=(0,l.unless)(l.isNil,(0,l.prop)("type")),am=(0,l.curry)(((e,t)=>_t(t.parentUri,e))),om=(0,l.curry)(((e,t)=>t.parentUri===e)),sm=(0,l.curry)(((e,t)=>(0,l.cond)([[(0,l.pipe)((0,l.prop)("uri"),_t(t.attributeTypeUri)),l.T],[(0,l.both)((0,l.propEq)("type",Xe.TYPE_REFERENCE),(0,l.pipe)(rt,(0,l.any)(_t(t.attributeTypeUri)))),l.T],[l.T,l.F]])(e))),lm=(0,l.curry)(((e,t)=>t.attributeTypeUri===e)),um=(0,l.curry)(((e,t,r)=>e===r.parentUri&&t!==r.attributeTypeUri)),cm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,l.filter)((0,l.allPass)([hm,em,am(e),sm(t),(0,l.complement)(um(e,t.uri))]))(r)},pm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=(0,l.find)((0,l.allPass)([hm,em,om(e),lm(t.uri),(0,l.complement)((0,l.prop)("uri")),(0,l.complement)((0,l.propEq)("type",me.missed))]))(r);return n&&n.message||""},dm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const{uri:i}=e,a=(0,l.find)((0,l.propEq)("uri",i))(n);return a||0!==t?a:n.find((e=>e.attributeTypeUri===r&&e.type===me.missed))},ym=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([em,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(kT(),e))]))(t)},fm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([em,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",e.uri)]))(t)},Tm=function(e){let{uri:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.any)((0,l.allPass)([em,am(t)]))(r)},Em=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,l.find)((0,l.allPass)([em,(0,l.propEq)("type",me.missedRefEntity),(0,l.propEq)("parentUri",(0,l.path)(["relation","uri"],e))]))(t)},mm=(e,t)=>{const{entitiesMap:r,metadata:n}=e,i=t?fE(e,t):null;return i&&i.map((e=>{const t=((e,t)=>{let{entitiesMap:r,metadata:n}=e;const{type:i,valueType:a,value:o}=t;switch(i){case ve.attributeValue:{const e=a;if(Ht(a))return Xp(o,e.dataLabelPattern);if(Qt(a)){const t=o,i=ps(t),a=et(e),s=Ir(n,a);return Tt(i)?Xp(r[i],s.dataLabelPattern):t.label}return""}case ve.tempEntity:return Xp(o,a.dataLabelPattern);case ve.relationConnection:{const{entity:e,relation:t}=o,i=null==e?void 0:e.entityUri,a=Ir(n,null==e?void 0:e.entityType);return`${Zp(i&&Tt(i)?Xp(r[i],null==a?void 0:a.dataLabelPattern):null==e?void 0:e.entityLabel)}, ${(null==t?void 0:t.relationLabel)||ui(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){zE(e,t,r[t])}))}return e}({},e,{label:Zp(t)})}))},hm=e=>!e.severity||e.severity===be.ERROR,bm=(0,l.curry)(((e,t)=>{let r=t.value;switch(e.type){case Xe.TYPE_NESTED:return Object.keys(r).some((t=>{const n=e.attributes.find((0,l.propEq)("name",t));return r[t].some(bm(n))}));case Xe.TYPE_REFERENCE:return!!is(t);case Xe.TYPE_BOOLEAN:return!0===r||!1===r||"true"===r||"false"===r;default:return"string"==typeof r&&(r=r.trim()),null!=r&&""!==r}})),Om=(e,t)=>e.every((0,l.complement)(bm(t))),vm=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.identity;const n=mo(e,t.type||t.relationType,!0).filter(r);return n.reduce(((r,n)=>{const i=Es(e,t,n.uri,!0);return i&&i.filter((e=>!(e.parent&&(e.parent.ignored||!ts(e.parent))))).forEach((e=>{Om(e.attrValues,n)&&r.push(ZE({type:me.missed,uri:"",attributeType:n,attributeTypeUri:n.uri,parentUri:e.parent.uri,message:en().text("Attribute is required"),source:he.local}))})),r}),[])},gm=(0,l.curry)(((e,t,r)=>Es(e,t,r,!1))),_m=(e,t)=>{const r=(0,l.pipe)((0,l.prop)("type"),Ir(e),(0,l.prop)("attributes"),(0,l.defaultTo)([]),(0,l.reject)(Bt),(0,l.filter)(Qt),(0,l.map)((0,l.prop)("uri")),(0,l.chain)(gm(e,t)));return(0,l.pipe)(r,(0,l.reject)(ps),(0,l.map)((e=>{let{uri:r}=e;return ZE({type:me.missedRefEntity,uri:"",attributeTypeUri:wt(r,t.type),parentUri:r,message:en().text("Entity is required"),source:he.local})})))(t)},Am=(e,t,r)=>Object.values(r.attributes||{}).flat().filter((0,l.has)("refEntity")).filter((0,l.pipe)(ps,Tt)).flatMap((n=>{const i=ps(n),a=t[i],o=nr(e,wt(n.uri,r.type));return Nm(e,t,o,a)})),Nm=(e,t,r,n)=>{const i=rt(r),a=i.map((t=>nr(e,t))).filter((0,l.both)(l.identity,(0,l.propEq)("type",Xe.TYPE_REFERENCE))).flatMap(it).concat(i);return Pm(e,t,n,(e=>a.some(_t(e.uri))))},Pm=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.identity;const i=vm(e,r,n),a=_m(e,r),o=Am(e,t,r);return[...i,...a,...o]},Rm=(e,t)=>{const r=(0,l.path)(MT(),t)||{};return vm(e,r)},Sm=(e,t,r)=>{t=t||{};const n=(0,l.pipe)((0,l.path)(VT()),(0,l.ifElse)(Tt,(e=>t[e]),(0,l.always)(null)))(r),i=Rm(e,r),a=(e=>(0,l.path)(VT(),e)?[]:[ZE({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(FT(),e),parentUri:(0,l.path)(kT(),e),message:en().text("Entity is required"),source:he.local})])(r),o=((e,t,r)=>r?Pm(e,t,r):[])(e,t,n);return[...i,...a,...o]},wm=e=>(0,l.path)(["entity","uri"],e)?[]:[ZE({type:me.missedRefEntity,uri:"",attributeTypeUri:(0,l.path)(["relation","type"],e),parentUri:(0,l.path)(["relation","uri"],e),message:en().text("Entity is required"),source:he.local})],Im=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{relation:r}=t,n=vm(e,r),i=wm(t);return[...n,...i]};function Um(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cm=(e,t)=>{var r,n;const i=Ir(e,t);return i.forceValidate||!(null==i||null===(r=i.lifecycleActions)||void 0===r||null===(n=r.validate)||void 0===n||!n.length)||Ga(e)},Lm=e=>(0,l.evolve)({uri:e,refEntity:{objectURI:e},refRelation:{objectURI:e}}),Dm=e=>{const t=r=>(0,l.ifElse)(Array.isArray,(0,l.map)(t),(0,l.pipe)(Lm(e),(0,l.evolve)({value:(0,l.when)((0,l.is)(Object),(0,l.map)(t))})))(r);return t},jm=(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)(ds,Tt,l.not)]),(e=>{const t=(0,l.pipe)(ds,Nt)(e);return Dm((e=>e.replace(t,t+ct)))(e)})),(0,l.when)((0,l.pipe)(ps,Tt),(t=>{const r=ps(t),n=e[r],i=n&&Fm(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){Um(e,t,r[t])}))}return e}({},e,i.attributes)})(t):t})))),km=(e,t,r)=>LE(IE((0,l.clone)(e.attributes),(0,l.clone)(t.attributes),!0),kE((0,l.clone)(t.attributes),(0,l.clone)(t.crosswalks)),e).map((e=>(0,l.evolve)({newValue:(0,l.when)(Array.isArray,(0,l.pipe)((0,l.filter)((e=>!e.refRelation||e.refEntity)),(0,l.map)(jm(r,e.type)),(0,l.map)(Dm(jt))))})(e))).concat(Hf(e,t)),Fm=(e,t)=>(0,l.evolve)({attributes:pl({valueTransformer:(0,l.pipe)(Ts,jm(t),Lm(jt)),deleteEmptyComplex:!0}),uri:jt})(e);function Mm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xm(e,t,r[t])}))}return e}function xm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $m=(0,l.unless)(l.isNil,(e=>e.replace(new RegExp(ut,"g"),"uri$$$$").replace(new RegExp(ct,"g"),""))),Vm=e=>(0,l.pipe)((0,l.evolve)({objectUri:$m,objectParentUri:$m}),(e=>{return Mm({type:(t=e.errorType,"MISSED"===(t=(t||"").toUpperCase())?me.missed:me.invalid),attributeTypeUri:e.objectTypeUri,parentUri:e.objectParentUri||e.objectUri&&Dt(e.objectUri),uri:e.objectUri,source:he.validationService},(0,l.pick)(["message","severity"],e));var t}))(e),Gm=(e,t)=>(0,l.map)((0,l.pipe)(Vm,(e=>{var r,n,i,a;const{metadata:o}=t,{uri:s,parentUri:u}=e,c=mm(t,s),p=null!=c&&c.length?c.slice(0,-1):mm(t,u),d=((e,t,r)=>{let{uri:n,attributeTypeUri:i}=r,a=i&&nr(e,i);if(!a&&n&&t&&t.length){const e=(0,l.last)(t);e.type===ve.attributeValue&&(a=e.valueType)}return a})(o,c,e);return Mm({},e,{attributeType:d,attributeTypeUri:null==d?void 0:d.uri,uri:c&&(null===(r=(0,l.last)(c))||void 0===r||null===(n=r.value)||void 0===n?void 0:n.uri)||s,parentUri:p&&(null===(i=(0,l.last)(p))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.uri)||u,path:s?c:p})}),(e=>{let{entitiesMap:t,metadata:r}=e;return e=>{const{uri:n,parentUri:i,path:a,attributeTypeUri:o}=e;if(!n&&null!=a&&a.length&&i&&Lt(i)){const n=(0,l.last)(a),i=n.valueType;if(Qt(i)&&at(i).includes(o)){const i=ps(n.value),o=i&&Tt(i)?t[i]:null;return o?Mm({},e,{parentUri:o.uri,path:a.concat({type:ve.tempEntity,value:o,valueType:Ir(r,o.type),label:""})}):e}}return e}})(t)))(e),Wm=e=>{const t=r=>r.reduce(((r,n)=>Math.max(r,(t=>106+16*(t.level||0)+6.5*t.item[e].length)(n),t(n.items?n.items.flat(1/0):[]))),0);return t};var Ym,Bm=r(33164);function qm(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.Random0="random0",e.Random1="random1",e.SpectreYellowCyan="spectreYellowCyan",e.SpectreBlueBrown="spectreBlueBrown",e.Charts="charts",e.Crosswalks="crosswalks"}(Ym||(Ym={}));const Hm={},Qm={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"]}},Km=(0,l.curry)(((e,t)=>{const r=(e=>{if(!Hm[e]){const t=Qm[e]||Qm.random0;Hm[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){qm(e,t,r[t])}))}return e}({counter:0,granularityCounter:0,idToColor:{}},t)}return Hm[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]})),Jm=e=>Km(Ym.Charts,e),Xm=e=>Km(Ym.Random1,e),zm=e=>(0,Bm.getColor)(e)?"#FFFFFF":"#212121";var Zm=r(51404),eh=r.n(Zm);const th=Array.from({length:100},((e,t)=>t/100)),rh=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)},nh={},ih=new(eh())({hash:rh,saturation:th.slice(15,71),lightness:th.slice(50,90)}),ah=(0,l.curry)(((e,t,r)=>{t in nh||(nh[t]={});const n=nh[t];r in n||(n[r]=((e,t)=>{const r=String(rh(t));return e.hsl(r)})(e,r));const[i,a,o]=n[r];return`hsl(${i}, ${100*a}%, ${100*o}%)`})),oh=ah(ih,"crosswalks"),sh=ah(ih,"sources"),lh=ah(ih,"contributors"),uh=ah(ih,"dataValidationFunctions");function ch(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ph(e,t,r[t])}))}return e}function ph(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dh=(0,l.has)("items"),yh=e=>0===e,fh=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)},Th=e=>e.reduce(((e,t)=>e+t.width),0),Eh=e=>e.reduce(((e,t)=>Math.max(e,t.height)),0),mh=e=>e.reduce(((e,t)=>Math.max(e,t.width)),0),hh=e=>e.reduce(((e,t)=>e+t.height),0),bh=e=>(0,l.is)(String,e)&&e.includes("%"),Oh=e=>Boolean(e.spacer),vh=(e,t)=>Math.max(Math.floor(parseFloat(t)/100*e),1),gh=e=>((null==e?void 0:e.items)||[]).reduce(((e,t)=>e.concat(dh(t)?gh(t):t)),[]),_h=e=>({id:e.layout}),Ah=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_h;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=bh(r.width)?vh(i,r.width):u}return fh(o,(0,l.prop)("minWidth",n),(0,l.prop)("maxWidth",n))},a=e=>{let{minHeight:t,maxHeight:r,height:n=1}=e;return fh(n,t,r)},o=(e,t)=>dh(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,dh(s)?n(s.layout):e(s.view)),d=yh(u)?t.x:(0,l.last)(o).x+(0,l.propOr)(c,"width",(0,l.last)(o));if(dh(s))return o.concat(p(ch({},t,{x:d,width:c}),s));{const r=e(s.view);return o.push(ch({y:t.y,x:d,height:a(r),width:c},r)),o}}),[]);return{x:t.x,y:t.y,width:Th(o),height:Eh(o),items:o}},u=(t,r)=>{const i=r.items.reduce(((r,i,o)=>{const s=dh(i)?n(i.layout):e(i.view),u=t.width,c=a(s),d=yh(o)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||c);if(dh(i))return r.concat(p(ch({},t,{y:d,width:u}),i));{const n=e(i.view);return r.push(ch({},n,{y:d,x:t.x,height:c,width:u,minWidth:(0,l.is)(Number,n.minWidth)?fh(n.minWidth,n.minWidth,u):void 0,maxWidth:(0,l.is)(Number,n.maxWidth)?fh(n.maxWidth,n.maxWidth,u):void 0})),r}}),[]);return{x:t.x,y:t.y,width:mh(i),height:hh(i),items:i}},c=(t,r)=>{const n=(t,r,n,i)=>{const o=e(n),s=t.width,u=a(o),c=yh(i)?t.y:(0,l.last)(r).y+((0,l.last)(r).height||u);return ch({},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=ch({},e,{width:a}),s=ch({},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(ch({},e,{height:d,items:(0,l.filter)(l.identity,[u,c])}))}return t}),[]);return ch({},e,{height:hh(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(ch({},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 ch({},t,{height:d,items:(0,l.reject)(y,[o,c,p])})},p=(e,t)=>{const r=ch({},t,{items:(0,l.reject)(Oh,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 gh(f)},Nh=(e,t)=>(e||[]).filter((e=>t.some((t=>t.id===e.id)))),Ph=[Ge.FilteredEntitiesViewFacet,Ge.ActivitiesViewFacet,Ge.ProfileStatsFacet,Ge.FilteredSavedSearchesFacet],Rh=(e,t)=>e.map((e=>{let{height:r=0,minHeight:n=0}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["height","minHeight"]);const a=t.find((e=>e.id===i.id)),o=Ph.includes(a.component)?8:4;return ch({},i,{height:Math.max(r,o),minHeight:Math.max(n,o)})}));function Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wh(e,t,r[t])}))}return e}function wh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ih={BarChart:Ve.BAR,BarChartGrouped:Ve.BAR,BarChartHorizontal:Ve.BAR,LineChart:Ve.LINE,Map:Ve.MAP,Pie:Ve.PIE},Uh=(e,t)=>Ut(e)?Rt(e,t):e,Ch=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{chartId:r,geoIdName:n,showLegend:i}=t,a=Ih[r];return Sh({},a?{chartType:a}:{},{showLegend:i,isHorizontal:"BarChartHorizontal"===r||void 0,geoIdName:n})},Lh=e=>{if(!e)return;const t=Array.isArray(e)?e[0]:e,{findShared:r}=t;return Sh({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"]))},Dh=(e,t,r)=>{const n=(e=>e&&ne(e).map((e=>{const{type:t,value:r}=e;return Sh({},e,{value:[Vr,Gr,Mr.HAS_ALL].includes(t)&&"string"==typeof r?r.split(","):r})})).map((e=>{let{type:t,attribute:r,value:n}=e;return{filter:Yr(t),fieldName:r,values:n?ne(n):void 0}})))(e);return t&&Ut(t)||!r?n:(n||[]).concat((i=r,{filter:Mr.EQUALS,fieldName:"type",values:[i]}));var i},jh=["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"],kh={"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:Uh(n,r),filters:Dh(a,n,r),chartType:Ve.BAR,component:Ge.DashboardFacet,title:i}},"com.reltio.plugins.dashboard.BubbleChartView":e=>{let{id:t,entity:r,attribute:n,caption:i,filter:a,count:o,orderType:s,canRead:l}=e;return{id:t,count:o,canRead:l,orderType:s,attributeUri:Uh(n,r),filters:Dh(a,n,r),chartType:Ve.BUBBLE,component:Ge.DashboardFacet,title:i}},"com.reltio.plugins.ui.CustomActionView":e=>{let{id:t,caption:r,canRead:n,url:i}=e;return{id:t,url:i,canRead:n,title:r,component:Ge.CustomActionViewFacet}},"com.reltio.plugins.dashboard.FacetChartView":e=>{let{id:t,firstDimension:r,useEntityType:n,caption:i,filter:a,count:o,orderType:s,options:l,canRead:u}=e;const c=ne(a).find((e=>"type"===(null==e?void 0:e.attribute))),p=n||(null==c?void 0:c.value);return Sh({id:t,count:o,canRead:u,orderType:s,attributeUri:Uh(r,p),filters:Dh(a,r,p),component:Ge.DashboardFacet,title:i,showOthers:!0},Ch(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:Uh(n,r),filters:Dh(a,n,r),chartType:Ve.MAP,component:Ge.DashboardFacet,title:i,geoUrl:jh[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 Sh({id:t,count:o,canRead:l,attributeUri:Uh(n,r),filters:Dh(a,n,r),component:Ge.DashboardFacet,title:i,geoUrl:s,chartType:Ve.MAP,projection:"geoMercator"},Ch(u))},"com.reltio.plugins.dashboard.ProfileStatsView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ProfileStatsFacet,title:n}},"com.reltio.plugins.dashboard.FilteredSavedSearchesView":e=>{let{id:t,caption:r,max:n,options:i,canRead:a}=e;return{id:t,canRead:a,options:Lh(i),component:Ge.FilteredSavedSearchesFacet,title:r,max:n}},"com.reltio.plugins.dashboard.FilteredEntitiesView":e=>{let{id:t,caption:r,filter:n,max:i,entity:a,canRead:o}=e;return{id:t,canRead:o,filters:Dh(n,null,a),component:Ge.FilteredEntitiesViewFacet,title:r,max:i}},"com.reltio.plugins.dashboard.MatchedEntitiesView":e=>{let{id:t,caption:r,max:n,canRead:i}=e;return{id:t,canRead:i,filters:[{filter:Mr.GTE,fieldName:"matches",values:["1"]}],component:Ge.FilteredEntitiesViewFacet,title:r,max:n}},"com.reltio.plugins.dashboard.EntitiesByTypeView":e=>{let{id:t,caption:r,orderType:n="reversedCount",inheritChildren:i,hideEmpty:a,canRead:o}=e;return{id:t,canRead:o,component:Ge.EntitiesByTypeViewFacet,orderType:n,inheritChildren:i,hideEmpty:a,title:r}},"com.reltio.plugins.dashboard.EntitiesByTagView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ve.CLOUD,component:Ge.DashboardFacet,attributeUri:"tags"}},"com.reltio.plugins.dashboard.EntitiesByRoleView":e=>{let{id:t,caption:r,orderType:n,canRead:i}=e;return{id:t,canRead:i,orderType:n,title:r,chartType:Ve.TREE,component:Ge.DashboardFacet,attributeUri:"roles"}},"com.reltio.plugins.inbox.NotificationInboxView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.NotificationInboxFacet,title:n||en().text("Notifications")}},"com.reltio.plugins.activities.ActivitiesView":e=>{let{id:t,canRead:r,caption:n}=e;return{id:t,canRead:r,component:Ge.ActivitiesViewFacet,title:n||en().text("Activity log")}}},Fh=e=>({id:e,height:10}),Mh=(0,l.pipe)((0,l.map)((e=>{const t=kh[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),xh=e=>{if("0.1"===e.version){const t=Mh(e.views),r=Ah(Fh,e.layout,{columns:4});return{id:e.id,margin:0,layout:Nh(r,t),views:t}}return e},$h=e=>(0,l.cond)([[(0,l.propEq)("layout","profile"),(0,l.pipe)((0,l.pick)(["center","right","top"]),l.values,l.flatten,(0,l.map)((0,l.when)((0,l.is)(Object),l.values)),l.flatten)],[(0,l.has)("view"),(0,l.pipe)((0,l.prop)("view"),ne)],[(0,l.prop)("items"),(0,l.pipe)((0,l.prop)("items"),(0,l.map)((e=>$h(e))),l.flatten)],[l.T,(0,l.always)([])]])(e);function Vh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gh(e,t,r[t])}))}return e}function Gh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wh=Vh({},We,{OldMapView:"com.reltio.plugins.entity.EntityMapView",OldTreeView:"com.reltio.plugins.entity.TreeView"}),Yh=e=>e,Bh={[Wh.Attributes]:Yh,[Wh.HierarchyTree]:Yh,[Wh.HierarchyPaths]:Yh,[Wh.RelationsTable]:Yh,[Wh.Relations]:e=>Vh({},(0,l.omit)(["recordClass"],e),{isComplex:"com.reltio.plugins.entity.relations.ComplexRelationRecord"===e.recordClass}),[Wh.SingleAttributeView]:Yh,[Wh.CustomView]:Yh,[Wh.TableAttributeView]:Yh,[Wh.MapView]:Yh,[Wh.OldTreeView]:e=>Vh({},e,{class:We.HierarchyTree}),[Wh.OldMapView]:e=>Vh({},e,{class:We.MapView}),[Wh.ImageAttributeView]:Yh,[Wh.PotentialMatchesView]:Yh},qh=(0,l.pipe)((0,l.map)((e=>{const t=Bh[null==e?void 0:e.class];return t?t(e):null})),(0,l.reject)(l.isNil)),Hh=(0,l.curry)(((e,t)=>(0,l.pipe)((0,l.defaultTo)([]),(0,l.find)((0,l.propEq)("id",t)),(0,l.prop)("class"))(e)===We.MapView?{id:t,height:5,minHeight:5}:{id:t,autosizing:!0})),Qh=e=>{const t=(0,l.pick)(["id","workflow","maxWidth","sidePanelViews","profileBand","views"],e);if("2.0"===e.version)return Vh({},t,{layout:e.newLayout});if("0.1"===e.version){const r=qh(e.views),n=Ah(Hh(r),e.layout,{columns:4});return Vh({},t,{layout:Nh(n,r),views:r})}return e},Kh=(e,t)=>e.class===t||e["react-class"]===t,Jh=e=>{const{includeUris:t,excludeUris:r}=(e=>e.reduce(((e,t)=>{if(Kh(t,We.Attributes))if(t.includeUris)e.includeUris.push(...t.includeUris);else{const r=t.excludeUris||[];e.excludeUris=e.excludeUris?(0,l.intersection)(e.excludeUris,r):r}return Kh(t,We.SingleAttributeView)&&e.includeUris.push(t.attributeUri),e}),{includeUris:[],excludeUris:null}))(e);return e=>{let{uri:n}=e;return r&&!r.some(_t(n))||t.some(_t(n))}},Xh=(e,t)=>e.filter((e=>t.some((t=>Kh(e,t))))).map((e=>{let{id:t}=e;return t})),zh=(e,t)=>{let{extensions:r}=e;return(r||[]).find((e=>e.id===t))},Zh=(e,t)=>e.flatMap((e=>{let{extensions:r=[]}=e;return r.filter((e=>{let{point:r}=e;return r===t}))})),eb=(e,t)=>(e||[]).find((e=>e.activator===t)),tb=e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.entity.ProfileBand"))),(0,l.reject)(l.isNil),l.head)(e);function rb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(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}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=(e,t)=>$h(t).map((t=>(0,l.pipe)((0,l.map)((e=>zh(e,t))),(0,l.reject)(l.isNil),l.head)(e))),ab=e=>{let{extensions:t=[]}=e;return t.filter((e=>"com.reltio.plugins.ui.perspective"===e.point&&e["entity-type"]))},ob=(e,t)=>{const r=(0,l.propOr)("0.1","version",t),n=t["entity-type"];if("2.0"===r&&t.newLayout){const{newLayout:e}=t;return(0,l.pipe)((0,l.pick)(["views","sidePanelViews","profileBand"]),(0,l.mergeRight)({entityType:n,layout:e}),(0,l.reject)(l.isNil))(t)}const i=ib(e,t.layout),a=((e,t)=>{if(t.side){const r=(0,l.pipe)((0,l.chain)((e=>zh(e,t.side))),(0,l.reject)(l.isNil),l.head)(e);return $h(r.layout||{})}})(e,t),o=Qh(rb({},t,{views:i,version:"0.1"})),s=(0,l.pipe)(tb,(0,l.defaultTo)({}),(0,l.pick)(["cloneAction","showEntityId"]))(e);return(0,l.reject)(l.isNil,{entityType:n,views:o.views,layout:o.layout,sidePanelViews:a,profileBand:s})},sb=(e,t)=>{if("scroll"===t.layout.layout){const r=ib(e,t.layout),n=xh(rb({},t,{views:r,version:"0.1"}));return{class:Be.Dashboard,id:t.id,views:n.views,layout:n.layout}}return{class:Be.Dashboard,views:t.views,layout:t.layout,id:t.id}},lb=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.DQDashboard,id:t.id,viewsByDataLevel:r.viewsByDataLevel,layoutsByDataLevel:r.layoutsByDataLevel}},ub=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.RelationshipSearch,id:t.id,options:r.options,consoleExportApp:r.consoleExportApp}},cb=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.Interactions,id:t.id,sortOrder:r.sortOrder,sortColumn:r.sortColumn,max:r.max,attributes:r.attributes,caption:r.caption}},pb=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.Relationships,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},db=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.Sources,id:t.id,canCreate:r.canCreate,canUpdate:r.canUpdate,canRead:r.canRead,canDelete:r.canDelete,profileBand:r.profileBand}},yb=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.PotentialMatches,id:t.id,availableTabs:r.availableTabs,allowMergeAll:r.allowMergeAll,matchActions:r.matchActions}},fb=(e,t)=>{const r=ib(e,t.layout)[0],n=r.potentialMatchesReview||{processType:(e=>{const[t]=Zh(e,"com.reltio.plugins.search.toolbar.component").filter((e=>"com.reltio.plugins.ui.CustomActionButtonView"===e.class&&e.processType));return null==t?void 0:t.processType})(e)};return{class:Be.Search,id:t.id,consoleExportApp:r.consoleExportApp,mapSearchEnabled:r.mapSearchEnabled,canRead:r.canRead,"bulk-update":r["bulk-update"],potentialMatchesReview:n,options:r.options,"entity-types":r["entity-types"],tabs:r.tabs}},Tb=(e,t)=>({class:Be.Graph,id:t.id}),Eb=(e,t)=>{const r=ib(e,t.layout)[0];return{class:Be.ProfileActivityLog,id:t.id,exportTypes:r.exportTypes,caption:r.caption}},mb=e=>t=>!!(0,l.intersection)(e,t).length,hb=(0,l.cond)([[mb(["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"]),()=>sb],[mb(["com.reltio.plugins.react.ReactDQDashboardView"]),()=>lb],[mb(["com.reltio.plugins.graph.GraphView"]),()=>Tb],[mb(["com.reltio.plugins.react.ReactRelationshipSearchView"]),()=>ub],[mb(["com.reltio.plugins.react.ReactInteractionsView","com.reltio.plugins.interactions.InteractionsView"]),()=>cb],[mb(["com.reltio.plugins.react.ReactRelationshipsView","com.reltio.plugins.relationships.RelationshipsView"]),()=>pb],[mb(["com.reltio.plugins.sources.SourcesView","com.reltio.plugins.react.ReactSourcesView"]),()=>db],[mb(["com.reltio.plugins.sameas.SameAsView","com.reltio.plugins.react.ReactPotentialMatchesView"]),()=>yb],[mb(["com.reltio.plugins.react.ReactSearchView","com.reltio.plugins.search.dev.SearchView"]),()=>fb],[mb(["com.reltio.plugins.activities.ProfileActivitiesView","com.reltio.plugins.react.ReactProfileActivityLog"]),()=>Eb],[l.T,()=>(0,l.always)(void 0)]]),bb=(e,t)=>{const{class:r}=e;if("com.reltio.plugins.entity.ProfileAction"===r)return((e,t)=>{const r=(0,l.pipe)((0,l.chain)(ab),(0,l.map)((t=>ob(e,t))),(0,l.indexBy)((0,l.prop)("entityType")),(0,l.map)((0,l.pick)(["layout","views","sidePanelViews","profileBand"])))(e);return{class:Be.Profile,id:t.id,entityTypes:r}})(t,e);if("com.reltio.plugins.ui.actions.CustomAction"===r)return{id:e.id,type:qe.CustomAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};if("com.reltio.plugins.ui.actions.ConsoleAppAction"===r)return{id:e.id,type:qe.ConsoleAppAction,config:(0,l.omit)(["class","id","point","parent","type"],e)};const n=(e=>{if(e.perspective)return e.perspective})(e);if((0,l.isNil)(n))return;if("com.reltio.plugins.dashboard.DashboardPerspective"===n||"com.reltio.plugins.newDashboard.NewDashboardPerspective"===n){const e=(0,l.find)((0,l.propEq)("id","com.reltio.plugins.newDashboard"))(t);if(e)return(0,l.pipe)((e=>zh(e,"com.reltio.plugins.newDashboard.NewDashboardView")),(0,l.pick)(["id","views","layout"]),(0,l.assoc)("class",Be.Dashboard))(e)}const i=(0,l.pipe)((0,l.map)((e=>zh(e,n))),(0,l.reject)(l.isNil),l.head)(t);if((0,l.isNil)(i))return;if(i.entityPerspectiveId)return((e,t,r)=>{const n=ob(e,r),i=(0,l.pipe)((0,l.propOr)([],"entity-types"),(0,l.map)((e=>[e,n])),l.fromPairs)(t);return{class:Be.NestedProfile,id:t.id,entityTypes:i}})(t,e,i);const a=$h(i.layout),o=(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>a.includes(e.id)))})),(0,l.pluck)("class"),(0,l.reject)(l.isNil))(t);return hb(o)(t,i)};function Ob(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vb(e,t,r[t])}))}return e}function vb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gb=e=>{let{extensions:t}=e;return(t||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&"com.reltio.plugins.ui.first_level_action"===e.type&&!e.parent))},_b="https://reltio-ui-files.s3.amazonaws.com/new-ui/";var Ab;!function(e){e[e.DashboardGroup=0]="DashboardGroup",e[e.ProfileGroup=1]="ProfileGroup",e[e.SearchGroup=2]="SearchGroup"}(Ab||(Ab={}));const Nb={[Be.DQDashboard]:`${_b}DqDashboard.svg`,[Be.Dashboard]:`${_b}Dashboard.svg`,[Be.Graph]:`${_b}Graph.svg`,[Be.RelationshipSearch]:`${_b}GraphSearch.svg`,[Be.Interactions]:`${_b}Interactions.svg`,[Be.PotentialMatches]:`${_b}PotentialMatches.svg`,[Be.Profile]:`${_b}Profile.svg`,[Be.NestedProfile]:`${_b}Profile.svg`,[Be.ProfileActivityLog]:`${_b}ActivityLog.svg`,[Be.Relationships]:`${_b}Relationships.svg`,[Be.Sources]:`${_b}Crosswalk.svg`,[Be.Search]:`${_b}Search.svg`,[Ab.DashboardGroup]:`${_b}DashboardGroup.svg`,[Ab.ProfileGroup]:`${_b}ProfileGroup.svg`,[Ab.SearchGroup]:`${_b}SearchGroup.svg`,DEFAULT:`${_b}Default.svg`},Pb=e=>Nb[null==e?void 0:e.class]||Nb.DEFAULT,Rb=(0,l.pipe)((0,l.pluck)("screen"),(0,l.filter)((0,l.anyPass)([(0,l.propEq)("class",Be.NestedProfile)])),(0,l.groupBy)((0,l.prop)("class")),(0,l.map)((e=>e.map(((e,t)=>Ob({},e,{nestedRoute:`${t+1}`})))))),Sb=(e,t)=>{var r;return(null===(r=e[t.class])||void 0===r?void 0:r.find((0,l.propEq)("id",t.id)))||t},wb=e=>"com.reltio.plugins.entity.ProfileFirstAction"===e.class?Nb[Ab.ProfileGroup]:null,Ib=e=>(0,l.cond)([[(0,l.any)((e=>{let{icon:t}=e;return t===Nb[Be.Dashboard]||t===Nb[Be.DQDashboard]})),(0,l.always)(Nb[Ab.DashboardGroup])],[(0,l.any)((e=>{let{icon:t}=e;return t===Nb[Be.Search]||t===Nb[Be.RelationshipSearch]})),(0,l.always)(Nb[Ab.SearchGroup])],[l.T,()=>null]])(e),Ub=e=>(0,l.pipe)((0,l.chain)(gb),(0,l.sortBy)((0,l.propOr)(1/0,"position")))(e).map((t=>{const r=((e,t)=>{const r=(0,l.pipe)((0,l.chain)((t=>((e,t)=>{let{extensions:r}=e;return(r||[]).filter((e=>"com.reltio.plugins.ui.action"===e.point&&e.parent===t))})(t,e.id))),(0,l.sortBy)((0,l.propOr)(1/0,"position")),(0,l.map)((e=>Ob({},e,{entityTypes:e["entity-types"],screen:bb(e,t)}))),(0,l.filter)((e=>e.screen)))(t),n=Rb(r);return(0,l.map)((e=>{let{label:t,screen:r,canRead:i,entityTypes:a}=e;return{label:t,icon:Pb(r),screen:Sb(n,r),canRead:i,entityTypes:a}}))(r)})(t,e),n=bb(t,e);return{label:t.label,icon:wb(t)||Ib(r)||Pb(n),menu:r.length?{type:"side",items:r}:void 0,screen:n,canRead:t.canRead}}));function Cb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lb=e=>{let{extensions:t}=e;return(t||[]).filter((0,l.propEq)("id","com.reltio.plugins.pivoting.PivotingSettings"))},Db=e=>({id:e,height:10}),jb=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)(Lb),(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=Mh(((e,t)=>{const r=$h(t);return(0,l.pipe)((0,l.chain)((e=>{let{extensions:t}=e;return(t||[]).filter((e=>r.includes(e.id)))})),(0,l.filter)((e=>{let{views:t}=e;return t})),(0,l.map)((e=>{let{views:t,id:r}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cb(e,t,r[t])}))}return e}({id:r},t[0])})),(0,l.uniqBy)((0,l.prop)("id")))(e)})(e,t.layout)),n=Ah(Db,t.layout,{columns:4});return{views:r,layout:Nh(n,r)}}return t})(e,r);return{"attribute-types":n,views:i.views,layout:i.layout}}))};function kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fb=e=>"com.reltio.plugins.dashboard.DashboardPerspective"===e,Mb=e=>(0,l.pipe)((e=>Zh(e,"com.reltio.plugins.ui.custom_script")),(0,l.reject)(E),(0,l.map)((e=>{let{action:t}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kb(e,t,r[t])}))}return e}({},t,function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["action"]))})))(e),xb=(0,l.prop)("showLookupCode"),$b=e=>{var t;const r=(e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.entity.EntityRequestSettings"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("defaultMaxValues"))(e))(e),n=(e=>(0,l.pipe)((0,l.map)((e=>zh(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=>zh(e,"com.reltio.plugins.ui.LookupAutocomplete"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}),(0,l.pick)(["includeAttributes","excludeAttributes"]))(e))(e),a=(e=>(0,l.pipe)((0,l.map)((e=>zh(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=>zh(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=>zh(e,"com.reltio.plugins.ui.LocalizationServer"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"))(e))(e),u=(e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.ui.AttributePresentation"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("configuration"),(0,l.defaultTo)({}),(0,l.filter)((0,l.propEq)("format","none")),(0,l.map)((0,l.always)({thousandSeparator:""})))(e))(e),c=(e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.workflow.configuration"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("enabled"))(e))(e),p=(e=>(0,l.pipe)((e=>eb(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("default-perspective"),(0,l.ifElse)(Fb,(0,l.always)("dashboard"),(0,l.always)("search")))(e))(e),d=Mb(e),y=(e=>(0,l.pipe)((e=>eb(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkUser"))(e))(e),f=(e=>(0,l.pipe)((e=>eb(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("checkIdle"))(e))(e),T=(e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.ui.configuration.FeatureManagement"))),(0,l.reject)(l.isNil),l.head,(0,l.prop)("preferNewUI"),l.not)(e))(e),E=(e=>(0,l.pipe)((0,l.map)((e=>zh(e,"com.reltio.plugins.ui.LookupCodeVisibility"))),(0,l.reject)(l.isNil),l.head,(0,l.defaultTo)({}))(e))(e),m=void 0===(h=xb(E))||h;var h;const b=null===(t=tb(e))||void 0===t?void 0:t.showEntityId,O=(e=>(0,l.pipe)((e=>eb(e,"com.reltio.plugins.ui.Activator")),(0,l.prop)("preview"))(e))(e);return{i18n:s,entity:{requestSettings:{defaultMaxValues:r}},image:{attributeFieldsOrder:n},lookups:{autocomplete:i,showCode:m},validate:{levels:a,validateReadMode:o},attributePresentations:u,workflow:{enabled:c},defaultRoute:p,customScripts:d,checkUser:y,checkIdle:f,showSwitchToClassic:T,showEntityId:b,preview:O}},Vb=e=>({layout:Ub(e),pivoting:jb(e),properties:$b(e)});var Gb=r(58697),Wb=r.n(Gb);function Yb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bb(e,t,r[t])}))}return e}function Bb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qb=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}_${Wb()()}`;return n[e.id].push(t),i=!0,Yb({},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]++,Yb({},e,{id:n[e.id][o[e.id]]})))):r;return i?{views:a,layout:s}:{views:t,layout:r}};function Hb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qb(e,t,r[t])}))}return e}function Qb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Kb={};const Jb=(e,t,r)=>{const n=`\n importScripts("${e}");\n importScripts("${r.action.files.join('","')}");\n postMessage({action:'loaded'});`;let i;const a=X(`${r.id}: ${r.action.files.join('","')}`);if(E(Kb[a])){try{const e=window.webkitURL||window.URL;i=new Worker(e.createObjectURL(new Blob([n],{type:"application/javascript"})))}catch(e){i=new Worker("data:application/javascript,"+encodeURIComponent(n))}Kb=Hb({},Kb,{[a]:Hb({},Kb[a]||{},{worker:i})})}else i=Kb[a].worker,Kb[a].innerText&&t({task:{action:Qe.SET_HTML,params:{html:Kb[a].innerText}},worker:i,config:r}),i.removeEventListener("message",Kb[a].onWorkerMessage);return i&&(Kb[a].onWorkerMessage=e=>{if("loaded"!==e.data.action){const n=JSON.parse(e.data);t({task:n,worker:i,config:r}),"setHtml"!==n.action||n.params.id||(Kb[a].innerText=n.params.html)}},i.addEventListener("message",Kb[a].onWorkerMessage)),i},Xb=(0,l.curry)(((e,t)=>!e||!e.availableEntityTypes||!t||e.availableEntityTypes.includes(t))),zb=(0,l.flip)(Xb),Zb=(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=en().number(t));return t})),eO=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return(0,l.is)(Number,e)?e>t?en().number(e,"0,0.0a").toUpperCase():en().number(e,"0,0"):""},tO=(0,l.ifElse)((0,l.has)("filename"),(0,l.prop)("filename"),(0,l.pipe)((0,l.prop)("link"),(0,l.split)("/"),l.last));let rO=!0;const nO=e=>rO=e,iO=(e,t)=>e!==t&&t?rO&&e?`${t} (${e})`:t:e,aO=(e,t,r)=>(0,l.path)([t,r,"displayName"],e),oO=(e,t,r)=>{const n=aO(e,t,r);return iO(r,n)},sO=(0,l.curry)(((e,t,r)=>(0,l.hasPath)([t,r],e))),lO=(0,l.complement)(sO),uO=e=>(0,l.pipe)((0,l.propOr)({},e),Object.entries,(0,l.map)((e=>{let[t,{displayName:r}]=e;return{lookupCode:t,value:r}}))),cO=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)},pO=(0,l.curry)(((e,t)=>t.map((t=>{let{type:r,codeValues:n}=t;return{type:r,codeValues:n.filter(lO(e,r))}})).filter((e=>{let{codeValues:t}=e;return t.length>0})))),dO=(0,l.curry)(((e,t)=>{let{attributePresentations:r={},dataTypeDefinition:n={},dateMask:i,dateTimeMask:a}=e;const o=r[n.uri],s=i?q(i):"L",u=a?K(a):"L LTS";switch(n.type){case Xe.TYPE_NUMBER:case Xe.TYPE_FLOAT:case Xe.TYPE_DOUBLE:case Xe.TYPE_LONG:case Xe.TYPE_INT:case Xe.TYPE_COUNT:return t&&Zb(o,t);case Xe.TYPE_BOOLEAN:case Xe.TYPE_BOOLEAN_RADIO:case Xe.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t=t,(0,l.isNil)(t)?t:le(t)?en().text("Yes"):en().text("No");case Xe.TYPE_DATE:return(0,l.is)(Number,t)&&(t=A(Number(t)).getTime()),(t=t)&&(Ru(t)?Su(t):en().date(t,s));case Xe.TYPE_ACTIVENESS_DATE:case Xe.TYPE_LOCAL_DATE:return(t=t)&&(Ru(t)?Su(t):en().date(t,s));case Xe.TYPE_TIMESTAMP:return(t=t)&&(Ru(t)?Su(t):en().date(isNaN(t)?t:Number(t),u));case Xe.TYPE_FILE:return(0,l.propOr)(null,"filename",t);case Xe.TYPE_SELECT:{const e=n.options.find((0,l.propEq)("value",t));return(0,l.propOr)(null,"label",e)}case Xe.TYPE_DOLLAR:return t=t,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t);default:return(0,l.is)(Object,t)?iO((0,l.propOr)(null,"lookupCode",t),(0,l.propOr)(null,"value",t)):t}})),yO={palette:{primary:{main:"#0072CE",light:"#0072CE",dark:"#0072CE"},secondary:{main:"#0072CE"},error:{main:"#FF1744"},background:{paper:"#FFF",default:"#FAFAFA"},action:{hover:"rgba(0,0,0,0.04)",hoverOpacity:.04},text:{primary:"rgba(0,0,0,0.87)",secondary:"rgba(0,0,0,0.54)",disabled:"rgba(0,0,0,0.26)"},divider:"rgba(0,0,0,0.38)"},overrides:{MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}},MuiInputBase:{input:{"&::placeholder":{color:"currentColor !important"},"&::-ms-clear":{display:"none"}}}},tooltip:{borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.54)"},inactiveBackground:"repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 14px, #e9e9e9 15px, #e9e9e9 16px)",inactiveSelectedBackground:"repeating-linear-gradient(45deg, #DBE9F4, #DBE9F4 14px, #CCDAE5 15px, #CCDAE5 16px)",inactiveSelectedHoverBackground:"repeating-linear-gradient(45deg, #D4E2ED, #D4E2ED 14px, #C6D4DF 15px, #C6D4DF 16px)",inactiveHoverBackground:"repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #e2e2e2 15px, #e2e2e2 16px)",transitions:{duration:{shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195}},inactive:{opacity:.7},basicView:{boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",borderRadius:"3px",backgroundColor:"#FFFFFF"},suggested:"rgb(237, 246, 251)"},fO=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()}},TO=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})))),EO=e=>{const{onRequest:t,onResponse:r,addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}=(()=>{const e={onRequest:[],onResponse:[]};return{onRequest:t=>{const{url:r,options:n,abort:i}=t,a=e.onRequest.reduce(((e,t)=>(r,n)=>t({url:r,options:n,abort:i,next:e})),t.next);a(r,n)},onResponse:t=>{const{response:r,abort:n,url:i,options:a}=t,o=e.onResponse.reduce(((e,t)=>r=>{r instanceof Response?t({response:r,abort:n,next:e,url:i,options:a}):e(r)}),t.next);o(r)},addRequestInterceptor:t=>{e.onRequest.push(t)},addResponseInterceptor:t=>{e.onResponse.push(t)},removeRequestInterceptor:t=>{const r=e.onRequest.indexOf(t);e.onRequest.splice(r,1)},removeResponseInterceptor:t=>{const r=e.onResponse.indexOf(t);e.onResponse.splice(r,1)}}})(),s=(0,l.pipe)((e=>{let t=null;return r=>(n,i)=>{const a=()=>r(n,i),o=()=>{var e;return null===(e=t)||void 0===e?void 0:e.then(a)};return o()||a().then((r=>401===r.status?(t||(t=e().then((()=>{t=null}))),o()):r))}})(e),fO,TO);return{request:(e,n)=>{const i=s(fetch),a=r?(e,t)=>i(e,t).then((n=>new Promise(((i,a)=>{r({response:n,next:e=>{i(e)},abort:a,url:e,options:t})})))):i;return t?new Promise(((r,i)=>{t({url:e,options:n,next:(e,t)=>{r(a(e,t))},abort:i})})):a(e,n)},addRequestInterceptor:n,addResponseInterceptor:i,removeRequestInterceptor:a,removeResponseInterceptor:o}},mO="__metadata",hO=(e=>{const t=[mO,"draft"];return(0,l.lens)((0,l.pathOr)(null,t),(0,l.assocPath)(t))})(),bO=(0,l.set)(hO),OO=(0,l.view)(hO),vO=bO(Kr.NEW),gO=bO(Kr.REMOVED),_O=bO(Kr.EDITED),AO=bO(Kr.IGNORED),NO=(0,l.pipe)(OO,(0,l.equals)(Kr.REMOVED)),PO=(0,l.pipe)(OO,(0,l.equals)(Kr.NEW)),RO=(0,l.pipe)(OO,(0,l.equals)(Kr.EDITED)),SO=(0,l.pipe)(OO,(0,l.complement)(l.isNil)),wO=(0,l.pipe)(OO,(0,l.equals)(Kr.IGNORED)),IO=(0,l.omit)([mO]),UO=(e,t)=>e===mO?void 0:t;function CO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LO=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=LO(e,n,r);if(i.length>0)return[t].concat(...i)}return[]},DO=(e,t)=>LO((0,l.propEq)("nodeId",t),e),jO=(e,t)=>LO((0,l.pathEq)(["entity","uri"],t),e),kO=(e,t)=>{const r=DO(e,t);return r.length>1?r[r.length-2]:null},FO=(e,t)=>{const r=DO(e,t);return r.length>0?r[r.length-1]:null},MO=(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=>MO(t,{parent:e,childrenProcessing:n,nodeProcessing:i}))))),e},xO=()=>{},$O=(e,t)=>{let{parent:r,nodeProcessing:n=xO}=t;n(e,r),e.children&&e.children.forEach((t=>$O(t,{parent:e,nodeProcessing:n})))},VO=e=>{let{node:t,connection:r,isReversed:n}=e;switch(t.editingMode){case Ue.addingParent:var i,a,o,s;return{entityUri:n?null===(i=r.entity)||void 0===i?void 0:i.uri:null===(a=t.relatedEntity)||void 0===a?void 0:a.uri,relation:r.relation,parentEntityUri:n?null===(o=t.relatedEntity)||void 0===o?void 0:o.uri:null===(s=r.entity)||void 0===s?void 0:s.uri};case Ue.addingChild:var l,u,c,p;return{entityUri:n?null===(l=t.relatedEntity)||void 0===l?void 0:l.uri:null===(u=r.entity)||void 0===u?void 0:u.uri,relation:r.relation,parentEntityUri:n?null===(c=r.entity)||void 0===c?void 0:c.uri:null===(p=t.relatedEntity)||void 0===p?void 0:p.uri};case Ue.editing:{var d,y,f,T;const e={oldRelation:t.relation,newRelation:r.relation,isReversed:n},i=null===(d=r.entity)||void 0===d?void 0:d.uri,a=null===(y=t.relatedEntity)||void 0===y?void 0:y.uri;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){CO(e,t,r[t])}))}return e}({},e,(null===(f=t.entity)||void 0===f?void 0:f.uri)===(null===(T=r.entity)||void 0===T?void 0:T.uri)?{}:{entityUri:i,newEntityUri:a})}}},GO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[];return Object.values(e).forEach((e=>{const r=e.root;r&&$O(r,{nodeProcessing:r=>{const n=(0,l.path)(["editingConnections",(0,l.path)(["relation","uri"],r)],e),i=Boolean(e.isReversed);if(r.editingMode===Ue.addingChild||r.editingMode===Ue.addingParent){const{entityUri:e,relation:a,parentEntityUri:o}=VO({node:r,connection:n,isReversed:i}),s=Zf({parentUri:o,relation:a,entityUri:e});t.push(s)}if(r.editingMode===Ue.editing){const{oldRelation:e,newRelation:a,entityUri:o,newEntityUri:s}=VO({node:r,isReversed:i,connection:n}),l=s?nT({entityUri:o,newEntityUri:s,relation:a,isReversed:i}):rT({oldRelation:e,newRelation:a});t.push(l)}}})})),t},WO=(e,t)=>{if((0,l.path)(["entity","uri"],e)===t)return!0;if(e&&e.children)for(const r of e.children){const e=WO(r,t);if(e)return e}return!1},YO=(0,l.curry)(((e,t)=>{const r=(0,l.map)(YO(e));return(0,l.evolve)({entity:t=>t.uri===e.uri?e:t,children:r},t)})),BO=(e,t)=>{const r=(0,l.pipe)(Object.entries,(0,l.filter)((t=>{let[,r]=t;return r.root&&((e,t)=>WO(t,e.uri))(e,r.root)}))),n=(0,l.map)((t=>{let[r,n]=t;return{id:r,root:YO(e,n.root)}}));return(0,l.pipe)(r,n)(t)},qO={relationTypeLabel:"relationTypeLabel",entityLabel:"entityLabel"},HO={asc:"asc",desc:"desc"},QO=qO.entityLabel,KO=HO.asc,JO=(0,l.always)(0),XO=e=>{let{sortField:t=QO,sortOrder:r=KO,typesLabelsMap:n}=e;return e=>e.slice().sort((e=>{let{sortField:t,sortOrder:r,typesLabelsMap:n}=e;switch(t){case qO.relationTypeLabel:return((e,t)=>(r,n)=>{const i=(0,l.path)(["relation","type"]),a=e[i(r)],o=e[i(n)];return bA.strings.sort(t,a,o)})(n,r);case qO.entityLabel:return(e=>(t,r)=>{const n=(0,l.path)(["entity","label"]),i=n(t),a=n(r);return bA.strings.sort(e,i,a)})(r);default:return JO}})({sortField:t,sortOrder:r,typesLabelsMap:n}))},zO=(0,l.pipe)((0,l.defaultTo)(""),l.toLower,(0,l.ifElse)((0,l.includes)(l.__,Object.values(HO)),l.identity,(0,l.always)(KO))),ZO=(0,l.pipe)((0,l.defaultTo)(""),(0,l.ifElse)((0,l.includes)(l.__,Object.values(qO)),l.identity,(0,l.always)(QO)));var ev=r(91104);let tv;const rv=(e,t)=>(tv||(tv=ev.createClient({key:t})),new Promise((t=>{tv.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)}))}))),nv=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,l.is)(Object,t)&&(t=""),t},iv=(e,t,r)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(ts).flatMap((e=>{let n;return e.type==t&&(n=r?[e]:[nv(e)]),(0,l.is)(Object,e.value)&&(n=(n||[]).concat(iv(e.value,t,r))),n})),av=e=>e&&e.length>0,ov=(e,t)=>[].concat(e&&e.attributes?iv(e.attributes,t):[]).filter(l.identity),sv=(e,t,r,n,i)=>{if(e&&e.type){const t=(Ir(r,e.type).geoLocationAttributes||[]).map((t=>{return r=ov(e,t.latitude),n=ov(e,t.longitude),av(r)&&av(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(av(t)&&t[0].value&&av(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?rv(n.label,i).catch((()=>null)):Promise.resolve(null)},lv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n={},i=(0,l.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(n[t.type]=n[t.type]||((null===(r=Ir(e,t.type))||void 0===r?void 0:r.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((e=>{let{name:t}=e;return t})),n[t.type].map((e=>t.attributes[e])).filter(l.identity).flatMap((e=>e.map((e=>({id:e.uri,label:e.label,entity:t,pointSource:e.value,refAttribute:e}))))));var r})));return Promise.all(i.map((t=>{let{id:n,label:i,entity:a,pointSource:o,refAttribute:s}=t;return sv(a,o,e,s,r).then((e=>!e&&a.label&&""!==a.label?rv(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)))},uv=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=Ir(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if(nr(e,r.latitude,t.type)&&nr(e,r.longitude,t.type)){const e=ov(t,r.latitude),n=ov(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))},cv=(e,t,r)=>Promise.all([uv(e,t),lv(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 pv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dv(e,t,r[t])}))}return e}function dv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yv=(e,t)=>t.values.map(ro(e,t.entityTypeUri)),fv=(e,t,r)=>Vs(t.fieldName,r)||nr(e,Rt(t.fieldName,(0,l.propOr)("","entityTypeUri",t)),(0,l.propOr)("","entityTypeUri",t)),Tv=(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?iO(e,t):e}),r)},Ev=(0,l.path)(["attrType","label"]),mv=(0,l.reduce)(((e,t)=>{const r=(0,l.path)(["attrType","lookupCode"],t);if(r){const n=t.values.reduce(((e,t)=>pv({},e,{[t]:!0})),{});e[r]=e[r]?pv({},e[r],n):n}return e}),{}),hv=(0,l.pipe)((0,l.prop)("values"),E),bv=(0,l.pipe)((0,l.defaultTo)({}),(0,l.propEq)("fieldName",fn.type.name)),Ov=e=>e.type===_v.NUMERIC_RANGE_FACET,vv=e=>e.type===_v.DATE_RANGE_FACET,gv=(0,l.either)(Ov,vv),_v={NUMERIC_RANGE_FACET:"numericRangeFacet",DATE_RANGE_FACET:"dateRangeFacet",WITH_DROPDOWN_CHECKBOXES_FACET:"facetWithDropdownCheckboxes",COMPLEX_FACET:"complexFacet",ENTITY_TYPE_FACET:"entityTypeFacet"},Av=e=>{switch(null==e?void 0:e.name){case fn.type.name:return _v.ENTITY_TYPE_FACET;case fn.createdBy.name:case fn.updatedBy.name:case fn.sourceSystems.name:case fn.tags.name:case fn.roles.name:case fn.matchRules.name:case fn.MLRecommendedMatch.name:return _v.WITH_DROPDOWN_CHECKBOXES_FACET;case fn.createdTime.name:case fn.updatedTime.name:case fn.startDate.name:case fn.endDate.name:return _v.DATE_RANGE_FACET;case fn.matches.name:case fn.matchScore.name:return _v.NUMERIC_RANGE_FACET;default:return(e=>{switch(e){case"Image":case"Nested":case"Reference":return _v.COMPLEX_FACET;case"Int":case"Float":case"Double":case"Long":case"Number":case"Count":return _v.NUMERIC_RANGE_FACET;case"Date":case"Timestamp":case"ActivenessDate":return _v.DATE_RANGE_FACET;default:return _v.WITH_DROPDOWN_CHECKBOXES_FACET}})(null==e?void 0:e.type)}},Nv=(0,l.pipe)(fv,Av),Pv=(0,l.pipe)((0,l.path)(["attrType","type"]),yr),Rv=(0,l.cond)([[Ov,(0,l.always)(Mr.IN_RANGE)],[vv,(0,l.always)(Mr.WITHIN)],[(0,l.allPass)([Pv,e=>e.values.length>=2]),(0,l.always)(Mr.EXISTS)],[l.T,(0,l.always)(Mr.EQUALS)]]),Sv=(0,l.cond)([[vv,(0,l.prop)("values")],[Ov,(0,l.prop)("values")],[Pv,e=>1===e.values.length?e.values.map(le):[]],[(0,l.pipe)((0,l.path)(["values",0]),Array.isArray),(0,l.prop)("values")],[l.T,e=>[e.values]]]);function wv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Iv=(0,l.pipe)((0,l.path)(["attrType","type"]),sr),Uv=(0,l.pipe)((0,l.path)(["attrType","type"]),cr),Cv=(0,l.pipe)((0,l.prop)("attrType"),Ws),Lv=(0,l.pipe)((0,l.prop)("attrType"),Gs),Dv=e=>t=>t.values.map((t=>Ir(e,t).label)).join(" , "),jv=(0,l.when)((0,l.propSatisfies)((0,l.gt)(l.__,1),"length"),(0,l.join)(" – ")),kv=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(en().number),jv)),(0,l.join)(","))(e.values);return`${Ev(e)}: ${t}`},Fv=e=>{const t=(0,l.pipe)((0,l.map)((0,l.pipe)(l.uniq,(0,l.map)(w),jv)),(0,l.join)(","))(e.values);return`${Ev(e)}: ${t}`},Mv=e=>t=>`${Ev(t)}: ${yv(e,t).join(", ")}`,xv=e=>t=>{const r=Tv(e,t);return`${Ev(t)}: ${r.join(", ")}`},$v=(0,l.curry)(((e,t,r)=>(0,l.map)((0,l.cond)([[Lv,Dv(e)],[Uv,kv],[Iv,Fv],[Cv,Mv(e)],[l.T,xv(t)]]),r))),Vv=(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){wv(e,t,r[t])}))}return e}({},t,{attrType:fv(e,t,n)}))),$v(e,r))(t),Gv=new RegExp(`^${en().text("Search")}`),Wv=(e,t,r,n)=>{let{uiState:i}=t;const{facets:a,keyword:o,advanced:s,readableQuery:u}=i;return(0,l.isEmpty)(s)?[...Vv(e,a,r,n),...o?[o.value]:[]]:[(0,l.replace)(Gv,"",u)]},Yv=(0,l.pipe)((0,l.omit)(["PICK_DATE"]),l.values)(Hr),Bv=e=>(e=>Yv.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]=Iu(t);return e.replace(r,i).replace(n,a)}),e))(e),qv=(0,l.curry)(((e,t)=>{const r=new URL(e),[,n]=r.pathname.split("/");return"nui"===n?`${e}search?state=${t}`:`${e}#p~com.reltio.plugins.search.SearchPerspective_s~${t}`})),Hv={geoPolygon:"geoPolygon",geoLocation:"geoLocation",onMapMove:"onMapMove"},Qv=e=>[Hv.geoPolygon,Hv.onMapMove].includes(e),Kv=e=>{let[t,r]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)})`},Jv=e=>{let[t,r,n]=e;return`(${+t.toFixed(6)}, ${+r.toFixed(6)}) ${+n.toFixed(1)}`},Xv=(e,t)=>Qv(e)?t.map(Kv):[Jv(t)],zv=e=>Qv(e)?en().text("Geo Polygon"):en().text("Geo Location"),Zv=e=>{switch(e){case Hv.geoLocation:return"geoLocation";case Hv.geoPolygon:case Hv.onMapMove:return"geoPolygon"}},eg={operator:"operator",attributeLabel:"attributeLabel",specialAttributeLabel:"specialAttributeLabel",attributeFilter:"attributeFilter",attributeValue:"attributeValue",entityTypeLabel:"entityTypeLabel",space:"space",bracket:"bracket",punctuationMark:"punctuationMark"},tg=e=>en().text(e),rg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{[Mr.EQUALS]:"=",[Mr.NOT_EQUALS]:"≠",[Mr.STARTS_WITH]:"*",[Mr.MISSING_VALUE]:en().text("missing value"),[Mr.HAS_ALL]:en().text("has all"),[Mr.IN_RANGE]:en().text("in range"),[Mr.FULL_TEXT]:en().text("full text"),[Mr.EXISTS]:en().text("exists"),[Mr.COUNT_EQUALS]:`${en().text("count")} =`,[Mr.COUNT_NOT_EQUALS]:`${en().text("count")} ≠`,[Mr.COUNT_LT]:`${en().text("count")} <`,[Mr.COUNT_LTE]:`${en().text("count")} <=`,[Mr.COUNT_GT]:`${en().text("count")} >`,[Mr.COUNT_RANGE]:en().text("count range"),[Mr.LT]:"<",[Mr.LTE]:"<=",[Mr.GT]:">",[Mr.GTE]:">=",[Mr.IN_FILE]:en().text("in file"),[Mr.NOT_IN_FILE]:en().text("not in file"),[Mr.CONTAINS]:"~",[xr.LIST_EQUALS]:"=",[xr.NOT_LIST_EQUALS]:"≠",[xr.LIST_EQUALS_CASE_SENSITIVE]:"=",[xr.NOT_LIST_EQUALS_CASE_SENSITIVE]:"≠"}[e]||en().text(e.toLowerCase())},ng=e=>({type:eg.operator,text:e}),ig=e=>({type:eg.operator,text:tg(e)}),ag=e=>({type:eg.attributeLabel,text:e}),og=e=>({type:eg.specialAttributeLabel,text:e}),sg=e=>({type:eg.attributeFilter,text:rg(e)}),lg=e=>({type:eg.attributeValue,text:e}),ug=e=>({type:eg.entityTypeLabel,text:e}),cg=()=>({type:eg.space,text:" "}),pg=()=>({type:eg.bracket,text:"("}),dg=()=>({type:eg.bracket,text:")"}),yg=(0,l.curry)(((e,t,r,n)=>((e,t)=>e===t.length-1)(r,n)?t:[t,e])),fg=(0,l.curry)(((e,t)=>t.map(yg(e)))),Tg=(0,l.curry)(((e,t,r)=>[e,...r,t])),Eg=Tg(pg(),dg()),mg=Tg(cg(),cg()),hg=(0,l.curry)(((e,t)=>[e,...t])),bg=e=>hg(ug(e)),Og=e=>hg(ug(`${e}: `)),vg=function(){let{localizable:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let r=!1;const n=su(t),i=[];for(let a=0;a<t.length;a++){const{operand:o,operator:s}=t[a];if(a!==t.length-1){const t=au(s),a=ou(s);!r&&t&&n&&(i.push(pg()),r=!0),i.push(o),r&&a&&(i.push(dg()),r=!1);const l=e?ig(s):ng(s);i.push(...mg([l]))}else i.push(o),r&&(i.push(dg()),r=!1)}return i}},gg=(0,l.pipe)((0,l.map)((0,l.when)((0,l.has)("text"),(0,l.prop)("text"))),(0,l.join)("")),_g=(0,l.pipe)(vg({localizable:!1}),gg),Ag=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},Ng=e=>{let{data:t,values:r,filter:n}=e;return t&&qu({filter:n,fieldName:(0,l.prop)("fieldName",t),values:r})},Pg=(0,l.anyPass)([(0,l.pipe)((0,l.prop)("attributes"),(0,l.any)(Ng)),(0,l.pipe)((0,l.path)(["entityTypes","length"]),(0,l.lt)(0))]),Rg=(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)&&Zt(e.data.attrType)})(e)&&[Mr.HAS_ALL,Mr.EQUALS,Mr.NOT_EQUALS].includes(e.filter))),(0,l.map)((e=>({type:zt((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})))),cO),Sg=(e,t)=>(0,l.pipe)(Rg,pO(t))(e),wg=(0,l.pathEq)(["data","fieldName"],fn.type.name),Ig=(0,l.path)(["data","entityTypeUri"]),Ug=(0,l.pipe)((0,l.props)(["entityTypes","attributes"]),(0,l.all)(l.isEmpty)),Cg=(0,l.curry)(((e,t)=>t.map((t=>(0,l.evolve)({entityTypes:(0,l.filter)(Yo(e)),attributes:(0,l.filter)((0,l.pipe)(Ig,(0,l.anyPass)([l.isNil,Yo(e),r=>{const n=(t.entityTypes||[]).filter(Yo(e));return(n.length>1?jr(e,n):null)===r&&!!Ir(e,r)}])))})(t))))),Lg=e=>(0,l.pipe)((0,l.prop)("filter"),ql,(0,l.equals)(e)),Dg=(0,l.curry)(((e,t,r,n,i,a)=>{const o=Vs(n.fieldName)||n.attrType,s=Au(o,i),u=dO({attributePresentations:t,dataTypeDefinition:s}),{type:c}=s;return(0,l.pipe)((0,l.cond)([[()=>Zt(s),()=>(0,l.is)(Object,a)&&a.lookupCode?iO(a.lookupCode,a.value):oO(r,zt(o),a)],[()=>Ws(s),()=>ro(e,n.entityTypeUri,a)],[()=>Ys(s),()=>No(e,a)],[()=>Js(s),()=>So(e,a)],[()=>"referenced_entity_id"===n.fieldName,()=>a.entityLabel],[l.T,()=>u(a)]]),(0,l.unless)((()=>cr(c)||yr(c)),Ou),lg)()})),jg=(e,t,r,n)=>{const i=Dg(e,t,r,n.data,n.filter);return(0,l.cond)([[Lg(0),(0,l.always)([])],[(0,l.both)(Lg(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[cg(),i(r),{type:eg.punctuationMark,text:" — "},i(n)]}],[l.T,e=>{let{values:t}=e;return[cg(),...(0,l.pipe)(l.flatten,(0,l.map)(i),fg({type:eg.punctuationMark,text:", "}))(t)]}]])(n)},kg=(e,t)=>{const r=!!Vs(e.data.fieldName);return(0,l.pipe)(Ag,r?og:ag)(e,t)},Fg=(e,t,r,n,i)=>[kg(n,i),cg(),sg(n.filter),...jg(e,t,r,n)],Mg=(0,l.addIndex)(l.map),xg=(0,l.propEq)("length",1),$g=(0,l.propSatisfies)((0,l.lt)(1),"length"),Vg=(0,l.complement)(l.isEmpty),Gg=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return(0,l.pipe)(cu,(0,l.filter)(Ng),pu,(0,l.map)((n=>({operand:Fg(e,t,r,n,i),operator:n.operator}))),(0,l.unless)(l.isEmpty,vg()))(n)},Wg=(0,l.pipe)(Gg,l.flatten),Yg=(e,t,r,n,i)=>{let{attributes:a,entityTypes:o=[]}=n;const s=t=>{const r=o.map((t=>Od(e,{type:t}))).join(", ");return r?t(r):l.identity},u=Gg(e,t,r,a);return(0,l.ifElse)(l.isEmpty,s(bg),(0,l.pipe)(s(Og),(0,l.unless)((()=>xg(u)||i),Eg)))(u)},Bg=(e,t,r,n)=>(0,l.pipe)(cu,(0,l.filter)(Pg),pu,Mg(((n,i,a)=>({operand:Yg(e,t,r,n,xg(a)),operator:n.operator}))),vg(),l.flatten)(n),qg=(0,l.pipe)((0,l.reject)(l.isEmpty),(0,l.map)((e=>({operand:e,operator:"and"}))),vg(),l.flatten),Hg=e=>{let{searchType:t,values:[r]}=e;return Xv(t,r).join(", ")},Qg=(e,t,r,n,i,a)=>{const o=(e=>e?[og(e.isRawFilter?en().text("Raw filter"):en().text("Search")),...mg([sg(Mr.EQUALS)]),lg(`"${e.value}"`)]:[])(i),s=(e=>e?[og(zv(e.searchType)),cg(),lg(Hg(e))]:[])(a),u=(0,l.pipe)(Bg,(0,l.when)((e=>$g(e)&&(Vg(o)||Vg(s))),Eg))(e,t,r,n);return qg([o,s,u])},Kg=(0,l.pipe)((0,l.map)((0,l.prop)("text")),(0,l.join)("")),Jg=(0,l.pipe)(Qg,Kg),Xg=(0,l.has)("attributes"),zg=Array.isArray,Zg=(0,l.allPass)([(0,l.propEq)("length",1),(0,l.pathSatisfies)((0,l.startsWith)("not"),[0,"filter"])]),e_=(e,t,r,n,i)=>{const{attributes:a,operator:o}=n,s=t_(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)(Zg(a))),Eg),(0,l.concat)(mg([ng(o)]))))(s)},t_=function(e,t,r,n){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return Xg(n)?e_(e,t,r,n,i):zg(n)?n.reduce(((n,a)=>n.concat(t_(e,t,r,a,i))),[]):(0,l.when)((0,l.always)((0,l.has)("operator",n)),(0,l.concat)(mg([ng(n.operator)])))(Fg(e,t,r,n,i))},r_=(e,t,r,n,i)=>(0,l.pipe)(t_,l.flatten)(e,t,r,n,i);function n_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i_(e,t,r[t])}))}return e}function i_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a_=(0,l.complement)(wg),o_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,l.pipe)((0,l.filter)(wg),(0,l.map)((0,l.prop)("values")),l.flatten,l.uniq)(e),r=(0,l.pipe)((0,l.map)(Ig),(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}},s_=e=>{const t=e.attributes||[],{areOnlySpecialAttributes:r,areAttributesFromOneEntityType:n}=o_(t);return(r||n)&&lu(t)},l_=(0,l.ifElse)((0,l.all)((0,l.has)("entityTypes")),l.identity,(0,l.pipe)((e=>{const t=[],r=e.filter((0,l.complement)(s_)),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(wg).some((0,l.propEq)("filter",Mr.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}=o_(r);if(s_(e))t.push(n_({},e,{entityTypes:(0,l.uniq)((0,l.concat)(n,i)),attributes:r.filter(a_)}));else{const n=r.map((a=e.operator,(e,t,r)=>{const n=(0,l.pipe)((0,l.ifElse)(wg,(0,l.pipe)((0,l.prop)("values"),l.flatten),(0,l.pipe)(Ig,(e=>[e]),(0,l.reject)(l.isNil))))(e),i=t===r.length-1;return{attributes:[e].filter(a_),entityTypes:n,operator:i?a:e.operator,id:Wb()()}}));t.push(...n)}var a;return t})(t))),[]))),u_={[Mr.EQUALS]:Mr.ON,[Mr.IN_RANGE]:Mr.WITHIN,[Mr.GTE]:Mr.AFTER,[Mr.GT]:Mr.AFTER,[Mr.LTE]:Mr.BEFORE,[Mr.LT]:Mr.BEFORE},c_=(0,l.curry)((e=>u_[e]||e)),p_=(0,l.curry)(((e,t)=>{switch(e){case Mr.LT:return[f()(t[0]).subtract(1,"day").valueOf()];case Mr.GT:return[f()(t[0]).add(1,"day").valueOf()];default:return t}})),d_=(0,l.pipe)((0,l.path)(["data","attrType","type"]),sr),y_=(0,l.curry)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>n_({},e,{attributes:(e.attributes||[]).map((e=>{const{filter:t}=e;return d_(e)?(0,l.evolve)({filter:c_,values:p_(t)},e):e}))})))})),f_=(0,l.evolve)({values:(0,l.when)((0,l.pipe)((0,l.prop)(0),Pu),(0,l.map)(Iu))}),T_=(0,l.map)((0,l.cond)([[d_,f_],[l.T,l.identity]])),E_=(0,l.curryN)(3,((e,t,r,n,i)=>(0,l.pipe)((0,l.defaultTo)([]),l_,Cg(t),(0,l.map)((0,l.evolve)({attributes:(0,l.pipe)((0,l.map)((0,l.evolve)({data:e(t,n,i)})),(0,l.reject)((0,l.propSatisfies)(l.isNil,"data")),T_)})),y_,(0,l.reject)(Ug))(r)));function m_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){h_(e,t,r[t])}))}return e}function h_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b_=(e,t)=>({data:{uri:Ut(e.fieldName)?Rt(e.fieldName,e.entityTypeUri):void 0,fieldName:e.fieldName,entityTypeUri:e.entityTypeUri},operator:"and",filter:t||Rv(e),id:Wb()(),values:Sv(e)}),O_=(0,l.curry)(((e,t,r,n)=>{const{uri:i,fieldName:a,entityTypeUri:o}=n,s=Vs(a,t,r)||nr(e,i);if(!s)return null;if(Wt(s))return m_({},n,{attrType:s,title:s.label});{const t=s.label||s.name,r=Od(e,{type:o}),i=(rr(e,Rt(a,o),o)||[]).map((0,l.pick)(["label","name"])).slice(0,-1);return m_({},n,{attrType:s,title:t,pathToTitle:Array.isArray(i)?[r,...(0,l.chain)((0,l.prop)("label"),i),t]:[r,t]})}})),v_=(0,l.curry)(((e,t,r,n)=>E_(O_,e,n,t,r)));function g_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){__(e,t,r[t])}))}return e}function __(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const A_=e=>{const{keyword:t,isRawFilter:r=!1}=e;return t?{value:t,isRawFilter:r}:null},N_=e=>"rdmLookups.not.resolved"===e?fn.notResolved.name:e,P_=(0,l.curry)(((e,t,r)=>{let{fieldName:n,uri:i,filter:a,values:o=[]}=r;const s=a===Wr?Mr.IN_RANGE:Yr(a),u=N_(n),c=Vs(u)||nr(e,i),p=(0,l.cond)([[()=>Jl(s),(0,l.map)((0,l.when)((0,l.both)((0,l.has)("link"),(0,l.complement)((0,l.has)("filename"))),(e=>g_({},e,{filename:tO(e)}))))],[()=>yr(null==c?void 0:c.type),(0,l.map)(le)],[e=>Ql(s)&&!Array.isArray(e[0])&&!sr(null==c?void 0:c.type),ie],[l.T,l.identity]])(o);return{id:Wb()(),data:{uri:i,fieldName:u,entityTypeUri:t},operator:a===Wr?"and not":"and",filter:s,values:p}})),R_=(0,l.curry)(((e,t)=>{const{searchParams:r=[],fastSearchParams:n=[],entityTypes:i=[]}=t,a=[...r,...n].map(P_(e,jr(e,i)));return[{id:Wb()(),operator:"or",attributes:a,entityTypes:i}]})),S_=e=>(0,l.pipe)((0,l.prop)(e),(0,l.is)(Number)),w_=(0,l.cond)([[(0,l.has)("values"),(0,l.prop)("values")],[(0,l.allPass)([S_("from"),S_("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,()=>[]]]),I_=(e,t)=>{const r=(0,l.pick)(["fieldName","entityType","attrType","filter"])(e),n=e.potentialMatchesDataTenant;return g_({},r,{values:w_(e),entityType:(0,l.propOr)(t,"entityType",r),fieldName:n?ks(e.fieldName,n):e.fieldName})},U_=(e,t)=>{if((0,l.has)("children")(e)){const r=I_(e,t);return e.children.reduce(((e,n)=>(e.push(U_(n,(0,l.propOr)(t,"entityType",r))),e)),[])}return I_(e,t)},C_=(0,l.cond)([[(0,l.has)("searchParameters"),e=>{const t=[];return(0,l.has)("values",e)&&t.push(I_(e)),(0,l.propOr)([],"searchParameters",e).forEach((r=>t.push(g_({fieldName:e.fieldName},I_(r,e.entityType))))),t}],[(0,l.has)("children"),(0,l.pipe)(U_,l.flatten)],[l.T,I_]]),L_=(0,l.pipe)((0,l.map)(C_),l.flatten),D_=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},j_=(e,t,r,n)=>{const{facets:i=[],advanced:a={},model:o}=n,[s]=R_(e,a),[u]=((e,t)=>{if(!t)return[];const[r,n]=(0,l.pipe)((0,l.reject)((e=>"tenants"===e.fieldName)),(0,l.partition)((e=>"type"===e.fieldName)))(t),i=(0,l.chain)((0,l.propOr)([],"values"),r);return[{attributes:L_(n).map((e=>{let{fieldName:t,entityType:r,values:n,filter:i}=e;return{fieldName:t,entityTypeUri:r,values:n,filter:i}})).map((t=>g_({},t,{type:Nv(e,t)}))).map((e=>g_({},e,{values:gv(e)?D_(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 b_(r,t)})),operator:"or",id:Wb()(),entityTypes:i}]})(e,i),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.pipe)(l.keys,(0,l.map)((t=>({[N_(t)]:e[t]}))),l.mergeAll)(e)}(o),p=[g_({},u,{entityTypes:null!=c&&c.type?(0,l.uniq)([...u.entityTypes,...s.entityTypes]):[],attributes:[...u.attributes,...s.attributes].filter((e=>{let{data:{fieldName:t}}=e;return c[t]}))})];return v_(e,t,r,p)},k_=(e,t,r,n)=>{try{return"2.0"==n.version?((e,t,r,n)=>{const{advanced:i=[],facets:a={}}=n,o=i.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?i:((e,t)=>{const[[r={}],n]=(0,l.pipe)(l.values,(0,l.reject)(hv),(0,l.partition)(bv))(t),i=n.map((t=>m_({},t,{type:Nv(e,t)}))).map((e=>b_(e))),a=r.values||[];return[{attributes:i,operator:"or",id:Wb()(),entityTypes:a}]})(e,a);return v_(e,t,r,o)})(e,t,r,n):j_(e,t,r,n)}catch(e){return console.error("Failed to convert search state to groups",e),[]}},F_=e=>"2.0"===e.version?e.keyword:A_(e),M_=e=>(0,l.pathEq)(["object","uri"],e),x_=(e,t)=>(0,l.pipe)((0,l.find)(M_(e)),(0,l.prop)("object"))(t),$_=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"),M_(r.uri),(0,l.pipe)((0,l.propOr)(!1,"direct"),l.not)])),(0,l.propOr)([],"shortestTransitiveMatchPath"))(t),a=r=>{const i=x_(r.match,t)||n[r.match];return i?{label:Zp((0,l.prop)("label",i)),matchRules:(0,l.propOr)([],"matchRules",r).map((function(t){return to(e,i.type,t)||{label:t,uri:t}}))}:null};return(0,l.pipe)((0,l.defaultTo)([]),(0,l.when)((0,l.complement)(l.isEmpty),(0,l.map)(a)),(0,l.reject)(l.isNil))(i)},V_=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)]),W_=(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:Zp((0,l.prop)("label",a)),matchRules:i.map((function(t){return to(e,a.type,t)||{label:t,uri:t}}))}})))(t),Y_=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)},B_=(0,l.path)(["object","uri"]),q_=e=>{let t=[];return{addChild:e=>{t=(0,l.append)(e,t)},getValue:()=>e,getChildren:()=>t,removeChild:e=>{t=(0,l.without)([e],t)}}},H_=e=>e.getValue(),Q_=(e,t)=>{let r=null;if(t(e.getValue()))return e;const n=e.getChildren();for(let e=0;e<n.length&&(r=Q_(n[e],t),!r);e++);return r},K_=(e,t)=>{const r=[],n=(0,l.pipe)(H_,t),i=(0,l.pipe)(l.map,l.flatten),a=e.getChildren();a.some(n)&&r.push(e);const o=i((0,l.partialRight)(K_,[t]),a);return r.push.apply(r,o),r};function J_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){X_(e,t,r[t])}))}return e}function X_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const z_=(e,t)=>!!e[t],Z_=e=>{let{uri:t,lookupCode:r,value:n}=e;return{uri:t,value:r||n}},eA=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||[]])},tA=e=>{let{structure:t,attrType:r,parents:n=[],children:i=[],values:a=[]}=e;const o=t[r.uri];return J_({},t,{[r.uri]:J_({},o,{attrType:(null==o?void 0:o.attrType)||r,parents:eA(null==o?void 0:o.parents,n),children:eA(null==o?void 0:o.children,i),values:eA(null==o?void 0:o.values,a,(0,l.prop)("uri"))})})},rA=e=>e.children?e.children.flatMap(rA):e,nA=e=>{let{structure:t={},metadata:r,typeUris:n,alreadyAddedTypeUris:i=[]}=e;return n.filter((e=>!i.includes(e))).reduce(((e,t)=>{const n=Ir(r,t)||li(r,t),i=(0,l.either)((0,l.both)((0,l.prop)("dependentLookupAttributes"),(0,l.prop)("dependentLookupCode")),(0,l.prop)("children"));return jo(r,n,i).flatMap(rA).reduce(((e,t)=>{const n=t.dependentLookupAttributes.map((e=>nr(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=tA({structure:t,attrType:r,children:i});return n.reduce(((e,t)=>tA({structure:e,attrType:t,parents:[r.uri]})),a)})({structure:e,parentAttrType:t,childrenAttrTypes:n})}),e)}),t)},iA=e=>{let{structure:t,metadata:r,entityOrRelation:n}=e;return Object.keys(t).reduce(((e,t)=>{if(((e,t)=>!Tt(e.uri)&&vt(e.type)&&vt(t)&&!t.startsWith(e.type))(n,t))return e;const i=Es(r,n,t)||[],a=(0,l.pipe)((0,l.filter)(ts),(0,l.map)(Z_))(i);return tA({structure:e,attrType:e[t].attrType,values:a})}),t)},aA=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 z_(e,r)}));return r||n?t.filter(ts).reduce(((e,t)=>aA({structure:e,attributeValue:t})),e):e}),t);{const e=r;return z_(t,e.type)?tA({structure:t,attrType:t[e.type].attrType,values:[Z_(e)]}):t}},oA=e=>{let{structure:t,uri:r}=e;return(0,l.map)((e=>e.values.some((e=>{let{uri:t}=e;return t.startsWith(r)}))?J_({},e,{values:e.values.filter((e=>{let{uri:t}=e;return!t.startsWith(r)}))}):e))(t)},sA=e=>{let{structure:t,attrTypeUri:r,entityOrRelation:n,metadata:i}=e;const a=Es(i,n,r)||[];return a.length?tA({structure:t,attrType:t[r].attrType,values:a.filter(ts).map(Z_)}):t},lA=(e,t,r)=>{const n=ht(e),i=ht(t);return n===i?((e,t)=>{const r=Dt(t),n=Dt(e);return _t(n,r)||((e,t)=>Ct(e)&&!Ct(t)&&_t(t,e))(n,r)})(e,t):!(!r||!Lt(t))&&dE(r,i).includes(n)},uA=(e,t)=>{if(e){if(e.includeAttributes)return e.includeAttributes.includes(t);if(e.excludeAttributes)return!e.excludeAttributes.includes(t)}return!1},cA=e=>{let{parentValues:t,valueUri:r,entityUri:n,modifiedEntities:i,connections:a}=e;const o=n?cE(n,i,a):null;return t.filter((e=>{let{uri:t}=e;return lA(r,t,o)}))},pA=(e,t,r)=>{const n=r[e].map((e=>t[e]));return(0,l.uniq)(n.concat(n.flatMap((r=>pA(e,t,r)))))},dA=(e,t,r,n)=>{let{uri:i,value:a}=r;return{type:e,uri:i,lookupValue:a,autopopulate:i!==t&&uA(n,e)}},yA=e=>{let{structure:t,typeUri:r,valueUri:n,modifiedEntities:i,connections:a,entityUri:o,config:s}=e;const l=t[r],u=ht(n),c=pE(u,o,i,a),p=pA("children",t,l),d=pA("parents",t,l),y=p.flatMap((e=>pA("parents",t,e))).filter((e=>![...d,l,...p].includes(e))),f=p.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return lA(t,n,c)})).map((t=>dA(e.attrType.uri,n,t,s)))));if(!f.length)return[];const T=d.flatMap((e=>e.values.filter((e=>{let{uri:t}=e;return lA(n,t,c)||ht(t)!==u&&lA(t,n,c)})).map((t=>dA(e.attrType.uri,n,t,s))))),E=y.flatMap((e=>{const r=pA("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)&&lA(n,t,c)}))})).map((t=>dA(e.attrType.uri,n,t,s)))}));return[...l.values.filter((e=>{let{uri:t}=e;return lA(t,n,c)})).map((e=>dA(r,n,e,s))),...T,...E,...f]},fA=async e=>{let{attributeType:t,attributePresentations:r,value:n}=e;const i=dO({attributePresentations:r,dataTypeDefinition:t}),a=(0,l.pipe)((e=>{const t={};for(const r of e){const[e,n]=Object.entries(r)[0];t[e]=Array.isArray(n)?n.map((e=>({value:e,ov:!0}))):[{value:n,ov:!0}]}return{value:t}}),(e=>Xp(e,t.dataLabelPattern))),o=e=>Object.values(e[0])[0],s=(0,l.pipe)(o,i),u=(0,l.cond)([[Ht,()=>a(n)],[Zt,()=>(e=>{const r=o(e),n=zt(t);return kl([{codeValue:r,type:n}]).then((e=>{if(Array.isArray(e))return oO(e[0],n,r)}))})(n)],[l.T,()=>s(n)]]);return await u(t)},TA=e=>{let{value:t,attributeType:r,entityType:n=""}=e,i=[{fieldName:"type",filter:Mr.EQUALS,values:[n]}];return Array.isArray(t)?i=i.concat(EA(r,t)):i.push(mA([t],r)),i},EA=(e,t)=>{const r=Yt(e),n=t=>(e[r]||[]).find((e=>e.uri===t||e.uri.endsWith(`/${t}`)));return t.reduce(((e,t)=>{for(const r in t){const i=n(r),a=Ht(i)?EA(i,t[r]):[mA(t[r],i)];return e.push(...a),e}}),[])},mA=(e,t)=>e&&e.length&&!(0,l.isNil)(e[0])&&""!==e[0]?{fieldName:Xt(t.uri),filter:t.type===Xe.TYPE_BLOB?Mr.FULL_TEXT:Mr.EQUALS,values:e}:{fieldName:Xt(t.uri),filter:Mr.MISSING_VALUE},hA={AttributesDiff:o,AttributesEditor:a,HistoryManager:s},bA={Colors:r(33164),DependencyManager:r(29524),strings:n,dates:i}},33164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getColor:()=>i});var n=[[255,235,238,0],[255,205,210,0],[239,154,154,0],[229,115,115,0],[239,83,80,1],[244,67,54,1],[229,57,53,1],[211,47,47,1],[198,40,40,1],[183,28,28,1],[255,138,128,0],[255,82,82,1],[255,23,68,1],[213,0,0,1],[252,228,236,0],[248,187,208,0],[244,143,177,0],[240,98,146,1],[236,64,122,1],[233,30,99,1],[216,27,96,1],[194,24,91,1],[173,20,87,1],[136,14,79,1],[255,128,171,0],[255,64,129,1],[245,0,87,1],[197,17,98,1],[243,229,245,0],[225,190,231,0],[206,147,216,0],[186,104,200,1],[171,71,188,1],[156,39,176,1],[142,36,170,1],[123,31,162,1],[106,27,154,1],[74,20,140,1],[234,128,252,0],[224,64,251,1],[213,0,249,1],[170,0,255,1],[237,231,246,0],[209,196,233,0],[179,157,219,0],[149,117,205,1],[126,87,194,1],[103,58,183,1],[94,53,177,1],[81,45,168,1],[69,39,160,1],[49,27,146,1],[179,136,255,0],[124,77,255,1],[101,31,255,1],[98,0,234,1],[232,234,246,0],[197,202,233,0],[159,168,218,0],[121,134,203,1],[92,107,192,1],[63,81,181,1],[57,73,171,1],[48,63,159,1],[40,53,147,1],[26,35,126,1],[140,158,255,0],[83,109,254,1],[61,90,254,1],[48,79,254,1],[227,242,253,0],[187,222,251,0],[144,202,249,0],[100,181,246,0],[66,165,245,0],[33,150,243,1],[30,136,229,1],[25,118,210,1],[21,101,192,1],[13,71,161,1],[130,177,255,0],[68,138,255,1],[41,121,255,1],[41,98,255,1],[225,245,254,0],[179,229,252,0],[129,212,250,0],[79,195,247,0],[41,182,246,0],[3,169,244,0],[3,155,229,1],[2,136,209,1],[2,119,189,1],[1,87,155,1],[128,216,255,0],[64,196,255,0],[0,176,255,0],[0,145,234,1],[224,247,250,0],[178,235,242,0],[128,222,234,0],[77,208,225,0],[38,198,218,0],[0,188,212,0],[0,172,193,0],[0,151,167,1],[0,131,143,1],[0,96,100,1],[132,255,255,0],[24,255,255,0],[0,229,255,0],[0,184,212,0],[224,242,241,0],[178,223,219,0],[128,203,196,0],[77,182,172,0],[38,166,154,0],[0,150,136,1],[0,137,123,1],[0,121,107,1],[0,105,92,1],[0,77,64,1],[167,255,235,0],[100,255,218,0],[29,233,182,0],[0,191,165,0],[232,245,233,0],[200,230,201,0],[165,214,167,0],[129,199,132,0],[102,187,106,0],[76,175,80,0],[67,160,71,1],[56,142,60,1],[46,125,50,1],[27,94,32,1],[185,246,202,0],[105,240,174,0],[0,230,118,0],[0,200,83,0],[241,248,233,0],[220,237,200,0],[197,225,165,0],[174,213,129,0],[156,204,101,0],[139,195,74,0],[124,179,66,0],[104,159,56,1],[85,139,47,1],[51,105,30,1],[204,255,144,0],[178,255,89,0],[118,255,3,0],[100,221,23,0],[249,251,231,0],[240,244,195,0],[230,238,156,0],[220,231,117,0],[212,225,87,0],[205,220,57,0],[192,202,51,0],[175,180,43,0],[158,157,36,0],[130,119,23,1],[244,255,129,0],[238,255,65,0],[198,255,0,0],[174,234,0,0],[255,253,231,0],[255,249,196,0],[255,245,157,0],[255,241,118,0],[255,238,88,0],[255,235,59,0],[253,216,53,0],[251,192,45,0],[249,168,37,0],[245,127,23,0],[255,255,141,0],[255,255,0,0],[255,234,0,0],[255,214,0,0],[255,248,225,0],[255,236,179,0],[255,224,130,0],[255,213,79,0],[255,202,40,0],[255,193,7,0],[255,179,0,0],[255,160,0,0],[255,143,0,0],[255,111,0,0],[255,229,127,0],[255,215,64,0],[255,196,0,0],[255,171,0,0],[255,243,224,0],[255,224,178,0],[255,204,128,0],[255,183,77,0],[255,167,38,0],[255,152,0,0],[251,140,0,0],[245,124,0,0],[239,108,0,1],[230,81,0,1],[255,209,128,0],[255,171,64,0],[255,145,0,0],[255,109,0,0],[251,233,231,0],[255,204,188,0],[255,171,145,0],[255,138,101,0],[255,112,67,0],[255,87,34,1],[244,81,30,1],[230,74,25,1],[216,67,21,1],[191,54,12,1],[255,158,128,0],[255,110,64,0],[255,61,0,1],[221,44,0,1],[239,235,233,0],[215,204,200,0],[188,170,164,0],[161,136,127,1],[141,110,99,1],[121,85,72,1],[109,76,65,1],[93,64,55,1],[78,52,46,1],[62,39,35,1],[250,250,250,0],[245,245,245,0],[238,238,238,0],[224,224,224,0],[189,189,189,0],[158,158,158,0],[117,117,117,1],[97,97,97,1],[66,66,66,1],[33,33,33,1],[236,239,241,0],[207,216,220,0],[176,190,197,0],[144,164,174,0],[120,144,156,1],[96,125,139,1],[84,110,122,1],[69,90,100,1],[55,71,79,1],[38,50,56,1],[0,0,0,1],[255,255,255,0]];function i(e){var t,r=null,i=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];return n.forEach((function(e){var n=Math.abs(i[0]-e[0])+Math.abs(i[1]-e[1])+Math.abs(i[2]-e[2]);(null===r||n<r)&&(r=n,t=e)})),t?t[3]:0}},29524:(e,t,r)=>{"use strict";function n(e){var t=[];return{getInfo:function(){return e},getEdges:function(){return t},removeEdge:function(e){var r=t.indexOf(e);t.splice(r,1)},addEdge:function(e){t.push(e)}}}function i(e,t){t(e),e.getEdges().forEach((function(e){i(e,t)}))}function a(e){var t=[];return e.getEdges().forEach((function(e){t.push.apply(t,a(e))})),t.push(e),t}function o(e,t){var r=null;if(e.getInfo()===t)return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=o(n[i],t));i++);return r}function s(e,t){var r=null;if(e.getEdges().some((function(e){return e.getInfo()===t})))return e;for(var n=e.getEdges(),i=0;i<n.length&&!(r=s(n[i],t));i++);return r}r.r(t),r.d(t,{Node:()=>n,resolve:()=>i,findNode:()=>o,findParentNode:()=>s,getDependencyOrder:()=>a})},33196:()=>{},38087:()=>{},74854:()=>{},66602:()=>{}}]);
2
2
  //# sourceMappingURL=2247.js.map