@reltio/remotes 1.4.1039 → 1.4.1043

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/2958.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2958],{91431:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(3073),s=r(28831),c=r(71153),u=r.n(c);const p=(0,r(79692).Z)((()=>({hidden:{visibility:"hidden"}}))),d=e=>{let{rowIndex:t,rowValue:r,className:o}=e;const l=p(),{toggleRowCollapse:c,getIsRowCollapsible:d,getIsRowCollapsed:m}=(0,n.useContext)(i.x),h=d(r),g=m(t);return a().createElement(s.Z,{className:u()(o,{[l.hidden]:!h}),isOpen:!g,onClick:e=>{c(t),e.stopPropagation()}})};d.propTypes={rowIndex:l().number,rowValue:l().object,className:l().string};const m=d},80560:(e,t,r)=>{r.d(t,{Z:()=>C});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(87918),s=r.n(i),c=r(71153),u=r.n(c),p=r(17440),d=r(18435),m=r(22311),h=r(33117),g=r(41008),f=r(63485),b=r(26638),y=r(94792);const v=(0,r(79692).Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{let{open:t,anchorEl:r,data:o,onSearch:l,onClose:i,titleText:s,filterText:c,onListItemClick:w,selected:O,hideCheckBox:C,renderGroupTitle:T}=e,k=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const S=(0,n.useCallback)((e=>e.label.toLowerCase().includes(c.toLowerCase())),[c]),I=(0,n.useCallback)((e=>S(e)||(e.children||[]).some(I)),[S]),P=(0,n.useMemo)((()=>{const e=(0,p.curry)(((e,r,n,a)=>[{item:x({},r,{filterText:c}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=t=>e(a,t,r,n),l=t.filter(I);return(T?p.map:p.chain)(o,l)};return t}),[c,T,I]),N=(0,n.useCallback)((e=>e.map((e=>({item:e,items:P(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[P]),D=(0,n.useCallback)((e=>{let{item:t}=e;w(t,!O.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[w,O]),R=(0,n.useMemo)((()=>(T?N:P)(o)),[o,T,N,P]),j=(0,n.useMemo)((()=>(0,g.LG)(R)),[R]),{focusIndex:Z,handleKeyDown:_}=(0,b.t)({items:j,open:t,onSelectFocusedItem:D,selectedItems:O}),A=(0,n.useRef)(null);A.current=Z;const M=(0,n.useCallback)(((e,t,r)=>{let{item:n,level:o=0}=t;const l=!!O.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),i=A.current===r;return a().createElement(h.Z,{key:n.id,onClick:w,checked:l,level:o,data:n,label:a().createElement(y.Z,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:C,isFocused:i,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[C,w,O]),L=(0,d.fW1)("label")(R)||308,F=v();return a().createElement(m.Z,E({open:t,className:u()(F.container,F.popupContainer),anchorEl:r,onClose:i,onSearch:l,title:s,containerWidth:L,searchInputOnKeyDown:_},k),a().createElement(f.Z,{height:300,renderItem:M,items:j,hideSubtitles:!0,getItemSize:()=>32,containerWidth:L,focusIndex:Z,renderGroupTitle:T}))};O.propTypes={open:l().bool,hideCheckBox:l().bool,anchorEl:l().any,selected:l().array,data:l().array,filterText:l().string,titleText:l().string,onClose:l().func,onListItemClick:l().func,onSearch:l().func,renderGroupTitle:l().func},O.defaultProps={data:[],selected:[],titleText:s().text("Show/hide columns"),filterText:""};const C=O},22118:(e,t,r)=>{r.d(t,{Z:()=>h});var n=r(24328),a=r.n(n),o=r(87918),l=r.n(o),i=r(77277),s=r(8629),c=r(49429),u=r(38724),p=r(55999),d=r(79249);const m=(0,r(79692).Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),h=e=>{let{open:t,title:r,content:n,onCancel:o,cancelCaption:h=l().text("Cancel"),onDiscard:g,discardCaption:f="",onSave:b,saveCaption:y=l().text("Save"),disabledSave:v=!1}=e;const E=m();return a().createElement(s.Z,{open:t,onClose:o,classes:{paperScrollPaper:E.paper}},a().createElement(d.Z,{classes:{root:E.title}},r),a().createElement(u.Z,{classes:{root:E.content}},a().createElement(p.Z,{classes:{root:E.contentText}},n)),a().createElement(c.Z,{className:E.actionButtons,disableSpacing:!0},o&&a().createElement(i.Z,{onClick:o},h),a().createElement("div",null,g&&a().createElement(i.Z,{onClick:g,classes:{root:E.discardButton}},f),a().createElement(i.Z,{onClick:b,color:"primary",disabled:v,autoFocus:!0},y))))}},85596:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(18435),s=r(17440),c=r(64651),u=r(65629);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const d=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:o=[],onChange:l=s.identity,applyFirstByDefault:i=!1,reversedContextLabels:d=!1}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:h,fromEditorValue:g,toEditorValue:f}=(0,c.n)({reversedContextLabels:d}),b=(0,n.useMemo)((()=>h(r,o)),[h,r,o]),y=(0,n.useCallback)((0,s.pipe)(g(r,o),l),[g,r,o,l]);return(0,n.useEffect)((()=>{i&&b.length&&y(b[0])}),[b,i,y]),a().createElement(u.Z,p({value:f(t,b),options:b,onChange:y},m))};d.propTypes={className:l().string,relation:i.bNA,inRelationTypes:l().arrayOf(i.IYE),outRelationTypes:l().arrayOf(i.IYE),applyFirstByDefault:l().bool,reversedContextLabels:l().bool,onChange:l().func};const m=d},87086:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),o=r(4190),l=r(60364);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}const s=e=>{let{open:t=!0,children:r}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[c,u]=(0,n.useState)(t),p=(0,l.Z)().transitions.duration.leavingScreen;return(0,n.useEffect)((()=>{if(t!==c){if(!t){const e=setTimeout((()=>{u(!1)}),p);return()=>clearTimeout(e)}u(!0)}}),[t,p,c]),a().createElement(o.ZP,i({open:t},s),c&&r)};s.displayName="Drawer";const c=s},19304:(e,t,r)=>{r.d(t,{J:()=>c});var n=r(24328),a=r.n(n),o=r(87918),l=r.n(o),i=r(7522);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}const c=e=>a().createElement(i.Z,s({message:l().text("No data available")},e))},44363:(e,t,r)=>{r.d(t,{Z:()=>f});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(17440),s=r(80030),c=r(79692);function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){p(e,t,r[t])}))}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d=(0,i.range)(2,10).reduce(((e,t)=>u({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),m=(0,c.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":u({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},d,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}const g=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const o=m(),l=t&&t.length?a().createElement("div",{className:o.tooltipContent},a().createElement("p",null,(0,i.last)(t)),t.length>2&&a().createElement("ul",null,t.map((e=>a().createElement("li",{key:e},e))))):"";return a().createElement(s.ZP,h({title:l,disableFocusListener:!0,classes:{tooltip:o.tooltip}},n),r)};g.propTypes={pathToTitle:l().arrayOf(l().string).isRequired,children:l().node};const f=g},76283:(e,t,r)=>{r.d(t,{E:()=>m,Z:()=>h});var n=r(24328),a=r.n(n),o=r(4614),l=r(39475),i=r(61932),s=r(27291),c=r(79573),u=r(71153),p=r.n(u);const d=(0,r(79692).Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let m;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(m||(m={}));const h=e=>{let{classes:t={},tooltip:r="",onClick:n=c.ZT,mode:u=m.INIT}=e;const h=d();return a().createElement("div",{className:p()(h.root,t.root)},(()=>{switch(u){case m.INIT:return a().createElement(l.k,{className:t.button,size:"M",tooltipTitle:r,icon:i.Z,onClick:n});case m.PROGRESS:return a().createElement(o.Z,{className:t.spinner,size:24});case m.SUCCESS:return a().createElement(s.Z,{className:p()(h.check,t.check)});default:return null}})())}},91026:(e,t,r)=>{r.d(t,{Z:()=>f});var n=r(24328),a=r.n(n),o=r(71153),l=r.n(o),i=r(52730),s=r(18435),c=r(89810);const u=(0,r(79692).Z)((e=>({container:{position:"relative",display:"flex",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,padding:"8px 8px 8px 0",overflow:"hidden"},colorBox:{position:"absolute",opacity:.12,top:0,left:0,bottom:0,width:"32px"},image:{width:"32px",height:"32px"},avatar:{marginRight:"8px",marginLeft:"16px",marginTop:"2px"},info:{overflow:"hidden",display:"flex",flexDirection:"column"},firstRow:{width:"100%"},label:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:500,color:e.palette.primary.main},link:{textDecoration:"none"},secondRow:{wordWrap:"break-word",marginTop:"4px",lineHeight:"13px",fontSize:"11px"},thirdRow:{display:"flex",alignItems:"center",fontSize:"12px",color:e.palette.text.secondary,marginTop:"auto"}})));var p=r(37573),d=r(18527),m=r(83088),h=r(20146);function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const f=(0,n.memo)((e=>{let{entity:t,classes:r={},disableEntityTypeColor:n}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","disableEntityTypeColor"]);const f=u(),{secondaryLabel:b,label:y,container:v}=r,E=(0,i.useSelector)(c.ZP.selectors.getMetadata),x=(0,s.idV)(t.label),{secondaryLabel:w,type:O}=t,C=(0,s.nt9)(E,O)||{},T=(0,s.VD3)(E,C,"typeColor")||s.rSc.palette.primary.main;return a().createElement("div",g({className:l()(f.container,v)},o),a().createElement("div",{className:f.colorBox,style:n?void 0:{backgroundColor:T}}),a().createElement(p.Z,{entity:t,avatarClassName:f.avatar,imageClassName:f.image}),a().createElement("div",{className:f.info},a().createElement("div",{className:f.firstRow},a().createElement(d.Z,{value:(0,s.wwR)(t),className:f.link},a().createElement(m.C,{value:x,placement:"top",showOnExceededHeight:!0},a().createElement("span",{className:l()(f.label,y)},x)))),a().createElement("div",{className:f.secondRow},w&&a().createElement(m.C,{value:w,placement:"top",showOnExceededHeight:!0},a().createElement("span",{className:b},w))),a().createElement("div",{className:f.thirdRow},a().createElement(h.Z,{entity:t}),a().createElement("div",null,(0,s.BTI)(t)))))}))},66072:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(52730),a=r(89810),o=r(24328),l=r.n(o),i=r(71153),s=r.n(i),c=r(17440),u=r(18435),p=r(20146),d=r(18527),m=r(37573),h=r(76283);const g=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),f=e=>{e&&clearTimeout(e)},b=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:o}=t;return r>=0&&n>o&&n<o+a}};var y=r(55962),v=r(79692),E=r(41128);const x=(0,v.Z)((e=>({"@keyframes animate":{from:{background:"transparent"},"66%":{background:"#f2e68e"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1},item:{display:"flex",minHeight:"40px",borderBottom:"1px solid rgba(0, 0, 0, 0.1)",flexDirection:"row","&:after":{content:"",minHeight:"inherit",fontSize:0},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},clickable:{cursor:"pointer"},selected:{background:(0,E.U1)(e.palette.primary.main,.12),"&:hover":{background:(0,E.U1)(e.palette.primary.main,.24)}},inactive:{background:e.inactiveBackground,"&:hover":{background:e.inactiveHoverBackground},"&$selected":{background:e.inactiveSelectedBackground,"&:hover":{background:e.inactiveSelectedHoverBackground}}},justImported:{backgroundColor:"#FFFBEB !important"},avatar:{marginLeft:"20px"},image:{height:"32px",width:"32px",marginTop:"8px",marginBottom:"7px"},info:{marginLeft:"20px",flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:"13px",width:"100%",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word"},label:{fontSize:"13px",lineHeight:"15px",fontWeight:500,color:e.palette.primary.main,marginRight:"17px",textDecoration:"none"},secondaryLabel:{marginRight:"12px"},businessCard:{color:"rgba(0, 0, 0, 0.54)"},secondRow:{display:"flex",marginTop:"2px",alignItems:"center",color:"rgba(0, 0, 0, 0.54)",fontSize:"12px"}}))),w=(0,n.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{entities:t,metadata:r,entityToHighlight:n,selectedEntityUri:a,onEntityClick:i,onEntityHover:v,entitiesImportStatus:E,entityButtonsRenderer:w}=e;const O=x(),C=(0,o.useRef)(null),T=(0,o.useRef)(null);return(0,y.D)((()=>{if(n){var e;const r=null===(e=C.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${n}']`);if(f(T.current),(null==r?void 0:r.length)>0){var t;const e=null===(t=C.current)||void 0===t?void 0:t.parentElement;b(r[0],e)||(g(r[0]),T.current=setTimeout((()=>{b(r[0],e)||g(r[0])}),1e3))}}return()=>{f(T.current)}}),[n]),l().createElement("div",{ref:C},(t||[]).map((e=>{const t=(0,u.idV)(e.label),o=e.secondaryLabel,g=(0,u.ptG)(r,e),f=(0,u.Fn9)(e),b=e.uri,y=(0,u.wwR)(e),x=(0,c.prop)(b,E);return l().createElement("div",{key:b,className:s()(O.item,{[O.clickable]:!!i,[O.selected]:b===a,[O.highlighted]:b===n,[O.inactive]:!f,[O.justImported]:x===h.E.SUCCESS}),onClick:i?()=>i(b):void 0,onMouseEnter:v?()=>v(b):void 0,onMouseLeave:v?()=>v(null):void 0,"data-entity-uri":b},l().createElement(m.Z,{entity:e,avatarClassName:O.avatar,imageClassName:O.image}),l().createElement("div",{className:O.info},l().createElement("div",null,l().createElement(d.Z,{value:y,className:O.label},t),o&&l().createElement("span",{className:O.secondaryLabel},o," "),g&&l().createElement("span",{className:O.businessCard},g)),l().createElement("div",{className:O.secondRow},l().createElement(p.Z,{entity:e}),l().createElement("div",null,(0,u.BTI)(e)))),w&&w(e))})))}))},88357:(e,t,r)=>{r.d(t,{Z:()=>O});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(71153),s=r.n(i),c=r(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=r(87918),d=r.n(p),m=r(6782);const h="46px",g=(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}}))),f=e=>{let{className:t,rowData:r}=e;const n=g();return a().createElement("div",{className:s()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,m.Z)(r.operator):d().text("Where"))};f.propTypes={className:l().string,rowData:l().object};const b=f;var y=r(18435);const v=e=>{let{className:t,rowData:r}=e;const n=g();return a().createElement("div",{className:s()(n.readOnlyFilter,t)},r&&r.filter?(0,y.XS2)(r.filter):d().text("equals"))};v.propTypes={className:l().string,rowData:l().object};const E=v;var x=r(53862);const w=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:o=b,AttributeSelectorComponent:l,FilterSelectorComponent:i=E,ValuesEditorComponent:c,ActionsComponent:p,filterSelectorRef:d,attributeSelectorProps:m={}}=e,h=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const g=u();return a().createElement("div",{className:s()(g.row,t.root)},a().createElement(o,{className:t.logicOperatorContainer,rowContext:h,rowData:n}),a().createElement("div",{className:s()(g.rowItem,t.attributeSelectorContainer)},a().createElement(l,{attributeSelectorProps:m,rowContext:h,rowData:r})),a().createElement("div",{className:s()(g.rowItem,t.filterSelectorContainer)},a().createElement(i,{textFieldInputRef:d,rowContext:h,rowData:r})),a().createElement("div",{className:s()(g.rowItem,g.fullWidth,t.valuesEditorContainer)},a().createElement(c,{rowContext:h,rowData:r})),a().createElement("div",{className:s()(g.rowItem,t.actionsContainer,{[g.hidden]:!r})},a().createElement(p,{rowContext:h,rowData:r})))};w.propTypes={classes:l().shape({root:l().string,logicOperatorContainer:l().string,attributeSelectorContainer:l().string,filterSelectorContainer:l().string,valuesEditorContainer:l().string,actionsContainer:l().string}),rowData:x.Xw,previousRowData:x.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 O=(0,n.memo)(w)},51586:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(17440),s=r(88357),c=r(53862);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:o,filterSelectorRef:l,filterSelectorRefIndex:c}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const d=(e,t,n)=>{const d=t>0?(0,i.path)([t-1],n):null,m=t===n.length?{attributeSelectorProps:o}:{};return a().createElement(s.Z,u({key:e&&e.id,rowData:e,previousRowData:d,classes:r,filterSelectorRef:t===c?l:void 0},p,m))};return a().createElement("div",{className:t},n.map(d),d(null,n.length,n))};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,n.memo)(p)},2633:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(54573),a=r(17440);const o={BY_LABEL:(0,n.c)({stringify:(0,a.prop)("label")})}},68977:(e,t,r)=>{r.d(t,{U:()=>c});var n=r(24328),a=r.n(n),o=r(87918),l=r.n(o),i=r(18435),s=r(72108);const c=(0,n.memo)((e=>{let{relationTypes:t,selectedRelationTypes:r,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d={},ListLabelProps:m={},disabled:h=!1}=e;const g=(0,n.useMemo)((()=>t.filter(i.Tt2)),[t]);return a().createElement(s.S,{items:g,selectedItemsUris:r,single:o,placeholder:c,enableEmptyValueUnderline:u,onChange:p,classes:d,ListLabelProps:m,disabled:h,label:l().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:l().text("Select relation types")})}));c.displayName="RelationTypesSelector"},62116:(e,t,r)=>{r.d(t,{Z:()=>G});var n=r(24328),a=r.n(n),o=r(17440),l=r(17871),i=r(75047);const s=e=>{let{children:t,className:r,position:a,map:o}=e;const[l,s]=(0,n.useState)(null);return(0,n.useEffect)((()=>{const e=document.createElement("div"),t=o.controls[a].length;return o.controls[a].push(e),s(e),()=>{o.controls[a].removeAt(t)}}),[o,a]),(0,n.useEffect)((()=>{l&&r&&l.classList.add(r)}),[r,l]),l?(0,i.createPortal)(t,l):null};var c=r(87918),u=r.n(c),p=r(77277),d=r(78223),m=r(41039);const h="circle",g="polygon",f=.001;function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(this,arguments)}const y=e=>a().createElement("svg",b({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}const E=e=>a().createElement("svg",v({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Draw_svg__a"})),a().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},a().createElement("path",{d:"M0 0h24v24H0z"}))));var x=r(79692);const w=(0,x.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),O=(0,d.Z)(p.Z),C=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:o,onClearOverlay:l}=e;const i=w(),s=e=>()=>{o(e)};return a().createElement("div",{className:i.container},t||n?a().createElement(O,{tooltipTitle:u().text("Clear area"),className:i.button,onClick:n?l:s(null)},a().createElement(m.Z,{className:i.icon})):r.map((e=>{const t=(e=>{switch(e){case h:return y;case g:return E;default:return null}})(e);return a().createElement(O,{tooltipTitle:u().text("Draw area"),key:e,className:i.button,onClick:s(e)},a().createElement(t,{className:i.icon}))})))};var T=r(5806),k=r(21324);const S=(0,x.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",padding:"5px","& svg":{width:"16px",height:"16px"}}}),I=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=S();return a().createElement(T.Z,{classes:{root:n.container,label:n.label},control:a().createElement(k.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:u().text("Search as I move the map")})},P=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),o=r.lng(),l=n.lat(),i=n.lng(),s=[],c=[];if(!(180===o&&-180===i||-180===o&&180===i)){const e=t.getCenter();s.push([a,e.lng()]),c.push([l,e.lng()])}return[[a,o],...s,[a,i],[l,i],...c,[l,o]]},N=e=>{switch(e){case h:return window.google.maps.drawing.OverlayType.CIRCLE;case g:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},D=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}};var R=r(91026),j=r(7421),Z=r(18435),_=r(3064);const A=(0,x.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function M(){return M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}const L=(0,Z.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),F=(0,Z.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),B=(0,n.memo)((e=>{let{marker:t,onClick:r}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const s=A(),c=(0,n.useRef)(),[u,p]=(0,n.useState)(!1),{activeEntityUri:d}=(0,n.useContext)(_.P),m=(0,o.pathEq)(["entity","uri"],d,t),h={lat:t.point.lat,lng:t.point.lng},g=(0,n.useCallback)((0,Z.DsO)(p,50),[]),f=(0,n.useCallback)((()=>g(!0)),[g]),b=(0,n.useCallback)((()=>g(!1)),[g]),y=(0,n.useCallback)((()=>r(t)),[r,t]);return a().createElement(a().Fragment,null,a().createElement(j.Z,{anchorEl:c.current,open:u,className:s.popper,modal:!1,placement:"top"},a().createElement(R.Z,{entity:t.entity,onMouseOver:f,onMouseOut:b})),a().createElement(l.Jx,M({icon:{url:u||m?L:F,scaledSize:new google.maps.Size(22,32)},position:h,onClick:y,visible:!1!==t.visible,onMouseOver:f,onMouseOut:b},i)),a().createElement(l.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:h},a().createElement("span",{ref:c})))}));var V=r(53857);const z=(0,x.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var U=r(90690);function H(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const W=["drawing"],G=e=>{let{markers:t=[],mapKey:r,defaultZoom:i,defaultCenter:c,loadingElement:u,isSearchOnMapMove:p,isSearchEnabled:d,activeOverlay:m,overlayOptions:h,drawingModes:g=[],markerClusterer:b,markerClustererOptions:y,mapContainerClassName:v,onMapBoundsChanged:E,onOverlayUpdated:x,onMarkerClicked:w}=e;const O=z(),{isLoaded:T,loadError:k}=(0,l.Ji)({googleMapsApiKey:r,libraries:W}),S=(0,n.useRef)(null),[R,j]=(0,n.useState)(null),[Z,_]=(0,n.useState)(null),[A,M]=(0,n.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:a,map:o}=e;const l=(0,U.D)(t),i=(0,U.D)(r),s=o&&window.google;(0,n.useEffect)((()=>{s&&!a&&t.length&&t!==l?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+f,e.lng()+f)),n.extend(new window.google.maps.LatLng(e.lat()-f,e.lng()-f))}t.fitBounds(n),r&&D(t,r,n)})(t,o,r):s&&r&&r!==i&&D(o,r)}),[o,t,r])})({markers:t,activeOverlay:m,map:R,isSearchOnMapMove:p});const L=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){H(e,t,r[t])}))}return e}({},V.r,h||{})),[h]),F=(0,n.useCallback)((e=>{E(e?P(R):null),M(null),clearTimeout(S.current)}),[R,E]),G=(0,n.useCallback)((()=>{clearTimeout(S.current)}),[]),q=(0,n.useCallback)((()=>{p&&E(P(R))}),[p,R,E]),K=(0,n.useCallback)((()=>{p&&(clearTimeout(S.current),S.current=setTimeout(q,1e3))}),[q,p]),Y=(0,n.useCallback)(((e,t)=>{const r=t||Z&&{type:V.vl.POLYGON,overlay:Z};if(!(0,o.isEmpty)(r)&&"function"==typeof x){const{overlay:e,type:t}=r,n={[V.vl.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[V.vl.CIRCLE]:()=>({radius:e.getRadius()/1e3,center:e.getCenter()})},a=n[t]&&n[t]();a&&x({data:a,type:t})}}),[x,Z]),$=(0,n.useCallback)((e=>t=>{Y(null,{type:e,overlay:t}),t.setMap(null),M(null)}),[Y]),X=(0,n.useCallback)((()=>{x(null)}),[x]),Q=e=>t.filter((0,o.prop)("point")).map((t=>a().createElement(B,{key:t.id,marker:t,clusterer:e,onClick:w})));return k?null:T?a().createElement(l.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:j,zoom:i,center:c,onZoomChanged:G,onDragStart:G,onIdle:K,mapContainerClassName:v},R&&d&&Boolean(g.length)&&a().createElement(s,{className:O.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:R},a().createElement(C,{hasActiveOverlay:!!m,drawingModes:g,drawingMode:A,onDrawingModeChanged:M,onClearOverlay:X})),R&&d&&a().createElement(s,{className:O.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:R},a().createElement(I,{onChangeIsSearchOnMapMove:F,isSearchOnMapMove:p})),b?(J=y,a().createElement(l.XL,{options:J},Q)):Q(),!N(A)&&m&&(0,o.propEq)("type",V.vl.POLYGON,m)&&a().createElement(l.mg,{onLoad:_,path:m.path,editable:!0,options:L,onMouseUp:Y,onDragEnd:Y}),d&&Boolean(g.length)&&a().createElement(l.j_,{onPolygonComplete:$(V.vl.POLYGON),onCircleComplete:$(V.vl.CIRCLE),drawingMode:N(A),options:{drawingControl:!1,circleOptions:L,polygonOptions:L}})):u;var J}},64435:(e,t,r)=>{r.d(t,{Z:()=>f});var n=r(24328),a=r.n(n),o=r(71153),l=r.n(o),i=r(13980),s=r.n(i),c=r(31396),u=r(60364);const p=(0,r(79692).Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}})));var d=r(18435);const m=e=>"horizontal"===e,h=e=>{let{className:t,children:r,orientation:o,defaultSize:i,size:s,minSize:h,maxSize:g,allowResize:f,onChange:b}=e;const y=p(),v=(0,u.Z)(),[E,x]=(0,n.useState)(),[w,O]=(0,n.useState)(!0),C=(0,n.useCallback)((()=>O(!0)),[]),T=(0,n.useCallback)((()=>O(!1)),[]),k=()=>m(o)?null==E?void 0:E.clientHeight:null==E?void 0:E.clientWidth,S=(0,n.useCallback)((0,d.DsO)((e=>{const t=k();b({percentageSize:e/t*100+"%",isMaxSize:g>0?e===g:e===t+g,isMinSize:e===h})}),250),[b,o,g,E]),I=(0,n.useMemo)((()=>({transition:v.transitions.create(m(o)?"height":"width",{easing:v.transitions.easing.sharp,duration:v.transitions.duration.leavingScreen})})),[o,v]);return"number"==typeof s&&s<0&&(s=(k()||0)+s),a().createElement("div",{ref:x,className:l()(y.container,t)},a().createElement(c.Z,{split:o,size:s,allowResize:f,onChange:S,defaultSize:i,minSize:h,maxSize:g,onDragStarted:T,onDragFinished:C,pane1Style:w?I:void 0},r))},g=s().oneOfType([s().number,s().string]);h.propTypes={className:s().string,children:s().arrayOf(s().node).isRequired,orientation:s().oneOf(["horizontal","vertical"]).isRequired,defaultSize:g,size:g,minSize:g,maxSize:g,allowResize:s().bool,onChange:s().func};const f=h},7907:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),o=r(99152),l=r(6487),i=r(83088);const s=(0,r(79692).Z)({tabsRoot:{width:"100%"},tabsScrollButton:{flex:"0 0 24px"},tabRoot:{fontSize:"0.875rem",padding:"7px 18px 5px","@media (min-width: 960px)":{minWidth:"inherit"}},labelWrapper:{whiteSpace:"nowrap",letterSpacing:"normal",display:"flex",flexDirection:"row",width:"100%"},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500}});function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:u}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","tabs","onChange","tabClasses"]);const d=s(),m=(e,t)=>a().createElement("span",{className:d.labelWrapper},a().createElement(i.C,{value:e},a().createElement("span",{className:d.label},e)),t);return a().createElement(o.Z,c({value:t,onChange:(e,t)=>n(t),classes:{root:d.tabsRoot,scrollButtons:d.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:"on"},p),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:o}=e;return a().createElement(l.Z,{classes:u||{root:d.tabRoot},key:r,value:r,label:m(t,n),"data-reltio-id":o})})))}},87356:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),o=r(33662),l=r(15311);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){c(e,t,r[t])}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=(0,l.y)({});return a().createElement(o.Z,i({classes:s({},t,{focused:n.white})},r))}},28101:(e,t,r)=>{r.d(t,{G:()=>m});var n=r(24328),a=r.n(n),o=r(71153),l=r.n(o),i=r(39475),s=r(79692),c=r(41128);const u=(0,s.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,c.U1)(e.palette.primary.main,.12),color:e.palette.primary.main,"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary}})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}function d(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const m=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:o,classes:s={}}=e;const c=u(),{active:m,buttonWrapper:h}=s,g=d(s,["active","buttonWrapper"]);return a().createElement("div",{className:l()(c.container,n)},t.map((e=>{let{id:t}=e,n=d(e,["id"]);return a().createElement(i.k,p({},n,{classes:g,size:"S",key:t,className:l()({[l()(c.active,m)]:r===t},c.buttonWrapper,h),onClick:()=>o(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},11821:(e,t,r)=>{r.d(t,{h:()=>l});var n=r(24328),a=r.n(n);const o=(0,r(79692).Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),l=e=>{let{width:t,open:r,children:n}=e;const l=o();return a().createElement("div",{className:l.contentWrapper,style:{width:`${r?t:0}px`}},r&&a().createElement(a().Fragment,null,n))}},21210:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(89810),a=r(18435),o=r(24328),l=r.n(o),i=r(52730),s=r(42639);const c=e=>{let{sourceType:t,className:r,classes:o}=e;const c=(0,i.useSelector)(n.ZP.selectors.getMetadata),{label:u,icon:p}=(0,a.PWK)(c,t);return l().createElement(s.Z,{className:r,avatarText:u[0],icon:p?(0,a.vPL)("https://s3.amazonaws.com/reltio.images/api",p):null,variant:"square",rootClasses:o})}},57412:(e,t,r)=>{r.d(t,{Z:()=>g});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(86689),s=r(83543);const c=(0,r(79692).Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}})));var u=r(71153),p=r.n(u),d=r(87918),m=r.n(d);const h=e=>{let{active:t,onClick:r,className:n}=e;const o=c();return a().createElement(i.Z,{className:p()(o.viewMoreLessLink,n),onClick:r,underline:"none"},a().createElement(s.Z,{className:p()(o.arrow,{[o.rotated]:t})}),t?m().text("View less"):m().text("View more"))};h.propTypes={active:l().bool,onClick:l().func,className:l().string};const g=h},65629:(e,t,r)=>{r.d(t,{Z:()=>T});var n=r(24328),a=r.n(n),o=r(13980),l=r.n(o),i=r(87918),s=r.n(i),c=r(17440),u=r(71153),p=r.n(u),d=r(12231),m=r(90436);const h=(0,r(79692).Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var g=r(42662),f=r(83088);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(this,arguments)}const y=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:o}=e;const l=h(),{value:i,label:s,startObject:c,endObject:u}=o,y=c.objectType.label+" ↔ "+u.objectType.label;return a().createElement(d.Z,b({className:l.container,ref:t,key:i,onClick:()=>n({label:s,value:i,startObject:c,endObject:u})},r),a().createElement("div",{className:l.icons},a().createElement(g.Z,{className:l.iconTop,entityType:c.objectType}),a().createElement(g.Z,{className:l.iconBottom,entityType:u.objectType})),a().createElement("div",{className:l.text},a().createElement(f.C,{value:s},a().createElement(m.Z,{className:p()(l.textItem,l.primaryTextItem)},s)),a().createElement(f.C,{value:y},a().createElement(m.Z,{color:"textSecondary",className:p()(l.textItem,l.secondaryTextItem)},y))))};y.propTypes={innerRef:l().oneOfType([l().oneOf([null]),l().func,l().shape({current:l().any.isRequired})]),innerProps:l().object.isRequired,selectOption:l().func.isRequired,data:l().shape({value:l().string.isRequired,label:l().string.isRequired,startObject:l().object,endObject:l().object})};const v=y;var E=r(84425);function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(this,arguments)}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{let{value:t={},options:r=[],onChange:o=c.identity,TextFieldProps:l}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","options","onChange","TextFieldProps"]);const u=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}({},(0,c.defaultTo)({},l),{"data-reltio-id":"relation-type-selector"})),[l]);return a().createElement(E.Z,x({value:t,options:r,onChange:o,label:s().text("Select relationship type "),components:{Option:v},TextFieldProps:u},i))},C=l().shape({label:l().string.isRequired,value:l().string.isRequired,startObject:l().object,endObject:l().object});O.propTypes={value:C,options:l().arrayOf(C),onChange:l().func};const T=O},53857:(e,t,r)=>{r.d(t,{vl:()=>n,r:()=>a,Pi:()=>o});const n={CIRCLE:"circle",POLYGON:"polygon"},a={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},o=.001},3064:(e,t,r)=>{r.d(t,{P:()=>a});var n=r(24328);const a=r.n(n)().createContext({});a.displayName="EntityMarkerContext"},64651:(e,t,r)=>{r.d(t,{n:()=>l});var n=r(24328),a=r(18435),o=r(17440);const l=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,n.useCallback)(((e,r)=>{const n={},l=(0,o.pipe)(a.PjQ,(0,o.tap)((e=>n[e]=(0,o.propOr)(0,e,n)+1))),i=(0,o.ascend)((0,o.prop)("label")),s=(0,o.curry)(((e,r)=>{let{uri:n,label:o,startObject:i,endObject:s}=r;const c=e===(t?a.Nsj.OUT:a.Nsj.IN)?i:s;return{label:{directionalLabel:l(c),typeLabel:o},value:`${n},${e}`,startObject:i,endObject:s}}));return e.map(s(a.Nsj.IN)).concat(r.map(s(a.Nsj.OUT))).map((0,o.evolve)({label:e=>{let{directionalLabel:t,typeLabel:r}=e;return t?n[t]>1?`${t} (${r})`:t:r}})).sort(i)}),[t]),fromEditorValue:(0,n.useCallback)(((e,t)=>r=>{const[n,l]=r.value.split(",");return{type:(l===a.Nsj.IN?e:t).find((0,o.propEq)("uri",n)),direction:l}}),[]),toEditorValue:(0,n.useCallback)(((e,t)=>t.find((0,o.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},52958:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Bd.S,ActionButton:()=>Pd,ActionButtonMode:()=>Id,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>o.I,AddWorkflowButton:()=>Ed,ArrowExpandButton:()=>$r.Z,AsyncMountContext:()=>um.g,AttributeListItem:()=>m.Z,AttributeTitle:()=>xo.Z,AttributesList:()=>f.Z,AttributesPager:()=>C.ZP,AttributesTable:()=>hs,AttributesView:()=>h.Z,AutoSizeList:()=>V.Z,AvatarWithFallback:()=>z.Z,BarChart:()=>At.Z,BasicTable:()=>U.Z,BasicTableContext:()=>W.X,BasicTablePagination:()=>Me.Z,BasicView:()=>jt.Z,BasicViewContent:()=>Zt.Z,BasicViewHeader:()=>_t.Z,BlockImageGalleryDialogContext:()=>mm.P,BranchDecorator:()=>g.Z,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>Fd.U,CardinalityMessage:()=>T.Z,ChartsFactory:()=>Bt.Z,ClickAwayProvider:()=>Wt,CollaborationContext:()=>hm.h,CollaborationItem:()=>Gt.J,CollapseButton:()=>qt.Z,CollapseRowButton:()=>ot.Z,ColorBar:()=>Kt.Z,ColumnFilterType:()=>Y.Dq,ColumnsDataType:()=>Y.uz,ColumnsSettings:()=>Ie,CommentsContainer:()=>Yt.Z,ConfigureColumnsPopup:()=>Jt.Z,ConfirmDeleteDialog:()=>di,ConfirmationDialog:()=>ii.Z,ConnectionRelationTypeSelector:()=>er.Z,CrosswalkDragLayer:()=>ws,CrosswalkEditor:()=>Hs,CrosswalkType:()=>Os,CrosswalksDisplayProvider:()=>Lo,DEFAULT_OVERLAY_OPTIONS:()=>Vd.r,DataTypeValue:()=>tr.Z,DataTypeValueEditor:()=>dr.Z,DateEditor:()=>pr.Z,DateRangeEditor:()=>ur.Z,DateRangeTypes:()=>Qs.K,DefaultCellValueRenderer:()=>Le.Z,DeltaTypes:()=>l.w,Drawer:()=>rr.Z,DropDownEditor:()=>or.Z,DropDownMenuButton:()=>nr.Z,DropDownSelector:()=>ar.Z,DropdownIndicator:()=>$t.Z,DropdownIndicatorWithIconButton:()=>Xt.Z,EMPTY_STATE_ICONS:()=>br.B9,EMPTY_STATE_VARIANTS:()=>br.tC,EditableAttribute:()=>S.Z,EditableImageAttributesLine:()=>A.Z,EmptyState:()=>br.ZP,EmptyStub:()=>ze.Vd,EntitiesMapContext:()=>vm.X,EntityAvatar:()=>yr.Z,EntityContext:()=>wm.u,EntityCreator:()=>b.Z,EntityMarkerContext:()=>Em.P,EntitySelector:()=>y.Z,EntityTypeBadge:()=>vr.Z,EntityTypeIcon:()=>Er.Z,EntityTypesSelector:()=>xr.Q,EntityUriLink:()=>Or.Z,ErrorBoundary:()=>Cr.Z,ErrorMessage:()=>Ys.Z,ErrorPopup:()=>Tr.Z,ErrorWrapper:()=>kr.Z,ExpandableSearchInput:()=>jo,ExpandedAttributesProvider:()=>ei,ExpandedValueTooltip:()=>Sr.C,FacetViewHeader:()=>Ir.Z,FileTypeEditor:()=>hr.Z,FilterButton:()=>Ae,FilterValueEditor:()=>ir.Z,FlipCard:()=>Zr,HideOnShrink:()=>Mr,HierarchicalAttributeTooltip:()=>Lr.Z,Highlighter:()=>ye.Z,HistoryActivityType:()=>Xs,HistoryChangeTypes:()=>yc,HistoryDiffContext:()=>pm.m,HistoryHeader:()=>cu,HistoryPanelEmptyState:()=>du,HistoryView:()=>Ac,IdContext:()=>ym,ImageAttributesLine:()=>I.Z,ImageGalleryDialog:()=>Fr.C,ImportButton:()=>Br.Z,ImportModes:()=>Br.E,InlineAttributesPager:()=>Kl,InlineImageAttribute:()=>zl,InlineNestedAttribute:()=>oi,InlineReferenceAttribute:()=>_l,LightArrowTooltip:()=>Yo,LinearLoadIndicator:()=>Vr.Z,Link:()=>Ur,LoadingSpinner:()=>Hr,MAP_DRAWING_MODES:()=>Vd.vl,MAP_MINIMUM_SCALE_RADIUS:()=>Vd.Pi,Marginator:()=>li.Z,MatchRulesBlock:()=>yn,MenuWithPopper:()=>Qt.Z,MergeButton:()=>Rd,ModeSwitcher:()=>vn.Z,ModeSwitcherSelect:()=>Sn,MoreAttributesButton:()=>v.Z,MultiSelect:()=>Vn.Z,MultiValueChip:()=>sr.Z,MultipleInput:()=>In.Z,NestedAttribute:()=>M.Z,NestedAttributeEditor:()=>E.Z,NoData:()=>gr.J,NoResults:()=>fr.X,NotMatchButton:()=>Md,NumberEditor:()=>cr.Z,OvIcon:()=>mu.Z,PieChart:()=>Mt.Z,PivotingAttributeContext:()=>fm.J,Popper:()=>Pn.Z,PopupBoundariesContext:()=>dm.p,PopupWithArrow:()=>Nn.Z,PotentialMatchReviewCard:()=>An,ProfileBand:()=>Mn.Z,ProfileBandHistory:()=>pu,ProfileBandNavigation:()=>Rt,ProfileCard:()=>Ln.Z,ProfileMatchCard:()=>nd,ProfilePerspectiveViewContext:()=>bm,ProfilesList:()=>Ld.Z,QueryBuilderAttributeDataType:()=>Y.eB,QueryBuilderAttributeType:()=>Y.Xw,QueryBuilderRow:()=>Fn.Z,QueryBuilderRowsGroup:()=>Bn.Z,ReactSelectOptionFilters:()=>zn.Z,ReactSortableTree:()=>Ka,ReactSortableTreeHandlers:()=>Ma,ReactSortableTreeUtils:()=>ba,ReadOnlyAttribute:()=>k.Z,ReadOnlyAttributeValuesBlock:()=>Z,ReadOnlyAttributesList:()=>_.Z,ReadOnlyAttributesPager:()=>B.Z,ReferenceAttribute:()=>L.Z,ReferenceAttributeEditor:()=>x.Z,RelatedObjectUrisContext:()=>xm.A,RelationEditor:()=>vu,RelationTypeSelector:()=>w.Z,RelationTypesSelector:()=>wr.U,ReltioGridLayout:()=>Ya.Z,ReltioMap:()=>Ks.Z,ResizablePanes:()=>$a.Z,RowCellAutoSizer:()=>at,ScrollableTabs:()=>_o.Z,SearchInput:()=>Xa.Z,SelectionPopup:()=>he.Z,SelectionPopupPopper:()=>no,SelectorWithOnlyOptionAutoSelect:()=>lo,SideButtonsPanel:()=>io.G,SidePanel:()=>mo.h,SidePanelContentHeader:()=>fo,SidePanelEmptyState:()=>po,SimpleAttribute:()=>F.Z,SimpleAttributeEditor:()=>O.Z,SimpleDropDownSelector:()=>bo.Z,SimpleMatchRulesBlock:()=>on,SimpleMatchRulesBuilder:()=>cn,SmallIconButton:()=>yo.Z,SmallIconButtonWithTooltip:()=>me.k,SortingType:()=>Y.nI,SourceCrosswalksRow:()=>zs,SourceIcon:()=>vo.Z,Spacer:()=>Eo.Z,TableContext:()=>W.X,TableWithBars:()=>Lt.Z,TextEditor:()=>lr.Z,TimestampEditor:()=>mr.Z,TransitiveMatchBlock:()=>bn,TreeChart:()=>Ft.Z,UsersContext:()=>gm.s,VerticalDivider:()=>Oo,VerticalHeadingsTable:()=>So,ViewIdContext:()=>Ot.m,ViewMoreToggle:()=>Io.Z,VirtualGroupedList:()=>ge.Z,WhiteSearchInput:()=>Qa.Z,WorkflowComments:()=>Hu,WorkflowTaskCard:()=>dd,WorkflowTasksContext:()=>xu,basicTableViewState:()=>Je,buildColumnsFilter:()=>Ve.Tz,columnFilterToMdmFilter:()=>Ve.su,createStandardAction:()=>ze.zD,defaultGetRowCellHeight:()=>Fe.Z,defaultRenderRowCell:()=>Be.Z,getChecked:()=>ze.IR,getValue:()=>ze.NA,groupCrosswalksByTypesAndSources:()=>qs,isIE:()=>ze.w1,mergeClasses:()=>ze.ze,noop:()=>ze.ZT,parseJSON:()=>ze.Rx,stopPropagation:()=>ze.UW,toggleSortOrder:()=>ze.Dh,useActions:()=>Wd,useActivitiesLoader:()=>i.d,useAsyncMount:()=>Gd.S,useAttributeExpanded:()=>ti,useBasicTableCellRenderer:()=>mt,useClickableStyle:()=>zt.d,useCollaboration:()=>Xd,useConfigPermissions:()=>cm.l,useCrosswalkActions:()=>vs,useCrosswalkColor:()=>Fo,useCrosswalkFocus:()=>zo,useCrosswalkHighlight:()=>Vo,useDidUpdateEffect:()=>rt.D,useDynamicRowCellHeight:()=>st,useHighlightedCrosswalks:()=>Bo,useHistory:()=>ic,useHistoryDiff:()=>pc,useHistoryEnabled:()=>dc,useHistorySlice:()=>$s,useKeyboardNavigation:()=>fe.t,useMarkAsNotMatchRequest:()=>_d,useMatchesLoader:()=>td,useMergeAllRequest:()=>Nd,useModifiedEntity:()=>ys,usePagingSimulator:()=>ed,usePrevious:()=>Qd.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>Jd.n,useRelationsLoader:()=>nm,useRunOnceAfterValueInitialization:()=>am,useSafePromise:()=>Ct._,useSavedState:()=>om.a,useUsers:()=>lm,useWhyDidYouUpdate:()=>sm,useWorkflowAssignee:()=>Su,useWorkflowCheckPermission:()=>Ou,useWorkflowComments:()=>zu,useWorkflowTasks:()=>wd,withAsyncMount:()=>zd.Z,withContext:()=>Ud.l,withFilterAtBottom:()=>G.Z,withPercents:()=>Vt.Z,withTableContext:()=>H.Z,withTooltip:()=>gt.Z});var n=r(56082),a=r(40023),o=r(20414),l=r(33992),i=r(7278),s=r(24328),c=r.n(s),u=r(18435),p=r(54202);const d=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,p.U)(t),o=await(0,u.k6v)({filter:e,max:r,offset:n,entityUri:a}),{total:l}=await(0,u.FEC)({filter:e,entityUri:a});return{data:o,total:l}}),[t,r,n,a])};var m=r(33117),h=r(15177),g=r(52239),f=r(76141),b=r(54255),y=r(72283),v=r(89913),E=r(3853),x=r(10768),w=r(65629),O=r(39390),C=r(92203),T=r(63928),k=r(11013),S=r(30410),I=r(61347);function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(){return D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}function R(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const j=e=>{let{values:t,valueContainerClassName:r}=e,n=R(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(k.Z,D({attributeValue:e},n))))))},Z=(0,s.memo)((e=>{let{expanded:t}=e,r=R(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:o}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return j(P({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:o},c().createElement(I.Z,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return j(P({},r))}}));var _=r(89978),A=r(66078),M=r(88610),L=r(95492),F=r(81489),B=r(47972),V=r(44938),z=r(42639),U=r(45108),H=r(30488),W=r(38748),G=r(25843),q=r(13980),K=r.n(q),Y=r(53862);function $(){return $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}const X=e=>c().createElement("svg",$({width:20,height:18,viewBox:"0 0 20 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M16 7.24V6h-4v1.24a8.417 8.417 0 00-2 .768V6H6v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM4 12V6H2v6h2zm0-8V2H2v2h2zm6 0V2H6v2h4zm6 0V2h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0014 9zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero",stroke:"none",strokeWidth:1,opacity:.54}));var Q=r(17440);function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ee(e,t,r[t])}))}return e}function ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const te=e=>e.id===e.groupId,re=(0,Q.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),ne=(0,Q.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),ae=(0,Q.propOr)(!0,"hideable"),oe=(e,t)=>{const r=((e,t)=>e.find((0,Q.either)(ne(t),re(t))))(e,t);return r?(r.children=oe(r.children||[],t),e):e.concat(t)},le=(0,Q.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(le(e)))),ie=(0,Q.reduce)(((e,t)=>oe(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),se=(0,Q.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,Q.pipe)((0,Q.filter)(le(e)),(0,Q.chain)((t=>[{item:J({},t,{filterText:e}),level:r},...t.children?se(e,t.children,r+1):[]])))(t)})),ce=(0,Q.has)("columns"),ue=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,Q.assoc)("groupId",t))]},pe=e=>e.children?(0,Q.chain)(pe,e.children):[e],de=(e,t)=>{const r=pe(t),n=t=>e.includes(t.id);return te(t)?r.every(n):r.some(n)};var me=r(39475),he=r(22311),ge=r(63485),fe=r(26638),be=r(41008),ye=r(94792),ve=r(71153),Ee=r.n(ve),xe=r(79692);const we=(0,xe.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Oe=e=>{let{item:t,onClick:r,checked:n,level:a,style:o,isFocused:l,isGroupItem:i}=e;const s=we();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(ye.Z,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:o,isFocused:l,hideIcon:i,className:Ee()({[s.groupItem]:i})})};Oe.propTypes={item:K().shape({label:K().string,filterText:K().string}),level:K().number,onClick:K().func,checked:K().bool,style:K().object,isGroupItem:K().bool,isFocused:K().bool};const Ce=Oe;var Te=r(87918),ke=r.n(Te);const Se=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:o}=e;const l=we(),[i,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(""),h=(0,s.useMemo)((()=>((e,t)=>(0,Q.pipe)((0,Q.chain)((0,Q.when)(ce,ue)),(0,Q.filter)((0,Q.either)(te,ae)),ie,se(t))(e))(t,d)),[t,d]),g=(0,u.fW1)("label")(h)||308,f=(0,s.useMemo)((()=>(0,be.LG)(h)),[h]),b=(0,s.useCallback)((e=>{const t=(0,Q.pipe)(pe,(0,Q.pluck)("id"))(e),a=de(r,e);n(a?(0,Q.difference)(r,t):(0,Q.uniq)((0,Q.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:v,handleKeyDown:E}=(0,fe.t)({items:f,open,onSelectFocusedItem:y,selectedItems:r}),x=Math.min(300,32*f.length),w=Math.max(140,x+108);return c().createElement(c().Fragment,null,c().createElement(me.k,{tooltipTitle:o||ke().text("Show/hide columns"),size:"L",icon:X,onClick:e=>p(e.currentTarget)}),c().createElement(he.Z,{className:l.popup,open:!!i,anchorEl:i,onClose:(0,Q.pipe)((()=>p(null)),(()=>m(""))),onSearch:m,title:a||ke().text("Show/hide columns"),containerWidth:g,containerHeight:w,searchInputOnKeyDown:E},c().createElement(ge.Z,{fixedTitle:!1,height:x,renderItem:(e,t,n)=>{let{item:a,level:o=0}=t;return c().createElement(Ce,{style:e,item:a,level:o,isFocused:v===n,checked:de(r,a),isGroupItem:te(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:g,focusIndex:v})))};Se.propTypes={columnsData:Y.uz,selectedColumns:K().arrayOf(K().string),onChangeColumns:K().func,title:K().string,tooltipTitle:K().string};const Ie=Se;var Pe=r(61837),Ne=r(87685),De=r(80030);function Re(){return Re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Re.apply(this,arguments)}const je=e=>c().createElement("svg",Re({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M18 2V0H0v2l7 8v8l4-2v-6z",fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:1})),Ze=(0,xe.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),_e=e=>{let{enabled:t,onClick:r}=e;const n=Ze();return c().createElement(De.ZP,{title:t?ke().text("Clear all filters"):ke().text("Filter")},c().createElement(Pe.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(je,{className:n["filterIcon--enabled"]}),c().createElement(Ne.default,{color:"primary",className:n.closeIcon})):c().createElement(je,null)))};_e.propTypes={enabled:K().bool,onClick:K().func};const Ae=_e;var Me=r(42011),Le=r(46728),Fe=r(85103),Be=r(1928),Ve=r(9377),ze=r(79573);function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){He(e,t,r[t])}))}return e}function He(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const We="CHANGE_COLUMNS",Ge="TOGGLE_FILTERS",qe="CHANGE_FILTER",Ke="TOGGLE_SORT",Ye="CHANGE_PAGE",$e="CHANGE_ROWS_PER_PAGE",Xe={changeColumns:(0,ze.zD)(We),toggleFilters:(0,ze.zD)(Ge),changeFilter:(0,ze.zD)(qe),toggleSort:(0,ze.zD)(Ke),changePage:(0,ze.zD)(Ye),changeRowsPerPage:(0,ze.zD)($e)},Qe=(e,t)=>{const r=(0,Q.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,Q.evolve)({visibleColumns:(0,Q.always)(t),sorting:(0,Q.when)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(e.field)}),(()=>{const[e]=t;return{field:e,order:"asc"}})),filters:e=>(0,Q.keys)(e).reduce(((e,t)=>n(t)?(0,Q.dissoc)(t,e):e),e)},e)},Je={reducer:(e,t)=>{switch(t.type){case We:{const r=t.payload;return Qe(e,r)}case Ge:{const t=!e.filters;return Ue({},e,{filters:t?{}:null,page:t?e.page:0})}case qe:{const{columnId:r,filter:n}=t.payload;return(0,Q.evolve)({filters:n?(0,Q.assoc)(r,n):(0,Q.dissoc)(r),page:(0,Q.always)(0)},e)}case Ke:{const r=t.payload,n=(0,Q.path)(["sorting","field"],e),a=(0,Q.path)(["sorting","order"],e);return Ue({},e,{sorting:{field:r,order:(0,ze.Dh)(r===n?a:null)},page:0})}case Ye:return Ue({},e,{page:t.payload});case $e:return Ue({},e,{rowsPerPage:t.payload});default:return e}},actions:Xe,changeVisibleColumns:Qe};var et=r(44443),tt=r(76625),rt=r(55962);const nt=e=>{let{onChangeHeight:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChangeHeight","children"]);const a=(0,s.useRef)(null),{rowValue:o,rowIndex:l,columnData:i,cellIndex:u}=n,p=t({rowIndex:l,cellIndex:u,columnData:i}),d=()=>a.current&&p(a.current.clientHeight);return(0,rt.D)(d,[o.rawValue]),c().createElement("div",null,c().createElement(et.Z,{handleHeight:!0,onResize:d}),c().createElement(tt.Z,{rootRef:a},r))};nt.propTypes={onChangeHeight:K().func,children:K().node};const at=nt;var ot=r(91431);function lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const it=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},st=()=>{const[e,t]=(0,s.useState)({}),r=(0,s.useRef)({}),n=(0,s.useCallback)((0,u.DsO)((()=>{t(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lt(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,Q.pipe)(it,(0,Q.prop)(Q.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,Q.curry)((0,Q.useWith)((0,Q.pipe)(((e,t)=>{r.current[e]=t}),n),[it,Q.identity])),[]),clearHeightsCache:a}};var ct=r(21697),ut=r(8233),pt=r(3073);function dt(){return dt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dt.apply(this,arguments)}const mt=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=Be.Z,getRowCellHeight:a=Fe.Z,defaultRowHeight:o=48,maxRowValuesCount:l=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,ut.Z)({rowsData:t,columnsData:r,renderRowCell:n,getRowCellHeight:a,maxRowValuesCount:l});return(0,s.useMemo)((()=>{const e=i.reduce(((e,t,r)=>{const{data:n}=t;return e[r]=(0,ct.calculateRowHeight)(n,o),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,Q.pathOr)(0,a,e)},n=t=>(0,Q.pathOr)(0,[t,"height"],e),a=e=>{let{columnId:a,rowIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["columnId","rowIndex"]);return c().createElement(pt.x.Provider,{value:u},c().createElement("div",dt({},l,{style:{height:n(o)}}),i.length>0&&(0,ct.getCellContentFromRowsData)({columnIndex:r.findIndex((0,Q.propEq)("id",a)),headData:r,rowsData:i,rowIndex:o,getHeightForSubRow:t})))};return a.propTypes={columnId:K().string,rowIndex:K().number},{getRowHeight:n,CellRenderer:a}}),[i,o,u,r])};var ht=r(86689),gt=r(78223),ft=r(67766),bt=r(42767);const yt=(0,xe.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),vt=(0,gt.Z)(ht.Z),Et=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:o,isNextDisabled:l}=e;const i=yt();return c().createElement("div",{className:i.container},c().createElement(vt,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:ke().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?ke().text("Search result"):ke().text("Search results")),c().createElement(me.k,{size:"L",icon:ft.Z,tooltipTitle:ke().text("Go to previous profile"),onClick:r,disabled:o,showForDisabled:!0}),c().createElement(me.k,{size:"L",icon:bt.Z,tooltipTitle:ke().text("Go to next profile"),onClick:n,disabled:l,showForDisabled:!0}))};var xt=r(52730),wt=r(89810),Ot=r(12212),Ct=r(29627);function Tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kt(e,t,r[t])}))}return e}function kt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class St{constructor(e){var t=this;let{data:{query:r,sortField:n,sortOrder:a},tenant:o,searchTenant:l,apiPath:i,dtssPath:s,globalSearchRequestOptions:c}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[t.getQueryFilter(),...e],a=Tt({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},r);return t.isDT()?(0,u.uqV)({filters:n,options:a,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,u.ZOr)(n,a)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,u.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,u.j_Q)(e,t)).then((e=>e.total))},this.query=r,this.sortField=n,this.sortOrder=a,this.tenant=o,this.searchTenant=l,this.apiPath=i,this.dtssPath=s,this.globalSearchRequestOptions=c}}function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pt(e,t,r[t])}))}return e}function Pt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Nt{constructor(e){var t=this;let{data:r,tenant:n,apiPath:a}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[{rawFilter:t.searchBody.filter},...e];return(0,u.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:It({},t.searchBody,{filter:e.length?(0,u.Uqd)()(n):t.searchBody.filter}),options:r})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,u.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,u.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=r,this.tenant=n,this.apiPath=a}}const Dt=(e,t)=>(0,Q.pipe)((0,Q.map)((0,Q.prop)("uri")),(0,Q.reject)((e=>t.includes(e))))(e),Rt=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:o}=(()=>{const e=(0,Ct._)(),t=(0,Ct._)(),r=(0,Ct._)(),{uri:n,index:a,total:o,tenant:l,cache:i}=(0,xt.useSelector)(wt.ZP.selectors.getSearchNavigationData)||{},{type:c,data:p}=(0,xt.useSelector)(wt.ZP.selectors.getSearchProviderData)||{},d=(0,xt.useSelector)(wt.ZP.selectors.getTenant),m=(0,xt.useSelector)(wt.ZP.selectors.getApiPath),h=(0,xt.useSelector)(wt.ZP.selectors.getDtssPath),g=(0,xt.useSelector)((e=>wt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),f=(0,s.useContext)(Ot.m),b=(0,xt.useDispatch)(),[y,v]=(0,s.useState)(!1),E=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new St(t);case"graphsearch":return new Nt(t)}})(c,{data:p,tenant:d,searchTenant:l,apiPath:m,dtssPath:h,globalSearchRequestOptions:g})),[c,p,d,l,m,h,g]),x=(0,s.useCallback)((e=>{b(wt.yC.actions.updateSearchNavigationDataFields(e))}),[b]),w=(0,s.useCallback)((e=>{const t=d!==l?(0,u.wwR)({uri:e,dataTenant:l}):e;b(wt.ui.actions.openEntity({uri:t,viewId:f,source:"navigation"}))}),[b,f,d,l]),O=(0,s.useCallback)((()=>{b(wt.ui.actions.openPerspective({perspectiveId:c,viewId:f}))}),[b,c,f]);(0,s.useEffect)((()=>{a>=o?x({index:o-1}):a<0&&x({index:0})}),[o,a,x]);const C=(0,s.useCallback)(((e,n,a)=>{v(!0),t(E.requestTotal()).then((e=>x({total:e})));const o=a+1;return r(E.requestEntities(15,o)).then((t=>{if(t){if(t.length){const r=Dt(t,e);if(r.length>0)return x({cache:e.concat(r),uri:r[0],index:o+t.length-r.length}),void w(r[0]);if(a+t.length<n-1)return C(e,n-t.length,a+t.length)}x({index:o})}})).finally((()=>{v(!1)}))}),[E,x,w]),T=(0,s.useCallback)(((e,n)=>{v(!0),t(E.requestTotal()).then((e=>x({total:e})));const a=n-1,o=Math.max(0,n-15),l=15+Math.min(0,n-15);return r(E.requestEntities(l,o)).then((t=>{if(t){if(t.length){const r=Dt(t,e);if(r.length>0)return x({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void w(r[r.length-1]);if(n-t.length>0)return T(e,n-t.length)}x({index:0})}})).finally((()=>{v(!1)}))}),[E,x,w]),k=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const o=t[r];return v(!0),e(E.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),k(e,r,n-1,a)}x({index:a+1,uri:o,cache:t,total:n}),w(o)})).finally((()=>{v(!1)}))}if(!(a>=n-1))return C(t,n,a);x({cache:t,total:n,index:n-1})}),[E,x,w,C]),S=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const o=t[r];return v(!0),e(E.checkEntity(o)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),S(e,r-1,n-1,a-1)}x({index:a-1,uri:o,cache:t,total:n}),w(o)})).finally((()=>{v(!1)}))}if(!(a<=0))return T(t,a);x({index:0,cache:t,total:n})}),[E,x,w,T]),I=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;S(i,e,o,a)}}),[S,i,n,o,a]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;k(i,e,o,a)}}),[k,i,n,o,a]);return{total:o,onPrev:I,onNext:P,onSearchResultsClick:O,isPrevDisabled:y||a<=0,isNextDisabled:y||a>=o-1}})();return(()=>{const{cache:e}=(0,xt.useSelector)(wt.ZP.selectors.getSearchNavigationData)||{},t=(0,xt.useSelector)(wt.ZP.selectors.getMode),r=(0,xt.useSelector)(wt.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(Et,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:o}):null};var jt=r(1730),Zt=r(82068),_t=r(17998),At=r(72668),Mt=r(38037),Lt=r(62321),Ft=r(56215),Bt=r(12960),Vt=r(39878),zt=r(59383),Ut=r(1292);function Ht(){return Ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ht.apply(this,arguments)}const Wt=e=>c().createElement(Ut.Z,Ht({mouseEvent:"onMouseDown"},e));var Gt=r(89925),qt=r(28831),Kt=r(89902),Yt=r(72316),$t=r(78501),Xt=r(59952),Qt=r(51556),Jt=r(80560),er=r(85596),tr=r(67586),rr=r(87086),nr=r(98538),ar=r(84425),or=r(1128),lr=r(43371),ir=r(15299),sr=r(92145),cr=r(19855),ur=r(72466),pr=r(39600),dr=r(65314),mr=r(91785),hr=r(51594),gr=r(19304),fr=r(6216),br=r(79002),yr=r(37573),vr=r(20146),Er=r(42662),xr=r(92934),wr=r(68977),Or=r(18527),Cr=r(7882),Tr=r(97333),kr=r(93555),Sr=r(83088),Ir=r(52194);const Pr=e=>`rotateY(${e?180:0}deg)`,Nr=e=>`rotateX(${e?180:0}deg)`,Dr=e=>`rotateY(${e?0:-180}deg)`,Rr=e=>`rotateX(${e?0:-180}deg)`,jr=(0,xe.Z)({back:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"relative":"absolute",top:"0",transform:"horizontal"===r?Dr(t):Rr(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",display:"flex"}},container:e=>{let{cardZIndex:t}=e;return{perspective:"1000px",zIndex:t}},flipper:{height:"100%",position:"relative",width:"100%"},front:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"absolute":"relative",top:"0",transform:"horizontal"===r?Pr(t):Nr(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),Zr=(0,s.forwardRef)(((e,t)=>{let{cardZIndex:r="auto",direction:n="vertical",isCardFlipped:a=!1,children:o,className:l}=e;const[i,u]=(0,s.useState)(a),p=jr({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:Ee()(p.flipper,l),ref:t},c().createElement("div",{"data-id":"front",className:p.front},o[0]),c().createElement("div",{"data-id":"back",className:p.back},o[1]))})),_r=()=>c().createElement("div",{style:{display:"none"}}),Ar=e=>{let{widthToHide:t,children:r}=e;return c().createElement(et.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(_r,null)}})};Ar.propTypes={children:K().node,widthToHide:K().number.isRequired};const Mr=Ar;var Lr=r(44363),Fr=r(95596),Br=r(76283),Vr=r(87378);const zr=(0,xe.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Ur=e=>{let{to:t,children:r,onClick:n}=e;const a=zr();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Hr=e=>{let{className:t}=e;return c().createElement("img",{className:t,alt:"loading",src:(0,u.Uw1)("R0lGODlhFQALAKIAAP///8Hf75vL5Van0wB4v////wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAFACwAAAIAFQAHAAADLFi6zPSQFEGpGhgXkrEUQShc1bB1wxcGYzGUZ6eKJGVy8lS1aJxJjaAiAkkAACH5BAkKAAUALAAAAwAUAAUAAAMiWLFbJRC6QakCODjBxIzDlW3dB4UBBmhPWQygwrCR9FZDAgAh+QQJCgAFACwIAAMADAAFAAADFBiqVfIvgBmaWHeC6rCklrdw0JMAACH5BAkKAAUALAAAAgAUAAcAAAMkSLpU/vCRQWmLLmg967hYAIxBV4GRSJoWlo1A6X1usXGMUkcJACH5BAkKAAUALAAAAgAOAAcAAAMdWLpF/qSMORudcYg97M2b0BHXAHIelV0pxizQkwAAOw==")})},Wr=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?ke().text("Match IQ"):ke().text("Match rules"))},Gr=(0,xe.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),qr=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Gr();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(Wr,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Kr=(0,xe.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),Yr=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=Kr();return c().createElement("div",{className:Ee()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Wr,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))};var $r=r(85777);const Xr=(0,xe.Z)((e=>({label:{backgroundColor:"rgba(43,152,240,0.12)",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,display:"flex",alignItems:"center",padding:"4px 8px"},container:{display:"flex",alignItems:"center",cursor:"pointer",marginBottom:"8px"}})));function Qr(){return Qr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qr.apply(this,arguments)}const Jr=(0,s.forwardRef)(((e,t)=>{let{children:r,expanded:n,onExpand:a,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","expanded","onExpand","className"]);const i=Xr();return c().createElement("div",Qr({onClick:a,ref:t,className:Ee()(i.container,o)},l),c().createElement($r.Z,{expanded:n}),c().createElement("div",{className:i.label},r))}));Jr.displayName="MatchRuleBadge";const en=Jr,tn=(0,xe.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function rn(){return rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rn.apply(this,arguments)}const nn=e=>c().createElement("svg",rn({width:192,height:192,viewBox:"0 0 192 192",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"MLMatch_svg__b"},c().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),c().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),c().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"MLMatch_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),c().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"MLMatch_svg__g"},c().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"MLMatch_svg__i"},c().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),c().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),c().createElement("path",{d:"M1.821 66.003L34.263 9.94C36.633 5.813 45.673.594 51.398.072l64.445-.064c5.06-.241 14.821 5.084 17.888 10.395l31.467 54.503c3.186 5.518 2.765 16.592-.13 22.117l-30.948 53.481c-3.776 5.127-14.165 11.126-19.57 11.328l-62.134.061c-5.51-.264-15.934-5.764-18.758-10.655L1.856 86.155C-.846 81.475-.37 70.648 1.82 66.003z",id:"MLMatch_svg__a"}),c().createElement("path",{d:"M11.109 67.042l28.713-49.618C41.92 13.77 49.931 9.158 55.006 8.7l57.143.005c4.486-.209 13.147 4.516 15.871 9.223l27.954 48.298c2.83 4.89 2.467 14.696-.095 19.586l-27.391 47.334c-3.343 4.537-12.55 9.84-17.342 10.013l-55.094-.004c-4.886-.24-14.134-5.12-16.643-9.454L11.16 84.889c-2.4-4.147-1.989-13.735-.05-17.847z",id:"MLMatch_svg__c"}),c().createElement("path",{d:"M.995 0c26.4.684 47.59 22.234 47.59 48.72 0 26.23-23.795 34.53-23.795 56.987 0 3.703-3.011 6.705-6.725 6.705l-17.07-.001V68.985c6.466-1.238 11.353-6.923 11.353-13.75S7.46 42.722.995 41.485V0z",id:"MLMatch_svg__e"}),c().createElement("path",{d:"M47.353 0l-.087 41.235-.225.003c-7.588.167-13.688 6.37-13.688 13.997 0 7.683 6.19 13.92 13.854 14l-.091 43.265H27.887c-1.894-.56-3.197-1.234-3.91-2.025-.712-.79-1.357-2.275-1.933-4.455l-2.335-10.733c-.354-1.265-.674-2.183-.96-2.753-.286-.57-.784-1.281-1.494-2.134L2.002 70.367c-.846-.949-1.383-1.73-1.61-2.343-.228-.613-.356-1.626-.386-3.038V31.34c-.028-.785.044-1.37.216-1.757.173-.387.566-.848 1.18-1.382L28.368.885c.37-.367.665-.601.885-.704.22-.103.557-.163 1.01-.181h17.09z",id:"MLMatch_svg__h"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("g",{transform:"translate(12 6)"},c().createElement("use",{fill:"url(#MLMatch_svg__b)",xlinkHref:"#MLMatch_svg__a"}),c().createElement("use",{fill:"url(#MLMatch_svg__d)",opacity:.5,xlinkHref:"#MLMatch_svg__c"})),c().createElement("g",{transform:"translate(69.652 30.765)"},c().createElement("rect",{fill:"#363636",x:15.457,y:132.745,width:21.151,height:23.158,rx:10.576}),c().createElement("path",{d:"M48.146 118.763v18.93c0 7.198-5.944 13.035-13.277 13.035h-16.71c-7.333 0-13.278-5.837-13.278-13.036v-18.929a13 13 0 01.023-.763h43.22a13 13 0 01.022.763z",fill:"#717171"}),c().createElement("path",{d:"M41.348 137.2c0 7.199-4.947 13.035-11.048 13.035H16.395c-6.101 0-11.047-5.836-11.047-13.035v-18.965h36V137.2z",fill:"#828282"}),c().createElement("path",{d:"M47.51 138.235a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956z",fill:"#B1B1B1"}),c().createElement("path",{d:"M24.999 138.234v8h-16v-8h16zm0-11v8h-16v-8h16zm0-11v8h-16v-8h16z",fill:"#C5C5C5"}),c().createElement("g",{transform:"translate(27)"},c().createElement("mask",{id:"MLMatch_svg__f",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__e"})),c().createElement("use",{fill:"#FFD44B",xlinkHref:"#MLMatch_svg__e"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFD347",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFDE72",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M11.965 48.645c.17-7.171 7.488-10.693 13.863-6.802 7.245 4.422 4.05 16.311-4.742 16.548l-.268.004h-3.227l-4.608 56.092-5.995-.253 4.413-51.248.185-4.592-10.592.001v-6h10.83l.139-3.585.002-.165zm10.737-1.681c-2.54-1.55-4.64-.58-4.737 1.766l-.005.284-.131 3.38 2.99.001c2.852 0 3.999-3.945 2.011-5.347l-.128-.084z",fill:"#F3BE13",mask:"url(#MLMatch_svg__f)"}),c().createElement("ellipse",{fill:"url(#MLMatch_svg__g)",mask:"url(#MLMatch_svg__f)",cx:-1.89,cy:48.245,rx:36.534,ry:36.667}))),c().createElement("g",{transform:"translate(45.647 30.765)"},c().createElement("mask",{id:"MLMatch_svg__j",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__h"})),c().createElement("use",{fill:"url(#MLMatch_svg__i)",xlinkHref:"#MLMatch_svg__h"}),c().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:.5,mask:"url(#MLMatch_svg__j)",d:"M38.24 11.235v6l-3.55-.001-22.207 22.207h-18.13v-6H9.997l22.207-22.206zM25.682 40.779l13.8 13.799H50v6H36.997L21.439 45.021zM53.311 28.235v6h-13.65l-3.935 4.246-4.4-4.08 5.718-6.166zM14.248 52.235l20.52 20.52h3.695v6h-6.18l-20.52-20.52H-.647v-6zM21.353 84.235h8.95L40.4 94.332h16.753v6H37.915L27.817 90.235z"})),c().createElement("circle",{fill:"#008FD8",cx:94,cy:86,r:9}))),an=(0,gt.Z)(en),on=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=tn(),[a,o]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>o((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(an,{tooltipTitle:c().createElement(qr,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(nn,{className:n.icon}),ke().text("Match IQ")):ke().text("Rules")),a?c().createElement(Yr,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function ln(){return ln=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ln.apply(this,arguments)}const sn=e=>{let{matchRules:t,Component:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["matchRules","Component"]);const[a,o]=(0,u.UkJ)(t);return c().createElement(c().Fragment,null,(0,Q.isEmpty)(o)?null:c().createElement(r,ln({matchRules:o},n)),(0,Q.isEmpty)(a)?null:c().createElement(r,ln({isMlMatch:!0,matchRules:a},n)))};sn.propTypes={matchRules:u.p3$,Component:K().func};const cn=sn,un=(0,xe.Z)((e=>({label:{fontSize:"13px",lineHeight:"15px",color:e.palette.primary.light},container:{display:"flex",flexDirection:"column"},badge:{display:"flex",marginBottom:"8px",cursor:"pointer"},matchLabels:{marginLeft:"30px"}}))),pn=e=>{let{label:t,matchRules:r}=e;const n=un(),[a,o]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>o((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement("div",{onClick:l,className:n.badge},c().createElement($r.Z,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(cn,{Component:Yr,matchRules:r,className:n.matchLabels}):null)},dn=(0,xe.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),mn=(0,xe.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),hn=e=>{let{transitiveMatchRules:t}=e;const r=mn();return c().createElement(c().Fragment,null,t.map(((e,t)=>{let{label:n,matchRules:a}=e;return c().createElement("div",{key:t,className:r.ruleWrapper},c().createElement("div",{className:r.label},n),c().createElement(qr,{matchRules:a}))})))};function gn(){return gn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gn.apply(this,arguments)}const fn=(0,gt.Z)(en),bn=e=>{let{transitiveMatchRules:t}=e;const r=dn(),[n,a]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(fn,{tooltipTitle:c().createElement(hn,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:n},ke().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(pn,gn({key:t},e)))):null)},yn=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(bn,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(cn,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:on})};var vn=r(4270),En=r(73698),xn=r(12231),wn=r(95544),On=r(90436);const Cn=(0,xe.Z)((e=>({root:{maxWidth:156,paddingTop:"9px",paddingBottom:"9px"},outlined:{paddingRight:32,paddingLeft:12},arrowIcon:{fontSize:"18px",top:"calc(50% - 9px)",right:"12px",color:e.palette.text.secondary},currentValue:{display:"flex",alignItems:"center"},currentValueIcon:{fontSize:"18px",marginRight:"8px",color:e.palette.text.secondary},currentValueText:{fontSize:"14px",lineHeight:"16px",textTransform:"uppercase",fontWeight:500,color:e.palette.text.primary,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},menuItem:{padding:"9px 12px 7px"},firstMenuItemButton:{borderTop:"1px solid #e4e4e4"},menuItemInner:{display:"flex",alignItems:"flex-start"},menuItemIcon:{fontSize:"18px",color:e.palette.text.secondary,marginRight:"9px"},menuItemLabel:{fontSize:"14px",lineHeight:"16px",fontWeight:500,color:e.palette.text.primary},menuItemDescription:{fontSize:"10px",lineHeight:"16px",color:e.palette.text.secondary}})));function Tn(){return Tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tn.apply(this,arguments)}const kn=e=>"onClick"in e,Sn=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:o=!1}=e;const l=Cn();return c().createElement(En.Z,{classes:{root:l.root,icon:l.arrowIcon,outlined:l.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,Q.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n=e}=t.find((0,Q.propEq)("value",e))||{};return c().createElement(wn.Z,{className:l.currentValue},r&&c().createElement(r,{className:l.currentValueIcon}),c().createElement(De.ZP,{title:n},c().createElement(On.Z,{className:l.currentValueText},n)))},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},getContentAnchorEl:null},disabled:o,"data-reltio-id":"reltio-profile-select-mode"},(e=>{const t=e.findIndex(kn);return e.map(((e,r)=>{const{value:n,description:a,icon:o}=e,i={value:n,className:l.menuItem};return kn(e)&&(i.onClick=()=>e.onClick(n),i.className=Ee()(i.className,{[l.firstMenuItemButton]:r===t})),c().createElement(xn.Z,Tn({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(wn.Z,{className:l.menuItemInner},c().createElement(o,{className:l.menuItemIcon}),c().createElement(wn.Z,null,c().createElement(On.Z,{className:l.menuItemLabel},n),c().createElement(On.Z,{className:l.menuItemDescription},a))))}))})([...t,...r]))};var In=r(16482),Pn=r(7421),Nn=r(80233),Dn=r(73272);function Rn(){return Rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rn.apply(this,arguments)}const jn=e=>c().createElement("svg",Rn({viewBox:"0 0 20 20"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 10L14 5.5V9h-3.5L5 3.5 3.5 5l6.04 6H14v3.5l4.5-4.5zM7.04 11.455L3.5 15 5 16.5l3.54-3.545-1.5-1.5z"})),Zn=(0,xe.Z)((e=>({expanded:{backgroundColor:"rgba(0, 0, 0, 0.03)"},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word"},icon:{width:"32px",height:"32px",fill:"#fff",backgroundColor:"rgba(177, 92, 189, 1)",borderRadius:"50%",margin:"5px 12px 0 8px"},infoBlock:{display:"flex",flexDirection:"row"},header:{display:"flex",flexDirection:"row",paddingBottom:"5px"},flex:{flex:1},caption:{fontSize:"16px",color:"rgba(0, 0, 0, 0.87)"},title:{display:"flex",flexDirection:"row",alignItems:"center",margin:"6px 0 8px 0"},flag:{height:"12px",width:"12px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},pmReviewCard:{borderTop:"3px solid #E83D40",flexDirection:"column",width:"100%"},date:{fontSize:"13px",color:"rgba(0, 0, 0, 0.87)"},mainInfo:{display:"flex",flexDirection:"column",flex:1}}))),_n=e=>{let{date:t,type:r,createdBy:n,step:a,children:o,Actions:l}=e;const i=Zn(),[u,p]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:Ee()(i.header,{[i.expanded]:u})},c().createElement(jn,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:Ee()(i.caption,i.flex)},ke().text("Match review")),c().createElement(Dn.Z,{className:i.flag}),c().createElement("span",{className:i.date},ke().date(t,"L")),c().createElement(qt.Z,{isOpen:u,onClick:()=>{p(!u)}})),c().createElement("div",{className:i.infoBlock},c().createElement("div",{className:i.flex},c().createElement("div",{className:i.info},r),c().createElement("div",{className:i.info},ke().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},ke().text("Step: ${step}",{step:a}))),l))),u?o:null)};_n.propTypes={date:K().number,createdBy:K().string,type:K().string,step:K().string,children:K().oneOfType([K().node,K().arrayOf(K().node)]),Actions:K().node};const An=_n;var Mn=r(33109),Ln=r(91026),Fn=r(88357),Bn=r(51586),Vn=r(15793),zn=r(2633),Un=r(81521),Hn=r(8978),Wn=r(13896),Gn=r(58651),qn=r(46847),Kn=r(15459);function Yn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const $n=(0,xe.Z)((()=>({"@global .rst__node":{minWidth:"100%",whiteSpace:"nowrap",position:"relative",textAlign:"left"},"@global .rst__node.rst__rtl":{textAlign:"right"},"@global .rst__nodeContent":{position:"absolute",top:0,bottom:0},"@global .rst__lineBlock, .rst__absoluteLineBlock":{height:"100%",position:"relative",display:"inline-block"},"@global .rst__absoluteLineBlock":{position:"absolute",top:0},"@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{position:"absolute",content:"",backgroundColor:"black"},"@global .rst__lineHalfHorizontalRight::before":{height:"1px",top:"50%",right:0,width:"50%"},"@global .rst__rtl.rst__lineHalfHorizontalRight::before":{left:0,right:"initial"},"@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{width:"1px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after":{right:"50%",left:"initial"},"@global .rst__lineHalfVerticalTop::after":{height:"50%"},"@global .rst__lineHalfVerticalBottom::after":{top:"auto",bottom:0,height:"50%"},"@global .rst__highlightLineVertical":{zIndex:3},"@global .rst__highlightLineVertical::before":{position:"absolute",content:"",backgroundColor:"#36c2f6",width:"8px",marginLeft:"-4px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__highlightLineVertical::before":{marginLeft:"initial",marginRight:"-4px",left:"initial",right:"50%"},"@keyframes arrow-pulse":{"0%":{transform:"translate(0, 0)",opacity:0},"30%":{transform:"translate(0, 300%)",opacity:1},"70%":{transform:"translate(0, 700%)",opacity:1},"100%":{transform:"translate(0, 1000%)",opacity:0}},"@global .rst__highlightLineVertical::after":{content:"",position:"absolute",height:0,marginLeft:"-4px",left:"50%",top:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid white",animation:"arrow-pulse 1s infinite linear both"},"@global .rst__rtl.rst__highlightLineVertical::after":{marginLeft:"initial",marginRight:"-4px",right:"50%",left:"initial"},"@global .rst__highlightTopLeftCorner::before":{zIndex:3,content:"",position:"absolute",borderTop:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(50% + 4px)",top:"50%",marginTop:"-4px",right:0,width:"calc(50% + 4px)"},"@global .rst__rtl.rst__highlightTopLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:0,right:"initial"},"@global .rst__highlightBottomLeftCorner":{zIndex:3},"@global .rst__highlightBottomLeftCorner::before":{content:"",position:"absolute",borderBottom:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(100% + 4px)",top:0,right:"12px",width:"calc(50% - 8px)"},"@global .rst__rtl.rst__highlightBottomLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:"12px",right:"initial"},"@global .rst__highlightBottomLeftCorner::after":{content:"",position:"absolute",height:0,right:0,top:"100%",marginTop:"-12px",borderTop:"12px solid transparent",borderBottom:"12px solid transparent",borderLeft:"12px solid #36c2f6"},"@global .rst__rtl.rst__highlightBottomLeftCorner::after":{left:0,right:"initial",borderRight:"12px solid #36c2f6",borderLeft:"none"}})));function Xn(){return Xn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xn.apply(this,arguments)}const Qn=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:o,scaffoldBlockPxWidth:l,lowerSiblingCounts:i,connectDropTarget:u,isOver:p,draggedNode:d,canDrop:m,treeIndex:h,treeId:g,getPrevRow:f,node:b,path:y,rowDirection:v}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]);$n();const x="rtl"===v?"rst__rtl":null,w=i.length,O=[];let C;return i.forEach(((e,t)=>{let i="";if(e>0?i=0===r?"rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom":t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":0===r?i="rst__lineHalfHorizontalRight":t===w-1&&(i="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:l},className:Yn("rst__lineBlock",i,x)})),h!==r&&t===o){let e,o="";o=r===n+a-1?"rst__highlightBottomLeftCorner":h===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===v?{width:l,right:l*t}:{width:l,left:l*t},O.push(c().createElement("div",{key:t,style:e,className:Yn("rst__absoluteLineBlock",o,x)}))}})),C="rtl"===v?{right:l*w}:{left:l*w},u(c().createElement("div",Xn({},E,{className:Yn("rst__node",x)}),O,c().createElement("div",{className:"rst__nodeContent",style:C},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:p,canDrop:m,draggedNode:d}))))))};Qn.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},Qn.propTypes={treeIndex:K().number.isRequired,treeId:K().string.isRequired,swapFrom:K().number,swapDepth:K().number,swapLength:K().number,scaffoldBlockPxWidth:K().number.isRequired,lowerSiblingCounts:K().arrayOf(K().number).isRequired,listIndex:K().number.isRequired,children:K().node.isRequired,connectDropTarget:K().func.isRequired,isOver:K().bool.isRequired,canDrop:K().bool,draggedNode:K().shape({}),getPrevRow:K().func.isRequired,node:K().shape({}).isRequired,path:K().arrayOf(K().oneOfType([K().string,K().number])).isRequired,rowDirection:K().string};const Jn=Qn;function ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ta(e,t,r[t])}))}return e}function ta(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e){let{targetIndex:t,node:r,currentIndex:n,getNodeKey:a,path:o=[],lowerSiblingCounts:l=[],ignoreCollapsed:i=!0,isPseudoRoot:s=!1}=e;const c=s?[]:[...o,a({node:r,treeIndex:n})];if(n===t)return{node:r,lowerSiblingCounts:l,path:c};if(!r.children||i&&!0!==r.expanded)return{nextIndex:n+1};let u=n+1;const p=r.children.length;for(let e=0;e<p;e+=1){const n=ra({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...l,p-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function na(e){let{node:t,ignoreCollapsed:r=!0}=e;return ra({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function aa(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:o,parentNode:l=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=a?[]:[...s,r({node:o,treeIndex:i})];if(!a&&!1===t(a?null:{node:o,parentNode:l,path:u,lowerSiblingCounts:c,treeIndex:i}))return!1;if(!o.children||!0!==o.expanded&&n&&!a)return i;let p=i;const d=o.children.length;if("function"!=typeof o.children)for(let e=0;e<d;e+=1)if(p=aa({callback:t,getNodeKey:r,ignoreCollapsed:n,node:o.children[e],parentNode:a?null:o,currentIndex:p+1,lowerSiblingCounts:[...c,d-e-1],path:u}),!1===p)return!1;return p}function oa(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:o,parentNode:l=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=ea({},o),p=a?[]:[...s,r({node:u,treeIndex:i})],d={node:u,parentNode:l,path:p,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(d)};let m=i;const h=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,o)=>{const l=oa({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,h-o-1],path:p});return m=l.treeIndex,l.node}))),{node:t(d),treeIndex:m}}function la(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||aa({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function ia(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:oa({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function sa(e){let{treeData:t,expanded:r=!0}=e;return ia({treeData:t,callback:e=>{let{node:t}=e;return ea({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function ca(e){let{treeData:t,path:r,newNode:n,getNodeKey:a,ignoreCollapsed:o=!0}=e;const l="RESULT_MISS",i=e=>{let{isPseudoRoot:t=!1,node:s,currentTreeIndex:c,pathIndex:u}=e;if(!t&&a({node:s,treeIndex:c})!==r[u])return l;if(u>=r.length-1)return"function"==typeof n?n({node:s,treeIndex:c}):n;if(!s.children)throw new Error("Path referenced children of node with no children.");let p=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:p,pathIndex:u+1});if(t!==l)return ea({},s,t?{children:[...s.children.slice(0,e),t,...s.children.slice(e+1)]}:{children:[...s.children.slice(0,e),...s.children.slice(e+1)]});p+=1+na({node:s.children[e],ignoreCollapsed:o})}return l},s=i({node:{children:t},currentTreeIndex:-1,pathIndex:-1,isPseudoRoot:!0});if(s===l)throw new Error("No node found at the given path.");return s.children}function ua(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,o=null,l=null;return{treeData:ca({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return o=t,l=r,null}}),node:o,treeIndex:l}}function pa(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:o,isPseudoRoot:l=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:p,path:d=[]}=e;const m=e=>l?[]:[...d,p({node:e,treeIndex:c})];if(c>=r-1||i&&(!s.children||!s.children.length)){if("function"==typeof s.children)throw new Error("Cannot add to children defined by a function");{const e=ea({},s,o?{expanded:!0}:{},{children:s.children?[n,...s.children]:[n]});return{node:e,nextIndex:c+2,insertedTreeIndex:c+1,parentPath:m(e),parentNode:l?null:e}}}if(u>=t-1){if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!l)return{node:s,nextIndex:c+1};let e=c+1,t=null,o=null;for(let n=0;n<s.children.length;n+=1){if(e>=r){t=e,o=n;break}e+=1+na({node:s.children[n],ignoreCollapsed:a})}if(null===o){if(e<r&&!i)return{node:s,nextIndex:e};t=e,o=s.children.length}const u=ea({},s,{children:[...s.children.slice(0,o),n,...s.children.slice(o)]});return{node:u,nextIndex:e,insertedTreeIndex:t,parentPath:m(u),parentNode:l?null:u}}if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!l)return{node:s,nextIndex:c+1};let h=null,g=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,l)=>{if(null!==h)return e;const s=pa({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:o,isLastChild:i&&l===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:p,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:h,parentNode:f,parentPath:g}=s),b=s.nextIndex,s.node})));const v=ea({},s,{children:y}),E={node:v,nextIndex:b};return null!==h&&(E.insertedTreeIndex=h,E.parentPath=[...m(v),...g],E.parentNode=f),E}function da(e){let{treeData:t,depth:r,minimumTreeIndex:n,newNode:a,getNodeKey:o=(()=>{}),ignoreCollapsed:l=!0,expandParent:i=!1}=e;if(!t&&0===r)return{treeData:[a],treeIndex:0,path:[o({node:a,treeIndex:0})],parentNode:null};const s=pa({targetDepth:r,minimumTreeIndex:n,newNode:a,ignoreCollapsed:l,expandParent:i,getNodeKey:o,isPseudoRoot:!0,isLastChild:!0,node:{children:t},currentIndex:-1,currentDepth:-1});if(!("insertedTreeIndex"in s))throw new Error("No suitable position found to insert.");const c=s.insertedTreeIndex;return{treeData:s.node.children,treeIndex:c,path:[...s.parentPath,o({node:a,treeIndex:c})],parentNode:s.parentNode}}function ma(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return la({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function ha(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||ha(e,t)))}function ga(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.children?"function"==typeof e.children?t+1:e.children.reduce(((e,r)=>Math.max(e,ga(r,t+1))),t):t}function fa(e){let{getNodeKey:t,treeData:r,searchQuery:n,searchMethod:a,searchFocusOffset:o,expandAllMatchPaths:l=!1,expandFocusMatchPaths:i=!0}=e,s=0;const c=e=>{let{isPseudoRoot:r=!1,node:u,currentIndex:p,path:d=[]}=e,m=[],h=!1,g=!1;const f=r?[]:[...d,t({node:u,treeIndex:p})],b=r?null:{path:f,treeIndex:p},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a(ea({},b,{node:u,searchQuery:n}))&&(s===o&&(g=!0),s+=1,h=!0);let v=p;const E=ea({},u);return y&&(E.children=E.children.map((e=>{const t=c({node:e,currentIndex:v+1,path:f});return t.node.expanded?v=t.treeIndex:v+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(g=!0),(l&&t.matches.length>0||(l||i)&&t.hasFocusMatch)&&(E.expanded=!0)),t.node}))),r||E.expanded||(m=m.map((e=>ea({},e,{treeIndex:null})))),h&&(m=[ea({},b,{node:E}),...m]),{node:m.length>0?E:u,matches:m,hasFocusMatch:g,treeIndex:v}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const ba={find:fa,getDepth:ga,isDescendant:ha,getTreeFromFlatData:function(e){let{flatData:t,getKey:r=(e=>e.id),getParentKey:n=(e=>e.parentId),rootKey:a="0"}=e;if(!t)return[];const o={};if(t.forEach((e=>{const t=n(e);t in o?o[t].push(e):o[t]=[e]})),!(a in o))return[];const l=e=>{const t=r(e);return t in o?ea({},e,{children:o[t].map((e=>l(e)))}):ea({},e)};return o[a].map((e=>l(e)))},getFlatDataFromTree:ma,insertNode:da,addNodeUnderParent:function(e){let{treeData:t,newNode:r,parentKey:n=null,getNodeKey:a,ignoreCollapsed:o=!0,expandParent:l=!1,addAsFirstChild:i=!1}=e;if(null===n)return i?{treeData:[r,...t||[]],treeIndex:0}:{treeData:[...t||[],r],treeIndex:(t||[]).length};let s=null,c=!1;const u=ia({treeData:t,getNodeKey:a,ignoreCollapsed:o,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const p=u?u[u.length-1]:null;if(c||p!==n)return t;c=!0;const d=ea({},t);if(l&&(d.expanded=!0),!d.children)return s=a+1,ea({},d,{children:[r]});if("function"==typeof d.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<d.children.length;e+=1)m+=1+na({node:d.children[e],ignoreCollapsed:o});return s=m,ea({},d,{children:i?[r,...d.children]:[...d.children,r]})}});if(!c)throw new Error("No node found with the given key.");return{treeData:u,treeIndex:s}},getNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,o=null;try{ca({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return o={node:t,treeIndex:r},t}})}catch(e){}return o},removeNode:ua,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return ca({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:ca,toggleExpandedForAll:sa,map:ia,walk:la,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=ra({targetIndex:r,getNodeKey:n,node:{children:t,expanded:!0},currentIndex:-1,path:[],lowerSiblingCounts:[],isPseudoRoot:!0});return a.node?a:null},getVisibleNodeCount:function(e){let{treeData:t}=e;const r=e=>e.children&&!0===e.expanded&&"function"!=typeof e.children?1+e.children.reduce(((e,t)=>e+r(t)),0):1;return t.reduce(((e,t)=>e+r(t)),0)},getDescendantCount:na};function ya(){return ya=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ya.apply(this,arguments)}function va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ea(e,t,r[t])}))}return e}function Ea(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xa=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:o,canDrop:l,canDrag:i,node:s,title:u,subtitle:p,draggedNode:d,path:m,treeIndex:h,isSearchMatch:g,isSearchFocus:f,buttons:b,className:y,style:v,didDrop:E,treeId:x,isOver:w,parentNode:O,rowDirection:C}=e,T=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]);const k=u||s.title,S=p||s.subtitle,I="rtl"===C?"rst__rtl":null;let P;i&&(P="function"==typeof s.children&&s.expanded?c().createElement("div",{className:"rst__loadingHandle"},c().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>c().createElement("div",{key:t,className:Yn("rst__loadingCirclePoint",I)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const N=d&&ha(d,s),D=!E&&o;let R={left:-.5*t};return"rtl"===C&&(R={right:-.5*t}),c().createElement("div",ya({style:{height:"100%"}},T),r&&s.children&&(s.children.length>0||"function"==typeof s.children)&&c().createElement("div",null,c().createElement("button",{type:"button","aria-label":s.expanded?"Collapse":"Expand",className:Yn(s.expanded?"rst__collapseButton":"rst__expandButton",I),style:R,onClick:()=>r({node:s,path:m,treeIndex:h})}),s.expanded&&!o&&c().createElement("div",{style:{width:t},className:Yn("rst__lineChildren",I)})),c().createElement("div",{className:Yn("rst__rowWrapper",I)},n(c().createElement("div",{className:Yn("rst__row",D&&"rst__rowLandingPad",D&&!l&&"rst__rowCancelPad",g&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",I,y),style:va({opacity:N?.5:1},v)},P,c().createElement("div",{className:Yn("rst__rowContents",!i&&"rst__rowContentsDragDisabled",I)},c().createElement("div",{className:Yn("rst__rowLabel",I)},c().createElement("span",{className:Yn("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof k?k({node:s,path:m,treeIndex:h}):k),S&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof S?S({node:s,path:m,treeIndex:h}):S)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};xa.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},xa.propTypes={node:K().shape({}).isRequired,title:K().oneOfType([K().func,K().node]),subtitle:K().oneOfType([K().func,K().node]),path:K().arrayOf(K().oneOfType([K().string,K().number])).isRequired,treeIndex:K().number.isRequired,treeId:K().string.isRequired,isSearchMatch:K().bool,isSearchFocus:K().bool,canDrag:K().bool,scaffoldBlockPxWidth:K().number.isRequired,toggleChildrenVisibility:K().func,buttons:K().arrayOf(K().node),className:K().string,style:K().shape({}),connectDragPreview:K().func.isRequired,connectDragSource:K().func.isRequired,parentNode:K().shape({}),isDragging:K().bool.isRequired,didDrop:K().bool.isRequired,draggedNode:K().shape({}),isOver:K().bool.isRequired,canDrop:K().bool,rowDirection:K().string};const wa=xa;function Oa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ca extends s.Component{render(){const e=this.props,{children:t,connectDropTarget:r,treeId:n,drop:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","connectDropTarget","treeId","drop"]);return r(c().createElement("div",null,s.Children.map(t,(e=>(0,s.cloneElement)(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Oa(e,t,r[t])}))}return e}({},o))))))}}Ca.defaultProps={canDrop:!1,draggedNode:null},Ca.propTypes={children:K().node.isRequired,connectDropTarget:K().func.isRequired,isOver:K().bool.isRequired,canDrop:K().bool,draggedNode:K().shape({}),treeId:K().string.isRequired,drop:K().func.isRequired};const Ta=Ca,ka=(0,xe.Z)((()=>({"@global .rst__placeholder":{position:"relative",height:"68px",maxWidth:"300px",padding:"10px"},"@global .rst__placeholder, .rst__placeholder > *":{boxSizing:"border-box"},"@global .rst__placeholder::before":{border:"3px dashed #d9d9d9",content:"",position:"absolute",top:"5px",right:"5px",bottom:"5px",left:"5px",zIndex:-1},"@global .rst__placeholderLandingPad, .rst__placeholderCancelPad":{border:"none !important",boxShadow:"none !important",outline:"none !important"},"@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *":{opacity:"0 !important"},"@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before":{backgroundColor:"lightblue",borderColor:"white"},"@global .rst__placeholderCancelPad::before":{backgroundColor:"#e6a8ad"}}))),Sa=e=>{let{isOver:t,canDrop:r}=e;return ka(),c().createElement("div",{className:Yn("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};Sa.defaultProps={isOver:!1,canDrop:!1},Sa.propTypes={isOver:K().bool,canDrop:K().bool};const Ia=Sa,Pa=e=>{let t=[],r=[],n=null;return a=>{const o=Object.keys(a).sort(),l=o.map((e=>a[e]));return(l.length!==t.length||l.some(((e,r)=>e!==t[r]))||o.some(((e,t)=>e!==r[t])))&&(t=l,r=o,n=e(a)),n}},Na=Pa(da),Da=Pa(ma),Ra=Pa(na);function ja(e){let{treeIndex:t}=e;return t}function Za(e){return"string"==typeof e?e:null===e||"object"!=typeof e||!e.props||!e.props.children||"string"!=typeof e.props.children&&"object"!=typeof e.props.children?"":"string"==typeof e.props.children?e.props.children:e.props.children.map((e=>Za(e))).join("")}function _a(e,t,r,n,a){return"function"==typeof r[e]?String(r[e]({node:r,path:n,treeIndex:a})).indexOf(t)>-1:"object"==typeof r[e]?Za(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Aa(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return _a("title",a,t,r,n)||_a("subtitle",a,t,r,n)}const Ma={defaultSearchMethod:Aa,defaultGetNodeKey:ja};var La=r(75047);class Fa{constructor(e){this.hoverHandler=()=>{if(null===this.hoverProps)return;const{dropTargetProps:e,monitor:t,component:r}=this.hoverProps,n=t.getItem();if(!n)return;const a=this.getTargetDepth(e,t,r),o=n.node;(e.node!==this.lastDropTargetNode||a!==this.lastDropTargetDepth)&&(this.lastDropTargetNode=e.node,this.lastDropTargetDepth=a,this.dragHover({node:o,path:n.path,minimumTreeIndex:e.listIndex,depth:a}),this.hoverProps=null)},this.deferredCallHoverHandler=()=>{if(this.shouldSkipMoreFrames)return this.shouldSkipMoreFrames=!1,void(this.rafId=requestAnimationFrame(this.deferredCallHoverHandler));this.rafId=null,this.hoverHandler()},this.treeRef=e,this.resetDragVariables()}get startDrag(){return this.treeRef.startDrag}get dragHover(){return this.treeRef.dragHover}get endDrag(){return this.treeRef.endDrag}get drop(){return this.treeRef.drop}get treeId(){return this.treeRef.treeId}get dndType(){return this.treeRef.dndType}get treeData(){return this.treeRef.state.draggingTreeData||this.treeRef.props.treeData}get getNodeKey(){return this.treeRef.props.getNodeKey}get customCanDrop(){return this.treeRef.props.canDrop}get maxDepth(){return this.treeRef.props.maxDepth}resetDragVariables(){this.lastDropTargetNode=null,this.lastDropTargetDepth=null,this.hoverProps=null,this.lastCanDropResult=null,this.lastCanDropProps=null,this.shouldSkipMoreFrames=!1,this.rafId=null}getTargetDepth(e,t,r){let n=0;const a=e.getPrevRow();if(a){let{path:t}=a;!this.treeRef.canNodeHaveChildren(a.node)&&(t=t.slice(0,t.length-1)),n=Math.min(t.length,e.path.length)}let o,l=(t.getItem().path||[]).length;if(t.getItem().treeId!==this.treeId)if(l=0,r){const n=(0,La.findDOMNode)(r).getBoundingClientRect(),a=t.getSourceClientOffset().x-n.left;o=Math.round(a/e.scaffoldBlockPxWidth)}else o=e.path.length;else{const r="rtl"===e.rowDirection?-1:1;o=Math.round(r*t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth)}let i=Math.min(n,Math.max(0,l+o-1));if(void 0!==this.maxDepth&&null!==this.maxDepth){const e=ga(t.getItem().node);i=Math.max(0,Math.min(i,this.maxDepth-e-1))}return i}canDrop(e,t){if(!t.isOver())return!1;const r=e.getPrevRow(),n=r?r.path:[],a=r?r.node:{},o=Math.round(t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth),l={nodeId:void 0!==e.node.nodeId?e.node.nodeId:e.node,rowAbove:r,abovePath:n,aboveNodeId:void 0!==a.nodeId?a.nodeId:a,blocksOffset:o};if((0,Q.equals)(this.lastCanDropProps,l))return this.lastCanDropResult;this.lastCanDropProps=l;const i=this.getTargetDepth(e,t,null);if(i>=n.length&&"function"==typeof a.children)return this.lastCanDropResult=!1;if("function"==typeof this.customCanDrop){const{node:r}=t.getItem(),n=Na({treeData:this.treeData,newNode:r,depth:i,getNodeKey:this.getNodeKey,minimumTreeIndex:e.listIndex,expandParent:!0});return this.lastCanDropResult=this.customCanDrop({node:r,prevPath:t.getItem().path,prevParent:t.getItem().parentNode,prevTreeIndex:t.getItem().treeIndex,nextPath:n.path,nextParent:n.parentNode,nextTreeIndex:n.treeIndex})}return this.lastCanDropResult=!0}wrapSource(e){const t={beginDrag:e=>(this.startDrag(e),{node:e.node,parentNode:e.parentNode,path:e.path,treeIndex:e.treeIndex,treeId:e.treeId}),endDrag:(e,t)=>{this.rafId&&cancelAnimationFrame(this.rafId),this.endDrag(t.getDropResult()),this.resetDragVariables()},isDragging:(e,t)=>{const r=t.getItem().node;return e.node===r}};return(0,Wn.DragSource)(this.dndType,t,(function(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging(),didDrop:t.didDrop()}}))(e)}wrapTarget(e){const t={drop:(e,t,r)=>{this.rafId&&cancelAnimationFrame(this.rafId);const n={node:t.getItem().node,path:t.getItem().path,treeIndex:t.getItem().treeIndex,treeId:this.treeId,minimumTreeIndex:e.treeIndex,depth:this.getTargetDepth(e,t,r)};return this.lastDropTargetNode=null,this.drop(n),n},hover:(e,t,r)=>{this.rafId?this.shouldSkipMoreFrames=!0:(this.shouldSkipMoreFrames=!1,this.hoverProps={dropTargetProps:e,monitor:t,component:r},this.rafId=requestAnimationFrame(this.deferredCallHoverHandler))},canDrop:this.canDrop.bind(this)};return(0,Wn.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}wrapPlaceholder(e){const t={drop:(e,t)=>{const{node:r,path:n,treeIndex:a}=t.getItem(),o={node:r,path:n,treeIndex:a,treeId:this.treeId,minimumTreeIndex:0,depth:0};return this.drop(o),o}};return(0,Wn.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}}function Ba(){return Ba=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ba.apply(this,arguments)}function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){za(e,t,r[t])}))}return e}function za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Ua=1;const Ha=e=>{const t=Va({},e,{style:Va({},e.theme.style,e.style),innerStyle:Va({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Va({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:wa,placeholderRenderer:Ia,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:Jn};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Wa extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:o}=Ha(e);this.dndManager=new Fa(this),this.treeId=`rst__${Ua}`,Ua+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(Ta),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Hn._t||Hn.ZP)(Un.aV),this.vStrength=(0,Hn.Kx)(o),this.hStrength=(0,Hn.v7)(o)),this.state={draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,searchMatches:[],searchFocusTreeIndex:null,dragging:!1,draggingExpandedPaths:[],ignoreOneTreeUpdate:!1,instanceProps:{treeData:this.props.treeData||[],searchQuery:null,searchFocusOffset:null,ignoreTreeChanges:!1}},this.toggleChildrenVisibility=this.toggleChildrenVisibility.bind(this),this.moveNode=this.moveNode.bind(this),this.startDrag=this.startDrag.bind(this),this.dragHover=this.dragHover.bind(this),this.endDrag=this.endDrag.bind(this),this.drop=this.drop.bind(this),this.handleDndMonitorChange=this.handleDndMonitorChange.bind(this)}componentDidMount(){Wa.loadLazyChildren(this.props);const e=Wa.search(this.props,this.state,!0,!0,!1);this.setState(e),this.clearMonitorSubscription=this.props.dragDropManager.getMonitor().subscribeToStateChange(this.handleDndMonitorChange)}static getDerivedStateFromProps(e,t){const{instanceProps:r}=t,n={};return(0,Q.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,Wa.search(e,t,!0,!0,!0)):Object.assign(n,Wa.search(e,t,!0,!0,!1)),r.searchQuery=e.searchQuery,r.searchFocusOffset=e.searchFocusOffset,n.instanceProps=r,n}componentDidUpdate(e,t){if(this.state.dragging!==t.dragging&&this.props.onDragStateChanged&&this.props.onDragStateChanged({isDragging:this.state.dragging,draggedNode:this.state.draggedNode}),this.state.dragging)if((0,Q.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&la({treeData:this.state.draggingTreeData,getNodeKey:this.props.getNodeKey,callback:e=>{let{node:t,path:r,lowerSiblingCounts:n,treeIndex:a}=e;t.pending&&t.expanded&&this.props.onLazyLoadChildren({node:t,path:r,lowerSiblingCounts:n,treeIndex:a})}});else{const{treeData:e}=ua({treeData:this.props.treeData,path:t.draggedPath,getNodeKey:this.props.getNodeKey});this.setState((t=>{let{draggingExpandedPaths:r}=t;return{draggingTreeData:r.reduce(((e,t)=>{let r;try{r=ca({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Va({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,Q.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,Wa.loadLazyChildren(this.props),Object.assign(a,Wa.search(this.props,this.state,!1,!1,!1))),a.draggingTreeData=null,a.draggedNode=null,a.draggedMinimumTreeIndex=null,a.draggedDepth=null,a.dragging=!1,a.draggingExpandedPaths=[],a.instanceProps=Va({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Da({ignoreCollapsed:!0,getNodeKey:this.props.getNodeKey,treeData:e})}handleDndMonitorChange(){!this.props.dragDropManager.getMonitor().isDragging()&&this.state.draggingTreeData&&this.endDrag()}toggleChildrenVisibility(e){let{node:t,path:r}=e;const{instanceProps:n}=this.state,a=ca({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Va({},t,{expanded:!t.expanded})},getNodeKey:this.props.getNodeKey});this.props.onChange(a),this.props.onVisibilityToggle({treeData:a,node:t,expanded:!t.expanded,path:r})}moveNode(e){let{node:t,path:r,treeIndex:n,depth:a,minimumTreeIndex:o}=e;const{treeData:l,treeIndex:i,path:s,parentNode:c}=da({treeData:this.state.draggingTreeData,newNode:t,depth:a,minimumTreeIndex:o,expandParent:!0,getNodeKey:this.props.getNodeKey});this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1,draggingExpandedPaths:[]},(()=>{this.props.onChange(l),this.props.onMoveNode({treeData:l,node:t,treeIndex:i,path:s,nextPath:s,nextTreeIndex:i,prevPath:r,prevTreeIndex:n,nextParentNode:c})}))}static search(e,t,r,n,a){const{onChange:o,getNodeKey:l,searchFinishCallback:i,searchQuery:s,searchMethod:c,searchFocusOffset:u,onlyExpandSearchedNodes:p}=e,{instanceProps:d}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:h,matches:g}=fa({getNodeKey:l,treeData:p?sa({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Aa,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,o(h)),i&&i(g);let f=null;return r&&null!==u&&u<g.length&&(f=g[u].treeIndex),m.searchMatches=g,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=ua({treeData:e.instanceProps.treeData,path:t,getNodeKey:this.props.getNodeKey});return{draggingTreeData:r,draggedNode:n,draggedDepth:t.length-1,draggedMinimumTreeIndex:a,draggedPath:t,dragging:!0}}))}dragHover(e){let{node:t,depth:r,minimumTreeIndex:n}=e;this.state.draggedDepth===r&&this.state.draggedMinimumTreeIndex===n||this.setState((e=>{let{draggingTreeData:a,instanceProps:o,draggingExpandedPaths:l}=e;const i=a||o.treeData,s=Na({treeData:i,newNode:t,depth:r,minimumTreeIndex:n,expandParent:!0,getNodeKey:this.props.getNodeKey}),c=this.getRows(s.treeData)[s.treeIndex].path.slice(0,-1),u=(0,Q.pipe)((0,Q.when)((0,Q.always)((0,Q.gt)(c.length,0)),(0,Q.append)(c)),(0,Q.uniqWith)((0,Q.eqBy)(String)))(l);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:ca({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Va({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey}),searchFocusTreeIndex:null,dragging:!0,draggingExpandedPaths:u}}))}endDrag(e){const{instanceProps:t}=this.state;if(e){if(e.treeId!==this.treeId){const{node:r,path:n,treeIndex:a}=e;let o=this.props.shouldCopyOnOutsideDrop;"function"==typeof o&&(o=o({node:r,prevTreeIndex:a,prevPath:n}));let l=this.state.draggingTreeData||t.treeData;o&&(l=ca({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Va({},t)},getNodeKey:this.props.getNodeKey})),this.props.onChange(l),this.props.onMoveNode({treeData:l,node:r,treeIndex:null,path:null,nextPath:null,nextTreeIndex:null,prevPath:n,prevTreeIndex:a})}}else(()=>{this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1})})()}drop(e){this.moveNode(e)}canNodeHaveChildren(e){const{canNodeHaveChildren:t}=this.props;return!t||t(e)}static loadLazyChildren(e){la({treeData:e.treeData,getNodeKey:e.getNodeKey,callback:t=>{let{node:r,path:n,lowerSiblingCounts:a,treeIndex:o}=t;r.pending&&(r.expanded||e.loadCollapsedLazyChildren)&&e.onLazyLoadChildren({node:r,path:n,lowerSiblingCounts:a,treeIndex:o,done:t=>e.onChange(ca({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Va({},n,{children:t}):n},getNodeKey:e.getNodeKey}),!0)})}})}renderRow(e,t){let{listIndex:r,style:n,getPrevRow:a,matchKeys:o,swapFrom:l,swapDepth:i,swapLength:s}=t;const{node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:h}=e,{canDrag:g,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:v}=Ha(this.props),E=this.treeNodeRenderer,x=this.nodeContentRenderer,w=d[d.length-1],O=w in o,C=O&&o[w]===y,T={node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:h,isSearchMatch:O,isSearchFocus:C},k=f?f(T):{},S="function"!=typeof g?g:g(T),I={treeIndex:h,scaffoldBlockPxWidth:b,node:u,path:d,treeId:this.treeId,rowDirection:v};return c().createElement(E,Ba({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:l,swapLength:s,swapDepth:i},I),c().createElement(x,Ba({parentNode:p,isSearchMatch:O,isSearchFocus:C,canDrag:S,toggleChildrenVisibility:this.toggleChildrenVisibility},I,k)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:o,placeholderRenderer:l,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=Ha(this.props),{searchMatches:p,searchFocusTreeIndex:d,draggedNode:m,draggedDepth:h,draggedMinimumTreeIndex:g}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,v=null,E=null;if(m&&null!==g){const e=Na({treeData:f,newNode:m,depth:h,minimumTreeIndex:g,expandParent:!0,getNodeKey:s}),t=g;v=e.treeIndex,E=1+Ra({node:m}),y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=[...e.slice(0,t),...e.slice(t+n)];return[...a.slice(0,r),...e.slice(t,t+n),...a.slice(r)]}(this.getRows(e.treeData),v,t,E)}else y=this.getRows(f);const x={};p.forEach(((e,t)=>{let{path:r}=e;x[r[r.length-1]]=t}));const w=null!==d?{scrollToIndex:d}:{};let O,C=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=l;O=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(o){C=Va({height:"100%"},C);const t=this.scrollZoneVirtualList;O=c().createElement(Un.qj,null,(r=>{let{height:o,width:l}=r;return c().createElement(t,Ba({},w,{dragDropManager:e,verticalStrength:this.vStrength,horizontalStrength:this.hStrength,speed:30,scrollToAlignment:"start",className:this.props.classes.rst__virtualScrollOverride,width:l,onScroll:e=>{let{scrollTop:t}=e;this.scrollTop=t},height:o,style:n,rowCount:y.length,estimatedRowSize:"function"!=typeof a?a:void 0,rowHeight:"function"!=typeof a?a:e=>{let{index:t}=e;return a({index:t,treeIndex:t,node:y[t].node,path:y[t].path})},rowRenderer:e=>{let{index:t,style:r}=e;return this.renderRow(y[t],{listIndex:t,style:r,getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:v,swapDepth:h,swapLength:E})}},i))}))}else O=y.map(((e,t)=>this.renderRow(e,{listIndex:t,style:{height:"function"!=typeof a?a:a({index:t,treeIndex:t,node:e.node,path:e.path})},getPrevRow:()=>y[t-1]||null,matchKeys:x,swapFrom:v,swapDepth:h,swapLength:E})));return c().createElement("div",{className:Yn("rst__tree",r,b),style:C},O)}}Wa.propTypes={classes:K().object,dragDropManager:K().shape({getMonitor:K().func}).isRequired,treeData:K().arrayOf(K().object).isRequired,style:K().shape({}),className:K().string,innerStyle:K().shape({}),rowHeight:K().oneOfType([K().number,K().func]),slideRegionSize:K().number,reactVirtualizedListProps:K().shape({}),scaffoldBlockPxWidth:K().number,maxDepth:K().number,searchMethod:K().func,searchQuery:K().any,searchFocusOffset:K().number,searchFinishCallback:K().func,generateNodeProps:K().func,isVirtualized:K().bool,treeNodeRenderer:K().func,nodeContentRenderer:K().func,placeholderRenderer:K().func,theme:K().shape({style:K().shape({}),innerStyle:K().shape({}),reactVirtualizedListProps:K().shape({}),scaffoldBlockPxWidth:K().number,slideRegionSize:K().number,rowHeight:K().oneOfType([K().number,K().func]),treeNodeRenderer:K().func,nodeContentRenderer:K().func,placeholderRenderer:K().func}),getNodeKey:K().func,onChange:K().func.isRequired,onMoveNode:K().func,canDrag:K().oneOfType([K().func,K().bool]),canDrop:K().func,canNodeHaveChildren:K().func,shouldCopyOnOutsideDrop:K().oneOfType([K().func,K().bool]),onVisibilityToggle:K().func,dndType:K().string,onDragStateChanged:K().func,onlyExpandSearchedNodes:K().bool,rowDirection:K().string,onLazyLoadChildren:K().func,ignoreTreeChanges:K().bool},Wa.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:ja,innerStyle:{},isVirtualized:!0,maxDepth:null,treeNodeRenderer:null,nodeContentRenderer:null,onMoveNode:()=>{},onVisibilityToggle:()=>{},placeholderRenderer:null,reactVirtualizedListProps:{},rowHeight:null,scaffoldBlockPxWidth:null,searchFinishCallback:null,searchFocusOffset:null,searchMethod:null,searchQuery:null,shouldCopyOnOutsideDrop:!1,slideRegionSize:null,style:{},theme:{},onDragStateChanged:()=>{},onlyExpandSearchedNodes:!1,rowDirection:"ltr",onLazyLoadChildren:()=>{},ignoreTreeChanges:!1},(0,qn.polyfill)(Wa);const Ga=(0,Kn.Z)((()=>({"@global .ReactVirtualized__Grid__innerScrollContainer":{overflow:"visible !important"},"@global .ReactVirtualized__Grid":{outline:"none"},"@global .ReactVirtualized__List":{},rst__virtualScrollOverride:{overflow:"auto !important"},"@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer":{direction:"rtl"}})))(Wa),qa=e=>c().createElement(Wn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Ga,Ba({},e,{dragDropManager:r}))})),Ka=e=>c().createElement(Wn.DndProvider,{backend:Gn.default},c().createElement(qa,e));var Ya=r(17822),$a=r(64435),Xa=r(33662),Qa=r(87356),Ja=r(54275),eo=r(72654),to=r(27556);function ro(){return ro=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ro.apply(this,arguments)}const no=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:o,containerHeight:l,paperProps:i,listContent:s,externalInputField:u,classes:p={}}=e;const d=(0,Ja.Z)({containerWidth:o,containerHeight:l});return c().createElement("div",{className:p.root},u,c().createElement(Pn.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(eo.Z,t,c().createElement(to.Z,ro({elevation:2},i),c().createElement("div",{className:Ee()(d.container,n),style:{width:o}},c().createElement("div",{className:d.list},s))))})))},ao=(0,xe.Z)({onlyValue:{color:"rgba(0,0,0,.6)",fontSize:"13px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},select:{fontSize:"13px",color:"rgba(0,0,0,.6)",paddingLeft:"15px","&&":{paddingRight:"35px"}},selectMenu:{"& li":{fontSize:"13px",height:"32px"}},textField:{maxWidth:"100%"}}),oo=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:o}=e;const l=ao(),[i,...u]=n,p=0===u.length;(0,s.useEffect)((()=>{p&&t!==i.value&&r(i.value)}),[i.value]);const d=!!o;return c().createElement("div",{className:a.root},p?c().createElement(On.Z,{className:a.onlyValue||l.onlyValue,variant:"h6"},i.label):c().createElement(or.Z,{displayEmpty:d,disableUnderline:!0,classes:{select:a.select||l.select},TextFieldProps:{classes:{root:a.textField||l.textField}},MenuProps:{classes:{list:a.selectMenu||l.selectMenu}},value:t||"",entries:d?[{value:"",label:o},...n]:n,onChange:e=>r(e||null)}))};oo.propTypes={value:K().string,onChange:K().func,options:K().arrayOf(K().shape({value:K().string,label:K().string})),classes:K().shape({root:K().string,onlyValue:K().string,select:K().string,selectMenu:K().string,textField:K().string}),emptyLabel:K().string};const lo=oo;var io=r(28101);function so(){return so=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},so.apply(this,arguments)}const co=e=>c().createElement("svg",so({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),c().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},c().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),c().createElement("g",{mask:"url(#AttributesList_svg__a)"},c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),c().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),c().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),c().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),c().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),c().createElement("defs",null,c().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),c().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),c().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopOpacity:.01}),c().createElement("stop",{offset:1})))),uo=(0,xe.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),po=e=>{let{IconRenderer:t=co,text:r,secondaryText:n}=e;const a=uo();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(On.Z,{className:a.text},r),n&&c().createElement(On.Z,{className:a.secondaryText},n)))};var mo=r(11821);const ho=(0,xe.Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 12px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}});var go=r(85256);const fo=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:o}=e;const l=ho();return c().createElement("div",{className:l.container},c().createElement(me.k,{size:"L",icon:Ne.default,onClick:t,className:l.icon,tooltipTitle:ke().text("Close")}),a||c().createElement(c().Fragment,null,c().createElement(On.Z,{variant:"h6"},r),n&&c().createElement(c().Fragment,null,c().createElement(go.Z,{orientation:"vertical",flexItem:!0,className:l.divider}),c().createElement(On.Z,{variant:"body1",color:"textSecondary",className:l.secondTitle},n)),o))};var bo=r(90590),yo=r(40435),vo=r(21210),Eo=r(79935),xo=r(92985);const wo=e=>{let{height:t,margin:r}=e;return c().createElement("div",{style:{width:"1px",height:`${t}px`,borderLeft:"1px solid rgba(0,0,0,0.38)",margin:`0 ${r}px`,flexShrink:"0"}})};wo.propTypes={height:K().number,margin:K().number};const Oo=wo,Co=e=>{let{label:t}=e;return t||null},To=e=>{let{value:t}=e;return t||null},ko=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const o=e=>{const t=e.cellRenderer||To,r=e.headCellRenderer||Co;return c().createElement("tr",{key:e.id},c().createElement("th",{key:e.id},c().createElement(r,e)),n.map(((r,n)=>c().createElement("td",{key:n},c().createElement(t,{value:r[e.id],columnValue:r,rowData:e})))))};return c().createElement("table",{className:t},a>0&&c().createElement("thead",null,r.slice(0,a).map(o)),c().createElement("tbody",null,r.slice(a).map(o)))};ko.propTypes={rowsData:K().arrayOf(K().shape({id:K().string,label:K().string,headCellRenderer:K().func,cellRenderer:K().func})),columnsData:K().arrayOf(K().object),theadRowsNumber:K().number,className:K().string};const So=(0,s.memo)(ko);var Io=r(57412),Po=r(29611),No=r(50581),Do=r(21853);const Ro=(0,xe.Z)({searchButton:{marginLeft:"auto !important",marginRight:"-4px",padding:"8px"},input:{flex:"1 0 200px",marginLeft:"70px",fontSize:"14px",background:"rgba(0,0,0,0.03) 2px",padding:"4px 0",marginRight:"4px"},startAdornment:{color:"rgba(0,0,0,0.54)",paddingLeft:"8px"}}),jo=e=>{let{query:t,onChange:r}=e;const[n,a]=(0,s.useState)(t),[o,l]=(0,s.useState)(!!t);(0,s.useEffect)((()=>{a(t)}),[t]);const i=Ro(),u=n&&n.length;return o?c().createElement(Po.Z,{className:i.input,value:n,autoFocus:!0,placeholder:ke().text("Search"),disableUnderline:!0,onChange:(0,Q.pipe)(ze.NA,a),startAdornment:c().createElement(No.Z,{position:"start"},c().createElement(Do.default,{className:i.startAdornment})),endAdornment:c().createElement(No.Z,{position:"end"},u&&c().createElement(yo.Z,{size:"S",icon:Ne.default,onClick:(0,Q.pipe)(Q.F,l,(0,Q.always)(""),(0,Q.tap)(r),a)})),onKeyPress:(0,Q.when)((0,Q.propEq)("key","Enter"),(0,Q.pipe)((0,Q.always)(n),Q.trim,r))}):c().createElement(Pe.Z,{className:i.searchButton,onClick:(0,Q.pipe)(Q.T,l)},c().createElement(Do.default,null))};var Zo,_o=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(Zo||(Zo={}));const Ao=()=>{const[e,t]=(0,s.useState)(null),r=e===Zo.READING,n=e===Zo.EDITING,a=e===Zo.HOVERED;(0,s.useEffect)((()=>{t(Zo.READING)}),[]);const o=(0,s.useCallback)((0,u.DsO)(t,50),[]),l=(0,s.useCallback)((()=>{n||o(Zo.HOVERED)}),[o,n]),i=(0,s.useCallback)((()=>{n||o(Zo.READING)}),[o,n]);return{setReadingMode:(0,s.useCallback)((()=>t(Zo.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(Zo.EDITING)),[t]),onMouseLeave:i,onMouseEnter:l,isReadingMode:r,isEditingMode:n,isHovered:a}};const Mo=(0,s.createContext)(null),Lo=e=>{let{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children"]);return c().createElement(Mo.Provider,{value:r},t)},Fo=e=>{const{getCrosswalkColor:t=(0,Q.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Mo)||{};return e?t(e):""},Bo=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Mo)||{};return e},Vo=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=ze.ZT}=(0,s.useContext)(Mo)||{},n=!!e&&!!t.find((0,Q.eqBy)(u.uKF,e));return{isHighlighted:n,isDimmed:t.length>0&&!n,highlightCrosswalk:(0,s.useCallback)((()=>r(e,!0)),[e,r]),removeHighlight:(0,s.useCallback)((()=>r(e,!1)),[e,r])}},zo=e=>{const{toggleCrosswalkFocus:t=ze.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Mo)||{};return{isFocused:!!e&&r.some((0,Q.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Uo=r(72753);const Ho=(0,xe.Z)({sourceItem:{display:"flex",overflow:"hidden"},eyeIcon:e=>{let{isFocused:t}=e;return{marginLeft:"10px",color:t?"#000":"rgba(0, 0, 0, 0.54)"}},label:{color:"rgba(0, 0, 0, 0.87)",verticalAlign:"top",fontSize:"13px",lineHeight:"16px"},sourceInfo:{overflow:"hidden"},crosswalkValue:{color:"rgba(0, 0, 0, 0.54)",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},sourceIcon:e=>{let{color:t}=e;return{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px",backgroundColor:t}},crosswalkIcon:e=>{let{color:t,isOpaque:r}=e;return{backgroundColor:t,height:"12px",width:"12px",borderRadius:"30px",opacity:r?1:.38,transition:"opacity 0.3s"}}}),Wo=(0,xe.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),Go=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:o,isFocused:l}=zo(t),i=Ho({color:r,isFocused:l}),s=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),{label:p}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:Ee()(i.sourceItem,n)},c().createElement(vo.Z,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},p),a&&c().createElement(me.k,{icon:Uo.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:ke().text("Focus"),onClick:()=>o()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},qo=(0,xe.Z)((e=>({tooltip:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,filter:"drop-shadow(0px 1px 5px #00000033) drop-shadow(0px 3px 1px #0000001F) drop-shadow(0px 2px 2px #00000024)",padding:"10px",maxWidth:"none"},arrow:{color:e.palette.background.paper}})));function Ko(){return Ko=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ko.apply(this,arguments)}const Yo=e=>{const t=qo();return c().createElement(De.ZP,Ko({},e,{classes:t,arrow:!0}))},$o=e=>{let{crosswalk:t,className:r}=e;const n=Fo(t),{isDimmed:a,highlightCrosswalk:o,removeHighlight:l}=Vo(t),i=Ho({isOpaque:!a,color:n});return c().createElement(Yo,{title:c().createElement(Go,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:Ee()(i.crosswalkIcon,r),onMouseEnter:()=>o(),onMouseLeave:()=>l()}))};var Xo=r(35039),Qo=r(31992),Jo=r(22983),el=r(27604),tl=r(43054),rl=r(79784),nl=r(12980);const al=(0,xe.Z)((()=>({textField:{margin:0},input:{borderRadius:0},inputMultiline:{"&$input":{paddingTop:0,paddingBottom:0}},booleanEditor:{paddingLeft:"10px"},timestampEditor:{"&$paper":{minWidth:"255px"}},paper:e=>{let{color:t,containerWidth:r}=e;return{border:`3px solid ${t}`,borderRadius:"4px",width:r,minWidth:"160px"}},popoverRoot:{zIndex:"10!important"}})));function ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ll=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],il=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:o,onEdit:l}=e;const i=al({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=(0,nl.AG)(r,p),[m,h]=(0,s.useState)(d),g={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=(0,nl.Ho)(t,m);if(!(0,Q.isNil)(m)&&!(0,Q.equals)(m,d)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(p.type)?null:e};l(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ol(e,t,r[t])}))}return e}({},r,n))}o()};return c().createElement(rl.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:Ee()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(p.type),[i.timestampEditor]:(0,u.j5n)(p.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||ll.includes(p.type)?"Escape"===e.key&&o():f()},onBackdropClick:f},c().createElement(dr.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:h,TextFieldProps:g,value:m,fullWidth:!0}))};function sl(){return sl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sl.apply(this,arguments)}const cl=e=>c().createElement("svg",sl({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3.5A8.503 8.503 0 003.5 12c0 4.692 3.808 8.5 8.5 8.5s8.5-3.808 8.5-8.5-3.808-8.5-8.5-8.5zM6.1 12c0-3.26 2.64-5.9 5.9-5.9 1.161 0 2.24.336 3.149.917L7.017 15.15A5.821 5.821 0 016.101 12zm5.9 5.9c-1.16 0-2.24-.336-3.148-.917l8.131-8.131c.581.908.917 1.987.917 3.148 0 3.26-2.64 5.9-5.9 5.9z",fill:"#000",fillOpacity:.54}));function ul(){return ul=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ul.apply(this,arguments)}const pl=e=>c().createElement("svg",ul({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.847 9.402a6.34 6.34 0 00-.8-1.322L8.08 17.048A6.34 6.34 0 0012 18.4a6.398 6.398 0 005.847-8.998zm-7.283 7.283l6.121-6.121a4.898 4.898 0 01-6.121 6.121zm1.437-11.084a6.334 6.334 0 013.92 1.352L6.953 15.92A6.334 6.334 0 015.6 12c0-3.536 2.864-6.4 6.4-6.4zm0 1.5c.5 0 .982.075 1.436.215l-6.121 6.12A4.898 4.898 0 0112 7.1zM6.6 17.903A7.967 7.967 0 0012 20c4.417-.001 8.001-3.585 8.001-8.001a7.967 7.967 0 00-2.601-5.902A7.988 7.988 0 0012 4c-4.416 0-8 3.584-8 8a7.967 7.967 0 002.602 5.902zM12 2.5c-5.244 0-9.5 4.256-9.5 9.5s4.256 9.5 9.5 9.5 9.5-4.256 9.5-9.5-4.256-9.5-9.5-9.5z",fill:"#000",fillOpacity:.54})),dl=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(me.k,{disabled:n,showForDisabled:!0,icon:t?cl:pl,tooltipTitle:n?ke().text("You don't have permissions to ignore"):ke().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function ml(){return ml=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ml.apply(this,arguments)}const hl=e=>c().createElement("svg",ml({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4v6l2 2v2h-5v7l-.992 1L11 21v-7H6v-2l2-2V4H7V2h10v2h-1z",fill:"#000",fillOpacity:.54}));function gl(){return gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gl.apply(this,arguments)}const fl=e=>c().createElement("svg",gl({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 10V4h1V2H7v2h1v6l-2 2v2h5v7l1.008 1L13 21v-7h5v-2l-2-2zm-6-6h4v7l1 1H9l1-1V4z",fill:"#000",fillOpacity:.54})),bl=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(me.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?hl:fl,tooltipTitle:n?"You don't have permissions to pin":ke().text("Pin"),size:"XS",disableRipple:!0})},yl=(0,xe.Z)((e=>({menuItem:{minHeight:"32px",color:e.palette.text.secondary},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"16px"},sourceItem:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)",paddingBottom:"8px",paddingLeft:"16px",maxWidth:"200px"}}))),vl=(0,gt.Z)(xn.Z),El=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(On.Z,{classes:{root:t.menuText}},n))},xl=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=yl(),{disabled:o,text:l,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement(Go,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(vl,{tooltipTitle:i,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:o,ref:t,"data-reltio-id":`crosswalk-menu-item${u}`},c().createElement(El,{icon:p,text:l,styles:a}))}));xl.displayName="CrosswalkMenuItem";const wl=xl;function Ol(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cl=(0,xe.Z)((()=>({root:e=>{let{fullyColored:t,opaque:r,color:n,variant:a}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ol(e,t,r[t])}))}return e}({height:"28px"},"filled"===a&&{borderRadius:"4px",background:t?n:`linear-gradient(to right, ${n} 8px, rgba(0,0,0,0.05) 8px)`},"outlined"===a&&{"&::after":{content:'""',position:"absolute",background:n,borderRadius:"4px 0px 0px 4px",width:"8px",height:"100%",pointerEvents:"none"},"&::before":{content:'""',position:"absolute",boxSizing:"border-box",borderRadius:"4px",border:t?`${n} solid 2px`:"rgba(0,0,0,0.12) solid 1px",width:"100%",height:"100%",pointerEvents:"none"}},{display:"flex",alignItems:"center",maxWidth:"230px",opacity:r?1:.38,transition:"opacity 0.3s",position:"relative"})},attributeValue:{marginLeft:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1},actions:{display:"flex",width:"71px",justifyContent:"flex-end",marginRight:"4px"}}))),Tl=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:o,disableEdit:l,disableDelete:i,onIgnore:p,onEdit:d,onPin:m,onDelete:h}=e;const{isReadingMode:g,isEditingMode:f,isHovered:b,onMouseEnter:y,onMouseLeave:v,setReadingMode:E,setEditingMode:x}=Ao(),w=(0,s.useRef)(),O=(0,u.nIW)(a.uri),C=(0,u.x_)(o),T=!n.system&&!C,k=T&&!l&&(0,u.Z5t)(u.fO_.EDITING,n),S=T&&!i&&(0,u.Edd)(u.fO_.EDITING,n),I=(0,u.ZiX)(a.uri),P=!I&&(!g&&k||a.pin),N=!I&&(!g&&k||a.ignored),D=Fo(o),{isHighlighted:R,isDimmed:j,highlightCrosswalk:Z,removeHighlight:_}=Vo(o),A=Cl({variant:C?"outlined":"filled",opaque:!j,fullyColored:R,color:D}),M=[{crosswalk:o,color:D},{disabled:!k,text:ke().text("Edit"),icon:c().createElement(el.Z,null),tooltip:k?null:ke().text("You don't have permissions to edit"),onClick:()=>x(),id:"edit"},{disabled:!S,text:ke().text("Delete"),icon:c().createElement(Jo.Z,null),tooltip:S?null:ke().text("You don't have permissions to delete"),onClick:()=>h({attributeType:n,attributeValue:a,crosswalks:[o]}),id:"delete"}],L=()=>{_(),E()};return c().createElement("div",{ref:w,className:Ee()(t,A.root),onMouseEnter:()=>{Z(),y()},onMouseLeave:()=>{_(),v()},"data-reltio-id":r},c().createElement("div",{className:A.attributeValue},c().createElement(tr.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:A.actions},P&&c().createElement(bl,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!k}),N&&c().createElement(dl,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!k}),b&&c().createElement(nr.Z,{MenuItemRenderer:wl,menuId:`simple-attribute-additional-actions-${O}`,buttonComponent:me.k,buttonProps:{icon:tl.Z,size:"XS",tooltipTitle:ke().text("More actions")},onMenuClose:L,menuItems:M})),f&&c().createElement(il,{attributeType:n,attributeValue:a,color:D,onClose:L,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:o}),containerRef:w}))},kl=(0,xe.Z)((()=>({simpleAttributesWrapper:{display:"flex",flexWrap:"wrap",gap:"4px",width:"100%",minHeight:"28px"},dropIndicator:{height:"28px",color:"#828282",fontSize:"13px",lineHeight:"28px",background:"rgba(0, 0, 0, 0.04)",border:"1px dashed #828282",borderRadius:"4px",boxSizing:"border-box",padding:"0 12px"}})));function Sl(){return Sl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sl.apply(this,arguments)}const Il=e=>{let{attributeValues:t,attributeType:r,parentUri:n,disableEdit:a,crosswalksMap:o,onAdd:l}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","attributeType","parentUri","disableEdit","crosswalksMap","onAdd"]);const s=kl(),[{isDragItemOver:p},d]=(0,Wn.useDrop)({accept:"Crosswalk",canDrop:e=>{let{crosswalk:t}=e;const n=(0,u.bC9)(t.uri)||"relation"===t.ownerType,o=(0,u.WgC)(t.uri)&&"entity"===t.ownerType;return(0,u.d89)(u.fO_.EDITING,r)&&!a&&(n&&(0,u.$NE)(r.uri)||o&&(0,u.EdS)(r.uri))},collect:e=>({isDragItemOver:e.isOver()&&e.canDrop()}),drop:(e,a)=>{let{crosswalk:o}=e;l({attributeType:r,crosswalk:o,parentUri:n,index:t.length})}});let m=0;return c().createElement("div",{ref:d,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=o[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(Tl,Sl({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),p&&c().createElement("div",{className:s.dropIndicator},ke().text("Drop here")))};var Pl=r(77277);function Nl(){return Nl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nl.apply(this,arguments)}const Dl=e=>{let{className:t,attributeValues:r,attributeType:n,onAdd:a,parentUri:o,disableEdit:l}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues","attributeType","onAdd","parentUri","disableEdit"]);const s=!l&&(0,u.d89)(u.fO_.EDITING,n);return 0===r.length&&s?c().createElement(Pl.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:o,attributeType:n,index:0})},ke().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(oi,Nl({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:l},i)))))},Rl=e=>{let{children:t}=e;const r=Wo();return c().createElement(On.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},jl=(0,xe.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Zl(){return Zl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zl.apply(this,arguments)}const _l=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=jl(),o=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),l=(0,xt.useSelector)(wt.ZP.selectors.getUIPath),i=c().createElement(Rl,null,c().createElement("a",{href:(0,u.ChB)({uiPath:l,uri:(0,u.bwT)(t)}),className:a.label},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:a.relationshipLabel},t.relationshipLabel))),s=(0,Q.pipe)(u.tF$,(0,Q.map)((e=>(0,u.zeJ)(o,e))),(0,Q.reject)(Q.isNil))(r);return c().createElement(ni,Zl({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function Al(){return Al=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Al.apply(this,arguments)}const Ml=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(_l,Al({key:e.uri,attributeValue:e},n)))))};var Ll=r(26729);const Fl=(0,xe.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Bl(){return Bl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bl.apply(this,arguments)}const Vl={imageWidth:55,imageHeight:45},zl=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=Fl();return c().createElement(ni,Bl({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Ll.Z,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Vl})},n))};function Ul(){return Ul=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ul.apply(this,arguments)}const Hl=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(zl,Ul({key:e.uri,attributeValue:e},n)))))},Wl=(0,xe.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function Gl(){return Gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gl.apply(this,arguments)}function ql(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const Kl=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:o}=e,l=ql(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Wl(),[p,d]=(0,s.useState)(a),m=(0,Q.propOr)(r.length,"totalValues",n),h=a<m,g=h&&p<m,f=h&&p>=m,b=r.slice(0,p),y=m-p;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(Dl,Gl({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},l));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=l,n=ql(l,["crosswalksMap"]);return c().createElement(Ml,Gl({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(Hl,Gl({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},l));default:return c().createElement(Il,Gl({attributeValues:e,attributeType:t},l))}})(b),g&&c().createElement(Xo.Z,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&o(),d(p+a)}}),f&&c().createElement(Qo.Z,{onClick:()=>{d(a)}}))},Yl=(0,xe.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function $l(){return $l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$l.apply(this,arguments)}const Xl=e=>{let{attributeTypes:t,attributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeTypes","attributes"]);const a=Yl();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(g.Z,{key:e.uri,enabled:!0},c().createElement(xo.Z,{className:a.title,label:e.label}),c().createElement(Kl,$l({attributeType:e,attributeValues:r[e.name],paging:(0,Q.path)(["paging",e.uri],r)},n))))))},Ql=e=>{let{onClick:t}=e;return c().createElement(me.k,{icon:Jo.Z,tooltipTitle:ke().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},Jl=(0,s.createContext)(null),ei=e=>{let{children:t,attributeUris:r}=e;return c().createElement(Jl.Provider,{value:r},t)},ti=e=>((0,s.useContext)(Jl)||[]).some((t=>(0,u.sOy)(t,e))),ri=(0,xe.Z)((()=>({root:{display:"flex",minHeight:"20px"},actions:{display:"flex",width:"65px",justifyContent:"flex-end",flexShrink:0,alignSelf:"center"},crosswalkIcon:{display:"inline-block",verticalAlign:"middle","& + &":{marginLeft:"4px"}}}))),ni=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:o,disableEdit:l,disableDelete:i,onPin:p,onIgnore:d,onDelete:m,onEdit:h,onAdd:g}=e;const f=ri(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:v}=Ao(),E=!l&&(0,u.Z5t)(u.fO_.EDITING,t),x=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),O=!w&&(!b&&E||r.pin),C=!w&&(!b&&E||r.ignored),T=!b&&x,k=ti(r.uri),[S,I]=(0,s.useState)(k||w);(0,rt.D)((()=>{k&&I(k)}),[k]);const P=(0,Q.pipe)((0,Q.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),Q.values,Q.flatten,(0,Q.uniqBy)((0,Q.prop)("uri")))(o);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:v},c().createElement($r.Z,{onClick:()=>I((e=>!e)),expanded:S}),c().createElement("span",null,a,P.map((e=>c().createElement($o,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(Eo.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(bl,{disabled:!E,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),C&&c().createElement(dl,{disabled:!E,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(Ql,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:o[r.uri]})}))),S&&c().createElement(Xl,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:o,disableEdit:!E,disableDelete:!x,onPin:p,onIgnore:d,onDelete:m,onEdit:h,onAdd:g}))};function ai(){return ai=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ai.apply(this,arguments)}const oi=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=c().createElement(Rl,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(ni,ai({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var li=r(33286),ii=r(22118),si=r(8629),ci=r(49429),ui=r(38724),pi=r(55999);const di=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(si.Z,{open:t},c().createElement(ui.Z,null,c().createElement(pi.Z,null,ke().text("Are you sure you want to delete this?"))),c().createElement(ci.Z,null,c().createElement(Pl.Z,{onClick:r,color:"primary"},ke().text("No")),c().createElement(Pl.Z,{onClick:()=>{n(),r()},color:"primary"},ke().text("Yes"))))};var mi=r(92332);const hi=(0,xe.Z)((e=>({coloredCell:{"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.06)",pointerEvents:"none"}},headCell:{display:"flex",alignItems:"center",fontSize:"12px",height:"100%",color:e.palette.text.secondary},rowCell:{fontSize:"13px",overflow:"hidden"},cellValueWrapper:{padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"}},attributeTitle:{display:"block",marginLeft:"3px","&:not(:last-child)":{marginBottom:"5px"}},ovValue:{"& + &":{marginTop:"4px"}},count:{textAlign:"center"},ruleType:{display:"flex",alignItems:"center"},ruleTypeLabel:{marginRight:"5px"},rulePopup:{width:"270px",overflowY:"hidden"},popupItem:{paddingBottom:"5px",paddingTop:"5px"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},closeButton:{height:24,width:24},popupTitle:{fontWeight:500,marginLeft:"12px"},popupTitleWrapper:{display:"flex",paddingLeft:16,paddingTop:16},popupItemsWrapper:{overflowY:"auto",maxHeight:"280px"},winnerSourceItemWrapper:{paddingBottom:"2px",paddingTop:"2px"},winnerSourceItem:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"8px"},winnerSourceItemLabel:{fontSize:13}}))),gi=e=>{const t=hi();return c().createElement("div",{className:Ee()(t.headCell,t.coloredCell)},c().createElement(mi.default,e),e.children)},fi=(0,xe.Z)({root:{marginBottom:"-6px"}}),bi=(0,H.Z)((0,Q.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:o}=e;const l=fi(),i=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,Q.propEq)("uri",t)),p=e=>!(null!=n&&n.find((0,Q.propEq)("uri",e.uri))),d=(0,Q.pipe)((0,Q.propOr)([],"attributes"),(0,Q.reject)((0,Q.either)(u.YkG,u.Or$)),(0,Q.filter)((0,Q.either)(u.QZu,p)),(0,Q.filter)((0,Q.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:l.root},c().createElement(v.Z,{label:ke().text("Attribute"),popupTitle:ke().text("Add attributes"),data:d,onApply:e=>{const t=e.filter(p);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{o({attributeType:e,parentUri:r})}))}}))}));const yi=(0,H.Z)((0,Q.pick)(["readOnly"]))((e=>{let{readOnly:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readOnly"]);return t?c().createElement(gi,r):c().createElement(gi,r,c().createElement(Eo.Z,null),c().createElement(bi,null))})),vi=e=>{let{value:t}=e;const r=hi();return c().createElement("div",{className:r.cellValueWrapper},t)},Ei=(0,xe.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function xi(){return xi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xi.apply(this,arguments)}const wi=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Ei();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(Kl,xi({attributeValues:t},r)))};function Oi(){return Oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oi.apply(this,arguments)}const Ci=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Ei(),a=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(oi,Oi({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function Ti(){return Ti=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ti.apply(this,arguments)}const ki=e=>{let{attributeValues:t,crosswalksMap:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","crosswalksMap"]);const a=Ei(),o=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:a.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(_l,Ti({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,o)};function Si(){return Si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Si.apply(this,arguments)}const Ii=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=Ei();return c().createElement(c().Fragment,null,null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(zl,Si({attributeValue:e},r))))))};function Pi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ni=(0,H.Z)((0,Q.pick)(["onDelete","onPin","onIgnore","onEdit","onAdd","parentUri","readOnly"]))((e=>{let{value:t,onDelete:r,onEdit:n,onPin:a,onIgnore:o,onAdd:l,parentUri:i,readOnly:s}=e;return class{static build(e,t){switch(e){case u.oS0.TYPE_NESTED:return c().createElement(Ci,t);case u.oS0.TYPE_REFERENCE:return c().createElement(ki,t);case u.oS0.TYPE_IMAGE:return c().createElement(Ii,t);default:return c().createElement(wi,t)}}}.build(t.attributeType.type,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pi(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:o,onAdd:l,disableEdit:s,disableDelete:s}))})),Di=e=>{let{value:{values:t,attributeType:r}}=e;const n=hi();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(xo.Z,{className:n.attributeTitle,label:r.label}),c().createElement(Z,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},Ri=e=>{let{value:t}=e;const r=hi();return c().createElement("div",{className:Ee()(r.cellValueWrapper,r.count)},t)};var ji=r(11776),Zi=r(38402),_i=r(49378),Ai=r(99144);const Mi=e=>{let{sourcesUriOrder:t}=e;const r=hi(),n=(0,xt.useSelector)(wt.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Zi.Z,{key:e,className:r.popupItem},c().createElement(vo.Z,{className:r.sourceIcon,sourceType:e}),c().createElement(_i.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Li=e=>{let{attributeUri:t}=e;const r=hi(),n=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Zi.Z,{key:a.uri,className:r.popupItem},c().createElement(_i.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},Fi=(0,Q.cond)([[(0,Q.prop)("sourcesUriOrder"),()=>ke().text("Source sequence")],[(0,Q.prop)("primaryAttributeUri"),()=>ke().text("Attribute winner")],[(0,Q.prop)("comparisonAttributeUri"),()=>ke().text("Comparison attribute")]]),Bi=(0,Q.cond)([[(0,Q.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Mi,{sourcesUriOrder:t})}],[(0,Q.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Li,{attributeUri:t})}],[(0,Q.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Li,{attributeUri:t})}]]),Vi=e=>{let{info:t}=e;const r=hi(),[n,a]=(0,s.useState)(null),o=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(me.k,{icon:Ai.Z,tooltipTitle:ke().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(rl.ZP,{classes:{paper:r.rulePopup},open:!!n,anchorEl:n,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:r.popupTitleWrapper},c().createElement(Pe.Z,{className:r.closeButton,onClick:o},c().createElement(Ne.default,null)),c().createElement(On.Z,{variant:"subtitle1",className:r.popupTitle},Fi(t))),c().createElement(ji.Z,{component:"div",className:r.popupItemsWrapper},Bi(t))))},zi=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const o=hi(),l=r||n||a;return c().createElement("div",{className:Ee()(o.cellValueWrapper,o.ruleType)},c().createElement("div",{className:o.ruleTypeLabel},t.label),l&&c().createElement(Vi,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function Ui(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hi=(0,xe.Z)({item:e=>{let{color:t,opacity:r,variant:n}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ui(e,t,r[t])}))}return e}({},"filled"===n&&{backgroundColor:t},"outlined"===n&&{border:`${t} solid 2px`},{opacity:r,transition:"opacity 0.3s",boxSizing:"border-box"})}});function Wi(){return Wi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wi.apply(this,arguments)}const Gi=(0,s.forwardRef)(((e,t)=>{let{color:r,opacity:n,variant:a="filled",children:o,className:l}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["color","opacity","variant","children","className"]);const s=Hi({color:r,opacity:n,variant:a});return c().createElement("div",Wi({ref:t,className:Ee()(s.item,l)},i),o)})),qi=e=>{let{crosswalk:t}=e;const r=hi(),n=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:o,removeHighlight:l}=Vo(t);return c().createElement(Gi,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>o(),onMouseLeave:()=>l()},c().createElement(vo.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(_i.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},Ki=e=>{let{value:{crosswalks:t}}=e;const r=hi();return c().createElement(ji.Z,{component:"div"},t.map((e=>c().createElement(Zi.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(qi,{crosswalk:e})))))},Yi=[{id:"ovValues",get label(){return ke().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return ke().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return ke().text("Rule type")},initialWidth:200},{id:"count",get label(){return ke().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return ke().text("Attribute values")},hideable:!1}],$i=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),Xi=["ovValues","ruleType","values"],Qi=e=>{switch(e){case"ovValues":return Di;case"values":return Ni;case"count":return Ri;case"ruleType":return zi;case"winnerSources":return Ki;default:return vi}},Ji=(0,Q.pipe)(u.cwx,(0,Q.sortWith)([(0,Q.descend)((0,Q.propOr)(-1,"priority"))]),(0,Q.map)((0,Q.prop)("uri"))),es=(0,Q.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,Q.pipe)(u.c31,(0,Q.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),ts=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,Q.pipe)((0,Q.filter)($i),(0,Q.chain)((e=>(0,Q.pipe)((0,Q.pickBy)(((t,r)=>{const n=(0,u.sOy)(r,e.uri),a=n?r.slice(e.uri.length+1):"",o=a&&(0,u.IM5)(e.value,a);return n&&(!o||$i(o))})),Q.values,Q.flatten)(t))),(0,Q.uniqBy)((0,Q.prop)("uri")))(e)},rs=(0,Q.map)((e=>{let{id:t,label:r,initialWidth:n,minWidth:a}=e;return{id:t,label:r,initialWidth:n,minWidth:a,autoResize:!n,resizable:!0,sortable:!1,headCellRenderer:"ovValues"===t?yi:gi,rowCellValueRenderer:Qi(t)}})),ns=(e,t,r,n,a,o)=>{switch(e){case"ovValues":return{attributeType:n,values:null==o?void 0:o.filter($i)};case"values":return{attributeType:n,attributeValues:o,crosswalksMap:a};case"count":return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;switch(e){case u.oS0.TYPE_REFERENCE:case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return t.length;default:return t.reduce(((e,t)=>e+r[t.uri].length),0)}}(n.type,o,a);case"ruleType":return((e,t,r)=>{var n,a;const o=[...e.entityTypes,...e.relationTypes||[]].find((0,Q.propEq)("uri",r)),l=null==o||null===(n=o.survivorshipGroups)||void 0===n?void 0:n.find((0,Q.propEq)("default",!0)),i=null==l||null===(a=l.mapping)||void 0===a?void 0:a.find((0,Q.propEq)("attribute",t.uri)),s=(0,u.o_J)(e,null==i?void 0:i.survivorshipStrategy)||(0,u.Xaq)(e),c=(e=>"configuration/survivorshipStrategies/SRC_SYS"===(null==e?void 0:e.uri))(s)?(0,Q.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==l?void 0:l.sourcesUriOrder)||[],...Ji(e)]):void 0,p=es(t),d=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?p(null==i?void 0:i.primaryAttributeUri):void 0,m=(0,u.YkM)(t)&&(e=>"configuration/survivorshipStrategies/MinValue"===(null==e?void 0:e.uri)||"configuration/survivorshipStrategies/MaxValue"===(null==e?void 0:e.uri))(s)?p(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:d,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:ts(o,a)};default:return null}};function as(){return as=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},as.apply(this,arguments)}const os=e=>{let{cell:t,CellValueRenderer:r,columnIndex:n,columnData:a}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["cell","CellValueRenderer","columnIndex","columnData"]);const l=hi(),i=0===n;return c().createElement("div",{className:Ee()(l.rowCell,i&&l.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,as({key:t,value:e},o)))))};var ls=r(44962),is=r(2682),ss=r(5806),cs=r(42494),us=r(84899);const ps=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[o,l]=(0,s.useState)("without");return c().createElement(si.Z,{open:t,onEnter:()=>l("without")},c().createElement(ui.Z,null,c().createElement(pi.Z,null,ke().text("You are attempting to change a value that is presently ignored.")),c().createElement(cs.Z,{component:"fieldset"},c().createElement(us.Z,{component:"legend"},ke().text("Please choose an option:")),c().createElement(is.Z,{value:o,onChange:(0,Q.pipe)(ze.NA,l)},c().createElement(ss.Z,{value:"without",control:c().createElement(ls.Z,null),label:ke().text("Save without Ignore")}),c().createElement(ss.Z,{value:"with",control:c().createElement(ls.Z,null),label:ke().text("Save and apply Ignore to new value")})))),c().createElement(ci.Z,null,c().createElement(Pl.Z,{onClick:r,color:"primary"},ke().text("Cancel")),c().createElement(Pl.Z,{onClick:()=>{"with"===o?a():n(),r()},color:"primary"},ke().text("Ok"))))},ds=(0,xe.Z)({tableContainer:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},tableHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between"},tableContent:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",position:"relative"}});function ms(){return ms=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ms.apply(this,arguments)}const hs=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=Xi,onChangeVisibleColumns:o,readOnly:l,onDelete:i=ze.ZT,onPin:p=ze.ZT,onIgnore:d=ze.ZT,onEdit:m=ze.ZT,onAdd:h=ze.ZT,selectedAttributeTypes:g,onSelectAttributeTypes:f=ze.ZT}=e;const b=ds(),y=(0,s.useMemo)((()=>(0,Q.pipe)((0,Q.filter)((e=>{let{id:t}=e;return a.includes(t)})),rs)(Yi)),[a]),{type:v,uri:E,attributes:x={}}=t||{},w=(0,xt.useSelector)(wt.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,Q.isNil)(g)){const e=(0,Q.pipe)(Q.keys,(0,Q.without)(["paging"]),(0,Q.map)((0,u.tCm)(v)),(0,Q.map)((e=>(0,u.zeJ)(w,e,v))),(0,Q.filter)(u.Uty))(x);f(e)}}),[t,g]);const O=(0,s.useMemo)((()=>v?function(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).map((o=>{const l=(0,u.nIW)(o.uri),i=a[l],s=(0,u.YkG)(o)?n.relation:n.entity;return(0,Q.pipe)((0,Q.reduce)(((r,n)=>(0,Q.assoc)(n,ns(n,e,t,o,s,i),r)),{}),(0,Q.assoc)("rawValue",i))(r)}))}(w,v,g,a,n,x):[]),[w,v,g,a,x,n]),{getDynamicRowCellHeight:C,changeRowCellHeight:T}=st(),k=(0,s.useCallback)((e=>c().createElement(at,ms({onChangeHeight:T},e),c().createElement(os,e))),[T]),S=(0,s.useCallback)((0,Q.either)(C,(0,Q.always)(68)),[C]),[I,P]=(0,s.useState)(null),[N,D]=(0,s.useState)(null),R=(0,s.useCallback)((e=>{e.attributeValue.ignored?D(e):m(e)}),[m,D]),j=(0,s.useMemo)((()=>({onDelete:P,onPin:p,onIgnore:d,onEdit:R,onAdd:h,parentUri:E,parentTypeUri:v,selectedAttributeTypes:g,onSelectAttributeTypes:f,readOnly:l})),[P,p,d,R,h,E,v,g,f,l]);return c().createElement("div",{className:b.tableContainer},c().createElement(_t.Z,{classes:{root:b.tableHeader},title:ke().text("Sources")},c().createElement(Ie,{columnsData:Yi,selectedColumns:a,onChangeColumns:o})),c().createElement("div",{className:b.tableContent},r&&c().createElement(Vr.Z,null),c().createElement(U.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:y,rowsData:O,renderRowCell:k,getRowCellHeight:S,context:j})),c().createElement(di,{open:!!I,onClose:()=>P(null),onConfirm:()=>i(I)}),c().createElement(ps,{open:!!N,onClose:()=>D(null),onConfirmEditWithIgnore:()=>m(N),onConfirmEditWithoutIgnore:()=>{d({attributeValue:N.attributeValue}),m(N)}}))}));function gs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fs(e,t,r[t])}))}return e}function fs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bs=[],ys=e=>{let{entity:t,onLoad:r=ze.ZT,onModify:n=ze.ZT,onError:a=ze.ZT}=e;const[o,l]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),p=(0,s.useRef)([]),d=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{d.current=null}),[]),[h,g]=(0,s.useState)(bs),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>((0,u.sJj)(t).forEach((r=>{e[r]=[...e[r]||[],t]})),e)),{})};(0,s.useEffect)((()=>{const e={entity:f(null==t?void 0:t.crosswalks),relation:(0,Q.pipe)(u.HQx,f)(t)};if((null==o?void 0:o.uri)===(null==t?void 0:t.uri)&&d.current){const{ownerType:t}=d.current,r=Object.keys(e[t]),n=Object.keys(i[t]);g((0,Q.difference)(r,n))}else g(bs);m(),l(t),c(e),p.current=[]}),[t]);const b=(0,s.useCallback)((0,Q.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:v,pinAttribute:E,createAttribute:x,updateAttribute:w}=(e=>{let{onSuccess:t=ze.ZT,onError:r=ze.ZT,onLoad:n=ze.ZT}=e;const a=(0,s.useCallback)((e=>{n(),e.then((()=>{t()})).catch(r)}),[r,t,n]),o=(0,s.useCallback)((e=>e.then((e=>{if("error"in e)throw e.error;return e}))),[]);return{deleteAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalks:n}=e;const l=(0,u.YkG)(r)?(0,Q.pipe)(u.o96,(0,Q.prop)("objectURI"),u.VGk,o)(t):Promise.all((n||[]).map((e=>{let{type:r,value:n,sourceTable:a}=e;return o((0,u.xZs)({attributeUri:t.uri,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:a}))})));a(l)}),[a,o]),pinAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,Q.pipe)(u.xkv,o,a)({attributeUri:t.uri,value:!t.pin})}),[a,o]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,Q.pipe)(u.P8_,o,a)({attributeUri:t.uri,value:!t.ignored})}),[a,o]),updateAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalk:n}=e;(0,u.YkM)(r)||(0,u.Or$)(r)||(0,Q.pipe)(u.tCj,o,a)({attributeUri:t.uri,sourceUri:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,value:(0,u.CwH)(r)?t.lookupCode:t.value})}),[a,o]),createAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,crosswalk:r}=e;(0,Q.pipe)(u.JV_,(0,Q.andThen)((e=>{let[{errors:t}]=e;if(t)throw t})),a)({attributeUri:t.uri,sourceUri:r.type,crosswalkValue:r.value,crosswalkSourceTable:r.sourceTable,value:t.value})}),[a])}})({onLoad:r,onSuccess:n,onError:b}),O=(0,s.useCallback)((e=>{let{attributeType:t,parentUri:r,crosswalk:n,index:a}=e;const o=(0,u.gjI)({parentUri:r,attributeType:t}),{uri:i}=o;if(n){const{ownerType:e}=n;c((t=>gs({},t,{[e]:gs({},t[e],{[i]:[n]})})))}l((e=>{var n;return(0,Q.isNil)(a)&&(a=null===(n=(0,u.JQy)(e,r,t.name))||void 0===n?void 0:n.length),(0,u.wLZ)({entity:e,attributeType:t,newAttribute:o,index:a})})),p.current.some((e=>(0,u.sOy)(i,e)))||p.current.push(i)}),[]),C=(0,s.useCallback)((e=>{const{attributeValue:{uri:t},attributeType:r}=e;(0,u.ZiX)(t)?(l((e=>(0,u.d$I)({entity:e,attributeType:r,uri:t}))),c((0,Q.evolve)({entity:(0,Q.dissoc)(t),relation:(0,Q.dissoc)(t)})),p.current=(0,Q.without)([t],p.current)):y(e)}),[y]),T=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,Q.isNil)(t.value)){const{uri:e}=t,a=p.current.find((t=>(0,u.sOy)(e,t))),l=(0,u.ww$)({entity:o,attributeType:r,uri:e,value:(0,u.kDl)(t)});x({attributeValue:(0,u.dLR)(l,a),crosswalk:n}),d.current=n}}else w(e)}),[x,w,o]);return{modifiedEntity:o,crosswalksMap:i,onAddAttribute:O,onDeleteAttribute:C,onPinAttribute:E,onIgnoreAttribute:v,onEditAttribute:T,newlyCreatedAttributes:h}},vs=e=>{let{onLoad:t=ze.ZT,onSuccess:r=ze.ZT,onError:n=ze.ZT}=e;const a=(0,s.useCallback)((e=>{t(),e.then((e=>{let{errors:t}=e;if(t)throw t;r()})).catch(n)}),[t,n,r]);return{addCrosswalk:(0,s.useCallback)((e=>{let{entity:t,contributorCrosswalk:r,crosswalk:n}=e;const o=r?(0,u.psB)({entityTypeUri:t.type,contributorCrosswalkType:r.type,contributorCrosswalkValue:r.value,contributorCrosswalkSourceTable:r.sourceTable,crosswalkType:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,crosswalkDeleteDate:n.deleteDate}):(0,u.kRE)({entityUri:t.uri,crosswalk:n});(0,Q.pipe)((0,Q.andThen)((e=>{let[t]=e;return t})),a)(o)}),[a]),editCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:o}=e;(0,Q.pipe)((0,Q.ifElse)((e=>{let{value:t}=e;return(0,Q.isNil)(t)}),u.K$w,u.WVU),(0,Q.andThen)((e=>{let[t]=e;return t})),a)({entityUri:t,crosswalkId:r,attributeName:n,value:o})}),[a]),deleteCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r}=e;(0,Q.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},Es=(0,xe.Z)({dragLayer:{position:"fixed",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:1300,pointerEvents:"none"},crosswalkPreview:{height:"28px",maxWidth:"394px",display:"flex",overflow:"hidden",padding:"6px",alignItems:"center",boxSizing:"border-box"},sourceLabel:{fontSize:"13px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},sourceIcon:{width:"16px",height:"16px",marginRight:"9px"}}),xs=e=>{let{crosswalk:t}=e;const r=Es(),n=Fo(t),a=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),o=(0,u.tH7)(a,t.type);return c().createElement(Gi,{color:n,className:r.crosswalkPreview},c().createElement(vo.Z,{className:r.sourceIcon,sourceType:t.type}),c().createElement(On.Z,{className:r.sourceLabel,variant:"body2"},o))},ws=(0,s.memo)((()=>{var e;const t=Es(),{isDragging:r,clientOffset:n,item:a}=(0,Wn.useDragLayer)((e=>({isDragging:e.isDragging(),clientOffset:e.getClientOffset(),item:e.getItem()}))),o=(0,s.useRef)(),l=(null===(e=o.current)||void 0===e?void 0:e.getBoundingClientRect())||{x:0,y:0},i=`translate(${(null==n?void 0:n.x)-(null==l?void 0:l.x)}px, ${(null==n?void 0:n.y)-(null==l?void 0:l.y)}px`;return r&&c().createElement("div",{ref:o,className:t.dragLayer},c().createElement("div",{style:{display:"flex",transform:i,WebkitTransform:i}},"Crosswalk"===a.type&&c().createElement(xs,{crosswalk:a.crosswalk})))}));let Os;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(Os||(Os={}));const Cs=(0,xe.Z)((()=>({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.38,transition:"opacity 0.3s"}},wrapper:{width:"100%",display:"flex",alignItems:"center",height:28,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMjYvMTMEw7WpAAAAeElEQVQ4ja3VuwrAIBBE0aup0uX/v9ImCCGSdIL4WF136+EwxcC6+3k/hAsxSREArvPAW2LAGFzFhqAG64JarAnuYBW4ixWgBZZBKwzAW2Ig7HAVCzHJ4AoGQsNVbAhqsC6oxZrgDlaBu1gBWmAZtMIA3MwLmMUAfmyqQ9/LD+oDAAAAAElFTkSuQmCC)"},focusedIcon:{width:28,height:28,backgroundColor:"rgba(0, 0, 0, 0.12)",borderRadius:0,borderRight:"1px solid #fff"},sourceIcon:{height:"16px",width:"16px",marginLeft:"16px",marginRight:"9px",fontSize:"14px"}}))),Ts=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Vo(),a=Cs({isOpaque:!n}),o=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),l=(0,u.tH7)(o,t);return c().createElement("div",{className:a.root},c().createElement(yo.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Uo.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(vo.Z,{className:a.sourceIcon,sourceType:t}),c().createElement(On.Z,{variant:"body2"},l)))}));var ks=r(19540),Ss=r(42484);function Is(){return Is=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Is.apply(this,arguments)}const Ps=e=>c().createElement("svg",Is({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"Copy_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Copy_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Copy_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#Copy_svg__b)",d:"M0 0h24v24H0z"}))),Ns=(0,xe.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Ds=e=>{let{value:t}=e;const r=Ns();return c().createElement("div",{className:r.root},c().createElement(On.Z,{className:r.text,variant:"body2"},t),c().createElement(yo.Z,{size:"XXS",icon:Ps,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Rs=(0,xe.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),js=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const o=Rs(),[l,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(mr.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,Q.unless)((0,Q.always)(l),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:o.timestampEditorInput,root:Ee()(o.timestampEditor,r.root)}}})};var Zs=r(95038),_s=r.n(Zs);const As=(0,xe.Z)((e=>({text:{fontSize:13},attributeWrapper:{display:"flex",alignItems:"center",paddingTop:5,paddingBottom:5,marginLeft:12},attributeTitle:{fontSize:13,width:135,color:e.palette.text.secondary},attributeValue:{paddingLeft:10,display:"flex",alignItems:"center",flexGrow:1},input:{paddingTop:14,paddingBottom:14,fontSize:13},editor:{flexGrow:1},moreButton:{marginLeft:24},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"}}))),Ms=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const o=As(),l=!("uri"in t),i=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),[p,d]=(0,s.useState)([]),[m,h]=(0,s.useState)(null),g=(0,s.useMemo)((()=>[{label:u.G39.sourceSystems.label,uri:"type"},{label:u.G39.value.label,uri:"value"},{label:u.G39.sourceTable.label,uri:"sourceTable",canBeAdded:l,canBeDeleted:l},{label:u.G39.createDate.label,uri:"createDate"},{label:u.G39.updateDate.label,uri:"updateDate"},{label:u.G39.deleteDate.label,uri:"deleteDate",canBeAdded:!0,canBeDeleted:!0},{label:u.G39.reltioLoadDate.label,uri:"reltioLoadDate"},{label:u.G39.publishDate.label,uri:"sourcePublishDate"}]),[]),f=(0,Q.pipe)((0,Q.filter)((0,Q.propEq)("canBeAdded",!0)),(0,Q.filter)((e=>!(0,Q.has)(e.uri,t))),(0,Q.filter)((e=>!p.includes(e.uri))))(g);return c().createElement(c().Fragment,null,f.length>0&&r&&c().createElement(v.Z,{label:ke().text("Add attributes"),onApply:e=>{e.length>0&&d((t=>t.concat((0,Q.map)((0,Q.prop)("uri"),e))))},data:f}),g.map((e=>e.uri in t||p.includes(e.uri)?c().createElement("div",{key:e.uri,className:o.attributeWrapper},c().createElement(On.Z,{variant:"body2",className:o.attributeTitle},`${e.label}:`),c().createElement("div",{className:o.attributeValue},((e,t)=>{switch(e){case"type":{const r=(0,u.tH7)(i,t);return l?c().createElement(bo.Z,{label:"",placeholder:t,className:o.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,Q.ascend)((0,Q.prop)("label"))).map((e=>{let{uri:t,label:r}=e;return{value:t,label:r}})),onChange:t=>{let{value:r}=t;return n(e,r)},TextFieldProps:{InputProps:{disableUnderline:!0}}}):c().createElement(c().Fragment,null,c().createElement(vo.Z,{className:o.sourceIcon,sourceType:t}),c().createElement(On.Z,{className:o.text,variant:"body2"},r))}case"sourceTable":return l?c().createElement(lr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:o.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:o.input}}}):c().createElement(On.Z,{className:o.text,variant:"body2"},t);case"value":return l?c().createElement(lr.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:o.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:o.input}}}):c().createElement(Ds,{value:t});case"deleteDate":return c().createElement(js,{value:t&&_s().utc((0,u.ZBU)(t)).valueOf(),onChange:t=>n(e,t.toString()),classes:{root:o.editor},disabled:!r});case"sourcePublishDate":case"createDate":case"updateDate":case"reltioLoadDate":return c().createElement(On.Z,{className:o.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(me.k,{icon:Jo.Z,disabled:!r,onClick:()=>h(e.uri),size:"XS",tooltipTitle:ke().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(di,{open:!!m,onClose:()=>h(null),onConfirm:()=>{return e=m,d((t=>(0,Q.without)([e],t))),void((0,Q.isNil)(t[e])||a(e));var e}}))},Ls=(0,xe.Z)({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.19,transition:"opacity 0.3s"}},header:{width:"100%",display:"flex",alignItems:"center",height:"28px"},focusedIcon:e=>{let{isFocused:t}=e;return{width:"26px","&:not([disabled])":{border:"1px solid rgba(0, 0, 0, 0.12)"},height:"28px",color:t?"#000":"rgba(0, 0, 0, 0.54)",borderRadius:0,margin:"0px 1px"}},crosswalkWrapper:{width:"100%",overflow:"hidden"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},attributesWrapper:e=>{let{color:t}=e;return{border:"1px solid",borderColor:t,position:"relative"}},deleteCrosswalkButton:{position:"absolute",top:5,right:5},labelValue:{marginLeft:5,marginRight:8},dependentIcon:{width:"16px",height:"16px",fillOpacity:.38}}),Fs=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:o=!0,disableEdit:l,disableDelete:i,onDelete:p,onEdit:d}=e;const m=(0,s.useRef)(null),h=Fo(t),{toggleCrosswalkFocus:g,isFocused:f}=zo(t),b=n?"#FFF":a?h:"#CACCD1",{isDimmed:y,highlightCrosswalk:v,removeHighlight:E}=Vo(t),[x]=Bo(),w=Ls({color:b,isOpaque:!y,isFocused:f}),[O,C]=(0,s.useState)(!1),[T,k]=(0,s.useState)(!1),S=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),I=(0,u.tH7)(S,t.type),P=(0,u.nIW)(t.uri),N=(0,u.x_)(t),[,D,R]=(0,Wn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!N}),j=!N&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{R((0,Ss.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;o&&x&&(0,u.aFF)(x,t)&&x!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[x]),c().createElement("div",{className:w.root,ref:m},c().createElement(me.k,{size:"XXS",className:w.focusedIcon,icon:o&&Uo.Z,onClick:()=>g(),disabled:!o,tooltipTitle:o&&ke().text("Focus")}),c().createElement("div",{className:w.crosswalkWrapper},c().createElement(Gi,{ref:D,className:w.header,color:b,variant:N?"outlined":"filled",onMouseEnter:()=>v(),onMouseLeave:()=>E()},r&&c().createElement(ks.Z,{className:w.dependentIcon}),c().createElement($r.Z,{onClick:()=>C((e=>!e)),expanded:O}),c().createElement(vo.Z,{className:w.sourceIcon,sourceType:t.type}),c().createElement(Sr.C,{value:I},c().createElement(On.Z,{variant:"body2",noWrap:!0},I)),c().createElement(Eo.Z,null),c().createElement(Sr.C,{value:t.value},c().createElement(On.Z,{variant:"body2",className:w.labelValue,noWrap:!0},t.value))),O&&c().createElement("div",{className:w.attributesWrapper},j&&c().createElement("div",{className:w.deleteCrosswalkButton},c().createElement(me.k,{icon:Jo.Z,disabled:i,onClick:()=>k(!0),size:"XS",tooltipTitle:i?ke().text("You don't have permissions to delete"):ke().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(di,{open:T,onConfirm:()=>{f&&g(),p(P)},onClose:()=>k(!1)})),c().createElement(Ms,{crosswalk:t,canEditAttribute:!l,onEditAttribute:(e,t)=>{d({crosswalkId:P,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:P,attributeName:e})}}))))})),Bs=(0,xe.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Vs=e=>{let{showMore:t,onClick:r}=e;const n=Bs();return c().createElement(ht.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?ke().text("View dependent crosswalks"):ke().text("Hide dependent crosswalks")))},zs=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:o,disableEditCrosswalk:l,disableDeleteCrosswalk:i,onEdit:p,onDelete:d,onToggleExpanded:m}=e;const h=Bo();return(0,s.useEffect)((()=>{!o&&a&&r[Os.Dependent].some((e=>h.some((0,u.aFF)(e))))&&m()}),[h]),c().createElement(c().Fragment,null,0===r[Os.Simple].length&&0===r[Os.Empty].length&&c().createElement(Ts,{crosswalkType:t,focusable:a}),r[Os.Simple].map((e=>c().createElement(Fs,{key:e.uri,crosswalk:e,focusable:a,disableEdit:l,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[Os.Empty].map((e=>c().createElement(Fs,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:l,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),o&&r[Os.Dependent].map((e=>c().createElement(Fs,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:l,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[Os.Dependent].length>0&&c().createElement(Vs,{showMore:!o,onClick:()=>m()}))},Us=(0,xe.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Hs=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=Us(),[o,l]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(On.Z,{variant:"body1",className:a.caption},ke().text("Add crosswalk")),c().createElement(Ms,{crosswalk:o,onDeleteAttribute:e=>{l((0,Q.dissoc)(e))},onEditAttribute:(e,t)=>{l((0,Q.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Pl.Z,{className:a.cancelButton,onClick:n},ke().text("Cancel")),c().createElement(Pl.Z,{color:"primary",onClick:()=>{r(o),n()},disabled:!o.type||!o.value},ke().text("Add"))))},Ws=e=>e[Os.Simple].length>0?1:e[Os.Dependent].length>0?e[Os.Empty].length>0?2:3:4,Gs=(0,Q.evolve)({[Os.Dependent]:(0,Q.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),qs=(0,Q.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[Os.Simple]:[],[Os.Empty]:[],[Os.Dependent]:[]}),"relation"===n.ownerType?r[n.type][Os.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,Q.propEq)("uri",n))})).length)(e,t,n)?r[n.type][Os.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,Q.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][Os.Dependent].push(n):r[n.type][Os.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>Ws(n[e])-Ws(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:Gs(n[e])})))}));var Ks=r(62116),Ys=r(55401);const $s=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),o=(0,xt.useSelector)(wt.ZP.selectors.getHistorySlice),l=(0,xt.useDispatch)(),i=(0,Ct._)(),{aStamp:c,bStamp:p,overrideUri:d}=r||{},m=d||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),p&&1!==p?(0,u.lrH)(m,p):Promise.resolve(null)])).then((e=>{let[t,r]=e;l(wt.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,p,m]),{isLoading:n,historySlice:o}};let Xs;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(Xs||(Xs={}));var Qs=r(39034);const Js=e=>(0,Q.pipe)((0,Q.map)(e),(0,Q.join)(" or ")),ec=e=>{const[t,r]=e;return _s()().subtract(t,r).valueOf()},tc=(0,Q.chain)((0,Q.cond)([[(0,Q.equals)(Xs.MERGE),()=>[o.I.ENTITIES_MERGED,o.I.ENTITIES_MERGED_MANUALLY,o.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,Q.equals)(Xs.UNMERGE),()=>[o.I.ENTITIES_SPLITTED]],[(0,Q.equals)(Xs.UPDATE),()=>[o.I.ENTITY_CHANGED]]])),rc=(0,Q.pipe)((0,Q.defaultTo)([]),tc,(0,Q.concat)([o.I.ENTITY_CREATED,o.I.ENTITY_REMOVED,o.I.ENTITY_LOST_MERGE]),Js((e=>`equals(type, '${e}')`))),nc=(0,Q.pipe)((0,Q.defaultTo)({}),(0,Q.reject)(u.O27),(0,Q.evolve)({users:Js((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:Js((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case Qs.K.WITHIN:return`gte(timestamp, ${ec(r)})`;case Qs.K.AGO:return`lte(timestamp, ${ec(r)})`;case Qs.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${_s()(t).endOf("date").valueOf()})`}default:return""}}}),(0,Q.over)((0,Q.lensProp)("activities"),rc),Q.values,(0,Q.reject)(u.O27),(0,Q.append)("not equals(user, 'collaboration-service')"),(0,Q.map)((e=>`(${e})`)),(0,Q.join)(" and "));function ac(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oc(e,t,r[t])}))}return e}function oc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lc={activities:[Xs.MERGE,Xs.UNMERGE,Xs.UPDATE]},ic=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)(lc),[o,l]=(0,s.useState)(0),i=(0,s.useMemo)((()=>nc(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(!1),f=(0,Ct._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},v=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.kgP)(ac({entityUri:b,historicUris:c,filter:i,showAll:v},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{g(!1)})))}),[i,v,c]),(0,s.useEffect)((()=>{b&&r&&(g(!0),f((0,u.wdF)({entityUri:b})).then((e=>{p(e)})).catch((e=>{console.warn("Failed to load history data",e),p(null)})).finally((()=>{g(!1)})),l(0))}),[b,null==t?void 0:t.updatedTime,r]);const E=(0,s.useCallback)((e=>{b&&c&&r&&(g(!0),f((0,u.kgP)(ac({entityUri:b,historicUris:c,filter:i,showAll:v,offset:e},y))).then((e=>{m((t=>ac({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{g(!1)})))}),[c,i,r]),x=(0,s.useMemo)((()=>32*(o+1)<(null==d?void 0:d.total)),[d,o]),w=(0,s.useCallback)((e=>{l(0),a(e)}),[]),O=(0,s.useCallback)((()=>{w(ac({},lc))}),[]),C=(0,s.useCallback)((()=>{x&&(E(32*(o+1)),l(o+1))}),[E,o,x]);return{isLoading:h,canLoadMore:x,onLoadMore:C,onApplyFilter:w,onClearFilter:O,historicUris:c,historyWithTotal:d,historyFilter:n}},sc={appearance:{},attributes:{},roles:[],tags:[]},cc=(0,Q.evolve)({refEntity:u.VGB,refRelation:u.VGB}),uc=e=>e?(0,Q.evolve)({attributes:(0,Q.map)((0,Q.map)(cc))})(e):e,pc=()=>{const e=(0,xt.useDispatch)(),t=(0,xt.useSelector)(wt.ZP.selectors.getHistorySlice),r=(0,xt.useSelector)(wt.ZP.selectors.getHistoryDiff),n=(0,xt.useSelector)(wt.ZP.selectors.getHistoryMode),a=(0,xt.useSelector)(wt.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:o}=t,l=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(uc(n===wt.Z9.Current?a:o),uc(r));e(wt.N5.history.actions.setHistoryDiff(l))}}),[t,n,e,a]),r||sc},dc=e=>{let{isHistoryTabActive:t,entity:r}=e;const[n,a]=(0,s.useState)(!1),o=null==r?void 0:r.uri;(0,s.useEffect)((()=>{t||a(!1)}),[o]),(0,s.useEffect)((()=>{t&&a(!0)}),[t]);const l=o&&!(0,u.ZiX)(o)&&!(0,u.biM)(r);return{isHistoryEnabled:n&&l,isProfilePersisted:l}};var mc=r(57312);const hc=(0,xe.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),gc=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:o,type:l,matchGroups:i,user:s,timestamp:p}=t,d=(0,u.GtP)(o),m=hc({color:d});return c().createElement("div",{className:Ee()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(On.Z,{className:Ee()(m.title,{bold:r})},r?ke().text("Current view"):(0,mc.Xr)(l)),!r&&c().createElement(On.Z,{className:m.date},ke().date(p,"L LT"))),i&&c().createElement(On.Z,{className:m.title},ke().text("Match rule:")," ",i.join(", ")),c().createElement(On.Z,{className:m.user},s))};function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bc;!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(bc||(bc={}));const yc=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fc(e,t,r[t])}))}return e}({},o.I,bc),vc=e=>e===yc.FAKE_FILTERED_INCOMING||e===yc.FAKE_FILTERED_OUTGOING,Ec=e=>{let{x:t,y:r,toX:n,toY:a,color:o,isDashed:l}=e;const i=((e,t,r,n)=>{const a=t>n,o=e<r,l=a?-6:6;return`M${e} ${t} L${o?r-12:r+12} ${t} ${o?`c 6 0 12 ${l} 12`:`c -6 0 -12 ${l} -12`} ${a?-12:12} L${r} ${n}`})(t,r,n,a);return c().createElement("path",{d:i,stroke:o,strokeWidth:2,fill:"none",strokeDasharray:l?"3,3":void 0})};function xc(){return xc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xc.apply(this,arguments)}const wc=(0,s.forwardRef)(((e,t)=>{let{x:r,y:n,color:a,isDashed:o,isCollapsed:l,showCollapseIcon:i,showLine:s}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["x","y","color","isDashed","isCollapsed","showCollapseIcon","showLine"]);const p=i?6:3;return c().createElement("g",xc({},u,{ref:t}),s&&c().createElement("rect",{id:"line",x:r-p-4,y:n-p-4,width:2*p+8,height:2,fill:a}),c().createElement("circle",{cx:r,cy:n,r:p,fill:o?"#fff":a,stroke:a,strokeDasharray:o?"1,1":void 0,strokeWidth:2}),i&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:r-4,y:n-1,width:8,height:2,fill:"#fff"}),l&&c().createElement("rect",{x:r-1,y:n-4,width:2,height:8,fill:"#fff"})))})),Oc=(0,gt.Z)(wc),Cc=(0,s.memo)((e=>{let{graphData:t,onHistoryCircleMouseOver:r}=e;const{historyLanes:n,rows:a}=t,o=[16],{links:l,rowLines:i,circles:s}=a.reduce(((e,t,l)=>{let{uri:i,height:s,uris:p,type:d,fakeType:m,index:h,timestamp:g,label:f}=t;const b=16*n[i].index+24,y=o[l];o.push(y+s);const v=vc(m),E=v?p[0]:i,x=!(null!=p&&p.some((e=>n[e])));e.circles.push(c().createElement(Oc,{tooltipTitle:f,tooltipPlacement:"top",onMouseOver:r?()=>r(i,g,h):void 0,key:`circle-${E}-${l}`,x:b,y,color:(0,u.GtP)(E),isDashed:v,isCollapsed:x,showCollapseIcon:!!p,showLine:m===yc.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${E}-${h}`,x:b,y:y-8,width:"100%",height:16,fill:(0,u.GtP)(E),opacity:.06}));const w=d===yc.ENTITIES_SPLITTED;return null==p||p.forEach((t=>{const r=n[t];if(!r)return;const o=a[l].height,i=16*r.index+24,s=w?y-o:y+o;b!==i&&e.links.push(c().createElement(Ec,{key:`link-${t}-${h}`,x:b,y,toX:i,toY:s,isDashed:vc(m),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),p=16*Object.keys(n).length+24,d=o[o.length-1]-16;return Object.entries(n).forEach((e=>{let[t,r]=e;const n=16*r.index+24;r.lifeTime.forEach(((e,i)=>{var p;let{start:d,end:m}=e;if((null===(p=a[null==m?void 0:m.index])||void 0===p?void 0:p.type)===yc.ENTITIES_SPLITTED)return;const h=(null==d?void 0:d.type)===yc.ENTITIES_SPLITTED?(null==d?void 0:d.index)-1:null==d?void 0:d.index,g=(null==m?void 0:m.type)===yc.ENTITIES_MERGED_MANUALLY||(null==m?void 0:m.type)===yc.ENTITIES_MERGED?(null==m?void 0:m.index)+1:null==m?void 0:m.index,f=o[h]||o[o.length-2],b=o[g]||16;if(f<=b)return;const y=(0,u.GtP)(t);!m&&r.index>0&&s.push(c().createElement(wc,{key:`initCircle-${t}-${i}`,x:n,y:b,color:y,showLine:!0})),l.unshift(c().createElement("path",{key:`line-${t}-${i}`,d:`M${n} ${f} L${n} ${b}`,stroke:y,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:p,height:d},c().createElement("g",{id:"rowLines"},i),c().createElement("g",{id:"links"},l),c().createElement("g",{id:"circles"},s))})),Tc=(0,xe.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});function kc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sc(e,t,r[t])}))}return e}function Sc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ic=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:o,historyEvent:l,findPreviousChange:i}=e;const p=Tc(),d=(0,xt.useDispatch)(),m=(0,xt.useSelector)(wt.ZP.selectors.getIsEditableMode),h=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),[g,f]=(0,s.useState)({historyLanes:{},rows:[]}),[b,y]=(0,s.useState)(!1),[v,E]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,Q.isNil)(l))return void E(0);const e=e=>(null==e?void 0:e.uri)===((null==l?void 0:l.overrideUri)||o)&&(null==e?void 0:e.timestamp)===(null==l?void 0:l.aStamp),r=-1!==v?t.rows[v]:null,n=t.rows.findIndex((t=>e(t)));E(e(r)?v:n)}),[t.rows,l]);const x=(0,s.useRef)(null),w=(0,s.useCallback)((e=>{if(!(0,Q.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;return kc({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));f({historyLanes:t.historyLanes,rows:n})}}),[t]),O=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==x?void 0:x.current)||{};y(r<e-t)};return c().createElement("div",{className:p.historyTree},r&&c().createElement(Vr.Z,null),c().createElement("div",{className:Ee()(p.graph,{[p.shadow]:b}),onScroll:O,ref:x},c().createElement(Cc,{onHistoryCircleMouseOver:(e,t,r)=>{if((0,Q.isNil)(g.rows[r].label)){const n={time:t,select:"crosswalks"};(0,u.HvW)(e,n).then((e=>{let{crosswalks:t}=e;const n=t?(0,Q.uniqBy)((0,Q.prop)("type"),t).map((e=>{const t=(0,u.s5)(h,e.type);return t?t.label:null})).filter(Q.identity).join(", "):ke().text("No data");f((e=>kc({},e,{rows:e.rows.map((e=>e.index===r?kc({},e,{label:n}):e))})))}))}},graphData:g}),c().createElement(et.Z,{handleWidth:!0,onResize:O})),c().createElement("div",{ref:w,className:p.history},t.rows.map(((e,t)=>{const r=t===v,n=0===t;return c().createElement(gc,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(ke().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;d(wt.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)d(wt.N5.history.actions.clearHistoryEvent()),E(0);else if(!n&&!r){const r=i(e-1,t.uri||o),n=i(e,t.uri||o),a=null==r?void 0:r.timestamp,l=null==n?void 0:n.timestamp,s=(null==t?void 0:t.uri)===o?null:null==t?void 0:t.uri;d(wt.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:l,overrideUri:s})),E(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:p.buttonContainer},c().createElement(Pl.Z,{color:"primary",onClick:()=>a()},ke().text("Show more"))))},Pc=(0,xe.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Nc=(0,xe.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),Dc=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),o=Nc({color:a});return c().createElement("div",{className:Ee()(o.icon,{[o.inactive]:!r,[o.active]:r,[o.clickable]:!!n}),onClick:n})},Rc=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:o}=e;const l=Pc();return c().createElement("div",{className:Ee()(l.root,o)},c().createElement(Dc,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement(Dc,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,Q.without)([e],r)):a([...r||[],e])})(e)}))))};function jc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zc=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:o}=r;if(a){const r=t-a.timestamp;((0,Q.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(r)&&r>0)&&(e.startIndex=n,e.startDistance=r)}if(o){const r=t-o.timestamp;((0,Q.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(r)&&r<0)&&(e.endIndex=n,e.endDistance=r)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),_c=(0,xe.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Ac=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:o,onLoadMore:l,historyEvent:i}=e;const u=_c(),[p,d]=(0,s.useState)(null);(0,s.useEffect)((()=>{d(n)}),[n]);const{historyData:m,findPreviousChange:h}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{user:"",timestamp:0,uri:t}],o=(0,Q.curry)(((e,r,n)=>{const a=n.uri||t;if(e)if(Array.isArray(e)){if(n.type!==yc.ENTITY_LOST_MERGE)return null;if(e.includes(a))return n;if(r&&n.uris)return e.some((e=>n.uris.includes(e)))?n:null}else{var o;if(a===e||r&&null!==(o=n.uris)&&void 0!==o&&o.includes(e))return n}return null})),l=(e,t,n)=>(0,Q.pipe)((0,Q.drop)(e+1),(0,Q.find)(o(t,n)))(r),i=t=>(e[t]||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),e[t]),s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==yc.ENTITY_CREATED||t.type!==yc.ENTITIES_SPLITTED)?e.push({start:t,end:null}):r.start=t},c=(e,t)=>{let r=!0;if(e.length){const n=e[e.length-1];r=!((!n.start||n.start.timestamp<t.timestamp)&&(!n.end||n.end.timestamp>t.timestamp))}r&&e.push({start:null,end:null})},u=(e,t)=>{if(e.length){const r=e[e.length-1];r.start||(r.start=t)}e.push({start:null,end:t})},p=[];return null==r||r.forEach(((r,n)=>{var o;switch(r.type){case yc.ENTITIES_SPLITTED:if(!l(n,r.uri||t,!1))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=l(n,t,!0);if(a&&(!e||e===a.uri))return}break;case yc.ENTITY_LOST_MERGE:case yc.RELATIONSHIP_CREATED:case yc.RELATIONSHIP_REMOVED:case yc.RELATIONSHIP_CHANGED:return}let d=!1;null===(o=r.uris)||void 0===o||o.forEach((e=>{i(e)||(d=!0)}));const m=i(r.uri||t);if(!m)return;const h=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jc(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,o;switch(r.type){case yc.ENTITY_CREATED:s(t,r);break;case yc.ENTITIES_MERGED_ON_THE_FLY:case yc.ENTITY_CHANGED:c(t,r);break;case yc.ENTITY_LOST_MERGE:case yc.ENTITY_REMOVED:u(t,r);break;case yc.ENTITIES_SPLITTED:c(t,r),null===(n=r.uris)||void 0===n||n.forEach((t=>{const n=e[t];if(!n)return;const o=n.lifeTime.length;o?s(n.lifeTime,r):u(n.lifeTime,r),a.push({uri:t,user:r.user,type:r.type,fakeType:o?yc.FAKE_UPDATE:yc.FAKE_NAVIGATE_PROFILE,timestamp:r.timestamp})}));break;case yc.ENTITIES_MERGED:case yc.ENTITIES_MERGED_MANUALLY:c(t,r),null===(o=r.uris)||void 0===o||o.forEach((t=>{const n=e[t];n&&u(n.lifeTime,r)}))}})(m.lifeTime,h),d&&p.push(h),a.push(h)})),p.forEach((t=>{t.uris.forEach((n=>{e[n]||r.forEach((r=>{let{uri:o,uris:l,timestamp:i,user:s,type:c}=r;o===n&&(null==l||l.forEach((r=>{const n=e[r];if(!n)return;let o=null;switch(c){case yc.ENTITIES_MERGED:case yc.ENTITIES_MERGED_MANUALLY:o=yc.FAKE_FILTERED_INCOMING;break;case yc.ENTITIES_SPLITTED:o=yc.FAKE_FILTERED_OUTGOING;break;default:return}const l={fakeType:o,uri:t.uri,uris:[r],type:c,user:s,timestamp:i},u=Zc(n.lifeTime,t.timestamp);o===yc.FAKE_FILTERED_INCOMING?(0,Q.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=l):(0,Q.isNil)(u.startIndex)||(n.lifeTime[u.startIndex].start=l),a.splice(a.indexOf(t),0,l)})))}))}))})),a.forEach(((e,r)=>{e.index=r,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:a},findPreviousChange:(e,t)=>(0,Q.pipe)((0,Q.slice)(e+1,1/0),(0,Q.find)(o(t,!1)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:p});return c().createElement("div",{className:u.root},c().createElement(Rc,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Ic,{historyData:m,isLoading:t,onLoadMore:l,canLoadMore:o,entityUri:a,historyEvent:i,findPreviousChange:h}))}));var Mc=r(36444),Lc=r(15791),Fc=r(55234);const Bc=[Qs.K.WITHIN,Qs.K.AGO,Qs.K.BETWEEN],Vc=e=>({[Qs.K.WITHIN]:ke().text("Within the last"),[Qs.K.AGO]:ke().text("More than"),[Qs.K.BETWEEN]:ke().text("Date range")}[e]||"");var zc=r(77875),Uc=r(27446);const Hc=(0,xe.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),Wc=[null,null],Gc=[null,"hours"],qc=e=>{let{value:t,onChange:r,className:n}=e;const a=Hc(),o=e=>e===Qs.K.WITHIN||e===Qs.K.AGO,l=e=>e===Qs.K.BETWEEN,i=l(null==t?void 0:t.type)?t.period:Wc,u=o(null==t?void 0:t.type)?t.period:Gc,[p,d]=(0,s.useState)(i),[m,h]=(0,s.useState)(u),g=(null==t?void 0:t.type)||Qs.K.WITHIN,f=e=>o(e)?m:l(e)?p:void 0,b=e=>{r({type:g,period:e})};return(0,rt.D)((()=>{t?o(t.type)?h(t.period):l(t.type)&&d(t.period):(d(Wc),h(Gc))}),[t]),c().createElement("div",{className:Ee()(a.root,n)},c().createElement(On.Z,{className:a.title,variant:"subtitle1"},ke().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(bo.Z,{label:"",className:a.typeInput,value:{value:g,label:Vc(g)},options:Bc.map((e=>({value:e,label:Vc(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),o(g)?c().createElement(zc.Z,{interval:m,onChange:b}):c().createElement(Uc.Z,{values:p,onChange:b})))},Kc=[Xs.UPDATE,Xs.MERGE,Xs.UNMERGE];function Yc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$c(e,t,r[t])}))}return e}function $c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xc={input:e=>Yc({},e,{fontSize:"14px"}),menuPortal:e=>Yc({},e,{zIndex:1300})},Qc=(0,xe.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),Jc=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=Qc(),o=e=>{return{value:e,label:(t=e,{[Xs.UPDATE]:ke().text("Update"),[Xs.MERGE]:ke().text("Merge"),[Xs.UNMERGE]:ke().text("Unmerge")}[t]||"")};var t},l=e=>e.map(o),i=l(Kc);return c().createElement("div",{className:Ee()(a.root,n)},c().createElement(On.Z,{className:a.title,variant:"subtitle1"},ke().text("Activity")),c().createElement(Vn.Z,{value:l(t),onChange:(0,Q.pipe)((0,Q.defaultTo)([]),(0,Q.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:Xt.Z},styles:Xc,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},eu=(0,xe.Z)({popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function tu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ru=e=>{let{className:t,filter:r,onApplyFilter:n,onClearFilter:a,entityType:o}=e;const l=eu(),[i,u]=(0,s.useState)(null),p=()=>u(null),[d,m]=(0,s.useState)(r);(0,s.useEffect)((()=>{m(r)}),[r]);const h=(0,Q.curry)(((e,t)=>{m((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tu(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:g=[],attributes:f=[],dateRange:b=null,users:y=[]}=d||{};return c().createElement(c().Fragment,null,c().createElement(yo.Z,{icon:Mc.Z,size:"L",onClick:e=>u(e.currentTarget),className:t}),c().createElement(rl.ZP,{classes:{paper:l.popup},open:!!i,anchorEl:i,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:l.filterContainer},c().createElement(On.Z,{variant:"h6"},ke().text("Filter")),c().createElement("div",{className:l.filterContainerScrollable},c().createElement(qc,{value:b,onChange:h("dateRange"),className:l.filterItem}),c().createElement(Lc.Z,{selectedUsers:y,onChange:h("users"),className:l.filterItem}),c().createElement(Jc,{selectedHistoryActivityTypes:g,onChange:h("activities"),className:l.filterItem}),c().createElement(Fc.Z,{selectedAttributes:f,entityType:o,onChange:h("attributes"),className:l.filterItem,title:ke().text("Attribute updated")}))),c().createElement("div",{className:l.filterControls},c().createElement(Pl.Z,{onClick:a,className:l.clearButton},ke().text("Clear all")),c().createElement(Pl.Z,{onClick:p},ke().text("Cancel")),c().createElement(Pl.Z,{color:"primary",onClick:()=>{b&&(e=>{if(e.type===Qs.K.AGO||e.type===Qs.K.WITHIN){const[t,r]=e.period;return"Number"===(0,Q.type)(t)&&"String"===(0,Q.type)(r)&&t>0}if(e.type===Qs.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(b)?n(d):n((0,Q.dissoc)("dateRange",d)),p()}},ke().text("Apply")))))};var nu=r(98281);const au=(0,xe.Z)({menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),ou=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=ze.ZT}=e;const a=au(),{text:o,selected:l,onClick:i}=r;return c().createElement(xn.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},l&&c().createElement(nu.Z,{className:a.checkIcon}),c().createElement(On.Z,{classes:{root:a.menuText}},o))}));ou.displayName="MenuItemRenderer";const lu=ou,iu=()=>{const e=(0,xt.useSelector)(wt.ZP.selectors.getHistoryMode),t=(0,xt.useDispatch)(),r=e=>{t(wt.N5.history.actions.setHistoryMode(e))},n=[{text:ke().text("Compare to Current view"),selected:e===wt.Z9.Current,onClick:()=>r(wt.Z9.Current)},{text:ke().text("Compare to Previous view"),selected:e===wt.Z9.Previous,onClick:()=>r(wt.Z9.Previous)}];return c().createElement(nr.Z,{MenuItemRenderer:lu,buttonComponent:yo.Z,buttonProps:{icon:tl.Z,size:"L"},menuId:"history-menu",menuItems:n})},su=(0,xe.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14},filterButton:{marginRight:"-4px"}}),cu=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a,onClearFilter:o}=e;const l=su();return c().createElement("div",{className:l.root},c().createElement(On.Z,{variant:"h6"},ke().text("History")),!(0,Q.isNil)(t)&&c().createElement(c().Fragment,null,c().createElement(go.Z,{orientation:"vertical",flexItem:!0,className:l.divider}),c().createElement(On.Z,{variant:"body1",color:"textSecondary",className:l.count},1===t?ke().text("${count} contributing profile",{count:t}):ke().text("${count} contributing profiles",{count:t}))),c().createElement(Eo.Z,null),c().createElement(ru,{className:l.filterButton,entityType:r,filter:n,onApplyFilter:a,onClearFilter:o}),c().createElement(iu,null))},uu=(0,xe.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),pu=()=>{const e=uu(),t=(0,xt.useSelector)(wt.ZP.selectors.getHistoryEvent),r=(0,xt.useDispatch)(),n=(0,Q.pipe)(wt.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(On.Z,{component:"div"},ke().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},ke().date(t.aStamp,"llll"))),c().createElement(Pl.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},ke().text("Cancel"))):null},du=()=>c().createElement(po,{text:ke().text("History in the making"),secondaryText:ke().text("When you create an event or perform an activity, it will show up here.")});var mu=r(37457);const hu=(0,xe.Z)({editor:{display:"flex",flexDirection:"column",padding:"0 24px 5px"},title:{color:"rgba(0, 0, 0, 0.6)",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",margin:"17px 0 24px"},item:{marginBottom:"20px"},dense:{marginBottom:0},actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}});function gu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fu(e,t,r[t])}))}return e}function fu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bu=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:o,mode:l,metadata:i,globalSearchRequestOptions:p,error:d}=e;const{relationUri:m,relationType:h,direction:g}=t.relation,b=t.isNew,v=hu(),{inRelations:E=[],outRelations:x=[]}=(0,s.useMemo)((()=>(0,u.ocC)({content:t.parentEntityUri?o.contentSecondLevel:o.content,direction:g,relationType:h,mode:l,metadata:i})),[o,g,h,l,i,t.parentEntityUri]),w=(0,s.useMemo)((()=>(0,u.xF8)(i,h)),[h,i]),O=(0,s.useMemo)((()=>gu({attributes:gu({},wt.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),C=(0,s.useRef)(t),T=(0,s.useRef)(r),k=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),S=(0,s.useRef)([]);(0,s.useEffect)((()=>{S.current=(0,Q.pipe)((0,Q.concat)(k.map((0,Q.prop)("uri"))),Q.uniq)(S.current)}),[k]);const I=(0,s.useRef)(k),P=(0,u.z7d)(E,x),N=C.current!==t||T.current!==r||(D=I.current,R=k,D.length!==R.length||D.some(((e,t)=>D[t]!==R[t])))||t.isNew&&!(0,u.O27)((0,Q.path)(["relation","object","attributes"],t));var D,R;const j=b?wt.N5.relations.actions.addRelation:wt.N5.relations.actions.editRelation,Z=(0,s.useCallback)((0,Q.pipe)(wt.N5.relations.actions.setRelationType(o.id,m),a),[o,m,a]),_=(0,s.useCallback)((()=>(0,Q.pipe)(wt.N5.relations.actions.closeRelationEditor,a)(o.id,m)),[o,m,a]),A=(0,s.useCallback)((e=>{if(r){const t=(0,u.nt9)(i,r.type);return(0,u.wx9)(t,r,e)}return e}),[r,i]),M=(0,s.useCallback)((e=>a(wt.N5.modifiedEntities.actions.entityCreated(e))),[a]),L=(0,s.useCallback)((e=>a(wt.N5.modifiedEntities.actions.entityDeleted(e))),[a]),F=(0,s.useCallback)((e=>{r&&L(r.uri),a(wt.N5.relations.actions.setRelationEntity(o.id,m,e)),d&&a(wt.N5.errors.actions.errorDeactivated((0,u.iFp)(d)))}),[o.id,m,a,r,L,d]),B=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(wt.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),V=(0,s.useCallback)((()=>a(wt.N5.errors.actions.errorsSet([]))),[a]),z=(0,s.useCallback)((0,Q.pipe)((0,Q.always)(t),(0,Q.when)(B,(0,Q.pipe)(u.zhn,A,j(o.id),a,(0,Q.always)((0,Q.differenceWith)(Q.equals,S.current,k.map((0,Q.prop)("uri")))),(0,Q.forEach)(L),_))),[t,o,a,A,B,k]),U=(0,s.useCallback)((()=>{const e=T.current;r!==e&&(e?(M(e),r&&r.uri!==e.uri&&L(r.uri)):L(r.uri));const t=I.current;(0,Q.differenceWith)(Q.equals,S.current,t.map((0,Q.prop)("uri"))).forEach(L),t.forEach(M),V(),_()}),[_,M,L,V,r]),H=(0,s.useCallback)((e=>(0,Q.pipe)(wt.N5.actions.addAttributes,a)(e.map((e=>gu({},e,{viewId:o.id}))))),[o.id,a]),W=(0,s.useCallback)((e=>(0,Q.pipe)(wt.N5.actions.modifyAttribute,a)(gu({},e,{viewId:o.id}))),[o.id,a]),G=(0,s.useCallback)((e=>(0,Q.pipe)(wt.N5.actions.removeAttribute,a)(gu({},e,{viewId:o.id}))),[o.id,a]),q=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,Q.pipe)(u.wcJ,(0,u._kX)(l))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});F(a),M(a)}),[M,F,l,i]),K=(0,u.e$p)(d),Y=(0,s.useCallback)((()=>{const{content:e,contentSecondLevel:r}=o;return r&&t.parentEntityUri?r.entityTypes:e.entityTypes}),[o,t.parentEntityUri]);return c().createElement(c().Fragment,null,c().createElement("div",{className:v.editor},c().createElement(On.Z,{className:v.title},b?ke().text("Add new item"):ke().text("Edit item")),null===P&&c().createElement(er.Z,{className:v.item,relation:t.relation,inRelationTypes:E,outRelationTypes:x,onChange:Z}),Boolean(h)&&c().createElement(c().Fragment,null,c().createElement(kr.Z,{errorMessage:K},c().createElement(y.Z,{className:Ee()(v.item,{[v.dense]:K||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:Y()||[],max:o.max||20,globalSearchRequestOptions:p,mode:l,onChange:F,onCreate:q,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(f.Z,{className:v.item,attrTypes:w,entity:O,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:l,parentUri:m,onAddAttributes:H,onChangeAttribute:W,onDeleteAttribute:G}))),c().createElement("div",{className:v.actionButtons},c().createElement(Pl.Z,{onClick:U},ke().text("Cancel")),c().createElement(Pl.Z,{color:"primary",disabled:!N,onClick:z},ke().text("Apply"))),c().createElement(go.Z,null))};bu.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:K().object,dispatch:K().func,config:u.PiC,mode:K().string,metadata:u.pGS,globalSearchRequestOptions:K().object,error:u.wfT,parentEntityUri:K().string};const yu=bu,vu=(0,xt.connect)(((e,t)=>{const r=(n=t,wt.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?wt.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?wt.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:wt.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,wt.ZP.selectors.getProfileErrors(e))}}))(yu),Eu=(0,xe.Z)((e=>({card:{borderBottom:"1px solid rgba(0,0,0,0.06)"},withBackground:{backgroundColor:"rgba(0, 0, 0, 0.03)"},lineWrapper:{position:"relative"},icon:{position:"absolute",top:"8px",left:"16px",width:"32px",height:"32px",zIndex:1},line:e=>{let{color:t}=e;return{borderLeft:`3px solid ${t}`,position:"absolute",left:0,top:0,bottom:0}},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word",lineHeight:"15px"},commentsInfo:{display:"flex",alignItems:"center",marginBottom:"-4px",marginTop:"7px"},commentsIcon:{width:"11px",height:"11px",marginLeft:"2px",marginRight:"6px",marginTop:"-2px"},infoValue:{color:e.palette.text.primary},infoBlock:{display:"flex",flexDirection:"row",marginBottom:"5px"},header:{display:"flex",flexDirection:"row",paddingBottom:"12px"},flex:{flex:1},caption:{fontSize:"16px",color:e.palette.text.primary},title:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"-4px"},flag:{height:"13px",width:"13px",marginTop:"-2px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},date:{fontSize:"13px",color:e.palette.text.primary},mainInfo:{display:"flex",flexDirection:"column",flex:1},controlsBox:{marginRight:"16px",marginBottom:"12px",marginTop:"13px"},controlsInRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},priority:{width:"162px"},comments:{marginLeft:"11px"}}))),xu=c().createContext(null);xu.displayName="WorkflowTasksContext";const wu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{errorMessage:t,errorCode:r}=e;r!==u.Xt7.WORKFLOW_IS_NOT_REGISTERED_ERROR&&(console.error(e),Tr.Z.addError({title:ke().text("Error"),message:t||ke().text("Something went wrong...")}))},Ou=()=>{const e=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),t=(0,xt.useSelector)(wt.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,xt.useSelector)(wt.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,xt.useSelector)(wt.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,xt.useSelector)(wt.ZP.selectors.getCanUserViewWorkflowDefinition),o=(0,xt.useSelector)(wt.ZP.selectors.getCanUserViewWorkflowConfigJar),l=(0,xt.useSelector)(wt.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,xt.useSelector)(wt.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,xt.useSelector)(wt.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,xt.useSelector)(wt.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,xt.useSelector)(wt.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),p=(0,xt.useSelector)(wt.ZP.selectors.getCanUserManageWorkflowDefinition),d=(0,xt.useSelector)(wt.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,xt.useSelector)(wt.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),h=(0,xt.useSelector)(wt.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),g=(0,xt.useSelector)(wt.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),f=(0,xt.useSelector)(wt.ZP.selectors.getCanUserExecuteWorkflowJobs),b=(0,xt.useSelector)(wt.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),y=(0,xt.useSelector)(wt.ZP.selectors.getCanUserRegisterConfigEnvironments),v=(0,xt.useSelector)(wt.ZP.selectors.getCanUserCreateWorkflowConfigJar);return E=>{if(!e)return!1;switch(E){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return f||g&&h&&m&&d;case"VIEW_CUSTOM_JARS":return o||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return y;case"START_PROCESS_INSTANCE":case"START_PROCESS_INSTANCE_SEARCH_QUERY":return t;case"VIEW_PROCESS_INSTANCE_COMMENTS":case"VIEW_PROCESS_INSTANCES":case"VIEW_PROCESS_INSTANCE_COUNT":return l;case"UPDATE_TASK":return i;case"DEPLOY_TENANT_PROCESS_DEFINITION":return p;case"DEPLOY_CUSTOM_JAR":return v&&b}return!1}},Cu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,Q.startsWith)("changeRequests/"))},Tu=e=>void 0===e||!0===e,ku=e=>({label:e,value:e}),Su=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(xu)||{},o=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,xt.useSelector)(wt.ZP.selectors.getTenant),c=(0,Ct._)(),p=(0,Ct._)(),[d,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(),[f,b]=(0,s.useState)(!1),y=Ou()("UPDATE_TASK")&&Tu(n);(0,s.useEffect)((()=>{m(ku(t))}),[t]);const v=(0,s.useCallback)((e=>{if(o&&y&&r){const t=(0,Q.filter)((t=>t.value.toLowerCase().includes(e)));return h?Promise.resolve(t(h)):p((0,u.j2$)({taskId:r,workflowPath:o,environment:l,tenant:i})).then((e=>{const{data:r}=e,n=r.sort(((e,t)=>u.P6Y.strings.sort("asc",e,t))).map(ku);return g(n),t(n)})).catch(wu)}}),[o,r,l,i,h,g,y]),E=(0,s.useCallback)((e=>{if(o&&y&&r){const{value:t}=e;b(!0),c((0,u._C4)({taskId:r,workflowPath:o,environment:l,tenant:i,assignee:t})).then((()=>{m(ku(t)),null==a||a(r,{assignee:t})})).catch(wu).finally((()=>{b(!1)}))}}),[o,r,l,i,y]);return{assignee:d,getAssignees:v,updateAssignee:E,updateRequestIsInProgress:f,readOnly:!y}},Iu=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:o,updateAssignee:l,updateRequestIsInProgress:i,readOnly:s}=Su({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(ar.Z,{isDisabled:u,getOptions:o,onChange:l,hideSelectedOptions:!1,label:ke().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Pu=(0,xe.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),Nu=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const o=Pu(),{updateDueDate:l,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(xu)||{},o=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,xt.useSelector)(wt.ZP.selectors.getTenant),c=(0,Ct._)(),[p,d]=(0,s.useState)(!1),m=Ou()("UPDATE_TASK")&&Tu(n);return{updateDueDate:(0,s.useCallback)((e=>{o&&m&&r&&e&&t!==e&&(d(!0),c((0,u.KF3)({taskId:r,workflowPath:o,environment:l,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(wu).finally((()=>{d(!1)})))}),[o,r,l,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(pr.Z,{className:Ee()(o.dueDate,a),disabled:i||p,value:r,label:ke().text("Due date"),onChange:(0,Q.pipe)((e=>e&&e.getTime()),l),margin:"dense",InputProps:{className:o.dueDateInput},InputLabelProps:{classes:{root:o.inputLabel}}})},Du=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:o,updatePriority:l,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(xu)||{},o=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,xt.useSelector)(wt.ZP.selectors.getTenant),c=(0,Ct._)(),[p,d]=(0,s.useState)(!1),m=Ou()("UPDATE_TASK")&&Tu(n),h=(0,s.useCallback)((e=>{const{value:n}=e;o&&m&&r&&t!==n&&(d(!0),c((0,u.ax9)({taskId:r,workflowPath:o,environment:l,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(wu).finally((()=>{d(!1)})))}),[o,r,l,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:ke().text("Low"),value:u.NVC.low},{label:ke().text("Medium"),value:u.NVC.medium},{label:ke().text("High"),value:u.NVC.high},{label:ke().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:h,updateRequestIsInProgress:p,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),d=i||p;return c().createElement(ar.Z,{className:a,isDisabled:d,options:o,onChange:l,hideSelectedOptions:!1,label:ke().text("Priority"),value:o.find((0,Q.propEq)("value",r)),TextFieldProps:{disabled:d},height:40})};var Ru=r(94842),ju=r(43434),Zu=r(98685);const _u=(0,xe.Z)((e=>({comment:{display:"flex",flexDirection:"row",flex:1,marginLeft:"6px"},avatar:{height:"24px",width:"24px",margin:"3px 13px 0 0"},icon:{fill:"#537280",backgroundColor:"#EAEDEE"},firstLine:{display:"flex",flexDirection:"row"},info:{flex:1},author:{flex:1,fontWeight:"500",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px"},date:{color:"rgba(0, 0, 0, 0.54)",fontSize:"11px",marginRight:"17px",lineHeight:"15px"},text:{color:"rgba(0, 0, 0, 0.6)",fontSize:"13px",wordWrap:"break-word",wordBreak:"break-all",paddingRight:"10px"}}))),Au=(0,xe.Z)((e=>({circleButton:{maxWidth:"14px",maxHeight:"14px",border:"1px solid rgba(0, 0, 0, 0.3)",fontSize:"13px",color:"rgba(0, 0, 0, 0.6)",position:"absolute",top:"-11px",left:"5px",backgroundColor:"#ffffff","&:hover":{backgroundColor:"#f7f7f7"},"&.focused":{backgroundColor:"#f7f7f7"}},delimiter:{position:"relative",height:"4px",borderTop:"1px solid rgba(0, 0, 0, 0.3)",borderBottom:"1px solid rgba(0, 0, 0, 0.3)",margin:"15px 0 24px 0"}}))),Mu=(0,xe.Z)((e=>({container:{padding:"5px 0",display:"flex",flexDirection:"column"},commentsContainer:{maxHeight:"300px",overflowY:"auto"},title:{margin:"0 0 8px 5px",fontSize:"14px",color:"rgba(0, 0, 0, 0.87)"},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"0 6px",height:"40px",margin:"10px 17px 0 6px",fontSize:"14px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}}))),Lu=(0,xe.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),Fu=e=>{let{author:t,classes:r,message:n,time:a}=e;const o=_u();return c().createElement("div",{className:o.comment},c().createElement(ju.Z,{className:o.avatar},c().createElement(Zu.Z,{className:o.icon})),c().createElement("div",{className:Ee()(o.info,r.messageContainer)},c().createElement("div",{className:o.firstLine},c().createElement("div",{className:o.author},t),c().createElement("span",{className:o.date},ke().date(a,"L LT"))),c().createElement("div",{className:o.text},n)))};Fu.defaultProps={classes:{}},Fu.propTypes={classes:K().object,author:K().string,id:K().string,message:K().string,time:K().number};const Bu=e=>{let{comments:t,onClick:r}=e;const n=Au();return c().createElement(c().Fragment,null,c().createElement(Fu,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Pe.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(Fu,t[t.length-1]))};Bu.propTypes={comments:K().arrayOf(K().shape({author:K().string,id:K().string,message:K().string,time:K().number})),onClick:K().func};const Vu=e=>{let{comments:t}=e;const r=Lu();return t.map((e=>{let{author:t,id:n,message:a,time:o}=e;return c().createElement(Fu,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:o})}))};Vu.propTypes={comments:K().arrayOf(K().shape({author:K().string,id:K().string,message:K().string,time:K().number}))};const zu=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(xu)||{},o=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,xt.useSelector)(wt.ZP.selectors.getTenant),c=(0,Ct._)(),[p,d]=(0,s.useState)([]),[m,h]=(0,s.useState)(!1),g=Ou()("UPDATE_TASK")&&Tu(n);(0,s.useEffect)((()=>{d(t||[])}),[t]);const f=(0,s.useCallback)((e=>{g&&(h(!0),c((0,u.tZe)({workflowPath:o,environment:l,tenant:i,taskId:r,comment:e}).then((()=>(0,u.yW4)({workflowPath:o,environment:l,tenant:i,taskId:r})))).then((e=>{let{processInstanceComments:t}=e;d(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(wu).finally((()=>h(!1))))}),[l,r,i,o,c,a,g]);return{comments:p,requestIsInProgress:m,writeComment:f,readOnly:!g}},Uu=e=>e.target.value,Hu=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Mu(),[o,l]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=zu({processInstanceComments:t,taskId:r,isOpen:n}),h=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),g=(0,Q.pipe)(Uu,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",ke().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},o||p.length<3?c().createElement(Vu,{comments:p}):c().createElement(Bu,{onClick:()=>l(!0),comments:p})),!m&&c().createElement(Po.Z,{endAdornment:c().createElement(No.Z,{position:"end"},c().createElement(yo.Z,{icon:Ru.Z,disabled:0===i.length,onClick:h})),classes:{root:a.filledInputRoot},placeholder:ke().text("Write a comment"),value:i,onKeyPress:(0,Q.when)((0,Q.propEq)("key","Enter"),h),onChange:g,disableUnderline:!0}))};Hu.propTypes={processInstanceComments:K().arrayOf(K().shape({author:K().string,id:K().string,message:K().string,time:K().number})),taskId:K().string};const Wu=e=>{let{taskId:t,possibleActions:r,assignee:n,isTaskOpen:a}=e;const{actions:o,actionRequestIsInProgress:l}=(e=>{let{possibleActions:t,assignee:r,taskId:n,isOpen:a}=e;const{loadWorkflowTasks:o}=(0,s.useContext)(xu)||{},l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),i=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,xt.useSelector)(wt.ZP.selectors.getTenant),p=(0,xt.useSelector)(wt.ZP.selectors.getUserName),d=(0,xt.useSelector)(wt.ZP.selectors.getEntityUri),[m,h]=(0,s.useState)(!1),g=(0,s.useContext)(Ot.m),f=(0,xt.useDispatch)(),b=(0,s.useCallback)((e=>()=>{l&&n&&(h(!0),(0,u.TZ_)({taskId:n,workflowPath:l,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?f(wt.ui.actions.entityDeletionFinished()):(f(wt.N5.entity.actions.loadEntity({viewId:g,uri:d})),null==o||o())})).catch(wu).finally((()=>{h(!1)})))}),[l,n,i,c,f,d,g,o]);return{actions:(0,s.useMemo)((()=>p===r&&Tu(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:b(t)}})):[]),[t,b,p,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return o.length>0?c().createElement(nr.Z,{buttonComponent:yo.Z,buttonProps:{icon:tl.Z,size:"L",disabled:l},menuId:"workflow-actions",menuItems:o}):null},Gu=(0,xe.Z)({decorator:{display:"flex",alignItems:"stretch"},lineBlock:{width:"56px",flexShrink:0},withLinePadding:{"& $noLine":{height:"10px"},"& $line":{height:"calc(100% - 10px)"}},noLine:{height:"0"},line:{height:"100%",position:"relative",marginLeft:"31px",borderLeft:"2px solid rgba(0,0,0,0.06)","&:before":{position:"absolute",height:6,width:6,borderRadius:"50%",left:-5,top:"15px",background:"#d8d8d8",content:'""',display:"block",border:"1px solid white"},"&$plain":{"&:before":{width:0,border:"none"}},"&$last":{height:"15px"}},content:{flex:1,minWidth:0},plain:{},last:{},rowDivider:{marginLeft:0}}),qu=e=>{let{className:t,children:r,plain:n,first:a,last:o,transparent:l,divider:i}=e;const s=Gu();return c().createElement("div",{className:Ee()(t,s.decorator)},c().createElement("div",{className:Ee()(s.lineBlock,{[s.withLinePadding]:a})},!l&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:Ee()(s.line,{[s.plain]:n},{[s.last]:o})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(go.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let Ku={};const Yu=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let $u=0;function Xu(){return Xu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xu.apply(this,arguments)}const Qu=e=>c().createElement("svg",Xu({width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"CollaborationIcon_svg__a"})),c().createElement("g",{transform:"translate(-2 -2)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"CollaborationIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#CollaborationIcon_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#CollaborationIcon_svg__b)",d:"M0 0h24v24H0z"}))),Ju=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:o,dueDate:l,priority:i,assignee:u,createdBy:p,createTime:d,displayName:m,processDefinitionDisplayName:h,objectURIs:g,processInstanceComments:f,possibleActions:b,isOpen:y}=t,v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,Q.pipe)(Cu,(0,Q.unless)(Q.isNil,(0,Q.pipe)((0,Q.split)("/"),(0,Q.nth)(1))))(e)}(g),E=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return Ku[r]||(Ku[r]=Yu[$u],$u++,$u>Yu.length-1&&($u=0)),Ku[r]})({processDefinitionDisplayName:h}),x=Eu({color:E}),[w,O]=(0,s.useState)(!1),C=Ou()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:x.card},c().createElement("div",{className:Ee()({[x.withBackground]:w})},c().createElement("div",{className:x.lineWrapper},c().createElement("div",{className:x.line}),a&&c().createElement(a,{className:x.icon}),c().createElement(qu,{plain:!0,first:!0,transparent:!w},c().createElement("div",{className:x.mainInfo},c().createElement("div",{className:x.title},c().createElement("div",{className:Ee()(x.caption,x.flex)},h),c().createElement(Dn.Z,{className:x.flag}),c().createElement(De.ZP,{title:ke().text("Due date")},c().createElement("span",{className:x.date},ke().date(l,"L"))),c().createElement(qt.Z,{isOpen:w,size:"L",onClick:()=>{O(!w)}})),c().createElement("div",{className:x.infoBlock},c().createElement("div",{className:x.flex},v&&c().createElement("div",{className:x.info},ke().text("DCR ID"),": ",c().createElement("span",{className:x.infoValue},v)),c().createElement("div",{className:x.info},ke().text("Created by"),": ",c().createElement("span",{className:x.infoValue},p)," ",ke().text("on")," ",c().createElement("span",{className:x.infoValue},ke().date(d,"L"))),c().createElement("div",{className:x.info},ke().text("Step"),": ",c().createElement("span",{className:x.infoValue},m)),C&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:x.commentsInfo},c().createElement(Qu,{className:x.commentsIcon}),c().createElement("div",{className:x.infoValue},f.length))),n||c().createElement(Wu,{taskId:o,possibleActions:b,assignee:u,isTaskOpen:y}))))),w&&c().createElement(qu,{plain:!0},c().createElement("div",{className:x.controlsBox},c().createElement("div",{className:x.controlsInRow},c().createElement(Nu,{taskId:o,dueDate:l,isTaskOpen:y}),c().createElement(Du,{taskId:o,priority:i,className:x.priority,isTaskOpen:y})),c().createElement(Iu,{taskId:o,assignee:u,isTaskOpen:y})))),w&&c().createElement(c().Fragment,null,r,C&&c().createElement("div",{className:x.comments},c().createElement(Hu,{taskId:o,processInstanceComments:f,isTaskOpen:y}))))};function ep(){return ep=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ep.apply(this,arguments)}const tp=e=>c().createElement("svg",ep({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#42A5F5",cx:14,cy:14,r:14}),c().createElement("path",{d:"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z",fill:"#FFF",opacity:.87})));let rp,np;!function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(rp||(rp={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(np||(np={}));var ap=r(26978);const op=(e,t)=>{switch(e){case np.CREATE_RELATIONSHIP:case np.INSERT_ATTRIBUTE:return rp.ADDED;case np.UPDATE_TAGS:case np.UPDATE_ROLES:case np.UPDATE_ATTRIBUTE:return rp.EDITED;case np.DELETE_ATTRIBUTE:case np.DELETE_RELATIONSHIP:return rp.DELETED;case np.PIN_ATTRIBUTE:return null!=t&&t.pin?rp.PIN_DELETED:rp.PINNED;case np.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?rp.IGNORE_DELETED:rp.IGNORED}},lp=e=>({[rp.ADDED]:ke().text("added"),[rp.EDITED]:ke().text("edited"),[rp.DELETED]:ke().text("deleted"),[rp.PINNED]:ke().text("pinned"),[rp.PIN_DELETED]:ke().text("pin deleted"),[rp.IGNORED]:ke().text("ignored"),[rp.IGNORE_DELETED]:ke().text("ignore deleted")}[e]||""),ip=(e,t)=>(0,Q.when)((0,Q.allPass)([(0,Q.pipe)((0,Q.prop)("type"),(0,Q.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,Q.evolve)({type:(0,Q.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function sp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cp(e,t,r[t])}))}return e}function cp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const up=(e,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,o=(0,Q.pathOr)([],["value",t.name])(r),l=(0,Q.pathOr)([],["value",t.name])(n),i=Math.max(o.length,l.length);return(0,Q.times)((e=>[{value:{newValue:o[e],oldValue:l[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},pp=(0,Q.curry)(((e,t,r)=>{const n=(0,ap.U)(e,t.type,[],[]);return mp(e,n,r)})),dp=(0,Q.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),o=(0,u.xF8)(e,t.type);return(0,Q.flatten)([sp({level:1,label:(0,Q.propOr)("","label",a),attributeType:a,attributeValue:sp({},t,r)},((e,t)=>{if(t===np.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=op(t);return e?{operation:e}:{}}return{}})(r,n)),mp(e,o,r,2)])})),mp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,Q.flatten)(t.map((t=>up(r,t).map((r=>r.map((r=>hp(e,t,r,n))))))).filter((0,Q.complement)(Q.isEmpty)))},hp=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return gp(e,t,r,n);case u.oS0.TYPE_REFERENCE:return fp(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,Q.is)(Object,r)?r:{newValue:t,type:np.INSERT_ATTRIBUTE}})(t,r);return bp(t,e,n)}}},gp=(e,t,r,n)=>{const a=(0,u.EUG)({},t);return[{level:n,label:(0,u.idV)((null==t?void 0:t.label)||(null==t?void 0:t.name)),attributeType:t,attributeValue:r},mp(e,a,r.value,n+1)]},fp=(e,t,r,n)=>{const a=(0,u.EUG)(e,t);return[{level:n,label:(null==t?void 0:t.label)||(null==t?void 0:t.name),attributeType:t,attributeValue:r},mp(e,a,r.value,n+1)]},bp=(e,t,r)=>{const{newValue:n,oldValue:a,type:o}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===np.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:op(o,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function yp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vp(e,t,r[t])}))}return e}function vp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ep=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],xp=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)||(0,u.O27)(e)?e:parseInt(e),a=e=>(null==e?void 0:e.length)&&!(0,u.O27)(e)&&!(0,u.O27)(e[0]),o=a(t),l=a(r);return o&&l?[{type:np.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:o?[{type:np.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:l?[{type:np.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},wp=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,o=a===np.UPDATE_ROLES?(0,u.xqc)(e):Q.identity,l=(0,Q.difference)(r,n),i=(0,Q.difference)(n,r),s=[];return l.length&&s.push({type:np.INSERT_ATTRIBUTE,newValue:{value:l.map(o).join(", ")}}),i.length&&s.push({type:np.DELETE_ATTRIBUTE,oldValue:{value:i.map(o).join(", ")}}),s},Op=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,o=t===np.INSERT_ATTRIBUTE?(0,u.Zmi)(r):r;if(n){const e=a.split("/attributes/"),t=n.split("/")[1];return[e[1],t,o].join("/")}return o})(t),n=r.split("/");let a=e;for(let e=0;e<n.length-1;e+=2){var o;const r=n[e],l=n[e+1],i=(a[r]||[]).find((0,Q.propEq)("id",l)),s=n.length===e+2?t:{},c=i||{id:l,value:s},u=(null===(o=t.refObjectURI)||void 0===o?void 0:o.indexOf(l))>=0&&t.refObjectURI;u&&(c.refObjectURI=u),(0,Q.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Cp=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:o,tags:l,defaultProfilePicValue:i}=t,s=yp({},r);return i&&(s.defaultProfilePicValue=[i]),o&&(s[u.xPW.roles.name]=[{type:np.INSERT_ATTRIBUTE,newValue:{value:o.map((0,u.xqc)(e)).join(", ")}}]),l&&(s[u.xPW.tags.name]=[{type:np.INSERT_ATTRIBUTE,newValue:{value:l.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:np.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:np.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Tp=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case np.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case np.UPDATE_TAGS:n[u.xPW.tags.name]=wp(e,r);break;case np.UPDATE_ROLES:n[u.xPW.roles.name]=wp(e,r);break;case np.UPDATE_START_DATE:n[u.xPW.startDate.name]=xp(r);break;case np.UPDATE_END_DATE:n[u.xPW.endDate.name]=xp(r);break;case np.CREATE_RELATIONSHIP:case np.CREATE_ENTITY:return yp({},n,Cp(e,r.newValue));case np.INSERT_ATTRIBUTE:case np.UPDATE_ATTRIBUTE:case np.DELETE_ATTRIBUTE:case np.PIN_ATTRIBUTE:case np.IGNORE_ATTRIBUTE:Op(n,r)}return n},kp=(0,xe.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Sp=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const o=kp();return c().createElement(ht.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:o.linkLabel},r?ke().text("View less suggestions"):ke().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var Ip=r(43525),Pp=r(7089);const Np=(0,xe.Z)((e=>({field:{fontSize:"12px",lineHeight:"20px",color:e.palette.text.primary,marginTop:"6px",overflow:"hidden",wordBreak:"break-word"},fieldName:{color:e.palette.text.secondary,marginRight:"8px"},difference:{marginRight:"8px"},arrow:{margin:"0 4px",fontSize:"12px",color:e.palette.text.primary},chip:{height:"20px",fontSize:"10px",fontWeight:500,lineHeight:"16px",letterSpacing:0,flexShrink:0,textTransform:"capitalize",color:e.palette.primary.main,borderColor:e.palette.primary.main,"&.edited":{color:"#CC7500",borderColor:"#CC7500"},"&.added":{color:"#599E0E",borderColor:"#599E0E"},"&.deleted":{color:"#CF0E26",borderColor:"#CF0E26"}}}))),Dp=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:o}=e;const l=Np(),i=r||n;return c().createElement("div",{className:Ee()(l.field,o)},c().createElement("span",{className:l.fieldName},t,":"),!(0,Q.isNil)(i)&&c().createElement("span",{className:l.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(Ip.Z,{className:l.arrow}),n)),a&&c().createElement(Pp.Z,{variant:"outlined",label:lp(a),className:Ee()(l.chip,a)}))},Rp=c().createContext(null);Rp.displayName="AttributesChangesContext";const jp=(0,xe.Z)((e=>({linkContainer:{textDecoration:"none",cursor:"pointer",marginLeft:"4px"},linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},disabledLink:{pointerEvents:"none",cursor:"default"},label:{color:e.palette.text.primary},change:e=>{let{level:t=0}=e;return{marginLeft:16*t+"px"}}}))),Zp=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:o,newValue:l,operation:i}=e;const p=jp({level:r}),d=(0,xt.useSelector)(wt.ZP.selectors.getEntityUri),m=(0,s.useContext)(Rp),h=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,Q.when)((0,Q.anyPass)([(0,Q.hasPath)(["value","newValue"]),(0,Q.hasPath)(["value","oldValue"])]),(0,Q.ifElse)((0,Q.hasPath)(["value","newValue"]),(0,Q.path)(["value","newValue"]),(0,Q.path)(["value","oldValue"])))(a);return function(e,t,r){let n,a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const l=o[t.refObjectURI];return l?(a=r===l.startObjectUri?l.endObjectUri:l.startObjectUri,n=r===l.startObjectUri?l.endObjectLabel:l.startObjectLabel):t.refEntity&&(a=t.refEntity.objectURI,n=o[a].label),{objectUri:a,objectLabel:n}}(n,e,d,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,d,m]),g=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=h()||{};if(!(0,Q.isNil)(e)&&!(0,Q.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(Or.Z,{value:e,className:Ee()(p.linkContainer,{[p.disabledLink]:n})},c().createElement("span",{className:Ee()(p.linkLabel,{[p.label]:n})},(0,u.idV)(t)))}return null}),[h,m,p]),f=(0,s.useMemo)((()=>c().createElement("span",null,t,g())),[t,g]),b=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(tr.Z,{value:t,dataTypeDefinition:ip(n,t)})}),[n]);return c().createElement(Dp,{className:p.change,label:f,oldValue:o&&b(o),newValue:l&&b(l),operation:i})},_p=(0,xe.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Ap(){return Ap=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ap.apply(this,arguments)}const Mp=e=>{let{changes:t}=e;const r=_p();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,Q.has)("level",e)?c().createElement(Zp,Ap({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Lp=(0,Q.pipe)((0,Q.filter)((0,Q.has)("operation")),Q.length),Fp=(0,xe.Z)((e=>({container:{boxSizing:"border-box",border:"1px solid rgba(0,0,0,0.03)",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.03)",padding:"10px",margin:"12px 16px 12px 0"},uri:{color:e.palette.primary.main,textDecoration:"none",cursor:"pointer"},label:{fontSize:"12px",letterSpacing:0,lineHeight:"16px"},showMoreLink:{marginTop:"8px"}}))),Bp=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:o}=e;const l=Fp(),i=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),[p,d]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,Q.pipe)((0,Q.pick)([t]),pp(e,r)),o=(0,Q.curry)(((e,t)=>(0,Q.reduce)(((e,r)=>(0,Q.concat)(e,r(t))),[],e))),l=(0,Q.propOr)([],r.uri)(t).reduce(((t,n)=>Tp(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,Q.propOr)([],r.uri)(t).reduce(((t,n)=>Tp(e,r,n,t)),{}))(e,t,r)));return[o([(0,Q.pipe)((0,Q.omit)(Ep),pp(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],l),(0,Q.flatten)(n.map(((r,n)=>{const a=(0,Q.path)([r.uri,0,"type"],t);return dp(e,r,i[n],a)})))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:ke().text("Relationships")};return d.length>0?(0,Q.flatten)([p,e,d]):p}),[p,d]),{isExpanded:h,onToggle:g,itemsToShow:f,collapsedSuggestionsCount:b}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const[r,n]=(0,s.useState)(!1),a=(0,s.useCallback)((()=>n((e=>!e))),[]),o=(0,s.useMemo)((()=>e.slice(0,t)),[e,t]),l=(0,s.useMemo)((()=>Lp(e)),[e]),i=(0,s.useMemo)((()=>Lp(o)),[o]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:o,collapsedSuggestionsCount:l-i}}(m,o);return c().createElement(Rp.Provider,{value:r},c().createElement("div",{className:l.container},c().createElement(Or.Z,{className:l.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:l.label},(0,u.idV)(n.label))),c().createElement(Mp,{changes:f}),b>0&&c().createElement(Sp,{onClick:g,suggestionsCount:b,isExpanded:h,className:l.showMoreLink})))};function Vp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zp(e,t,r[t])}))}return e}function zp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Up=(0,Q.filter)((0,Q.pipe)((0,Q.prop)("uri"),u.WgC)),Hp=(0,Q.filter)((0,Q.pipe)((0,Q.prop)("uri"),u.bC9)),Wp=(e,t)=>(0,Q.filter)((0,Q.allPass)([(0,Q.pipe)((0,Q.prop)("uri"),u.bC9),(0,Q.pipe)((0,Q.prop)("startObjectUri"),(0,Q.equals)(t))]))(e),Gp=(0,Q.curry)(((e,t)=>({entity:t,relations:Wp(e,t.uri)}))),qp=(0,Q.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:Vp({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),Kp=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,o=(0,Q.pipe)((0,Q.pathOr)([],[a,"relations"]),(0,Q.concat)(n),Q.uniq)(e);return e[a]={entity:r,relations:o},e};function Yp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $p=e=>{let{task:t}=e;const{objectURIs:r}=t,n=Cu(r),{dcr:a,groupedObjects:o}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),o=(0,Ct._)(),l=(0,s.useCallback)((e=>(0,Q.isEmpty)(e)?Promise.resolve([]):o((0,u.DnY)(e,{searchOptions:"ovOnly",defaultMaxValues:1}))),[]);return(0,s.useEffect)((()=>{(0,u.E6I)(e).then((e=>{const{changes:t,objectsInfo:n}=e,o=((e,t)=>(0,Q.pipe)(Q.keys,(0,Q.filter)((t=>(0,Q.prop)([t],e))),(0,Q.map)((e=>Vp({},t[e],{uri:e}))))(t))(t,n),i=(0,Q.pipe)(Up,(0,Q.map)(Gp(o)))(o),s=(0,Q.pipe)(Hp,(0,Q.map)(qp(n)))(o),[c,u]=(0,Q.partition)((0,Q.has)("entity"),s),p=u.map((0,Q.path)(["relations",0,"startObjectUri"]));l(p).then((e=>{const t=u.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yp(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,Q.pipe)(Q.flatten,(0,Q.reduce)(Kp,{}),Q.values,r)([i,c,t])})).catch(wu),a(e)})).catch(wu)}),[e,l]),{dcr:n,groupedObjects:t}})(n);return c().createElement(Ju,{task:t,Icon:tp},a&&o.map(((e,t)=>c().createElement(qu,{key:t,last:t===o.length-1,divider:!0},c().createElement(Bp,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},Xp=(0,xe.Z)({pmCard:{marginLeft:"-15px"}});function Qp(){return Qp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qp.apply(this,arguments)}const Jp=e=>c().createElement("svg",Qp({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#1976D2",cx:14,cy:14,r:14}),c().createElement("path",{d:"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z",fill:"#FFF",opacity:.87})));const ed=e=>(0,s.useCallback)((e=>{let t={},r=[];return async n=>{let{max:a,offset:o,force:l}=n,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(n,["max","offset","force"]),s=l;const c=Object.keys(t);if(s=s||!(0,Q.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,Q.equals)(t[e],i[e]);return s&&(r=await e(i),t=i),{response:r.slice(o,o+a),total:r.length,originalResponse:r}}})(e),[e]),td=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:o,options:l,page:i,rowsPerPage:c,sorting:p}=e;const{order:d,field:m}=p||{},[h,g]=(0,s.useState)(0),[f,b]=(0,s.useState)([]),[y,v]=(0,s.useState)({}),E=(0,xt.useSelector)(wt.ZP.selectors.getTenant),x=(0,xt.useSelector)(wt.ZP.selectors.getDtssPath),w=(0,xt.useSelector)(wt.ZP.selectors.getDataTenants),O=(0,s.useMemo)((()=>({dtssPath:x,dataTenants:w,entity:r,customerTenant:E,dtssRequest:u.Rgl})),[x,w,r,E]),C=(0,s.useCallback)((0,u.U_T)(O,u.SP6),[O]),T=ed(C),k=ed(u.bFH),S=(0,Q.prop)("uri",r),I=(0,Ct._)(),P=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t||(0,u.ZiX)(S))return g(0),b([]),void v({});null==o||o(),I((0,u.biM)(r)?k({dtssPath:x,entity:r,customerTenant:E,offset:i*c,max:c,force:e}):T({entityUri:S,offset:i*c,max:c,filter:n,sort:m,order:d,force:e,deep:l.showTransitiveMatches?void 0:1,activeness:l.showInactiveEntities?u.YJ7.ALL:u.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:r,originalResponse:n}=e;g(r),b(t),(0,u.B1H)(n).length>0&&v((0,u.KPC)(n))})).finally((()=>{null==a||a()}))}),[x,t,S,m,n,k,T,a,o,l,d,i,c,I,E]);return(0,s.useEffect)((()=>{P()}),[P]),{total:h,matches:f,entitiesMap:y,loadMatches:(0,s.useCallback)((()=>{P(!0)}),[P])}},rd=(0,xe.Z)({root:{display:"flex",flexDirection:"column",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px","& + &":{borderTop:"1px solid rgba(0,0,0, 0.12)"}},profileCardWrapper:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},profileCardContainer:{flexGrow:1},rulesContainer:{paddingLeft:"40px"}}),nd=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:o,className:l}=e;const i=rd();return c().createElement("div",{className:Ee()(i.root,l)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Ln.Z,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(yn,{match:a,metadata:o,entitiesMap:r,entity:n})))},ad={showTransitiveMatches:!0,showInactiveEntities:!1},od=e=>{let{task:t}=e;const r=Xp(),{objectURIs:n}=t,a=(0,xt.useSelector)(wt.ZP.selectors.getEntity),o=(0,xt.useSelector)(wt.ZP.selectors.getMetadata),{matches:l,entitiesMap:i}=td({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:ad}),s=null==l?void 0:l.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(Ju,{task:t,Icon:Jp},s&&c().createElement(qu,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(nd,{metadata:o,entity:a,match:s,entitiesMap:i}))))};function ld(){return ld=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ld.apply(this,arguments)}const id=e=>c().createElement("svg",ld({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#205191",cx:14,cy:14,r:14}),c().createElement("path",{d:"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z",fill:"#FFF",opacity:.87})));function sd(){return sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sd.apply(this,arguments)}const cd=e=>c().createElement("svg",sd({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",opacity:.87},c().createElement("circle",{fill:"#0D47A1",cx:14,cy:14,r:14}),c().createElement("path",{d:"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z",fill:"#FFF"})));class ud{}ud.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement($p,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(od,{task:t});case u.Yj_.recommendForDelete:return c().createElement(Ju,{task:t,Icon:cd});default:return c().createElement(Ju,{task:t,Icon:id})}};const pd=ud,dd=e=>{let{task:t}=e;return pd.build({task:t})};var md=r(65549),hd=r(86619),gd=r(8560),fd=r(37265);const bd=(0,xe.Z)((e=>({popoverPaper:{width:"464px"},title:{fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",color:e.palette.text.primary,marginBottom:"17px"},content:{display:"flex",flexDirection:"column",padding:"23px 24px 14px 24px"},simpleDropDownSelector:{marginBottom:"20px"},inputRoot:{paddingTop:"0 !important",paddingBottom:"0 !important"},select:{fontSize:"14px"},footer:{display:"flex",justifyContent:"flex-end",padding:"5px 8px 8px",borderTop:"1px solid rgba(0,0,0,0.12)"},cancelButton:{marginRight:"8px"},input:{fontSize:"14px"}}))),yd=e=>{let{anchorEl:t,onClose:r}=e;const n=bd(),[a,o]=(0,s.useState)(""),[l,i]=(0,s.useState)(null),[p,d]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),n=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,xt.useSelector)(wt.ZP.selectors.getTenant),o=(0,xt.useSelector)(wt.ZP.selectors.getEntity).type;return(0,s.useEffect)((()=>{(0,u.IU6)({workflowPath:r,environment:n,tenant:a}).then((e=>{let{data:r}=e;return t(((e,t)=>e.filter((e=>{let{manualStart:r,objectTypes:n}=e;return r&&(!n||(null==n?void 0:n.some((e=>e===t))))})))(r,o))}))}),[o,r,n,a]),{definitions:e}})(),{processInstance:h,loading:g}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(xu),t=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),r=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,xt.useSelector)(wt.ZP.selectors.getTenant),a=(0,xt.useSelector)(wt.ZP.selectors.getEntity).uri,[o,l]=(0,s.useState)(!1);return{processInstance:(0,s.useCallback)(((o,i)=>(l(!0),(0,u.$ju)({workflowPath:t,tenant:n,environment:r,processType:i,comment:o,objectURIs:[a]}).then((()=>{e()})).catch((e=>{throw wu(e),e})).finally((()=>{l(!1)})))),[a,r,e,n,t]),loading:o}})(),f=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(rl.ZP,{open:f,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},classes:{paper:n.popoverPaper}},c().createElement("div",{className:n.content},c().createElement(On.Z,{className:n.title},ke().text("Add new workflow")),c().createElement(bo.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:ke().text("Select task type"),value:l,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(hd.Z,{variant:"filled",hiddenLabel:!0,size:"small",placeholder:"Type a comment",InputProps:{disableUnderline:!0,classes:{input:n.input,root:n.inputRoot}},value:a,onChange:e=>{o(e.target.value)},multiline:!0})),c().createElement("div",{className:n.footer},c().createElement(Pl.Z,{disabled:g,className:n.cancelButton,onClick:r},ke().text("Cancel")),c().createElement(Pl.Z,{disabled:g,color:"primary",onClick:()=>{h(a,null==l?void 0:l.value).then((()=>{d(!0),o(""),i(null),r()})).catch((()=>{}))}},ke().text("Start")))),c().createElement(gd.Z,{container:document.body},c().createElement(fd.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:ke().text("A new workflow has started")})))},vd=(0,xe.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),Ed=()=>{const e=vd(),[t,r]=(0,s.useState)(null),n=Ou(),a=n("START_PROCESS_INSTANCE"),o=n("VIEW_PROCESS_DEFINITIONS");return a&&o?c().createElement(c().Fragment,null,c().createElement(Pl.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(md.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},ke().text("Add"))),c().createElement(yd,{anchorEl:t,onClose:()=>r(null)})):null};function xd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wd=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,Ct._)(),o=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowPath),l=(0,xt.useSelector)(wt.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,xt.useSelector)(wt.ZP.selectors.isWorkflowEnabled),c=(0,xt.useSelector)(wt.ZP.selectors.getTenant),p=(0,xt.useSelector)(wt.ZP.selectors.getEntityUri),d=(0,xt.useSelector)(wt.ZP.selectors.getIsEditableMode),m=Ou()("VIEW_TASKS"),h=!(!o||!l)&&i&&m,[g,f]=(0,s.useState)(null),[b,y]=(0,s.useState)(0),[v,E]=(0,s.useState)(!1),x=(0,s.useCallback)((()=>{E(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,i=(e||[null]).map((e=>(0,u.uT0)({entityUri:p,workflowPath:o,environment:l,tenant:c,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(i)).then((t=>{const n=(0,Q.pipe)((0,Q.map)((0,Q.prop)("data")),(0,Q.reject)(Q.isNil),Q.flatten,(0,Q.uniqBy)((0,Q.prop)("taskId")),(0,Q.filter)(Od(e,r)))(t);f(n),y(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{E(!1)}))}),[p,l,a,c,o,r,n,t]);(0,s.useEffect)((()=>{p&&h&&!(0,u.ZiX)(p)?x():(f(null),y(0))}),[h,p,x,d]);const w=(0,s.useCallback)(((e,t)=>{f((r=>r.map((r=>r.taskId===e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xd(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:g,total:b,loading:v,updateTaskState:w,loadWorkflowTasks:x}},Od=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function Cd(){return Cd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cd.apply(this,arguments)}const Td=e=>c().createElement("svg",Cd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17.045 20.455l1.41-1.41-3.41-3.41-1.41 1.41 3.41 3.41zm-9.5-12.41h3.5v5.59l-5.41 5.41 1.41 1.41 6-6v-6.41h3.5l-4.5-4.5-4.5 4.5z",id:"MergeDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"MergeDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#MergeDark_svg__a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#MergeDark_svg__b)",d:"M0 0h24v24H0z"}))),kd=(0,xe.Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));function Sd(){return Sd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sd.apply(this,arguments)}let Id;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(Id||(Id={}));const Pd=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Id.iconButton,label:a,disabled:o,icon:l,onClick:i=ze.ZT,onMenuClose:s=ze.ZT}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const p=kd();return(()=>{switch(n){case"iconButton":return c().createElement(me.k,Sd({disabled:o,className:Ee()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:l},u));case"button":return c().createElement(Pl.Z,Sd({className:Ee()(p.button,r),disabled:o,startIcon:c().createElement(l,null),onClick:i,color:"primary",classes:{startIcon:p.startIcon,label:p.label}},u),c().createElement(Sr.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(xn.Z,Sd({classes:{root:p.menuItem},onClick:e,disabled:o,ref:t},u),c().createElement(c().Fragment,null,c().createElement(l,{className:p.menuIcon}),c().createElement(On.Z,{classes:{root:p.menuText}},a)))}}})()}));Pd.displayName="ActionButton";const Nd=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:o=ze.ZT}=e;const l=(0,xt.useSelector)(wt.ZP.selectors.getTenant),i=(0,xt.useSelector)(wt.ZP.selectors.getDtssPath),[c,p]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),p(!0);const e={dtssPath:i,customerTenant:l,entity:r,entities:t};((0,u.biM)(r)?(0,u.uJQ)(e):(0,u.OxG)(e)).catch(o).finally((()=>{null==n||n(),p(!1)}))}),[i,t,r,n,a,l])}};function Dd(){return Dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dd.apply(this,arguments)}const Rd=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Id.iconButton,onMenuClose:a=ze.ZT,disabled:o=!1,entity:l,entities:i,onStartRequest:s,onFinishRequest:u,onError:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest","onError"]);const{sendMergeAllRequest:m}=Nd({entity:l,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(Pd,Dd({className:r,disabled:o,mode:n,label:ke().text("Merge"),icon:Td,onClick:m,onMenuClose:a,ref:t},d))}));function jd(){return jd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jd.apply(this,arguments)}Rd.displayName="mergeButton";const Zd=e=>c().createElement("svg",jd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M17 13.138l4.5 4.5-4.5 4.5V18.5h-1.247l-3.488-3.479 1.413-1.414 2.901 2.893H17v-3.362zM17 1.5L21.5 6 17 10.5V7.138h-.421l-11.03 11H2v-2h2.723l11.03-11H17V1.5zm-11.45 4l3.294 3.286-1.414 1.413L4.723 7.5H2v-2h3.55z",id:"NotMatchDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"NotMatchDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#NotMatchDark_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#NotMatchDark_svg__b)",d:"M0 0h24v24H0z"}))),_d=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const o=(0,xt.useSelector)(wt.ZP.selectors.getTenant),l=(0,xt.useSelector)(wt.ZP.selectors.getDtssPath),[i,c]=(0,s.useState)(!1);return{isPending:i,sendMarkAsNotMatchRequest:(0,s.useCallback)((()=>{null==a||a(),c(!0);const e={dtssPath:l,customerTenant:o,entity:r,entities:t};((0,u.biM)(r)?(0,u.bMg)(e):(0,u.fZN)(e)).finally((()=>{null==n||n(),c(!1)}))}),[l,t,r,n,a,o])}};function Ad(){return Ad=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ad.apply(this,arguments)}const Md=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=Id.iconButton,onMenuClose:a=ze.ZT,disabled:o=!1,entity:l,entities:i,onStartRequest:s,onFinishRequest:u}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest"]);const{sendMarkAsNotMatchRequest:d}=_d({entity:l,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(Pd,Ad({className:r,disabled:o,mode:n,label:ke().text("Not a match"),icon:Zd,onClick:d,onMenuClose:a,ref:t},p))}));Md.displayName="notMatchButton";var Ld=r(66072),Fd=r(62901),Bd=r(86602),Vd=r(53857),zd=r(67462),Ud=r(50548);function Hd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wd=e=>{let{actions:t,dispatch:r}=e;return(0,s.useMemo)((()=>Object.entries(t).reduce(((e,t)=>{let[n,a]=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hd(e,t,r[t])}))}return e}({},e,{[n]:(0,Q.pipe)(a,r)})}),{})),[r,t])};var Gd=r(27536);function qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kd(e,t,r[t])}))}return e}function Kd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Yd=[],$d=e=>console.error("Collaboration error",e),Xd=e=>{let{objectIds:t=Yd,objectTypes:r,enabled:n=!0}=e;const a=(0,xt.useSelector)(wt.ZP.selectors.getEntity),o=(0,xt.useSelector)(wt.ZP.selectors.getTenant),l=(0,xt.useSelector)(wt.ZP.selectors.getCollaborationPath),i=(0,xt.useSelector)(wt.ZP.selectors.isCollaborationEnabled)&&n,[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)([]),[h,g]=(0,s.useState)(null),[f,b]=(0,s.useState)(null),[y,v]=(0,s.useState)(!1),[E,x]=(0,s.useState)(!1),w=(0,s.useCallback)((e=>{g((t=>qd({},t,e)))}),[]),O=null==a?void 0:a.uri,C=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&O&&!(0,u.ZiX)(O)){const r=e=>{console.warn("Collaboration error",e),g(null)};(0,Q.pipe)(u.$oF,(0,Q.andThen)((0,Q.map)((0,Q.props)(["objectId","comments"]))),(0,Q.andThen)(Q.fromPairs),(0,Q.andThen)(t?g:w),(0,Q.otherwise)(r))({uris:e,tenant:o,collaborationPath:l})}else g(null)}),[w,l,O,i,o]);(0,s.useEffect)((()=>{C(t,!0)}),[t,C]);const T=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:l,tenant:o,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;m((e=>t?(0,Q.uniqBy)((0,Q.prop)("commentId"),[...e,...r]):r)),p(n)})).catch($d)}),[l,o]),k=(0,s.useCallback)((e=>{x(!0),(0,u.d7q)({collaborationPath:l,tenant:o,commentId:e}).then(b).catch($d).finally((()=>x(!1)))}),[l,o]),S=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i}=e;v(!0);const s={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:l,tenant:o,data:s}).then((e=>{let[t]=e;return((e,t)=>{b(e),g((r=>qd({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch($d).finally((()=>v(!1)))}),[l,o]),I=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;v(!0);const p={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:l,tenant:o,data:p}).then((e=>(e=>{b(e),m((0,Q.map)((0,Q.when)((0,Q.propEq)("commentId",e.commentId),(0,Q.always)(e))))})(qd({},e,{replies:c})))).catch($d).finally((()=>v(!1)))}),[l,o]),P=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;v(!0),(0,u.YFy)({collaborationPath:l,tenant:o,commentId:r}).then((()=>((e,t)=>{b(null),g((r=>{const n=r[t]||[];return qd({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch($d).finally((()=>v(!1)))}),[l,o]),N=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";b("resolved"===n?e=>{if(e)return null}:t=>{if(t)return qd({},t,{replies:[...t.replies,e]})}),g((e=>qd({},e,{[t]:(e[t]||[]).map((e=>e.commentId===r?qd({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?qd({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:n,action:a,uri:i}=e;v(!0);const s={content:t,action:a,namedUsers:r};return(0,u.PP2)({collaborationPath:l,tenant:o,commentId:n,data:s}).then((e=>{let[t]=e;return N(t,i,n)})).catch($d).finally((()=>v(!1)))}),[l,o,N]),R=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;D({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[D]),j=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;D({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[D]);return{clearCurrentComment:(0,s.useCallback)((()=>{b(null)}),[]),comments:d,commentsMap:h,createComment:S,createReply:D,currentComment:f,deleteComment:P,editComment:I,getComment:k,getComments:T,getCommentsCount:C,loading:E,objectTypes:r,pageToken:c,reOpenThread:j,resolveThread:R,sending:y}};var Qd=r(90690),Jd=r(64651);function em(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tm(e,t,r[t])}))}return e}function tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rm=(0,Q.when)(Q.identity,(0,Q.pipe)(u.VGB,Q.length,(0,Q.times)((e=>e+1)))),nm=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:o,entity:l,relationActivityFilter:i,mode:c}=e;const[p,d]=(0,s.useState)(!1),m=(0,xt.useDispatch)(),h=(0,xt.useSelector)(wt.ZP.selectors.getTenant),g=(0,xt.useSelector)(wt.ZP.selectors.getDtssPath),{activityFilter:f,globalFilter:b}=(0,xt.useSelector)(wt.ZP.selectors.getGlobalSearchRequestOptions)||{},y=(0,Ct._)(),v=o.suggested,E=(0,s.useCallback)((()=>{if(null!=l&&l.uri){const e=em({},o.content,{sortBy:null==t?void 0:t.field,order:null==t?void 0:t.order,returnDates:!0,returnObjects:!0,activeness:{relation:i||u.Ng6.ALL,entity:f},max:a,offset:n*a,filter:(0,u.vyX)(b,r)||void 0,suggested:rm(v)}),s=[e].concat((0,Q.ifElse)(Q.identity,(0,Q.pipe)(u.VGB,(t=>t.map(((t,r)=>em({},t,{id:e.suggested[r]}))))),(0,Q.always)([]))(v)),c=(0,Q.cond)([[(0,Q.pipe)((0,Q.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,e=>(0,u.n_1)({entityUri:e.uri,configs:s,customerTenant:h,dataTenant:e.dataTenant,dtssPath:g})],[Q.T,e=>(0,u.N6e)(e.uri,s)]]);d(!0),y(c(l)).then((e=>{let[{connections:t,total:r}]=e;m(wt.N5.relations.actions.relationsLoaded({id:o.id,connections:t,total:r}))})).finally((()=>{d(!1)}))}}),[f,o,m,g,null==l?void 0:l.uri,null==l?void 0:l.dataTenant,r,b,n,i,a,y,t,h]),x=(0,s.useRef)(!1);x.current=!1,(0,s.useEffect)((()=>{x.current=!0,E()}),[E]);const w=(0,Qd.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||x.current||w===c||(x.current=!0,E())}),[E,c,w]),{isLoading:p,reload:E}},am=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var om=r(11326);const lm=()=>{const[e,t]=(0,s.useState)([]),r=(0,xt.useSelector)(wt.ZP.selectors.getTenant),n=(0,xt.useSelector)(wt.ZP.selectors.getServicesPath),a=e=>{console.warn("Users error",e),t([])};return(0,s.useEffect)((()=>{(0,u.kz_)({tenant:r,servicesPath:n}).then((e=>{let{array:r}=e;return t(r)})).catch(a)}),[r,n]),e};function im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sm=(e,t)=>{const r=(0,s.useRef)();(0,s.useEffect)((()=>{if(r.current){const n=Object.keys(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){im(e,t,r[t])}))}return e}({},r.current,t)),a={};n.forEach((e=>{r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e]})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,a)}r.current=t}))};var cm=r(47081),um=r(76572),pm=r(62228),dm=r(8007),mm=r(65510),hm=r(58142),gm=r(89575),fm=r(80687);const bm=c().createContext(!1);bm.displayName="ProfilePerspectiveViewContext";const ym=c().createContext("");ym.displayName="IdContext";var vm=r(63929),Em=r(3064),xm=r(38309),wm=r(10609)}}]);