@reltio/remotes 1.4.1282 → 1.4.1283
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/7952.js +1 -1
- package/7952.js.map +1 -1
- package/package.json +1 -1
package/7952.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[7952],{79821:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(24328),o=n.n(r),a=n(52730),l=n(59431),i=n(99831),s=n(97991);const c=(0,n(79692).Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),u=e=>{let{group:t,metadata:n}=e;const r=c(),u=(0,a.useSelector)(l.ZP.selectors.getAbsoluteImagePath),p=(0,i.XH8)(n,{type:t.id}),d=(0,i.vPL)(u,p);return o().createElement(s.Z,{className:r.icon,icon:d,avatarText:t.title[0]})}},97991:(e,t,n)=>{n.d(t,{Z:()=>u});var r,o=n(94079),a=n(71153),l=n.n(a),i=n(24328),s=n.n(i);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}!function(e){e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE"}(r||(r={}));const u=e=>{let{className:t,icon:n,avatarText:a,rootClasses:u}=e,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","icon","avatarText","rootClasses"]);const[d,m]=(0,i.useState)(null);(0,i.useEffect)((()=>{m(n?r.ICON_MODE:r.TEXT_MODE)}),[n,a]);const h=()=>{m(r.ERROR_MODE)};switch(d){case r.ICON_MODE:return s().createElement(o.Avatar,c({className:l()(t,null==u?void 0:u.iconRoot),src:n,onError:h},p));case r.TEXT_MODE:case r.ERROR_MODE:return s().createElement(o.Avatar,c({className:l()(t,null==u?void 0:u.textRoot)},p),a);default:return null}}},99757:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(97820),p=n(54763),d=n(45767),m=n(88611),h=n(22385),f=n(79692);const g=(0,f.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),b=(0,c.either)((0,c.prop)("title"),(0,c.prop)("fieldName")),y=e=>{let{value:t,getLabel:n=b,onSelectAttributeClick:r,disabled:a=!1}=e;const i=g(),c=t&&n(t);return o().createElement("div",{onClick:a?void 0:r,className:s()(i.attribute,{[i.attributeWithValue]:!!c},{[i.disabled]:a})},o().createElement(m.C,{value:c},o().createElement("div",{className:s()(i.name,{[i.disabled]:a})},c||o().createElement("span",{className:i.noSelect},l().text("Select attribute")))),o().createElement(h.Z,{size:"M",icon:d.Z,disabled:a}))};var v=n(99831);function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const C=(0,c.eqBy)((0,c.pick)(["fieldName","uri","entityTypeUri"])),x=(e,t)=>t&&!!t.find(C(e)),O=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),S=(e,t)=>O(e,t)||(e.children||[]).some((e=>S(e,t))),R=(e,t)=>e.findIndex(C(t)),P=(0,v.fW1)("title"),k=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const l=O(e,r);return[{item:r?w({},e,{filterText:r}):e,level:o,groupId:t,groupName:n}].concat(e.children?e.children.filter((e=>a||l||S(e,r))).flatMap((e=>k(e,t,n,r,o+1,a||l))):[]).flat()},T=(0,c.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>S(t,e))).map((n=>k(n,t.id,t.title,e)))}))).filter((e=>e.items.length))));var M=n(52730),j=n(94079),N=n(59431),I=n(7785),A=n(44890),D=n(27239),Z=n(79821);const B=(0,f.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){z(e,t,n[t])}))}return e}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const H=(0,r.memo)((e=>{let{selectedAttributes:t,onItemClick:n,focusIndex:r,hideCheckBox:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const i=B(),s=(0,M.useSelector)(N.ZP.selectors.getMetadata);return o().createElement(A.Z,V({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,l,i)=>{let{item:s,level:c,groupId:u,groupName:p}=l;const d=x(s,t),m=i===r;return o().createElement(I.Z,{key:`item-${u}-${s.fieldName}`,onClick:n,checked:d,data:L({},s,{groupName:p}),notSelectable:s.notSelectable,hideCheckBox:a,label:o().createElement(D.Z,{text:s.title,highlight:s.filterText}),labelInText:s.title,level:c,style:e,isFocused:m,groupId:u,LogoIcon:s.LogoIcon})},renderGroupTitle:(e,t)=>o().createElement(j.ListItem,{component:"div",className:i.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&o().createElement(Z.Z,{group:t.item,metadata:s}),t.item.title),focusIndex:r},l))}));var F=n(56656);const W=(0,f.Z)({selector:{minWidth:"200px",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),_=(0,r.memo)((e=>{let{className:t,itemsGroups:n,value:a,getLabel:i,onSelect:d,onRestoreFocus:m=c.identity,onOpenPopup:h=c.identity,disableRestoreFocus:f=!1,disableEnforceFocus:g=!1,single:b=!1,ungroup:v=!1,disabled:E=!1,hideCheckBox:O=!1}=e;const S=W(),[k,M]=(0,r.useState)(null),j=(0,r.useCallback)((()=>M(null)),[]),N=!!k,[I,A]=(0,r.useState)(""),D=(0,r.useCallback)((()=>A("")),[]),[Z,B]=(0,r.useState)([]),V=(0,r.useCallback)((()=>B([])),[]),L=(0,r.useMemo)((()=>T(I,n)),[n,I]),z=(0,r.useMemo)((()=>(0,c.pipe)((0,c.when)((0,c.always)(v),(0,c.chain)((0,c.pipe)((0,c.prop)("items"),c.flatten,(0,c.map)((0,c.pick)(["item","level"]))))),F.LG)(L)),[v,L]),_=(0,r.useMemo)((()=>Math.max(P(L),308)),[L]),U=(0,c.pipe)((0,c.tap)((0,c.pipe)(V,D,j)),m),G=(0,r.useRef)(),q=(0,r.useCallback)(((e,t)=>{d({checked:t,attribute:e,index:t?Z.length:R(Z,e),selectedAttributes:Z}),b?(B(t?[e]:[]),U({})):(B((e=>{let{attribute:t,selectedAttributes:n,checked:r}=e;return r?n.concat(t):n.filter((e=>!C(t,e)))})({selectedAttributes:Z,attribute:e,checked:t})),G.current&&G.current.focus())}),[Z,d,b,U,G]),$=(0,r.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:n}=e;return e=>{let{item:r,groupData:o}=e;const a=x(r,n);t(w({},r,{groupName:o.groupName}),!a)}})({onListItemClick:q,selectedAttributes:Z}),[q,Z]),{focusIndex:X,handleKeyDown:Y}=(0,p.t)({items:z,open:N,onSelectFocusedItem:$,selectedItems:Z,onClose:U});return o().createElement("div",{className:s()(S.selector,t),"data-reltio-id":"attribute-selector"},o().createElement(y,{value:a,getLabel:i,onSelectAttributeClick:e=>{h(),M(e.currentTarget)},disabled:E}),o().createElement(u.Z,{open:N,anchorEl:k,onClose:U,onSearch:A,title:l().text("Select attribute"),containerWidth:_,containerHeight:507,searchInputOnKeyDown:Y,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:G,disableRestoreFocus:f,disableEnforceFocus:g},o().createElement(H,{items:z,onItemClick:q,selectedAttributes:Z,width:_,height:400,focusIndex:X,hideCheckBox:O})))}))},74402:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(24328),o=n(17440),a=n(99831);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=e=>{let{rowIndex:t,columnData:{id:n},cellIndex:r}=e;return`${n}[${t}][${r}]`},s=()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useRef)({}),s=(0,r.useCallback)((0,a.DsO)((()=>{t(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}({},n.current))})),[]),c=(0,r.useCallback)((()=>{n.current={}}),[]);return{getDynamicRowCellHeight:(0,r.useCallback)((0,o.pipe)(i,(0,o.prop)(o.__,e)),[e]),changeRowCellHeight:(0,r.useCallback)((0,o.curry)((0,o.useWith)((0,o.pipe)(((e,t)=>{n.current[e]=t}),s),[i,o.identity])),[]),clearHeightsCache:c}}},74566:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(73038),s=n(58241),c=n(71153),u=n.n(c);const p=(0,n(79692).Z)((()=>({hidden:{visibility:"hidden"}}))),d=e=>{let{rowIndex:t,rowValue:n,className:a}=e;const l=p(),{toggleRowCollapse:c,getIsRowCollapsible:d,getIsRowCollapsed:m}=(0,r.useContext)(i.x),h=d(n),f=m(t);return o().createElement(s.Z,{className:u()(a,{[l.hidden]:!h}),isOpen:!f,onClick:e=>{c(t),e.stopPropagation()}})};d.propTypes={rowIndex:l().number,rowValue:l().object,className:l().string};const m=d},97946:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(44443),s=n(94079),c=n(20562);const u=e=>{let{onChangeHeight:t,children:n}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onChangeHeight","children"]);const l=(0,r.useRef)(null),{rowValue:u,rowIndex:p,columnData:d,cellIndex:m}=a,h=t({rowIndex:p,cellIndex:m,columnData:d}),f=()=>l.current&&h(l.current.clientHeight);return(0,c.D)(f,[u.rawValue]),o().createElement("div",null,o().createElement(i.Z,{handleHeight:!0,onResize:f}),o().createElement(s.RootRef,{rootRef:l},n))};u.propTypes={onChangeHeight:l().func,children:l().node};const p=u},23598:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(71153),s=n.n(i),c=n(79692);const u=(0,c.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var p=n(87918),d=n.n(p),m=n(6782);const h="46px",f=(0,c.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:h},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:h}}))),g=e=>{let{className:t,rowData:n}=e;const r=f();return o().createElement("div",{className:s()(r.readOnlyLogicOperatorContainer,t)},n&&n.operator?(0,m.Z)(n.operator):d().text("Where"))};g.propTypes={className:l().string,rowData:l().object};const b=g;var y=n(99831);const v=e=>{let{className:t,rowData:n}=e;const r=f();return o().createElement("div",{className:s()(r.readOnlyFilter,t)},n&&n.filter?(0,y.XS2)(n.filter):d().text("equals"))};v.propTypes={className:l().string,rowData:l().object};const w=v;var E=n(94656);const C=e=>{let{classes:t={},rowData:n,previousRowData:r,LogicOperatorComponent:a=b,AttributeSelectorComponent:l,FilterSelectorComponent:i=w,ValuesEditorComponent:c,ActionsComponent:p,filterSelectorRef:d,attributeSelectorProps:m={}}=e,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const f=u();return o().createElement("div",{className:s()(f.row,t.root)},o().createElement(a,{className:t.logicOperatorContainer,rowContext:h,rowData:r}),o().createElement("div",{className:s()(f.rowItem,t.attributeSelectorContainer)},o().createElement(l,{attributeSelectorProps:m,rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,t.filterSelectorContainer)},o().createElement(i,{textFieldInputRef:d,rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,f.fullWidth,t.valuesEditorContainer)},o().createElement(c,{rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,t.actionsContainer,{[f.hidden]:!n})},o().createElement(p,{rowContext:h,rowData:n})))};C.propTypes={classes:l().shape({root:l().string,logicOperatorContainer:l().string,attributeSelectorContainer:l().string,filterSelectorContainer:l().string,valuesEditorContainer:l().string,actionsContainer:l().string}),rowData:E.Xw,previousRowData:E.Xw,LogicOperatorComponent:l().elementType,AttributeSelectorComponent:l().elementType,FilterSelectorComponent:l().elementType,ValuesEditorComponent:l().elementType,ActionsComponent:l().elementType,filterSelectorRef:l().object,attributeSelectorProps:l().shape({onRestoreFocus:l().func,onOpen:l().func,disablePopoverRestoreFocus:l().bool})};const x=(0,r.memo)(C)},41315:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(17440),s=n(23598),c=n(94656);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}const p=e=>{let{className:t,rowClasses:n,rowsData:r,lastRowAttributeSelectorProps:a,filterSelectorRef:l,filterSelectorRefIndex:c}=e,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const d=(e,t,r)=>{const d=t>0?(0,i.path)([t-1],r):null,m=t===r.length?{attributeSelectorProps:a}:{};return o().createElement(s.Z,u({key:e&&e.id,rowData:e,previousRowData:d,classes:n,filterSelectorRef:t===c?l:void 0},p,m))};return o().createElement("div",{className:t},r.map(d),d(null,r.length,r))};p.propTypes={className:l().string,rowClasses:l().shape({root:l().string,logicOperatorContainer:l().string,attributeSelectorContainer:l().string,filterSelectorContainer:l().string,valuesEditorContainer:l().string,actionsContainer:l().string}),rowsData:l().arrayOf(c.Xw),LogicOperatorComponent:l().elementType,AttributeSelectorComponent:l().elementType,FilterSelectorComponent:l().elementType,ValuesEditorComponent:l().elementType,ActionsComponent:l().elementType,filterSelectorRef:l().object,filterSelectorRefIndex:l().number,lastRowAttributeSelectorProps:l().shape({onRestoreFocus:l().func,onOpen:l().func,disablePopoverRestoreFocus:l().bool})};const d=(0,r.memo)(p)},94175:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),a=n(52730),l=n(59431),i=n(99831),s=n(97991);const c=e=>{let{sourceType:t,className:n,classes:r}=e;const c=(0,a.useSelector)(l.ZP.selectors.getMetadata),{uri:u,icon:p}=(0,i.PWK)(c,t)||{},d=u?(0,i.tH7)(c,u)[0]:"",m=p?(0,i.vPL)("https://s3.amazonaws.com/reltio.images/api",p):null;return o().createElement(s.Z,{className:n,avatarText:d,icon:m,variant:"square",rootClasses:r})}},87760:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(99831),o=n(24328),a=n.n(o),l=n(81303),i=n(13074);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const d=e=>{let{values:t,valueContainerClassName:n}=e,r=p(e,["values","valueContainerClassName"]);return a().createElement(a().Fragment,null,(t||[]).map((e=>a().createElement("div",{key:e.uri,className:n},a().createElement(l.Z,u({attributeValue:e},r))))))},m=(0,o.memo)((e=>{let{expanded:t,LabelRenderer:n,RightSlot:o}=e,l=p(e,["expanded","LabelRenderer","RightSlot"]);const{attributeType:c,values:u,valueContainerClassName:m}=l;switch(c.type){case r.oS0.TYPE_NESTED:case r.oS0.TYPE_REFERENCE:return d(s({expanded:t,LabelRenderer:n,RightSlot:o},l));case r.oS0.TYPE_IMAGE:return a().createElement("div",{className:m},a().createElement(i.Z,{attributeType:c,attributeValues:u,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return d(s({},l))}}))},63149:(e,t,n)=>{n.d(t,{hR:()=>c,nX:()=>u,RT:()=>p,pu:()=>d,BF:()=>m});var r=n(24328),o=n.n(r),a=n(99831),l=n(17440),i=n(31276);const s=(0,r.createContext)(null),c=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children"]);return o().createElement(s.Provider,{value:n},t)},u=e=>{const{getCrosswalkColor:t=(0,l.pipe)(a.uKF,a.CJp)}=(0,r.useContext)(s)||{};return e?t(e):""},p=()=>{const{highlightedCrosswalks:e=[]}=(0,r.useContext)(s)||{};return e},d=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:n=i.ZT}=(0,r.useContext)(s)||{},o=!!e&&!!t.find((0,l.eqBy)(a.uKF,e));return{isHighlighted:o,isDimmed:t.length>0&&!o,highlightCrosswalk:(0,r.useCallback)((()=>n(e,!0)),[e,n]),removeHighlight:(0,r.useCallback)((()=>n(e,!1)),[e,n])}},m=e=>{const{toggleCrosswalkFocus:t=i.ZT,focusedCrosswalks:n=[]}=(0,r.useContext)(s)||{};return{isFocused:!!e&&n.some((0,l.eqBy)(a.uKF,e)),toggleCrosswalkFocus:(0,r.useCallback)((()=>t(e)),[e,t])}}},97250:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Nc});var r=n(8598),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l),s=n(44443),c=n(36138),u=n(22664),p=n(52730),d=n(17440),m=n(99831),h=n(10237),f=n(17554),g=n(49759),b=n(6521);const y={FIND_MATCHES:"findMatches",POTENTIAL_MATCHES:"potentialMatches",NOT_A_MATCH:"notAMatch"},v="FULL_SCREEN",w="HIDDEN",E="VISIBLE";var C=n(20562),x=n(58662),O=n(99136);const S=(0,l.createContext)({reloadData:()=>{},setReloadHandler:()=>{}}),R=(()=>{let e;return{reloadData:()=>{e&&e()},setReloadHandler:t=>{e=t}}})(),P=e=>{let{children:t}=e;return i().createElement(S.Provider,{value:R},t)};P.propTypes={children:a().node};const k=()=>{const e=(0,l.useContext)(S);if(void 0===e)throw new Error("useReloadData must be used within a ReloadDataProvider");return e};var T=n(31276),M=n(86361);function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const I=(0,l.createContext)(null),A=(0,l.createContext)(null),D="UPDATE_COMPARISON_VIEW_MODE",Z="SET_GLOBAL_SPINNER",B={setComparisonViewMode:(0,T.zD)(D),setGlobalSpinner:(0,T.zD)(Z)},V=(e,t)=>{switch(t.type){case D:return j({},e,{comparisonViewMode:t.payload});case Z:return j({},e,{isGlobalSpinnerActive:t.payload})}},L=e=>{let{children:t}=e;const[n,r]=(0,l.useReducer)(V,{comparisonViewMode:w,isGlobalSpinnerActive:!1}),o=(0,M.o)({actions:B,dispatch:r});return i().createElement(I.Provider,{value:n},i().createElement(A.Provider,{value:o},t))};L.propTypes={children:a().node};const z=()=>{const e=(0,l.useContext)(I);if(void 0===e)throw new Error("useViewState must be used within a ViewStateProvider");return e},H=()=>{const e=(0,l.useContext)(A);if(void 0===e)throw new Error("useViewStateActions must be used within a ViewStateProvider");return e},F=i().createContext(null);F.displayName="ColumnHandlerContext";var W=n(99341);const _=e=>({filter:"equals",fieldName:"type",values:[e]}),U=(e,t,n)=>{const r=m.wSh.fromNull(e).map(_).orSome("");return m.wSh.fromNull(t).map((e=>Object.entries(e).map((e=>{let[t,r]=e;const o=n.find((0,d.propEq)("id",t));return(0,W.su)(o,r)})))).orSome([]).concat(r)};var G=n(87918),q=n.n(G);const $=(0,d.pipe)((0,d.map)((e=>({id:(0,m.Tde)(e.uri),label:(0,m.idV)(e.label),dataTypeDefinition:(0,m.PFL)(e)})))),X=(0,d.pipe)(m.Fof,$),Y=(0,d.pluck)("id"),Q=(0,d.curry)(((e,t)=>e.map(m.Tde).some((e=>t.id===e||J(t)&&ee(t,e))))),K=e=>(0,m.QZu)(e.dataTypeDefinition),J=e=>(0,m.YkG)(e.dataTypeDefinition),ee=(0,d.curry)(((e,t)=>t.startsWith(`${e.id}.`))),te=(0,d.curry)(((e,t)=>K(t)&&e.some((e=>{let{id:n}=e;return ee(t,n)})))),ne=e=>(0,d.either)((0,d.includes)(d.__,e),te(e)),re=(e,t)=>(0,d.pipe)((0,d.reject)(K),(0,d.filter)(Q(e)))(t);var oe=n(85229);const ae=e=>{let{defaultColumnsData:t,additionalColumnsData:n,metadata:r,entityType:o}=e;return(0,l.useMemo)((()=>{const e=X(r,o),a=t.concat(n||[]).concat(e),l=(0,m.qhs)(r,o),i=((e,t)=>{const[n,r]=(0,d.pipe)((0,d.reject)(K),(0,d.partition)(Q(e)))(t);return n.length?[{id:"match",label:q().text("Match attributes"),columns:t.filter(ne(n))},{id:"all",label:q().text("All attributes"),columns:t.filter(ne(r))}]:t})(l,a);return[a,i,(0,d.pipe)(re,(0,d.concat)(t),Y)(l,e)]}),[t,n,r,o])};var le=n(26180);function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){se(e,t,n[t])}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce="RESET",ue="SET_SELECTED_ITEMS",pe="TOGGLE_SELECT",de="SET_OPTIONS",me="SET_LIMIT_SELECTION",he=ie({},le.ZP.actions,{reset:(0,T.zD)(ce),toggleSelect:(0,T.zD)(pe),setSelectedItems:(0,T.zD)(ue),setOptions:(0,T.zD)(de),setLimitSelection:(0,T.zD)(me)}),fe=(e,t)=>{switch(t.type){case ce:return ie({},t.payload);case de:return ie({},e,{options:t.payload});case ue:return ie({},e,{selectedItems:t.payload});case pe:return(0,d.evolve)({selectedItems:n=>{const r=t.payload,o=n.findIndex((e=>e===r));if(o>-1)return(0,d.remove)(o,1,n);{const{limitSelection:t}=e;return(0,d.pipe)((0,d.when)((0,d.both)((0,d.complement)(d.isNil),(0,d.propSatisfies)((0,d.gte)(d.__,t),"length")),(0,d.take)(t-1)),(0,d.append)(r))(n)}}},e);case me:return ie({},e,{limitSelection:t.payload});default:return le.ZP.reducer(e,t)}},ge=(e,t,n,r)=>{const{field:o,order:a}=t,i={visibleColumns:e,filters:null,sorting:{field:o,order:a},page:0,rowsPerPage:n,selectedItems:[],options:r,limitSelection:null},[s,c]=(0,l.useReducer)(fe,i);return[(0,M.o)({actions:he,dispatch:c}),s,c]};var be=n(93428),ye=n(585);const ve=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:q().text("Can't add relationship")})},we=e=>{(null==e?void 0:e.errorCode)!==m.Xt7.DCR_ALREADY_EXISTS&&Ee(e)},Ee=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:(null==e?void 0:e.errorMessage)||q().text("Something went wrong...")})},Ce=()=>{const{setGlobalSpinner:e}=H(),{isGlobalSpinnerActive:t}=z(),{reloadData:n}=k();return{onStartRequest:(0,l.useCallback)((()=>{e(!0)}),[e]),onFinishRequest:(0,l.useCallback)((()=>{e(!1),n()}),[n,e]),isGlobalSpinnerActive:t}},xe=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:l=T.ZT}=e;const{isGlobalSpinnerActive:s,onFinishRequest:c,onStartRequest:u}=Ce();return i().createElement(be.H,{className:n,disabled:s,entities:r,entity:o,mode:a,onMenuClose:l,onStartRequest:u,onFinishRequest:c,onError:Ee,"data-reltio-id":"reltio-potential-matches-merge-button",ref:t})}));xe.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},xe.displayName="mergeButton";var Oe=n(98808),Se=n(59431);function Re(){return Re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re.apply(this,arguments)}const Pe=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Re({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M10 6v2H4v12.22h12V14h2v6c0 1.05-.82 1.918-1.851 1.994L16 22H4c-1.05 0-1.918-.82-1.994-1.851L2 20V8c0-1.05.82-1.918 1.851-1.994L4 6h6zm4 10v2H6v-2h8zm-3.997-3l-.001 2H6v-2h4.003zM21 2c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1h-7l-2 2 .005-11c0-.55.445-1 .995-1h8zm-10.996 8l-.001 2H6v-2h4.004zm9.286-6.3l-3.17 3.17-1.41-1.42-1.41 1.41 2.82 2.84 4.59-4.58-1.42-1.42z",id:"svg3192636834a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg3192636834b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg3192636834a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3192636834b)",d:"M0 0h24v24H0z"})))},ke=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n}=e;const{selectors:r}=Se.ZP,{setGlobalSpinner:o}=H(),{isGlobalSpinnerActive:a}=z(),i=(0,p.useSelector)(r.getWorkflowPath),s=(0,p.useSelector)(r.getWorkflowEnvironmentUrl),c=(0,p.useSelector)(r.getTenant),u=(0,d.prop)("uri"),h=(0,d.pipe)(d.concat,(0,d.map)(u))([n],t);return[a,(0,l.useCallback)((()=>{o(!0),(0,m.t6d)({workflowPath:i,processType:"potentialMatchReview",objectURIs:h,tenant:c,environment:s}).catch(we).finally((()=>{o(!1)}))}),[i,h,c,s,o])]})({entity:o,entities:r}),h=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),f=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath);return h&&!(0,m.O27)(f)?i().createElement(Oe.K,{className:n,disabled:c,mode:a,label:q().text("Potential match request"),icon:Pe,onClick:u,onMenuClose:s,ref:t}):null}));function Te(){return Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}ke.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},ke.displayName="DCRReviewButton";const Me=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Te({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M19 14v3h3v2h-3v3h-2v-3h-3v-2l3-.001V14h2zM17 2a3 3 0 11-1.293 5.708l-4.535 4.535a5 5 0 11-1.414-1.414l4.534-4.536A3 3 0 0117 2zM7 12a3 3 0 100 6 3 3 0 000-6zm10-8a1 1 0 100 2 1 1 0 000-2z",id:"svg2192258504a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2192258504b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2192258504a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2192258504b)",d:"M0 0h24v24H0z"})))},je=(0,l.forwardRef)(((e,t)=>{let{className:n,mainEntity:r,currentEntity:o,matchRules:a,mode:l="iconButton",onClick:s=T.ZT,onMenuClose:c=T.ZT}=e;return i().createElement(Oe.K,{className:n,mode:l,label:q().text("Add relationship"),icon:Me,onClick:()=>s({mainEntity:r,currentEntity:o,matchRules:a}),onMenuClose:c,ref:t})}));je.propTypes={className:a().string,mainEntity:m.pyR,currentEntity:m.pyR,matchRules:a().arrayOf(a().string),mode:a().oneOf(["iconButton","button","menuItem"]),onClick:a().func,onMenuClose:a().func},je.displayName="CreateRelationButton";var Ne=n(30885);const Ie=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:l=T.ZT}=e;const{isGlobalSpinnerActive:s,onFinishRequest:c,onStartRequest:u}=Ce();return i().createElement(Ne.i,{className:n,disabled:s,entities:r,entity:o,mode:a,onMenuClose:l,onStartRequest:u,onFinishRequest:c,ref:t})}));Ie.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ie.displayName="NotMatchButton";var Ae=n(71153),De=n.n(Ae),Ze=n(8818);function Be(){return Be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(this,arguments)}const Ve=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Be({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M3 15h8v-2H3v2zm0 4h8v-2H3v2zm0-8h8V9H3v2zm0-6v2h8V5H3zm10 0h8v14h-8V5z",id:"svg2461472690a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"#111",fillRule:"evenodd"},i().createElement("mask",{id:"svg2461472690b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2461472690a"})),i().createElement("path",{fillOpacity:".54",fill:"red",mask:"url(#svg2461472690b)",d:"M0 0h24v24H0z"})))};var Le=n(79692),ze=n(41128);const He=(0,Le.Z)((e=>({iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},comparisonButtonSelected:{backgroundColor:e.palette.primary.main,borderRadius:0,"& svg g path":{fill:"#FFFFFF",fillOpacity:1},"&:hover":{backgroundColor:(0,ze._j)(e.palette.primary.main,e.palette.action.hoverOpacity),"& svg g path":{fill:(0,ze._j)("#FFFFFF",e.palette.action.hoverOpacity)}}},comparisonButton:{backgroundColor:"#FFFFFF",borderRadius:0}}))),Fe=e=>{let{className:t,selectedMatchesCount:n}=e;const r=He(),{comparisonViewMode:o}=z(),{setComparisonViewMode:a}=H(),s=o===w,c=n>3,u=(0,l.useCallback)((()=>{a(s?E:w)}),[a,s]),p=(0,l.useMemo)((()=>c?q().text("Select 1-${maxProfilesToCompare} profiles to compare",{maxProfilesToCompare:3}):s?q().text("Show comparison view"):q().text("Hide comparison view")),[s,c]);return i().createElement(Ze.k,{tooltipTitle:p,className:De()(t,{[r.iconButton]:s,[r.comparisonButton]:s,[r.comparisonButtonSelected]:!s}),size:"S",onClick:u,icon:Ve,showForDisabled:!0,disabled:c})};function We(){return We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}Fe.propTypes={entities:a().arrayOf(a().object),entity:m.pyR,className:a().string,selectedMatchesCount:a().number.isRequired};const _e=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",We({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M9 4c4.42 0 8 3.58 8 8s-3.58 8-8 8a8 8 0 01-7.419-5h2.224A6.002 6.002 0 009 18c3.31 0 6-2.69 6-6s-2.69-6-6-6a6.002 6.002 0 00-5.196 3H1.581A8 8 0 019 4zm8 .26c3.45.89 6 4.01 6 7.74 0 3.73-2.55 6.85-6 7.74v-2.09a5.99 5.99 0 000-11.3V4.26zM8 7.5l4.5 4.5L8 16.5V13H0v-2h8V7.5z",id:"svg689336942a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg689336942b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg689336942a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg689336942b)",d:"M0 0h24v24H0z"})))},Ue=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n}=e;const{setGlobalSpinner:r}=H(),{isGlobalSpinnerActive:o}=z(),{reloadData:a}=k(),i=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),s=(0,p.useSelector)(Se.ZP.selectors.getTenant);return[o,(0,l.useCallback)((()=>{r(!0);const e={dtssPath:i,customerTenant:s,entity:n,entities:t};((0,m.biM)(n)?(0,m.XkY)(e):(0,m.uQS)(e)).finally((()=>{r(!1),a()}))}),[t,n,r,a,i,s])]})({entity:n,entities:r});return i().createElement(Oe.K,{className:o,disabled:c,mode:a,label:q().text("Save as potential match"),icon:_e,onClick:u,onMenuClose:s,ref:t})}));Ue.propTypes={entities:a().arrayOf(a().object),entity:m.pyR,className:a().string,mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ue.displayName="ReinstateMatchButton";const Ge=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n,_tenant:r}=e;const{setGlobalSpinner:o}=H(),{isGlobalSpinnerActive:a}=z(),{reloadData:i}=k();return[a,(0,l.useCallback)((()=>{o(!0),(0,m.ck9)(n.uri,t).finally((()=>{o(!1),i()}))}),[t,n,o,i])]})({entity:n,entities:r});return i().createElement(Oe.K,{className:o,disabled:c,mode:a,label:q().text("Save on potential matches"),icon:_e,onClick:u,onMenuClose:s,ref:t})}));Ge.propTypes={className:a().string,entities:a().arrayOf(a().object),entity:m.pyR,mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ge.displayName="SetAMatchButton";const qe=(0,Le.Z)({container:{display:"flex",height:"100%",alignItems:"center",marginLeft:"8px"},mergeButton:{flexShrink:0,marginRight:"8px"},rightButton:{display:"flex",alignItems:"center",marginLeft:"auto"},moreOptions:{marginRight:"-2px"}}),$e={value:a().shape({show:a().bool,config:a().object,entity:m.pyR,entities:a().arrayOf(a().object),matchRules:a().arrayOf(a().string),permission:a().shape({canMerge:a().bool,canAddRelation:a().bool,canMark:a().bool})})},Xe=e=>{let{value:{show:t,entity:n,entities:r,permission:o}}=e;const a=qe(),{canMark:l}=o;return t?i().createElement(i().Fragment,null,i().createElement("div",{className:a.container},l&&i().createElement(Ge,{entity:n,entities:r,className:a.rightButton,mode:"button"}))):null};Xe.propTypes=$e;const Ye=Xe;var Qe=n(34635),Ke=n(87760);const Je=i().createContext({});function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(this,arguments)}Je.displayName="ExpandedContext";const tt=(0,Le.Z)((()=>({complexAttributesHeadRenderer:{height:"100%",width:"100%",display:"flex",alignItems:"flex-start"},complexAttributesHeadLabel:{flex:1},attribute:{whiteSpace:"pre-wrap"},matchedAttribute:{fontWeight:500,height:"100%",margin:"-5px -16px",padding:"5px 16px",background:"rgba(140, 193, 82, 0.12)"}}))),nt=(e=>{const t=(0,l.forwardRef)(((t,n)=>{const{attributeType:r}=t,{expandedMap:o}=(0,l.useContext)(Je),a=o[r.uri];return i().createElement(e,et({},t,{expanded:a,ref:n}))}));return t.displayName="WithExpanded",t})(Ke.Z),rt=e=>{let{value:{attributeType:t,attributeValues:n,matched:r=!1}}=e;const o=tt();return i().createElement("div",{className:De()(o.attribute,{[o.matchedAttribute]:r})},i().createElement(nt,{values:n,attributeType:t}))};function ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",ot({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M21.843 14.8l-4.242 4.243-4.243-4.243h8.485zM8 6v12H5V6h3zm2 8.919L12.941 18H10v-3.081zM13 6v6h-3V6h3zm5 0v6h-3V6h3z",id:"svg2425089452a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2425089452b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2425089452a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2425089452b)",d:"M0 0h24v24H0z"})))};function lt(){return lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lt.apply(this,arguments)}const it=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",lt({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M15.879 12.879l4.242 4.242-4.242 4.243v-8.485zM8 6v12H5V6h3zm5 0v12h-3V6h3zm5 0v5.464l-3-3V6h3z",id:"svg1931425825a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg1931425825b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg1931425825a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1931425825b)",d:"M0 0h24v24H0z"})))},st=e=>{let{label:t,attributeType:n}=e;const r=tt(),{expandedMap:o,onExpandType:a}=(0,l.useContext)(Je),s=(0,l.useCallback)((()=>a(n.uri)),[a,n]),c=o[n.uri];return i().createElement("div",{className:r.complexAttributesHeadRenderer},i().createElement("div",{className:r.complexAttributesHeadLabel},t),i().createElement(Ze.k,{icon:c?at:it,size:"XS",onClick:s}))};st.propTypes={label:a().string,attributeType:m.EMD};var ct=n(22385),ut=n(93517),pt=n(87685);const dt=(0,Le.Z)({container:{position:"relative",width:"100%",height:"87px",display:"flex",overflow:"hidden"},closeButton:{position:"absolute",backgroundColor:"#FFFFFF",zIndex:1,borderRadius:"2px",margin:"4px"},profileCard_container:{overflow:"hidden"},profileCard_label:{display:"-webkit-box",lineClamp:2,boxOrient:"vertical",whiteSpace:"normal"},"@media all and (-ms-high-contrast: none), (-ms-high-contrast: active)":{profileCard_label:{display:"block",whiteSpace:"nowrap"}},profileCard_secondaryLabel:{display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}),mt=e=>{let{value:{entity:t,showCloseButton:n,onClose:r}}=e;const o=dt();return i().createElement("div",{className:o.container},n&&i().createElement(ct.Z,{className:o.closeButton,icon:pt.default,onClick:r,size:"XXS"}),i().createElement(ut.Z,{entity:t,classes:{container:o.profileCard_container,secondaryLabel:o.profileCard_secondaryLabel,label:o.profileCard_label}}))};mt.propTypes={value:a().shape({entity:m.pyR,showCloseButton:a().bool,onClose:a().func})};const ht=mt;var ft=n(22071);const gt=(0,Le.Z)({container:{paddingTop:"7px"}});var bt=n(84504),yt=n(59119),vt=n(5434),wt=n(55847),Et=n(35071),Ct=n(24737),xt=n(89140),Ot=n(43054);const St=e=>"potentialMatchReview"===e.processType,Rt=(0,Le.Z)({container:{position:"relative",width:"100%",minHeight:"86px",display:"flex",overflow:"hidden"},assigneeSelector:{},assigneeContainer:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"16px 14px 16px 48px"}});function Pt(){return Pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pt.apply(this,arguments)}const kt=(0,d.pick)(["processInstanceComments","taskId"]),Tt=e=>{let{entity:t,match:n}=e;const r=Rt(),{tasks:o,loadTasks:a}=(e=>{let{entity:t,match:n}=e;const r=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),o=(0,p.useSelector)(Se.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,p.useSelector)(Se.ZP.selectors.getTenant),i=(0,oe._)(),{uri:s}=t,c=(0,m.ev7)(n),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)([]),b=(0,l.useCallback)((()=>{r&&c!==s&&(h(!0),i((0,m.uT0)({entityUri:s,workflowPath:r,environment:o,tenant:a})).then((e=>{const{data:t}=e,n=(0,d.propSatisfies)((0,d.includes)(c),"objectURIs"),r=(0,d.allPass)([St,n]),o=t.filter(r);g(o)})).finally((e=>h(!1))))}),[s,o,a,r,c]);return{enabled:!!r,loading:u,tasks:f,loadTasks:b}})({entity:t,match:n}),{isPending:s,sendMergeAllRequest:c}=(0,bt._)({entity:t,entities:[n.object]}),{isPending:u,sendMarkAsNotMatchRequest:h}=(0,yt.m)({entity:t,entities:[n.object]}),f={Merge:c,NotAMatch:h};(0,l.useEffect)((()=>{a()}),[a]);const g=o[0],b=(g&&g.possibleActions||[]).map((e=>{let{action:t,label:n}=e;return{text:n,onClick:f[t]}})),{assignee:y,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:E}=(0,vt.r)(g||{}),C=b.length>0?i().createElement(wt.Z,{buttonComponent:ct.Z,buttonProps:{icon:Ot.Z,size:"L"},enabled:!s||!u,menuId:"custom-actions",menuItems:b}):null;return g?i().createElement("div",{className:r.container},i().createElement(Et.Z,Pt({},(e=>({date:e.dueDate,type:e.processDefinitionDisplayName,createdBy:e.createdBy,step:e.displayName}))(g),{Actions:C}),i().createElement("div",{className:r.assigneeContainer},i().createElement(Ct.Z,{className:r.assigneeSelector,enabled:!E||y,getOptions:v,onChange:w,hideSelectedOptions:!1,label:q().text("Assigned to"),value:y,defaultOptions:!0})),i().createElement(xt.V,kt(g)))):null};Tt.propTypes={entity:m.pyR,match:m.nqG};const Mt=e=>{let{value:{entity:t,match:n}}=e;return i().createElement(Tt,{entity:t,match:n})};Mt.propTypes={value:a().shape({entity:m.pyR,match:m.nqG})};const jt=[{id:"entityCard",label:"",cellRenderer:ht},{id:"matchControls",cellRenderer:()=>null},{id:"matchMethod",label:"Match Method",cellRenderer:e=>{let{value:{metadata:t,entity:n,match:r,entitiesMap:o,show:a}}=e;const l=gt();return a?i().createElement("div",{className:l.container},i().createElement(ft.Z,{entity:n,match:r,entitiesMap:o,metadata:t})):null}},{id:"workflowCard",label:"",cellRenderer:Mt},{id:"entityId",label:"Entity ID"}],Nt=(0,d.curry)(((e,t)=>`${e}/attributes/${t}`)),It=(0,d.pipe)((0,d.split)("/"),d.last),At="1px solid rgba(0,0,0,0.12)",Dt="2px solid rgba(0,0,0,0.12)",Zt=(0,Le.Z)((e=>({container:{overflow:"auto",height:"100%",width:"100%"},comparisonTable:{borderSpacing:0,"& td, & th":{borderRight:At,borderBottom:At,margin:0,verticalAlign:"top",textAlign:"left",fontSize:"13px",boxSizing:"border-box",wordBreak:"break-word",wordWrap:"break-word"},"& td":{minWidth:310,maxWidth:310,padding:"5px 16px",overflow:"hidden",height:0},"& td:empty, th:empty":{padding:"0px 16px"},"& th":{minWidth:212,maxWidth:212,padding:"5px 8px"},"& thead tr:first-child th:first-child":{borderBottom:"none",borderTop:"none"},"& td:first-child, th:first-child":{borderLeft:At,position:"sticky",left:"0",zIndex:2,backgroundColor:"white",color:e.palette.text.secondary,fontWeight:"normal"},"& td:nth-child(2), th:nth-child(2)":{borderRight:Dt,position:"sticky",left:"212px",zIndex:2},"& thead tr:first-child td, & thead tr:first-child th":{borderTop:"none",position:"sticky",top:"0",backgroundColor:"white",height:88,padding:0,zIndex:2},"& thead tr:nth-child(2) td, & thead tr:nth-child(2) th":{position:"sticky",top:"88px",backgroundColor:"white",height:48,padding:0,zIndex:2},"& thead tr:nth-child(3) td, & thead tr:nth-child(3) th":{position:"sticky",top:"136px",backgroundColor:"white",borderBottom:Dt,zIndex:2},"& thead tr:nth-child(-n+3) td:nth-child(-n+2), & thead tr:nth-child(-n+3) th:nth-child(-n+2)":{zIndex:3},"table& tr td:nth-child(2), th:nth-child(2)":{backgroundColor:"rgb(245,245,245)"}}})));function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vt=e=>{let{className:t,entity:n,matches:r,metadata:o,config:a,selectedAttributes:s,entitiesMap:c,controlsRenderer:u}=e;const p=Zt(),h=(0,l.useMemo)((()=>((e,t,n,r)=>{const o=n||(e=>Object.keys(e.attributes).map(Nt(e.type)))(t),a=o.map((n=>{const r=(0,m.zeJ)(e,n,t.type),o=(0,m.xy8)(n);return r?{id:`${o}.${It(n)}`,label:r.label,attributeType:r,cellRenderer:rt,headCellRenderer:(0,m.YkM)(r)?st:void 0}:null})).filter(d.identity);return(e=>jt.map((0,d.when)((0,d.propEq)("id","matchControls"),(0,d.assoc)("cellRenderer",e))))(r).concat(a)})(o,n,s,u)),[o,n,s,u]),f=(0,l.useContext)(F),g=(0,l.useMemo)((()=>((e,t,n,r,o,a,l)=>[{object:n,isMainEntity:!0}].concat(r).map((r=>t.reduce(((t,i)=>(t[i.id]=((e,t,n,r,o,a,l)=>{const{object:i,isMainEntity:s,matchRules:c}=t;switch(o.id){case"entityId":return(0,m.BTI)(i);case"entityCard":return{entity:i,showCloseButton:!s,onClose:()=>l(t)};case"matchControls":return{show:!s,entity:r,entities:[i],matchRules:c,permission:(0,m.hXd)(e,a,i,r,c),config:a};case"matchMethod":return{metadata:e,entity:r,match:t,entitiesMap:n,show:!s&&!!c};case"workflowCard":return{entity:r,match:t}}if((0,m.vZp)(o.id)){const t=(0,m.xy8)(o.attributeType),n=(0,d.pipe)((0,d.pathOr)([],[t,o.attributeType.name]),(0,d.filter)(m.OXP))(i),a=(0,m.w80)(e,r.type,c||[]).includes((0,d.path)(["attributeType","uri"],o))&&!(0,m.O27)(n);return{attributeType:o.attributeType,attributeValues:n,matched:a}}})(e,r,o,n,i,a,l),t)),{}))))(o,h,n,r,c,a,f)),[o,h,r,n,c,a,f]),[b,y]=(0,l.useState)({}),v=(0,l.useCallback)((e=>{y((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Bt(e,t,n[t])}))}return e}({},t,{[e]:!t[e]})))}),[]),w=(0,l.useMemo)((()=>({expandedMap:b,onExpandType:v})),[v,b]);return i().createElement("div",{className:De()(p.container,t)},i().createElement("div",null,i().createElement(Je.Provider,{value:w},i().createElement(Qe.Z,{className:p.comparisonTable,rowsData:h,columnsData:g,theadRowsNumber:3}))))};Vt.propTypes={className:a().string,entity:m.pyR,matches:a().arrayOf(m.nqG),metadata:m.pGS,config:m.yxQ,selectedAttributes:a().arrayOf(a().string),entitiesMap:a().object,controlsRenderer:a().func};var Lt=n(94079),zt=n(92778),Ht=n(29103),Ft=n(83911);function Wt(){return Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}const _t=e=>{let{isFullscreen:t=!1,onClick:n=d.identity}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isFullscreen","onClick"]);return i().createElement(Ze.k,Wt({size:"L",icon:t?Ft.Z:Ht.Z,tooltipTitle:t?q().text("Exit full screen"):q().text("Full screen"),onClick:n},r))};_t.propTypes={isFullscreen:a().bool,onClick:a().func};const Ut=_t,Gt=e=>{let{onClick:t}=e;return i().createElement(ct.Z,{size:"L",icon:pt.default,onClick:t})};Gt.propTypes={onClick:a().func};const qt=Gt;var $t=n(60894),Xt=n(94656);const Yt=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},padding:"8px 15px 8px 0",borderLeft:"1px solid rgba(0,0,0,0.12)"},flex1:{flex:1},title:{display:"flex",flexDirection:"row",alignItems:"center"}}))),Qt=e=>{let{columnsData:t,selectedColumns:n,onChangeColumns:r}=e;const o=Yt(),{setComparisonViewMode:a}=H(),{comparisonViewMode:s}=z(),c=(0,l.useCallback)((()=>{a(w)}),[a]),u=(0,l.useCallback)((()=>{a(s!==v?v:E)}),[a,s]);return i().createElement(zt.Z,{title:"",classes:{root:o.header}},i().createElement("div",{className:De()(o.flex1,o.title)},i().createElement(qt,{onClick:c}),i().createElement(Ut,{onClick:u,isFullscreen:s===v}),i().createElement(Lt.Typography,null,q().text("Comparison view"))),i().createElement($t.Z,{title:q().text("Show/hide attributes"),tooltipTitle:q().text("Show/hide attributes"),columnsData:t,selectedColumns:n,onChangeColumns:r}))};Qt.propTypes={columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func};const Kt=(0,d.pipe)((0,d.split)("."),(0,d.slice)(0,2),(0,d.join)(".")),Jt=(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,Kt)),d.uniq),en=(0,d.curry)(((e,t)=>(0,d.reduce)(((t,n)=>(n.id.startsWith(`${e}.`)&&!(0,m.QZu)(n.dataTypeDefinition)&&t.push(n.id),t)),[])(t))),tn=(0,d.curry)(((e,t)=>(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,(t=>{const n=Kt(t),r=((e,t)=>e.reduce(((e,n)=>(0,d.pipe)((0,d.prop)("columns"),en(t),d.flatten,(0,d.concat)(e))(n)),[]))(e,n);return r.length?r:t}))),d.flatten,d.uniq)(t))),nn=(0,d.pipe)((0,d.prop)("id"),(0,d.both)(m.vZp,(0,d.pipe)((0,d.split)("."),(0,d.propSatisfies)((0,d.lt)(2),"length")))),rn=(0,d.map)((0,d.evolve)({columns:(0,d.reject)(nn)})),on=(0,Le.Z)((()=>({container:{display:"flex",flexDirection:"column"},table:{flex:1}}))),an=e=>{let{classes:t,columnsData:n,selectedColumns:r,onChangeColumns:o,selectedItems:a,config:l,metadata:s,entity:c,entitiesMap:u,controlsRenderer:p}=e;const h=on(),f=a.slice(-3),g=Jt(r),b=(y=c.type,v=g,(0,d.pipe)((0,d.filter)(m.vZp),(0,d.map)((e=>(0,m.h2W)(e,y))))(v));var y,v;return i().createElement("div",{className:De()(t.root,h.container)},i().createElement(Qt,{columnsData:rn(n),selectedColumns:g,onChangeColumns:(0,d.pipe)(tn(n),o)}),i().createElement(Vt,{className:h.table,entity:c,metadata:s,config:l,matches:f,selectedAttributes:b,entitiesMap:u,controlsRenderer:p}))};an.propTypes={entity:m.pyR,metadata:m.pGS,columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func,selectedItems:a().arrayOf(a().object),classes:a().object,config:m.yxQ,entitiesMap:a().object,controlsRenderer:a().func},an.defaultProps={classes:{}};const ln=e=>{let{fullScreenContainer:t,children:n}=e;return t?i().createElement(Lt.Portal,{container:t},n):i().createElement("div",null)};ln.propTypes={fullScreenContainer:a().instanceOf(Element),children:a().oneOfType([a().node,a().arrayOf(a().node)])};var sn=n(46177),cn=n(74402),un=n(94646),pn=n(97946),dn=n(25461),mn=n(85709),hn=n(92332),fn=n(67353);function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){bn(e,t,n[t])}))}return e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yn={position:"relative",whiteSpace:"pre",padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"},color:"rgba(0,0,0,0.87)"},vn={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},wn=(e,t)=>({"& > *":{position:"relative"},"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:e,pointerEvents:"none","div.hoveredRow &":{background:t||"none"}},"& $defaultWrapper::after":{background:`linear-gradient(to right, ${(0,ze.U1)(e,0)}, ${e} 100%)`,"div.hoveredRow &":{background:t&&`linear-gradient(to right, ${(0,ze.U1)(t,0)}, ${t} 100%)`}}}),En=(0,Le.Z)((e=>{const t=(0,ze.$n)(e.palette.primary.main,.88),n=(0,ze.$n)(e.palette.primary.main,.82),r=(0,ze.$n)("rgb(140,193,82)",.88),o=(0,ze.$n)("rgb(0, 0, 0)",.96),a={color:e.palette.primary.main,cursor:"pointer",textDecoration:"none"};return{link:a,hidden:{visibility:"hidden"},rowCheckbox:{marginLeft:"-9px",marginRight:"19px"},headCheckbox:{marginLeft:"6px"},headCell:{display:"flex",alignItems:"center",height:"56px",fontSize:"12px",position:"relative",flex:1,overflow:"hidden",color:"rgba(0,0,0,0.87)","&::after":gn({},vn,{width:"30px"})},headCellWithEntity:{height:"100%",display:"flex",flexDirection:"column"},rowCell:{fontSize:"12px",overflow:"hidden"},rowCellFirstColumn:{height:"100%"},firstEntityCell:{maxHeight:"200px"},entityRowCell:{fontSize:"12px",position:"relative"},entityRowCellSelected:wn(o),rowCellHighlighted:wn(r),rowCellSelected:wn(t,n),defaultWrapper:gn({},yn,{"&::after":gn({},vn,{"div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"}})}),hoveredDefaultWrapper:gn({},yn),entityWrapper:{paddingLeft:"12px"},profileWrapper:{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",position:"relative"},entityLabel:gn({},a,{fontWeight:500}),commentsContainer:{position:"absolute",right:0,top:0,zIndex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"15px",backgroundColor:"#fff","&$checked":{backgroundColor:t}},checked:{},matchRulesWrapper:{padding:"12px 15px 4px 10px",display:"flex",alignItems:"center",boxSizing:"border-box"},blobWrapper:gn({},yn,{whiteSpace:"pre-wrap",height:"100px",boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}),imageWrapper:gn({},yn,{display:"flex","& > img":{height:"64px",width:"64px"}}),referenceWrapper:{display:"flex",alignItems:"center",boxSizing:"border-box",height:"48px"},entityAvatar:{transform:"scale(0.5)",marginLeft:"-10px"},collapseButton:{position:"absolute",left:"40px",zIndex:2},dragIcon:{position:"absolute",left:"-5px",zIndex:2,opacity:.38}}})),Cn=(0,fn.Z)((e=>{const t=En();return i().createElement("div",{className:t.headCell},i().createElement(hn.default,e))}));var xn=n(72768);const On=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const r=En();return i().createElement("div",{className:r.defaultWrapper},i().createElement(xn.Z,{value:t,dataTypeDefinition:n}))};On.propTypes={columnData:a().shape({dataTypeDefinition:a().object}),value:a().any};const Sn=On;var Rn=n(52049),Pn=n(74566),kn=n(31039),Tn=n(32528),Mn=n(14940);const jn=e=>{const{value:t,rowIndex:n,rowValue:r,onToggleSelect:o,entityToMatch:a,isRowSelected:s,hoverRowIndex:c}=e,u=En(),p=(0,l.useContext)(Rn.B),d=t!==a,h=n===c,f=0===n,g=h?u.hoveredDefaultWrapper:u.defaultWrapper,b=t.uri!==a.uri&&!h;return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(g,u.profileWrapper,u.entityWrapper,{[u.firstEntityCell]:f&&!d})},h&&i().createElement(Mn.Z,{className:u.dragIcon}),i().createElement(Pn.Z,{className:u.collapseButton,rowIndex:n,rowValue:r}),i().createElement(Lt.Checkbox,{className:De()(u.rowCheckbox,{[u.hidden]:!d}),checked:s,onChange:o,"data-reltio-id":`reltio-matches-table-${p?p+"-":""}checkbox-${n}`}),i().createElement(kn.Z,{value:(0,m.wwR)(t),className:u.entityLabel},(0,m.idV)(t.label)),b&&i().createElement(un.Z,{className:De()(u.commentsContainer,{[u.checked]:s}),uri:(0,m.E_P)(a.uri,t.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:a.uri,matchEntityUri:t.uri}),allowOnlyOneComment:!0})))};jn.propTypes={value:m.pyR,rowIndex:a().number,rowValue:a().shape({rawValue:a().object}),onToggleSelect:a().func,isRowSelected:a().bool,columnsData:a().array,entityToMatch:m.pyR,hoverRowIndex:a().number};const Nn=(0,Tn.Z)(((e,t)=>{let{onToggleSelect:n,entityToMatch:r}=e,{rowValue:o,value:a}=t;const{rawValue:l}=o;return{onToggleSelect:()=>n(l),isRowSelectable:a!==r,entityToMatch:r}}))(jn);const In=e=>{let{isAllSelected:t,isSomeSelected:n,onCheckboxClick:r,isComparisonViewShown:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isAllSelected","isSomeSelected","onCheckboxClick","isComparisonViewShown"]);const l=En();return i().createElement("div",{className:l.headCell},i().createElement(Lt.Checkbox,{className:l.headCheckbox,indeterminate:n&&!t,checked:t,disabled:!n&&o,onChange:()=>r(),"data-reltio-id":"reltio-matches-table-selectAll-checkbox"}),i().createElement(hn.default,a))};In.propTypes={isSomeSelected:a().bool,isAllSelected:a().bool,onCheckboxClick:a().func,isComparisonViewShown:a().bool};const An=(0,Tn.Z)((e=>{let{selected:t,isAllSelected:n,onResetSelect:r,onSelectAll:o,isComparisonViewShown:a}=e;const l=!!t&&t.length>0;return{isSomeSelected:l,isAllSelected:n,onCheckboxClick:l?r:o,isComparisonViewShown:a}}))((0,fn.Z)(In));var Dn=n(74615),Zn=n(93301);const Bn=e=>{let{value:{transitiveMatchRules:t=[],matchRules:n=[]}={}}=e;const r=En();return i().createElement("div",{className:r.matchRulesWrapper},n.length>0&&i().createElement(Dn.Z,{matchRules:n}),t.length>0&&i().createElement(Zn.Z,{transitiveMatchRules:t}))};Bn.propTypes={value:a().shape({transitiveMatchRules:a().array,matchRules:a().array})};const Vn=Bn,Ln=e=>{let{value:{mlMatchRules:t=[]}={}}=e;const n=En();return i().createElement("div",{className:n.matchRulesWrapper},t.length>0&&i().createElement(Dn.Z,{isMlMatch:!0,matchRules:t}))};Ln.propTypes={value:a().shape({mlMatchRules:a().array})};const zn=Ln,Hn=e=>{let{value:t}=e;const n=En();return i().createElement("div",{className:n.blobWrapper,onScroll:T.UW},t)};Hn.propTypes={value:a().any};const Fn=Hn,Wn=e=>{let{value:t}=e;const n=En(),r=(0,m.efz)({value:t});return r&&i().createElement("div",{className:n.imageWrapper},i().createElement("img",{src:r}))};Wn.propTypes={value:a().any};const _n=Wn;var Un=n(31254);const Gn=e=>{let{value:t}=e;const n=En(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata);return t&&i().createElement("div",{className:De()(n.defaultWrapper,n.referenceWrapper)},i().createElement(Un.Z,{className:n.entityAvatar,entityType:(0,m.nt9)(r,(0,m.CZ8)(t).type)}),i().createElement(kn.Z,{value:(0,m.CZ8)(t).objectURI,className:n.link},(0,m.idV)(t.label)))};Gn.propTypes={value:a().any};const qn=Gn;function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xn=(0,d.split)("."),Yn=(e,t,n,r)=>n.map((o=>{const a=o.object,l=(0,m.ZYr)(e,n,a,r),i=o.matchRules||[],s=o.matchScore||0,[c,u]=(0,d.isEmpty)(l)?(0,d.pipe)((0,m.LS0)(e,a.type),m.UkJ)(i):[[],[]],p=(0,m.w80)(e,a.type,i),h={entity:a,matchRules:u,mlMatchRules:c,transitiveMatchRules:l,matchScore:s};return(0,d.pipe)((0,d.reduce)(((e,t)=>(0,d.assoc)(t.id,((e,t,n)=>{let{entity:r,transitiveMatchRules:o,matchRules:a,mlMatchRules:l,matchScore:i}=n;switch(t.id){case"label":return r;case"id":return(0,m.BTI)(r);case"matchRules":return{transitiveMatchRules:o,matchRules:a};case"mlMatchRules":return{mlMatchRules:l};case"score":return i;default:{const[e,...n]=Xn(t.id);return(0,d.pipe)((0,d.prop)(e),(0,m.tT_)(n))(r)}}})(0,t,h),e)),{}),(0,d.assoc)("matchAttributes",p),(0,d.assoc)("rawValue",o))(t)})),Qn=e=>{if((0,m.vZp)(e)){const[,...t]=Xn(e);return t.length>1?t.slice(0,-1):null}return null},Kn=e=>{switch(e.id){case"label":return Nn;case"matchRules":return Vn;case"mlMatchRules":return zn;default:return(e=>{switch(e){case m.oS0.TYPE_BLOB:return Fn;case m.oS0.TYPE_IMAGE:return _n;case m.oS0.TYPE_REFERENCE:return qn;default:return Sn}})(e.dataTypeDefinition.type)}};function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}const er=e=>{let{rowValue:t,cell:n,CellValueRenderer:r,isRowSelected:o,isCellHighlighted:a,columnIndex:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["rowValue","cell","CellValueRenderer","isRowSelected","isCellHighlighted","columnIndex"]);const c=En(),u=0===l;return i().createElement("div",{className:De()({[c.rowCellSelected]:o,[c.rowCellHighlighted]:a,[c.rowCellFirstColumn]:u},c.rowCell)},n.values.map(((e,n)=>i().createElement(r,Jn({key:n,value:e,rowValue:t,isRowSelected:o},s)))))};er.propTypes={rowValue:a().object,cell:a().object,CellValueRenderer:a().elementType,isRowSelected:a().bool,isCellHighlighted:a().bool,columnIndex:a().number};const tr=(0,Tn.Z)(((e,t)=>{let{selected:n}=e,{columnData:r,rowValue:o,cell:a}=t;return{isRowSelected:!!n&&n.includes(o.rawValue),isCellHighlighted:Q(o.matchAttributes,r)&&!a.values.every(m.O27)}}))(er),nr=(0,Le.Z)((e=>({tableContainer:{flex:1,display:"flex",color:"rgba(0,0,0,0.54)",overflow:"hidden"},rowActionButtonsWrapper:{height:"100%",display:"flex",alignItems:"center",marginRight:"1px"},rowActionButtons:{backgroundColor:"rgba(238, 238, 238, 1)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",backgroundColor:"rgba(238, 238, 238, 1)",borderLeft:"1px solid rgba(0,0,0,0.12)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},checked:{},actionButton:{marginLeft:"12px","&:last-child":{marginRight:"3px"}},hoveredRowRightContentContainer:{alignItems:"center !important"}})));function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{entity:t,matches:n,metadata:r,columnsData:o,filters:s,onFilter:c,sorting:u,onSort:p,selected:h,onToggleSelect:f,onResetSelect:g,onSelectAll:b,entitiesMap:y,actionButtonsRenderer:v,basicTableRef:w,isComparisonViewShown:E}=e;const C=nr(),[x,O]=(0,l.useState)(n);(0,l.useEffect)((()=>{O(n)}),[n]);const S=(0,l.useCallback)(((e,t)=>{O((0,d.move)(e,t)),U(t)}),[]),R=(0,l.useMemo)((()=>Yn(r,o,x,y)),[x,o,r,y]),P=!!p,k=(0,l.useMemo)((()=>((e,t)=>(0,d.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$n(e,t,n[t])}))}return e}({sortable:e},t,{resizable:!0,nestedPath:Qn(t.id),headCellRenderer:"label"===t.id?An:Cn,rowCellValueRenderer:Kn(t)})))(t))(P,o)),[o,P]),T=(0,l.useMemo)((()=>t?Yn(r,o,[{object:t}]):[]),[t,r,o]),{getRowHeight:M,CellRenderer:j}=(0,sn.Z)({rowsData:T,columnsData:k,maxRowValuesCount:3}),N=M(0),I=(0,l.useMemo)((()=>{const e=(e=>t=>{const n=n=>{const r=En();return i().createElement(Rn.B.Provider,{value:"tableHeader"},i().createElement("div",{className:r.headCellWithEntity},i().createElement(t,n),i().createElement(e,{className:De()(r.entityRowCell,r.entityRowCellSelected),columnId:n.headCellData.id,rowIndex:0})))};return n.propTypes={headCellData:a().shape({id:a().string})},n})(j);return k.map((0,d.evolve)({headCellRenderer:e}))}),[k,j]),A=(0,l.useMemo)((()=>({isAllSelected:h.length>0&&h.length===n.length,entityToMatch:t,selected:h,onToggleSelect:f,onResetSelect:g,onSelectAll:b,isComparisonViewShown:E})),[t,h,f,g,b,n,E]),{getDynamicRowCellHeight:D,changeRowCellHeight:Z,clearHeightsCache:B}=(0,cn.Z)();(0,l.useLayoutEffect)(B,[n]);const[V,L]=(0,l.useState)(!1),z=(0,l.useCallback)((()=>L(!0)),[]),H=(0,l.useCallback)((()=>L(!1)),[]),[F,W]=(0,l.useState)(!1),[_,U]=(0,l.useState)(null),G=(0,l.useCallback)((e=>{U((t=>V||F?t:e))}),[V,F]),q=(0,l.useMemo)((()=>{if(!v||null===_)return null;const e=x[_],n=h.includes(e);return i().createElement("div",{className:De()(C.rowActionButtonsWrapper)},i().createElement("div",{className:De()(C.rowActionButtons,{[C.checked]:n})},v({hoveredMatch:e,buttonClassName:C.actionButton,onActionsMenuOpen:z,onActionsMenuClose:H})),t&&i().createElement(un.Z,{className:De()(C.commentsContainer,{[C.checked]:n}),uri:(0,m.E_P)(t.uri,e.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:t.uri,matchEntityUri:e.object.uri}),onChangePopupVisibility:W,allowOnlyOneComment:!0,showAlways:!0}))}),[v,_,x,h,C,z,H,t]),$=(0,l.useCallback)((e=>{switch(e.columnData.id){case"label":return i().createElement(tr,rr({},e,{hoverRowIndex:_,actionsContent:q,tableRef:w}));case"matchRules":case"mlMatchRules":return i().createElement(pn.Z,rr({onChangeHeight:Z},e),i().createElement(tr,e));default:return i().createElement(tr,e)}}),[Z,_,q,w]),X=(0,l.useCallback)((0,d.either)(D,dn.Z),[D,dn.Z]),Y=(0,l.useMemo)((()=>({hoveredRowRightContentContainer:C.hoveredRowRightContentContainer})),[C]);return i().createElement("div",{className:C.tableContainer},i().createElement(mn.Z,{fixFirstColumn:!0,columnsData:I,rowsData:R,context:A,sorting:u,onSort:p,filters:s,onFilter:c,defaultColumnWidth:250,defaultColumnMinWidth:100,headRowHeight:56+N,renderRowCell:$,getRowCellHeight:X,hoverStateEnabled:!0,hoveredRowRightContent:q,hoverRowIndex:_,onRowHover:G,classes:Y,maxRowValuesCount:3,dndRowReorderingEnabled:!0,dndRowReorderingHandler:S,ref:w,hoveredContentPosition:0}))};or.propTypes={entity:m.pyR,metadata:m.pGS,columnsData:Xt.uz,matches:a().array,selected:a().array,onToggleSelect:a().func,onResetSelect:a().func,onSelectAll:a().func,filters:a().objectOf(Xt.Dq),onFilter:a().func,sorting:Xt.nI,onSort:a().func,entitiesMap:a().object,actionButtonsRenderer:a().func,basicTableRef:a().shape({current:a().object}),isComparisonViewShown:a().bool};const ar=or;var lr=n(51229),ir=n(1876),sr=n(30553),cr=n(98281);const ur=(0,Le.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,ze.U1)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,ze.U1)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px",paddingLeft:"12px",paddingRight:"38px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0},hidden:{visibility:"hidden"},checkIcon:{color:"rgba(0,0,0,0.54)",marginRight:"12px"}})));function pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dr=e=>{let{options:t,optionsData:n,onChangeOptions:r}=e;const o="options-menu",a=ur(),s=(0,l.useRef)(),[c,u]=(0,l.useState)(!1),p=()=>u((e=>!e));return i().createElement(i().Fragment,null,i().createElement(ct.Z,{icon:Ot.Z,size:"L",ref:s,className:De()(a.buttonRoot,{[a.selected]:c}),onClick:p,"aria-pressed":c,"aria-controls":c?o:void 0,"aria-haspopup":"true"}),i().createElement(Lt.Menu,{id:o,variant:"menu",open:c,autoFocus:!1,classes:{paper:a.paper},anchorEl:s.current,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:c}},n.map((e=>{const{label:n,id:o}=e,l=t[o];return i().createElement(Lt.MenuItem,{key:o,classes:{root:a.menuItem},onClick:()=>{u(!1),r(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pr(e,t,n[t])}))}return e}({},t,{[o]:!l}))}},i().createElement(cr.Z,{className:De()(a.checkIcon,{[a.hidden]:!l})}),i().createElement(Lt.Typography,{classes:{root:a.menuText}},n))}))))};dr.propTypes={options:a().object,optionsData:a().array,onChangeOptions:a().func};const mr=dr,hr=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},paddingRight:"15px"},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500},flex1:{flex:1},selected:{backgroundColor:(0,ze.U1)(e.palette.primary.main,.12)}}))),fr=e=>{let{total:t,columnsData:n,selectedColumns:r,onChangeColumns:o,filtersEnabled:a,onToggleFilters:l,showFilters:s,options:c,optionsData:u,onChangeOptions:p}=e;const d=hr(),h=!(0,m.O27)(u);return i().createElement(zt.Z,{title:"",classes:{root:d.header}},i().createElement(Lt.Typography,{className:d.totalCaption,variant:"caption"},i().createElement("span",{className:d.totalNumber},q().number(t,"0,0")),q().text("total profiles")),i().createElement(lr.Z,null),s&&i().createElement(ir.Z,{enabled:a,onClick:l}),h&&i().createElement(mr,{options:c,optionsData:u,onChangeOptions:p}),(s||h)&&i().createElement(sr.Z,{height:28,margin:10}),i().createElement($t.Z,{columnsData:n,selectedColumns:r,onChangeColumns:o}))};fr.propTypes={total:a().number,showFilters:a().bool,columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func,filtersEnabled:a().bool,onToggleFilters:a().func,options:a().object,optionsData:a().array,onChangeOptions:a().func};const gr=fr,br=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},paddingRight:"15px"},flex1:{flex:1},selected:{backgroundColor:(0,ze.U1)(e.palette.primary.main,.12)}}))),yr=e=>{let{selectedItems:t,children:n}=e;const r=br(),o=t.length>0;return i().createElement(zt.Z,{title:"",classes:{root:De()(r.header,{[r.selected]:o})}},i().createElement("div",{className:r.flex1},i().createElement(Lt.Typography,{color:"primary"},q().text("Selected: ${count}",{count:t.length}))),n)};yr.propTypes={selectedItems:a().arrayOf(a().object),children:a().oneOfType([a().arrayOf(a().node),a().node])},yr.defaultProps={selectedItems:[]};const vr=yr,wr=(0,Le.Z)({actions:{display:"flex",alignItems:"center"},button:{marginLeft:"8px"}}),Er=(0,d.map)((0,d.prop)("object")),Cr=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=wr(),l=Er(n),{canMark:s}=(0,m.OCS)(r,o,t,n);return i().createElement("div",{className:a.actions},s&&i().createElement(Ge,{entity:t,entities:l,mode:"button"}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};Cr.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const xr=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],Or=[{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],Sr=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}}))),Rr=(e,t)=>{(0,l.useEffect)((()=>{t(e!==w?3:void 0)}),[e,t])};function Pr(){return Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}const kr=[20,50,100],[Tr]=kr,Mr=Y(xr),[jr]=Mr,Nr={showInactiveEntities:!1},Ir=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const a=Sr(),[s,c]=ge(Mr,{order:"asc",field:jr},Tr,Nr),{comparisonViewMode:u,isGlobalSpinnerActive:p}=z(),{changeRowsPerPage:h,changePage:f,changeColumns:g,toggleFilters:b,changeFilter:y,toggleSort:w,setSelectedItems:S,toggleSelect:R,setOptions:P,setLimitSelection:T}=s,{sorting:M,page:j,rowsPerPage:N,visibleColumns:I,filters:A,selectedItems:D,options:Z}=c,{uri:B,type:V}=t||{},[L,W,_]=ae({defaultColumnsData:xr,metadata:n,entityType:V}),G=(0,l.useMemo)((()=>I.map((e=>L.find((0,d.propEq)("id",e)))).filter(d.identity)),[I,L]);(0,l.useEffect)((()=>{g(_)}),[_,g]);const q=(0,l.useMemo)((()=>[...U(V,A,L),{filter:"not equals",fieldName:"uri",values:[B]}]),[V,A,L,B]),$=(0,l.useMemo)((()=>Y(G)),[G]),{entities:X,total:Q,findEntities:K}=(e=>{let{entityType:t,filters:n,select:r,sorting:o,page:a,rowsPerPage:i,options:s,enabled:c}=e;const{order:u,field:p}=o,{setGlobalSpinner:d}=H(),[h,f]=(0,l.useState)(0),[g,b]=(0,l.useState)([]),y=(0,oe._)(),v=["uri","label","type","secondaryLabel","defaultProfilePicValue"],w=s.showInactiveEntities?m.YJ7.ALL:m.YJ7.ACTIVE_ONLY,E=(0,l.useCallback)((()=>{c&&(d(!0),y(Promise.all([(0,m.ZOr)(n,{offset:a*i,max:i,sort:p,order:u,select:v.concat(r).join(","),activityFilter:w}),(0,m.j_Q)(n,{activityFilter:w})])).then((e=>{const[t,n]=e,{total:r}=n;b(t.map((e=>({object:e})))),f(r)})).finally((e=>d(!1))))}),[t,n,p,u,a,i,c,r,w]);return(0,l.useEffect)((()=>{E()}),[E]),{entities:g,total:h,findEntities:E}})({enabled:!!B,entityType:V,filters:q,sorting:M,select:$,page:j,rowsPerPage:N,options:Z}),{setReloadHandler:J}=k();J((()=>{K(),ee()}));const ee=(0,l.useCallback)((()=>{S([])}),[S]),te=(0,l.useCallback)((()=>{S(X)}),[S,X]);(0,l.useEffect)((()=>{const e=D.map((e=>X.find((t=>(0,m.ev7)(t)===(0,m.ev7)(e)))||e));S(e)}),[X]),(0,C.D)((()=>{f(0),ee()}),[B,A,Z]),Rr(u,T);const ne=u===v,re=u===E,le={entity:t,metadata:n,selectedItems:D||[],columnsData:W,config:r,selectedColumns:I,onChangeColumns:g,controlsRenderer:Ye},ie=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a}=e;const l=[o.object],{canMark:s}=(0,m.hXd)(n,r,o.object,t,o.matchRules);return s&&i().createElement(Ge,{entity:t,entities:l,mode:"iconButton",className:a})}),[r,t,n]),se=(0,l.useRef)(null);return ne?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:R},i().createElement(an,Pr({},le,{classes:{root:a.fullScreen}})))):i().createElement("div",{className:a.matchesView},D&&D.length>0?i().createElement(vr,{selectedItems:D},i().createElement(Cr,{matches:D,entity:t,metadata:n,config:r})):i().createElement(gr,{total:Q,columnsData:W,selectedColumns:I,onChangeColumns:g,filtersEnabled:!!A,onToggleFilters:b,showFilters:!0,options:Z,optionsData:Or,onChangeOptions:P}),i().createElement("div",{className:a.mainArea},i().createElement("div",{className:a.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:G,matches:X,selected:D,onToggleSelect:R,onResetSelect:ee,onSelectAll:te,filters:A,onFilter:y,sorting:M,onSort:w,actionButtonsRenderer:ie,basicTableRef:se,isComparisonViewShown:re}),i().createElement(x.Z,{rowsPerPageOptions:re?[]:kr,count:Q,page:j,onChangePage:f,rowsPerPage:N,onChangeRowsPerPage:h,basicTableRef:se}),p&&i().createElement(O.Z,null)),re&&i().createElement(F.Provider,{value:R},i().createElement(an,Pr({},le,{classes:{root:a.comparisonView}})))))}));Ir.displayName="FindMatchesView",Ir.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};var Ar=n(7718),Dr=n(3515),Zr=n(31274),Br=n(7154),Vr=n(91262);const Lr=(0,Le.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"16px 16px 0"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px"},path:{color:e.palette.text.secondary,fontize:"13px",letterSpacing:0,lineHeight:"15px",padding:"6px 0"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}})));function zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Hr(e,t,n[t])}))}return e}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fr=e=>{let{config:t,mainEntity:n,currentEntity:r,matchRules:o,open:a,onClose:s=d.identity}=e;const c=Lr(),u=(0,p.useDispatch)(),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),{relation:f={}}=(0,p.useSelector)((e=>Se.ZP.selectors.getRelationToAddByViewId(e,t.id)))||{},{inRelations:g=[],outRelations:b=[]}=(0,l.useMemo)((()=>((e,t,n,r,o)=>{const{isNotDuplicatedInRelation:a,isNotDuplicatedOutRelation:l}=(0,m.xE1)(),i=t=>(0,d.pipe)((0,d.assocPath)(["startObject","objectType"],(0,m.nt9)(e,t.startObject.objectTypeURI)),(0,d.assocPath)(["endObject","objectType"],(0,m.nt9)(e,t.endObject.objectTypeURI)))(t),s=(0,m.nt9)(e,r.type),c=(0,d.propOr)({},"matchActions",t),u=(0,m.dzT)(c,s,o),[p]=u.map((e=>{let{createRelation:t}=e;return t})).filter(d.identity);return(0,d.evolve)({inRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,r,n)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(a),(0,d.map)(i)),outRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,n,r)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(l),(0,d.map)(i))},p)||{}})(h,t,n,r,o)),[t,n,r,o,h]),{relationUri:y,relationType:v={}}=f,w=(0,d.pathOr)({},["object","attributes"],f),E=(0,l.useMemo)((()=>(0,m.xF8)(h,v)),[v,h]),C=(0,l.useMemo)((()=>zr({attributes:w},(0,m.p2l)(f))),[f,w]),x=t.id,O=(0,l.useCallback)((e=>{(0,d.pipe)(Se.N5.relations.actions.setRelationType(t.id,y),u)(e)}),[t,y,u]),S=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.addAttributes,u)(e.map((e=>zr({},e,{viewId:x}))))),[x,u]),R=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.modifyAttribute,u)(zr({},e,{viewId:x}))),[x,u]),P=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.removeAttribute,u)(zr({},e,{viewId:x}))),[x,u]),k=(0,l.useCallback)((()=>s(y)),[y,s]),T=(0,l.useCallback)((()=>u(Se.N5.errors.actions.errorsSet([]))),[u]),M=(0,l.useCallback)((()=>{const e=(0,m.xkB)(h,{relation:f});return u(Se.N5.errors.actions.errorsSet(e)),0===e.length}),[f,h,u]),j=(0,l.useCallback)((()=>{T(),k()}),[T,k]),N=`${(0,m.idV)(r.label)} → ${(0,m.idV)(n.label)}`,I=(0,d.isEmpty)(v);return i().createElement(Lt.Dialog,{open:a,fullWidth:!0,maxWidth:"sm",onClose:j,classes:{paper:c.dialogPaper}},i().createElement(Lt.DialogTitle,{disableTypography:!0,classes:{root:c.dialogTitle}},i().createElement(Lt.Typography,{variant:"subtitle1",classes:{root:c.titleText}},q().text("Add relationship")),i().createElement(Lt.Typography,{variant:"body2",classes:{root:c.path}},N)),i().createElement(Lt.DialogContent,{classes:{root:c.content}},i().createElement(Br.Z,{relation:f,metadata:h,inRelationTypes:g,outRelationTypes:b,onChange:O,applyFirstByDefault:!0}),i().createElement(Vr.Z,{className:c.attributeList,attrTypes:E,entity:C,showEmptyEditors:!0,mode:m.fO_.EDITING,parentUri:y,onAddAttributes:S,onChangeAttribute:R,onDeleteAttribute:P})),i().createElement(Lt.DialogActions,null,i().createElement(Lt.Button,{onClick:j},q().text("Cancel")),i().createElement(Lt.Button,{disabled:I,color:"primary",onClick:()=>{const{relationType:e,startDate:t,endDate:o}=f;M()&&((0,m.DsR)({startEntityUri:n.uri,endEntityUri:r.uri,relationType:e,attributes:(0,d.pathOr)({},["object","attributes"],f),startDate:t,endDate:o}).catch(ve),k())}},q().text("Add"))))};Fr.propTypes={config:m.yxQ,mainEntity:m.pyR,currentEntity:m.pyR,matchRules:a().arrayOf(a().string),open:a().bool,onClose:a().func};const Wr=Fr;function _r(){return _r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}const Ur=e=>{const[t,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)({}),a=(0,p.useDispatch)(),s=(0,l.useCallback)((t=>{let{mainEntity:r,currentEntity:l,matchRules:i}=t;const s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{relation:{relationUri:(0,m.ncP)()},entity:e,isNew:!0}}(l);(0,d.pipe)(Se.N5.relations.actions.openRelationEditor(e.id),a)(s),o({mainEntity:r,currentEntity:l,matchRules:i}),n(!0)}),[e,a]),c=(0,l.useCallback)((t=>{(0,d.pipe)(Se.N5.relations.actions.closeRelationEditor,a)(e.id,t),n(!1)}),[e.id,a]),u=()=>t?i().createElement(Wr,_r({config:e,open:t,onClose:c},r)):null;return u.propTypes={},{showDialog:t,openAddRelationDialog:s,AddRelationDialogRenderer:u}};var Gr=n(28741);function qr(){return qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}const $r=(0,l.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=d.identity}=e;const{ActionButton:o,props:a}=n;return i().createElement(o,qr({ref:t,mode:"menuItem",onMenuClose:r},a))}));$r.displayName="MenuItemRenderer";const Xr=$r;function Yr(){return Yr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}const Qr=e=>{let{actions:t,numberOfButtons:n=2,mode:r="normal",classes:o,onActionsMenuOpen:a,onActionsMenuClose:l}=e;const[s,c]=(0,d.splitAt)(n,t),u="normal"===r?"button":"iconButton",p="normal"===r?"MPlus":"S";return i().createElement(i().Fragment,null,s.map(((e,t)=>{let{ActionButton:n,props:r}=e;return i().createElement(n,Yr({key:t,mode:u,className:null==o?void 0:o.actionButton},r))})),c.length>0&&i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ot.Z,size:p,tooltipTitle:q().text("More actions")},className:null==o?void 0:o.moreOptions,menuId:"matches-view-actions",menuItems:c,onMenuOpen:a,onMenuClose:l,MenuItemRenderer:Xr}))},Kr=e=>{let{value:{show:t,entity:n,entities:r,matchRules:o,permission:a,config:l}}=e;const s=qe(),{canMerge:c,canAddRelation:u,canMark:p}=a,{showDialog:h,openAddRelationDialog:f,AddRelationDialogRenderer:g}=Ur(l),b=[...r,n].some(m.biM),y=[{ActionButton:Ie,show:p,props:{entity:n,entities:r}},{ActionButton:ke,show:!b,props:{entity:n,entities:r}},{ActionButton:je,show:u&&!b,props:{mainEntity:n,currentEntity:r.length>0?r[0]:{},matchRules:o,onClick:f}}].filter((0,d.prop)("show"));return t?i().createElement(i().Fragment,null,i().createElement("div",{className:s.container},c&&i().createElement(xe,{entity:n,entities:r,className:s.mergeButton,mode:"button"}),i().createElement(Qr,{actions:y,numberOfButtons:1,classes:{actionButton:s.rightButton,moreOptions:s.moreOptions}})),u&&h&&i().createElement(g,null)):null};Kr.propTypes=$e;const Jr=Kr,eo=(0,d.map)((0,d.prop)("object")),to=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=eo(n),{canMerge:s,canMark:c}=(0,m.OCS)(r,o,t,n),u=wr(),p=[...a,t].some(m.biM),h=(0,l.useMemo)((()=>[{ActionButton:xe,show:s,props:{entity:t,entities:a}},{ActionButton:Ie,show:c,props:{entity:t,entities:a}},{ActionButton:ke,show:!p,props:{entity:t,entities:a}}].filter((0,d.prop)("show"))),[c,s,t,a,p]);return i().createElement("div",{className:u.actions},i().createElement(Qr,{actions:h,numberOfButtons:2,classes:{actionButton:u.button}}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};to.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const no=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"matchRules",get label(){return q().text("Match rule")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,initialWidth:100,autoResize:!1},{id:"mlMatchRules",get label(){return q().text("Match IQ")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,initialWidth:130,minWidth:130,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],ro=[{id:"showTransitiveMatches",get label(){return q().text("Show transitive matches")}},{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],oo=[{id:"score",get label(){return q().text("Match score")},dataTypeDefinition:{type:m.oS0.TYPE_INT},initialWidth:100}],ao=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}})));function lo(){return lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const io=[20,50,100],[so]=io,co=Y(no),uo={showTransitiveMatches:!0,showInactiveEntities:!1},po=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const a=ao(),[s,c]=ge(co,{order:"asc",field:co[0]},so,uo),{comparisonViewMode:u,isGlobalSpinnerActive:p}=z(),{changeRowsPerPage:h,changePage:f,changeColumns:g,toggleFilters:b,changeFilter:y,setSelectedItems:w,toggleSelect:S,setOptions:R,setLimitSelection:P}=s,{page:T,rowsPerPage:M,visibleColumns:j,filters:N,selectedItems:I,options:A}=c,{uri:D,type:Z}=t||{},B=j.includes("score")?{field:"score",order:"desc"}:{order:"asc",field:co[0]},{matches:V,total:L,entitiesMap:W,loadMatches:_}=(e=>{let{entity:t,filter:n,sorting:r,page:o,rowsPerPage:a,options:i,enabled:s}=e;const{setGlobalSpinner:c}=H(),u=(0,l.useCallback)((()=>{c(!0)}),[c]),p=(0,l.useCallback)((()=>{c(!1)}),[c]),{total:d,matches:m,entitiesMap:h,loadMatches:f}=(0,Gr.s)({enabled:s,entity:t,filter:n,onFinishLoading:p,onStartLoading:u,options:i,page:o,rowsPerPage:a,sorting:r});return{matches:m,total:d,entitiesMap:h,loadMatches:f}})({enabled:!!D,entity:t,filter:"",page:T,sorting:B,rowsPerPage:M,options:A}),U=(0,l.useMemo)((()=>(0,m.NVY)(D,Object.keys(W))),[D,W]),G=(0,Ar.C)({objectIds:U}),{setReloadHandler:q}=k();q((()=>{_(),K()}));const[$,X,Y]=ae({defaultColumnsData:no,additionalColumnsData:oo,metadata:n,entityType:Z});(0,l.useEffect)((()=>{g(Y)}),[Y,g]);const Q=(0,l.useMemo)((()=>j.map((e=>$.find((0,d.propEq)("id",e)))).filter(d.identity)),[j,$]),K=(0,l.useCallback)((()=>{w([])}),[w]),J=(0,l.useCallback)((()=>{w(V)}),[w,V]);(0,C.D)((()=>{f(0),K()}),[D,A]),Rr(u,P);const ee=u===v,te=u===E,ne={entity:t,metadata:n,selectedItems:I||[],columnsData:X,config:r,selectedColumns:j,onChangeColumns:g,entitiesMap:W,controlsRenderer:Jr},{showDialog:re,openAddRelationDialog:oe,AddRelationDialogRenderer:le}=Ur(r),ie=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canAddRelation:u,canMark:p}=(0,m.hXd)(n,r,o.object,t,o.matchRules),h=[o.object],f=[...h,t].some(m.biM),g=[{ActionButton:xe,show:c,props:{entity:t,entities:h}},{ActionButton:Ie,show:p,props:{entity:t,entities:h}},{ActionButton:ke,show:!f,props:{entity:t,entities:h}},{ActionButton:je,show:u&&!f,props:{mainEntity:t,currentEntity:o.object,matchRules:o.matchRules,onClick:oe}}].filter((0,d.prop)("show"));return i().createElement(Qr,{actions:g,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,r,n,oe]),se=(0,l.useRef)(null);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:W},ee?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:S},i().createElement(an,lo({},ne,{classes:{root:a.fullScreen}})))):i().createElement("div",{className:a.matchesView},I&&I.length>0?i().createElement(vr,{selectedItems:I},i().createElement(to,{matches:I,entity:t,metadata:n,config:r})):i().createElement(gr,{total:L,columnsData:X,selectedColumns:j,onChangeColumns:g,filtersEnabled:!!N,onToggleFilters:b,options:A,optionsData:(0,m.biM)(t)?void 0:ro,onChangeOptions:R}),i().createElement("div",{className:a.mainArea},i().createElement("div",{className:a.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:Q,matches:V,selected:I||[],onToggleSelect:S,onResetSelect:K,onSelectAll:J,filters:N,onFilter:y,entitiesMap:W,actionButtonsRenderer:ie,basicTableRef:se,isComparisonViewShown:te}),i().createElement(x.Z,{rowsPerPageOptions:te?[]:io,count:L,page:T,onChangePage:f,rowsPerPage:M,onChangeRowsPerPage:h,basicTableRef:se}),p&&i().createElement(O.Z,null)),te&&i().createElement(F.Provider,{value:S},i().createElement(an,lo({},ne,{classes:{root:a.comparisonView}})))),re&&i().createElement(le,null))))}));po.displayName="MatchesView",po.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};var mo=n(20449);const ho=e=>{let{value:{show:t,entity:n,entities:r,permission:o}}=e;const a=qe(),{canMerge:l,canMark:s}=o,c=[...r,n].some(m.biM),u=[{ActionButton:Ue,show:s,props:{entity:n,entities:r}},{ActionButton:ke,show:!c,props:{entity:n,entities:r}}].filter((0,d.prop)("show"));return t?i().createElement(i().Fragment,null,i().createElement("div",{className:a.container},l&&i().createElement(xe,{entity:n,entities:r,className:a.mergeButton,mode:"button"}),i().createElement(Qr,{actions:u,numberOfButtons:1,classes:{actionButton:a.rightButton,moreOptions:a.moreOptions}}))):null};ho.propTypes=$e;const fo=ho,go=(0,d.map)((0,d.prop)("object")),bo=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=wr(),s=go(n),{canMerge:c,canMark:u}=(0,m.OCS)(r,o,t,n),p=[...s,t].some(m.biM),h=(0,l.useMemo)((()=>[{ActionButton:xe,show:c,props:{entity:t,entities:s}},{ActionButton:Ue,show:u,props:{entity:t,entities:s}},{ActionButton:ke,show:!p,props:{entity:t,entities:s}}].filter((0,d.prop)("show"))),[u,c,s,t,p]);return i().createElement("div",{className:a.actions},i().createElement(Qr,{actions:h,numberOfButtons:2,classes:{actionButton:a.button}}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};bo.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const yo=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],vo=[{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],wo=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}})));function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eo.apply(this,arguments)}const Co=[20,50,100],[xo]=Co,Oo=Y(yo),So={showInactiveEntities:!1},Ro=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const{comparisonViewMode:a,isGlobalSpinnerActive:s}=z(),c=wo(),[u,h]=ge(Oo,{order:"asc",field:Oo[0]},xo,So),{changeRowsPerPage:f,changePage:g,changeColumns:b,toggleFilters:y,changeFilter:w,setSelectedItems:S,toggleSelect:R,setOptions:P,setLimitSelection:T}=u,{page:M,rowsPerPage:j,visibleColumns:N,filters:I,selectedItems:A,options:D}=h,{uri:Z,type:B}=t||{},{matches:V,total:L,entitiesMap:W,loadNotMatches:_}=(e=>{let{entityUri:t,filter:n,sorting:r,page:o,rowsPerPage:a,options:i,enabled:s}=e;const{order:c,field:u}=r||{},{setGlobalSpinner:d}=H(),[h,f]=(0,l.useState)(0),[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)({}),w=(0,p.useSelector)(Se.ZP.selectors.getTenant),E=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),C=(0,p.useSelector)(Se.ZP.selectors.getDataTenants),x=(0,l.useMemo)((()=>({dtssPath:E,dataTenants:C,entity:{uri:t},customerTenant:w,dtssRequest:m.WSA})),[E,C,t,w]),O=(0,l.useCallback)((0,m.U_T)(x,m.pg),[x]),S=(0,mo.a)(O),R=(0,oe._)(),P=(0,l.useCallback)((e=>{s&&(d(!0),R(S({entityUri:t,offset:o*a,max:a,filter:n,sort:u,force:e,order:c,activeness:i.showInactiveEntities?m.YJ7.ALL:m.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:n,originalResponse:r}=e;f(n),b(t),t.map((e=>{let{uri:t}=e;return t})).length>0&&v((0,m.KPC)(r))})).finally((e=>d(!1))))}),[t,n,u,c,o,a,i,s]);return(0,l.useEffect)((()=>{P()}),[P]),{matches:g,total:h,entitiesMap:y,loadNotMatches:(0,l.useCallback)((()=>{P(!0)}),[P])}})({enabled:!!Z,entityUri:Z,filter:"",page:M,rowsPerPage:j,options:D}),U=(0,l.useMemo)((()=>(0,m.NVY)(Z,Object.keys(W))),[Z,W]),G=(0,Ar.C)({objectIds:U}),{setReloadHandler:q}=k();q((()=>{_(),K()}));const[$,X,Y]=ae({defaultColumnsData:yo,metadata:n,entityType:B});(0,l.useEffect)((()=>{b(Y)}),[Y,b]);const Q=(0,l.useMemo)((()=>N.map((e=>$.find((0,d.propEq)("id",e)))).filter(d.identity)),[N,$]),K=(0,l.useCallback)((()=>{S([])}),[S]),J=(0,l.useCallback)((()=>{S(V)}),[S,V]);(0,C.D)((()=>{g(0),K()}),[Z,D]),Rr(a,T);const ee=a===v,te=a===E,ne={entity:t,metadata:n,selectedItems:A||[],columnsData:X,config:r,selectedColumns:N,onChangeColumns:b,controlsRenderer:fo},re=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canMark:u}=(0,m.hXd)(n,r,o.object,t,o.matchRules),p=[o.object],h=[...p,t].some(m.biM),f=[{ActionButton:xe,show:c,props:{entity:t,entities:p}},{ActionButton:Ue,show:u,props:{entity:t,entities:p}},{ActionButton:ke,show:!h,props:{entity:t,entities:p}}].filter((0,d.prop)("show"));return i().createElement(Qr,{actions:f,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,r,n]),le=(0,l.useRef)(null);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:W},ee?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:R},i().createElement(an,Eo({},ne,{classes:{root:c.fullScreen}})))):i().createElement("div",{className:c.matchesView},A&&A.length>0?i().createElement(vr,{selectedItems:A},i().createElement(bo,{matches:A,entity:t,metadata:n,config:r})):i().createElement(gr,{total:L,columnsData:X,selectedColumns:N,onChangeColumns:b,filtersEnabled:!!I,onToggleFilters:y,options:D,optionsData:vo,onChangeOptions:P}),i().createElement("div",{className:c.mainArea},i().createElement("div",{className:c.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:Q,matches:V,selected:A||[],onToggleSelect:R,onResetSelect:K,onSelectAll:J,filters:I,onFilter:w,actionButtonsRenderer:re,basicTableRef:le,isComparisonViewShown:te}),i().createElement(x.Z,{rowsPerPageOptions:te?[]:Co,count:L,page:M,onChangePage:g,rowsPerPage:j,onChangeRowsPerPage:f,basicTableRef:le}),s&&i().createElement(O.Z,null)),te&&i().createElement(F.Provider,{value:R},i().createElement(an,Eo({},ne,{classes:{root:c.comparisonView}})))))))}));Ro.displayName="NotMatchView",Ro.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};const Po=e=>{let{entity:t,metadata:n,config:r,activeView:o,fullScreenContainer:a}=e;const l=(0,f.U)();let s;switch(o){case y.POTENTIAL_MATCHES:s=i().createElement(po,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;case y.FIND_MATCHES:s=i().createElement(Ir,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;case y.NOT_A_MATCH:s=i().createElement(Ro,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;default:s=i().createElement("div",null)}return i().createElement(g.s.Provider,{value:l},i().createElement(b.l,null,i().createElement(P,null,s)))};Po.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,activeView:a().string,fullScreenContainer:a().instanceOf(Element)};const ko=e=>{let{availableTabs:t=[y.POTENTIAL_MATCHES,y.FIND_MATCHES,y.NOT_A_MATCH],activeTab:n,onChange:r}=e;const o={[y.POTENTIAL_MATCHES]:(0,G.text)("POTENTIAL MATCHES"),[y.FIND_MATCHES]:(0,G.text)("FIND MATCHES"),[y.NOT_A_MATCH]:(0,G.text)("NOT A MATCH")};return i().createElement(Lt.Tabs,{value:n,onChange:r,indicatorColor:"primary",textColor:"primary",scrollButtons:"on"},t.map((e=>i().createElement(Lt.Tab,{key:e,label:o[e],value:e,classes:{}}))))};ko.propTypes={availableTabs:a().arrayOf(a().string),activeTab:a().string,onChange:a().func};const To=(0,Le.Z)((e=>({basicView:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",position:"absolute",top:0,bottom:0,left:0,right:0},content:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Mo=(0,l.memo)((e=>{let{config:t,entity:n,metadata:r,getSavedState:o,saveState:a}=e;const s=To(),c=(0,m.biM)(n)?[y.POTENTIAL_MATCHES]:t.availableTabs,[u,p]=(0,l.useState)(y.POTENTIAL_MATCHES),[d,f]=(0,l.useState)();return i().createElement(h.Z,{ref:f,className:s.basicView},i().createElement("div",{className:s.content},i().createElement(ko,{activeTab:u,availableTabs:c,onChange:(e,t)=>p(t)}),i().createElement(Po,{fullScreenContainer:d,entity:n,metadata:r,config:t,activeView:u})))}));Mo.displayName="PotentialMatchesView",Mo.propTypes={config:m.yxQ,entity:m.pyR,metadata:m.pGS,dispatch:a().func,getSavedState:a().func,saveState:a().func};const jo=(0,p.connect)((e=>({entity:Se.ZP.selectors.getEntity(e),metadata:Se.ZP.selectors.getMetadata(e)})))((e=>i().createElement(L,null,i().createElement(Mo,e))));var No=n(24605),Io=n(60641),Ao=n(97094),Do=n(64459),Zo=n(19603),Bo=n(93873);const Vo=(0,Le.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),Lo=(0,l.memo)((e=>{let{className:t}=e;const n=Vo(),r=(0,p.useSelector)(Se.ZP.selectors.getEntity),o=(0,p.useSelector)(Se.ZP.selectors.getEntityUriWithDataTenant);return i().createElement(Do.Z,{className:De()(t,Zo.U),entity:r},i().createElement(Lt.Box,{display:"flex",alignItems:"center"},i().createElement(Lt.Box,{mr:3},i().createElement(Bo.a,null))),i().createElement(Lt.Box,{className:n.comments},i().createElement(un.Z,{uri:o,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:o}),objectType:m.q7e.ENTITY})))}));Lo.displayName="PotentialMatchesProfileBand";var zo=n(63172),Ho=n(52043),Fo=n(39827);function Wo(){return Wo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wo.apply(this,arguments)}const _o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Wo({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M20 4v14h2V4c0-1.1-.9-2-2-2H6v2h14zM2 20c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12z",fill:"currentColor"}))};function Uo(){return Uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uo.apply(this,arguments)}const Go=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Uo({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M10 12a4 4 0 100-8 4 4 0 000 8zM10.35 14.01C7.62 13.91 2 15.27 2 18v2h9.54c-2.47-2.76-1.23-5.89-1.19-5.99zM19.43 18.02c.36-.59.57-1.28.57-2.02 0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4c.74 0 1.43-.22 2.02-.57L20.59 22 22 20.59l-2.57-2.57zM16 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",fill:"currentColor"}))};function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qo.apply(this,arguments)}const $o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",qo({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 20h15.002L21 23l1.27-1.27-20-20.01L1 2.99l6.172 6.175a4.007 4.007 0 002.66 2.662l2.23 2.23A10.754 10.754 0 0011 14c-2.67 0-8 1.34-8 4v2zm8-16a3.987 3.987 0 00-2.795 1.137l5.656 5.659A3.999 3.999 0 0011 4z",fill:"#000",fillOpacity:".54"}))};let Xo,Yo;var Qo;!function(e){e[e.PotentialMatches=0]="PotentialMatches",e[e.FindMatches=1]="FindMatches",e[e.NotAMatch=2]="NotAMatch"}(Xo||(Xo={})),(Qo=Yo||(Yo={})).TABLE="TABLE",Qo.COLUMNS="COLUMNS";const Ko=(0,l.createContext)({reloadData:()=>{},setReloadHandler:()=>{}}),Jo=(()=>{let e;return{reloadData:()=>{e&&e()},setReloadHandler:t=>{e=t}}})(),ea=e=>{let{children:t}=e;return i().createElement(Ko.Provider,{value:Jo},t)},ta=()=>{const e=(0,l.useContext)(Ko);if(void 0===e)throw new Error("useReloadData must be used within a ReloadDataProvider");return e},na=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const o=ra(e,t,n,r),a=(t.children||[]).map((n=>na(e,n,"",r.concat({name:t.name,label:t.label}))));return a.length&&(o.children=a,o.notSelectable=!0),o},ra=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const o=(0,d.omit)(["children"],t),a=o.label||o.name;return{title:a,fieldName:n||(0,m.Tde)(o.uri,r)}},oa=(e,t)=>t?(0,m.k66)(e,t).map((t=>na(e,t))):[],aa=(0,d.pipe)((0,d.map)((e=>({id:(0,m.Tde)(e.uri),label:(0,m.idV)(e.label),dataTypeDefinition:(0,m.PFL)(e)})))),la=(0,d.pipe)(m.Fof,aa),ia=(0,d.pluck)("id"),sa=(0,d.curry)(((e,t)=>e.map((e=>(0,m.Tde)(e))).some((e=>t.id===e||ua(t)&&pa(t,e))))),ca=e=>(0,m.QZu)(e.dataTypeDefinition),ua=e=>(0,m.YkG)(e.dataTypeDefinition),pa=(0,d.curry)(((e,t)=>t.startsWith(`${e.id}.`))),da=(0,d.curry)(((e,t)=>ca(t)&&e.some((e=>{let{id:n}=e;return pa(t,n)})))),ma=e=>(0,d.either)((0,d.includes)(d.__,e),da(e)),ha=(e,t)=>(0,d.pipe)((0,d.reject)(ca),(0,d.filter)(sa(e)))(t);function fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ga(e,t,n[t])}))}return e}function ga(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ba=(0,l.createContext)(null),ya=(0,l.createContext)(null),va="SET_GLOBAL_SPINNER",wa="SET_SELECTED_ITEMS",Ea="TOGGLE_SELECT",Ca="SET_LIMIT_SELECTION",xa="SET_COMPARISON_VIEW_MODE",Oa="SET_ENTITIES_MAP",Sa="DELETE_EXTRA_MATCHES",Ra={setGlobalSpinner:(0,T.zD)(va),setSelectedItems:(0,T.zD)(wa),toggleSelect:(0,T.zD)(Ea),setLimitSelection:(0,T.zD)(Ca),setComparisonViewMode:(0,T.zD)(xa),setEntitiesMap:(0,T.zD)(Oa),deleteExtraMatches:(0,T.zD)(Sa)},Pa=(e,t)=>{switch(t.type){case va:return fa({},e,{isGlobalSpinnerActive:t.payload});case Sa:return fa({},e,{selectedItems:e.selectedItems.slice(0,e.limitSelection)});case wa:return fa({},e,{selectedItems:t.payload.slice(0,e.limitSelection)});case Ea:return(0,d.evolve)({selectedItems:n=>{const r=t.payload,o=n.findIndex((e=>{var t,n;return(null==e||null===(t=e.object)||void 0===t?void 0:t.uri)===(null==r||null===(n=r.object)||void 0===n?void 0:n.uri)}));if(o>-1)return(0,d.remove)(o,1,n);{const{limitSelection:t}=e;return e.tableViewModeAvailable?(0,d.append)(r,n):(0,d.pipe)((0,d.when)((0,d.both)((0,d.complement)(d.isNil),(0,d.propSatisfies)((0,d.gte)(d.__,t),"length")),(0,d.take)(t-1)),(0,d.append)(r))(n)}}},e);case Ca:return fa({},e,{limitSelection:t.payload});case xa:{const n=t.payload;return fa({},e,{comparisonViewMode:n,limitSelection:n===Yo.COLUMNS?4:void 0})}case Oa:{const n=t.payload;return fa({},e,{entitiesMap:n})}}},ka=e=>{let{children:t,tableViewModeAvailable:n}=e;const[r,o]=(0,l.useReducer)(Pa,{isGlobalSpinnerActive:!1,selectedItems:[],comparisonViewMode:Yo.COLUMNS,limitSelection:4,entitiesMap:{},tableViewModeAvailable:n}),a=(0,M.o)({actions:Ra,dispatch:o});return i().createElement(ba.Provider,{value:r},i().createElement(ya.Provider,{value:a},t))},Ta=()=>{const e=(0,l.useContext)(ba);if(void 0===e)throw new Error("useViewState must be used within a ViewStateProvider");return e},Ma=()=>{const e=(0,l.useContext)(ya);if(void 0===e)throw new Error("useViewStateActions must be used within a ViewStateProvider");return e};function ja(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Na(e,t,n[t])}))}return e}function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Aa(e,t,n[t])}))}return e}function Aa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Da="RESET",Za="SET_OPTIONS",Ba=Ia({},le.ZP.actions,{reset:(0,T.zD)(Da),setOptions:(0,T.zD)(Za)}),Va=(e,t)=>{switch(t.type){case Da:return Ia({},t.payload);case Za:return Ia({},e,{options:t.payload});default:return le.ZP.reducer(e,t)}};function La(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){za(e,t,n[t])}))}return e}function za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ha=(e,t)=>{const{field:n,order:r}=e,o={sorting:{field:n,order:r},page:0,rowsPerPage:t,selectedItems:[],limitSelection:null},[a,i]=(0,l.useReducer)(Va,o),s=(0,M.o)({actions:Ba,dispatch:i}),c=Ma(),u=Ta();return[La({},s,c),La({},a,u),i]},Fa=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:q().text("Can't add relationship")})},Wa=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:(null==e?void 0:e.errorMessage)||q().text("Something went wrong...")})},_a=e=>{(null==e?void 0:e.errorCode)!==m.Xt7.DCR_ALREADY_EXISTS&&Wa(e)},Ua=()=>{const{setGlobalSpinner:e}=Ma(),{isGlobalSpinnerActive:t}=Ta(),{reloadData:n}=ta();return{onStartRequest:(0,l.useCallback)((()=>{e(!0)}),[e]),onFinishRequest:(0,l.useCallback)((()=>{e(!1),n()}),[n,e]),isGlobalSpinnerActive:t}},Ga=(e,t)=>e.filter((e=>{let{object:n}=e;return!t.some((e=>{let{uri:t}=e;return t===n.uri}))}));function qa(){return qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qa.apply(this,arguments)}const $a=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,size:l,onMenuClose:s=T.ZT}=e;const{isGlobalSpinnerActive:c,onFinishRequest:u,onStartRequest:p}=Ua(),{selectedItems:d}=Ta(),{setSelectedItems:m}=Ma();return i().createElement(be.H,qa({className:n,disabled:c,entities:r,entity:o,mode:a},l?{size:l}:{},{onMenuClose:s,onStartRequest:p,onFinishRequest:u,onSuccess:()=>{m(Ga(d,r))},onError:Wa,"data-reltio-id":"reltio-potential-matches-merge-button",ref:t}))}));function Xa(){return Xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}$a.displayName="mergeButton";const Ya=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,size:l,onMenuClose:s=T.ZT}=e;const{isGlobalSpinnerActive:c,onFinishRequest:u,onStartRequest:p}=Ua(),{selectedItems:d}=Ta(),{setSelectedItems:m}=Ma();return i().createElement(Ne.i,Xa({className:n,disabled:c,entities:r,entity:o,mode:a},l?{size:l}:{},{onMenuClose:s,onStartRequest:p,onFinishRequest:u,onSuccess:()=>{m(Ga(d,r))},ref:t}))}));function Qa(){return Qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qa.apply(this,arguments)}Ya.displayName="NotMatchButton";const Ka=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Qa({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M9 4c4.42 0 8 3.58 8 8s-3.58 8-8 8a8 8 0 01-7.419-5h2.224A6.002 6.002 0 009 18c3.31 0 6-2.69 6-6s-2.69-6-6-6a6.002 6.002 0 00-5.196 3H1.581A8 8 0 019 4zm8 .26c3.45.89 6 4.01 6 7.74 0 3.73-2.55 6.85-6 7.74v-2.09a5.99 5.99 0 000-11.3V4.26zM8 7.5l4.5 4.5L8 16.5V13H0v-2h8V7.5z",fillOpacity:".541"}))},Ja=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const{setSelectedItems:c}=Ma(),{selectedItems:u}=Ta(),[p,d]=(e=>{let{entities:t,entity:n,onSuccess:r}=e;const{setGlobalSpinner:o}=Ma(),{isGlobalSpinnerActive:a}=Ta(),{reloadData:i}=ta();return[a,(0,l.useCallback)((()=>{o(!0),(0,m.ck9)(n.uri,t).then((()=>{null==r||r()})).finally((()=>{o(!1),i()}))}),[t,n,o,i,r])]})({entity:n,entities:r,onSuccess:()=>{c(Ga(u,r))}});return i().createElement(Oe.K,{className:o,disabled:p,mode:a,label:q().text("Save on potential matches"),icon:Ka,onClick:d,onMenuClose:s,ref:t})}));function el(){return el=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},el.apply(this,arguments)}Ja.displayName="SetAMatchButton";const tl=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",el({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M10 6v2H4v12.22h12V14h2v6c0 1.05-.82 1.918-1.851 1.994L16 22H4c-1.05 0-1.918-.82-1.994-1.851L2 20V8c0-1.05.82-1.918 1.851-1.994L4 6h6zm4 10v2H6v-2h8zm-3.997-3l-.001 2H6v-2h4.003zM21 2c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1h-7l-2 2 .005-11c0-.55.445-1 .995-1h8zm-10.996 8l-.001 2H6v-2h4.004zm9.286-6.3l-3.17 3.17-1.41-1.42-1.41 1.41 2.82 2.84 4.59-4.58-1.42-1.42z",id:"svg2465811894a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2465811894b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2465811894a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2465811894b)",d:"M0 0h24v24H0z"})))},nl=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const c=(0,l.useContext)(Ao.S),[u,h]=(e=>{let{entities:t,entity:n,showSnackbarMessage:r}=e;const{selectors:o}=Se.ZP,{setGlobalSpinner:a}=Ma(),{isGlobalSpinnerActive:i}=Ta(),s=(0,p.useSelector)(o.getWorkflowPath),c=(0,p.useSelector)(o.getWorkflowEnvironmentUrl),u=(0,p.useSelector)(o.getTenant),h=(0,d.prop)("uri"),f=(0,d.pipe)(d.concat,(0,d.map)(h))([n],t);return[i,(0,l.useCallback)((()=>{a(!0),(0,m.t6d)({workflowPath:s,processType:"potentialMatchReview",objectURIs:f,tenant:u,environment:c}).then((()=>{null==r||r(q().text("Potential match request: Done"))})).catch(_a).finally((()=>{a(!1)}))}),[a,s,f,u,c,r])]})({entity:o,entities:r,showSnackbarMessage:c}),f=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),g=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath);return f&&!(0,m.O27)(g)?i().createElement(Oe.K,{className:n,disabled:u,mode:a,label:u?"":q().text("Potential match request"),icon:tl,onClick:h,onMenuClose:s,ref:t}):null}));nl.displayName="DCRReviewButton";const rl=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const{selectedItems:c}=Ta(),{setSelectedItems:u}=Ma(),d=(0,l.useContext)(Ao.S),[h,f]=(e=>{let{entities:t,entity:n,showSnackbarMessage:r,onSuccess:o}=e;const{setGlobalSpinner:a}=Ma(),{isGlobalSpinnerActive:i}=Ta(),{reloadData:s}=ta(),c=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),u=(0,p.useSelector)(Se.ZP.selectors.getTenant);return[i,(0,l.useCallback)((()=>{a(!0);const e={dtssPath:c,customerTenant:u,entity:n,entities:t};((0,m.biM)(n)?(0,m.XkY)(e):(0,m.uQS)(e)).then((()=>{null==r||r(q().text("Save as potential match: Done")),null==o||o()})).finally((()=>{a(!1),s()}))}),[a,c,u,n,t,r,s,o])]})({entity:n,entities:r,showSnackbarMessage:d,onSuccess:()=>{u(Ga(c,r))}});return i().createElement(Oe.K,{className:o,disabled:h,mode:a,label:q().text("Save as potential match"),icon:Ka,onClick:f,onMenuClose:s,ref:t})}));function ol(){return ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}rl.displayName="ReinstateMatchButton";const al=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",ol({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M19 14v3h3v2h-3v3h-2v-3h-3v-2l3-.001V14h2zM17 2a3 3 0 11-1.293 5.708l-4.535 4.535a5 5 0 11-1.414-1.414l4.534-4.536A3 3 0 0117 2zM7 12a3 3 0 100 6 3 3 0 000-6zm10-8a1 1 0 100 2 1 1 0 000-2z",id:"svg2904917532a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2904917532b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2904917532a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2904917532b)",d:"M0 0h24v24H0z"})))},ll=(0,l.forwardRef)(((e,t)=>{let{className:n,mainEntity:r,currentEntity:o,matchRules:a,mode:l=Oe.N.iconButton,onClick:s=T.ZT,onMenuClose:c=T.ZT}=e;return i().createElement(Oe.K,{className:n,mode:l,label:q().text("Add relationship"),icon:al,onClick:()=>s({mainEntity:r,currentEntity:o,matchRules:a}),onMenuClose:c,ref:t})}));ll.displayName="CreateRelationButton";var il=n(17308);const sl=i().createContext({onClose:()=>{}});var cl=n(99757);const ul=(0,Le.Z)((()=>({attributeSelect:{width:"100%",height:"40px"}}))),pl=(0,l.memo)((e=>{let{onChange:t,options:n,sortField:r}=e;const o=ul(),a=(0,l.useMemo)((()=>{const e=r.split("."),t=e.length,o=n=>{const a=n[0].fieldName.split(".").length;if(a===t)return n.find((e=>e.fieldName===r));if(a<t){var l;const t=e.slice(0,a).join("."),r=null===(l=n.find((e=>e.fieldName===t)))||void 0===l?void 0:l.children;if(r)return o(r)}};for(const e of n){const t=o(e.attributes);if(t)return t}}),[r,n]),s=(0,l.useCallback)((e=>{t(e.attribute.fieldName)}),[t]);return i().createElement(cl.Z,{hideCheckBox:!0,className:o.attributeSelect,value:a,itemsGroups:n,onSelect:s,ungroup:!0,single:!0})}));var dl=n(90324);const ml=(0,Le.Z)((()=>({rowCheckbox:{marginRight:"20px",height:"24px",position:"relative",padding:"12px"},header:{padding:"8px 12px 8px 0",border:"rgba(0,0,0,0.05) 1px solid",borderTop:0,display:"flex",justifyContent:"space-between"},selector:{width:"160px"},sorting:{display:"flex"},arrow:{transition:"transform 0.3s ease-in"},rotate:{transform:"rotate(180deg)"}})));function hl(){return hl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hl.apply(this,arguments)}const fl=e=>{let{selectedCount:t,totalCount:n,onSelect:r,sortOptions:o,toggleSort:a,sorting:s,totalOnPage:c,children:u}=e;const p=ml(),d=(0,l.useContext)(sl);return i().createElement(i().Fragment,null,i().createElement(il.P,hl({},d,{secondTitle:!!n&&q().text("${n} Profiles",{n})})),u,!!c&&i().createElement("div",{className:p.header},i().createElement(Lt.Checkbox,{className:p.rowCheckbox,checked:t===c,indeterminate:t>0&&t<c,onChange:r}),i().createElement("div",{className:p.sorting},i().createElement(pl,{sortField:s.field,options:o,onChange:a}),i().createElement(Lt.IconButton,{onClick:()=>a(s.field),classes:{root:De()(p.arrow,{[p.rotate]:"desc"===s.order})}},i().createElement(dl.Z,null)))))},gl=[{id:"label",get label(){return q().text("Profile name")}},{id:"id",get label(){return q().text("Entity ID")}}],bl=(e,t,n,r)=>(0,l.useMemo)((()=>{const o=((e,t)=>[{title:"",attributes:oa(e,(0,m.nt9)(e,t))}])(n,r);return[{title:"",attributes:e.concat(t||[]).map((e=>({title:e.label,fieldName:e.id})))},...o]}),[n,r,e,t]);var yl=n(77245);const vl=(0,Le.Z)((e=>({hidden:{visibility:"hidden"},rowCheckbox:{marginLeft:"-9px",marginRight:"19px",height:"24px",position:"relative",padding:"9px"},entity:{paddingTop:"12px",paddingBottom:"8px",overflow:"hidden",textOverflow:"ellipsis"},actions:{marginLeft:"auto",marginRight:0,paddingTop:"15px",display:"flex"},actionButtons:{display:"none"},active:{display:"flex"},wrapper:{position:"relative",whiteSpace:"pre",padding:"0 15px 0 15px",color:"rgba(0,0,0,0.87)","&::after":{content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none"},"&:hover":{backgroundColor:"rgba(0,0,0,0.04)","& $actionButtons":{display:"flex"},"& $commentsContainer":{borderLeft:"1px solid rgba(0,0,0,0.12)"}},display:"flex",boxSizing:"border-box",borderBottom:"1px rgba(0,0,0,0.05) solid",paddingLeft:"12px"},entityLabel:{color:e.palette.primary.main,cursor:"pointer",textDecoration:"none",fontWeight:500},matchRulesWrapper:{padding:"12px 15px 4px 10px",display:"flex",alignItems:"center",boxSizing:"border-box"},selectedRow:{backgroundColor:"rgba(0, 114, 206, 0.12)"},matchScore:{borderLeft:"rgba(0,0,0,0.12) 1px solid",paddingLeft:"12px",height:"20px",marginLeft:"20px",color:"rgba(0,0,0,0.54)"},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",height:"24px",marginLeft:"6px"},border:{borderLeft:"1px solid rgba(0,0,0,0.12)"},rightButton:{marginLeft:"8px"}}))),wl=(0,l.memo)((e=>{let{rowIndex:t,match:n,toggleSelect:r,entityToMatch:o,isRowSelected:a,actionButtonsRenderer:s,metadata:c,entitiesMap:u={}}=e;const p=vl(),d=n.object,[h,f]=(0,l.useState)(!1),g=d!==o,b=s;return i().createElement("div",{className:De()(p.wrapper,Zo.U,{[p.selectedRow]:a})},i().createElement(Lt.Checkbox,{className:De()(p.rowCheckbox,{[p.hidden]:!g}),checked:a,onChange:()=>r(n),"data-reltio-id":`reltio-matches-table-checkbox-${t}`}),i().createElement("div",{className:p.entity},i().createElement(kn.Z,{value:(0,m.wwR)(d),className:p.entityLabel},(0,m.idV)(d.label)),i().createElement("div",{className:p.matchRulesWrapper},i().createElement(ft.Z,{entitiesMap:u,entity:d,match:n,metadata:c,variant:yl.g.excludeNotMatch}),!!n.matchScore&&i().createElement("div",{className:p.matchScore},n.matchScore))),i().createElement("div",{className:p.actions},i().createElement("div",{className:De()(p.actionButtons,{[p.active]:h})},i().createElement(b,{buttonClassName:p.rightButton,hoveredMatch:n,onActionsMenuOpen:()=>f(!0),onActionsMenuClose:()=>f(!1)})),o&&i().createElement(un.Z,{className:De()(p.commentsContainer,{[p.border]:h}),uri:(0,m.E_P)(o.uri,n.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:o.uri,matchEntityUri:n.object.uri}),allowOnlyOneComment:!0,showAlways:h})))})),El=(0,Le.Z)((()=>({view:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflowY:"auto",overflowX:"hidden"}}))),Cl=e=>{let{entityToMatch:t,matches:n,toggleSelect:r,actionButtonsRenderer:o,metadata:a,entitiesMap:l,selectedItems:s}=e;const c=El();return i().createElement("div",{className:c.view},n.map(((e,c)=>i().createElement(wl,{key:e.object.uri,rowIndex:c,match:e,entityToMatch:t,toggleSelect:r,actionButtonsRenderer:o,matches:n,matchRules:e.matchRules,metadata:a,entitiesMap:l,isRowSelected:s.some((t=>t.object.uri===e.object.uri))}))))};var xl=n(95474),Ol=n(94574);const Sl=(0,Le.Z)({root:{display:"flex",padding:"8px 16px",gap:"8px",borderBottom:"rgba(0,0,0,0.05) 1px solid"},inputRoot:{borderRadius:"4px"},menuButtonRoot:{padding:0}}),Rl=(0,l.memo)((e=>{let{onSearch:t,searchTenant:n,onChangeSearchTenant:r,entityTypeUri:o}=e;const a=Sl(),s=(0,l.useRef)(),[c,u]=(0,l.useState)(""),p=(0,l.useCallback)((0,d.when)((0,d.propEq)("key","Enter"),(0,d.pipe)((0,d.always)(c),d.trim,t)),[c,t]),m=(0,l.useCallback)((e=>{u(e),(0,d.isEmpty)(e)&&document.activeElement!==s.current&&t(e)}),[t]);return t?i().createElement("div",{className:a.root},i().createElement(xl.H,{entityTypeUri:o,selectedTenant:n,onChangeTenant:r}),i().createElement(Ol.Z,{classes:{root:a.inputRoot},inputRef:s,fullWidth:!0,height:40,autofocus:!1,value:c,onSearch:m,onKeyPress:p})):null})),Pl=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),kl=[20,50,100],[Tl]=kl,Ml=ia(gl),[jl]=Ml,Nl=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=Pl(),[s,c]=Ha({order:"asc",field:jl},Tl),{changeRowsPerPage:u,changePage:h,toggleSort:f,setSelectedItems:g,toggleSelect:b}=s,{sorting:y,page:v,rowsPerPage:w,selectedItems:E,isGlobalSpinnerActive:S}=c,{uri:R,type:P}=t||{},k=(0,p.useSelector)(Se.ZP.selectors.getTenantObject),[T,M]=(0,l.useState)(""),[j,N]=(0,l.useState)(k),I=(0,l.useMemo)((()=>[(0,d.isEmpty)(T)?null:{filter:"containsWordStartingWith",fieldName:"attributes",values:[T]},{filter:"equals",fieldName:"type",values:[P]},{filter:"not equals",fieldName:"uri",values:[R]},...r].filter(d.identity)),[P,R,T,r]),A=bl(gl,[],n,P),{entities:D,total:Z,findEntities:B}=(e=>{let{entityType:t,filters:n,sorting:r,page:o,rowsPerPage:a,enabled:i,searchTenantId:s}=e;const{order:c,field:u}=r,h=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),f=(0,p.useSelector)(Se.ZP.selectors.getTenantObject),{setGlobalSpinner:g}=Ma(),{activityFilter:b,globalFilter:y}=(0,p.useSelector)(Se.ZP.selectors.getGlobalSearchRequestOptions)||{},[v,w]=(0,l.useState)(0),[E,C]=(0,l.useState)([]),x=(0,oe._)(),O=["uri","label","type","secondaryLabel","attributes","crosswalks"],S=(0,l.useMemo)((()=>(0,m.Uqd)()(n)),[n]),R=(0,l.useCallback)((()=>{if(i){g(!0);const e=s!==f.id,t={customerTenant:f.id,dataTenant:s,dtssPath:h},r={offset:o*a,max:a,sort:u,order:c,select:O.join(","),globalFilter:y,activityFilter:b},l=e?(0,m.uqV)(ja({filters:n,options:r},t)).then((0,d.map)((0,m.E7G)(s))):(0,m.ZOr)(n,r),i={activityFilter:b,globalFilter:y},p=e?(0,m.J$m)(ja({filters:n,options:i},t)):(0,m.j_Q)(n,i);x(Promise.all([l,p])).then((e=>{const[t,n]=e,{total:r}=n;C(t.map((e=>({object:e})))),w(r)})).finally((()=>g(!1)))}}),[t,S,u,c,o,a,i,b,y,s,f]);return(0,l.useEffect)((()=>{R()}),[R]),{entities:E,total:v,findEntities:R}})({enabled:!!R,entityType:P,filters:I,sorting:y,page:v,rowsPerPage:w,searchTenantId:j.id}),{setReloadHandler:V}=ta();V((()=>{B(),z()}));const L=()=>{h(0)},z=(0,l.useCallback)((()=>{g([])}),[g]),H=(0,l.useCallback)((()=>{g(D)}),[g,D]);(0,l.useEffect)((()=>{const e=E.map((e=>D.find((t=>(0,m.ev7)(t)===(0,m.ev7)(e)))||e));g(e)}),[D]),(0,C.D)((()=>{L(),z()}),[R]),(0,C.D)((()=>{L()}),[r,T]);const F=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a}=e;const l=[r.object],{canMark:s}=(0,m.hXd)(n,o,r.object,t,r.matchRules);return s&&i().createElement(Ja,{entity:t,entities:l,className:a})}),[o,t,n]),W=(0,l.useMemo)((()=>D.map((e=>null==E?void 0:E.find((0,d.pathEq)(["object","uri"],e.object.uri)))).filter(d.identity).length),[E,D]);return i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:W,totalCount:Z,totalOnPage:D.length,sortOptions:A,sorting:y,toggleSort:f,onSelect:W?z:H},i().createElement(Rl,{searchTenant:j,onChangeSearchTenant:N,entityTypeUri:P,onSearch:M})),i().createElement(Cl,{entityToMatch:t,toggleSelect:b,actionButtonsRenderer:F,matches:D,metadata:n,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:kl,count:Z,page:v,onChangePage:h,rowsPerPage:w,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null))}));Nl.displayName="FindMatchesView";const Il=e=>{let{entity:t,filter:n,rules:r,sorting:o,page:a,rowsPerPage:i,options:s,enabled:c}=e;const{setGlobalSpinner:u,setEntitiesMap:p}=Ma(),d=(0,l.useCallback)((()=>{u(!0)}),[u]),m=(0,l.useCallback)((()=>{u(!1)}),[u]),{total:h,matches:f,entitiesMap:g,loadMatches:b}=(0,Gr.s)({enabled:c,entity:t,filter:n,rules:r,onFinishLoading:m,onStartLoading:d,options:s,page:a,rowsPerPage:i,sorting:o,markMatchedValues:!0});return(0,l.useEffect)((()=>{p(g)}),[p,g]),{matches:f,total:h,entitiesMap:g,loadMatches:b}};var Al=n(30268);const Dl=(0,Le.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"16px 16px 0"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px"},path:{color:e.palette.text.secondary,fontize:"13px",letterSpacing:0,lineHeight:"15px",padding:"6px 0"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}})));function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Bl(e,t,n[t])}))}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vl=e=>{let{config:t,mainEntity:n,currentEntity:r,matchRules:o,open:a,onClose:s=d.identity}=e;const c=Dl(),u=(0,p.useDispatch)(),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),f=(0,l.useRef)(null),{relation:g={}}=(0,p.useSelector)((e=>Se.ZP.selectors.getRelationToAddByViewId(e,t.id)))||{},{inRelations:b=[],outRelations:y=[]}=(0,l.useMemo)((()=>((e,t,n,r,o)=>{const{isNotDuplicatedInRelation:a,isNotDuplicatedOutRelation:l}=(0,m.xE1)(),i=t=>(0,d.pipe)((0,d.assocPath)(["startObject","objectType"],(0,m.nt9)(e,t.startObject.objectTypeURI)),(0,d.assocPath)(["endObject","objectType"],(0,m.nt9)(e,t.endObject.objectTypeURI)))(t),s=(0,m.nt9)(e,r.type),c=(0,d.propOr)({},"matchActions",t),u=(0,m.dzT)(c,s,o),[p]=u.map((e=>{let{createRelation:t}=e;return t})).filter(d.identity);return(0,d.evolve)({inRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,r,n)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(a),(0,d.map)(i)),outRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,n,r)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(l),(0,d.map)(i))},p)||{}})(h,t,n,r,o)),[t,n,r,o,h]),{relationUri:v,relationType:w={}}=g,E=(0,d.pathOr)({},["object","attributes"],g),C=(0,l.useMemo)((()=>(0,m.xF8)(h,w)),[w,h]),x=(0,l.useMemo)((()=>Zl({attributes:E},(0,m.p2l)(g))),[g,E]),O=t.id,S=(0,l.useCallback)((0,d.pipe)(Se.N5.relations.actions.setRelationType(t.id,v),u),[t,v,u]),R=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.addAttributes,u)(e.map((e=>Zl({},e,{viewId:O}))))),[O,u]),P=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.modifyAttribute,u)(Zl({},e,{viewId:O}))),[O,u]),k=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.removeAttribute,u)(Zl({},e,{viewId:O}))),[O,u]),T=(0,l.useCallback)((()=>s(v)),[v,s]),M=(0,l.useCallback)((()=>u(Se.N5.errors.actions.errorsSet([]))),[u]),j=(0,l.useCallback)((()=>{const e=(0,m.xkB)(h,{relation:g});return u(Se.N5.errors.actions.errorsSet(e)),0===e.length}),[g,h,u]),N=(0,l.useCallback)((()=>{M(),T()}),[M,T]),I=`${(0,m.idV)(r.label)} → ${(0,m.idV)(n.label)}`,A=(0,d.isEmpty)(w),D=f.current,Z=(0,l.useMemo)((()=>({element:D,priority:["top","bottom"]})),[D]);return i().createElement(Lt.Dialog,{open:a,fullWidth:!0,maxWidth:"sm",onClose:N,classes:{paper:c.dialogPaper}},i().createElement(Lt.DialogTitle,{disableTypography:!0,classes:{root:c.dialogTitle}},i().createElement(Lt.Typography,{variant:"subtitle1",classes:{root:c.titleText}},q().text("Add relationship")),i().createElement(Lt.Typography,{variant:"body2",classes:{root:c.path}},I)),i().createElement(Lt.DialogContent,{classes:{root:c.content},ref:f},i().createElement(Al.p.Provider,{value:Z},i().createElement(Br.Z,{relation:g,metadata:h,inRelationTypes:b,outRelationTypes:y,onChange:S,applyFirstByDefault:!0}),i().createElement(Vr.Z,{className:c.attributeList,attrTypes:C,entity:x,showEmptyEditors:!0,mode:m.fO_.EDITING,parentUri:v,onAddAttributes:R,onChangeAttribute:P,onDeleteAttribute:k}))),i().createElement(Lt.DialogActions,null,i().createElement(Lt.Button,{onClick:N},q().text("Cancel")),i().createElement(Lt.Button,{disabled:A,color:"primary",onClick:()=>{const{relationType:e,startDate:t,endDate:o}=g;j()&&((0,m.DsR)({startEntityUri:n.uri,endEntityUri:r.uri,relationType:e,attributes:(0,d.pathOr)({},["object","attributes"],g),startDate:t,endDate:o}).catch(Fa),T())}},q().text("Add"))))};function Ll(){return Ll=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ll.apply(this,arguments)}const zl=e=>{const[t,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)({}),a=(0,p.useDispatch)(),s=(0,l.useCallback)((t=>{let{mainEntity:r,currentEntity:l,matchRules:i}=t;const s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{relation:{relationUri:(0,m.ncP)()},entity:e,isNew:!0}}(l);(0,d.pipe)(Se.N5.relations.actions.openRelationEditor(e.id),a)(s),o({mainEntity:r,currentEntity:l,matchRules:i}),n(!0)}),[e,a]),c=(0,l.useCallback)((t=>{(0,d.pipe)(Se.N5.relations.actions.closeRelationEditor,a)(e.id,t),n(!1)}),[e.id,a]),u=(0,l.useCallback)((()=>t?i().createElement(Vl,Ll({config:e,open:t,onClose:c},r)):null),[t,e,c,r]);return{showDialog:t,openAddRelationDialog:s,AddRelationDialogRenderer:u}},Hl=[{id:"label",get label(){return q().text("Profile name")}},{id:"matchRules",get label(){return q().text("Match rule")}},{id:"mlMatchRules",get label(){return q().text("Match IQ")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT}},{id:"id",get label(){return q().text("Entity ID")}}],Fl=[{id:"score",get label(){return q().text("Match score")}}],Wl=e=>{let{fieldName:t}=e;return(0,d.pipe)(d.values,(0,d.pluck)("name"),(0,d.any)((0,d.equals)(t)))(m.S91)},_l=e=>(0,d.flatten)(e.map((0,d.prop)("values"))).join(",");function Ul(){return Ul=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ul.apply(this,arguments)}const Gl=(0,l.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=d.identity}=e;const{ActionButton:o,props:a}=n;return i().createElement(o,Ul({ref:t,mode:"menuItem",onMenuClose:r},a))}));Gl.displayName="MenuItemRenderer";const ql=Gl;function $l(){return $l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$l.apply(this,arguments)}const Xl=e=>{let{actions:t,numberOfButtons:n=2,mode:r="normal",actionButtonSize:o,classes:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const[c,u]=(0,d.splitAt)(n,t),p="normal"===r?Oe.N.button:Oe.N.iconButton,m="normal"===r?"MPlus":"S";return i().createElement(i().Fragment,null,c.map(((e,t)=>{let{ActionButton:n,props:r}=e;return i().createElement(n,$l({key:t,mode:p,className:null==a?void 0:a.actionButton},o?{size:o}:{},r))})),u.length>0&&i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ot.Z,size:m,tooltipTitle:q().text("More actions")},className:null==a?void 0:a.moreOptions,menuId:"matches-view-actions",menuItems:u,onMenuOpen:l,onMenuClose:s,MenuItemRenderer:ql}))},Yl={showTransitiveMatches:!0},Ql=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),Kl=[20,50,100],[Jl]=Kl,ei=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=Ql(),[s,c]=Ha({field:Fl[0].id,order:"desc"},Jl),{changeRowsPerPage:u,changePage:h,toggleSort:f,setSelectedItems:g,toggleSelect:b}=s,{page:y,rowsPerPage:v,sorting:w,selectedItems:E,isGlobalSpinnerActive:S}=c,R=Yl,P=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),k=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),T=P&&!(0,m.O27)(k),{uri:M,type:j}=t||{},{showDialog:N,openAddRelationDialog:I,AddRelationDialogRenderer:A}=zl(o),D=bl(Hl,Fl,n,j),[Z,B]=(0,l.useMemo)((()=>(0,d.partition)(Wl)(r)),[r]),{matches:V,total:L,entitiesMap:z,loadMatches:H}=Il({enabled:!!M,entity:t,filter:(0,m.Uqd)()(B),page:y,sorting:w,rowsPerPage:v,options:R,rules:_l(Z)}),{setReloadHandler:F}=ta();F((()=>{H()}));const W=(0,l.useCallback)((()=>{g([])}),[g]),_=(0,l.useCallback)((()=>{g(V)}),[g,V]);(0,C.D)((()=>{h(0),W()}),[M,R]);const U=(0,l.useMemo)((()=>(0,m.NVY)(M,Object.keys(z))),[M,z]),G=(0,Ar.C)({objectIds:U}),q=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canAddRelation:u,canMark:p}=(0,m.hXd)(n,o,r.object,t,r.matchRules),h=[r.object],f=[...h,t].some(m.biM),g=[{ActionButton:$a,show:c,props:{entity:t,entities:h}},{ActionButton:Ya,show:p,props:{entity:t,entities:h}},{ActionButton:nl,show:!f&&T,props:{entity:t,entities:h}},{ActionButton:ll,show:u&&!f,props:{mainEntity:t,currentEntity:r.object,matchRules:r.matchRules,onClick:I}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:g,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,o,n,I,T]),$=(0,l.useMemo)((()=>V.map((e=>null==E?void 0:E.find((0,d.equals)(e)))).filter(d.identity).length),[E,V]);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:z},i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:$,totalCount:L,totalOnPage:V.length,sortOptions:D,sorting:w,toggleSort:f,onSelect:$?W:_}),i().createElement(Cl,{entityToMatch:t,toggleSelect:b,actionButtonsRenderer:q,matches:V,metadata:n,entitiesMap:z,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:Kl,count:L,page:y,onChangePage:h,rowsPerPage:v,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null)),N&&i().createElement(A,null)))}));ei.displayName="MatchesView";const ti=ei;function ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ri=[{id:"label",get label(){return q().text("Profile name")}},{id:"id",get label(){return q().text("Entity ID")}}],oi=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),ai=[20,50,100],[li]=ai,ii=ia(ri),si=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=oi(),[s,c]=Ha({order:"asc",field:ii[0]},li),{changeRowsPerPage:u,changePage:h,setSelectedItems:f,toggleSelect:g,toggleSort:b}=s,{page:y,rowsPerPage:v,sorting:w,selectedItems:E,isGlobalSpinnerActive:S}=c,{uri:R,type:P}=t||{},k=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),T=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),M=k&&!(0,m.O27)(T),{matches:j,total:N,entitiesMap:I,loadNotMatches:A}=(e=>{let{entityUri:t,filter:n,sorting:r,page:o,rowsPerPage:a,enabled:i}=e;const{order:s,field:c}=r||{},{setGlobalSpinner:u}=Ma(),[d,h]=(0,l.useState)(0),[f,g]=(0,l.useState)([]),[b,y]=(0,l.useState)({}),v=(0,p.useSelector)(Se.ZP.selectors.getTenant),w=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),E=(0,p.useSelector)(Se.ZP.selectors.getDataTenants),{activityFilter:C,globalFilter:x}=(0,p.useSelector)(Se.ZP.selectors.getGlobalSearchRequestOptions)||{},O=(0,l.useMemo)((()=>({dtssPath:w,dataTenants:E,entity:{uri:t},customerTenant:v,dtssRequest:m.WSA})),[w,E,t,v]),S=(0,l.useCallback)((0,m.U_T)(O,m.pg),[O]),R=(0,mo.a)(S),P=(0,oe._)(),k=e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ni(e,t,n[t])}))}return e}({matchRules:[m.h_8]},e),T=(0,l.useCallback)((e=>{i&&(u(!0),P(R({entityUri:t,offset:o*a,max:a,filter:(0,m.vyX)(x,n)||"",sort:c,force:e,order:s,activeness:C})).then((e=>{const{response:t,total:n,originalResponse:r}=e;h(n),g(t.map(k)),t.map((e=>{let{uri:t}=e;return t})).length>0&&y((0,m.KPC)(r))})).finally((()=>u(!1))))}),[t,n,c,s,o,a,C,i,x]);return(0,l.useEffect)((()=>{T()}),[T]),{matches:f,total:d,entitiesMap:b,loadNotMatches:(0,l.useCallback)((()=>{T(!0)}),[T])}})({enabled:!!R,entityUri:R,filter:(0,m.Uqd)()(r),page:y,rowsPerPage:v,sorting:w}),D=(0,l.useMemo)((()=>(0,m.NVY)(R,Object.keys(I))),[R,I]),Z=(0,Ar.C)({objectIds:D}),B=bl(ri,[],n,P),{setReloadHandler:V}=ta();V((()=>{A()}));const L=(0,l.useCallback)((()=>{f([])}),[f]),z=(0,l.useCallback)((()=>{f(j)}),[f,j]);(0,C.D)((()=>{h(0),L()}),[R]);const H=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canMark:u}=(0,m.hXd)(n,o,r.object,t,r.matchRules),p=[r.object],h=[...p,t].some(m.biM),f=[{ActionButton:$a,show:c,props:{entity:t,entities:p}},{ActionButton:rl,show:u,props:{entity:t,entities:p}},{ActionButton:nl,show:!h&&M,props:{entity:t,entities:p}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:f,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,o,n,M]),F=(0,l.useMemo)((()=>j.map((e=>null==E?void 0:E.find((0,d.equals)(e)))).filter(d.identity).length),[E,j]);return i().createElement(Dr.h.Provider,{value:Z},i().createElement(Zr.X.Provider,{value:I},i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:F,totalCount:N,totalOnPage:j.length,sortOptions:B,sorting:w,toggleSort:b,onSelect:F?L:z}),i().createElement(Cl,{entityToMatch:t,toggleSelect:g,actionButtonsRenderer:H,matches:j,metadata:n,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:ai,count:N,page:y,onChangePage:h,rowsPerPage:v,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null))))}));si.displayName="NotMatchView";const ci=e=>{let{entity:t,metadata:n,filters:r,config:o,activeView:a}=e;const l=(0,f.U)();return i().createElement(g.s.Provider,{value:l},(()=>{switch(a){case Xo.PotentialMatches:return i().createElement(ti,{entity:t,metadata:n,filters:r,config:o});case Xo.FindMatches:return i().createElement(Nl,{entity:t,metadata:n,filters:r,config:o});case Xo.NotAMatch:return i().createElement(si,{entity:t,metadata:n,filters:r,config:o});default:return i().createElement("div",null)}})())};var ui=n(6782),pi=n(64731);function di(){return di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},di.apply(this,arguments)}var mi=n(58970),hi=n(54337),fi=n(70215);const gi=(0,Le.Z)({input:{margin:0,borderRadius:"4px",width:"100%",paddingTop:0,paddingBottom:0}});function bi(){return bi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(this,arguments)}const yi=e=>{let{rowData:t,rowContext:n}=e;const r=gi(),{values:o=[],attribute:{attrType:a,fieldName:s=null}={},filter:c,id:u}=t||{},{changeFilter:p}=n,{entityType:d}=n,h={values:o,onChange:(0,l.useCallback)((e=>{p({fieldName:s,filter:c,values:e},u)}),[p,u,s,c]),TextFieldProps:(0,l.useMemo)((()=>({InputProps:{classes:{root:r.input}}})),[r]),fullWidth:!0};return(0,m.pzC)(a)?i().createElement(mi.Z,bi({},h,{name:a.name,entityType:d})):(0,m.OFd)(a)?i().createElement(hi.Z,h):i().createElement(fi.Z,{rowContext:n,rowData:t})},vi=(0,Le.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ei(e,t,n[t])}))}return e}function Ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ci={FilterSelector:e=>{const{rowData:t}=e,{attribute:{attrType:n}={}}=t||{},r=(0,m.pzC)(n)?[m.j5E.EQUALS].map((e=>({value:e,label:(0,ui.Z)((0,m.XS2)(e))}))):null;return i().createElement(pi.Z,di({},e,{options:r}))},ValuesEditor:yi},xi={ValuesEditor:yi},Oi=(0,l.memo)((e=>{var t;let{config:n,isLoaded:r,savedState:o,onUpdateSavedState:a}=e;const s=vi(),[c,u]=(0,l.useState)([]),[h,f]=(0,l.useState)([]),[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)(null),w=(0,p.useSelector)(Se.ZP.selectors.getMetadata),E=(0,p.useSelector)(Se.ZP.selectors.getEntity),C=(0,l.useCallback)((e=>{v((t=>t===e?null:e))}),[]),x=(0,l.useCallback)((()=>{v(null)}),[]),O=null!==y,S=(0,m.nt9)(w,null==E?void 0:E.type),R=(0,l.useMemo)((()=>(e=>(e.attributes||[]).concat(e.analyticsAttributes||[]).filter(m.Uty))(S)),[S]),P=(0,l.useMemo)((()=>[wi({},m.S91.matchRules,{check:m.Ir}),wi({},m.S91.MLRecommendedMatch,{check:m.XQO})].reduce(((e,t)=>{let{check:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["check"]);return n(S)&&e.push(r),e}),[])),[S]),k=(0,l.useMemo)((()=>[...P,...R]),[R,P]),T=(0,l.useMemo)((()=>[m.xPW.id,m.G39.sourceSystems,...R]),[R]),M=(0,l.useMemo)((()=>[{buttonProps:{id:Xo.PotentialMatches,icon:_o,tooltipTitle:q().text("Potential Matches")},headerProps:{mainTitle:q().text("Potential Matches"),rightContent:i().createElement(zo.Z,{filters:c,onChange:u,attributeTypes:k,components:Ci})},filters:c},{buttonProps:{id:Xo.FindMatches,icon:Go,tooltipTitle:q().text("Find Matches")},headerProps:{mainTitle:q().text("Find Matches"),rightContent:i().createElement(zo.Z,{filters:h,onChange:f,attributeTypes:T,components:xi})},filters:h},{buttonProps:{id:Xo.NotAMatch,icon:$o,tooltipTitle:q().text("Not a Match")},headerProps:{mainTitle:q().text("Not a Match"),rightContent:i().createElement(zo.Z,{filters:g,onChange:b,attributeTypes:R})},filters:g}]),[c,h,g,k,T,R]),j=(0,l.useMemo)((()=>{var e;return wi({},null===(e=M[y])||void 0===e?void 0:e.headerProps,{onClose:x})}),[x,y,M]),N=null===(t=M[y])||void 0===t?void 0:t.filters;return(0,l.useEffect)((()=>{if(!r)return;const e=(0,d.propOr)(!0,"showSidePanel")(o);v(e?Xo.PotentialMatches:null)}),[r]),(0,l.useEffect)((()=>{r&&a({showSidePanel:null!==y})}),[y]),i().createElement("div",{className:s.wrapper},i().createElement(Ho.h,{open:O,width:480},i().createElement(sl.Provider,{value:j},i().createElement(ci,{config:n,entity:E,filters:N,metadata:w,activeView:y}))),i().createElement(Fo.G,{buttonsProps:(0,d.pluck)("buttonProps",M),onButtonClick:C,activeIndexId:y}))}));Oi.displayName="RightSidePanel";var Si=n(83401);const Ri=(0,Le.Z)((()=>({button:{minWidth:"90px",padding:"8px 12px"}})));var Pi=n(66324),ki=n(82882);function Ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mi=[{id:Yo.COLUMNS,tooltipTitle:q().text("Column"),title:q().text("Column"),Icon:Pi.Z},{id:Yo.TABLE,tooltipTitle:q().text("Table"),title:q().text("Table"),Icon:ki.Z}],ji=e=>{let{className:t}=e;const n=Ri(),{comparisonViewMode:r,selectedItems:o}=Ta(),{setComparisonViewMode:a}=Ma(),l=o.length>4;return i().createElement(Si.Z,{className:t,classes:{button:n.button},modes:Mi.map((e=>e.id===Yo.COLUMNS?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ti(e,t,n[t])}))}return e}({},e,{disabled:l,tooltipTitle:l?q().text("Column view supports maximum ${maxProfiles} profiles",{maxProfiles:4}):e.tooltipTitle}):e)),modeId:r,onChange:a})},Ni=(0,Le.Z)((e=>({header:{padding:"0 8px 0 16px",backgroundColor:"#fff","& $splitter":{height:"32px",marginRight:"16px",marginLeft:"4px",color:"rgba(0, 0, 0, 0.12)"}},title:{fontSize:"16px",fontWeight:400,lineHeight:"24px",letterSpacing:"0.15px",color:e.palette.text.primary},clearAllButton:{marginLeft:"16px"},mergeButton:{marginRight:"12px"},total:{color:e.palette.text.secondary},splitter:{},actionSplitter:{height:"32px",margin:"0 8px",color:"rgba(0, 0, 0, 0.12)"}})));var Ii=n(47603);const Ai=e=>{let{items:t}=e;return i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ii.Z,tooltipTitle:q().text("Settings"),size:"L"},menuId:"matches-view-settings",menuItems:t})},Di=(0,d.map)((0,d.prop)("object")),Zi=e=>{let{config:t,columnsData:n,selectedColumns:r,onChangeColumns:o,showNonOv:a,onChangeShowNonOv:s}=e;const c=Ni(),u=(0,p.useSelector)(Se.ZP.selectors.getEntity),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),{selectedItems:f,limitSelection:g}=Ta(),{setSelectedItems:b}=Ma(),y=Di(f),{tableViewModeAvailable:v}=t,{canMerge:w,canMark:E}=(0,m.OCS)(h,t,u,f),C=[...y,u].some(m.biM),x=(0,l.useMemo)((()=>[{ActionButton:$a,show:w,props:{entity:u,entities:y}},{ActionButton:Ya,show:E,props:{entity:u,entities:y}},{ActionButton:nl,show:!C,props:{entity:u,entities:y}}].filter((0,d.prop)("show"))),[E,w,u,y,C]),O=0!==f.length,S=(0,l.useCallback)((()=>{s(d.not)}),[s]),R=(0,l.useMemo)((()=>[{selected:!a,selectable:!0,text:q().text("Show only OV"),onClick:S,id:"showNonOv"}]),[S,a]);return i().createElement(zt.Z,{title:"",classes:{root:c.header}},i().createElement(Lt.Typography,{className:c.title},i().createElement("span",null,q().text("Match Review")),O&&i().createElement("span",{className:c.total}," ","(",f.length,g&&"/"+g,")")),O&&i().createElement(Lt.Button,{onClick:()=>{b([])},className:c.clearAllButton,color:"primary"},q().text("Clear All")),i().createElement(lr.Z,null),O&&i().createElement(i().Fragment,null,i().createElement(Xl,{actions:x,numberOfButtons:2}),i().createElement(Lt.Divider,{orientation:"vertical",classes:{vertical:c.actionSplitter}})),i().createElement(Ai,{items:R}),i().createElement($t.Z,{columnsData:n,selectedColumns:r,onChangeColumns:o}),v&&i().createElement(i().Fragment,null,i().createElement(Lt.Divider,{orientation:"vertical",classes:{vertical:c.splitter}}),i().createElement(ji,null)))};var Bi=n(21077),Vi=n(43600);const Li=i().createContext({expandedMap:{},onExpandType:()=>{}});function zi(){return zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}Li.displayName="ExpandedContext";const Hi=e=>{const t=(0,l.forwardRef)(((t,n)=>{const{attributeType:r}=t,{expandedMap:o}=(0,l.useContext)(Li),a=o[r.uri];return i().createElement(e,zi({},t,{expanded:a,ref:n}))}));return t.displayName="WithExpanded",t},Fi="rgba(140, 193, 82, 0.12)",Wi=(0,Le.Z)({complexAttributesHeadRenderer:{height:"100%",width:"100%",display:"flex",alignItems:"flex-start"},complexAttributesHeadLabel:{flex:1,marginLeft:"5px"},arrowButton:{cursor:"pointer",marginLeft:"-3px"},attribute:{whiteSpace:"pre-wrap"},matchedAttribute:{fontWeight:500,position:"relative","&::after":{content:'""',position:"absolute",left:"-1000px",top:0,width:"5000px",height:"100%",background:Fi,pointerEvents:"none"}}}),_i=(0,Le.Z)({badge:{borderRadius:"50%",background:Fi,fontWeight:500,height:"20px",width:"20px",display:"flex",alignItems:"center",justifyContent:"center",alignSelf:"flex-start",marginBottom:"2px",marginTop:"-2px"}}),Ui=e=>{let{attributeValue:t}=e;const n=_i(),{highlightedValuesUris:r=[]}=(0,l.useContext)(Vi.j),o=r.filter((e=>(0,m.sOy)(e,t.uri))).length;return o>0?i().createElement(Lt.Tooltip,{title:1===o?q().text("${count} match",{count:o}):q().text("${count} matches",{count:o})},i().createElement("div",{className:n.badge},o)):null},Gi=Hi(Ke.Z),qi=e=>{let{value:{attributeType:t,attributeValues:n,matchedValuesUris:r,showNonOv:o}}=e;const a=Wi(),s=(0,l.useMemo)((()=>({highlightedValuesUris:r,highlightedClassName:a.matchedAttribute})),[r,a.matchedAttribute]);return i().createElement("div",{className:a.attribute},i().createElement(Vi.j.Provider,{value:s},i().createElement(Gi,{values:n,attributeType:t,showNonOv:o,RightSlot:Ui})))},$i=i().createContext({});$i.displayName="ColumnDataContext";const Xi=(0,Le.Z)({menuButtonWrapper:{display:"none",position:"absolute",top:"-4px",right:"-14px"},headCell:{display:"flex",position:"relative","th:hover &":{"& $menuButtonWrapper":{display:"block"}}},active:{display:"block"}}),Yi=e=>{let{label:t,id:n,hideable:r}=e;const o=Xi(),{setAnchor:a,setHoveredId:s,hoveredId:c}=(0,l.useContext)($i),u=(0,l.useRef)();return i().createElement("div",{className:o.headCell},t,!1!==r&&i().createElement("div",{className:De()(o.menuButtonWrapper,{[o.active]:c===n}),ref:u},i().createElement(ct.Z,{icon:Ot.Z,onClick:()=>{a(u.current),s(n)},size:"S"})))};var Qi=n(19592);const Ki=e=>{let{label:t,attributeType:n,id:r}=e;const o=Wi(),{expandedMap:a,onExpandType:s}=(0,l.useContext)(Li),c=(0,l.useCallback)((()=>s(n.uri)),[s,n]),u=a[n.uri];return i().createElement("div",{className:o.complexAttributesHeadRenderer},i().createElement(Qi.Z,{expanded:u,onClick:c,className:o.arrowButton}),i().createElement("div",{className:o.complexAttributesHeadLabel},i().createElement(Yi,{label:t,id:r})))},Ji=i().createContext({hoveredEntity:null,resetHoveredEntity:()=>{}});Ji.displayName="HoveredEntityContext";const es=(0,l.memo)((e=>{let{value:{mainEntity:t,entity:n,matchRules:r,permission:o},onActionsMenuClose:a,onActionsMenuOpen:l,openAddRelationDialog:s,classes:c={},mode:u="hover"}=e;const{canMerge:p,canAddRelation:h,canMark:f}=o,g=[t,n].some(m.biM),b=!r,y=!b&&r.includes(m.h_8),v=!y&&!b,w=[{ActionButton:$a,show:p&&(y||v),props:{entity:t,entities:[n]}},{ActionButton:Ya,show:f&&v,props:{entity:t,entities:[n]}},{ActionButton:rl,show:f&&y,props:{entity:t,entities:[n]}},{ActionButton:nl,show:!g&&(y||v),props:{entity:t,entities:[n]}},{ActionButton:Ja,show:f&&b,props:{entity:t,entities:[n]}},{ActionButton:ll,show:h&&!g,props:{mainEntity:t,currentEntity:n,matchRules:r,onClick:s}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:w,numberOfButtons:2,mode:u,actionButtonSize:"XS",classes:{actionButton:c.actionButton,moreOptions:c.moreOptions},onActionsMenuClose:a,onActionsMenuOpen:l})})),ts=(0,Le.Z)({container:{position:"relative",width:"100%",height:"140px",display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden"},hovered:{backgroundColor:"rgb(245, 245, 245)"},closeButton:{position:"absolute",zIndex:1,margin:"4px"},matchControlsContainer:{display:"flex",alignItems:"center",height:"45px",margin:"4px 8px"},rightButton:{display:"flex",alignItems:"center"},moreOptions:{marginLeft:"8px"}});function ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rs=e=>"potentialMatchReview"===e.processType,os=i().createContext((()=>{}));os.displayName="WorkflowTasksAvailabilityContext";const as=(0,Le.Z)({container:{position:"relative",minHeight:"86px",display:"flex",overflow:"hidden",margin:"-16px"},assigneeSelector:{},assigneeContainer:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"16px 14px 16px 48px"}});function ls(){return ls=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ls.apply(this,arguments)}const is=(0,d.pick)(["processInstanceComments","taskId"]),ss=e=>{let{entity:t,match:n}=e;const r=as(),{tasks:o,loadTasks:a}=(e=>{let{entity:t,match:n}=e;const r=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),o=(0,p.useSelector)(Se.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,p.useSelector)(Se.ZP.selectors.getTenant),i=(0,oe._)(),{uri:s}=t,c=(0,m.ev7)(n),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)([]),b=(0,l.useCallback)((()=>{r&&c!==s&&(h(!0),i((0,m.uT0)({entityUri:s,workflowPath:r,environment:o,tenant:a})).then((e=>{const{data:t}=e,n=(0,d.propSatisfies)((0,d.includes)(c),"objectURIs"),r=(0,d.allPass)([rs,n]),o=t.filter(r);g(o)})).finally((()=>h(!1))))}),[s,o,a,r,c]);return{enabled:!!r,loading:u,tasks:f,loadTasks:b}})({entity:t,match:n}),s=(0,l.useContext)(os),{sendMergeAllRequest:c}=(0,bt._)({entity:t,entities:[n.object]}),{sendMarkAsNotMatchRequest:u}=(0,yt.m)({entity:t,entities:[n.object]}),h={Merge:c,NotAMatch:u};(0,l.useEffect)((()=>{a()}),[a]);const f=o[0],g=(0,m.ev7)(n);(0,l.useEffect)((()=>{null==s||s(g,!!f)}),[s,g,f]);const b=(f&&f.possibleActions||[]).map((e=>{let{action:t,label:n}=e;return{text:n,onClick:h[t]}})),{assignee:y,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:E}=(0,vt.r)(f||{}),C=b.length>0?i().createElement(wt.Z,{buttonComponent:ct.Z,buttonProps:{icon:Ot.Z,size:"L"},menuId:"custom-actions",menuItems:b}):null;return f?i().createElement("div",{className:r.container},i().createElement(Et.Z,ls({},(e=>({date:e.dueDate,type:e.processDefinitionDisplayName,createdBy:e.createdBy,step:e.displayName}))(f),{Actions:C}),i().createElement("div",{className:r.assigneeContainer},i().createElement(Ct.Z,{className:r.assigneeSelector,enabled:!E||y,getOptions:v,onChange:w,hideSelectedOptions:!1,label:q().text("Assigned to"),value:y,defaultOptions:!0})),i().createElement(xt.V,is(f)))):null},cs=[{id:"profile",label:q().text("Profile name"),dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,draggable:!1,initialWidth:280,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"matchRules",label:q().text("Match method"),dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,draggable:!1,initialWidth:130,minWidth:130,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"workflowCard",label:q().text("Workflow"),modes:[Yo.COLUMNS]},{id:"entityId",label:q().text("Entity ID"),dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"score",label:q().text("Match score"),dataTypeDefinition:{type:m.oS0.TYPE_INT},initialWidth:100,modes:[Yo.TABLE,Yo.COLUMNS]},{id:"sources",label:q().text("Sources"),modes:[Yo.COLUMNS,Yo.TABLE]},{id:"crosswalks",label:q().text("Crosswalks"),modes:[Yo.COLUMNS]}];var us=n(63149),ps=n(94175);const ds=(0,Le.Z)({itemContainer:{width:"18px",height:"18px"},item:{width:"18px",height:"18px",background:"none",fontSize:"1rem"}}),ms=(0,l.memo)((e=>{let{className:t,crosswalk:n,showTooltip:r=!0}=e;const o=ds(),a=(0,us.nX)(n),l=(0,p.useSelector)(Se.ZP.selectors.getMetadata)||{},s=i().createElement("div",{className:De()(o.itemContainer,t),style:{background:a}},i().createElement(ps.Z,{sourceType:n.type,className:o.item}));return r?i().createElement(Lt.Tooltip,{title:(0,m.tH7)(l,n.type)},s):s})),hs=(0,Le.Z)({crosswalk:{marginBottom:"8px"},crosswalkIcon:{marginRight:"5px"},labelContainer:{display:"flex",alignItems:"center",width:"100%"},spacer:{flex:1}}),fs=e=>{let{attributeValue:t}=e;const n=hs(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata),o=t.value.crosswalk;return i().createElement("div",{className:n.labelContainer},i().createElement(ms,{className:n.crosswalkIcon,crosswalk:o,showTooltip:!1}),i().createElement("div",null,(0,m.tH7)(r,o.type)),i().createElement("div",{className:n.spacer}),i().createElement("div",null,o.value))},gs=Hi(Ke.Z),bs=(0,Le.Z)({wrapper:{display:"flex",flexWrap:"wrap",marginBottom:"-8px"},crosswalkIcon:{marginRight:"5px",marginBottom:"8px"}}),ys=e=>{let{value:t}=e;const n=bs();return t?i().createElement("div",{className:n.wrapper},t.map((e=>i().createElement(ms,{key:e.uri,className:n.crosswalkIcon,crosswalk:e})))):null};function vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ws(e,t,n[t])}))}return e}function ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Es={profile:{cellRenderer:e=>{let{value:{entity:t,showCloseButton:n,onClose:r,showButtons:o,config:a}}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e.value,["entity","showCloseButton","onClose","showButtons","config"]);const c=ts(),{hoveredEntity:u,resetHoveredEntity:p}=(0,l.useContext)(Ji),d=(0,m.BTI)(t)===u,{showDialog:h,openAddRelationDialog:f,AddRelationDialogRenderer:g}=zl(a),b=(0,l.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ns(e,t,n[t])}))}return e}({},s,{entity:t})),[s,t]);return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(c.container,{[c.hovered]:o&&d})},n&&i().createElement(ct.Z,{className:c.closeButton,icon:pt.default,onClick:r,size:"XXS"}),i().createElement(ut.Z,{entity:t}),o&&i().createElement("div",{className:c.matchControlsContainer},i().createElement(es,{mode:"normal",value:b,onActionsMenuClose:p,openAddRelationDialog:f,classes:{actionButton:c.rightButton,moreOptions:c.moreOptions}}))),h&&i().createElement(g,null))},headCellRenderer:Yi,label:""},matchRules:{cellRenderer:e=>{let{value:{metadata:t,entity:n,match:r,entitiesMap:o,show:a}}=e;return a?i().createElement(ft.Z,{entity:n,match:r,entitiesMap:o,metadata:t}):null},headCellRenderer:Yi},workflowCard:{cellRenderer:e=>{let{value:{entity:t,match:n}}=e;return i().createElement(ss,{entity:t,match:n})},headCellRenderer:Yi},sources:{cellRenderer:ys,headCellRenderer:Yi},entityId:{headCellRenderer:Yi},crosswalks:{cellRenderer:e=>{let{value:{crosswalks:t,attributeType:n}}=e;const r=hs(),o=(0,p.useSelector)(Se.ZP.selectors.getMetadata),a=(0,l.useMemo)((()=>null==t?void 0:t.map((e=>((e,t,n)=>t.attributes.reduce(((t,r)=>(r.uri===m.G39.sourceSystems.uri?t.value[r.uri]=(0,m.tH7)(n,e.type):e[r.uri]&&(t.value[r.uri]=e[r.uri]),t)),{value:{crosswalk:e},uri:e.uri}))(e,n,o)))),[o,t,n]);return a?i().createElement(gs,{values:a,attributeType:n,LabelRenderer:fs,valueContainerClassName:r.crosswalk}):null},headCellRenderer:Ki,attributeType:{uri:"crosswalks",name:"crosswalks",type:"Nested",attributes:Object.values(m.G39)}}},Cs=cs.filter((e=>{let{modes:t}=e;return t.includes(Yo.COLUMNS)})).map((e=>vs({},(0,d.pick)(["id","label","hideable"],e),Es[e.id]))),xs=(0,d.pipe)((0,d.split)("/"),d.last),Os=e=>(0,d.when)(d.identity,(0,d.pipe)(d.values,(0,d.chain)((0,d.chain)((0,d.cond)([[(0,d.path)(["value","uri"]),(0,d.path)(["value","uri"])],[(0,d.path)(["value","values"]),(0,d.pipe)((0,d.path)(["value","values"]),(0,d.map)((0,d.prop)("uri")))]]))),(0,d.filter)(d.identity)))(e),Ss=(e,t,n,r,o,a,l,i)=>{const{object:s,isMainEntity:c,matchRules:u,matchedValues:p,matchScore:h}=t;switch(o.id){case"entityId":return(0,m.BTI)(s);case"profile":return{mainEntity:r,showCloseButton:!c,onClose:()=>l(t),showButtons:!c,entity:s,matchRules:u,permission:(0,m.hXd)(e,a,s,r,u),config:a};case"matchRules":return{metadata:e,entity:r,match:t,entitiesMap:n,show:!c&&!!u};case"sources":return s.crosswalks;case"crosswalks":return{crosswalks:s.crosswalks,attributeType:o.attributeType};case"workflowCard":return{entity:r,match:t};case"score":return h||0}if((0,m.vZp)(o.id)){const e=(0,m.xy8)(o.attributeType),t=(0,d.pipe)((0,d.pathOr)([],[e,o.attributeType.name]),(0,d.when)((0,d.always)(!i),(0,d.filter)(m.OXP)))(s);return{attributeType:o.attributeType,attributeValues:t,matchedValuesUris:Os(p),showNonOv:i}}},Rs=i().createContext((()=>{}));Rs.displayName="ColumnHandlerContext";const Ps=(0,d.pipe)((0,d.split)("."),(0,d.slice)(0,2),(0,d.join)(".")),ks=(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,Ps)),d.uniq);let Ts;!function(e){e.INSERT_BELOW="below",e.INSERT_ABOVE="above",e.HIDE="hide"}(Ts||(Ts={}));const Ms={[Ts.INSERT_BELOW]:q().text("Insert row below"),[Ts.INSERT_ABOVE]:q().text("Insert row above"),[Ts.HIDE]:q().text("Hide row")},js=e=>{let{open:t,anchorEl:n,onClick:r,onClose:o,actions:a}=e;return i().createElement(Lt.Popover,{open:t,anchorEl:n,onClose:o},i().createElement(Lt.List,{component:"div"},a.map(((e,t)=>((e,t,n)=>i().createElement(Lt.ListItem,{button:!0,component:"div",key:n,onClick:t},i().createElement(Lt.ListItemText,{primary:Ms[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))))};var Ns=n(47458);function Is(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=(e,t)=>e.filter(t).map((e=>e.columns?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Is(e,t,n[t])}))}return e}({},e,{columns:As(e.columns,t)}):e)),Ds=(0,l.memo)((e=>{let{anchorEl:t,onClose:n,actions:r,id:o,selectedAttributes:a,setSelectedAttributes:s,groupColumnsData:c}=e;const u=(0,l.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return As(e,(e=>!t.some((t=>e.id===t))))}(c,a)),[c,a]),[p,d]=(0,l.useState)(),[m,h]=(0,l.useState)(!1);(0,l.useEffect)((()=>{t&&h(!0)}),[t]);const f=()=>{d(null),h(!1),n()};return i().createElement(i().Fragment,null,i().createElement(js,{open:m,anchorEl:t,actions:r,onClose:()=>{h(!1),p||n()},onClick:e=>{if(e!==Ts.HIDE)d(e),h(!1);else{const e=[...a],t=a.indexOf(o);t>-1&&(e.splice(t,1),s(e),f())}}}),i().createElement(Ns.G,{hideCheckBox:!0,anchorEl:p?t:void 0,columnsData:u,selectedColumns:a,onColumnClick:e=>{let{id:t}=e;const n=[...a],r=a.indexOf(o),l=p===Ts.INSERT_ABOVE?r:r+1;n.splice(l,0,t),s(n),f()},onClose:f,title:q().text("Add row")}))}));function Zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bs="1px solid rgba(0,0,0,0.12)",Vs="rgb(245, 245, 245)",Ls=(0,Le.Z)((e=>({container:{overflow:"auto",height:"100%",width:"100%"},comparisonTableWrapper:{display:"flex",alignItems:"flex-start",position:"relative"},collapsedRow:{display:"none"},comparisonTable:{borderSpacing:0,"& tbody tr:hover td, & tbody tr:hover th":{backgroundColor:"rgb(235, 235, 235)"},"table& tbody tr:hover td:nth-child(2)":{backgroundColor:"rgb(215, 228, 239)"},"& td, & th":{borderRight:Bs,borderBottom:Bs,margin:0,verticalAlign:"top",textAlign:"left",fontSize:"13px",minHeight:"16px",boxSizing:"border-box",wordBreak:"break-word",wordWrap:"break-word",backgroundColor:"white"},"& td":{minWidth:310,maxWidth:310,padding:"16px",overflow:"hidden",height:0},"& td:empty, th:empty":{padding:"0px 16px"},"& th":{minWidth:212,maxWidth:212,padding:"16px"},"& thead tr:first-child th:first-child":{borderBottom:"none",borderTop:"none"},"& td:first-child, th:first-child":{borderLeft:Bs,position:"sticky",left:"0",zIndex:2,backgroundColor:Vs,color:e.palette.text.secondary,fontWeight:"normal"},"& td:nth-child(2), th:nth-child(2)":{borderRight:"2px solid rgba(0,0,0,0.12)",position:"sticky",left:"212px",zIndex:2},"& thead tr:first-child td, & thead tr:first-child th":{borderTop:"none",position:"sticky",top:"0",height:141,padding:0,zIndex:2},"& thead tr:nth-child(2) td, & thead tr:nth-child(2) th":{position:"sticky",top:"141px",height:50,padding:"16px",zIndex:2},"& thead tr:nth-child(2) th, & thead tr:nth-child(3) th":{padding:"16px",backgroundColor:Vs},"& thead tr:nth-child(-n+2) td:nth-child(-n+2), & thead tr:nth-child(-n+2) th:nth-child(-n+2)":{zIndex:3},"table& tr td:nth-child(2), th:nth-child(2)":{backgroundColor:"rgb(224, 238, 249)"}},emptyState:{position:"sticky",top:"10vh",display:"flex",width:"100%"}})));function zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Hs(e,t,n[t])}))}return e}function Hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs=[Ts.INSERT_BELOW,Ts.INSERT_ABOVE,Ts.HIDE],Ws=e=>{let{className:t,entity:n,metadata:r,config:o,selectedItems:a,setSelectedItems:s,selectedColumns:c,setSelectedColumns:u,entitiesMap:p={},columnsData:h,showNonOv:f=!1}=e;const g=Ls(),[b,y]=(0,l.useState)(null),[v,w]=(0,l.useState)(),[E,C]=(0,l.useState)(),x=(0,l.useMemo)((()=>a.slice(-4)),[a]),O=(0,l.useMemo)((()=>ks(c)),[c]),S=(0,l.useMemo)((()=>((e,t,n)=>n.map((n=>{const r=Cs.find((e=>{let{id:t}=e;return t===n}));if(r)return r;if(!(0,m.vZp)(n))return null;const o=(0,m.h2W)(n,t.type),a=(0,m.zeJ)(e,o,t.type),l=(0,m.xy8)(o);return a?{id:`${l}.${xs(o)}`,label:a.label,attributeType:a,cellRenderer:qi,headCellRenderer:(0,m.YkM)(a)?Ki:Yi}:null})).filter(d.identity))(r,n,O)),[r,n,O]),R=(0,l.useContext)(Rs),P=(0,l.useMemo)((()=>function(e,t,n,r,o,a,l){let i=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return[{object:n,isMainEntity:!0}].concat(r).map((r=>t.reduce(((t,s)=>(t[s.id]=Ss(e,r,o,n,s,a,l,i),vs({},t,{isDraggable:!r.isMainEntity,id:r.object.uri}))),{})))}(r,S,n,x,p,o,R,f)),[r,S,x,n,p,o,R,f]),[k,T]=(0,l.useState)({}),M=(0,l.useCallback)((e=>{T((t=>zs({},t,{[e]:!t[e]})))}),[]),j=(0,l.useMemo)((()=>({expandedMap:k,onExpandType:M})),[M,k]),N=(0,l.useMemo)((()=>({setHoveredId:w,setAnchor:C,hoveredId:v})),[v]),I=(0,l.useCallback)((()=>{w(null),C(null)}),[]),A=(0,l.useMemo)((()=>S.map((0,d.prop)("id"))),[S]),D=(0,l.useCallback)((()=>{y(null)}),[]),Z=(0,l.useMemo)((()=>({hoveredEntity:b,resetHoveredEntity:D})),[b,D]),{isThereAnyTask:B,setWorkflowTaskAvailability:V}=(e=>{const[t,n]=(0,l.useState)({}),r=(0,l.useCallback)(((e,t)=>{n((n=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Zs(e,t,n[t])}))}return e}({},n,{[e]:t})))}),[]);return{isThereAnyTask:(0,d.pipe)((0,d.map)(m.ev7),(0,d.any)((e=>t[e])))(e),setWorkflowTaskAvailability:r}})(x),L=B?void 0:g.collapsedRow,z=(0,l.useMemo)((()=>S.map((e=>L&&"workflowCard"===e.id?zs({},e,{rowClassName:L}):e))),[S,L]);return i().createElement("div",{className:De()(g.container,t)},i().createElement("div",{className:g.comparisonTableWrapper},i().createElement(Ji.Provider,{value:Z},i().createElement(Li.Provider,{value:j},i().createElement($i.Provider,{value:N},i().createElement(os.Provider,{value:V},i().createElement(Qe.Z,{className:g.comparisonTable,rowsData:z,columnsData:P,theadRowsNumber:2,onMoveRow:(e,t)=>{const n=(0,d.pipe)((0,d.groupBy)((e=>(0,m.vZp)(e)?(0,m.hWO)(e):e)),d.toPairs)(c),r=n.findIndex((t=>{let[n]=t;return n===e})),o=n.findIndex((e=>{let[n]=e;return n===t})),a=n[r];a&&u((0,d.pipe)((0,d.remove)(r,1),(0,d.insert)(o,a),(0,d.chain)((0,d.nth)(1)))(n))},onMoveColumn:(e,t)=>{const n=a.findIndex((t=>{let{object:n}=t;return n.uri===e})),r=a.findIndex((e=>{let{object:n}=e;return n.uri===t})),o=a[n];o&&s((0,d.pipe)((0,d.remove)(n,1),(0,d.insert)(r,o))(a))},setHoveredColumn:e=>{y((null==e?void 0:e.entityId)||null)},resetHoveredColumn:D}))))),!x.length&&i().createElement("div",{className:g.emptyState},i().createElement(Bi.ZP,{LogoRenderer:Bi.B9.SELECT_ATTRIBUTES,variant:Bi.tC.embedded,text:q().text("Select profiles"),secondaryText:q().text("Select one or more profiles to compare it with the current profile")})),i().createElement(Ds,{id:v,anchorEl:E,onClose:I,actions:Fs,selectedAttributes:A,setSelectedAttributes:u,groupColumnsData:h})))},_s=(0,Le.Z)({container:{display:"flex",flexDirection:"column"},table:{flex:1}}),Us=e=>{let{classes:t={},selectedColumns:n,setSelectedColumns:r,selectedItems:o,setSelectedItems:a,config:l,metadata:s,entity:c,entitiesMap:u={},columnsData:p,showNonOv:d}=e;const m=_s();return i().createElement("div",{className:De()(t.root,m.container)},i().createElement(Ws,{className:m.table,entity:c,metadata:s,config:l,selectedColumns:n,setSelectedColumns:r,selectedItems:o,setSelectedItems:a,columnsData:p,entitiesMap:u,showNonOv:d}))};function Gs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qs(e,t,n[t])}))}return e}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $s={position:"relative",whiteSpace:"pre",padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"},color:"rgba(0,0,0,0.87)"},Xs={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},Ys=(e,t)=>({"& > *":{position:"relative"},"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:e,pointerEvents:"none","div.hoveredRow &":{background:t||"none"}},"& $defaultWrapper::after":{background:`linear-gradient(to right, ${(0,ze.U1)(e,0)}, ${e} 100%)`,"div.hoveredRow &":{background:t&&`linear-gradient(to right, ${(0,ze.U1)(t,0)}, ${t} 100%)`}}}),Qs=(0,Le.Z)((e=>{const t=(0,ze.$n)(e.palette.primary.main,.88),n=(0,ze.$n)(e.palette.primary.main,.82),r=(0,ze.$n)("rgb(140,193,82)",.88),o=(0,ze.$n)("rgb(0, 114, 206)",.88),a={color:e.palette.primary.main,cursor:"pointer",textDecoration:"none"};return{link:a,hidden:{visibility:"hidden"},rowCloseIcon:{color:"rgba(0, 0, 0, 0.54)",margin:"0 24px 0 8px"},headCell:{display:"flex",alignItems:"center",height:"56px",fontSize:"12px",position:"relative",flex:1,overflow:"hidden",color:"rgba(0,0,0,0.87)",backgroundColor:"rgba(0, 0, 0, 0.06)","&::after":Gs({},Xs,{width:"30px",backgroundImage:"none"})},firstHeadCell:{paddingLeft:"42px"},headCellWithEntity:{height:"100%",display:"flex",flexDirection:"column"},rowCell:{fontSize:"12px",overflow:"hidden"},rowCellFirstColumn:{height:"100%"},firstEntityCell:{maxHeight:"200px"},entityRowCell:{fontSize:"12px",position:"relative"},entityRowCellSelected:Ys(o),rowCellHighlighted:Ys(r),rowCellSelected:Ys(t,n),defaultWrapper:Gs({},$s,{"&::after":Gs({},Xs,{"div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"}})}),hoveredDefaultWrapper:Gs({},$s),entityWrapper:{paddingLeft:"12px"},profileWrapper:{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",position:"relative"},entityLabel:Gs({},a,{fontWeight:500}),commentsContainer:{position:"absolute",right:0,top:0,zIndex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"15px",backgroundColor:"#fff","&$checked":{backgroundColor:t}},checked:{},matchRulesWrapper:{padding:"8px 15px 8px 10px",display:"flex",flexDirection:"column",boxSizing:"border-box"},blobWrapper:Gs({},$s,{whiteSpace:"pre-wrap",height:"100px",boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}),imageWrapper:Gs({},$s,{display:"flex","& > img":{height:"64px",width:"64px"}}),referenceWrapper:{display:"flex",alignItems:"center",boxSizing:"border-box",height:"48px"},entityAvatar:{transform:"scale(0.5)",marginLeft:"-10px"},collapseButton:{position:"absolute",left:"40px",zIndex:2},dragIcon:{position:"absolute",left:"-5px",zIndex:2,opacity:.38},ovFalse:e.inactive}})),Ks=(0,fn.Z)((e=>{const t=Qs();return i().createElement("div",{className:t.headCell},i().createElement(hn.default,e))})),Js=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const{value:r,ov:o}=t,a=Qs();return i().createElement("div",{className:De()(a.defaultWrapper,{[a.ovFalse]:!1===o})},i().createElement(xn.Z,{value:r,dataTypeDefinition:n}))},ec=(0,Tn.Z)(((e,t)=>{let{onToggleSelect:n,entityToMatch:r}=e,{rowValue:o,value:a}=t;const{rawValue:l}=o;return{onRemove:()=>n(l),isRowRemovable:a!==r,entityToMatch:r}}))((e=>{let{value:t,rowIndex:n,rowValue:r,onRemove:o,entityToMatch:a,isRowSelected:s,hoverRowIndex:c}=e;const u=Qs(),p=(0,l.useContext)(Rn.B),d=t!==a,h=n===c,f=0===n,g=h?u.hoveredDefaultWrapper:u.defaultWrapper,b=t.uri!==a.uri&&!h;return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(g,u.profileWrapper,u.entityWrapper,{[u.firstEntityCell]:f&&!d})},h&&i().createElement(Mn.Z,{className:u.dragIcon}),i().createElement(Pn.Z,{className:u.collapseButton,rowIndex:n,rowValue:r}),i().createElement(ct.Z,{icon:pt.default,size:"XS",className:De()(u.rowCloseIcon,{[u.hidden]:!d}),onClick:o,"data-reltio-id":`reltio-matches-table-${p?p+"-":""}checkbox-${n}`}),i().createElement(kn.Z,{value:(0,m.wwR)(t),className:u.entityLabel},(0,m.idV)(t.label)),b&&i().createElement(un.Z,{className:De()(u.commentsContainer,{[u.checked]:s}),uri:(0,m.E_P)(a.uri,t.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:a.uri,matchEntityUri:t.uri}),allowOnlyOneComment:!0})))})),tc=(0,Tn.Z)()((0,fn.Z)((e=>{const t=0===e.headIndex,n=Qs();return i().createElement("div",{className:De()(n.headCell,{[n.firstHeadCell]:t})},i().createElement(hn.default,e))}))),nc=e=>{let{value:t}=e;const n=Qs();if(!t)return null;const{metadata:r,match:o,entitiesMap:a,entity:l,variant:s}=t;return i().createElement("div",{className:n.matchRulesWrapper},i().createElement(ft.Z,{variant:s,metadata:r,entitiesMap:a,match:o,entity:l}))},rc=e=>{let{value:t}=e;const{value:n,ov:r}=t,o=Qs();return i().createElement("div",{className:De()(o.blobWrapper,{[o.ovFalse]:!1===r}),onScroll:T.UW},n)},oc=e=>{let{value:t}=e;const{value:n}=t,r=Qs(),o=(0,m.efz)({value:n});return o&&i().createElement("div",{className:r.imageWrapper},i().createElement("img",{src:o}))},ac=e=>{let{value:t}=e;const n=Qs(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata);return t&&i().createElement("div",{className:De()(n.defaultWrapper,n.referenceWrapper,{[n.ovFalse]:!1===t.ov})},i().createElement(Un.Z,{className:n.entityAvatar,entityType:(0,m.nt9)(r,(0,m.CZ8)(t).type)}),i().createElement(kn.Z,{value:(0,m.CZ8)(t).objectURI,className:n.link},(0,m.idV)(t.label)))},lc=e=>{let{value:t}=e;const n=Qs();return i().createElement("div",{className:n.defaultWrapper},i().createElement(ys,{value:t.crosswalks}))};function ic(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sc=(0,d.split)("."),cc=(e,t,n,r,o)=>n.map((n=>{const a=n.object,l=n.matchRules||[],i=n.matchScore||0,s=(0,m.w80)(e,a.type,l),c={entity:a,metadata:e,match:n,entitiesMap:o,matchScore:i},u=t.filter((e=>{let{modes:t}=e;return!t||t.includes(Yo.TABLE)}));return(0,d.pipe)((0,d.reduce)(((e,t)=>(0,d.assoc)(t.id,((e,t,n)=>{let{entity:r,metadata:o,match:a,entitiesMap:l,matchScore:i}=t;switch(e.id){case"profile":return r;case"entityId":return(0,m.BTI)(r);case"matchRules":return{metadata:o,match:a,entitiesMap:l,entity:r,variant:"all"};case"score":return i;case"sources":return{crosswalks:r.crosswalks};default:{const[t,...o]=sc(e.id);return(0,d.pipe)((0,d.prop)(t),(0,d.ifElse)((0,d.always)(n),(0,m.pfb)(o),(0,m.BgZ)(o)))(r)}}})(t,c,r),e)),{}),(0,d.assoc)("matchAttributes",s),(0,d.assoc)("rawValue",n))(u)})),uc=e=>{if((0,m.vZp)(e)){const[,...t]=sc(e);return t.length>1?t.slice(0,-1):null}return null},pc=e=>{switch(e.id){case"profile":return ec;case"matchRules":return nc;case"sources":return lc;default:return(e=>{switch(e){case m.oS0.TYPE_BLOB:return rc;case m.oS0.TYPE_IMAGE:return oc;case m.oS0.TYPE_REFERENCE:return ac;default:return Js}})(e.dataTypeDefinition.type)}};function dc(){return dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dc.apply(this,arguments)}const mc=(0,Tn.Z)(((e,t)=>{let{selected:n}=e,{columnData:r,rowValue:o,cell:a}=t;return{isRowSelected:!!n&&n.includes(o.rawValue),isCellHighlighted:sa(o.matchAttributes,r)&&!a.values.every(m.O27)}}))((e=>{let{rowValue:t,cell:n,CellValueRenderer:r,isRowSelected:o,isCellHighlighted:a,columnIndex:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["rowValue","cell","CellValueRenderer","isRowSelected","isCellHighlighted","columnIndex"]);const c=Qs(),u=0===l;return i().createElement("div",{className:De()({[c.rowCellSelected]:o,[c.rowCellHighlighted]:a,[c.rowCellFirstColumn]:u},c.rowCell)},n.values.map(((e,n)=>i().createElement(r,dc({key:n,value:e,rowValue:t,isRowSelected:o},s)))))})),hc=(0,Le.Z)((e=>({tableContainer:{flex:1,display:"flex",color:"rgba(0,0,0,0.54)",overflow:"hidden",background:e.palette.background.paper},rowActionButtonsWrapper:{height:"100%",display:"flex",alignItems:"center",marginRight:"1px"},rowActionButtons:{backgroundColor:"rgba(238, 238, 238, 1)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",backgroundColor:"rgba(238, 238, 238, 1)",borderLeft:"1px solid rgba(0,0,0,0.12)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},checked:{},actionButton:{marginLeft:"12px","&:last-child":{marginRight:"3px"}},hoveredRowRightContentContainer:{alignItems:"center !important"},dragColumnHead:{"& #headCell":{border:"1px solid",borderColor:e.palette.primary.main},"& #entityCell":{borderLeft:"1px solid",borderRight:"1px solid",borderLeftColor:e.palette.primary.main,borderRightColor:e.palette.primary.main}},dragColumnBody:{borderLeft:"1px solid",borderRight:"1px solid",borderLeftColor:e.palette.primary.main,borderRightColor:e.palette.primary.main}})));function fc(){return fc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fc.apply(this,arguments)}const gc=e=>{let{entity:t,matches:n,metadata:r,columnsData:o,onReorderingColumn:a,config:s,filters:c,onFilter:u,sorting:p,onSort:h,selected:f,onToggleSelect:g,onResetSelect:b,onSelectAll:y,entitiesMap:v,basicTableRef:w,isComparisonViewShown:E,showNonOv:C}=e;const x=hc(),[O,S]=(0,l.useState)(n);(0,l.useEffect)((()=>{S(n)}),[n]);const R=(0,l.useCallback)(((e,t)=>{S((0,d.move)(e,t)),q(t)}),[]),P=(0,l.useMemo)((()=>cc(r,o,O,C,v)),[r,o,O,C,v]),k=!!h,T=(0,l.useMemo)((()=>((e,t)=>(0,d.pipe)((0,d.filter)((e=>{let{modes:t}=e;return!t||t.includes(Yo.TABLE)})),(0,d.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ic(e,t,n[t])}))}return e}({sortable:e},t,{resizable:!0,nestedPath:uc(t.id),headCellRenderer:"profile"===t.id?tc:Ks,rowCellValueRenderer:pc(t),draggable:(0,d.propOr)(!0,"draggable")(t)}))))(t))(k,o)),[o,k]),M=(0,l.useMemo)((()=>t?cc(r,o,[{object:t}],C):[]),[t,r,o,C]),{getRowHeight:j,CellRenderer:N}=(0,sn.Z)({rowsData:M,columnsData:T,maxRowValuesCount:3}),I=j(0),A=(0,l.useMemo)((()=>{const e=(e=>t=>n=>{const r=Qs();return i().createElement(Rn.B.Provider,{value:"tableHeader"},i().createElement("div",{className:r.headCellWithEntity},i().createElement("div",{id:"headCell"},i().createElement(t,n)),i().createElement(e,{className:De()(r.entityRowCell,r.entityRowCellSelected),columnId:n.headCellData.id,rowIndex:0,id:"entityCell"})))})(N);return T.map((0,d.evolve)({headCellRenderer:e}))}),[T,N]),D=(0,l.useCallback)((e=>{let{what:t,where:n}=e;const r=T[t.columnIndex].id,o=T[n.columnIndex].id;a(r,o)}),[T]),Z=(0,l.useMemo)((()=>({isAllSelected:f.length>0&&f.length===n.length,entityToMatch:t,selected:f,onToggleSelect:g,onResetSelect:b,onSelectAll:y,isComparisonViewShown:E})),[t,f,g,b,y,n,E]),{getDynamicRowCellHeight:B,changeRowCellHeight:V,clearHeightsCache:L}=(0,cn.Z)();(0,l.useLayoutEffect)(L,[n]);const[z,H]=(0,l.useState)(!1),F=(0,l.useCallback)((()=>H(!0)),[]),W=(0,l.useCallback)((()=>H(!1)),[]),[_,U]=(0,l.useState)(!1),[G,q]=(0,l.useState)(null),$=(0,l.useCallback)((e=>{q((t=>z||_?t:e))}),[z,_]),{showDialog:X,openAddRelationDialog:Y,AddRelationDialogRenderer:Q}=zl(s),K=(0,l.useMemo)((()=>{if(null===G)return null;const e=O[G];if(!e)return null;const n=(0,m.hXd)(r,s,e.object,t,e.matchRules),o=f.includes(e);return i().createElement("div",{className:De()(x.rowActionButtonsWrapper)},i().createElement("div",{className:De()(x.rowActionButtons,{[x.checked]:o})},i().createElement(es,{value:{mainEntity:t,entity:e.object,matchRules:e.matchRules,permission:n},openAddRelationDialog:Y,onActionsMenuClose:W,onActionsMenuOpen:F,classes:{actionButton:x.actionButton,moreOptions:x.actionButton}})),t&&i().createElement(un.Z,{className:De()(x.commentsContainer,{[x.checked]:o}),uri:(0,m.E_P)(t.uri,e.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:t.uri,matchEntityUri:e.object.uri}),onChangePopupVisibility:U,allowOnlyOneComment:!0,showAlways:!0}))}),[G,O,f,x,t,s,r,F,W,Y]),J=(0,l.useCallback)((e=>{switch(e.columnData.id){case"profile":return i().createElement(mc,fc({},e,{hoverRowIndex:G,actionsContent:K,tableRef:w}));case"matchRules":return i().createElement(pn.Z,fc({onChangeHeight:V},e),i().createElement(mc,e));default:return i().createElement(mc,e)}}),[V,G,K,w]),ee=(0,l.useCallback)((0,d.either)(B,dn.Z),[B,dn.Z]),te=(0,l.useMemo)((()=>({hoveredRowRightContentContainer:x.hoveredRowRightContentContainer,dragColumnHead:x.dragColumnHead,dragColumnBody:x.dragColumnBody})),[x]);return i().createElement("div",{className:x.tableContainer},i().createElement(mn.Z,{fixFirstColumn:!0,columnsData:A,rowsData:P,context:Z,sorting:p,onSort:h,filters:c,onFilter:u,defaultColumnWidth:250,defaultColumnMinWidth:100,headRowHeight:56+I,renderRowCell:J,getRowCellHeight:ee,hoverStateEnabled:!0,hoveredRowRightContent:K,hoverRowIndex:G,onRowHover:$,classes:te,maxRowValuesCount:3,dndRowReorderingEnabled:!0,dndColumnReorderingEnabled:!0,dndColumnReorderingHandler:D,dndRowReorderingHandler:R,ref:w,hoveredContentPosition:0}),X&&i().createElement(Q,null))},bc=(0,Le.Z)({comparisonView:{width:"100%",overflow:"auto"}});function yc(){return yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yc.apply(this,arguments)}const vc=e=>{let{config:t,isLoaded:n,savedState:r,onUpdateSavedState:o}=e;const a=(0,p.useSelector)(Se.ZP.selectors.getMetadata),s=(0,p.useSelector)(Se.ZP.selectors.getEntity),{tableViewModeAvailable:c}=t,{selectedItems:u,entitiesMap:h,comparisonViewMode:f}=Ta(),{toggleSelect:g,setSelectedItems:y,setComparisonViewMode:v}=Ma(),{isGlobalSpinnerActive:w}=Ua(),{uri:E}=s||{};((e,t)=>{const{setSelectedItems:n}=Ma(),r=(0,d.prop)("uri",t),o=(0,d.prop)("dataTenant",t),a=(0,l.useMemo)((()=>({enabled:!!r,entity:t,filter:"",page:0,sorting:{field:"score",order:"desc"},rowsPerPage:3,options:Yl})),[o,r]),{matches:i}=Il(a);(0,l.useEffect)((()=>{n(i)}),[i,n])})(0,s);const C=(0,l.useMemo)((()=>(0,m.NVY)(E,Object.keys(h))),[E,h]),x=(0,Ar.C)({objectIds:C}),S=bc(),[R,P,k]=(e=>{let{defaultColumnsData:t,additionalColumnsData:n,metadata:r,entityTypeUri:o}=e;return(0,l.useMemo)((()=>{const e=la(r,o),a=t.concat(n||[]).concat(e),l=(0,m.qhs)(r,o),i=((e,t)=>{const[n,r]=(0,d.pipe)((0,d.reject)(ca),(0,d.partition)(sa(e)))(t);return n.length?[{id:"match",label:q().text("Match attributes"),columns:t.filter(ma(n))},{id:"all",label:q().text("All attributes"),columns:t.filter(ma(r))}]:t})(l,a);return[a,i,(0,d.pipe)(ha,(0,d.concat)(t),ia)(l,e)]}),[t,n,r,o])})({defaultColumnsData:cs,metadata:a,entityTypeUri:s.type}),[T,M]=(0,l.useState)(k),[j,N]=(0,l.useState)(!1),I=(0,l.useMemo)((()=>T.map((e=>R.find((0,d.propEq)("id",e)))).filter(d.identity)),[T,R]),A=(0,l.useCallback)(((e,t)=>{const n=T.indexOf(e),r=T.indexOf(t);M((0,d.move)(n,r))}),[T]),D={entity:s,metadata:a,selectedItems:u||[],setSelectedItems:y,config:t,selectedColumns:T,setSelectedColumns:M,entitiesMap:h,columnsData:P,showNonOv:j},Z={entity:s,metadata:a,entitiesMap:h,config:t,matches:u,columnsData:I,onReorderingColumn:A,onSelectAll:()=>{},onToggleSelect:g,onResetSelect:()=>{},selected:[],isComparisonViewShown:!1,showNonOv:j};return(0,l.useEffect)((()=>{n&&(null!=r&&r.visibleColumns&&M(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,d.pipe)((0,d.filter)((0,d.propEq)("hideable",!1)),(0,d.map)((0,d.prop)("id"))),n=(0,d.pipe)(d.concat,d.uniq),r=t(cs);return n(r,e)}(r.visibleColumns)),null!=r&&r.comparisonViewMode&&v(c?r.comparisonViewMode:Yo.COLUMNS),(0,d.has)("showNonOv",r)&&N(r.showNonOv))}),[n]),(0,l.useEffect)((()=>{n&&o({comparisonViewMode:f,visibleColumns:T,showNonOv:j})}),[T,f,j]),i().createElement(i().Fragment,null,i().createElement(Zi,{config:t,columnsData:P,selectedColumns:T,onChangeColumns:M,showNonOv:j,onChangeShowNonOv:N}),i().createElement(Dr.h.Provider,{value:x},f===Yo.COLUMNS?i().createElement(b.l,null,i().createElement(Rs.Provider,{value:g},n&&i().createElement(Us,yc({},D,{classes:{root:S.comparisonView}})))):n&&i().createElement(gc,Z)),w&&i().createElement(O.Z,null))};var wc=n(81137);function Ec(){return Ec=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ec.apply(this,arguments)}const Cc=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Ec({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.25 3H3.75c-.825 0-1.5.675-1.5 1.5v9c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5v-9c0-.825-.675-1.5-1.5-1.5zm-9 10.5h-1.5v-6h1.5v6zM3.75 6h1.5V4.5h-1.5V6zm6 7.5h-3v-6h3v6zm-3-7.5h3V4.5h-3V6zm7.5 7.5h-3v-6h3v6zm-3-7.5h3V4.5h-3V6z",fill:"#000",fillOpacity:".541"}))},xc=(0,Le.Z)({flexBox:{display:"flex",alignItems:"center"},icon:{display:"flex",alignItems:"center",margin:"0 4px"}}),Oc=()=>{const{selectedItems:e,comparisonViewMode:t,limitSelection:n}=Ta(),{setComparisonViewMode:r,deleteExtraMatches:o}=Ma(),a=xc(),s=(0,l.useCallback)((()=>{r(Yo.TABLE)}),[r]),c=t===Yo.COLUMNS&&e.length>n,u=q().text("Switch to table view"),p=i().createElement("div",{className:a.flexBox},q().text("Please switch to"),i().createElement("div",{className:a.icon},i().createElement(Cc,null)),q().text("Table View to compare more than ${max} profiles",{max:4}));return i().createElement(wc.Z,{open:c,title:u,content:p,onSave:s,onDiscard:o,saveCaption:q().text("Proceed"),discardCaption:q().text("Cancel")})},Sc=(0,Le.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},potentialMatchesWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},potentialMatchesContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function Rc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pc(e,t,n[t])}))}return e}function Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kc=e=>{let{config:t,getSavedState:n,saveState:r}=e;const o=Sc(),a=(0,p.useSelector)(Se.ZP.selectors.getEntity),{SnackbarRenderer:s,showSnackbarMessage:c}=(0,No.D)(),u=(0,l.useRef)(),{tableViewModeAvailable:m}=t,{isLoaded:h,savedState:f,updateSavedState:g}=(0,Io.w)({getSavedState:n,saveState:r,entityTypeUri:a.type});(0,l.useEffect)((()=>{h&&(u.current=f||{})}),[h,f]);const b=(0,l.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!u.current)return;const t=Rc({},u.current,e);(0,d.equals)(t,u.current)||(g(t),u.current=t)}),[g]);return i().createElement(ka,{tableViewModeAvailable:m},i().createElement(ea,null,i().createElement(Ao.S.Provider,{value:c},i().createElement("div",{className:o.perspectiveView},(null==a?void 0:a.uri)&&i().createElement("div",{className:o.potentialMatchesContainer},i().createElement("div",{className:o.potentialMatchesWrapper},i().createElement(Lo,null),i().createElement(vc,{config:t,isLoaded:h,savedState:f,onUpdateSavedState:b})),i().createElement(Oi,{config:t,isLoaded:h,savedState:f,onUpdateSavedState:b}),i().createElement(s,null),m&&i().createElement(Oc,null))))))};var Tc=n(39450);const Mc=(0,c.createGenerateClassName)({productionPrefix:"potentialMathcesView",disableGlobal:!0}),jc=e=>{let{config:t,store:n,onResize:o=d.identity,saveState:a,getSavedState:h}=e;const f=(0,l.useCallback)((0,m.aYu)(h),[h]),g=(0,l.useCallback)((0,m.DsO)(a,3e3),[a]);return i().createElement(p.Provider,{store:n},i().createElement(Tc.m.Provider,{value:t.id},i().createElement(c.StylesProvider,{generateClassName:Mc},i().createElement(u.MuiPickersUtilsProvider,{utils:r.Z},i().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&(!1!==t.newView?i().createElement(kc,{config:t,saveState:g,getSavedState:f}):i().createElement(jo,{config:t,saveState:a,getSavedState:f})),i().createElement(ye.Z,null)))))};jc.propTypes={config:m.yxQ,store:a().object,onResize:a().func,saveState:a().func,getSavedState:a().func};const Nc=jc}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[7952],{79821:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(24328),o=n.n(r),a=n(52730),l=n(59431),i=n(99831),s=n(97991);const c=(0,n(79692).Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),u=e=>{let{group:t,metadata:n}=e;const r=c(),u=(0,a.useSelector)(l.ZP.selectors.getAbsoluteImagePath),p=(0,i.XH8)(n,{type:t.id}),d=(0,i.vPL)(u,p);return o().createElement(s.Z,{className:r.icon,icon:d,avatarText:t.title[0]})}},97991:(e,t,n)=>{n.d(t,{Z:()=>u});var r,o=n(94079),a=n(71153),l=n.n(a),i=n(24328),s=n.n(i);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}!function(e){e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE"}(r||(r={}));const u=e=>{let{className:t,icon:n,avatarText:a,rootClasses:u}=e,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","icon","avatarText","rootClasses"]);const[d,m]=(0,i.useState)(null);(0,i.useEffect)((()=>{m(n?r.ICON_MODE:r.TEXT_MODE)}),[n,a]);const h=()=>{m(r.ERROR_MODE)};switch(d){case r.ICON_MODE:return s().createElement(o.Avatar,c({className:l()(t,null==u?void 0:u.iconRoot),src:n,onError:h},p));case r.TEXT_MODE:case r.ERROR_MODE:return s().createElement(o.Avatar,c({className:l()(t,null==u?void 0:u.textRoot)},p),a);default:return null}}},99757:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(97820),p=n(54763),d=n(45767),m=n(88611),h=n(22385),f=n(79692);const g=(0,f.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),b=(0,c.either)((0,c.prop)("title"),(0,c.prop)("fieldName")),y=e=>{let{value:t,getLabel:n=b,onSelectAttributeClick:r,disabled:a=!1}=e;const i=g(),c=t&&n(t);return o().createElement("div",{onClick:a?void 0:r,className:s()(i.attribute,{[i.attributeWithValue]:!!c},{[i.disabled]:a})},o().createElement(m.C,{value:c},o().createElement("div",{className:s()(i.name,{[i.disabled]:a})},c||o().createElement("span",{className:i.noSelect},l().text("Select attribute")))),o().createElement(h.Z,{size:"M",icon:d.Z,disabled:a}))};var v=n(99831);function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const C=(0,c.eqBy)((0,c.pick)(["fieldName","uri","entityTypeUri"])),x=(e,t)=>t&&!!t.find(C(e)),O=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),S=(e,t)=>O(e,t)||(e.children||[]).some((e=>S(e,t))),R=(e,t)=>e.findIndex(C(t)),P=(0,v.fW1)("title"),k=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const l=O(e,r);return[{item:r?w({},e,{filterText:r}):e,level:o,groupId:t,groupName:n}].concat(e.children?e.children.filter((e=>a||l||S(e,r))).flatMap((e=>k(e,t,n,r,o+1,a||l))):[]).flat()},T=(0,c.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>S(t,e))).map((n=>k(n,t.id,t.title,e)))}))).filter((e=>e.items.length))));var M=n(52730),j=n(94079),N=n(59431),I=n(7785),A=n(44890),D=n(27239),Z=n(79821);const B=(0,f.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){z(e,t,n[t])}))}return e}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const H=(0,r.memo)((e=>{let{selectedAttributes:t,onItemClick:n,focusIndex:r,hideCheckBox:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const i=B(),s=(0,M.useSelector)(N.ZP.selectors.getMetadata);return o().createElement(A.Z,V({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,l,i)=>{let{item:s,level:c,groupId:u,groupName:p}=l;const d=x(s,t),m=i===r;return o().createElement(I.Z,{key:`item-${u}-${s.fieldName}`,onClick:n,checked:d,data:L({},s,{groupName:p}),notSelectable:s.notSelectable,hideCheckBox:a,label:o().createElement(D.Z,{text:s.title,highlight:s.filterText}),labelInText:s.title,level:c,style:e,isFocused:m,groupId:u,LogoIcon:s.LogoIcon})},renderGroupTitle:(e,t)=>o().createElement(j.ListItem,{component:"div",className:i.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&o().createElement(Z.Z,{group:t.item,metadata:s}),t.item.title),focusIndex:r},l))}));var F=n(56656);const W=(0,f.Z)({selector:{minWidth:"200px",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),_=(0,r.memo)((e=>{let{className:t,itemsGroups:n,value:a,getLabel:i,onSelect:d,onRestoreFocus:m=c.identity,onOpenPopup:h=c.identity,disableRestoreFocus:f=!1,disableEnforceFocus:g=!1,single:b=!1,ungroup:v=!1,disabled:E=!1,hideCheckBox:O=!1}=e;const S=W(),[k,M]=(0,r.useState)(null),j=(0,r.useCallback)((()=>M(null)),[]),N=!!k,[I,A]=(0,r.useState)(""),D=(0,r.useCallback)((()=>A("")),[]),[Z,B]=(0,r.useState)([]),V=(0,r.useCallback)((()=>B([])),[]),L=(0,r.useMemo)((()=>T(I,n)),[n,I]),z=(0,r.useMemo)((()=>(0,c.pipe)((0,c.when)((0,c.always)(v),(0,c.chain)((0,c.pipe)((0,c.prop)("items"),c.flatten,(0,c.map)((0,c.pick)(["item","level"]))))),F.LG)(L)),[v,L]),_=(0,r.useMemo)((()=>Math.max(P(L),308)),[L]),U=(0,c.pipe)((0,c.tap)((0,c.pipe)(V,D,j)),m),G=(0,r.useRef)(),q=(0,r.useCallback)(((e,t)=>{d({checked:t,attribute:e,index:t?Z.length:R(Z,e),selectedAttributes:Z}),b?(B(t?[e]:[]),U({})):(B((e=>{let{attribute:t,selectedAttributes:n,checked:r}=e;return r?n.concat(t):n.filter((e=>!C(t,e)))})({selectedAttributes:Z,attribute:e,checked:t})),G.current&&G.current.focus())}),[Z,d,b,U,G]),$=(0,r.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:n}=e;return e=>{let{item:r,groupData:o}=e;const a=x(r,n);t(w({},r,{groupName:o.groupName}),!a)}})({onListItemClick:q,selectedAttributes:Z}),[q,Z]),{focusIndex:X,handleKeyDown:Y}=(0,p.t)({items:z,open:N,onSelectFocusedItem:$,selectedItems:Z,onClose:U});return o().createElement("div",{className:s()(S.selector,t),"data-reltio-id":"attribute-selector"},o().createElement(y,{value:a,getLabel:i,onSelectAttributeClick:e=>{h(),M(e.currentTarget)},disabled:E}),o().createElement(u.Z,{open:N,anchorEl:k,onClose:U,onSearch:A,title:l().text("Select attribute"),containerWidth:_,containerHeight:507,searchInputOnKeyDown:Y,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:G,disableRestoreFocus:f,disableEnforceFocus:g},o().createElement(H,{items:z,onItemClick:q,selectedAttributes:Z,width:_,height:400,focusIndex:X,hideCheckBox:O})))}))},74402:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(24328),o=n(17440),a=n(99831);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=e=>{let{rowIndex:t,columnData:{id:n},cellIndex:r}=e;return`${n}[${t}][${r}]`},s=()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useRef)({}),s=(0,r.useCallback)((0,a.DsO)((()=>{t(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}({},n.current))})),[]),c=(0,r.useCallback)((()=>{n.current={}}),[]);return{getDynamicRowCellHeight:(0,r.useCallback)((0,o.pipe)(i,(0,o.prop)(o.__,e)),[e]),changeRowCellHeight:(0,r.useCallback)((0,o.curry)((0,o.useWith)((0,o.pipe)(((e,t)=>{n.current[e]=t}),s),[i,o.identity])),[]),clearHeightsCache:c}}},74566:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(73038),s=n(58241),c=n(71153),u=n.n(c);const p=(0,n(79692).Z)((()=>({hidden:{visibility:"hidden"}}))),d=e=>{let{rowIndex:t,rowValue:n,className:a}=e;const l=p(),{toggleRowCollapse:c,getIsRowCollapsible:d,getIsRowCollapsed:m}=(0,r.useContext)(i.x),h=d(n),f=m(t);return o().createElement(s.Z,{className:u()(a,{[l.hidden]:!h}),isOpen:!f,onClick:e=>{c(t),e.stopPropagation()}})};d.propTypes={rowIndex:l().number,rowValue:l().object,className:l().string};const m=d},97946:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(44443),s=n(94079),c=n(20562);const u=e=>{let{onChangeHeight:t,children:n}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["onChangeHeight","children"]);const l=(0,r.useRef)(null),{rowValue:u,rowIndex:p,columnData:d,cellIndex:m}=a,h=t({rowIndex:p,cellIndex:m,columnData:d}),f=()=>l.current&&h(l.current.clientHeight);return(0,c.D)(f,[u.rawValue]),o().createElement("div",null,o().createElement(i.Z,{handleHeight:!0,onResize:f}),o().createElement(s.RootRef,{rootRef:l},n))};u.propTypes={onChangeHeight:l().func,children:l().node};const p=u},23598:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(71153),s=n.n(i),c=n(79692);const u=(0,c.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var p=n(87918),d=n.n(p),m=n(6782);const h="46px",f=(0,c.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:h},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:h}}))),g=e=>{let{className:t,rowData:n}=e;const r=f();return o().createElement("div",{className:s()(r.readOnlyLogicOperatorContainer,t)},n&&n.operator?(0,m.Z)(n.operator):d().text("Where"))};g.propTypes={className:l().string,rowData:l().object};const b=g;var y=n(99831);const v=e=>{let{className:t,rowData:n}=e;const r=f();return o().createElement("div",{className:s()(r.readOnlyFilter,t)},n&&n.filter?(0,y.XS2)(n.filter):d().text("equals"))};v.propTypes={className:l().string,rowData:l().object};const w=v;var E=n(94656);const C=e=>{let{classes:t={},rowData:n,previousRowData:r,LogicOperatorComponent:a=b,AttributeSelectorComponent:l,FilterSelectorComponent:i=w,ValuesEditorComponent:c,ActionsComponent:p,filterSelectorRef:d,attributeSelectorProps:m={}}=e,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const f=u();return o().createElement("div",{className:s()(f.row,t.root)},o().createElement(a,{className:t.logicOperatorContainer,rowContext:h,rowData:r}),o().createElement("div",{className:s()(f.rowItem,t.attributeSelectorContainer)},o().createElement(l,{attributeSelectorProps:m,rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,t.filterSelectorContainer)},o().createElement(i,{textFieldInputRef:d,rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,f.fullWidth,t.valuesEditorContainer)},o().createElement(c,{rowContext:h,rowData:n})),o().createElement("div",{className:s()(f.rowItem,t.actionsContainer,{[f.hidden]:!n})},o().createElement(p,{rowContext:h,rowData:n})))};C.propTypes={classes:l().shape({root:l().string,logicOperatorContainer:l().string,attributeSelectorContainer:l().string,filterSelectorContainer:l().string,valuesEditorContainer:l().string,actionsContainer:l().string}),rowData:E.Xw,previousRowData:E.Xw,LogicOperatorComponent:l().elementType,AttributeSelectorComponent:l().elementType,FilterSelectorComponent:l().elementType,ValuesEditorComponent:l().elementType,ActionsComponent:l().elementType,filterSelectorRef:l().object,attributeSelectorProps:l().shape({onRestoreFocus:l().func,onOpen:l().func,disablePopoverRestoreFocus:l().bool})};const x=(0,r.memo)(C)},41315:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),a=n(13980),l=n.n(a),i=n(17440),s=n(23598),c=n(94656);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}const p=e=>{let{className:t,rowClasses:n,rowsData:r,lastRowAttributeSelectorProps:a,filterSelectorRef:l,filterSelectorRefIndex:c}=e,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const d=(e,t,r)=>{const d=t>0?(0,i.path)([t-1],r):null,m=t===r.length?{attributeSelectorProps:a}:{};return o().createElement(s.Z,u({key:e&&e.id,rowData:e,previousRowData:d,classes:n,filterSelectorRef:t===c?l:void 0},p,m))};return o().createElement("div",{className:t},r.map(d),d(null,r.length,r))};p.propTypes={className:l().string,rowClasses:l().shape({root:l().string,logicOperatorContainer:l().string,attributeSelectorContainer:l().string,filterSelectorContainer:l().string,valuesEditorContainer:l().string,actionsContainer:l().string}),rowsData:l().arrayOf(c.Xw),LogicOperatorComponent:l().elementType,AttributeSelectorComponent:l().elementType,FilterSelectorComponent:l().elementType,ValuesEditorComponent:l().elementType,ActionsComponent:l().elementType,filterSelectorRef:l().object,filterSelectorRefIndex:l().number,lastRowAttributeSelectorProps:l().shape({onRestoreFocus:l().func,onOpen:l().func,disablePopoverRestoreFocus:l().bool})};const d=(0,r.memo)(p)},94175:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),a=n(52730),l=n(59431),i=n(99831),s=n(97991);const c=e=>{let{sourceType:t,className:n,classes:r}=e;const c=(0,a.useSelector)(l.ZP.selectors.getMetadata),{uri:u,icon:p}=(0,i.PWK)(c,t)||{},d=u?(0,i.tH7)(c,u)[0]:"",m=p?(0,i.vPL)("https://s3.amazonaws.com/reltio.images/api",p):null;return o().createElement(s.Z,{className:n,avatarText:d,icon:m,variant:"square",rootClasses:r})}},87760:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(99831),o=n(24328),a=n.n(o),l=n(81303),i=n(13074);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const d=e=>{let{values:t,valueContainerClassName:n}=e,r=p(e,["values","valueContainerClassName"]);return a().createElement(a().Fragment,null,(t||[]).map((e=>a().createElement("div",{key:e.uri,className:n},a().createElement(l.Z,u({attributeValue:e},r))))))},m=(0,o.memo)((e=>{let{expanded:t,LabelRenderer:n,RightSlot:o}=e,l=p(e,["expanded","LabelRenderer","RightSlot"]);const{attributeType:c,values:u,valueContainerClassName:m}=l;switch(c.type){case r.oS0.TYPE_NESTED:case r.oS0.TYPE_REFERENCE:return d(s({expanded:t,LabelRenderer:n,RightSlot:o},l));case r.oS0.TYPE_IMAGE:return a().createElement("div",{className:m},a().createElement(i.Z,{attributeType:c,attributeValues:u,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return d(s({},l))}}))},63149:(e,t,n)=>{n.d(t,{hR:()=>c,nX:()=>u,RT:()=>p,pu:()=>d,BF:()=>m});var r=n(24328),o=n.n(r),a=n(99831),l=n(17440),i=n(31276);const s=(0,r.createContext)(null),c=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children"]);return o().createElement(s.Provider,{value:n},t)},u=e=>{const{getCrosswalkColor:t=(0,l.pipe)(a.uKF,a.CJp)}=(0,r.useContext)(s)||{};return e?t(e):""},p=()=>{const{highlightedCrosswalks:e=[]}=(0,r.useContext)(s)||{};return e},d=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:n=i.ZT}=(0,r.useContext)(s)||{},o=!!e&&!!t.find((0,l.eqBy)(a.uKF,e));return{isHighlighted:o,isDimmed:t.length>0&&!o,highlightCrosswalk:(0,r.useCallback)((()=>n(e,!0)),[e,n]),removeHighlight:(0,r.useCallback)((()=>n(e,!1)),[e,n])}},m=e=>{const{toggleCrosswalkFocus:t=i.ZT,focusedCrosswalks:n=[]}=(0,r.useContext)(s)||{};return{isFocused:!!e&&n.some((0,l.eqBy)(a.uKF,e)),toggleCrosswalkFocus:(0,r.useCallback)((()=>t(e)),[e,t])}}},97250:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Nc});var r=n(8598),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l),s=n(44443),c=n(36138),u=n(22664),p=n(52730),d=n(17440),m=n(99831),h=n(10237),f=n(17554),g=n(49759),b=n(6521);const y={FIND_MATCHES:"findMatches",POTENTIAL_MATCHES:"potentialMatches",NOT_A_MATCH:"notAMatch"},v="FULL_SCREEN",w="HIDDEN",E="VISIBLE";var C=n(20562),x=n(58662),O=n(99136);const S=(0,l.createContext)({reloadData:()=>{},setReloadHandler:()=>{}}),R=(()=>{let e;return{reloadData:()=>{e&&e()},setReloadHandler:t=>{e=t}}})(),P=e=>{let{children:t}=e;return i().createElement(S.Provider,{value:R},t)};P.propTypes={children:a().node};const k=()=>{const e=(0,l.useContext)(S);if(void 0===e)throw new Error("useReloadData must be used within a ReloadDataProvider");return e};var T=n(31276),M=n(86361);function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const I=(0,l.createContext)(null),A=(0,l.createContext)(null),D="UPDATE_COMPARISON_VIEW_MODE",Z="SET_GLOBAL_SPINNER",B={setComparisonViewMode:(0,T.zD)(D),setGlobalSpinner:(0,T.zD)(Z)},V=(e,t)=>{switch(t.type){case D:return j({},e,{comparisonViewMode:t.payload});case Z:return j({},e,{isGlobalSpinnerActive:t.payload})}},L=e=>{let{children:t}=e;const[n,r]=(0,l.useReducer)(V,{comparisonViewMode:w,isGlobalSpinnerActive:!1}),o=(0,M.o)({actions:B,dispatch:r});return i().createElement(I.Provider,{value:n},i().createElement(A.Provider,{value:o},t))};L.propTypes={children:a().node};const z=()=>{const e=(0,l.useContext)(I);if(void 0===e)throw new Error("useViewState must be used within a ViewStateProvider");return e},H=()=>{const e=(0,l.useContext)(A);if(void 0===e)throw new Error("useViewStateActions must be used within a ViewStateProvider");return e},F=i().createContext(null);F.displayName="ColumnHandlerContext";var W=n(99341);const _=e=>({filter:"equals",fieldName:"type",values:[e]}),U=(e,t,n)=>{const r=m.wSh.fromNull(e).map(_).orSome("");return m.wSh.fromNull(t).map((e=>Object.entries(e).map((e=>{let[t,r]=e;const o=n.find((0,d.propEq)("id",t));return(0,W.su)(o,r)})))).orSome([]).concat(r)};var G=n(87918),q=n.n(G);const $=(0,d.pipe)((0,d.map)((e=>({id:(0,m.Tde)(e.uri),label:(0,m.idV)(e.label),dataTypeDefinition:(0,m.PFL)(e)})))),X=(0,d.pipe)(m.Fof,$),Y=(0,d.pluck)("id"),Q=(0,d.curry)(((e,t)=>e.map(m.Tde).some((e=>t.id===e||J(t)&&ee(t,e))))),K=e=>(0,m.QZu)(e.dataTypeDefinition),J=e=>(0,m.YkG)(e.dataTypeDefinition),ee=(0,d.curry)(((e,t)=>t.startsWith(`${e.id}.`))),te=(0,d.curry)(((e,t)=>K(t)&&e.some((e=>{let{id:n}=e;return ee(t,n)})))),ne=e=>(0,d.either)((0,d.includes)(d.__,e),te(e)),re=(e,t)=>(0,d.pipe)((0,d.reject)(K),(0,d.filter)(Q(e)))(t);var oe=n(85229);const ae=e=>{let{defaultColumnsData:t,additionalColumnsData:n,metadata:r,entityType:o}=e;return(0,l.useMemo)((()=>{const e=X(r,o),a=t.concat(n||[]).concat(e),l=(0,m.qhs)(r,o),i=((e,t)=>{const[n,r]=(0,d.pipe)((0,d.reject)(K),(0,d.partition)(Q(e)))(t);return n.length?[{id:"match",label:q().text("Match attributes"),columns:t.filter(ne(n))},{id:"all",label:q().text("All attributes"),columns:t.filter(ne(r))}]:t})(l,a);return[a,i,(0,d.pipe)(re,(0,d.concat)(t),Y)(l,e)]}),[t,n,r,o])};var le=n(26180);function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){se(e,t,n[t])}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce="RESET",ue="SET_SELECTED_ITEMS",pe="TOGGLE_SELECT",de="SET_OPTIONS",me="SET_LIMIT_SELECTION",he=ie({},le.ZP.actions,{reset:(0,T.zD)(ce),toggleSelect:(0,T.zD)(pe),setSelectedItems:(0,T.zD)(ue),setOptions:(0,T.zD)(de),setLimitSelection:(0,T.zD)(me)}),fe=(e,t)=>{switch(t.type){case ce:return ie({},t.payload);case de:return ie({},e,{options:t.payload});case ue:return ie({},e,{selectedItems:t.payload});case pe:return(0,d.evolve)({selectedItems:n=>{const r=t.payload,o=n.findIndex((e=>e===r));if(o>-1)return(0,d.remove)(o,1,n);{const{limitSelection:t}=e;return(0,d.pipe)((0,d.when)((0,d.both)((0,d.complement)(d.isNil),(0,d.propSatisfies)((0,d.gte)(d.__,t),"length")),(0,d.take)(t-1)),(0,d.append)(r))(n)}}},e);case me:return ie({},e,{limitSelection:t.payload});default:return le.ZP.reducer(e,t)}},ge=(e,t,n,r)=>{const{field:o,order:a}=t,i={visibleColumns:e,filters:null,sorting:{field:o,order:a},page:0,rowsPerPage:n,selectedItems:[],options:r,limitSelection:null},[s,c]=(0,l.useReducer)(fe,i);return[(0,M.o)({actions:he,dispatch:c}),s,c]};var be=n(93428),ye=n(585);const ve=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:q().text("Can't add relationship")})},we=e=>{(null==e?void 0:e.errorCode)!==m.Xt7.DCR_ALREADY_EXISTS&&Ee(e)},Ee=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:(null==e?void 0:e.errorMessage)||q().text("Something went wrong...")})},Ce=()=>{const{setGlobalSpinner:e}=H(),{isGlobalSpinnerActive:t}=z(),{reloadData:n}=k();return{onStartRequest:(0,l.useCallback)((()=>{e(!0)}),[e]),onFinishRequest:(0,l.useCallback)((()=>{e(!1),n()}),[n,e]),isGlobalSpinnerActive:t}},xe=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:l=T.ZT}=e;const{isGlobalSpinnerActive:s,onFinishRequest:c,onStartRequest:u}=Ce();return i().createElement(be.H,{className:n,disabled:s,entities:r,entity:o,mode:a,onMenuClose:l,onStartRequest:u,onFinishRequest:c,onError:Ee,"data-reltio-id":"reltio-potential-matches-merge-button",ref:t})}));xe.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},xe.displayName="mergeButton";var Oe=n(98808),Se=n(59431);function Re(){return Re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re.apply(this,arguments)}const Pe=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Re({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M10 6v2H4v12.22h12V14h2v6c0 1.05-.82 1.918-1.851 1.994L16 22H4c-1.05 0-1.918-.82-1.994-1.851L2 20V8c0-1.05.82-1.918 1.851-1.994L4 6h6zm4 10v2H6v-2h8zm-3.997-3l-.001 2H6v-2h4.003zM21 2c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1h-7l-2 2 .005-11c0-.55.445-1 .995-1h8zm-10.996 8l-.001 2H6v-2h4.004zm9.286-6.3l-3.17 3.17-1.41-1.42-1.41 1.41 2.82 2.84 4.59-4.58-1.42-1.42z",id:"svg3192636834a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg3192636834b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg3192636834a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3192636834b)",d:"M0 0h24v24H0z"})))},ke=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n}=e;const{selectors:r}=Se.ZP,{setGlobalSpinner:o}=H(),{isGlobalSpinnerActive:a}=z(),i=(0,p.useSelector)(r.getWorkflowPath),s=(0,p.useSelector)(r.getWorkflowEnvironmentUrl),c=(0,p.useSelector)(r.getTenant),u=(0,d.prop)("uri"),h=(0,d.pipe)(d.concat,(0,d.map)(u))([n],t);return[a,(0,l.useCallback)((()=>{o(!0),(0,m.t6d)({workflowPath:i,processType:"potentialMatchReview",objectURIs:h,tenant:c,environment:s}).catch(we).finally((()=>{o(!1)}))}),[i,h,c,s,o])]})({entity:o,entities:r}),h=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),f=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath);return h&&!(0,m.O27)(f)?i().createElement(Oe.K,{className:n,disabled:c,mode:a,label:q().text("Potential match request"),icon:Pe,onClick:u,onMenuClose:s,ref:t}):null}));function Te(){return Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Te.apply(this,arguments)}ke.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},ke.displayName="DCRReviewButton";const Me=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Te({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M19 14v3h3v2h-3v3h-2v-3h-3v-2l3-.001V14h2zM17 2a3 3 0 11-1.293 5.708l-4.535 4.535a5 5 0 11-1.414-1.414l4.534-4.536A3 3 0 0117 2zM7 12a3 3 0 100 6 3 3 0 000-6zm10-8a1 1 0 100 2 1 1 0 000-2z",id:"svg2192258504a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2192258504b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2192258504a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2192258504b)",d:"M0 0h24v24H0z"})))},je=(0,l.forwardRef)(((e,t)=>{let{className:n,mainEntity:r,currentEntity:o,matchRules:a,mode:l="iconButton",onClick:s=T.ZT,onMenuClose:c=T.ZT}=e;return i().createElement(Oe.K,{className:n,mode:l,label:q().text("Add relationship"),icon:Me,onClick:()=>s({mainEntity:r,currentEntity:o,matchRules:a}),onMenuClose:c,ref:t})}));je.propTypes={className:a().string,mainEntity:m.pyR,currentEntity:m.pyR,matchRules:a().arrayOf(a().string),mode:a().oneOf(["iconButton","button","menuItem"]),onClick:a().func,onMenuClose:a().func},je.displayName="CreateRelationButton";var Ne=n(30885);const Ie=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a="iconButton",onMenuClose:l=T.ZT}=e;const{isGlobalSpinnerActive:s,onFinishRequest:c,onStartRequest:u}=Ce();return i().createElement(Ne.i,{className:n,disabled:s,entities:r,entity:o,mode:a,onMenuClose:l,onStartRequest:u,onFinishRequest:c,ref:t})}));Ie.propTypes={className:a().string,entity:m.pyR,entities:a().arrayOf(a().object),mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ie.displayName="NotMatchButton";var Ae=n(71153),De=n.n(Ae),Ze=n(8818);function Be(){return Be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Be.apply(this,arguments)}const Ve=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Be({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M3 15h8v-2H3v2zm0 4h8v-2H3v2zm0-8h8V9H3v2zm0-6v2h8V5H3zm10 0h8v14h-8V5z",id:"svg2461472690a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"#111",fillRule:"evenodd"},i().createElement("mask",{id:"svg2461472690b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2461472690a"})),i().createElement("path",{fillOpacity:".54",fill:"red",mask:"url(#svg2461472690b)",d:"M0 0h24v24H0z"})))};var Le=n(79692),ze=n(41128);const He=(0,Le.Z)((e=>({iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},comparisonButtonSelected:{backgroundColor:e.palette.primary.main,borderRadius:0,"& svg g path":{fill:"#FFFFFF",fillOpacity:1},"&:hover":{backgroundColor:(0,ze._j)(e.palette.primary.main,e.palette.action.hoverOpacity),"& svg g path":{fill:(0,ze._j)("#FFFFFF",e.palette.action.hoverOpacity)}}},comparisonButton:{backgroundColor:"#FFFFFF",borderRadius:0}}))),Fe=e=>{let{className:t,selectedMatchesCount:n}=e;const r=He(),{comparisonViewMode:o}=z(),{setComparisonViewMode:a}=H(),s=o===w,c=n>3,u=(0,l.useCallback)((()=>{a(s?E:w)}),[a,s]),p=(0,l.useMemo)((()=>c?q().text("Select 1-${maxProfilesToCompare} profiles to compare",{maxProfilesToCompare:3}):s?q().text("Show comparison view"):q().text("Hide comparison view")),[s,c]);return i().createElement(Ze.k,{tooltipTitle:p,className:De()(t,{[r.iconButton]:s,[r.comparisonButton]:s,[r.comparisonButtonSelected]:!s}),size:"S",onClick:u,icon:Ve,showForDisabled:!0,disabled:c})};function We(){return We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}Fe.propTypes={entities:a().arrayOf(a().object),entity:m.pyR,className:a().string,selectedMatchesCount:a().number.isRequired};const _e=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",We({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M9 4c4.42 0 8 3.58 8 8s-3.58 8-8 8a8 8 0 01-7.419-5h2.224A6.002 6.002 0 009 18c3.31 0 6-2.69 6-6s-2.69-6-6-6a6.002 6.002 0 00-5.196 3H1.581A8 8 0 019 4zm8 .26c3.45.89 6 4.01 6 7.74 0 3.73-2.55 6.85-6 7.74v-2.09a5.99 5.99 0 000-11.3V4.26zM8 7.5l4.5 4.5L8 16.5V13H0v-2h8V7.5z",id:"svg689336942a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg689336942b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg689336942a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg689336942b)",d:"M0 0h24v24H0z"})))},Ue=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n}=e;const{setGlobalSpinner:r}=H(),{isGlobalSpinnerActive:o}=z(),{reloadData:a}=k(),i=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),s=(0,p.useSelector)(Se.ZP.selectors.getTenant);return[o,(0,l.useCallback)((()=>{r(!0);const e={dtssPath:i,customerTenant:s,entity:n,entities:t};((0,m.biM)(n)?(0,m.XkY)(e):(0,m.uQS)(e)).finally((()=>{r(!1),a()}))}),[t,n,r,a,i,s])]})({entity:n,entities:r});return i().createElement(Oe.K,{className:o,disabled:c,mode:a,label:q().text("Save as potential match"),icon:_e,onClick:u,onMenuClose:s,ref:t})}));Ue.propTypes={entities:a().arrayOf(a().object),entity:m.pyR,className:a().string,mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ue.displayName="ReinstateMatchButton";const Ge=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a="iconButton",onMenuClose:s=T.ZT}=e;const[c,u]=(e=>{let{entities:t,entity:n,_tenant:r}=e;const{setGlobalSpinner:o}=H(),{isGlobalSpinnerActive:a}=z(),{reloadData:i}=k();return[a,(0,l.useCallback)((()=>{o(!0),(0,m.ck9)(n.uri,t).finally((()=>{o(!1),i()}))}),[t,n,o,i])]})({entity:n,entities:r});return i().createElement(Oe.K,{className:o,disabled:c,mode:a,label:q().text("Save on potential matches"),icon:_e,onClick:u,onMenuClose:s,ref:t})}));Ge.propTypes={className:a().string,entities:a().arrayOf(a().object),entity:m.pyR,mode:a().oneOf(["iconButton","button","menuItem"]),onMenuClose:a().func},Ge.displayName="SetAMatchButton";const qe=(0,Le.Z)({container:{display:"flex",height:"100%",alignItems:"center",marginLeft:"8px"},mergeButton:{flexShrink:0,marginRight:"8px"},rightButton:{display:"flex",alignItems:"center",marginLeft:"auto"},moreOptions:{marginRight:"-2px"}}),$e={value:a().shape({show:a().bool,config:a().object,entity:m.pyR,entities:a().arrayOf(a().object),matchRules:a().arrayOf(a().string),permission:a().shape({canMerge:a().bool,canAddRelation:a().bool,canMark:a().bool})})},Xe=e=>{let{value:{show:t,entity:n,entities:r,permission:o}}=e;const a=qe(),{canMark:l}=o;return t?i().createElement(i().Fragment,null,i().createElement("div",{className:a.container},l&&i().createElement(Ge,{entity:n,entities:r,className:a.rightButton,mode:"button"}))):null};Xe.propTypes=$e;const Ye=Xe;var Qe=n(34635),Ke=n(87760);const Je=i().createContext({});function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(this,arguments)}Je.displayName="ExpandedContext";const tt=(0,Le.Z)((()=>({complexAttributesHeadRenderer:{height:"100%",width:"100%",display:"flex",alignItems:"flex-start"},complexAttributesHeadLabel:{flex:1},attribute:{whiteSpace:"pre-wrap"},matchedAttribute:{fontWeight:500,height:"100%",margin:"-5px -16px",padding:"5px 16px",background:"rgba(140, 193, 82, 0.12)"}}))),nt=(e=>{const t=(0,l.forwardRef)(((t,n)=>{const{attributeType:r}=t,{expandedMap:o}=(0,l.useContext)(Je),a=o[r.uri];return i().createElement(e,et({},t,{expanded:a,ref:n}))}));return t.displayName="WithExpanded",t})(Ke.Z),rt=e=>{let{value:{attributeType:t,attributeValues:n,matched:r=!1}}=e;const o=tt();return i().createElement("div",{className:De()(o.attribute,{[o.matchedAttribute]:r})},i().createElement(nt,{values:n,attributeType:t}))};function ot(){return ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}const at=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",ot({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M21.843 14.8l-4.242 4.243-4.243-4.243h8.485zM8 6v12H5V6h3zm2 8.919L12.941 18H10v-3.081zM13 6v6h-3V6h3zm5 0v6h-3V6h3z",id:"svg2425089452a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2425089452b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2425089452a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2425089452b)",d:"M0 0h24v24H0z"})))};function lt(){return lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lt.apply(this,arguments)}const it=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",lt({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M15.879 12.879l4.242 4.242-4.242 4.243v-8.485zM8 6v12H5V6h3zm5 0v12h-3V6h3zm5 0v5.464l-3-3V6h3z",id:"svg1931425825a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg1931425825b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg1931425825a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1931425825b)",d:"M0 0h24v24H0z"})))},st=e=>{let{label:t,attributeType:n}=e;const r=tt(),{expandedMap:o,onExpandType:a}=(0,l.useContext)(Je),s=(0,l.useCallback)((()=>a(n.uri)),[a,n]),c=o[n.uri];return i().createElement("div",{className:r.complexAttributesHeadRenderer},i().createElement("div",{className:r.complexAttributesHeadLabel},t),i().createElement(Ze.k,{icon:c?at:it,size:"XS",onClick:s}))};st.propTypes={label:a().string,attributeType:m.EMD};var ct=n(22385),ut=n(93517),pt=n(87685);const dt=(0,Le.Z)({container:{position:"relative",width:"100%",height:"87px",display:"flex",overflow:"hidden"},closeButton:{position:"absolute",backgroundColor:"#FFFFFF",zIndex:1,borderRadius:"2px",margin:"4px"},profileCard_container:{overflow:"hidden"},profileCard_label:{display:"-webkit-box",lineClamp:2,boxOrient:"vertical",whiteSpace:"normal"},"@media all and (-ms-high-contrast: none), (-ms-high-contrast: active)":{profileCard_label:{display:"block",whiteSpace:"nowrap"}},profileCard_secondaryLabel:{display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}),mt=e=>{let{value:{entity:t,showCloseButton:n,onClose:r}}=e;const o=dt();return i().createElement("div",{className:o.container},n&&i().createElement(ct.Z,{className:o.closeButton,icon:pt.default,onClick:r,size:"XXS"}),i().createElement(ut.Z,{entity:t,classes:{container:o.profileCard_container,secondaryLabel:o.profileCard_secondaryLabel,label:o.profileCard_label}}))};mt.propTypes={value:a().shape({entity:m.pyR,showCloseButton:a().bool,onClose:a().func})};const ht=mt;var ft=n(22071);const gt=(0,Le.Z)({container:{paddingTop:"7px"}});var bt=n(84504),yt=n(59119),vt=n(5434),wt=n(55847),Et=n(35071),Ct=n(24737),xt=n(89140),Ot=n(43054);const St=e=>"potentialMatchReview"===e.processType,Rt=(0,Le.Z)({container:{position:"relative",width:"100%",minHeight:"86px",display:"flex",overflow:"hidden"},assigneeSelector:{},assigneeContainer:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"16px 14px 16px 48px"}});function Pt(){return Pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pt.apply(this,arguments)}const kt=(0,d.pick)(["processInstanceComments","taskId"]),Tt=e=>{let{entity:t,match:n}=e;const r=Rt(),{tasks:o,loadTasks:a}=(e=>{let{entity:t,match:n}=e;const r=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),o=(0,p.useSelector)(Se.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,p.useSelector)(Se.ZP.selectors.getTenant),i=(0,oe._)(),{uri:s}=t,c=(0,m.ev7)(n),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)([]),b=(0,l.useCallback)((()=>{r&&c!==s&&(h(!0),i((0,m.uT0)({entityUri:s,workflowPath:r,environment:o,tenant:a})).then((e=>{const{data:t}=e,n=(0,d.propSatisfies)((0,d.includes)(c),"objectURIs"),r=(0,d.allPass)([St,n]),o=t.filter(r);g(o)})).finally((e=>h(!1))))}),[s,o,a,r,c]);return{enabled:!!r,loading:u,tasks:f,loadTasks:b}})({entity:t,match:n}),{isPending:s,sendMergeAllRequest:c}=(0,bt._)({entity:t,entities:[n.object]}),{isPending:u,sendMarkAsNotMatchRequest:h}=(0,yt.m)({entity:t,entities:[n.object]}),f={Merge:c,NotAMatch:h};(0,l.useEffect)((()=>{a()}),[a]);const g=o[0],b=(g&&g.possibleActions||[]).map((e=>{let{action:t,label:n}=e;return{text:n,onClick:f[t]}})),{assignee:y,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:E}=(0,vt.r)(g||{}),C=b.length>0?i().createElement(wt.Z,{buttonComponent:ct.Z,buttonProps:{icon:Ot.Z,size:"L"},enabled:!s||!u,menuId:"custom-actions",menuItems:b}):null;return g?i().createElement("div",{className:r.container},i().createElement(Et.Z,Pt({},(e=>({date:e.dueDate,type:e.processDefinitionDisplayName,createdBy:e.createdBy,step:e.displayName}))(g),{Actions:C}),i().createElement("div",{className:r.assigneeContainer},i().createElement(Ct.Z,{className:r.assigneeSelector,enabled:!E||y,getOptions:v,onChange:w,hideSelectedOptions:!1,label:q().text("Assigned to"),value:y,defaultOptions:!0})),i().createElement(xt.V,kt(g)))):null};Tt.propTypes={entity:m.pyR,match:m.nqG};const Mt=e=>{let{value:{entity:t,match:n}}=e;return i().createElement(Tt,{entity:t,match:n})};Mt.propTypes={value:a().shape({entity:m.pyR,match:m.nqG})};const jt=[{id:"entityCard",label:"",cellRenderer:ht},{id:"matchControls",cellRenderer:()=>null},{id:"matchMethod",label:"Match Method",cellRenderer:e=>{let{value:{metadata:t,entity:n,match:r,entitiesMap:o,show:a}}=e;const l=gt();return a?i().createElement("div",{className:l.container},i().createElement(ft.Z,{entity:n,match:r,entitiesMap:o,metadata:t})):null}},{id:"workflowCard",label:"",cellRenderer:Mt},{id:"entityId",label:"Entity ID"}],Nt=(0,d.curry)(((e,t)=>`${e}/attributes/${t}`)),It=(0,d.pipe)((0,d.split)("/"),d.last),At="1px solid rgba(0,0,0,0.12)",Dt="2px solid rgba(0,0,0,0.12)",Zt=(0,Le.Z)((e=>({container:{overflow:"auto",height:"100%",width:"100%"},comparisonTable:{borderSpacing:0,"& td, & th":{borderRight:At,borderBottom:At,margin:0,verticalAlign:"top",textAlign:"left",fontSize:"13px",boxSizing:"border-box",wordBreak:"break-word",wordWrap:"break-word"},"& td":{minWidth:310,maxWidth:310,padding:"5px 16px",overflow:"hidden",height:0},"& td:empty, th:empty":{padding:"0px 16px"},"& th":{minWidth:212,maxWidth:212,padding:"5px 8px"},"& thead tr:first-child th:first-child":{borderBottom:"none",borderTop:"none"},"& td:first-child, th:first-child":{borderLeft:At,position:"sticky",left:"0",zIndex:2,backgroundColor:"white",color:e.palette.text.secondary,fontWeight:"normal"},"& td:nth-child(2), th:nth-child(2)":{borderRight:Dt,position:"sticky",left:"212px",zIndex:2},"& thead tr:first-child td, & thead tr:first-child th":{borderTop:"none",position:"sticky",top:"0",backgroundColor:"white",height:88,padding:0,zIndex:2},"& thead tr:nth-child(2) td, & thead tr:nth-child(2) th":{position:"sticky",top:"88px",backgroundColor:"white",height:48,padding:0,zIndex:2},"& thead tr:nth-child(3) td, & thead tr:nth-child(3) th":{position:"sticky",top:"136px",backgroundColor:"white",borderBottom:Dt,zIndex:2},"& thead tr:nth-child(-n+3) td:nth-child(-n+2), & thead tr:nth-child(-n+3) th:nth-child(-n+2)":{zIndex:3},"table& tr td:nth-child(2), th:nth-child(2)":{backgroundColor:"rgb(245,245,245)"}}})));function Bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vt=e=>{let{className:t,entity:n,matches:r,metadata:o,config:a,selectedAttributes:s,entitiesMap:c,controlsRenderer:u}=e;const p=Zt(),h=(0,l.useMemo)((()=>((e,t,n,r)=>{const o=n||(e=>Object.keys(e.attributes).map(Nt(e.type)))(t),a=o.map((n=>{const r=(0,m.zeJ)(e,n,t.type),o=(0,m.xy8)(n);return r?{id:`${o}.${It(n)}`,label:r.label,attributeType:r,cellRenderer:rt,headCellRenderer:(0,m.YkM)(r)?st:void 0}:null})).filter(d.identity);return(e=>jt.map((0,d.when)((0,d.propEq)("id","matchControls"),(0,d.assoc)("cellRenderer",e))))(r).concat(a)})(o,n,s,u)),[o,n,s,u]),f=(0,l.useContext)(F),g=(0,l.useMemo)((()=>((e,t,n,r,o,a,l)=>[{object:n,isMainEntity:!0}].concat(r).map((r=>t.reduce(((t,i)=>(t[i.id]=((e,t,n,r,o,a,l)=>{const{object:i,isMainEntity:s,matchRules:c}=t;switch(o.id){case"entityId":return(0,m.BTI)(i);case"entityCard":return{entity:i,showCloseButton:!s,onClose:()=>l(t)};case"matchControls":return{show:!s,entity:r,entities:[i],matchRules:c,permission:(0,m.hXd)(e,a,i,r,c),config:a};case"matchMethod":return{metadata:e,entity:r,match:t,entitiesMap:n,show:!s&&!!c};case"workflowCard":return{entity:r,match:t}}if((0,m.vZp)(o.id)){const t=(0,m.xy8)(o.attributeType),n=(0,d.pipe)((0,d.pathOr)([],[t,o.attributeType.name]),(0,d.filter)(m.OXP))(i),a=(0,m.w80)(e,r.type,c||[]).includes((0,d.path)(["attributeType","uri"],o))&&!(0,m.O27)(n);return{attributeType:o.attributeType,attributeValues:n,matched:a}}})(e,r,o,n,i,a,l),t)),{}))))(o,h,n,r,c,a,f)),[o,h,r,n,c,a,f]),[b,y]=(0,l.useState)({}),v=(0,l.useCallback)((e=>{y((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Bt(e,t,n[t])}))}return e}({},t,{[e]:!t[e]})))}),[]),w=(0,l.useMemo)((()=>({expandedMap:b,onExpandType:v})),[v,b]);return i().createElement("div",{className:De()(p.container,t)},i().createElement("div",null,i().createElement(Je.Provider,{value:w},i().createElement(Qe.Z,{className:p.comparisonTable,rowsData:h,columnsData:g,theadRowsNumber:3}))))};Vt.propTypes={className:a().string,entity:m.pyR,matches:a().arrayOf(m.nqG),metadata:m.pGS,config:m.yxQ,selectedAttributes:a().arrayOf(a().string),entitiesMap:a().object,controlsRenderer:a().func};var Lt=n(94079),zt=n(92778),Ht=n(29103),Ft=n(83911);function Wt(){return Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}const _t=e=>{let{isFullscreen:t=!1,onClick:n=d.identity}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isFullscreen","onClick"]);return i().createElement(Ze.k,Wt({size:"L",icon:t?Ft.Z:Ht.Z,tooltipTitle:t?q().text("Exit full screen"):q().text("Full screen"),onClick:n},r))};_t.propTypes={isFullscreen:a().bool,onClick:a().func};const Ut=_t,Gt=e=>{let{onClick:t}=e;return i().createElement(ct.Z,{size:"L",icon:pt.default,onClick:t})};Gt.propTypes={onClick:a().func};const qt=Gt;var $t=n(60894),Xt=n(94656);const Yt=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},padding:"8px 15px 8px 0",borderLeft:"1px solid rgba(0,0,0,0.12)"},flex1:{flex:1},title:{display:"flex",flexDirection:"row",alignItems:"center"}}))),Qt=e=>{let{columnsData:t,selectedColumns:n,onChangeColumns:r}=e;const o=Yt(),{setComparisonViewMode:a}=H(),{comparisonViewMode:s}=z(),c=(0,l.useCallback)((()=>{a(w)}),[a]),u=(0,l.useCallback)((()=>{a(s!==v?v:E)}),[a,s]);return i().createElement(zt.Z,{title:"",classes:{root:o.header}},i().createElement("div",{className:De()(o.flex1,o.title)},i().createElement(qt,{onClick:c}),i().createElement(Ut,{onClick:u,isFullscreen:s===v}),i().createElement(Lt.Typography,null,q().text("Comparison view"))),i().createElement($t.Z,{title:q().text("Show/hide attributes"),tooltipTitle:q().text("Show/hide attributes"),columnsData:t,selectedColumns:n,onChangeColumns:r}))};Qt.propTypes={columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func};const Kt=(0,d.pipe)((0,d.split)("."),(0,d.slice)(0,2),(0,d.join)(".")),Jt=(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,Kt)),d.uniq),en=(0,d.curry)(((e,t)=>(0,d.reduce)(((t,n)=>(n.id.startsWith(`${e}.`)&&!(0,m.QZu)(n.dataTypeDefinition)&&t.push(n.id),t)),[])(t))),tn=(0,d.curry)(((e,t)=>(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,(t=>{const n=Kt(t),r=((e,t)=>e.reduce(((e,n)=>(0,d.pipe)((0,d.prop)("columns"),en(t),d.flatten,(0,d.concat)(e))(n)),[]))(e,n);return r.length?r:t}))),d.flatten,d.uniq)(t))),nn=(0,d.pipe)((0,d.prop)("id"),(0,d.both)(m.vZp,(0,d.pipe)((0,d.split)("."),(0,d.propSatisfies)((0,d.lt)(2),"length")))),rn=(0,d.map)((0,d.evolve)({columns:(0,d.reject)(nn)})),on=(0,Le.Z)((()=>({container:{display:"flex",flexDirection:"column"},table:{flex:1}}))),an=e=>{let{classes:t,columnsData:n,selectedColumns:r,onChangeColumns:o,selectedItems:a,config:l,metadata:s,entity:c,entitiesMap:u,controlsRenderer:p}=e;const h=on(),f=a.slice(-3),g=Jt(r),b=(y=c.type,v=g,(0,d.pipe)((0,d.filter)(m.vZp),(0,d.map)((e=>(0,m.h2W)(e,y))))(v));var y,v;return i().createElement("div",{className:De()(t.root,h.container)},i().createElement(Qt,{columnsData:rn(n),selectedColumns:g,onChangeColumns:(0,d.pipe)(tn(n),o)}),i().createElement(Vt,{className:h.table,entity:c,metadata:s,config:l,matches:f,selectedAttributes:b,entitiesMap:u,controlsRenderer:p}))};an.propTypes={entity:m.pyR,metadata:m.pGS,columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func,selectedItems:a().arrayOf(a().object),classes:a().object,config:m.yxQ,entitiesMap:a().object,controlsRenderer:a().func},an.defaultProps={classes:{}};const ln=e=>{let{fullScreenContainer:t,children:n}=e;return t?i().createElement(Lt.Portal,{container:t},n):i().createElement("div",null)};ln.propTypes={fullScreenContainer:a().instanceOf(Element),children:a().oneOfType([a().node,a().arrayOf(a().node)])};var sn=n(46177),cn=n(74402),un=n(94646),pn=n(97946),dn=n(25461),mn=n(85709),hn=n(92332),fn=n(67353);function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){bn(e,t,n[t])}))}return e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yn={position:"relative",whiteSpace:"pre",padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"},color:"rgba(0,0,0,0.87)"},vn={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},wn=(e,t)=>({"& > *":{position:"relative"},"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:e,pointerEvents:"none","div.hoveredRow &":{background:t||"none"}},"& $defaultWrapper::after":{background:`linear-gradient(to right, ${(0,ze.U1)(e,0)}, ${e} 100%)`,"div.hoveredRow &":{background:t&&`linear-gradient(to right, ${(0,ze.U1)(t,0)}, ${t} 100%)`}}}),En=(0,Le.Z)((e=>{const t=(0,ze.$n)(e.palette.primary.main,.88),n=(0,ze.$n)(e.palette.primary.main,.82),r=(0,ze.$n)("rgb(140,193,82)",.88),o=(0,ze.$n)("rgb(0, 0, 0)",.96),a={color:e.palette.primary.main,cursor:"pointer",textDecoration:"none"};return{link:a,hidden:{visibility:"hidden"},rowCheckbox:{marginLeft:"-9px",marginRight:"19px"},headCheckbox:{marginLeft:"6px"},headCell:{display:"flex",alignItems:"center",height:"56px",fontSize:"12px",position:"relative",flex:1,overflow:"hidden",color:"rgba(0,0,0,0.87)","&::after":gn({},vn,{width:"30px"})},headCellWithEntity:{height:"100%",display:"flex",flexDirection:"column"},rowCell:{fontSize:"12px",overflow:"hidden"},rowCellFirstColumn:{height:"100%"},firstEntityCell:{maxHeight:"200px"},entityRowCell:{fontSize:"12px",position:"relative"},entityRowCellSelected:wn(o),rowCellHighlighted:wn(r),rowCellSelected:wn(t,n),defaultWrapper:gn({},yn,{"&::after":gn({},vn,{"div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"}})}),hoveredDefaultWrapper:gn({},yn),entityWrapper:{paddingLeft:"12px"},profileWrapper:{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",position:"relative"},entityLabel:gn({},a,{fontWeight:500}),commentsContainer:{position:"absolute",right:0,top:0,zIndex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"15px",backgroundColor:"#fff","&$checked":{backgroundColor:t}},checked:{},matchRulesWrapper:{padding:"12px 15px 4px 10px",display:"flex",alignItems:"center",boxSizing:"border-box"},blobWrapper:gn({},yn,{whiteSpace:"pre-wrap",height:"100px",boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}),imageWrapper:gn({},yn,{display:"flex","& > img":{height:"64px",width:"64px"}}),referenceWrapper:{display:"flex",alignItems:"center",boxSizing:"border-box",height:"48px"},entityAvatar:{transform:"scale(0.5)",marginLeft:"-10px"},collapseButton:{position:"absolute",left:"40px",zIndex:2},dragIcon:{position:"absolute",left:"-5px",zIndex:2,opacity:.38}}})),Cn=(0,fn.Z)((e=>{const t=En();return i().createElement("div",{className:t.headCell},i().createElement(hn.default,e))}));var xn=n(72768);const On=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const r=En();return i().createElement("div",{className:r.defaultWrapper},i().createElement(xn.Z,{value:t,dataTypeDefinition:n}))};On.propTypes={columnData:a().shape({dataTypeDefinition:a().object}),value:a().any};const Sn=On;var Rn=n(52049),Pn=n(74566),kn=n(31039),Tn=n(32528),Mn=n(14940);const jn=e=>{const{value:t,rowIndex:n,rowValue:r,onToggleSelect:o,entityToMatch:a,isRowSelected:s,hoverRowIndex:c}=e,u=En(),p=(0,l.useContext)(Rn.B),d=t!==a,h=n===c,f=0===n,g=h?u.hoveredDefaultWrapper:u.defaultWrapper,b=t.uri!==a.uri&&!h;return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(g,u.profileWrapper,u.entityWrapper,{[u.firstEntityCell]:f&&!d})},h&&i().createElement(Mn.Z,{className:u.dragIcon}),i().createElement(Pn.Z,{className:u.collapseButton,rowIndex:n,rowValue:r}),i().createElement(Lt.Checkbox,{className:De()(u.rowCheckbox,{[u.hidden]:!d}),checked:s,onChange:o,"data-reltio-id":`reltio-matches-table-${p?p+"-":""}checkbox-${n}`}),i().createElement(kn.Z,{value:(0,m.wwR)(t),className:u.entityLabel},(0,m.idV)(t.label)),b&&i().createElement(un.Z,{className:De()(u.commentsContainer,{[u.checked]:s}),uri:(0,m.E_P)(a.uri,t.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:a.uri,matchEntityUri:t.uri}),allowOnlyOneComment:!0})))};jn.propTypes={value:m.pyR,rowIndex:a().number,rowValue:a().shape({rawValue:a().object}),onToggleSelect:a().func,isRowSelected:a().bool,columnsData:a().array,entityToMatch:m.pyR,hoverRowIndex:a().number};const Nn=(0,Tn.Z)(((e,t)=>{let{onToggleSelect:n,entityToMatch:r}=e,{rowValue:o,value:a}=t;const{rawValue:l}=o;return{onToggleSelect:()=>n(l),isRowSelectable:a!==r,entityToMatch:r}}))(jn);const In=e=>{let{isAllSelected:t,isSomeSelected:n,onCheckboxClick:r,isComparisonViewShown:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isAllSelected","isSomeSelected","onCheckboxClick","isComparisonViewShown"]);const l=En();return i().createElement("div",{className:l.headCell},i().createElement(Lt.Checkbox,{className:l.headCheckbox,indeterminate:n&&!t,checked:t,disabled:!n&&o,onChange:()=>r(),"data-reltio-id":"reltio-matches-table-selectAll-checkbox"}),i().createElement(hn.default,a))};In.propTypes={isSomeSelected:a().bool,isAllSelected:a().bool,onCheckboxClick:a().func,isComparisonViewShown:a().bool};const An=(0,Tn.Z)((e=>{let{selected:t,isAllSelected:n,onResetSelect:r,onSelectAll:o,isComparisonViewShown:a}=e;const l=!!t&&t.length>0;return{isSomeSelected:l,isAllSelected:n,onCheckboxClick:l?r:o,isComparisonViewShown:a}}))((0,fn.Z)(In));var Dn=n(74615),Zn=n(93301);const Bn=e=>{let{value:{transitiveMatchRules:t=[],matchRules:n=[]}={}}=e;const r=En();return i().createElement("div",{className:r.matchRulesWrapper},n.length>0&&i().createElement(Dn.Z,{matchRules:n}),t.length>0&&i().createElement(Zn.Z,{transitiveMatchRules:t}))};Bn.propTypes={value:a().shape({transitiveMatchRules:a().array,matchRules:a().array})};const Vn=Bn,Ln=e=>{let{value:{mlMatchRules:t=[]}={}}=e;const n=En();return i().createElement("div",{className:n.matchRulesWrapper},t.length>0&&i().createElement(Dn.Z,{isMlMatch:!0,matchRules:t}))};Ln.propTypes={value:a().shape({mlMatchRules:a().array})};const zn=Ln,Hn=e=>{let{value:t}=e;const n=En();return i().createElement("div",{className:n.blobWrapper,onScroll:T.UW},t)};Hn.propTypes={value:a().any};const Fn=Hn,Wn=e=>{let{value:t}=e;const n=En(),r=(0,m.efz)({value:t});return r&&i().createElement("div",{className:n.imageWrapper},i().createElement("img",{src:r}))};Wn.propTypes={value:a().any};const _n=Wn;var Un=n(31254);const Gn=e=>{let{value:t}=e;const n=En(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata);return t&&i().createElement("div",{className:De()(n.defaultWrapper,n.referenceWrapper)},i().createElement(Un.Z,{className:n.entityAvatar,entityType:(0,m.nt9)(r,(0,m.CZ8)(t).type)}),i().createElement(kn.Z,{value:(0,m.CZ8)(t).objectURI,className:n.link},(0,m.idV)(t.label)))};Gn.propTypes={value:a().any};const qn=Gn;function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xn=(0,d.split)("."),Yn=(e,t,n,r)=>n.map((o=>{const a=o.object,l=(0,m.ZYr)(e,n,a,r),i=o.matchRules||[],s=o.matchScore||0,[c,u]=(0,d.isEmpty)(l)?(0,d.pipe)((0,m.LS0)(e,a.type),m.UkJ)(i):[[],[]],p=(0,m.w80)(e,a.type,i),h={entity:a,matchRules:u,mlMatchRules:c,transitiveMatchRules:l,matchScore:s};return(0,d.pipe)((0,d.reduce)(((e,t)=>(0,d.assoc)(t.id,((e,t,n)=>{let{entity:r,transitiveMatchRules:o,matchRules:a,mlMatchRules:l,matchScore:i}=n;switch(t.id){case"label":return r;case"id":return(0,m.BTI)(r);case"matchRules":return{transitiveMatchRules:o,matchRules:a};case"mlMatchRules":return{mlMatchRules:l};case"score":return i;default:{const[e,...n]=Xn(t.id);return(0,d.pipe)((0,d.prop)(e),(0,m.tT_)(n))(r)}}})(0,t,h),e)),{}),(0,d.assoc)("matchAttributes",p),(0,d.assoc)("rawValue",o))(t)})),Qn=e=>{if((0,m.vZp)(e)){const[,...t]=Xn(e);return t.length>1?t.slice(0,-1):null}return null},Kn=e=>{switch(e.id){case"label":return Nn;case"matchRules":return Vn;case"mlMatchRules":return zn;default:return(e=>{switch(e){case m.oS0.TYPE_BLOB:return Fn;case m.oS0.TYPE_IMAGE:return _n;case m.oS0.TYPE_REFERENCE:return qn;default:return Sn}})(e.dataTypeDefinition.type)}};function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}const er=e=>{let{rowValue:t,cell:n,CellValueRenderer:r,isRowSelected:o,isCellHighlighted:a,columnIndex:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["rowValue","cell","CellValueRenderer","isRowSelected","isCellHighlighted","columnIndex"]);const c=En(),u=0===l;return i().createElement("div",{className:De()({[c.rowCellSelected]:o,[c.rowCellHighlighted]:a,[c.rowCellFirstColumn]:u},c.rowCell)},n.values.map(((e,n)=>i().createElement(r,Jn({key:n,value:e,rowValue:t,isRowSelected:o},s)))))};er.propTypes={rowValue:a().object,cell:a().object,CellValueRenderer:a().elementType,isRowSelected:a().bool,isCellHighlighted:a().bool,columnIndex:a().number};const tr=(0,Tn.Z)(((e,t)=>{let{selected:n}=e,{columnData:r,rowValue:o,cell:a}=t;return{isRowSelected:!!n&&n.includes(o.rawValue),isCellHighlighted:Q(o.matchAttributes,r)&&!a.values.every(m.O27)}}))(er),nr=(0,Le.Z)((e=>({tableContainer:{flex:1,display:"flex",color:"rgba(0,0,0,0.54)",overflow:"hidden"},rowActionButtonsWrapper:{height:"100%",display:"flex",alignItems:"center",marginRight:"1px"},rowActionButtons:{backgroundColor:"rgba(238, 238, 238, 1)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",backgroundColor:"rgba(238, 238, 238, 1)",borderLeft:"1px solid rgba(0,0,0,0.12)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},checked:{},actionButton:{marginLeft:"12px","&:last-child":{marginRight:"3px"}},hoveredRowRightContentContainer:{alignItems:"center !important"}})));function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{entity:t,matches:n,metadata:r,columnsData:o,filters:s,onFilter:c,sorting:u,onSort:p,selected:h,onToggleSelect:f,onResetSelect:g,onSelectAll:b,entitiesMap:y,actionButtonsRenderer:v,basicTableRef:w,isComparisonViewShown:E}=e;const C=nr(),[x,O]=(0,l.useState)(n);(0,l.useEffect)((()=>{O(n)}),[n]);const S=(0,l.useCallback)(((e,t)=>{O((0,d.move)(e,t)),U(t)}),[]),R=(0,l.useMemo)((()=>Yn(r,o,x,y)),[x,o,r,y]),P=!!p,k=(0,l.useMemo)((()=>((e,t)=>(0,d.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$n(e,t,n[t])}))}return e}({sortable:e},t,{resizable:!0,nestedPath:Qn(t.id),headCellRenderer:"label"===t.id?An:Cn,rowCellValueRenderer:Kn(t)})))(t))(P,o)),[o,P]),T=(0,l.useMemo)((()=>t?Yn(r,o,[{object:t}]):[]),[t,r,o]),{getRowHeight:M,CellRenderer:j}=(0,sn.Z)({rowsData:T,columnsData:k,maxRowValuesCount:3}),N=M(0),I=(0,l.useMemo)((()=>{const e=(e=>t=>{const n=n=>{const r=En();return i().createElement(Rn.B.Provider,{value:"tableHeader"},i().createElement("div",{className:r.headCellWithEntity},i().createElement(t,n),i().createElement(e,{className:De()(r.entityRowCell,r.entityRowCellSelected),columnId:n.headCellData.id,rowIndex:0})))};return n.propTypes={headCellData:a().shape({id:a().string})},n})(j);return k.map((0,d.evolve)({headCellRenderer:e}))}),[k,j]),A=(0,l.useMemo)((()=>({isAllSelected:h.length>0&&h.length===n.length,entityToMatch:t,selected:h,onToggleSelect:f,onResetSelect:g,onSelectAll:b,isComparisonViewShown:E})),[t,h,f,g,b,n,E]),{getDynamicRowCellHeight:D,changeRowCellHeight:Z,clearHeightsCache:B}=(0,cn.Z)();(0,l.useLayoutEffect)(B,[n]);const[V,L]=(0,l.useState)(!1),z=(0,l.useCallback)((()=>L(!0)),[]),H=(0,l.useCallback)((()=>L(!1)),[]),[F,W]=(0,l.useState)(!1),[_,U]=(0,l.useState)(null),G=(0,l.useCallback)((e=>{U((t=>V||F?t:e))}),[V,F]),q=(0,l.useMemo)((()=>{if(!v||null===_)return null;const e=x[_],n=h.includes(e);return i().createElement("div",{className:De()(C.rowActionButtonsWrapper)},i().createElement("div",{className:De()(C.rowActionButtons,{[C.checked]:n})},v({hoveredMatch:e,buttonClassName:C.actionButton,onActionsMenuOpen:z,onActionsMenuClose:H})),t&&i().createElement(un.Z,{className:De()(C.commentsContainer,{[C.checked]:n}),uri:(0,m.E_P)(t.uri,e.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:t.uri,matchEntityUri:e.object.uri}),onChangePopupVisibility:W,allowOnlyOneComment:!0,showAlways:!0}))}),[v,_,x,h,C,z,H,t]),$=(0,l.useCallback)((e=>{switch(e.columnData.id){case"label":return i().createElement(tr,rr({},e,{hoverRowIndex:_,actionsContent:q,tableRef:w}));case"matchRules":case"mlMatchRules":return i().createElement(pn.Z,rr({onChangeHeight:Z},e),i().createElement(tr,e));default:return i().createElement(tr,e)}}),[Z,_,q,w]),X=(0,l.useCallback)((0,d.either)(D,dn.Z),[D,dn.Z]),Y=(0,l.useMemo)((()=>({hoveredRowRightContentContainer:C.hoveredRowRightContentContainer})),[C]);return i().createElement("div",{className:C.tableContainer},i().createElement(mn.Z,{fixFirstColumn:!0,columnsData:I,rowsData:R,context:A,sorting:u,onSort:p,filters:s,onFilter:c,defaultColumnWidth:250,defaultColumnMinWidth:100,headRowHeight:56+N,renderRowCell:$,getRowCellHeight:X,hoverStateEnabled:!0,hoveredRowRightContent:q,hoverRowIndex:_,onRowHover:G,classes:Y,maxRowValuesCount:3,dndRowReorderingEnabled:!0,dndRowReorderingHandler:S,ref:w,hoveredContentPosition:0}))};or.propTypes={entity:m.pyR,metadata:m.pGS,columnsData:Xt.uz,matches:a().array,selected:a().array,onToggleSelect:a().func,onResetSelect:a().func,onSelectAll:a().func,filters:a().objectOf(Xt.Dq),onFilter:a().func,sorting:Xt.nI,onSort:a().func,entitiesMap:a().object,actionButtonsRenderer:a().func,basicTableRef:a().shape({current:a().object}),isComparisonViewShown:a().bool};const ar=or;var lr=n(51229),ir=n(1876),sr=n(30553),cr=n(98281);const ur=(0,Le.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,ze.U1)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,ze.U1)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px",paddingLeft:"12px",paddingRight:"38px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0},hidden:{visibility:"hidden"},checkIcon:{color:"rgba(0,0,0,0.54)",marginRight:"12px"}})));function pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dr=e=>{let{options:t,optionsData:n,onChangeOptions:r}=e;const o="options-menu",a=ur(),s=(0,l.useRef)(),[c,u]=(0,l.useState)(!1),p=()=>u((e=>!e));return i().createElement(i().Fragment,null,i().createElement(ct.Z,{icon:Ot.Z,size:"L",ref:s,className:De()(a.buttonRoot,{[a.selected]:c}),onClick:p,"aria-pressed":c,"aria-controls":c?o:void 0,"aria-haspopup":"true"}),i().createElement(Lt.Menu,{id:o,variant:"menu",open:c,autoFocus:!1,classes:{paper:a.paper},anchorEl:s.current,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:c}},n.map((e=>{const{label:n,id:o}=e,l=t[o];return i().createElement(Lt.MenuItem,{key:o,classes:{root:a.menuItem},onClick:()=>{u(!1),r(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pr(e,t,n[t])}))}return e}({},t,{[o]:!l}))}},i().createElement(cr.Z,{className:De()(a.checkIcon,{[a.hidden]:!l})}),i().createElement(Lt.Typography,{classes:{root:a.menuText}},n))}))))};dr.propTypes={options:a().object,optionsData:a().array,onChangeOptions:a().func};const mr=dr,hr=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},paddingRight:"15px"},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500},flex1:{flex:1},selected:{backgroundColor:(0,ze.U1)(e.palette.primary.main,.12)}}))),fr=e=>{let{total:t,columnsData:n,selectedColumns:r,onChangeColumns:o,filtersEnabled:a,onToggleFilters:l,showFilters:s,options:c,optionsData:u,onChangeOptions:p}=e;const d=hr(),h=!(0,m.O27)(u);return i().createElement(zt.Z,{title:"",classes:{root:d.header}},i().createElement(Lt.Typography,{className:d.totalCaption,variant:"caption"},i().createElement("span",{className:d.totalNumber},q().number(t,"0,0")),q().text("total profiles")),i().createElement(lr.Z,null),s&&i().createElement(ir.Z,{enabled:a,onClick:l}),h&&i().createElement(mr,{options:c,optionsData:u,onChangeOptions:p}),(s||h)&&i().createElement(sr.Z,{height:28,margin:10}),i().createElement($t.Z,{columnsData:n,selectedColumns:r,onChangeColumns:o}))};fr.propTypes={total:a().number,showFilters:a().bool,columnsData:Xt.uz,selectedColumns:a().arrayOf(a().string),onChangeColumns:a().func,filtersEnabled:a().bool,onToggleFilters:a().func,options:a().object,optionsData:a().array,onChangeOptions:a().func};const gr=fr,br=(0,Le.Z)((e=>({header:{"& > button":{margin:"0 -2px"},paddingRight:"15px"},flex1:{flex:1},selected:{backgroundColor:(0,ze.U1)(e.palette.primary.main,.12)}}))),yr=e=>{let{selectedItems:t,children:n}=e;const r=br(),o=t.length>0;return i().createElement(zt.Z,{title:"",classes:{root:De()(r.header,{[r.selected]:o})}},i().createElement("div",{className:r.flex1},i().createElement(Lt.Typography,{color:"primary"},q().text("Selected: ${count}",{count:t.length}))),n)};yr.propTypes={selectedItems:a().arrayOf(a().object),children:a().oneOfType([a().arrayOf(a().node),a().node])},yr.defaultProps={selectedItems:[]};const vr=yr,wr=(0,Le.Z)({actions:{display:"flex",alignItems:"center"},button:{marginLeft:"8px"}}),Er=(0,d.map)((0,d.prop)("object")),Cr=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=wr(),l=Er(n),{canMark:s}=(0,m.OCS)(r,o,t,n);return i().createElement("div",{className:a.actions},s&&i().createElement(Ge,{entity:t,entities:l,mode:"button"}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};Cr.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const xr=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],Or=[{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],Sr=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}}))),Rr=(e,t)=>{(0,l.useEffect)((()=>{t(e!==w?3:void 0)}),[e,t])};function Pr(){return Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}const kr=[20,50,100],[Tr]=kr,Mr=Y(xr),[jr]=Mr,Nr={showInactiveEntities:!1},Ir=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const a=Sr(),[s,c]=ge(Mr,{order:"asc",field:jr},Tr,Nr),{comparisonViewMode:u,isGlobalSpinnerActive:p}=z(),{changeRowsPerPage:h,changePage:f,changeColumns:g,toggleFilters:b,changeFilter:y,toggleSort:w,setSelectedItems:S,toggleSelect:R,setOptions:P,setLimitSelection:T}=s,{sorting:M,page:j,rowsPerPage:N,visibleColumns:I,filters:A,selectedItems:D,options:Z}=c,{uri:B,type:V}=t||{},[L,W,_]=ae({defaultColumnsData:xr,metadata:n,entityType:V}),G=(0,l.useMemo)((()=>I.map((e=>L.find((0,d.propEq)("id",e)))).filter(d.identity)),[I,L]);(0,l.useEffect)((()=>{g(_)}),[_,g]);const q=(0,l.useMemo)((()=>[...U(V,A,L),{filter:"not equals",fieldName:"uri",values:[B]}]),[V,A,L,B]),$=(0,l.useMemo)((()=>Y(G)),[G]),{entities:X,total:Q,findEntities:K}=(e=>{let{entityType:t,filters:n,select:r,sorting:o,page:a,rowsPerPage:i,options:s,enabled:c}=e;const{order:u,field:p}=o,{setGlobalSpinner:d}=H(),[h,f]=(0,l.useState)(0),[g,b]=(0,l.useState)([]),y=(0,oe._)(),v=["uri","label","type","secondaryLabel","defaultProfilePicValue"],w=s.showInactiveEntities?m.YJ7.ALL:m.YJ7.ACTIVE_ONLY,E=(0,l.useCallback)((()=>{c&&(d(!0),y(Promise.all([(0,m.ZOr)(n,{offset:a*i,max:i,sort:p,order:u,select:v.concat(r).join(","),activityFilter:w}),(0,m.j_Q)(n,{activityFilter:w})])).then((e=>{const[t,n]=e,{total:r}=n;b(t.map((e=>({object:e})))),f(r)})).finally((e=>d(!1))))}),[t,n,p,u,a,i,c,r,w]);return(0,l.useEffect)((()=>{E()}),[E]),{entities:g,total:h,findEntities:E}})({enabled:!!B,entityType:V,filters:q,sorting:M,select:$,page:j,rowsPerPage:N,options:Z}),{setReloadHandler:J}=k();J((()=>{K(),ee()}));const ee=(0,l.useCallback)((()=>{S([])}),[S]),te=(0,l.useCallback)((()=>{S(X)}),[S,X]);(0,l.useEffect)((()=>{const e=D.map((e=>X.find((t=>(0,m.ev7)(t)===(0,m.ev7)(e)))||e));S(e)}),[X]),(0,C.D)((()=>{f(0),ee()}),[B,A,Z]),Rr(u,T);const ne=u===v,re=u===E,le={entity:t,metadata:n,selectedItems:D||[],columnsData:W,config:r,selectedColumns:I,onChangeColumns:g,controlsRenderer:Ye},ie=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a}=e;const l=[o.object],{canMark:s}=(0,m.hXd)(n,r,o.object,t,o.matchRules);return s&&i().createElement(Ge,{entity:t,entities:l,mode:"iconButton",className:a})}),[r,t,n]),se=(0,l.useRef)(null);return ne?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:R},i().createElement(an,Pr({},le,{classes:{root:a.fullScreen}})))):i().createElement("div",{className:a.matchesView},D&&D.length>0?i().createElement(vr,{selectedItems:D},i().createElement(Cr,{matches:D,entity:t,metadata:n,config:r})):i().createElement(gr,{total:Q,columnsData:W,selectedColumns:I,onChangeColumns:g,filtersEnabled:!!A,onToggleFilters:b,showFilters:!0,options:Z,optionsData:Or,onChangeOptions:P}),i().createElement("div",{className:a.mainArea},i().createElement("div",{className:a.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:G,matches:X,selected:D,onToggleSelect:R,onResetSelect:ee,onSelectAll:te,filters:A,onFilter:y,sorting:M,onSort:w,actionButtonsRenderer:ie,basicTableRef:se,isComparisonViewShown:re}),i().createElement(x.Z,{rowsPerPageOptions:re?[]:kr,count:Q,page:j,onChangePage:f,rowsPerPage:N,onChangeRowsPerPage:h,basicTableRef:se}),p&&i().createElement(O.Z,null)),re&&i().createElement(F.Provider,{value:R},i().createElement(an,Pr({},le,{classes:{root:a.comparisonView}})))))}));Ir.displayName="FindMatchesView",Ir.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};var Ar=n(7718),Dr=n(3515),Zr=n(31274),Br=n(7154),Vr=n(91262);const Lr=(0,Le.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"16px 16px 0"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px"},path:{color:e.palette.text.secondary,fontize:"13px",letterSpacing:0,lineHeight:"15px",padding:"6px 0"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}})));function zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Hr(e,t,n[t])}))}return e}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fr=e=>{let{config:t,mainEntity:n,currentEntity:r,matchRules:o,open:a,onClose:s=d.identity}=e;const c=Lr(),u=(0,p.useDispatch)(),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),{relation:f={}}=(0,p.useSelector)((e=>Se.ZP.selectors.getRelationToAddByViewId(e,t.id)))||{},{inRelations:g=[],outRelations:b=[]}=(0,l.useMemo)((()=>((e,t,n,r,o)=>{const{isNotDuplicatedInRelation:a,isNotDuplicatedOutRelation:l}=(0,m.xE1)(),i=t=>(0,d.pipe)((0,d.assocPath)(["startObject","objectType"],(0,m.nt9)(e,t.startObject.objectTypeURI)),(0,d.assocPath)(["endObject","objectType"],(0,m.nt9)(e,t.endObject.objectTypeURI)))(t),s=(0,m.nt9)(e,r.type),c=(0,d.propOr)({},"matchActions",t),u=(0,m.dzT)(c,s,o),[p]=u.map((e=>{let{createRelation:t}=e;return t})).filter(d.identity);return(0,d.evolve)({inRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,r,n)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(a),(0,d.map)(i)),outRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,n,r)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(l),(0,d.map)(i))},p)||{}})(h,t,n,r,o)),[t,n,r,o,h]),{relationUri:y,relationType:v={}}=f,w=(0,d.pathOr)({},["object","attributes"],f),E=(0,l.useMemo)((()=>(0,m.xF8)(h,v)),[v,h]),C=(0,l.useMemo)((()=>zr({attributes:w},(0,m.p2l)(f))),[f,w]),x=t.id,O=(0,l.useCallback)((e=>{(0,d.pipe)(Se.N5.relations.actions.setRelationType(t.id,y),u)(e)}),[t,y,u]),S=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.addAttributes,u)(e.map((e=>zr({},e,{viewId:x}))))),[x,u]),R=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.modifyAttribute,u)(zr({},e,{viewId:x}))),[x,u]),P=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.removeAttribute,u)(zr({},e,{viewId:x}))),[x,u]),k=(0,l.useCallback)((()=>s(y)),[y,s]),T=(0,l.useCallback)((()=>u(Se.N5.errors.actions.errorsSet([]))),[u]),M=(0,l.useCallback)((()=>{const e=(0,m.xkB)(h,{relation:f});return u(Se.N5.errors.actions.errorsSet(e)),0===e.length}),[f,h,u]),j=(0,l.useCallback)((()=>{T(),k()}),[T,k]),N=`${(0,m.idV)(r.label)} → ${(0,m.idV)(n.label)}`,I=(0,d.isEmpty)(v);return i().createElement(Lt.Dialog,{open:a,fullWidth:!0,maxWidth:"sm",onClose:j,classes:{paper:c.dialogPaper}},i().createElement(Lt.DialogTitle,{disableTypography:!0,classes:{root:c.dialogTitle}},i().createElement(Lt.Typography,{variant:"subtitle1",classes:{root:c.titleText}},q().text("Add relationship")),i().createElement(Lt.Typography,{variant:"body2",classes:{root:c.path}},N)),i().createElement(Lt.DialogContent,{classes:{root:c.content}},i().createElement(Br.Z,{relation:f,metadata:h,inRelationTypes:g,outRelationTypes:b,onChange:O,applyFirstByDefault:!0}),i().createElement(Vr.Z,{className:c.attributeList,attrTypes:E,entity:C,showEmptyEditors:!0,mode:m.fO_.EDITING,parentUri:y,onAddAttributes:S,onChangeAttribute:R,onDeleteAttribute:P})),i().createElement(Lt.DialogActions,null,i().createElement(Lt.Button,{onClick:j},q().text("Cancel")),i().createElement(Lt.Button,{disabled:I,color:"primary",onClick:()=>{const{relationType:e,startDate:t,endDate:o}=f;M()&&((0,m.DsR)({startEntityUri:n.uri,endEntityUri:r.uri,relationType:e,attributes:(0,d.pathOr)({},["object","attributes"],f),startDate:t,endDate:o}).catch(ve),k())}},q().text("Add"))))};Fr.propTypes={config:m.yxQ,mainEntity:m.pyR,currentEntity:m.pyR,matchRules:a().arrayOf(a().string),open:a().bool,onClose:a().func};const Wr=Fr;function _r(){return _r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_r.apply(this,arguments)}const Ur=e=>{const[t,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)({}),a=(0,p.useDispatch)(),s=(0,l.useCallback)((t=>{let{mainEntity:r,currentEntity:l,matchRules:i}=t;const s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{relation:{relationUri:(0,m.ncP)()},entity:e,isNew:!0}}(l);(0,d.pipe)(Se.N5.relations.actions.openRelationEditor(e.id),a)(s),o({mainEntity:r,currentEntity:l,matchRules:i}),n(!0)}),[e,a]),c=(0,l.useCallback)((t=>{(0,d.pipe)(Se.N5.relations.actions.closeRelationEditor,a)(e.id,t),n(!1)}),[e.id,a]),u=()=>t?i().createElement(Wr,_r({config:e,open:t,onClose:c},r)):null;return u.propTypes={},{showDialog:t,openAddRelationDialog:s,AddRelationDialogRenderer:u}};var Gr=n(28741);function qr(){return qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}const $r=(0,l.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=d.identity}=e;const{ActionButton:o,props:a}=n;return i().createElement(o,qr({ref:t,mode:"menuItem",onMenuClose:r},a))}));$r.displayName="MenuItemRenderer";const Xr=$r;function Yr(){return Yr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}const Qr=e=>{let{actions:t,numberOfButtons:n=2,mode:r="normal",classes:o,onActionsMenuOpen:a,onActionsMenuClose:l}=e;const[s,c]=(0,d.splitAt)(n,t),u="normal"===r?"button":"iconButton",p="normal"===r?"MPlus":"S";return i().createElement(i().Fragment,null,s.map(((e,t)=>{let{ActionButton:n,props:r}=e;return i().createElement(n,Yr({key:t,mode:u,className:null==o?void 0:o.actionButton},r))})),c.length>0&&i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ot.Z,size:p,tooltipTitle:q().text("More actions")},className:null==o?void 0:o.moreOptions,menuId:"matches-view-actions",menuItems:c,onMenuOpen:a,onMenuClose:l,MenuItemRenderer:Xr}))},Kr=e=>{let{value:{show:t,entity:n,entities:r,matchRules:o,permission:a,config:l}}=e;const s=qe(),{canMerge:c,canAddRelation:u,canMark:p}=a,{showDialog:h,openAddRelationDialog:f,AddRelationDialogRenderer:g}=Ur(l),b=[...r,n].some(m.biM),y=[{ActionButton:Ie,show:p,props:{entity:n,entities:r}},{ActionButton:ke,show:!b,props:{entity:n,entities:r}},{ActionButton:je,show:u&&!b,props:{mainEntity:n,currentEntity:r.length>0?r[0]:{},matchRules:o,onClick:f}}].filter((0,d.prop)("show"));return t?i().createElement(i().Fragment,null,i().createElement("div",{className:s.container},c&&i().createElement(xe,{entity:n,entities:r,className:s.mergeButton,mode:"button"}),i().createElement(Qr,{actions:y,numberOfButtons:1,classes:{actionButton:s.rightButton,moreOptions:s.moreOptions}})),u&&h&&i().createElement(g,null)):null};Kr.propTypes=$e;const Jr=Kr,eo=(0,d.map)((0,d.prop)("object")),to=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=eo(n),{canMerge:s,canMark:c}=(0,m.OCS)(r,o,t,n),u=wr(),p=[...a,t].some(m.biM),h=(0,l.useMemo)((()=>[{ActionButton:xe,show:s,props:{entity:t,entities:a}},{ActionButton:Ie,show:c,props:{entity:t,entities:a}},{ActionButton:ke,show:!p,props:{entity:t,entities:a}}].filter((0,d.prop)("show"))),[c,s,t,a,p]);return i().createElement("div",{className:u.actions},i().createElement(Qr,{actions:h,numberOfButtons:2,classes:{actionButton:u.button}}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};to.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const no=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"matchRules",get label(){return q().text("Match rule")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,initialWidth:100,autoResize:!1},{id:"mlMatchRules",get label(){return q().text("Match IQ")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,initialWidth:130,minWidth:130,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],ro=[{id:"showTransitiveMatches",get label(){return q().text("Show transitive matches")}},{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],oo=[{id:"score",get label(){return q().text("Match score")},dataTypeDefinition:{type:m.oS0.TYPE_INT},initialWidth:100}],ao=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}})));function lo(){return lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const io=[20,50,100],[so]=io,co=Y(no),uo={showTransitiveMatches:!0,showInactiveEntities:!1},po=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const a=ao(),[s,c]=ge(co,{order:"asc",field:co[0]},so,uo),{comparisonViewMode:u,isGlobalSpinnerActive:p}=z(),{changeRowsPerPage:h,changePage:f,changeColumns:g,toggleFilters:b,changeFilter:y,setSelectedItems:w,toggleSelect:S,setOptions:R,setLimitSelection:P}=s,{page:T,rowsPerPage:M,visibleColumns:j,filters:N,selectedItems:I,options:A}=c,{uri:D,type:Z}=t||{},B=j.includes("score")?{field:"score",order:"desc"}:{order:"asc",field:co[0]},{matches:V,total:L,entitiesMap:W,loadMatches:_}=(e=>{let{entity:t,filter:n,sorting:r,page:o,rowsPerPage:a,options:i,enabled:s}=e;const{setGlobalSpinner:c}=H(),u=(0,l.useCallback)((()=>{c(!0)}),[c]),p=(0,l.useCallback)((()=>{c(!1)}),[c]),{total:d,matches:m,entitiesMap:h,loadMatches:f}=(0,Gr.s)({enabled:s,entity:t,filter:n,onFinishLoading:p,onStartLoading:u,options:i,page:o,rowsPerPage:a,sorting:r});return{matches:m,total:d,entitiesMap:h,loadMatches:f}})({enabled:!!D,entity:t,filter:"",page:T,sorting:B,rowsPerPage:M,options:A}),U=(0,l.useMemo)((()=>(0,m.NVY)(D,Object.keys(W))),[D,W]),G=(0,Ar.C)({objectIds:U}),{setReloadHandler:q}=k();q((()=>{_(),K()}));const[$,X,Y]=ae({defaultColumnsData:no,additionalColumnsData:oo,metadata:n,entityType:Z});(0,l.useEffect)((()=>{g(Y)}),[Y,g]);const Q=(0,l.useMemo)((()=>j.map((e=>$.find((0,d.propEq)("id",e)))).filter(d.identity)),[j,$]),K=(0,l.useCallback)((()=>{w([])}),[w]),J=(0,l.useCallback)((()=>{w(V)}),[w,V]);(0,C.D)((()=>{f(0),K()}),[D,A]),Rr(u,P);const ee=u===v,te=u===E,ne={entity:t,metadata:n,selectedItems:I||[],columnsData:X,config:r,selectedColumns:j,onChangeColumns:g,entitiesMap:W,controlsRenderer:Jr},{showDialog:re,openAddRelationDialog:oe,AddRelationDialogRenderer:le}=Ur(r),ie=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canAddRelation:u,canMark:p}=(0,m.hXd)(n,r,o.object,t,o.matchRules),h=[o.object],f=[...h,t].some(m.biM),g=[{ActionButton:xe,show:c,props:{entity:t,entities:h}},{ActionButton:Ie,show:p,props:{entity:t,entities:h}},{ActionButton:ke,show:!f,props:{entity:t,entities:h}},{ActionButton:je,show:u&&!f,props:{mainEntity:t,currentEntity:o.object,matchRules:o.matchRules,onClick:oe}}].filter((0,d.prop)("show"));return i().createElement(Qr,{actions:g,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,r,n,oe]),se=(0,l.useRef)(null);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:W},ee?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:S},i().createElement(an,lo({},ne,{classes:{root:a.fullScreen}})))):i().createElement("div",{className:a.matchesView},I&&I.length>0?i().createElement(vr,{selectedItems:I},i().createElement(to,{matches:I,entity:t,metadata:n,config:r})):i().createElement(gr,{total:L,columnsData:X,selectedColumns:j,onChangeColumns:g,filtersEnabled:!!N,onToggleFilters:b,options:A,optionsData:(0,m.biM)(t)?void 0:ro,onChangeOptions:R}),i().createElement("div",{className:a.mainArea},i().createElement("div",{className:a.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:Q,matches:V,selected:I||[],onToggleSelect:S,onResetSelect:K,onSelectAll:J,filters:N,onFilter:y,entitiesMap:W,actionButtonsRenderer:ie,basicTableRef:se,isComparisonViewShown:te}),i().createElement(x.Z,{rowsPerPageOptions:te?[]:io,count:L,page:T,onChangePage:f,rowsPerPage:M,onChangeRowsPerPage:h,basicTableRef:se}),p&&i().createElement(O.Z,null)),te&&i().createElement(F.Provider,{value:S},i().createElement(an,lo({},ne,{classes:{root:a.comparisonView}})))),re&&i().createElement(le,null))))}));po.displayName="MatchesView",po.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};var mo=n(20449);const ho=e=>{let{value:{show:t,entity:n,entities:r,permission:o}}=e;const a=qe(),{canMerge:l,canMark:s}=o,c=[...r,n].some(m.biM),u=[{ActionButton:Ue,show:s,props:{entity:n,entities:r}},{ActionButton:ke,show:!c,props:{entity:n,entities:r}}].filter((0,d.prop)("show"));return t?i().createElement(i().Fragment,null,i().createElement("div",{className:a.container},l&&i().createElement(xe,{entity:n,entities:r,className:a.mergeButton,mode:"button"}),i().createElement(Qr,{actions:u,numberOfButtons:1,classes:{actionButton:a.rightButton,moreOptions:a.moreOptions}}))):null};ho.propTypes=$e;const fo=ho,go=(0,d.map)((0,d.prop)("object")),bo=e=>{let{entity:t,matches:n,metadata:r,config:o}=e;const a=wr(),s=go(n),{canMerge:c,canMark:u}=(0,m.OCS)(r,o,t,n),p=[...s,t].some(m.biM),h=(0,l.useMemo)((()=>[{ActionButton:xe,show:c,props:{entity:t,entities:s}},{ActionButton:Ue,show:u,props:{entity:t,entities:s}},{ActionButton:ke,show:!p,props:{entity:t,entities:s}}].filter((0,d.prop)("show"))),[u,c,s,t,p]);return i().createElement("div",{className:a.actions},i().createElement(Qr,{actions:h,numberOfButtons:2,classes:{actionButton:a.button}}),i().createElement(sr.Z,{height:28,margin:10}),i().createElement(Fe,{selectedMatchesCount:n.length}))};bo.propTypes={entity:m.pyR,matches:a().arrayOf(a().object),metadata:m.pGS,config:m.yxQ};const yo=[{id:"label",get label(){return q().text("Profile name")},dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,initialWidth:280,autoResize:!1},{id:"id",get label(){return q().text("Entity ID")},dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1}],vo=[{id:"showInactiveEntities",get label(){return q().text("Include entities that have ended")}}],wo=(0,Le.Z)((e=>({tableView:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},matchesView:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},mainArea:{flex:1,display:"flex",flexDirection:"row",overflow:"hidden"},comparisonView:{width:"calc(100% - 280px)"},fullScreen:{height:"100%",zIndex:"200"}})));function Eo(){return Eo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eo.apply(this,arguments)}const Co=[20,50,100],[xo]=Co,Oo=Y(yo),So={showInactiveEntities:!1},Ro=(0,l.memo)((e=>{let{entity:t,metadata:n,config:r,fullScreenContainer:o}=e;const{comparisonViewMode:a,isGlobalSpinnerActive:s}=z(),c=wo(),[u,h]=ge(Oo,{order:"asc",field:Oo[0]},xo,So),{changeRowsPerPage:f,changePage:g,changeColumns:b,toggleFilters:y,changeFilter:w,setSelectedItems:S,toggleSelect:R,setOptions:P,setLimitSelection:T}=u,{page:M,rowsPerPage:j,visibleColumns:N,filters:I,selectedItems:A,options:D}=h,{uri:Z,type:B}=t||{},{matches:V,total:L,entitiesMap:W,loadNotMatches:_}=(e=>{let{entityUri:t,filter:n,sorting:r,page:o,rowsPerPage:a,options:i,enabled:s}=e;const{order:c,field:u}=r||{},{setGlobalSpinner:d}=H(),[h,f]=(0,l.useState)(0),[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)({}),w=(0,p.useSelector)(Se.ZP.selectors.getTenant),E=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),C=(0,p.useSelector)(Se.ZP.selectors.getDataTenants),x=(0,l.useMemo)((()=>({dtssPath:E,dataTenants:C,entity:{uri:t},customerTenant:w,dtssRequest:m.WSA})),[E,C,t,w]),O=(0,l.useCallback)((0,m.U_T)(x,m.pg),[x]),S=(0,mo.a)(O),R=(0,oe._)(),P=(0,l.useCallback)((e=>{s&&(d(!0),R(S({entityUri:t,offset:o*a,max:a,filter:n,sort:u,force:e,order:c,activeness:i.showInactiveEntities?m.YJ7.ALL:m.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:n,originalResponse:r}=e;f(n),b(t),t.map((e=>{let{uri:t}=e;return t})).length>0&&v((0,m.KPC)(r))})).finally((e=>d(!1))))}),[t,n,u,c,o,a,i,s]);return(0,l.useEffect)((()=>{P()}),[P]),{matches:g,total:h,entitiesMap:y,loadNotMatches:(0,l.useCallback)((()=>{P(!0)}),[P])}})({enabled:!!Z,entityUri:Z,filter:"",page:M,rowsPerPage:j,options:D}),U=(0,l.useMemo)((()=>(0,m.NVY)(Z,Object.keys(W))),[Z,W]),G=(0,Ar.C)({objectIds:U}),{setReloadHandler:q}=k();q((()=>{_(),K()}));const[$,X,Y]=ae({defaultColumnsData:yo,metadata:n,entityType:B});(0,l.useEffect)((()=>{b(Y)}),[Y,b]);const Q=(0,l.useMemo)((()=>N.map((e=>$.find((0,d.propEq)("id",e)))).filter(d.identity)),[N,$]),K=(0,l.useCallback)((()=>{S([])}),[S]),J=(0,l.useCallback)((()=>{S(V)}),[S,V]);(0,C.D)((()=>{g(0),K()}),[Z,D]),Rr(a,T);const ee=a===v,te=a===E,ne={entity:t,metadata:n,selectedItems:A||[],columnsData:X,config:r,selectedColumns:N,onChangeColumns:b,controlsRenderer:fo},re=(0,l.useCallback)((e=>{let{hoveredMatch:o,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canMark:u}=(0,m.hXd)(n,r,o.object,t,o.matchRules),p=[o.object],h=[...p,t].some(m.biM),f=[{ActionButton:xe,show:c,props:{entity:t,entities:p}},{ActionButton:Ue,show:u,props:{entity:t,entities:p}},{ActionButton:ke,show:!h,props:{entity:t,entities:p}}].filter((0,d.prop)("show"));return i().createElement(Qr,{actions:f,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,r,n]),le=(0,l.useRef)(null);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:W},ee?i().createElement(ln,{fullScreenContainer:o},i().createElement(F.Provider,{value:R},i().createElement(an,Eo({},ne,{classes:{root:c.fullScreen}})))):i().createElement("div",{className:c.matchesView},A&&A.length>0?i().createElement(vr,{selectedItems:A},i().createElement(bo,{matches:A,entity:t,metadata:n,config:r})):i().createElement(gr,{total:L,columnsData:X,selectedColumns:N,onChangeColumns:b,filtersEnabled:!!I,onToggleFilters:y,options:D,optionsData:vo,onChangeOptions:P}),i().createElement("div",{className:c.mainArea},i().createElement("div",{className:c.tableView},i().createElement(ar,{entity:t,metadata:n,columnsData:Q,matches:V,selected:A||[],onToggleSelect:R,onResetSelect:K,onSelectAll:J,filters:I,onFilter:w,actionButtonsRenderer:re,basicTableRef:le,isComparisonViewShown:te}),i().createElement(x.Z,{rowsPerPageOptions:te?[]:Co,count:L,page:M,onChangePage:g,rowsPerPage:j,onChangeRowsPerPage:f,basicTableRef:le}),s&&i().createElement(O.Z,null)),te&&i().createElement(F.Provider,{value:R},i().createElement(an,Eo({},ne,{classes:{root:c.comparisonView}})))))))}));Ro.displayName="NotMatchView",Ro.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,fullScreenContainer:a().instanceOf(Element)};const Po=e=>{let{entity:t,metadata:n,config:r,activeView:o,fullScreenContainer:a}=e;const l=(0,f.U)();let s;switch(o){case y.POTENTIAL_MATCHES:s=i().createElement(po,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;case y.FIND_MATCHES:s=i().createElement(Ir,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;case y.NOT_A_MATCH:s=i().createElement(Ro,{entity:t,metadata:n,config:r,fullScreenContainer:a});break;default:s=i().createElement("div",null)}return i().createElement(g.s.Provider,{value:l},i().createElement(b.l,null,i().createElement(P,null,s)))};Po.propTypes={entity:m.pyR,metadata:m.pGS,config:m.yxQ,activeView:a().string,fullScreenContainer:a().instanceOf(Element)};const ko=e=>{let{availableTabs:t=[y.POTENTIAL_MATCHES,y.FIND_MATCHES,y.NOT_A_MATCH],activeTab:n,onChange:r}=e;const o={[y.POTENTIAL_MATCHES]:(0,G.text)("POTENTIAL MATCHES"),[y.FIND_MATCHES]:(0,G.text)("FIND MATCHES"),[y.NOT_A_MATCH]:(0,G.text)("NOT A MATCH")};return i().createElement(Lt.Tabs,{value:n,onChange:r,indicatorColor:"primary",textColor:"primary",scrollButtons:"on"},t.map((e=>i().createElement(Lt.Tab,{key:e,label:o[e],value:e,classes:{}}))))};ko.propTypes={availableTabs:a().arrayOf(a().string),activeTab:a().string,onChange:a().func};const To=(0,Le.Z)((e=>({basicView:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",position:"absolute",top:0,bottom:0,left:0,right:0},content:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),Mo=(0,l.memo)((e=>{let{config:t,entity:n,metadata:r,getSavedState:o,saveState:a}=e;const s=To(),c=(0,m.biM)(n)?[y.POTENTIAL_MATCHES]:t.availableTabs,[u,p]=(0,l.useState)(y.POTENTIAL_MATCHES),[d,f]=(0,l.useState)();return i().createElement(h.Z,{ref:f,className:s.basicView},i().createElement("div",{className:s.content},i().createElement(ko,{activeTab:u,availableTabs:c,onChange:(e,t)=>p(t)}),i().createElement(Po,{fullScreenContainer:d,entity:n,metadata:r,config:t,activeView:u})))}));Mo.displayName="PotentialMatchesView",Mo.propTypes={config:m.yxQ,entity:m.pyR,metadata:m.pGS,dispatch:a().func,getSavedState:a().func,saveState:a().func};const jo=(0,p.connect)((e=>({entity:Se.ZP.selectors.getEntity(e),metadata:Se.ZP.selectors.getMetadata(e)})))((e=>i().createElement(L,null,i().createElement(Mo,e))));var No=n(24605),Io=n(60641),Ao=n(97094),Do=n(64459),Zo=n(19603),Bo=n(93873);const Vo=(0,Le.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),Lo=(0,l.memo)((e=>{let{className:t}=e;const n=Vo(),r=(0,p.useSelector)(Se.ZP.selectors.getEntity),o=(0,p.useSelector)(Se.ZP.selectors.getEntityUriWithDataTenant);return i().createElement(Do.Z,{className:De()(t,Zo.U),entity:r},i().createElement(Lt.Box,{display:"flex",alignItems:"center"},i().createElement(Lt.Box,{mr:3},i().createElement(Bo.a,null))),i().createElement(Lt.Box,{className:n.comments},i().createElement(un.Z,{uri:o,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:o}),objectType:m.q7e.ENTITY})))}));Lo.displayName="PotentialMatchesProfileBand";var zo=n(63172),Ho=n(52043),Fo=n(39827);function Wo(){return Wo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wo.apply(this,arguments)}const _o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Wo({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M20 4v14h2V4c0-1.1-.9-2-2-2H6v2h14zM2 20c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12z",fill:"currentColor"}))};function Uo(){return Uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uo.apply(this,arguments)}const Go=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Uo({width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M10 12a4 4 0 100-8 4 4 0 000 8zM10.35 14.01C7.62 13.91 2 15.27 2 18v2h9.54c-2.47-2.76-1.23-5.89-1.19-5.99zM19.43 18.02c.36-.59.57-1.28.57-2.02 0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4c.74 0 1.43-.22 2.02-.57L20.59 22 22 20.59l-2.57-2.57zM16 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",fill:"currentColor"}))};function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qo.apply(this,arguments)}const $o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",qo({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 20h15.002L21 23l1.27-1.27-20-20.01L1 2.99l6.172 6.175a4.007 4.007 0 002.66 2.662l2.23 2.23A10.754 10.754 0 0011 14c-2.67 0-8 1.34-8 4v2zm8-16a3.987 3.987 0 00-2.795 1.137l5.656 5.659A3.999 3.999 0 0011 4z",fill:"#000",fillOpacity:".54"}))};let Xo,Yo;var Qo;!function(e){e[e.PotentialMatches=0]="PotentialMatches",e[e.FindMatches=1]="FindMatches",e[e.NotAMatch=2]="NotAMatch"}(Xo||(Xo={})),(Qo=Yo||(Yo={})).TABLE="TABLE",Qo.COLUMNS="COLUMNS";const Ko=(0,l.createContext)({reloadData:()=>{},setReloadHandler:()=>{}}),Jo=(()=>{let e;return{reloadData:()=>{e&&e()},setReloadHandler:t=>{e=t}}})(),ea=e=>{let{children:t}=e;return i().createElement(Ko.Provider,{value:Jo},t)},ta=()=>{const e=(0,l.useContext)(Ko);if(void 0===e)throw new Error("useReloadData must be used within a ReloadDataProvider");return e},na=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const o=ra(e,t,n,r),a=(t.children||[]).map((n=>na(e,n,"",r.concat({name:t.name,label:t.label}))));return a.length&&(o.children=a,o.notSelectable=!0),o},ra=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const o=(0,d.omit)(["children"],t),a=o.label||o.name;return{title:a,fieldName:n||(0,m.Tde)(o.uri,r)}},oa=(e,t)=>t?(0,m.k66)(e,t).map((t=>na(e,t))):[],aa=(0,d.pipe)((0,d.map)((e=>({id:(0,m.Tde)(e.uri),label:(0,m.idV)(e.label),dataTypeDefinition:(0,m.PFL)(e)})))),la=(0,d.pipe)(m.Fof,aa),ia=(0,d.pluck)("id"),sa=(0,d.curry)(((e,t)=>e.map((e=>(0,m.Tde)(e))).some((e=>t.id===e||ua(t)&&pa(t,e))))),ca=e=>(0,m.QZu)(e.dataTypeDefinition),ua=e=>(0,m.YkG)(e.dataTypeDefinition),pa=(0,d.curry)(((e,t)=>t.startsWith(`${e.id}.`))),da=(0,d.curry)(((e,t)=>ca(t)&&e.some((e=>{let{id:n}=e;return pa(t,n)})))),ma=e=>(0,d.either)((0,d.includes)(d.__,e),da(e)),ha=(e,t)=>(0,d.pipe)((0,d.reject)(ca),(0,d.filter)(sa(e)))(t);function fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ga(e,t,n[t])}))}return e}function ga(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ba=(0,l.createContext)(null),ya=(0,l.createContext)(null),va="SET_GLOBAL_SPINNER",wa="SET_SELECTED_ITEMS",Ea="TOGGLE_SELECT",Ca="SET_LIMIT_SELECTION",xa="SET_COMPARISON_VIEW_MODE",Oa="SET_ENTITIES_MAP",Sa="DELETE_EXTRA_MATCHES",Ra={setGlobalSpinner:(0,T.zD)(va),setSelectedItems:(0,T.zD)(wa),toggleSelect:(0,T.zD)(Ea),setLimitSelection:(0,T.zD)(Ca),setComparisonViewMode:(0,T.zD)(xa),setEntitiesMap:(0,T.zD)(Oa),deleteExtraMatches:(0,T.zD)(Sa)},Pa=(e,t)=>{switch(t.type){case va:return fa({},e,{isGlobalSpinnerActive:t.payload});case Sa:return fa({},e,{selectedItems:e.selectedItems.slice(0,e.limitSelection)});case wa:return fa({},e,{selectedItems:t.payload.slice(0,e.limitSelection)});case Ea:return(0,d.evolve)({selectedItems:n=>{const r=t.payload,o=n.findIndex((e=>{var t,n;return(null==e||null===(t=e.object)||void 0===t?void 0:t.uri)===(null==r||null===(n=r.object)||void 0===n?void 0:n.uri)}));if(o>-1)return(0,d.remove)(o,1,n);{const{limitSelection:t}=e;return e.tableViewModeAvailable?(0,d.append)(r,n):(0,d.pipe)((0,d.when)((0,d.both)((0,d.complement)(d.isNil),(0,d.propSatisfies)((0,d.gte)(d.__,t),"length")),(0,d.take)(t-1)),(0,d.append)(r))(n)}}},e);case Ca:return fa({},e,{limitSelection:t.payload});case xa:{const n=t.payload;return fa({},e,{comparisonViewMode:n,limitSelection:n===Yo.COLUMNS?4:void 0})}case Oa:{const n=t.payload;return fa({},e,{entitiesMap:n})}}},ka=e=>{let{children:t,tableViewModeAvailable:n}=e;const[r,o]=(0,l.useReducer)(Pa,{isGlobalSpinnerActive:!1,selectedItems:[],comparisonViewMode:Yo.COLUMNS,limitSelection:4,entitiesMap:{},tableViewModeAvailable:n}),a=(0,M.o)({actions:Ra,dispatch:o});return i().createElement(ba.Provider,{value:r},i().createElement(ya.Provider,{value:a},t))},Ta=()=>{const e=(0,l.useContext)(ba);if(void 0===e)throw new Error("useViewState must be used within a ViewStateProvider");return e},Ma=()=>{const e=(0,l.useContext)(ya);if(void 0===e)throw new Error("useViewStateActions must be used within a ViewStateProvider");return e};function ja(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Na(e,t,n[t])}))}return e}function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Aa(e,t,n[t])}))}return e}function Aa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Da="RESET",Za="SET_OPTIONS",Ba=Ia({},le.ZP.actions,{reset:(0,T.zD)(Da),setOptions:(0,T.zD)(Za)}),Va=(e,t)=>{switch(t.type){case Da:return Ia({},t.payload);case Za:return Ia({},e,{options:t.payload});default:return le.ZP.reducer(e,t)}};function La(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){za(e,t,n[t])}))}return e}function za(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ha=(e,t)=>{const{field:n,order:r}=e,o={sorting:{field:n,order:r},page:0,rowsPerPage:t,selectedItems:[],limitSelection:null},[a,i]=(0,l.useReducer)(Va,o),s=(0,M.o)({actions:Ba,dispatch:i}),c=Ma(),u=Ta();return[La({},s,c),La({},a,u),i]},Fa=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:q().text("Can't add relationship")})},Wa=e=>{console.error(e),ye.Z.addError({title:q().text("Error"),message:(null==e?void 0:e.errorMessage)||q().text("Something went wrong...")})},_a=e=>{(null==e?void 0:e.errorCode)!==m.Xt7.DCR_ALREADY_EXISTS&&Wa(e)},Ua=()=>{const{setGlobalSpinner:e}=Ma(),{isGlobalSpinnerActive:t}=Ta(),{reloadData:n}=ta();return{onStartRequest:(0,l.useCallback)((()=>{e(!0)}),[e]),onFinishRequest:(0,l.useCallback)((()=>{e(!1),n()}),[n,e]),isGlobalSpinnerActive:t}},Ga=(e,t)=>e.filter((e=>{let{object:n}=e;return!t.some((e=>{let{uri:t}=e;return t===n.uri}))}));function qa(){return qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qa.apply(this,arguments)}const $a=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,size:l,onMenuClose:s=T.ZT}=e;const{isGlobalSpinnerActive:c,onFinishRequest:u,onStartRequest:p}=Ua(),{selectedItems:d}=Ta(),{setSelectedItems:m}=Ma();return i().createElement(be.H,qa({className:n,disabled:c,entities:r,entity:o,mode:a},l?{size:l}:{},{onMenuClose:s,onStartRequest:p,onFinishRequest:u,onSuccess:()=>{m(Ga(d,r))},onError:Wa,"data-reltio-id":"reltio-potential-matches-merge-button",ref:t}))}));function Xa(){return Xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}$a.displayName="mergeButton";const Ya=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,size:l,onMenuClose:s=T.ZT}=e;const{isGlobalSpinnerActive:c,onFinishRequest:u,onStartRequest:p}=Ua(),{selectedItems:d}=Ta(),{setSelectedItems:m}=Ma();return i().createElement(Ne.i,Xa({className:n,disabled:c,entities:r,entity:o,mode:a},l?{size:l}:{},{onMenuClose:s,onStartRequest:p,onFinishRequest:u,onSuccess:()=>{m(Ga(d,r))},ref:t}))}));function Qa(){return Qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qa.apply(this,arguments)}Ya.displayName="NotMatchButton";const Ka=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Qa({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{d:"M9 4c4.42 0 8 3.58 8 8s-3.58 8-8 8a8 8 0 01-7.419-5h2.224A6.002 6.002 0 009 18c3.31 0 6-2.69 6-6s-2.69-6-6-6a6.002 6.002 0 00-5.196 3H1.581A8 8 0 019 4zm8 .26c3.45.89 6 4.01 6 7.74 0 3.73-2.55 6.85-6 7.74v-2.09a5.99 5.99 0 000-11.3V4.26zM8 7.5l4.5 4.5L8 16.5V13H0v-2h8V7.5z",fillOpacity:".541"}))},Ja=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const{setSelectedItems:c}=Ma(),{selectedItems:u}=Ta(),[p,d]=(e=>{let{entities:t,entity:n,onSuccess:r}=e;const{setGlobalSpinner:o}=Ma(),{isGlobalSpinnerActive:a}=Ta(),{reloadData:i}=ta();return[a,(0,l.useCallback)((()=>{o(!0),(0,m.ck9)(n.uri,t).then((()=>{null==r||r()})).finally((()=>{o(!1),i()}))}),[t,n,o,i,r])]})({entity:n,entities:r,onSuccess:()=>{c(Ga(u,r))}});return i().createElement(Oe.K,{className:o,disabled:p,mode:a,label:q().text("Save on potential matches"),icon:Ka,onClick:d,onMenuClose:s,ref:t})}));function el(){return el=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},el.apply(this,arguments)}Ja.displayName="SetAMatchButton";const tl=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",el({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M10 6v2H4v12.22h12V14h2v6c0 1.05-.82 1.918-1.851 1.994L16 22H4c-1.05 0-1.918-.82-1.994-1.851L2 20V8c0-1.05.82-1.918 1.851-1.994L4 6h6zm4 10v2H6v-2h8zm-3.997-3l-.001 2H6v-2h4.003zM21 2c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1h-7l-2 2 .005-11c0-.55.445-1 .995-1h8zm-10.996 8l-.001 2H6v-2h4.004zm9.286-6.3l-3.17 3.17-1.41-1.42-1.41 1.41 2.82 2.84 4.59-4.58-1.42-1.42z",id:"svg2465811894a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2465811894b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2465811894a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2465811894b)",d:"M0 0h24v24H0z"})))},nl=(0,l.forwardRef)(((e,t)=>{let{className:n,entities:r,entity:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const c=(0,l.useContext)(Ao.S),[u,h]=(e=>{let{entities:t,entity:n,showSnackbarMessage:r}=e;const{selectors:o}=Se.ZP,{setGlobalSpinner:a}=Ma(),{isGlobalSpinnerActive:i}=Ta(),s=(0,p.useSelector)(o.getWorkflowPath),c=(0,p.useSelector)(o.getWorkflowEnvironmentUrl),u=(0,p.useSelector)(o.getTenant),h=(0,d.prop)("uri"),f=(0,d.pipe)(d.concat,(0,d.map)(h))([n],t);return[i,(0,l.useCallback)((()=>{a(!0),(0,m.t6d)({workflowPath:s,processType:"potentialMatchReview",objectURIs:f,tenant:u,environment:c}).then((()=>{null==r||r(q().text("Potential match request: Done"))})).catch(_a).finally((()=>{a(!1)}))}),[a,s,f,u,c,r])]})({entity:o,entities:r,showSnackbarMessage:c}),f=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),g=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath);return f&&!(0,m.O27)(g)?i().createElement(Oe.K,{className:n,disabled:u,mode:a,label:u?"":q().text("Potential match request"),icon:tl,onClick:h,onMenuClose:s,ref:t}):null}));nl.displayName="DCRReviewButton";const rl=(0,l.forwardRef)(((e,t)=>{let{entity:n,entities:r,className:o,mode:a=Oe.N.iconButton,onMenuClose:s=T.ZT}=e;const{selectedItems:c}=Ta(),{setSelectedItems:u}=Ma(),d=(0,l.useContext)(Ao.S),[h,f]=(e=>{let{entities:t,entity:n,showSnackbarMessage:r,onSuccess:o}=e;const{setGlobalSpinner:a}=Ma(),{isGlobalSpinnerActive:i}=Ta(),{reloadData:s}=ta(),c=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),u=(0,p.useSelector)(Se.ZP.selectors.getTenant);return[i,(0,l.useCallback)((()=>{a(!0);const e={dtssPath:c,customerTenant:u,entity:n,entities:t};((0,m.biM)(n)?(0,m.XkY)(e):(0,m.uQS)(e)).then((()=>{null==r||r(q().text("Save as potential match: Done")),null==o||o()})).finally((()=>{a(!1),s()}))}),[a,c,u,n,t,r,s,o])]})({entity:n,entities:r,showSnackbarMessage:d,onSuccess:()=>{u(Ga(c,r))}});return i().createElement(Oe.K,{className:o,disabled:h,mode:a,label:q().text("Save as potential match"),icon:Ka,onClick:f,onMenuClose:s,ref:t})}));function ol(){return ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}rl.displayName="ReinstateMatchButton";const al=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",ol({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),i().createElement("defs",null,i().createElement("path",{d:"M19 14v3h3v2h-3v3h-2v-3h-3v-2l3-.001V14h2zM17 2a3 3 0 11-1.293 5.708l-4.535 4.535a5 5 0 11-1.414-1.414l4.534-4.536A3 3 0 0117 2zM7 12a3 3 0 100 6 3 3 0 000-6zm10-8a1 1 0 100 2 1 1 0 000-2z",id:"svg2904917532a"})),i().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i().createElement("mask",{id:"svg2904917532b",fill:"#fff"},i().createElement("use",{xlinkHref:"#svg2904917532a"})),i().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2904917532b)",d:"M0 0h24v24H0z"})))},ll=(0,l.forwardRef)(((e,t)=>{let{className:n,mainEntity:r,currentEntity:o,matchRules:a,mode:l=Oe.N.iconButton,onClick:s=T.ZT,onMenuClose:c=T.ZT}=e;return i().createElement(Oe.K,{className:n,mode:l,label:q().text("Add relationship"),icon:al,onClick:()=>s({mainEntity:r,currentEntity:o,matchRules:a}),onMenuClose:c,ref:t})}));ll.displayName="CreateRelationButton";var il=n(17308);const sl=i().createContext({onClose:()=>{}});var cl=n(99757);const ul=(0,Le.Z)((()=>({attributeSelect:{width:"100%",height:"40px"}}))),pl=(0,l.memo)((e=>{let{onChange:t,options:n,sortField:r}=e;const o=ul(),a=(0,l.useMemo)((()=>{const e=r.split("."),t=e.length,o=n=>{const a=n[0].fieldName.split(".").length;if(a===t)return n.find((e=>e.fieldName===r));if(a<t){var l;const t=e.slice(0,a).join("."),r=null===(l=n.find((e=>e.fieldName===t)))||void 0===l?void 0:l.children;if(r)return o(r)}};for(const e of n){const t=o(e.attributes);if(t)return t}}),[r,n]),s=(0,l.useCallback)((e=>{t(e.attribute.fieldName)}),[t]);return i().createElement(cl.Z,{hideCheckBox:!0,className:o.attributeSelect,value:a,itemsGroups:n,onSelect:s,ungroup:!0,single:!0})}));var dl=n(90324);const ml=(0,Le.Z)((()=>({rowCheckbox:{marginRight:"20px",height:"24px",position:"relative",padding:"12px"},header:{padding:"8px 12px 8px 0",border:"rgba(0,0,0,0.05) 1px solid",borderTop:0,display:"flex",justifyContent:"space-between"},selector:{width:"160px"},sorting:{display:"flex"},arrow:{transition:"transform 0.3s ease-in"},rotate:{transform:"rotate(180deg)"}})));function hl(){return hl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hl.apply(this,arguments)}const fl=e=>{let{selectedCount:t,totalCount:n,onSelect:r,sortOptions:o,toggleSort:a,sorting:s,totalOnPage:c,children:u}=e;const p=ml(),d=(0,l.useContext)(sl);return i().createElement(i().Fragment,null,i().createElement(il.P,hl({},d,{secondTitle:!!n&&q().text("${n} Profiles",{n})})),u,!!c&&i().createElement("div",{className:p.header},i().createElement(Lt.Checkbox,{className:p.rowCheckbox,checked:t===c,indeterminate:t>0&&t<c,onChange:r}),i().createElement("div",{className:p.sorting},i().createElement(pl,{sortField:s.field,options:o,onChange:a}),i().createElement(Lt.IconButton,{onClick:()=>a(s.field),classes:{root:De()(p.arrow,{[p.rotate]:"desc"===s.order})}},i().createElement(dl.Z,null)))))},gl=[{id:"label",get label(){return q().text("Profile name")}},{id:"id",get label(){return q().text("Entity ID")}}],bl=(e,t,n,r)=>(0,l.useMemo)((()=>{const o=((e,t)=>[{title:"",attributes:oa(e,(0,m.nt9)(e,t))}])(n,r);return[{title:"",attributes:e.concat(t||[]).map((e=>({title:e.label,fieldName:e.id})))},...o]}),[n,r,e,t]);var yl=n(77245);const vl=(0,Le.Z)((e=>({hidden:{visibility:"hidden"},rowCheckbox:{marginLeft:"-9px",marginRight:"19px",height:"24px",position:"relative",padding:"9px"},entity:{paddingTop:"12px",paddingBottom:"8px",overflow:"hidden",textOverflow:"ellipsis"},actions:{marginLeft:"auto",marginRight:0,paddingTop:"15px",display:"flex"},actionButtons:{display:"none"},active:{display:"flex"},wrapper:{position:"relative",whiteSpace:"pre",padding:"0 15px 0 15px",color:"rgba(0,0,0,0.87)","&::after":{content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none"},"&:hover":{backgroundColor:"rgba(0,0,0,0.04)","& $actionButtons":{display:"flex"},"& $commentsContainer":{borderLeft:"1px solid rgba(0,0,0,0.12)"}},display:"flex",boxSizing:"border-box",borderBottom:"1px rgba(0,0,0,0.05) solid",paddingLeft:"12px"},entityLabel:{color:e.palette.primary.main,cursor:"pointer",textDecoration:"none",fontWeight:500},matchRulesWrapper:{padding:"12px 15px 4px 10px",display:"flex",alignItems:"center",boxSizing:"border-box"},selectedRow:{backgroundColor:"rgba(0, 114, 206, 0.12)"},matchScore:{borderLeft:"rgba(0,0,0,0.12) 1px solid",paddingLeft:"12px",height:"20px",marginLeft:"20px",color:"rgba(0,0,0,0.54)"},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",height:"24px",marginLeft:"6px"},border:{borderLeft:"1px solid rgba(0,0,0,0.12)"},rightButton:{marginLeft:"8px"}}))),wl=(0,l.memo)((e=>{let{rowIndex:t,match:n,toggleSelect:r,entityToMatch:o,isRowSelected:a,actionButtonsRenderer:s,metadata:c,entitiesMap:u={}}=e;const p=vl(),d=n.object,[h,f]=(0,l.useState)(!1),g=d!==o,b=s;return i().createElement("div",{className:De()(p.wrapper,Zo.U,{[p.selectedRow]:a})},i().createElement(Lt.Checkbox,{className:De()(p.rowCheckbox,{[p.hidden]:!g}),checked:a,onChange:()=>r(n),"data-reltio-id":`reltio-matches-table-checkbox-${t}`}),i().createElement("div",{className:p.entity},i().createElement(kn.Z,{value:(0,m.wwR)(d),className:p.entityLabel},(0,m.idV)(d.label)),i().createElement("div",{className:p.matchRulesWrapper},i().createElement(ft.Z,{entitiesMap:u,entity:d,match:n,metadata:c,variant:yl.g.excludeNotMatch}),!!n.matchScore&&i().createElement("div",{className:p.matchScore},n.matchScore))),i().createElement("div",{className:p.actions},i().createElement("div",{className:De()(p.actionButtons,{[p.active]:h})},i().createElement(b,{buttonClassName:p.rightButton,hoveredMatch:n,onActionsMenuOpen:()=>f(!0),onActionsMenuClose:()=>f(!1)})),o&&i().createElement(un.Z,{className:De()(p.commentsContainer,{[p.border]:h}),uri:(0,m.E_P)(o.uri,n.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:o.uri,matchEntityUri:n.object.uri}),allowOnlyOneComment:!0,showAlways:h})))})),El=(0,Le.Z)((()=>({view:{position:"relative",flex:1,display:"flex",flexDirection:"column",overflowY:"auto",overflowX:"hidden"}}))),Cl=e=>{let{entityToMatch:t,matches:n,toggleSelect:r,actionButtonsRenderer:o,metadata:a,entitiesMap:l,selectedItems:s}=e;const c=El();return i().createElement("div",{className:c.view},n.map(((e,c)=>i().createElement(wl,{key:e.object.uri,rowIndex:c,match:e,entityToMatch:t,toggleSelect:r,actionButtonsRenderer:o,matches:n,matchRules:e.matchRules,metadata:a,entitiesMap:l,isRowSelected:s.some((t=>t.object.uri===e.object.uri))}))))};var xl=n(95474),Ol=n(94574);const Sl=(0,Le.Z)({root:{display:"flex",padding:"8px 16px",gap:"8px",borderBottom:"rgba(0,0,0,0.05) 1px solid"},inputRoot:{borderRadius:"4px"},menuButtonRoot:{padding:0}}),Rl=(0,l.memo)((e=>{let{onSearch:t,searchTenant:n,onChangeSearchTenant:r,entityTypeUri:o}=e;const a=Sl(),s=(0,l.useRef)(),[c,u]=(0,l.useState)(""),p=(0,l.useCallback)((0,d.when)((0,d.propEq)("key","Enter"),(0,d.pipe)((0,d.always)(c),d.trim,t)),[c,t]),m=(0,l.useCallback)((e=>{u(e),(0,d.isEmpty)(e)&&document.activeElement!==s.current&&t(e)}),[t]);return t?i().createElement("div",{className:a.root},i().createElement(xl.H,{entityTypeUri:o,selectedTenant:n,onChangeTenant:r}),i().createElement(Ol.Z,{classes:{root:a.inputRoot},inputRef:s,fullWidth:!0,height:40,autofocus:!1,value:c,onSearch:m,onKeyPress:p})):null})),Pl=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),kl=[20,50,100],[Tl]=kl,Ml=ia(gl),[jl]=Ml,Nl=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=Pl(),[s,c]=Ha({order:"asc",field:jl},Tl),{changeRowsPerPage:u,changePage:h,toggleSort:f,setSelectedItems:g,toggleSelect:b}=s,{sorting:y,page:v,rowsPerPage:w,selectedItems:E,isGlobalSpinnerActive:S}=c,{uri:R,type:P}=t||{},k=(0,p.useSelector)(Se.ZP.selectors.getTenantObject),[T,M]=(0,l.useState)(""),[j,N]=(0,l.useState)(k),I=(0,l.useMemo)((()=>[(0,d.isEmpty)(T)?null:{filter:"containsWordStartingWith",fieldName:"attributes",values:[T]},{filter:"equals",fieldName:"type",values:[P]},{filter:"not equals",fieldName:"uri",values:[R]},...r].filter(d.identity)),[P,R,T,r]),A=bl(gl,[],n,P),{entities:D,total:Z,findEntities:B}=(e=>{let{entityType:t,filters:n,sorting:r,page:o,rowsPerPage:a,enabled:i,searchTenantId:s}=e;const{order:c,field:u}=r,h=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),f=(0,p.useSelector)(Se.ZP.selectors.getTenantObject),{setGlobalSpinner:g}=Ma(),{activityFilter:b,globalFilter:y}=(0,p.useSelector)(Se.ZP.selectors.getGlobalSearchRequestOptions)||{},[v,w]=(0,l.useState)(0),[E,C]=(0,l.useState)([]),x=(0,oe._)(),O=["uri","label","type","secondaryLabel","attributes","crosswalks"],S=(0,l.useMemo)((()=>(0,m.Uqd)()(n)),[n]),R=(0,l.useCallback)((()=>{if(i){g(!0);const e=s!==f.id,t={customerTenant:f.id,dataTenant:s,dtssPath:h},r={offset:o*a,max:a,sort:u,order:c,select:O.join(","),globalFilter:y,activityFilter:b},l=e?(0,m.uqV)(ja({filters:n,options:r},t)).then((0,d.map)((0,m.E7G)(s))):(0,m.ZOr)(n,r),i={activityFilter:b,globalFilter:y},p=e?(0,m.J$m)(ja({filters:n,options:i},t)):(0,m.j_Q)(n,i);x(Promise.all([l,p])).then((e=>{const[t,n]=e,{total:r}=n;C(t.map((e=>({object:e})))),w(r)})).finally((()=>g(!1)))}}),[t,S,u,c,o,a,i,b,y,s,f]);return(0,l.useEffect)((()=>{R()}),[R]),{entities:E,total:v,findEntities:R}})({enabled:!!R,entityType:P,filters:I,sorting:y,page:v,rowsPerPage:w,searchTenantId:j.id}),{setReloadHandler:V}=ta();V((()=>{B()}));const L=()=>{h(0)},z=(0,l.useCallback)((()=>{g([])}),[g]),H=(0,l.useCallback)((()=>{g(D)}),[g,D]);(0,l.useEffect)((()=>{const e=E.map((e=>D.find((t=>(0,m.ev7)(t)===(0,m.ev7)(e)))||e));g(e)}),[D]),(0,C.D)((()=>{L(),z()}),[R]),(0,C.D)((()=>{L()}),[r,T]);const F=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a}=e;const l=[r.object],{canMark:s}=(0,m.hXd)(n,o,r.object,t,r.matchRules);return s&&i().createElement(Ja,{entity:t,entities:l,className:a})}),[o,t,n]),W=(0,l.useMemo)((()=>D.map((e=>null==E?void 0:E.find((0,d.pathEq)(["object","uri"],e.object.uri)))).filter(d.identity).length),[E,D]);return i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:W,totalCount:Z,totalOnPage:D.length,sortOptions:A,sorting:y,toggleSort:f,onSelect:W?z:H},i().createElement(Rl,{searchTenant:j,onChangeSearchTenant:N,entityTypeUri:P,onSearch:M})),i().createElement(Cl,{entityToMatch:t,toggleSelect:b,actionButtonsRenderer:F,matches:D,metadata:n,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:kl,count:Z,page:v,onChangePage:h,rowsPerPage:w,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null))}));Nl.displayName="FindMatchesView";const Il=e=>{let{entity:t,filter:n,rules:r,sorting:o,page:a,rowsPerPage:i,options:s,enabled:c}=e;const{setGlobalSpinner:u,setEntitiesMap:p}=Ma(),d=(0,l.useCallback)((()=>{u(!0)}),[u]),m=(0,l.useCallback)((()=>{u(!1)}),[u]),{total:h,matches:f,entitiesMap:g,loadMatches:b}=(0,Gr.s)({enabled:c,entity:t,filter:n,rules:r,onFinishLoading:m,onStartLoading:d,options:s,page:a,rowsPerPage:i,sorting:o,markMatchedValues:!0});return(0,l.useEffect)((()=>{p(g)}),[p,g]),{matches:f,total:h,entitiesMap:g,loadMatches:b}};var Al=n(30268);const Dl=(0,Le.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"16px 16px 0"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px"},path:{color:e.palette.text.secondary,fontize:"13px",letterSpacing:0,lineHeight:"15px",padding:"6px 0"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}})));function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Bl(e,t,n[t])}))}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vl=e=>{let{config:t,mainEntity:n,currentEntity:r,matchRules:o,open:a,onClose:s=d.identity}=e;const c=Dl(),u=(0,p.useDispatch)(),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),f=(0,l.useRef)(null),{relation:g={}}=(0,p.useSelector)((e=>Se.ZP.selectors.getRelationToAddByViewId(e,t.id)))||{},{inRelations:b=[],outRelations:y=[]}=(0,l.useMemo)((()=>((e,t,n,r,o)=>{const{isNotDuplicatedInRelation:a,isNotDuplicatedOutRelation:l}=(0,m.xE1)(),i=t=>(0,d.pipe)((0,d.assocPath)(["startObject","objectType"],(0,m.nt9)(e,t.startObject.objectTypeURI)),(0,d.assocPath)(["endObject","objectType"],(0,m.nt9)(e,t.endObject.objectTypeURI)))(t),s=(0,m.nt9)(e,r.type),c=(0,d.propOr)({},"matchActions",t),u=(0,m.dzT)(c,s,o),[p]=u.map((e=>{let{createRelation:t}=e;return t})).filter(d.identity);return(0,d.evolve)({inRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,r,n)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(a),(0,d.map)(i)),outRelations:(0,d.pipe)((0,d.filter)((0,m.rny)(e,n,r)),(0,d.map)((0,m.V3K)(e)),(0,d.filter)(l),(0,d.map)(i))},p)||{}})(h,t,n,r,o)),[t,n,r,o,h]),{relationUri:v,relationType:w={}}=g,E=(0,d.pathOr)({},["object","attributes"],g),C=(0,l.useMemo)((()=>(0,m.xF8)(h,w)),[w,h]),x=(0,l.useMemo)((()=>Zl({attributes:E},(0,m.p2l)(g))),[g,E]),O=t.id,S=(0,l.useCallback)((0,d.pipe)(Se.N5.relations.actions.setRelationType(t.id,v),u),[t,v,u]),R=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.addAttributes,u)(e.map((e=>Zl({},e,{viewId:O}))))),[O,u]),P=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.modifyAttribute,u)(Zl({},e,{viewId:O}))),[O,u]),k=(0,l.useCallback)((e=>(0,d.pipe)(Se.N5.actions.removeAttribute,u)(Zl({},e,{viewId:O}))),[O,u]),T=(0,l.useCallback)((()=>s(v)),[v,s]),M=(0,l.useCallback)((()=>u(Se.N5.errors.actions.errorsSet([]))),[u]),j=(0,l.useCallback)((()=>{const e=(0,m.xkB)(h,{relation:g});return u(Se.N5.errors.actions.errorsSet(e)),0===e.length}),[g,h,u]),N=(0,l.useCallback)((()=>{M(),T()}),[M,T]),I=`${(0,m.idV)(r.label)} → ${(0,m.idV)(n.label)}`,A=(0,d.isEmpty)(w),D=f.current,Z=(0,l.useMemo)((()=>({element:D,priority:["top","bottom"]})),[D]);return i().createElement(Lt.Dialog,{open:a,fullWidth:!0,maxWidth:"sm",onClose:N,classes:{paper:c.dialogPaper}},i().createElement(Lt.DialogTitle,{disableTypography:!0,classes:{root:c.dialogTitle}},i().createElement(Lt.Typography,{variant:"subtitle1",classes:{root:c.titleText}},q().text("Add relationship")),i().createElement(Lt.Typography,{variant:"body2",classes:{root:c.path}},I)),i().createElement(Lt.DialogContent,{classes:{root:c.content},ref:f},i().createElement(Al.p.Provider,{value:Z},i().createElement(Br.Z,{relation:g,metadata:h,inRelationTypes:b,outRelationTypes:y,onChange:S,applyFirstByDefault:!0}),i().createElement(Vr.Z,{className:c.attributeList,attrTypes:C,entity:x,showEmptyEditors:!0,mode:m.fO_.EDITING,parentUri:v,onAddAttributes:R,onChangeAttribute:P,onDeleteAttribute:k}))),i().createElement(Lt.DialogActions,null,i().createElement(Lt.Button,{onClick:N},q().text("Cancel")),i().createElement(Lt.Button,{disabled:A,color:"primary",onClick:()=>{const{relationType:e,startDate:t,endDate:o}=g;j()&&((0,m.DsR)({startEntityUri:n.uri,endEntityUri:r.uri,relationType:e,attributes:(0,d.pathOr)({},["object","attributes"],g),startDate:t,endDate:o}).catch(Fa),T())}},q().text("Add"))))};function Ll(){return Ll=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ll.apply(this,arguments)}const zl=e=>{const[t,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)({}),a=(0,p.useDispatch)(),s=(0,l.useCallback)((t=>{let{mainEntity:r,currentEntity:l,matchRules:i}=t;const s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{relation:{relationUri:(0,m.ncP)()},entity:e,isNew:!0}}(l);(0,d.pipe)(Se.N5.relations.actions.openRelationEditor(e.id),a)(s),o({mainEntity:r,currentEntity:l,matchRules:i}),n(!0)}),[e,a]),c=(0,l.useCallback)((t=>{(0,d.pipe)(Se.N5.relations.actions.closeRelationEditor,a)(e.id,t),n(!1)}),[e.id,a]),u=(0,l.useCallback)((()=>t?i().createElement(Vl,Ll({config:e,open:t,onClose:c},r)):null),[t,e,c,r]);return{showDialog:t,openAddRelationDialog:s,AddRelationDialogRenderer:u}},Hl=[{id:"label",get label(){return q().text("Profile name")}},{id:"matchRules",get label(){return q().text("Match rule")}},{id:"mlMatchRules",get label(){return q().text("Match IQ")},dataTypeDefinition:{type:m.oS0.TYPE_SELECT}},{id:"id",get label(){return q().text("Entity ID")}}],Fl=[{id:"score",get label(){return q().text("Match score")}}],Wl=e=>{let{fieldName:t}=e;return(0,d.pipe)(d.values,(0,d.pluck)("name"),(0,d.any)((0,d.equals)(t)))(m.S91)},_l=e=>(0,d.flatten)(e.map((0,d.prop)("values"))).join(",");function Ul(){return Ul=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ul.apply(this,arguments)}const Gl=(0,l.forwardRef)(((e,t)=>{let{item:n,onMenuClose:r=d.identity}=e;const{ActionButton:o,props:a}=n;return i().createElement(o,Ul({ref:t,mode:"menuItem",onMenuClose:r},a))}));Gl.displayName="MenuItemRenderer";const ql=Gl;function $l(){return $l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$l.apply(this,arguments)}const Xl=e=>{let{actions:t,numberOfButtons:n=2,mode:r="normal",actionButtonSize:o,classes:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const[c,u]=(0,d.splitAt)(n,t),p="normal"===r?Oe.N.button:Oe.N.iconButton,m="normal"===r?"MPlus":"S";return i().createElement(i().Fragment,null,c.map(((e,t)=>{let{ActionButton:n,props:r}=e;return i().createElement(n,$l({key:t,mode:p,className:null==a?void 0:a.actionButton},o?{size:o}:{},r))})),u.length>0&&i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ot.Z,size:m,tooltipTitle:q().text("More actions")},className:null==a?void 0:a.moreOptions,menuId:"matches-view-actions",menuItems:u,onMenuOpen:l,onMenuClose:s,MenuItemRenderer:ql}))},Yl={showTransitiveMatches:!0},Ql=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),Kl=[20,50,100],[Jl]=Kl,ei=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=Ql(),[s,c]=Ha({field:Fl[0].id,order:"desc"},Jl),{changeRowsPerPage:u,changePage:h,toggleSort:f,setSelectedItems:g,toggleSelect:b}=s,{page:y,rowsPerPage:v,sorting:w,selectedItems:E,isGlobalSpinnerActive:S}=c,R=Yl,P=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),k=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),T=P&&!(0,m.O27)(k),{uri:M,type:j}=t||{},{showDialog:N,openAddRelationDialog:I,AddRelationDialogRenderer:A}=zl(o),D=bl(Hl,Fl,n,j),[Z,B]=(0,l.useMemo)((()=>(0,d.partition)(Wl)(r)),[r]),{matches:V,total:L,entitiesMap:z,loadMatches:H}=Il({enabled:!!M,entity:t,filter:(0,m.Uqd)()(B),page:y,sorting:w,rowsPerPage:v,options:R,rules:_l(Z)}),{setReloadHandler:F}=ta();F((()=>{H()}));const W=(0,l.useCallback)((()=>{g([])}),[g]),_=(0,l.useCallback)((()=>{g(V)}),[g,V]);(0,C.D)((()=>{h(0),W()}),[M,R]);const U=(0,l.useMemo)((()=>(0,m.NVY)(M,Object.keys(z))),[M,z]),G=(0,Ar.C)({objectIds:U}),q=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canAddRelation:u,canMark:p}=(0,m.hXd)(n,o,r.object,t,r.matchRules),h=[r.object],f=[...h,t].some(m.biM),g=[{ActionButton:$a,show:c,props:{entity:t,entities:h}},{ActionButton:Ya,show:p,props:{entity:t,entities:h}},{ActionButton:nl,show:!f&&T,props:{entity:t,entities:h}},{ActionButton:ll,show:u&&!f,props:{mainEntity:t,currentEntity:r.object,matchRules:r.matchRules,onClick:I}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:g,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,o,n,I,T]),$=(0,l.useMemo)((()=>V.map((e=>null==E?void 0:E.find((0,d.equals)(e)))).filter(d.identity).length),[E,V]);return i().createElement(Dr.h.Provider,{value:G},i().createElement(Zr.X.Provider,{value:z},i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:$,totalCount:L,totalOnPage:V.length,sortOptions:D,sorting:w,toggleSort:f,onSelect:$?W:_}),i().createElement(Cl,{entityToMatch:t,toggleSelect:b,actionButtonsRenderer:q,matches:V,metadata:n,entitiesMap:z,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:Kl,count:L,page:y,onChangePage:h,rowsPerPage:v,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null)),N&&i().createElement(A,null)))}));ei.displayName="MatchesView";const ti=ei;function ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ri=[{id:"label",get label(){return q().text("Profile name")}},{id:"id",get label(){return q().text("Entity ID")}}],oi=(0,Le.Z)((()=>({mainArea:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"}}))),ai=[20,50,100],[li]=ai,ii=ia(ri),si=(0,l.memo)((e=>{let{entity:t,metadata:n,filters:r,config:o}=e;const a=oi(),[s,c]=Ha({order:"asc",field:ii[0]},li),{changeRowsPerPage:u,changePage:h,setSelectedItems:f,toggleSelect:g,toggleSort:b}=s,{page:y,rowsPerPage:v,sorting:w,selectedItems:E,isGlobalSpinnerActive:S}=c,{uri:R,type:P}=t||{},k=(0,p.useSelector)(Se.ZP.selectors.getCanUserStartProcessFromQuery),T=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),M=k&&!(0,m.O27)(T),{matches:j,total:N,entitiesMap:I,loadNotMatches:A}=(e=>{let{entityUri:t,filter:n,sorting:r,page:o,rowsPerPage:a,enabled:i}=e;const{order:s,field:c}=r||{},{setGlobalSpinner:u}=Ma(),[d,h]=(0,l.useState)(0),[f,g]=(0,l.useState)([]),[b,y]=(0,l.useState)({}),v=(0,p.useSelector)(Se.ZP.selectors.getTenant),w=(0,p.useSelector)(Se.ZP.selectors.getDtssPath),E=(0,p.useSelector)(Se.ZP.selectors.getDataTenants),{activityFilter:C,globalFilter:x}=(0,p.useSelector)(Se.ZP.selectors.getGlobalSearchRequestOptions)||{},O=(0,l.useMemo)((()=>({dtssPath:w,dataTenants:E,entity:{uri:t},customerTenant:v,dtssRequest:m.WSA})),[w,E,t,v]),S=(0,l.useCallback)((0,m.U_T)(O,m.pg),[O]),R=(0,mo.a)(S),P=(0,oe._)(),k=e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ni(e,t,n[t])}))}return e}({matchRules:[m.h_8]},e),T=(0,l.useCallback)((e=>{i&&(u(!0),P(R({entityUri:t,offset:o*a,max:a,filter:(0,m.vyX)(x,n)||"",sort:c,force:e,order:s,activeness:C})).then((e=>{const{response:t,total:n,originalResponse:r}=e;h(n),g(t.map(k)),t.map((e=>{let{uri:t}=e;return t})).length>0&&y((0,m.KPC)(r))})).finally((()=>u(!1))))}),[t,n,c,s,o,a,C,i,x]);return(0,l.useEffect)((()=>{T()}),[T]),{matches:f,total:d,entitiesMap:b,loadNotMatches:(0,l.useCallback)((()=>{T(!0)}),[T])}})({enabled:!!R,entityUri:R,filter:(0,m.Uqd)()(r),page:y,rowsPerPage:v,sorting:w}),D=(0,l.useMemo)((()=>(0,m.NVY)(R,Object.keys(I))),[R,I]),Z=(0,Ar.C)({objectIds:D}),B=bl(ri,[],n,P),{setReloadHandler:V}=ta();V((()=>{A()}));const L=(0,l.useCallback)((()=>{f([])}),[f]),z=(0,l.useCallback)((()=>{f(j)}),[f,j]);(0,C.D)((()=>{h(0),L()}),[R]);const H=(0,l.useCallback)((e=>{let{hoveredMatch:r,buttonClassName:a,onActionsMenuOpen:l,onActionsMenuClose:s}=e;const{canMerge:c,canMark:u}=(0,m.hXd)(n,o,r.object,t,r.matchRules),p=[r.object],h=[...p,t].some(m.biM),f=[{ActionButton:$a,show:c,props:{entity:t,entities:p}},{ActionButton:rl,show:u,props:{entity:t,entities:p}},{ActionButton:nl,show:!h&&M,props:{entity:t,entities:p}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:f,classes:{actionButton:a,moreOptions:a},mode:"hover",numberOfButtons:2,onActionsMenuOpen:l,onActionsMenuClose:s})}),[t,o,n,M]),F=(0,l.useMemo)((()=>j.map((e=>null==E?void 0:E.find((0,d.equals)(e)))).filter(d.identity).length),[E,j]);return i().createElement(Dr.h.Provider,{value:Z},i().createElement(Zr.X.Provider,{value:I},i().createElement("div",{className:a.mainArea},i().createElement(fl,{selectedCount:F,totalCount:N,totalOnPage:j.length,sortOptions:B,sorting:w,toggleSort:b,onSelect:F?L:z}),i().createElement(Cl,{entityToMatch:t,toggleSelect:g,actionButtonsRenderer:H,matches:j,metadata:n,selectedItems:E}),i().createElement(x.Z,{rowsPerPageOptions:ai,count:N,page:y,onChangePage:h,rowsPerPage:v,onChangeRowsPerPage:u}),S&&i().createElement(O.Z,null))))}));si.displayName="NotMatchView";const ci=e=>{let{entity:t,metadata:n,filters:r,config:o,activeView:a}=e;const l=(0,f.U)();return i().createElement(g.s.Provider,{value:l},(()=>{switch(a){case Xo.PotentialMatches:return i().createElement(ti,{entity:t,metadata:n,filters:r,config:o});case Xo.FindMatches:return i().createElement(Nl,{entity:t,metadata:n,filters:r,config:o});case Xo.NotAMatch:return i().createElement(si,{entity:t,metadata:n,filters:r,config:o});default:return i().createElement("div",null)}})())};var ui=n(6782),pi=n(64731);function di(){return di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},di.apply(this,arguments)}var mi=n(58970),hi=n(54337),fi=n(70215);const gi=(0,Le.Z)({input:{margin:0,borderRadius:"4px",width:"100%",paddingTop:0,paddingBottom:0}});function bi(){return bi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(this,arguments)}const yi=e=>{let{rowData:t,rowContext:n}=e;const r=gi(),{values:o=[],attribute:{attrType:a,fieldName:s=null}={},filter:c,id:u}=t||{},{changeFilter:p}=n,{entityType:d}=n,h={values:o,onChange:(0,l.useCallback)((e=>{p({fieldName:s,filter:c,values:e},u)}),[p,u,s,c]),TextFieldProps:(0,l.useMemo)((()=>({InputProps:{classes:{root:r.input}}})),[r]),fullWidth:!0};return(0,m.pzC)(a)?i().createElement(mi.Z,bi({},h,{name:a.name,entityType:d})):(0,m.OFd)(a)?i().createElement(hi.Z,h):i().createElement(fi.Z,{rowContext:n,rowData:t})},vi=(0,Le.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ei(e,t,n[t])}))}return e}function Ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ci={FilterSelector:e=>{const{rowData:t}=e,{attribute:{attrType:n}={}}=t||{},r=(0,m.pzC)(n)?[m.j5E.EQUALS].map((e=>({value:e,label:(0,ui.Z)((0,m.XS2)(e))}))):null;return i().createElement(pi.Z,di({},e,{options:r}))},ValuesEditor:yi},xi={ValuesEditor:yi},Oi=(0,l.memo)((e=>{var t;let{config:n,isLoaded:r,savedState:o,onUpdateSavedState:a}=e;const s=vi(),[c,u]=(0,l.useState)([]),[h,f]=(0,l.useState)([]),[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)(null),w=(0,p.useSelector)(Se.ZP.selectors.getMetadata),E=(0,p.useSelector)(Se.ZP.selectors.getEntity),C=(0,l.useCallback)((e=>{v((t=>t===e?null:e))}),[]),x=(0,l.useCallback)((()=>{v(null)}),[]),O=null!==y,S=(0,m.nt9)(w,null==E?void 0:E.type),R=(0,l.useMemo)((()=>(e=>(e.attributes||[]).concat(e.analyticsAttributes||[]).filter(m.Uty))(S)),[S]),P=(0,l.useMemo)((()=>[wi({},m.S91.matchRules,{check:m.Ir}),wi({},m.S91.MLRecommendedMatch,{check:m.XQO})].reduce(((e,t)=>{let{check:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["check"]);return n(S)&&e.push(r),e}),[])),[S]),k=(0,l.useMemo)((()=>[...P,...R]),[R,P]),T=(0,l.useMemo)((()=>[m.xPW.id,m.G39.sourceSystems,...R]),[R]),M=(0,l.useMemo)((()=>[{buttonProps:{id:Xo.PotentialMatches,icon:_o,tooltipTitle:q().text("Potential Matches")},headerProps:{mainTitle:q().text("Potential Matches"),rightContent:i().createElement(zo.Z,{filters:c,onChange:u,attributeTypes:k,components:Ci})},filters:c},{buttonProps:{id:Xo.FindMatches,icon:Go,tooltipTitle:q().text("Find Matches")},headerProps:{mainTitle:q().text("Find Matches"),rightContent:i().createElement(zo.Z,{filters:h,onChange:f,attributeTypes:T,components:xi})},filters:h},{buttonProps:{id:Xo.NotAMatch,icon:$o,tooltipTitle:q().text("Not a Match")},headerProps:{mainTitle:q().text("Not a Match"),rightContent:i().createElement(zo.Z,{filters:g,onChange:b,attributeTypes:R})},filters:g}]),[c,h,g,k,T,R]),j=(0,l.useMemo)((()=>{var e;return wi({},null===(e=M[y])||void 0===e?void 0:e.headerProps,{onClose:x})}),[x,y,M]),N=null===(t=M[y])||void 0===t?void 0:t.filters;return(0,l.useEffect)((()=>{if(!r)return;const e=(0,d.propOr)(!0,"showSidePanel")(o);v(e?Xo.PotentialMatches:null)}),[r]),(0,l.useEffect)((()=>{r&&a({showSidePanel:null!==y})}),[y]),i().createElement("div",{className:s.wrapper},i().createElement(Ho.h,{open:O,width:480},i().createElement(sl.Provider,{value:j},i().createElement(ci,{config:n,entity:E,filters:N,metadata:w,activeView:y}))),i().createElement(Fo.G,{buttonsProps:(0,d.pluck)("buttonProps",M),onButtonClick:C,activeIndexId:y}))}));Oi.displayName="RightSidePanel";var Si=n(83401);const Ri=(0,Le.Z)((()=>({button:{minWidth:"90px",padding:"8px 12px"}})));var Pi=n(66324),ki=n(82882);function Ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mi=[{id:Yo.COLUMNS,tooltipTitle:q().text("Column"),title:q().text("Column"),Icon:Pi.Z},{id:Yo.TABLE,tooltipTitle:q().text("Table"),title:q().text("Table"),Icon:ki.Z}],ji=e=>{let{className:t}=e;const n=Ri(),{comparisonViewMode:r,selectedItems:o}=Ta(),{setComparisonViewMode:a}=Ma(),l=o.length>4;return i().createElement(Si.Z,{className:t,classes:{button:n.button},modes:Mi.map((e=>e.id===Yo.COLUMNS?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ti(e,t,n[t])}))}return e}({},e,{disabled:l,tooltipTitle:l?q().text("Column view supports maximum ${maxProfiles} profiles",{maxProfiles:4}):e.tooltipTitle}):e)),modeId:r,onChange:a})},Ni=(0,Le.Z)((e=>({header:{padding:"0 8px 0 16px",backgroundColor:"#fff","& $splitter":{height:"32px",marginRight:"16px",marginLeft:"4px",color:"rgba(0, 0, 0, 0.12)"}},title:{fontSize:"16px",fontWeight:400,lineHeight:"24px",letterSpacing:"0.15px",color:e.palette.text.primary},clearAllButton:{marginLeft:"16px"},mergeButton:{marginRight:"12px"},total:{color:e.palette.text.secondary},splitter:{},actionSplitter:{height:"32px",margin:"0 8px",color:"rgba(0, 0, 0, 0.12)"}})));var Ii=n(47603);const Ai=e=>{let{items:t}=e;return i().createElement(wt.Z,{buttonComponent:Ze.k,buttonProps:{icon:Ii.Z,tooltipTitle:q().text("Settings"),size:"L"},menuId:"matches-view-settings",menuItems:t})},Di=(0,d.map)((0,d.prop)("object")),Zi=e=>{let{config:t,columnsData:n,selectedColumns:r,onChangeColumns:o,showNonOv:a,onChangeShowNonOv:s}=e;const c=Ni(),u=(0,p.useSelector)(Se.ZP.selectors.getEntity),h=(0,p.useSelector)(Se.ZP.selectors.getMetadata),{selectedItems:f,limitSelection:g}=Ta(),{setSelectedItems:b}=Ma(),y=Di(f),{tableViewModeAvailable:v}=t,{canMerge:w,canMark:E}=(0,m.OCS)(h,t,u,f),C=[...y,u].some(m.biM),x=(0,l.useMemo)((()=>[{ActionButton:$a,show:w,props:{entity:u,entities:y}},{ActionButton:Ya,show:E,props:{entity:u,entities:y}},{ActionButton:nl,show:!C,props:{entity:u,entities:y}}].filter((0,d.prop)("show"))),[E,w,u,y,C]),O=0!==f.length,S=(0,l.useCallback)((()=>{s(d.not)}),[s]),R=(0,l.useMemo)((()=>[{selected:!a,selectable:!0,text:q().text("Show only OV"),onClick:S,id:"showNonOv"}]),[S,a]);return i().createElement(zt.Z,{title:"",classes:{root:c.header}},i().createElement(Lt.Typography,{className:c.title},i().createElement("span",null,q().text("Match Review")),O&&i().createElement("span",{className:c.total}," ","(",f.length,g&&"/"+g,")")),O&&i().createElement(Lt.Button,{onClick:()=>{b([])},className:c.clearAllButton,color:"primary"},q().text("Clear All")),i().createElement(lr.Z,null),O&&i().createElement(i().Fragment,null,i().createElement(Xl,{actions:x,numberOfButtons:2}),i().createElement(Lt.Divider,{orientation:"vertical",classes:{vertical:c.actionSplitter}})),i().createElement(Ai,{items:R}),i().createElement($t.Z,{columnsData:n,selectedColumns:r,onChangeColumns:o}),v&&i().createElement(i().Fragment,null,i().createElement(Lt.Divider,{orientation:"vertical",classes:{vertical:c.splitter}}),i().createElement(ji,null)))};var Bi=n(21077),Vi=n(43600);const Li=i().createContext({expandedMap:{},onExpandType:()=>{}});function zi(){return zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}Li.displayName="ExpandedContext";const Hi=e=>{const t=(0,l.forwardRef)(((t,n)=>{const{attributeType:r}=t,{expandedMap:o}=(0,l.useContext)(Li),a=o[r.uri];return i().createElement(e,zi({},t,{expanded:a,ref:n}))}));return t.displayName="WithExpanded",t},Fi="rgba(140, 193, 82, 0.12)",Wi=(0,Le.Z)({complexAttributesHeadRenderer:{height:"100%",width:"100%",display:"flex",alignItems:"flex-start"},complexAttributesHeadLabel:{flex:1,marginLeft:"5px"},arrowButton:{cursor:"pointer",marginLeft:"-3px"},attribute:{whiteSpace:"pre-wrap"},matchedAttribute:{fontWeight:500,position:"relative","&::after":{content:'""',position:"absolute",left:"-1000px",top:0,width:"5000px",height:"100%",background:Fi,pointerEvents:"none"}}}),_i=(0,Le.Z)({badge:{borderRadius:"50%",background:Fi,fontWeight:500,height:"20px",width:"20px",display:"flex",alignItems:"center",justifyContent:"center",alignSelf:"flex-start",marginBottom:"2px",marginTop:"-2px"}}),Ui=e=>{let{attributeValue:t}=e;const n=_i(),{highlightedValuesUris:r=[]}=(0,l.useContext)(Vi.j),o=r.filter((e=>(0,m.sOy)(e,t.uri))).length;return o>0?i().createElement(Lt.Tooltip,{title:1===o?q().text("${count} match",{count:o}):q().text("${count} matches",{count:o})},i().createElement("div",{className:n.badge},o)):null},Gi=Hi(Ke.Z),qi=e=>{let{value:{attributeType:t,attributeValues:n,matchedValuesUris:r,showNonOv:o}}=e;const a=Wi(),s=(0,l.useMemo)((()=>({highlightedValuesUris:r,highlightedClassName:a.matchedAttribute})),[r,a.matchedAttribute]);return i().createElement("div",{className:a.attribute},i().createElement(Vi.j.Provider,{value:s},i().createElement(Gi,{values:n,attributeType:t,showNonOv:o,RightSlot:Ui})))},$i=i().createContext({});$i.displayName="ColumnDataContext";const Xi=(0,Le.Z)({menuButtonWrapper:{display:"none",position:"absolute",top:"-4px",right:"-14px"},headCell:{display:"flex",position:"relative","th:hover &":{"& $menuButtonWrapper":{display:"block"}}},active:{display:"block"}}),Yi=e=>{let{label:t,id:n,hideable:r}=e;const o=Xi(),{setAnchor:a,setHoveredId:s,hoveredId:c}=(0,l.useContext)($i),u=(0,l.useRef)();return i().createElement("div",{className:o.headCell},t,!1!==r&&i().createElement("div",{className:De()(o.menuButtonWrapper,{[o.active]:c===n}),ref:u},i().createElement(ct.Z,{icon:Ot.Z,onClick:()=>{a(u.current),s(n)},size:"S"})))};var Qi=n(19592);const Ki=e=>{let{label:t,attributeType:n,id:r}=e;const o=Wi(),{expandedMap:a,onExpandType:s}=(0,l.useContext)(Li),c=(0,l.useCallback)((()=>s(n.uri)),[s,n]),u=a[n.uri];return i().createElement("div",{className:o.complexAttributesHeadRenderer},i().createElement(Qi.Z,{expanded:u,onClick:c,className:o.arrowButton}),i().createElement("div",{className:o.complexAttributesHeadLabel},i().createElement(Yi,{label:t,id:r})))},Ji=i().createContext({hoveredEntity:null,resetHoveredEntity:()=>{}});Ji.displayName="HoveredEntityContext";const es=(0,l.memo)((e=>{let{value:{mainEntity:t,entity:n,matchRules:r,permission:o},onActionsMenuClose:a,onActionsMenuOpen:l,openAddRelationDialog:s,classes:c={},mode:u="hover"}=e;const{canMerge:p,canAddRelation:h,canMark:f}=o,g=[t,n].some(m.biM),b=!r,y=!b&&r.includes(m.h_8),v=!y&&!b,w=[{ActionButton:$a,show:p&&(y||v),props:{entity:t,entities:[n]}},{ActionButton:Ya,show:f&&v,props:{entity:t,entities:[n]}},{ActionButton:rl,show:f&&y,props:{entity:t,entities:[n]}},{ActionButton:nl,show:!g&&(y||v),props:{entity:t,entities:[n]}},{ActionButton:Ja,show:f&&b,props:{entity:t,entities:[n]}},{ActionButton:ll,show:h&&!g,props:{mainEntity:t,currentEntity:n,matchRules:r,onClick:s}}].filter((0,d.prop)("show"));return i().createElement(Xl,{actions:w,numberOfButtons:2,mode:u,actionButtonSize:"XS",classes:{actionButton:c.actionButton,moreOptions:c.moreOptions},onActionsMenuClose:a,onActionsMenuOpen:l})})),ts=(0,Le.Z)({container:{position:"relative",width:"100%",height:"140px",display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden"},hovered:{backgroundColor:"rgb(245, 245, 245)"},closeButton:{position:"absolute",zIndex:1,margin:"4px"},matchControlsContainer:{display:"flex",alignItems:"center",height:"45px",margin:"4px 8px"},rightButton:{display:"flex",alignItems:"center"},moreOptions:{marginLeft:"8px"}});function ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rs=e=>"potentialMatchReview"===e.processType,os=i().createContext((()=>{}));os.displayName="WorkflowTasksAvailabilityContext";const as=(0,Le.Z)({container:{position:"relative",minHeight:"86px",display:"flex",overflow:"hidden",margin:"-16px"},assigneeSelector:{},assigneeContainer:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"16px 14px 16px 48px"}});function ls(){return ls=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ls.apply(this,arguments)}const is=(0,d.pick)(["processInstanceComments","taskId"]),ss=e=>{let{entity:t,match:n}=e;const r=as(),{tasks:o,loadTasks:a}=(e=>{let{entity:t,match:n}=e;const r=(0,p.useSelector)(Se.ZP.selectors.getWorkflowPath),o=(0,p.useSelector)(Se.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,p.useSelector)(Se.ZP.selectors.getTenant),i=(0,oe._)(),{uri:s}=t,c=(0,m.ev7)(n),[u,h]=(0,l.useState)(!1),[f,g]=(0,l.useState)([]),b=(0,l.useCallback)((()=>{r&&c!==s&&(h(!0),i((0,m.uT0)({entityUri:s,workflowPath:r,environment:o,tenant:a})).then((e=>{const{data:t}=e,n=(0,d.propSatisfies)((0,d.includes)(c),"objectURIs"),r=(0,d.allPass)([rs,n]),o=t.filter(r);g(o)})).finally((()=>h(!1))))}),[s,o,a,r,c]);return{enabled:!!r,loading:u,tasks:f,loadTasks:b}})({entity:t,match:n}),s=(0,l.useContext)(os),{sendMergeAllRequest:c}=(0,bt._)({entity:t,entities:[n.object]}),{sendMarkAsNotMatchRequest:u}=(0,yt.m)({entity:t,entities:[n.object]}),h={Merge:c,NotAMatch:u};(0,l.useEffect)((()=>{a()}),[a]);const f=o[0],g=(0,m.ev7)(n);(0,l.useEffect)((()=>{null==s||s(g,!!f)}),[s,g,f]);const b=(f&&f.possibleActions||[]).map((e=>{let{action:t,label:n}=e;return{text:n,onClick:h[t]}})),{assignee:y,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:E}=(0,vt.r)(f||{}),C=b.length>0?i().createElement(wt.Z,{buttonComponent:ct.Z,buttonProps:{icon:Ot.Z,size:"L"},menuId:"custom-actions",menuItems:b}):null;return f?i().createElement("div",{className:r.container},i().createElement(Et.Z,ls({},(e=>({date:e.dueDate,type:e.processDefinitionDisplayName,createdBy:e.createdBy,step:e.displayName}))(f),{Actions:C}),i().createElement("div",{className:r.assigneeContainer},i().createElement(Ct.Z,{className:r.assigneeSelector,enabled:!E||y,getOptions:v,onChange:w,hideSelectedOptions:!1,label:q().text("Assigned to"),value:y,defaultOptions:!0})),i().createElement(xt.V,is(f)))):null},cs=[{id:"profile",label:q().text("Profile name"),dataTypeDefinition:{type:m.oS0.TYPE_STRING},hideable:!1,draggable:!1,initialWidth:280,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"matchRules",label:q().text("Match method"),dataTypeDefinition:{type:m.oS0.TYPE_SELECT},hideable:!1,draggable:!1,initialWidth:130,minWidth:130,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"workflowCard",label:q().text("Workflow"),modes:[Yo.COLUMNS]},{id:"entityId",label:q().text("Entity ID"),dataTypeDefinition:{type:m.oS0.TYPE_ENTITY_ID},initialWidth:100,autoResize:!1,modes:[Yo.COLUMNS,Yo.TABLE]},{id:"score",label:q().text("Match score"),dataTypeDefinition:{type:m.oS0.TYPE_INT},initialWidth:100,modes:[Yo.TABLE,Yo.COLUMNS]},{id:"sources",label:q().text("Sources"),modes:[Yo.COLUMNS,Yo.TABLE]},{id:"crosswalks",label:q().text("Crosswalks"),modes:[Yo.COLUMNS]}];var us=n(63149),ps=n(94175);const ds=(0,Le.Z)({itemContainer:{width:"18px",height:"18px"},item:{width:"18px",height:"18px",background:"none",fontSize:"1rem"}}),ms=(0,l.memo)((e=>{let{className:t,crosswalk:n,showTooltip:r=!0}=e;const o=ds(),a=(0,us.nX)(n),l=(0,p.useSelector)(Se.ZP.selectors.getMetadata)||{},s=i().createElement("div",{className:De()(o.itemContainer,t),style:{background:a}},i().createElement(ps.Z,{sourceType:n.type,className:o.item}));return r?i().createElement(Lt.Tooltip,{title:(0,m.tH7)(l,n.type)},s):s})),hs=(0,Le.Z)({crosswalk:{marginBottom:"8px"},crosswalkIcon:{marginRight:"5px"},labelContainer:{display:"flex",alignItems:"center",width:"100%"},spacer:{flex:1}}),fs=e=>{let{attributeValue:t}=e;const n=hs(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata),o=t.value.crosswalk;return i().createElement("div",{className:n.labelContainer},i().createElement(ms,{className:n.crosswalkIcon,crosswalk:o,showTooltip:!1}),i().createElement("div",null,(0,m.tH7)(r,o.type)),i().createElement("div",{className:n.spacer}),i().createElement("div",null,o.value))},gs=Hi(Ke.Z),bs=(0,Le.Z)({wrapper:{display:"flex",flexWrap:"wrap",marginBottom:"-8px"},crosswalkIcon:{marginRight:"5px",marginBottom:"8px"}}),ys=e=>{let{value:t}=e;const n=bs();return t?i().createElement("div",{className:n.wrapper},t.map((e=>i().createElement(ms,{key:e.uri,className:n.crosswalkIcon,crosswalk:e})))):null};function vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ws(e,t,n[t])}))}return e}function ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Es={profile:{cellRenderer:e=>{let{value:{entity:t,showCloseButton:n,onClose:r,showButtons:o,config:a}}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e.value,["entity","showCloseButton","onClose","showButtons","config"]);const c=ts(),{hoveredEntity:u,resetHoveredEntity:p}=(0,l.useContext)(Ji),d=(0,m.BTI)(t)===u,{showDialog:h,openAddRelationDialog:f,AddRelationDialogRenderer:g}=zl(a),b=(0,l.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ns(e,t,n[t])}))}return e}({},s,{entity:t})),[s,t]);return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(c.container,{[c.hovered]:o&&d})},n&&i().createElement(ct.Z,{className:c.closeButton,icon:pt.default,onClick:r,size:"XXS"}),i().createElement(ut.Z,{entity:t}),o&&i().createElement("div",{className:c.matchControlsContainer},i().createElement(es,{mode:"normal",value:b,onActionsMenuClose:p,openAddRelationDialog:f,classes:{actionButton:c.rightButton,moreOptions:c.moreOptions}}))),h&&i().createElement(g,null))},headCellRenderer:Yi,label:""},matchRules:{cellRenderer:e=>{let{value:{metadata:t,entity:n,match:r,entitiesMap:o,show:a}}=e;return a?i().createElement(ft.Z,{entity:n,match:r,entitiesMap:o,metadata:t}):null},headCellRenderer:Yi},workflowCard:{cellRenderer:e=>{let{value:{entity:t,match:n}}=e;return i().createElement(ss,{entity:t,match:n})},headCellRenderer:Yi},sources:{cellRenderer:ys,headCellRenderer:Yi},entityId:{headCellRenderer:Yi},crosswalks:{cellRenderer:e=>{let{value:{crosswalks:t,attributeType:n}}=e;const r=hs(),o=(0,p.useSelector)(Se.ZP.selectors.getMetadata),a=(0,l.useMemo)((()=>null==t?void 0:t.map((e=>((e,t,n)=>t.attributes.reduce(((t,r)=>(r.uri===m.G39.sourceSystems.uri?t.value[r.uri]=(0,m.tH7)(n,e.type):e[r.uri]&&(t.value[r.uri]=e[r.uri]),t)),{value:{crosswalk:e},uri:e.uri}))(e,n,o)))),[o,t,n]);return a?i().createElement(gs,{values:a,attributeType:n,LabelRenderer:fs,valueContainerClassName:r.crosswalk}):null},headCellRenderer:Ki,attributeType:{uri:"crosswalks",name:"crosswalks",type:"Nested",attributes:Object.values(m.G39)}}},Cs=cs.filter((e=>{let{modes:t}=e;return t.includes(Yo.COLUMNS)})).map((e=>vs({},(0,d.pick)(["id","label","hideable"],e),Es[e.id]))),xs=(0,d.pipe)((0,d.split)("/"),d.last),Os=e=>(0,d.when)(d.identity,(0,d.pipe)(d.values,(0,d.chain)((0,d.chain)((0,d.cond)([[(0,d.path)(["value","uri"]),(0,d.path)(["value","uri"])],[(0,d.path)(["value","values"]),(0,d.pipe)((0,d.path)(["value","values"]),(0,d.map)((0,d.prop)("uri")))]]))),(0,d.filter)(d.identity)))(e),Ss=(e,t,n,r,o,a,l,i)=>{const{object:s,isMainEntity:c,matchRules:u,matchedValues:p,matchScore:h}=t;switch(o.id){case"entityId":return(0,m.BTI)(s);case"profile":return{mainEntity:r,showCloseButton:!c,onClose:()=>l(t),showButtons:!c,entity:s,matchRules:u,permission:(0,m.hXd)(e,a,s,r,u),config:a};case"matchRules":return{metadata:e,entity:r,match:t,entitiesMap:n,show:!c&&!!u};case"sources":return s.crosswalks;case"crosswalks":return{crosswalks:s.crosswalks,attributeType:o.attributeType};case"workflowCard":return{entity:r,match:t};case"score":return h||0}if((0,m.vZp)(o.id)){const e=(0,m.xy8)(o.attributeType),t=(0,d.pipe)((0,d.pathOr)([],[e,o.attributeType.name]),(0,d.when)((0,d.always)(!i),(0,d.filter)(m.OXP)))(s);return{attributeType:o.attributeType,attributeValues:t,matchedValuesUris:Os(p),showNonOv:i}}},Rs=i().createContext((()=>{}));Rs.displayName="ColumnHandlerContext";const Ps=(0,d.pipe)((0,d.split)("."),(0,d.slice)(0,2),(0,d.join)(".")),ks=(0,d.pipe)((0,d.map)((0,d.when)(m.vZp,Ps)),d.uniq);let Ts;!function(e){e.INSERT_BELOW="below",e.INSERT_ABOVE="above",e.HIDE="hide"}(Ts||(Ts={}));const Ms={[Ts.INSERT_BELOW]:q().text("Insert row below"),[Ts.INSERT_ABOVE]:q().text("Insert row above"),[Ts.HIDE]:q().text("Hide row")},js=e=>{let{open:t,anchorEl:n,onClick:r,onClose:o,actions:a}=e;return i().createElement(Lt.Popover,{open:t,anchorEl:n,onClose:o},i().createElement(Lt.List,{component:"div"},a.map(((e,t)=>((e,t,n)=>i().createElement(Lt.ListItem,{button:!0,component:"div",key:n,onClick:t},i().createElement(Lt.ListItemText,{primary:Ms[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))))};var Ns=n(47458);function Is(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=(e,t)=>e.filter(t).map((e=>e.columns?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Is(e,t,n[t])}))}return e}({},e,{columns:As(e.columns,t)}):e)),Ds=(0,l.memo)((e=>{let{anchorEl:t,onClose:n,actions:r,id:o,selectedAttributes:a,setSelectedAttributes:s,groupColumnsData:c}=e;const u=(0,l.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return As(e,(e=>!t.some((t=>e.id===t))))}(c,a)),[c,a]),[p,d]=(0,l.useState)(),[m,h]=(0,l.useState)(!1);(0,l.useEffect)((()=>{t&&h(!0)}),[t]);const f=()=>{d(null),h(!1),n()};return i().createElement(i().Fragment,null,i().createElement(js,{open:m,anchorEl:t,actions:r,onClose:()=>{h(!1),p||n()},onClick:e=>{if(e!==Ts.HIDE)d(e),h(!1);else{const e=[...a],t=a.indexOf(o);t>-1&&(e.splice(t,1),s(e),f())}}}),i().createElement(Ns.G,{hideCheckBox:!0,anchorEl:p?t:void 0,columnsData:u,selectedColumns:a,onColumnClick:e=>{let{id:t}=e;const n=[...a],r=a.indexOf(o),l=p===Ts.INSERT_ABOVE?r:r+1;n.splice(l,0,t),s(n),f()},onClose:f,title:q().text("Add row")}))}));function Zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bs="1px solid rgba(0,0,0,0.12)",Vs="rgb(245, 245, 245)",Ls=(0,Le.Z)((e=>({container:{overflow:"auto",height:"100%",width:"100%"},comparisonTableWrapper:{display:"flex",alignItems:"flex-start",position:"relative"},collapsedRow:{display:"none"},comparisonTable:{borderSpacing:0,"& tbody tr:hover td, & tbody tr:hover th":{backgroundColor:"rgb(235, 235, 235)"},"table& tbody tr:hover td:nth-child(2)":{backgroundColor:"rgb(215, 228, 239)"},"& td, & th":{borderRight:Bs,borderBottom:Bs,margin:0,verticalAlign:"top",textAlign:"left",fontSize:"13px",minHeight:"16px",boxSizing:"border-box",wordBreak:"break-word",wordWrap:"break-word",backgroundColor:"white"},"& td":{minWidth:310,maxWidth:310,padding:"16px",overflow:"hidden",height:0},"& td:empty, th:empty":{padding:"0px 16px"},"& th":{minWidth:212,maxWidth:212,padding:"16px"},"& thead tr:first-child th:first-child":{borderBottom:"none",borderTop:"none"},"& td:first-child, th:first-child":{borderLeft:Bs,position:"sticky",left:"0",zIndex:2,backgroundColor:Vs,color:e.palette.text.secondary,fontWeight:"normal"},"& td:nth-child(2), th:nth-child(2)":{borderRight:"2px solid rgba(0,0,0,0.12)",position:"sticky",left:"212px",zIndex:2},"& thead tr:first-child td, & thead tr:first-child th":{borderTop:"none",position:"sticky",top:"0",height:141,padding:0,zIndex:2},"& thead tr:nth-child(2) td, & thead tr:nth-child(2) th":{position:"sticky",top:"141px",height:50,padding:"16px",zIndex:2},"& thead tr:nth-child(2) th, & thead tr:nth-child(3) th":{padding:"16px",backgroundColor:Vs},"& thead tr:nth-child(-n+2) td:nth-child(-n+2), & thead tr:nth-child(-n+2) th:nth-child(-n+2)":{zIndex:3},"table& tr td:nth-child(2), th:nth-child(2)":{backgroundColor:"rgb(224, 238, 249)"}},emptyState:{position:"sticky",top:"10vh",display:"flex",width:"100%"}})));function zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Hs(e,t,n[t])}))}return e}function Hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs=[Ts.INSERT_BELOW,Ts.INSERT_ABOVE,Ts.HIDE],Ws=e=>{let{className:t,entity:n,metadata:r,config:o,selectedItems:a,setSelectedItems:s,selectedColumns:c,setSelectedColumns:u,entitiesMap:p={},columnsData:h,showNonOv:f=!1}=e;const g=Ls(),[b,y]=(0,l.useState)(null),[v,w]=(0,l.useState)(),[E,C]=(0,l.useState)(),x=(0,l.useMemo)((()=>a.slice(-4)),[a]),O=(0,l.useMemo)((()=>ks(c)),[c]),S=(0,l.useMemo)((()=>((e,t,n)=>n.map((n=>{const r=Cs.find((e=>{let{id:t}=e;return t===n}));if(r)return r;if(!(0,m.vZp)(n))return null;const o=(0,m.h2W)(n,t.type),a=(0,m.zeJ)(e,o,t.type),l=(0,m.xy8)(o);return a?{id:`${l}.${xs(o)}`,label:a.label,attributeType:a,cellRenderer:qi,headCellRenderer:(0,m.YkM)(a)?Ki:Yi}:null})).filter(d.identity))(r,n,O)),[r,n,O]),R=(0,l.useContext)(Rs),P=(0,l.useMemo)((()=>function(e,t,n,r,o,a,l){let i=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return[{object:n,isMainEntity:!0}].concat(r).map((r=>t.reduce(((t,s)=>(t[s.id]=Ss(e,r,o,n,s,a,l,i),vs({},t,{isDraggable:!r.isMainEntity,id:r.object.uri}))),{})))}(r,S,n,x,p,o,R,f)),[r,S,x,n,p,o,R,f]),[k,T]=(0,l.useState)({}),M=(0,l.useCallback)((e=>{T((t=>zs({},t,{[e]:!t[e]})))}),[]),j=(0,l.useMemo)((()=>({expandedMap:k,onExpandType:M})),[M,k]),N=(0,l.useMemo)((()=>({setHoveredId:w,setAnchor:C,hoveredId:v})),[v]),I=(0,l.useCallback)((()=>{w(null),C(null)}),[]),A=(0,l.useMemo)((()=>S.map((0,d.prop)("id"))),[S]),D=(0,l.useCallback)((()=>{y(null)}),[]),Z=(0,l.useMemo)((()=>({hoveredEntity:b,resetHoveredEntity:D})),[b,D]),{isThereAnyTask:B,setWorkflowTaskAvailability:V}=(e=>{const[t,n]=(0,l.useState)({}),r=(0,l.useCallback)(((e,t)=>{n((n=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Zs(e,t,n[t])}))}return e}({},n,{[e]:t})))}),[]);return{isThereAnyTask:(0,d.pipe)((0,d.map)(m.ev7),(0,d.any)((e=>t[e])))(e),setWorkflowTaskAvailability:r}})(x),L=B?void 0:g.collapsedRow,z=(0,l.useMemo)((()=>S.map((e=>L&&"workflowCard"===e.id?zs({},e,{rowClassName:L}):e))),[S,L]);return i().createElement("div",{className:De()(g.container,t)},i().createElement("div",{className:g.comparisonTableWrapper},i().createElement(Ji.Provider,{value:Z},i().createElement(Li.Provider,{value:j},i().createElement($i.Provider,{value:N},i().createElement(os.Provider,{value:V},i().createElement(Qe.Z,{className:g.comparisonTable,rowsData:z,columnsData:P,theadRowsNumber:2,onMoveRow:(e,t)=>{const n=(0,d.pipe)((0,d.groupBy)((e=>(0,m.vZp)(e)?(0,m.hWO)(e):e)),d.toPairs)(c),r=n.findIndex((t=>{let[n]=t;return n===e})),o=n.findIndex((e=>{let[n]=e;return n===t})),a=n[r];a&&u((0,d.pipe)((0,d.remove)(r,1),(0,d.insert)(o,a),(0,d.chain)((0,d.nth)(1)))(n))},onMoveColumn:(e,t)=>{const n=a.findIndex((t=>{let{object:n}=t;return n.uri===e})),r=a.findIndex((e=>{let{object:n}=e;return n.uri===t})),o=a[n];o&&s((0,d.pipe)((0,d.remove)(n,1),(0,d.insert)(r,o))(a))},setHoveredColumn:e=>{y((null==e?void 0:e.entityId)||null)},resetHoveredColumn:D}))))),!x.length&&i().createElement("div",{className:g.emptyState},i().createElement(Bi.ZP,{LogoRenderer:Bi.B9.SELECT_ATTRIBUTES,variant:Bi.tC.embedded,text:q().text("Select profiles"),secondaryText:q().text("Select one or more profiles to compare it with the current profile")})),i().createElement(Ds,{id:v,anchorEl:E,onClose:I,actions:Fs,selectedAttributes:A,setSelectedAttributes:u,groupColumnsData:h})))},_s=(0,Le.Z)({container:{display:"flex",flexDirection:"column"},table:{flex:1}}),Us=e=>{let{classes:t={},selectedColumns:n,setSelectedColumns:r,selectedItems:o,setSelectedItems:a,config:l,metadata:s,entity:c,entitiesMap:u={},columnsData:p,showNonOv:d}=e;const m=_s();return i().createElement("div",{className:De()(t.root,m.container)},i().createElement(Ws,{className:m.table,entity:c,metadata:s,config:l,selectedColumns:n,setSelectedColumns:r,selectedItems:o,setSelectedItems:a,columnsData:p,entitiesMap:u,showNonOv:d}))};function Gs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qs(e,t,n[t])}))}return e}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $s={position:"relative",whiteSpace:"pre",padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"},color:"rgba(0,0,0,0.87)"},Xs={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},Ys=(e,t)=>({"& > *":{position:"relative"},"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:e,pointerEvents:"none","div.hoveredRow &":{background:t||"none"}},"& $defaultWrapper::after":{background:`linear-gradient(to right, ${(0,ze.U1)(e,0)}, ${e} 100%)`,"div.hoveredRow &":{background:t&&`linear-gradient(to right, ${(0,ze.U1)(t,0)}, ${t} 100%)`}}}),Qs=(0,Le.Z)((e=>{const t=(0,ze.$n)(e.palette.primary.main,.88),n=(0,ze.$n)(e.palette.primary.main,.82),r=(0,ze.$n)("rgb(140,193,82)",.88),o=(0,ze.$n)("rgb(0, 114, 206)",.88),a={color:e.palette.primary.main,cursor:"pointer",textDecoration:"none"};return{link:a,hidden:{visibility:"hidden"},rowCloseIcon:{color:"rgba(0, 0, 0, 0.54)",margin:"0 24px 0 8px"},headCell:{display:"flex",alignItems:"center",height:"56px",fontSize:"12px",position:"relative",flex:1,overflow:"hidden",color:"rgba(0,0,0,0.87)",backgroundColor:"rgba(0, 0, 0, 0.06)","&::after":Gs({},Xs,{width:"30px",backgroundImage:"none"})},firstHeadCell:{paddingLeft:"42px"},headCellWithEntity:{height:"100%",display:"flex",flexDirection:"column"},rowCell:{fontSize:"12px",overflow:"hidden"},rowCellFirstColumn:{height:"100%"},firstEntityCell:{maxHeight:"200px"},entityRowCell:{fontSize:"12px",position:"relative"},entityRowCellSelected:Ys(o),rowCellHighlighted:Ys(r),rowCellSelected:Ys(t,n),defaultWrapper:Gs({},$s,{"&::after":Gs({},Xs,{"div.hoveredRow &":{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"}})}),hoveredDefaultWrapper:Gs({},$s),entityWrapper:{paddingLeft:"12px"},profileWrapper:{height:"100%",display:"flex",alignItems:"center",boxSizing:"border-box",position:"relative"},entityLabel:Gs({},a,{fontWeight:500}),commentsContainer:{position:"absolute",right:0,top:0,zIndex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"15px",backgroundColor:"#fff","&$checked":{backgroundColor:t}},checked:{},matchRulesWrapper:{padding:"8px 15px 8px 10px",display:"flex",flexDirection:"column",boxSizing:"border-box"},blobWrapper:Gs({},$s,{whiteSpace:"pre-wrap",height:"100px",boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}),imageWrapper:Gs({},$s,{display:"flex","& > img":{height:"64px",width:"64px"}}),referenceWrapper:{display:"flex",alignItems:"center",boxSizing:"border-box",height:"48px"},entityAvatar:{transform:"scale(0.5)",marginLeft:"-10px"},collapseButton:{position:"absolute",left:"40px",zIndex:2},dragIcon:{position:"absolute",left:"-5px",zIndex:2,opacity:.38},ovFalse:e.inactive}})),Ks=(0,fn.Z)((e=>{const t=Qs();return i().createElement("div",{className:t.headCell},i().createElement(hn.default,e))})),Js=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const{value:r,ov:o}=t,a=Qs();return i().createElement("div",{className:De()(a.defaultWrapper,{[a.ovFalse]:!1===o})},i().createElement(xn.Z,{value:r,dataTypeDefinition:n}))},ec=(0,Tn.Z)(((e,t)=>{let{onToggleSelect:n,entityToMatch:r}=e,{rowValue:o,value:a}=t;const{rawValue:l}=o;return{onRemove:()=>n(l),isRowRemovable:a!==r,entityToMatch:r}}))((e=>{let{value:t,rowIndex:n,rowValue:r,onRemove:o,entityToMatch:a,isRowSelected:s,hoverRowIndex:c}=e;const u=Qs(),p=(0,l.useContext)(Rn.B),d=t!==a,h=n===c,f=0===n,g=h?u.hoveredDefaultWrapper:u.defaultWrapper,b=t.uri!==a.uri&&!h;return i().createElement(i().Fragment,null,i().createElement("div",{className:De()(g,u.profileWrapper,u.entityWrapper,{[u.firstEntityCell]:f&&!d})},h&&i().createElement(Mn.Z,{className:u.dragIcon}),i().createElement(Pn.Z,{className:u.collapseButton,rowIndex:n,rowValue:r}),i().createElement(ct.Z,{icon:pt.default,size:"XS",className:De()(u.rowCloseIcon,{[u.hidden]:!d}),onClick:o,"data-reltio-id":`reltio-matches-table-${p?p+"-":""}checkbox-${n}`}),i().createElement(kn.Z,{value:(0,m.wwR)(t),className:u.entityLabel},(0,m.idV)(t.label)),b&&i().createElement(un.Z,{className:De()(u.commentsContainer,{[u.checked]:s}),uri:(0,m.E_P)(a.uri,t.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:a.uri,matchEntityUri:t.uri}),allowOnlyOneComment:!0})))})),tc=(0,Tn.Z)()((0,fn.Z)((e=>{const t=0===e.headIndex,n=Qs();return i().createElement("div",{className:De()(n.headCell,{[n.firstHeadCell]:t})},i().createElement(hn.default,e))}))),nc=e=>{let{value:t}=e;const n=Qs();if(!t)return null;const{metadata:r,match:o,entitiesMap:a,entity:l,variant:s}=t;return i().createElement("div",{className:n.matchRulesWrapper},i().createElement(ft.Z,{variant:s,metadata:r,entitiesMap:a,match:o,entity:l}))},rc=e=>{let{value:t}=e;const{value:n,ov:r}=t,o=Qs();return i().createElement("div",{className:De()(o.blobWrapper,{[o.ovFalse]:!1===r}),onScroll:T.UW},n)},oc=e=>{let{value:t}=e;const{value:n}=t,r=Qs(),o=(0,m.efz)({value:n});return o&&i().createElement("div",{className:r.imageWrapper},i().createElement("img",{src:o}))},ac=e=>{let{value:t}=e;const n=Qs(),r=(0,p.useSelector)(Se.ZP.selectors.getMetadata);return t&&i().createElement("div",{className:De()(n.defaultWrapper,n.referenceWrapper,{[n.ovFalse]:!1===t.ov})},i().createElement(Un.Z,{className:n.entityAvatar,entityType:(0,m.nt9)(r,(0,m.CZ8)(t).type)}),i().createElement(kn.Z,{value:(0,m.CZ8)(t).objectURI,className:n.link},(0,m.idV)(t.label)))},lc=e=>{let{value:t}=e;const n=Qs();return i().createElement("div",{className:n.defaultWrapper},i().createElement(ys,{value:t.crosswalks}))};function ic(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sc=(0,d.split)("."),cc=(e,t,n,r,o)=>n.map((n=>{const a=n.object,l=n.matchRules||[],i=n.matchScore||0,s=(0,m.w80)(e,a.type,l),c={entity:a,metadata:e,match:n,entitiesMap:o,matchScore:i},u=t.filter((e=>{let{modes:t}=e;return!t||t.includes(Yo.TABLE)}));return(0,d.pipe)((0,d.reduce)(((e,t)=>(0,d.assoc)(t.id,((e,t,n)=>{let{entity:r,metadata:o,match:a,entitiesMap:l,matchScore:i}=t;switch(e.id){case"profile":return r;case"entityId":return(0,m.BTI)(r);case"matchRules":return{metadata:o,match:a,entitiesMap:l,entity:r,variant:"all"};case"score":return i;case"sources":return{crosswalks:r.crosswalks};default:{const[t,...o]=sc(e.id);return(0,d.pipe)((0,d.prop)(t),(0,d.ifElse)((0,d.always)(n),(0,m.pfb)(o),(0,m.BgZ)(o)))(r)}}})(t,c,r),e)),{}),(0,d.assoc)("matchAttributes",s),(0,d.assoc)("rawValue",n))(u)})),uc=e=>{if((0,m.vZp)(e)){const[,...t]=sc(e);return t.length>1?t.slice(0,-1):null}return null},pc=e=>{switch(e.id){case"profile":return ec;case"matchRules":return nc;case"sources":return lc;default:return(e=>{switch(e){case m.oS0.TYPE_BLOB:return rc;case m.oS0.TYPE_IMAGE:return oc;case m.oS0.TYPE_REFERENCE:return ac;default:return Js}})(e.dataTypeDefinition.type)}};function dc(){return dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dc.apply(this,arguments)}const mc=(0,Tn.Z)(((e,t)=>{let{selected:n}=e,{columnData:r,rowValue:o,cell:a}=t;return{isRowSelected:!!n&&n.includes(o.rawValue),isCellHighlighted:sa(o.matchAttributes,r)&&!a.values.every(m.O27)}}))((e=>{let{rowValue:t,cell:n,CellValueRenderer:r,isRowSelected:o,isCellHighlighted:a,columnIndex:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["rowValue","cell","CellValueRenderer","isRowSelected","isCellHighlighted","columnIndex"]);const c=Qs(),u=0===l;return i().createElement("div",{className:De()({[c.rowCellSelected]:o,[c.rowCellHighlighted]:a,[c.rowCellFirstColumn]:u},c.rowCell)},n.values.map(((e,n)=>i().createElement(r,dc({key:n,value:e,rowValue:t,isRowSelected:o},s)))))})),hc=(0,Le.Z)((e=>({tableContainer:{flex:1,display:"flex",color:"rgba(0,0,0,0.54)",overflow:"hidden",background:e.palette.background.paper},rowActionButtonsWrapper:{height:"100%",display:"flex",alignItems:"center",marginRight:"1px"},rowActionButtons:{backgroundColor:"rgba(238, 238, 238, 1)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},commentsContainer:{paddingLeft:"6px",paddingRight:"15px",backgroundColor:"rgba(238, 238, 238, 1)",borderLeft:"1px solid rgba(0,0,0,0.12)","&$checked":{backgroundColor:(0,ze.$n)(e.palette.primary.main,.82)}},checked:{},actionButton:{marginLeft:"12px","&:last-child":{marginRight:"3px"}},hoveredRowRightContentContainer:{alignItems:"center !important"},dragColumnHead:{"& #headCell":{border:"1px solid",borderColor:e.palette.primary.main},"& #entityCell":{borderLeft:"1px solid",borderRight:"1px solid",borderLeftColor:e.palette.primary.main,borderRightColor:e.palette.primary.main}},dragColumnBody:{borderLeft:"1px solid",borderRight:"1px solid",borderLeftColor:e.palette.primary.main,borderRightColor:e.palette.primary.main}})));function fc(){return fc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fc.apply(this,arguments)}const gc=e=>{let{entity:t,matches:n,metadata:r,columnsData:o,onReorderingColumn:a,config:s,filters:c,onFilter:u,sorting:p,onSort:h,selected:f,onToggleSelect:g,onResetSelect:b,onSelectAll:y,entitiesMap:v,basicTableRef:w,isComparisonViewShown:E,showNonOv:C}=e;const x=hc(),[O,S]=(0,l.useState)(n);(0,l.useEffect)((()=>{S(n)}),[n]);const R=(0,l.useCallback)(((e,t)=>{S((0,d.move)(e,t)),q(t)}),[]),P=(0,l.useMemo)((()=>cc(r,o,O,C,v)),[r,o,O,C,v]),k=!!h,T=(0,l.useMemo)((()=>((e,t)=>(0,d.pipe)((0,d.filter)((e=>{let{modes:t}=e;return!t||t.includes(Yo.TABLE)})),(0,d.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ic(e,t,n[t])}))}return e}({sortable:e},t,{resizable:!0,nestedPath:uc(t.id),headCellRenderer:"profile"===t.id?tc:Ks,rowCellValueRenderer:pc(t),draggable:(0,d.propOr)(!0,"draggable")(t)}))))(t))(k,o)),[o,k]),M=(0,l.useMemo)((()=>t?cc(r,o,[{object:t}],C):[]),[t,r,o,C]),{getRowHeight:j,CellRenderer:N}=(0,sn.Z)({rowsData:M,columnsData:T,maxRowValuesCount:3}),I=j(0),A=(0,l.useMemo)((()=>{const e=(e=>t=>n=>{const r=Qs();return i().createElement(Rn.B.Provider,{value:"tableHeader"},i().createElement("div",{className:r.headCellWithEntity},i().createElement("div",{id:"headCell"},i().createElement(t,n)),i().createElement(e,{className:De()(r.entityRowCell,r.entityRowCellSelected),columnId:n.headCellData.id,rowIndex:0,id:"entityCell"})))})(N);return T.map((0,d.evolve)({headCellRenderer:e}))}),[T,N]),D=(0,l.useCallback)((e=>{let{what:t,where:n}=e;const r=T[t.columnIndex].id,o=T[n.columnIndex].id;a(r,o)}),[T]),Z=(0,l.useMemo)((()=>({isAllSelected:f.length>0&&f.length===n.length,entityToMatch:t,selected:f,onToggleSelect:g,onResetSelect:b,onSelectAll:y,isComparisonViewShown:E})),[t,f,g,b,y,n,E]),{getDynamicRowCellHeight:B,changeRowCellHeight:V,clearHeightsCache:L}=(0,cn.Z)();(0,l.useLayoutEffect)(L,[n]);const[z,H]=(0,l.useState)(!1),F=(0,l.useCallback)((()=>H(!0)),[]),W=(0,l.useCallback)((()=>H(!1)),[]),[_,U]=(0,l.useState)(!1),[G,q]=(0,l.useState)(null),$=(0,l.useCallback)((e=>{q((t=>z||_?t:e))}),[z,_]),{showDialog:X,openAddRelationDialog:Y,AddRelationDialogRenderer:Q}=zl(s),K=(0,l.useMemo)((()=>{if(null===G)return null;const e=O[G];if(!e)return null;const n=(0,m.hXd)(r,s,e.object,t,e.matchRules),o=f.includes(e);return i().createElement("div",{className:De()(x.rowActionButtonsWrapper)},i().createElement("div",{className:De()(x.rowActionButtons,{[x.checked]:o})},i().createElement(es,{value:{mainEntity:t,entity:e.object,matchRules:e.matchRules,permission:n},openAddRelationDialog:Y,onActionsMenuClose:W,onActionsMenuOpen:F,classes:{actionButton:x.actionButton,moreOptions:x.actionButton}})),t&&i().createElement(un.Z,{className:De()(x.commentsContainer,{[x.checked]:o}),uri:(0,m.E_P)(t.uri,e.object.uri),objectType:m.q7e.POTENTIAL_MATCH,relatedObjectUris:(0,m.wp9)(m.q7e.POTENTIAL_MATCH,{entityUri:t.uri,matchEntityUri:e.object.uri}),onChangePopupVisibility:U,allowOnlyOneComment:!0,showAlways:!0}))}),[G,O,f,x,t,s,r,F,W,Y]),J=(0,l.useCallback)((e=>{switch(e.columnData.id){case"profile":return i().createElement(mc,fc({},e,{hoverRowIndex:G,actionsContent:K,tableRef:w}));case"matchRules":return i().createElement(pn.Z,fc({onChangeHeight:V},e),i().createElement(mc,e));default:return i().createElement(mc,e)}}),[V,G,K,w]),ee=(0,l.useCallback)((0,d.either)(B,dn.Z),[B,dn.Z]),te=(0,l.useMemo)((()=>({hoveredRowRightContentContainer:x.hoveredRowRightContentContainer,dragColumnHead:x.dragColumnHead,dragColumnBody:x.dragColumnBody})),[x]);return i().createElement("div",{className:x.tableContainer},i().createElement(mn.Z,{fixFirstColumn:!0,columnsData:A,rowsData:P,context:Z,sorting:p,onSort:h,filters:c,onFilter:u,defaultColumnWidth:250,defaultColumnMinWidth:100,headRowHeight:56+I,renderRowCell:J,getRowCellHeight:ee,hoverStateEnabled:!0,hoveredRowRightContent:K,hoverRowIndex:G,onRowHover:$,classes:te,maxRowValuesCount:3,dndRowReorderingEnabled:!0,dndColumnReorderingEnabled:!0,dndColumnReorderingHandler:D,dndRowReorderingHandler:R,ref:w,hoveredContentPosition:0}),X&&i().createElement(Q,null))},bc=(0,Le.Z)({comparisonView:{width:"100%",overflow:"auto"}});function yc(){return yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yc.apply(this,arguments)}const vc=e=>{let{config:t,isLoaded:n,savedState:r,onUpdateSavedState:o}=e;const a=(0,p.useSelector)(Se.ZP.selectors.getMetadata),s=(0,p.useSelector)(Se.ZP.selectors.getEntity),{tableViewModeAvailable:c}=t,{selectedItems:u,entitiesMap:h,comparisonViewMode:f}=Ta(),{toggleSelect:g,setSelectedItems:y,setComparisonViewMode:v}=Ma(),{isGlobalSpinnerActive:w}=Ua(),{uri:E}=s||{};((e,t)=>{const{setSelectedItems:n}=Ma(),r=(0,d.prop)("uri",t),o=(0,d.prop)("dataTenant",t),a=(0,l.useMemo)((()=>({enabled:!!r,entity:t,filter:"",page:0,sorting:{field:"score",order:"desc"},rowsPerPage:3,options:Yl})),[o,r]),{matches:i}=Il(a);(0,l.useEffect)((()=>{n(i)}),[i,n])})(0,s);const C=(0,l.useMemo)((()=>(0,m.NVY)(E,Object.keys(h))),[E,h]),x=(0,Ar.C)({objectIds:C}),S=bc(),[R,P,k]=(e=>{let{defaultColumnsData:t,additionalColumnsData:n,metadata:r,entityTypeUri:o}=e;return(0,l.useMemo)((()=>{const e=la(r,o),a=t.concat(n||[]).concat(e),l=(0,m.qhs)(r,o),i=((e,t)=>{const[n,r]=(0,d.pipe)((0,d.reject)(ca),(0,d.partition)(sa(e)))(t);return n.length?[{id:"match",label:q().text("Match attributes"),columns:t.filter(ma(n))},{id:"all",label:q().text("All attributes"),columns:t.filter(ma(r))}]:t})(l,a);return[a,i,(0,d.pipe)(ha,(0,d.concat)(t),ia)(l,e)]}),[t,n,r,o])})({defaultColumnsData:cs,metadata:a,entityTypeUri:s.type}),[T,M]=(0,l.useState)(k),[j,N]=(0,l.useState)(!1),I=(0,l.useMemo)((()=>T.map((e=>R.find((0,d.propEq)("id",e)))).filter(d.identity)),[T,R]),A=(0,l.useCallback)(((e,t)=>{const n=T.indexOf(e),r=T.indexOf(t);M((0,d.move)(n,r))}),[T]),D={entity:s,metadata:a,selectedItems:u||[],setSelectedItems:y,config:t,selectedColumns:T,setSelectedColumns:M,entitiesMap:h,columnsData:P,showNonOv:j},Z={entity:s,metadata:a,entitiesMap:h,config:t,matches:u,columnsData:I,onReorderingColumn:A,onSelectAll:()=>{},onToggleSelect:g,onResetSelect:()=>{},selected:[],isComparisonViewShown:!1,showNonOv:j};return(0,l.useEffect)((()=>{n&&(null!=r&&r.visibleColumns&&M(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=(0,d.pipe)((0,d.filter)((0,d.propEq)("hideable",!1)),(0,d.map)((0,d.prop)("id"))),n=(0,d.pipe)(d.concat,d.uniq),r=t(cs);return n(r,e)}(r.visibleColumns)),null!=r&&r.comparisonViewMode&&v(c?r.comparisonViewMode:Yo.COLUMNS),(0,d.has)("showNonOv",r)&&N(r.showNonOv))}),[n]),(0,l.useEffect)((()=>{n&&o({comparisonViewMode:f,visibleColumns:T,showNonOv:j})}),[T,f,j]),i().createElement(i().Fragment,null,i().createElement(Zi,{config:t,columnsData:P,selectedColumns:T,onChangeColumns:M,showNonOv:j,onChangeShowNonOv:N}),i().createElement(Dr.h.Provider,{value:x},f===Yo.COLUMNS?i().createElement(b.l,null,i().createElement(Rs.Provider,{value:g},n&&i().createElement(Us,yc({},D,{classes:{root:S.comparisonView}})))):n&&i().createElement(gc,Z)),w&&i().createElement(O.Z,null))};var wc=n(81137);function Ec(){return Ec=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ec.apply(this,arguments)}const Cc=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return i().createElement("svg",Ec({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),i().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.25 3H3.75c-.825 0-1.5.675-1.5 1.5v9c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5v-9c0-.825-.675-1.5-1.5-1.5zm-9 10.5h-1.5v-6h1.5v6zM3.75 6h1.5V4.5h-1.5V6zm6 7.5h-3v-6h3v6zm-3-7.5h3V4.5h-3V6zm7.5 7.5h-3v-6h3v6zm-3-7.5h3V4.5h-3V6z",fill:"#000",fillOpacity:".541"}))},xc=(0,Le.Z)({flexBox:{display:"flex",alignItems:"center"},icon:{display:"flex",alignItems:"center",margin:"0 4px"}}),Oc=()=>{const{selectedItems:e,comparisonViewMode:t,limitSelection:n}=Ta(),{setComparisonViewMode:r,deleteExtraMatches:o}=Ma(),a=xc(),s=(0,l.useCallback)((()=>{r(Yo.TABLE)}),[r]),c=t===Yo.COLUMNS&&e.length>n,u=q().text("Switch to table view"),p=i().createElement("div",{className:a.flexBox},q().text("Please switch to"),i().createElement("div",{className:a.icon},i().createElement(Cc,null)),q().text("Table View to compare more than ${max} profiles",{max:4}));return i().createElement(wc.Z,{open:c,title:u,content:p,onSave:s,onDiscard:o,saveCaption:q().text("Proceed"),discardCaption:q().text("Cancel")})},Sc=(0,Le.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},potentialMatchesWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},potentialMatchesContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function Rc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pc(e,t,n[t])}))}return e}function Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kc=e=>{let{config:t,getSavedState:n,saveState:r}=e;const o=Sc(),a=(0,p.useSelector)(Se.ZP.selectors.getEntity),{SnackbarRenderer:s,showSnackbarMessage:c}=(0,No.D)(),u=(0,l.useRef)(),{tableViewModeAvailable:m}=t,{isLoaded:h,savedState:f,updateSavedState:g}=(0,Io.w)({getSavedState:n,saveState:r,entityTypeUri:a.type});(0,l.useEffect)((()=>{h&&(u.current=f||{})}),[h,f]);const b=(0,l.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!u.current)return;const t=Rc({},u.current,e);(0,d.equals)(t,u.current)||(g(t),u.current=t)}),[g]);return i().createElement(ka,{tableViewModeAvailable:m},i().createElement(ea,null,i().createElement(Ao.S.Provider,{value:c},i().createElement("div",{className:o.perspectiveView},(null==a?void 0:a.uri)&&i().createElement("div",{className:o.potentialMatchesContainer},i().createElement("div",{className:o.potentialMatchesWrapper},i().createElement(Lo,null),i().createElement(vc,{config:t,isLoaded:h,savedState:f,onUpdateSavedState:b})),i().createElement(Oi,{config:t,isLoaded:h,savedState:f,onUpdateSavedState:b}),i().createElement(s,null),m&&i().createElement(Oc,null))))))};var Tc=n(39450);const Mc=(0,c.createGenerateClassName)({productionPrefix:"potentialMathcesView",disableGlobal:!0}),jc=e=>{let{config:t,store:n,onResize:o=d.identity,saveState:a,getSavedState:h}=e;const f=(0,l.useCallback)((0,m.aYu)(h),[h]),g=(0,l.useCallback)((0,m.DsO)(a,3e3),[a]);return i().createElement(p.Provider,{store:n},i().createElement(Tc.m.Provider,{value:t.id},i().createElement(c.StylesProvider,{generateClassName:Mc},i().createElement(u.MuiPickersUtilsProvider,{utils:r.Z},i().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&(!1!==t.newView?i().createElement(kc,{config:t,saveState:g,getSavedState:f}):i().createElement(jo,{config:t,saveState:a,getSavedState:f})),i().createElement(ye.Z,null)))))};jc.propTypes={config:m.yxQ,store:a().object,onResize:a().func,saveState:a().func,getSavedState:a().func};const Nc=jc}}]);
|
|
2
2
|
//# sourceMappingURL=7952.js.map
|