@reltio/remotes 1.4.1165 → 1.4.1167

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/350.js +1 -1
  2. package/9838.js +1 -1
  3. package/package.json +1 -1
package/350.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[350],{97991:(e,t,n)=>{n.d(t,{Z:()=>u});var r,a=n(94079),l=n(71153),i=n.n(l),o=n(24328),s=n.n(o);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}!function(e){e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE"}(r||(r={}));const u=e=>{let{className:t,icon:n,avatarText:l,rootClasses:u}=e,d=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["className","icon","avatarText","rootClasses"]);const[p,m]=(0,o.useState)(null);(0,o.useEffect)((()=>{m(n?r.ICON_MODE:r.TEXT_MODE)}),[n,l]);const f=()=>{m(r.ERROR_MODE)};switch(p){case r.ICON_MODE:return s().createElement(a.Avatar,c({className:i()(t,null==u?void 0:u.iconRoot),src:n,onError:f},d));case r.TEXT_MODE:case r.ERROR_MODE:return s().createElement(a.Avatar,c({className:i()(t,null==u?void 0:u.textRoot)},d),l);default:return null}}},81727:(e,t,n)=>{n.d(t,{E:()=>m,Z:()=>f});var r=n(24328),a=n.n(r),l=n(94079),i=n(8818),o=n(61932),s=n(27291),c=n(31276),u=n(71153),d=n.n(u);const p=(0,n(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 f=e=>{let{classes:t={},tooltip:n="",onClick:r=c.ZT,mode:u=m.INIT}=e;const f=p();return a().createElement("div",{className:d()(f.root,t.root)},(()=>{switch(u){case m.INIT:return a().createElement(i.k,{className:t.button,size:"M",tooltipTitle:n,icon:o.Z,onClick:r});case m.PROGRESS:return a().createElement(l.CircularProgress,{className:t.spinner,size:24});case m.SUCCESS:return a().createElement(s.Z,{className:d()(f.check,t.check)});default:return null}})())}},82842:(e,t,n)=>{n.d(t,{Z:()=>C});var r=n(52730),a=n(59431),l=n(24328),i=n.n(l),o=n(71153),s=n.n(o),c=n(17440),u=n(81403),d=n(68439),p=n(31039),m=n(53180),f=n(81727);const h=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),y=e=>{e&&clearTimeout(e)},g=(e,t)=>{if(e&&t){const n=e.offsetTop,r=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:l}=t;return n>=0&&r>l&&r<l+a}};var b=n(20562),E=n(79692),v=n(41128);const T=(0,E.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,v.U1)(e.palette.primary.main,.12),"&:hover":{background:(0,v.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"}}))),C=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{entities:t,metadata:n,entityToHighlight:r,selectedEntityUri:a,onEntityClick:o,onEntityHover:E,entitiesImportStatus:v,entityButtonsRenderer:C}=e;const O=T(),S=(0,l.useRef)(null),A=(0,l.useRef)(null);return(0,b.D)((()=>{if(r){var e;const n=null===(e=S.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(y(A.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=S.current)||void 0===t?void 0:t.parentElement;g(n[0],e)||(h(n[0]),A.current=setTimeout((()=>{g(n[0],e)||h(n[0])}),1e3))}}return()=>{y(A.current)}}),[r]),i().createElement("div",{ref:S},(t||[]).map((e=>{const t=(0,u.idV)(e.label),l=e.secondaryLabel,h=(0,u.ptG)(n,e),y=(0,u.Fn9)(e),g=e.uri,b=(0,u.wwR)(e),T=(0,c.prop)(g,v);return i().createElement("div",{key:g,className:s()(O.item,{[O.clickable]:!!o,[O.selected]:g===a,[O.highlighted]:g===r,[O.inactive]:!y,[O.justImported]:T===f.E.SUCCESS}),onClick:o?()=>o(g):void 0,onMouseEnter:E?()=>E(g):void 0,onMouseLeave:E?()=>E(null):void 0,"data-entity-uri":g},i().createElement(m.Z,{entity:e,avatarClassName:O.avatar,imageClassName:O.image}),i().createElement("div",{className:O.info},i().createElement("div",null,i().createElement(p.Z,{value:b,className:O.label},t),l&&i().createElement("span",{className:O.secondaryLabel},l," "),h&&i().createElement("span",{className:O.businessCard},h)),i().createElement("div",{className:O.secondRow},i().createElement(d.Z,{entity:e}),i().createElement("div",null,(0,u.BTI)(e)))),C&&C(e))})))}))},20435:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(24328),a=n.n(r),l=n(13980),i=n.n(l),o=n(52730),s=n(31276),c=n(89119),u=n(8818),d=n(87918),p=n.n(d),m=n(67679);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}const h=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",f({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},a().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-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 0017 13zm0 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"})))};var y=n(7043),g=n(59431);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}const E=e=>{let{entityTypeUri:t,headColumns:n=[],onSelectColumns:l=s.ZT}=e,i=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[d,f]=(0,r.useState)(null),[E,v]=(0,r.useState)(""),T=(0,o.useSelector)(g.ZP.selectors.getMetadata),C=()=>{f(null),v("")},O=(0,r.useCallback)(((e,r)=>{const a=(0,m.kF)(T,t),i=(0,m.m5)(a,e.id);let o;o=i.length?r?n.concat(i):n.filter((e=>!i.find((t=>t.id===e.id)))):r?n.concat(e):n.filter((t=>t.id!==e.id)),l(o)}),[T,t,n,l]);return a().createElement(a().Fragment,null,a().createElement(u.k,b({tooltipTitle:p().text("Show/hide columns"),size:"M",icon:h,onClick:e=>f(e.currentTarget),className:y.Z.headerIcon},i)),(()=>{const e=(0,m.kF)(T,t);return a().createElement(c.Z,{open:!!d,anchorEl:d,data:e,onListItemClick:O,selected:n,filterText:E,onClose:C,onSearch:v})})())};E.propTypes={entityTypeUri:i().string,headColumns:i().array,onSelectColumns:i().func};const v=E},17087:(e,t,n)=>{n.d(t,{Z:()=>Ae});var r=n(24328),a=n.n(r),l=n(52730),i=n(13980),o=n.n(i),s=n(17440),c=n(45053),u=n(85709),d=n(71153),p=n.n(d),m=n(94079),f=n(43054),h=n(22385),y=n(32528);const g=e=>{let{headCellData:t,headIndex:n,sortOrder:r,sortField:l,sortHandler:i,canCheck:o,onCheck:c,headerCheckboxState:u,openConfigColumnPopup:d}=e;return a().createElement("div",{className:p()("HeadCellRenderer-styles-headCellContentWrapper--204Aj",(0,s.path)(["wrapperClassName"],t))},t&&o&&a().createElement(m.Checkbox,{className:"HeadCellRenderer-styles-checkbox--3kWo3",checked:u||!1,indeterminate:null===u,onChange:()=>c()}),a().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--3v65T"},t&&(t.sortable?a().createElement(m.TableSortLabel,{active:Boolean(r&&l===t.id),direction:r,onClick:i,classes:{root:"HeadCellRenderer-styles-sortLabel--3pCJO"},component:"div"},t.label):t.label)),d&&a().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--2WKUw"},a().createElement(h.Z,{icon:f.Z,onClick:d,size:"S","data-column-index":n})))};g.propTypes={headCellData:o().shape({id:o().string,label:o().oneOfType([o().string,o().node]),sortable:o().bool}),headIndex:o().number,sortOrder:o().string,sortField:o().string,sortHandler:o().func,canCheck:o().bool,onCheck:o().func,headerCheckboxState:o().oneOf([!0,!1,null]),openConfigColumnPopup:o().func};const b=(0,y.Z)((0,s.pick)(["openConfigColumnPopup"]))(g),E=(0,y.Z)((0,s.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(g);var v=n(81403),T=n(53180),C=n(31039);const O={popupBackdrop:"EntitiesTable-styles-popupBackdrop--1kv_-",popupContent:"EntitiesTable-styles-popupContent--2_Yic",complexPopupContent:"EntitiesTable-styles-complexPopupContent--3eaMg",highlighted:"EntitiesTable-styles-highlighted--2KGk8",highlightAnimate:"EntitiesTable-styles-highlightAnimate--31hFj",inactiveBackground:"EntitiesTable-styles-inactiveBackground--3GLxS",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--2IA7I",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--fXrDv",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--2xMPL",textOverflow:"EntitiesTable-styles-textOverflow--2r-Op",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--c704F",link:"EntitiesTable-styles-link--3M_i8",defaultWrapper:"EntitiesTable-styles-defaultWrapper--17m-1",table:"EntitiesTable-styles-table--2cYK8",imageWrapper:"EntitiesTable-styles-imageWrapper--1Mh4_",blobWrapper:"EntitiesTable-styles-blobWrapper--1lpTF",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--3K07i",referenceWrapper:"EntitiesTable-styles-referenceWrapper--2em-P",referenceContent:"EntitiesTable-styles-referenceContent--Y_vP-",referenceIcon:"EntitiesTable-styles-referenceIcon--3TGdy",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--24W5V",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--2fLKb",profileWrapper:"EntitiesTable-styles-profileWrapper--31FtH",entityAvatar:"EntitiesTable-styles-entityAvatar--1LVQ0",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--1ePjP",entityLabel:"EntitiesTable-styles-entityLabel--2Wawq",scores:"EntitiesTable-styles-scores--RoYyd",dragColumnHead:"EntitiesTable-styles-dragColumnHead--tOZC8",dragColumnBody:"EntitiesTable-styles-dragColumnBody--1F9zz",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--3LNDx",cellWrapper:"EntitiesTable-styles-cellWrapper--1-flA",entityButtons:"EntitiesTable-styles-entityButtons--uhQM9",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--1s9-b",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--3bEFw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--3KFhD"},S=e=>{let{value:t={}}=e;const n=(0,v.idV)(t.label);return a().createElement("div",{className:p()(O.defaultWrapper,O.profileWrapper)},a().createElement(T.Z,{avatarClassName:O.entityAvatar,imageClassName:O.entityAvatarImage,entity:t}),a().createElement(C.Z,{value:(0,v.wwR)(t),className:O.entityLabel},n))};S.propTypes={value:o().object};const A=S;var N=n(72768);const R=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;return a().createElement("div",{className:O.defaultWrapper},n?a().createElement(N.Z,{value:t,dataTypeDefinition:n}):t)};R.propTypes={value:o().any,columnData:o().object};const w=R;var I=n(61934),P=n(97991),F=n(59431);const _=e=>{let{value:t}=e;const n=(0,l.useSelector)(F.ZP.selectors.getMetadata);return t&&a().createElement("div",{className:p()(O.defaultWrapper,O.referenceWrapper)},a().createElement(P.Z,{className:O.referenceIcon,icon:(0,I.H)(n,t.refEntity.type)}),a().createElement(C.Z,{value:t.refEntity.objectURI,className:O.referenceContent},(0,v.idV)(t.label)))};_.propTypes={value:o().object};const k=_,D=e=>{e.stopPropagation()},x=e=>{const{value:t}=e;return a().createElement("div",{className:O.blobWrapper,onScroll:D},t)};x.propTypes={value:o().any};const j=x,H=e=>{let{value:t}=e;const n=(0,v.efz)({value:t});return n&&a().createElement("div",{className:O.imageWrapper},a().createElement("img",{src:n}))};H.propTypes={value:o().object};const L=H,M=e=>{if("label"===e.id)return A;switch((0,s.path)(["attrType","type"],e)){case"Reference":return k;case"Blob":return j;case"Image":return L}return w};function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){z(e,t,n[t])}))}return e}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const W=(0,s.split)("."),q=["entityId"],B=e=>!q.includes(e.id),Z=e=>{if((0,v.vZp)(e)){const[,...t]=W(e);return t.length>1?t.slice(0,-1):null}return null};var Y=n(81727),V=n(50646);const $=e=>{let{entity:t,isSelectedEntity:n,isHighlightedEntity:r,entityImportStatus:l,onEntityImportStatusChange:i}=e;return a().createElement("div",{className:p()(O.entityButtons,{[O.selectedEntityButtons]:n,[O.justImportedEntityButtons]:l===Y.E.SUCCESS,[O.highlightedEntityButtons]:r})},a().createElement(V.Z,{entity:t,entityImportStatus:l,onEntityImportStatusChange:i}))};$.propTypes={entity:o().object,isSelectedEntity:o().bool,isHighlightedEntity:o().bool,entityImportStatus:o().oneOf(Object.values(Y.E)),onEntityImportStatusChange:o().func};const X=(0,y.Z)(((e,t)=>{let{entitiesImportStatus:n,onEntityImportStatusChange:r,selectedEntityUri:a,highlightedEntityIndex:l}=e,{entity:i,rowIndex:o}=t;return{entityImportStatus:i&&n[i.uri],onEntityImportStatusChange:r,isSelectedEntity:a===i.uri,isHighlightedEntity:l===o}}))($);var J=n(14838),Q=n(79692),K=n(41128);function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){te(e,t,n[t])}))}return e}function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ne={height:"100%",display:"flex",flexDirection:"column"},re=(0,Q.Z)((e=>({inactiveCell:ee({background:e.inactiveBackground},ne,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:ee({background:(0,K.$n)(e.palette.primary.main,.88)},ne),clickable:ee({cursor:"pointer"},ne),justImported:ee({backgroundColor:"#FFFBEB !important"},ne)}))),ae={entity:o().object,isSelected:o().bool,onEntityClick:o().func,isJustImported:o().bool},le=(0,Q.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const ie={onCheck:o().func,isChecked:o().bool,hasCheckbox:o().bool},oe=(0,Q.Z)({collapser:{marginLeft:"-2px"}});var se=n(74566);const ce={hasCollapseButton:o().bool},ue=(0,s.pipe)((e=>{const t=t=>{const n=oe(),{hasCollapseButton:r}=t,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=l;return r?a().createElement("div",{className:"cellWithCollapser"},a().createElement(se.Z,{className:n.collapser,rowIndex:o,rowValue:i}),a().createElement(e,l)):a().createElement(e,l)};return t.propTypes=ce,t}),(e=>{const t=t=>{const n=le(),{onCheck:r,isChecked:l,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:s}}=o;return i?a().createElement("div",{className:p()(n.checkboxWrapper,"cellWithCheckbox")},a().createElement(m.Checkbox,{className:n.checkbox,checked:l,onClick:e=>e.stopPropagation(),onChange:e=>r(s.uri,e.target.checked)}),a().createElement(e,o)):a().createElement(e,o)};return t.propTypes=ie,t}),(e=>{const t=t=>{const n=re(),{rowValue:{rawValue:r},isSelected:l,onEntityClick:i,isJustImported:o}=t,s=i?()=>i(r.uri):void 0,c=r&&!(0,v.Fn9)(r);return s||c||l||o?a().createElement("div",{className:p()({[n.inactiveCell]:c},{inactiveCell:c},{[n.selectedRowCell]:l},{selectedRowCell:l},{[n.clickable]:!!s},{[n.justImported]:o},{justImported:o}),onClick:s},a().createElement(e,t)):a().createElement(e,t)};return t.propTypes=ae,t}),(0,y.Z)(((e,t)=>{let{onEntityClick:n,selectedEntityUri:r,entitiesImportStatus:a,canCheck:l,onCheck:i,checkedEntitiesUris:o}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,d=0===c;return{onCheck:i,isChecked:o&&o.includes(u.uri),hasCheckbox:l&&d,hasCollapseButton:d,isSelected:r===u.uri,isJustImported:a[u.uri]===Y.E.SUCCESS,onEntityClick:n}})))(J.Z),de=e=>{let{columnData:t,cell:n}=e;const r=n.values.length,a=28*Math.max(r,1)+20;if(!r)return a;switch((0,s.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return a}},pe=(0,r.forwardRef)(((e,t)=>{let{headColumns:n,entities:i,entityToHighlight:o,selectedEntityUri:d,onReorderingColumn:p,dndColumnReorderingEnabled:m,columnsSize:f,onChangeColumnsSize:h,onScroll:y,onSort:g,sortField:T,sortOrder:C,onEntityHover:S,onEntityClick:A,entitiesImportStatus:N,onEntityImportStatusChange:R,logger:w,canCheck:I,checkedEntitiesUris:P,headerCheckboxState:_,onCheck:k,openConfigColumnPopup:D}=e;const x=(0,r.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:O.dragColumnHead,dragColumnBody:O.dragColumnBody,draggableHeadCell:O.draggableHeadCell,cellWrapper:O.cellWrapper})),[]),j=(0,l.useSelector)(F.ZP.selectors.getMetadata),[H,L]=(0,r.useState)(null),z=(0,r.useCallback)((e=>{L(e),S&&S((0,s.path)([e,"uri"],i))}),[S,i]),q=(0,r.useRef)();(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{q.current&&q.current.resetScrollbarPosition({resetLeft:!1})}})));const Y=(0,r.useCallback)((e=>{C&&e===T?C===c.SORT_DIRECTION_ASC?g({field:e,order:c.SORT_DIRECTION_DESC}):g({field:e}):g({field:e,order:c.SORT_DIRECTION_ASC})}),[g,T,C]),V=(0,r.useCallback)((e=>{const t=(0,s.prop)(e,i);return t?a().createElement(X,{entity:t,rowIndex:e}):null}),[i]),$=(0,r.useCallback)((e=>a().createElement(ue,e)),[]),J=!!S,Q=!!g,K=(0,r.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,n)=>{let{attrType:r}=e,a=G(e,["attrType"]);const l=0===n;return U({},a,{dataTypeDefinition:r&&(0,v.PFL)(r),resizable:!0,autoResize:!l,draggable:!l,sortable:t&&B(a),nestedPath:Z(a.id),headCellRenderer:l?E:b,rowCellValueRenderer:M(U({},a,{attrType:r}))})}))}(n,Q)),[n,Q]),ee=(0,r.useMemo)((()=>((e,t,n)=>n.map((e=>(0,s.pipe)((0,s.reduce)(((t,n)=>(0,s.assoc)(n.id,((e,t,n)=>{switch(t.id){case"label":return n;case"entityId":return(0,v.BTI)(n);default:{const[e,...r]=W(t.id);return(0,s.pipe)((0,s.prop)(e),(0,v.tT_)(r))(n)}}})(0,n,e),t)),{}),(0,s.assoc)("rawValue",e))(t))))(0,n,i)),[j,n,i]),te=o?i.findIndex((0,s.propEq)("uri",o)):-1,ne=(0,r.useMemo)((()=>({onEntityClick:A,selectedEntityUri:d,highlightedEntityIndex:te,entitiesImportStatus:N,onEntityImportStatusChange:R,canCheck:I,checkedEntitiesUris:P,headerCheckboxState:_,onCheck:k,openConfigColumnPopup:D})),[P,N,_,te,I,k,A,R,d,D]);return a().createElement(u.Z,{fixFirstColumn:!0,onScroll:y,rowsData:ee,columnsData:K,onSort:Y,highlightRow:-1!==te?te:null,ref:q,sortFieldClassName:O.sortableCell,containerClassName:O.table,classes:x,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:T,order:C},dndColumnReorderingHandler:p,dndColumnReorderingEnabled:m,onChangeColumnsSize:h,columnsSize:f,resizeDebounceDelay:150,onRowHover:J?z:void 0,hoverStateEnabled:J,hoverRowIndex:H,renderRowOverlay:V,logger:w,context:ne,maxRowValuesCount:2,renderRowCell:$,getRowCellHeight:de})}));pe.propTypes={entities:o().array,entityToHighlight:o().string,selectedEntityUri:o().string,headColumns:o().array,columnsSize:o().array,onScroll:o().func,onSort:o().func,onReorderingColumn:o().func,onChangeColumnsSize:o().func,dndColumnReorderingEnabled:o().bool,onEntityClick:o().func,onEntityHover:o().func,sortField:o().string,sortOrder:o().oneOf([c.SORT_DIRECTION_ASC,c.SORT_DIRECTION_DESC]),entitiesImportStatus:o().object,onEntityImportStatusChange:o().func,logger:o().func,canCheck:o().bool,checkedEntitiesUris:o().arrayOf(o().string),headerCheckboxState:o().oneOf([!0,!1,null]),onCheck:o().func,openConfigColumnPopup:o().func},pe.defaultProps={entities:[],headColumns:[]},pe.displayName="EntitiesTable";const me=(0,r.memo)(pe);var fe=n(89119),he=n(87918),ye=n.n(he);const ge="left",be="right",Ee="hide",ve={[ge]:ye().text("Insert 1 left"),[be]:ye().text("Insert 1 right"),[Ee]:ye().text("Hide column")},Te=e=>{let{open:t,anchorEl:n,onClick:r,onClose:l,actions:i}=e;return a().createElement(m.Popover,{open:t,anchorEl:n,onClose:l},a().createElement(m.List,{component:"div"},i.map(((e,t)=>((e,t,n)=>a().createElement(m.ListItem,{button:!0,component:"div",key:n,onClick:t},a().createElement(m.ListItemText,{primary:ve[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))))};Te.propTypes={open:o().bool,anchorEl:o().any,onClick:o().func,onClose:o().func,actions:o().array};const Ce=Te;var Oe=n(55639);class Se extends a().PureComponent{constructor(){super(...arguments),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:n,headColumns:r}=this.props,a=r.slice();a.splice(t,0,e),n({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case ge:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case be:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case Ee:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:n}=this.props,r=n.slice();r.splice(e,1),t({columns:r}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,s.memoizeWith)(Se.getMemoIdForColumnSize,Se.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t,n){return`${n}${t}${(0,s.toString)(e.map((e=>(0,s.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:n,onScroll:r,headColumns:l,sortField:i,sortOrder:o,dndColumnReorderingEnabled:s,onEntityClick:c,onEntityHover:u,entitiesTableRef:d,additionalColumns:p,onChangeColumnsList:m,onReorderingColumn:f,onSort:h,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:b={},onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:C,headerCheckboxState:O,onCheck:S}=this.props,{addColumnPopupOpen:A,configColumnPopupOpen:N,popupAnchor:R,filterText:w,configurableColumnIndex:I}=this.state,P=this.memoizedGetColumnSize(l,g,(0,Oe.Lt)());return a().createElement(a().Fragment,null,a().createElement(me,{entities:e,entityToHighlight:t,selectedEntityUri:n,onScroll:r,onSort:h,onEntityClick:c,onEntityHover:u,headColumns:l,sortField:i,sortOrder:o,onReorderingColumn:f,ref:d,onChangeColumnsList:m,dndColumnReorderingEnabled:s,onChangeColumnsSize:y,columnsSize:P,entitiesImportStatus:b,onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:C,headerCheckboxState:O,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup}),a().createElement(fe.Z,{open:A,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:w,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:he.text("Add column")}),a().createElement(Ce,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:N,actions:I>0?[ge,be,Ee]:[be]}))}}Se.propTypes={entities:o().array,entityToHighlight:o().string,selectedEntityUri:o().string,entityTypeUri:o().string,headColumns:o().array,dndColumnReorderingEnabled:o().bool,onScroll:o().func,onSort:o().func,onReorderingColumn:o().func,onChangeColumnsSize:o().func,onChangeColumnsList:o().func,onEntityClick:o().func,onEntityHover:o().func,sortField:o().string,sortOrder:o().oneOf([c.SORT_DIRECTION_ASC,c.SORT_DIRECTION_DESC]),entitiesTableRef:o().shape({current:o().shape({resetScrollbarPosition:o().func})}),additionalColumns:o().arrayOf(o().shape({id:o().string,label:o().string})),entitiesImportStatus:o().object,onEntityImportStatusChange:o().func,logger:o().func,canCheck:o().bool,checkedEntitiesUris:o().arrayOf(o().string),headerCheckboxState:o().oneOf([!0,!1,null]),onCheck:o().func};const Ae=Se},50646:(e,t,n)=>{n.d(t,{Z:()=>E});var r=n(24328),a=n.n(r),l=n(52730),i=n(13980),o=n.n(i),s=n(59431),c=n(81403),u=n(86564),d=n(81727),p=n(87918),m=n.n(p),f=n(17440);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}const y=e=>{let{entity:t,importStatus:n,onImportStatusChange:r,hideDelay:i=3e3}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const p=(0,l.useSelector)(s.ZP.selectors.getDtssPath),f=(0,l.useSelector)(s.ZP.selectors.getTenant);return a().createElement(d.Z,h({},o,{mode:n,tooltip:m().text("Import this record"),onClick:e=>{e.stopPropagation(),r(d.E.PROGRESS),(0,c.WF)({dtssPath:p,customerTenant:f,entity:t}).then((e=>{let{success:n,uris:a}=e;if(!n)throw new Error("Failed to import entity");t.ctSubscribedUris=a,r(d.E.SUCCESS),setTimeout((()=>r(d.E.DONE)),i)})).catch((()=>{r(d.E.INIT),(0,u.eX)()}))}}))};y.propTypes={entity:c.pyR,importStatus:o().oneOf((0,f.values)(d.E)),onImportStatusChange:o().func,hideDelay:o().number};const g=y,b=(0,n(79692).Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),E=e=>{let{entity:t,entityImportStatus:n,onEntityImportStatusChange:r}=e;const i=b(),o=(0,l.useSelector)(s.ZP.selectors.getMetadata),u=(0,l.useSelector)(s.ZP.selectors.getCanUserImportEntitiesFromDT),p=(0,c.biM)(t)&&u,m=(0,c.nt9)(o,t.type),f=(0,c.Nxd)(m)&&!(0,c.aBi)(t),h=n&&n!==d.E.DONE||f;return a().createElement(a().Fragment,null,p&&a().createElement("div",{className:i.importButtonPlaceholder},h&&a().createElement(g,{entity:t,importStatus:n,onImportStatusChange:e=>r(t.uri,e)})))}},31651:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(24328),a=n.n(r),l=n(13980),i=n.n(l),o=n(71153),s=n.n(o),c=n(79692),u=n(81403);const d=(0,c.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[u.Tl4.entityTypeLabel]:{color:"#03904A"},[u.Tl4.attributeLabel]:{color:"#059BEA"},[u.Tl4.specialAttributeLabel]:{color:"#EA05CF"},[u.Tl4.attributeFilter]:{color:"#7F00FF"},[u.Tl4.attributeValue]:{color:"#000000"}})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const m=(0,r.forwardRef)(((e,t)=>{let{readableQuery:n=[],className:r}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["readableQuery","className"]);const i=d();return a().createElement("span",p({ref:t,className:s()(i.query,r)},l),n.map(((e,t)=>{let{type:n,text:r}=e;return a().createElement("span",{key:t,className:i[n]},r)})))}));m.displayName="ReadableSearchQuery",m.propTypes={readableQuery:i().array,className:i().string};const f=m},19492:(e,t,n)=>{n.d(t,{Z:()=>r});const r={CREATE_FACETS:"FACETS_CREATE_FACETS",DESTROY_FACETS:"FACETS_DESTROY_FACETS",CHANGE_VALUES:"FACETS_CHANGE_VALUES",CLEAR_ALL_VALUES:"FACETS_CLEAR_ALL_VALUES",UPDATE_DATA:"FACETS_UPDATE_DATA",UPDATE_FILTERED_DATA:"FACETS_UPDATE_FILTERED_DATA",DESTROY_FILTERED_DATA:"FACETS_DESTROY_FILTERED_DATA",FILTER_FACET_DATA:"FACETS_FILTER_FACET_DATA",HANDLE_CONFIGS_CHANGES:"FACETS_HANDLE_CONFIGS_CHANGES",REQUEST_GIVEN_FACETS_DATA:"FACETS_REQUEST_GIVEN_FACETS_DATA",SET_RECOMMENDED_FACETS_LIST:"FACETS_SET_RECOMMENDED_FACETS_LIST",CONVERT_FROM_ADVANCED_SEARCH:"FACETS_CONVERT_FROM_ADVANCED_SEARCH",SHOW_MORE_ENTITY_TYPES:"FACETS_SHOW_MORE_ENTITY_TYPES",HIGHLIGHT_ADDED_FACETS:"FACETS_HIGHLIGHT_ADDED_FACETS",CLEAR_HIGHLIGHT_ADDED_FACETS:"FACETS_CLEAR_HIGHLIGHT_ADDED_FACETS"}},87861:(e,t,n)=>{n.d(t,{Z:()=>r});const r={UPDATE_ENTITIES:"SEARCH_UPDATE_ENTITIES",UPDATE_URL:"SEARCH_UPDATE_URL",CLEAR_RESULTS:"SEARCH_CLEAR_RESULTS",REFRESH_DISPLAYED_ENTITIES:"SEARCH_REFRESH_DISPLAYED_ENTITIES",REFRESH:"SEARCH_REFRESH",CLEAR_ALL:"SEARCH_CLEAR_ALL",SHOW_MORE_RESULTS_FOR_ENTITY_TYPE:"SEARCH_SHOW_MORE_RESULTS_FOR_ENTITY_TYPE",UPDATE_TOTAL:"SEARCH_UPDATE_TOTAL",CHANGE_PAGE:"SEARCH_CHANGE_PAGE",RESET_PAGE:"SEARCH_RESET_PAGE",CHANGE_ROWS_PER_PAGE:"SEARCH_CHANGE_ROWS_PER_PAGE",CHANGE_SORT:"SEARCH_CHANGE_SORT",CHANGE_LOADING:"SEARCH_CHANGE_LOADING",MAP_CHANGE_VALUE:"SEARCH_MAP_CHANGE_VALUE",STATE_UPDATED:"SEARCH_STATE_UPDATED",EXPORT_RESULTS:"SEARCH_EXPORT_RESULTS",OPEN_DATA_LOADER:"SEARCH_OPEN_DATA_LOADER",CHANGE_CURRENT_TENANT:"SEARCH_CHANGE_CURRENT_TENANT"}},24097:(e,t,n)=>{n.d(t,{Jf:()=>i,Tu:()=>o,GB:()=>s,nq:()=>c,q7:()=>u,FR:()=>d,ll:()=>p,cp:()=>m,om:()=>f,cu:()=>h,Gn:()=>y,YL:()=>g,qx:()=>b,uJ:()=>E,ib:()=>v,KY:()=>T,PW:()=>C,rX:()=>O,m2:()=>S,GT:()=>A,mL:()=>N,wP:()=>R,XU:()=>w,v6:()=>I,dV:()=>P,Vh:()=>F,WN:()=>_,KJ:()=>k,pG:()=>D,DY:()=>x,hS:()=>j,Vp:()=>H,E_:()=>L,Tv:()=>M});var r=n(87918),a=n.n(r),l=n(17440);const i="explorer",o=[25,50,100],s=0,c=1e4,u=(()=>{const e=new Date;return e.setHours(0,0,0,0),e.setFullYear(e.getFullYear()-1)})(),d=(new Date).setHours(0,0,0,0),p={TABLE:"table",LIST:"list",MAP:"map"},m=p.TABLE,f={PROFILE:"profile",MAP:"map"},h=20,y=[{label:"And",value:"and"},{label:"Or",value:"or"},{label:"And not",value:"and not"},{label:"Or not",value:"or not"}],g=y[0],b=y[1],E={saved:"saved",recent:"recent"},v={public:"public",private:"private"},T={name:"name",updateDate:"updateDate"},C={[T.name]:"NAME",[T.updateDate]:"UPDATE_DATE"},O={ASC:"asc",DESC:"desc"},S=[{label:a().text("Only me"),value:v.private},{label:a().text("All users"),value:v.public}],A={info:"info",error:"error"},N={pmRulesScope:"ML_RULES_ONLY"},R=7,w=300,I={include:"include",exclude:"exclude"},P={UpdateProfiles:"UpdateProfiles",DeleteProfiles:"DeleteProfiles"},F={AddNew:"AddNew",Clear:"Clear",ReplaceAllWith:"ReplaceAllWith",FindAndReplace:"FindAndReplace",FindAndRemove:"FindAndRemove",RepointReference:"RepointReference"},_={[F.AddNew]:a().text("Add new"),[F.Clear]:a().text("Clear attribute"),[F.ReplaceAllWith]:a().text("Replace all with"),[F.FindAndReplace]:a().text("Find and replace"),[F.FindAndRemove]:a().text("Find and remove"),[F.RepointReference]:a().text("Repoint reference")},k={[F.AddNew]:["attributeValue"],[F.Clear]:[],[F.ReplaceAllWith]:["attributeValue"],[F.FindAndReplace]:["attributeValue","attributeValueToFind"],[F.FindAndRemove]:["attributeValueToFind"],[F.RepointReference]:["attributeValue"]},D=(0,l.pipe)(l.values,(0,l.without)(F.RepointReference))(F),x=[F.AddNew,F.Clear,F.ReplaceAllWith],j=[F.AddNew,F.Clear,F.RepointReference],H={AddAttribute:"AddAttribute",UpdateAttribute:"UpdateAttribute",DeleteAttribute:"DeleteAttribute",RepointReferencedEntity:"RepointReferencedEntity",AddTags:"AddTags",ReplaceTag:"ReplaceTag",DeleteTags:"DeleteTags",ClearTags:"ClearTags"},L="referenced_entity_id",M=["uri","label","type","secondaryLabel","defaultProfilePic","defaultProfilePicValue","attributes.Address","attributes.GeoLocation","attributes.ImageGallery"]},78088:(e,t,n)=>{n.r(t),n.d(t,{PROP_NAME_OPERATOR:()=>d,PROP_NAME_VALUES:()=>p,PROP_NAME_FILTER:()=>m,getEmptyAttributeObject:()=>f,getAttributeObject:()=>h,getAttributeData:()=>y,defaultFindGroupPath:()=>g,createGetGroupLens:()=>b,createGetAttributesLens:()=>E,createGetAttributeIndex:()=>v,createGetAttributeLens:()=>T,createSetAttributeProp:()=>C,createGetAttributeProp:()=>O,addAttributeAfter:()=>S,changeAttributeData:()=>A,setAttributeOperator:()=>N,deleteAttribute:()=>R,duplicateAttribute:()=>w,setFilter:()=>I,setValues:()=>P});var r=n(17440),a=n(58697),l=n.n(a),i=n(81403),o=n(24097),s=n(19672);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d="operator",p="values",m="filter",f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l()();return{[d]:o.YL.value,id:e}},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l()();const n=y(e);return{data:n,[d]:o.YL.value,[m]:(0,r.pathOr)("",["filterOptions",0],n),id:t}},y=e=>c({},e,{filterOptions:e.enforcedFilterOptions||(0,i.d3Y)(e.attrType,e.fieldName)}),g=(0,r.curry)(((e,t)=>{const n=t.findIndex((t=>t.id===e));return n>-1?[n]:null})),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;return(n,r)=>{const a=(0,s.ET)(...e).get(n),l=t(r,a);return!!l&&(0,s.ET)(...e,...l)}},E=(e,t)=>(n,r)=>{const a=e(n,r);return a&&a.compose((0,s.Ic)(t))},v=e=>(t,n,r)=>{const a=e(t,n);return a?a.get(t).findIndex((e=>e.id===r)):-1},T=e=>(t,n,r)=>{const a=e(t,n),l=v(e)(t,n,r);return-1!==l?a.compose((0,s.ET)(l)):null},C=e=>(t,n,r,a,l)=>{const i=e(t,n,r);if(i){const e=c({},i.get(t));return e[a]=l,i.set(t,e)}return t},O=e=>(t,n,r,a)=>{const l=e(t,n,r);if(l)return l.get(t)[a]},S=e=>{let{state:t,groupId:n,attributeId:r,attribute:a,getAttributesLens:l,getAttributeIndex:i}=e;const s=l(t,n);if(s){let e=[...s.get(t)];const l=i(t,n,r),u=!e[l+1];return-1!==l&&u?e.splice(l+1,0,a):-1!==l?(e.splice(l+1,0,c({},a,{operator:e[l].operator})),e[l]=c({},e[l],{operator:o.YL.value})):e.push(a),s.set(t,e)}return t},A=e=>{let{state:t,groupId:n,attributeId:r,attributeData:a,setAttributeProp:l,getAttributeLens:i}=e,o=t;if(a)return((e,t,n,r,a)=>{const l=a(e,t,n);let i;return l&&(i=l.get(e).filter),r.filterOptions.length&&(!i||!r.filterOptions.includes(i))})(t,n,r,a,i)&&(o=l(t,n,r,m,a.filterOptions[0])),o=l(o,n,r,p,[]),l(o,n,r,"data",a);{const e=i(t,n,r);return e&&(o=e.set(o,f(r))),o}},N=e=>{let{state:t,groupId:n,attributeId:r,operator:a,setAttributeProp:l}=e;return l(t,n,r,d,a)},R=e=>{let{state:t,groupId:n,attributeId:a,getAttributesLens:l}=e;const i=l(t,n);if(i){const e=[...i.get(t)],n=e.findIndex((e=>e.id===a));if(n>-1){const a=(0,r.remove)(n,1,e),l=a[n-1],o=e[n];return l&&(a[n-1]=c({},l,{operator:o.operator})),i.set(t,a)}}return t},w=e=>{let{state:t,groupId:n,attributeId:r,id:a,getAttributesLens:l}=e;const i=l(t,n);if(i){const e=[...i.get(t)],n=e.findIndex((e=>e.id===r));if(n>-1)return e.push(c({},e[n],{id:a})),i.set(t,e)}return t},I=e=>{let{state:t,groupId:n,attributeId:r,filter:a,getAttributeProp:l,setAttributeProp:o}=e;const s=l(t,n,r,m),c=(0,i._26)(s,a)?t:o(t,n,r,p,[]);return o(c,n,r,m,a)},P=e=>{let{state:t,groupId:n,attributeId:r,values:a,setAttributeProp:l}=e;return l(t,n,r,p,a)}},81802:(e,t,n)=>{n.r(t),n.d(t,{toggleQueryBuilderAttributeSelect:()=>i});var r=n(90371),a=n(17440),l=n(78088);function*i(e){let{groups:t,findGroupPath:n=l.defaultFindGroupPath,attributesPropName:i,groupId:o,attributeId:s,selectInfo:c,actions:u}=e;const{checked:d,attribute:p,index:m,selectedAttributes:f}=c,{addAttributeAfter:h,changeAttribute:y,clearAttribute:g,deleteAttribute:b}=u,E=(0,a.pipe)(n(o),(0,a.path)(a.__,t),(0,a.propOr)([],i))(t),v=e=>(0,a.path)([e,"id"],E),T=E.findIndex((0,a.propEq)("id",s));if(s&&0===m)if(d)yield(0,r.gz)(y(o,s,p));else{let e=f[m+1];e?(yield(0,r.gz)(y(o,s,e)),yield(0,r.gz)(b(o,v(T+1)))):yield(0,r.gz)(g(o,s))}else{const e=f.length-m,t=s?T+m:E.length-e;d?yield(0,r.gz)(h(o,v(t-1),p)):yield(0,r.gz)(b(o,v(t)))}}},61934:(e,t,n)=>{n.d(t,{H:()=>l});var r=n(81403),a=n(28527);const l=(e,t)=>{return n=(0,r.XH8)(e,{type:t}),(0,r.vPL)((0,a.al)()||(0,a.cN)(),n);var n}},578:(e,t,n)=>{n.d(t,{o:()=>A,nT:()=>N,Yg:()=>R,zH:()=>w});var r=n(87918),a=n.n(r),l=n(81403),i=n(26507),o=n(17440);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.pipe)(o.values,(0,o.map)((e=>({title:e.label,fieldName:e.name,type:e.type,faceted:e.faceted,hideForDataTenant:e.hideForDataTenant})))),d={id:"entity",title:a().text("Entity"),attributes:u(l.xPW)},p={id:"workflow",title:a().text("Workflow"),attributes:u(l.iP_)},m={id:"collaborationItems",title:a().text("Collaboration Items"),attributes:u(l.eWf)},f={id:"RDMItems",title:a().text("Reference Data Management"),attributes:u(l.lwr)},h={id:"auditItems",title:a().text("Audit Items"),attributes:u(l.PEf)},y={id:"potentialMatches",title:a().text("Potential Matches"),attributes:u(l.C68)},g={id:"crosswalksItems",title:a().text("Crosswalks Items"),attributes:u((0,o.omit)(["sourceTable"],l.G39))},b=()=>d,E=()=>p,v=()=>m,T=()=>f,C=()=>h,O=e=>e?(0,o.evolve)({attributes:(0,o.concat)(o.__,e.map((e=>s({},y.attributes.find((0,o.propEq)("fieldName",l.C68.matches.name)),{dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant"}))))},y):y,S=()=>g,A=e=>{let{title:t,fieldName:n,dataTenant:r,fieldNameForRequest:a,dataTenantFieldName:l}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["title","fieldName","dataTenant","fieldNameForRequest","dataTenantFieldName"]);return s({title:t,fieldName:n,attrType:o},o.faceted?{pageSize:(0,i.OY)(o),orderType:(0,i.nd)(o)}:{},r?(0,i.sW)({dataTenant:r,fieldNameForRequest:a,dataTenantFieldName:l,originalTitle:t}):{})},N=(e,t,n)=>n&&n.length?{id:e,title:t,attributes:n}:null,R=function(){let{attributesFilter:e=o.T,dataTenants:t,canUserReadWorkflowDataTask:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=t=>{let{id:n,title:r,attributes:a}=t;return N(n,r,a.map(A).filter(e))},a=[b(),...n?[E()]:[],v(),T(),C(),O(t),S()];return a.map(r).filter(o.identity)},w=(e,t,n)=>{const r=R({dataTenants:t,canUserReadWorkflowDataTask:n}).find((t=>t.attributes.find((t=>t.fieldName===e))));return r&&r.attributes.find((t=>t.fieldName===e))}},26507:(e,t,n)=>{n.d(t,{TG:()=>I,Km:()=>w,Y2:()=>N,NG:()=>A,sW:()=>g,YU:()=>y,LG:()=>P,Q9:()=>E,vf:()=>R,jj:()=>S,nd:()=>T,OY:()=>v});var r=n(17440),a=n(36631),l=n(87918),i=n.n(l),o=n(24328),s=n.n(o);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u=n(68973),d=n(24097),p=n(81403),m=n(578);function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y=(e,t)=>f({title:e.label,fieldName:e.name,type:(0,p.CY1)(e),attrType:{type:e.type,singleValue:e.singleValue,hideForDataTenant:e.hideForDataTenant,faceted:!0}},t),g=e=>{let{dataTenant:t,fieldNameForRequest:n,dataTenantFieldName:r,originalTitle:a}=e;return{fieldName:(0,p.CSV)(n,t.id),fieldNameForRequest:n,dataTenant:t.id,dataTenantFieldName:r,title:`${t.label} ${a}`}},b=[{attribute:y(p.lD1.matchRules,{pageSize:d.cu,orderType:"reversedCount"}),check:p.Ir},{attribute:y(p.lD1.MLRecommendedMatch,{fieldNameForRequest:"matchRules",pageSize:d.cu,orderType:"reversedCount",LogoIcon:e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return s().createElement("svg",c({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),s().createElement("defs",null,s().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"svg1842926308b"},s().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),s().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),s().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"svg1842926308d"},s().createElement("stop",{stopColor:"#FFF",offset:"0%"}),s().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),s().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"svg1842926308g"},s().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:"0",offset:"0%"}),s().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),s().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"svg1842926308i"},s().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),s().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),s().createElement("path",{d:"M.228 8.25l4.055-7.007C4.579.727 5.709.074 6.425.009L14.48.001c.633-.03 1.853.635 2.236 1.3l3.934 6.812c.398.69.345 2.074-.017 2.765l-3.868 6.685c-.472.64-1.77 1.39-2.446 1.416l-7.767.008c-.689-.033-1.992-.72-2.345-1.332L.232 10.769c-.338-.585-.278-1.938-.004-2.519z",id:"svg1842926308a"}),s().createElement("path",{d:"M1.389 8.38l3.589-6.202c.262-.457 1.263-1.033 1.898-1.09h7.143c.56-.026 1.643.565 1.984 1.153l3.494 6.037c.353.611.308 1.837-.012 2.449l-3.424 5.916c-.418.567-1.569 1.23-2.168 1.252H7.006c-.61-.03-1.766-.64-2.08-1.182L1.395 10.61c-.3-.518-.249-1.717-.006-2.23z",id:"svg1842926308c"}),s().createElement("path",{d:"M.124 0l-.161-.002c3.374 0 6.11 2.727 6.11 6.092 0 3.279-2.974 4.316-2.974 7.123a.84.84 0 01-.84.838H.123V8.623a1.75 1.75 0 000-3.437V0z",id:"svg1842926308e"}),s().createElement("path",{d:"M5.92 0l-.012 5.154-.132.006A1.75 1.75 0 005.9 8.654l-.012 5.409H3.486c-.237-.07-.4-.155-.489-.254-.089-.098-.17-.284-.242-.557l-.291-1.341a2.084 2.084 0 00-.12-.344 1.507 1.507 0 00-.187-.267L.25 8.796a1.032 1.032 0 01-.201-.293 1.277 1.277 0 01-.048-.38V3.917a.522.522 0 01.027-.22.562.562 0 01.147-.172L3.546.111a.456.456 0 01.11-.088A.345.345 0 013.784 0h2.136z",id:"svg1842926308h"})),s().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},s().createElement("g",null,s().createElement("g",{transform:"translate(1.5 .75)"},s().createElement("use",{fill:"url(#svg1842926308b)",xlinkHref:"#svg1842926308a"}),s().createElement("use",{fill:"url(#svg1842926308d)",opacity:".5",xlinkHref:"#svg1842926308c"})),s().createElement("g",{transform:"translate(8.707 3.846)"},s().createElement("rect",{fill:"#363636",x:"1.932",y:"16.593",width:"2.644",height:"2.895",rx:"1.322"}),s().createElement("path",{d:"M6.018 14.845v2.367c0 .9-.743 1.629-1.66 1.629H2.27c-.917 0-1.66-.73-1.66-1.63v-2.366l.004-.095h5.401c.002.031.003.063.003.095z",fill:"#717171"}),s().createElement("path",{d:"M5.168 17.15c0 .9-.618 1.63-1.38 1.63H2.049c-.762 0-1.38-.73-1.38-1.63v-2.37h4.5v2.37z",fill:"#828282"}),s().createElement("path",{d:"M5.939 17.28a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.376a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.375a.5.5 0 010 1H.569a.5.5 0 110-1h5.37z",fill:"#B1B1B1"}),s().createElement("path",{d:"M3.125 17.28v1h-2v-1h2zm0-1.376v1h-2v-1h2zm0-1.375v1h-2v-1h2z",fill:"#C5C5C5"}),s().createElement("g",{transform:"translate(3.375)"},s().createElement("mask",{id:"svg1842926308f",fill:"#fff"},s().createElement("use",{xlinkHref:"#svg1842926308e"})),s().createElement("use",{fill:"#FFD44B",xlinkHref:"#svg1842926308e"}),s().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFD347",mask:"url(#svg1842926308f)"}),s().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFDE72",mask:"url(#svg1842926308f)"}),s().createElement("path",{d:"M1.496 6.08c.02-.896.936-1.336 1.732-.85.906.553.507 2.04-.592 2.069H2.199l-.576 7.012-.75-.032.552-6.406.023-.574H.124v-.75h1.354l.017-.448v-.02zm1.342-.21c-.318-.193-.58-.072-.592.221l-.001.036-.016.422h.373c.357 0 .5-.493.252-.668l-.016-.01z",fill:"#F3BE13",mask:"url(#svg1842926308f)"}),s().createElement("ellipse",{fill:"url(#svg1842926308g)",mask:"url(#svg1842926308f)",cx:"-.236",cy:"6.031",rx:"4.567",ry:"4.583"})))),s().createElement("g",null,s().createElement("g",{transform:"translate(5.706 3.846)"},s().createElement("mask",{id:"svg1842926308j",fill:"#fff"},s().createElement("use",{xlinkHref:"#svg1842926308h"})),s().createElement("use",{fill:"url(#svg1842926308i)",xlinkHref:"#svg1842926308h"}),s().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:".5",mask:"url(#svg1842926308j)",d:"M4.78 1.404v.75h-.444L1.56 4.93H-.706v-.75H1.25l2.775-2.776zM3.21 5.097l1.725 1.725H6.25v.75H4.625L2.68 5.628zM6.664 3.53v.75H4.958l-.492.53-.55-.51.714-.77zM1.781 6.53l2.565 2.564h.462v.75h-.773L1.47 7.28H-.08v-.75zM2.67 10.53h1.118L5.05 11.79h2.094v.75H4.74L3.477 11.28z"}))),s().createElement("circle",{fill:"#008FD8",cx:"11.75",cy:"10.75",r:"1.125"})))}}),check:p.XQO}],E=(0,r.curry)(((e,t)=>{const n=b.reduce(((e,n)=>{let{attribute:r,check:a}=n;return a(t)&&e.push(f({},r,{entityTypeUri:t.uri})),e}),[]),a=(e||[]).flatMap((e=>n.filter((0,r.propEq)("fieldName",p.lD1.matchRules.name)).map((t=>f({},t,g({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matchRules",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:t.title}))))));return n.concat(a)})),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return 1;default:return d.cu}},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return"reversedTerm";default:return"reversedCount"}},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return!0;default:return!1}},O=(0,r.curry)(((e,t)=>(0,p.YkM)(t)?(0,p.EUG)(e,t).some(O(e)):!!t.faceted)),S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(e.children?e.children.concat(e.children.map(S)).flat(1/0):[]).filter((0,r.complement)(r.isEmpty))},A=function(e,t,n,r,a){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];const i=f({},a(e,t,n,r,l),{uri:t.uri}),o=t.children?t.children.map((r=>A(e,r,n,"",a,l.concat({name:t.name,label:t.label})))):[];return o.length&&(i.children=o),i},N=(e,t,n,a,l)=>{const i=(0,p.jFi)(e,{type:n}),o=t.label||t.name;return{title:o,pathToTitle:Array.isArray(l)?[i,...(0,r.chain)((0,r.prop)("label"),l),o]:[i,o],fieldName:a||(0,u.$9)(t.uri,l),entityTypeUri:n,attrType:t,pageSize:v(t),orderType:T(t),isComplex:(0,p.YkM)(t),disableIncludeFilter:C(t)}},R=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,p.k66)(e,t,(0,r.either)((0,r.always)(!n),O(e)))},w=(0,a.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,l=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0;const s=e=>t.includes(e),c=()=>i,u=()=>(0,r.propEq)("length",1,t),{entityTypes:d}=e;return d.filter(p.oDv).filter((0,r.anyPass)([(0,r.always)(!t.length),(0,r.allPass)([c,u,(0,r.propEq)("uri",t[0])]),(0,r.allPass)([(0,r.complement)(c),(0,r.pipe)((0,r.prop)("uri"),s)])])).map((t=>{const r=(0,p.jFi)(e,{type:t.uri}),i=E(o,t).concat(R(e,t,l).map((n=>A(e,n,t.uri,"",a))));return i.length?n(t.uri,r,i):null})).filter(r.identity)})),I=(0,a.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.T,a=arguments.length>3?arguments[3]:void 0;if(0===t.length)return w(e,void 0,m.nT,N,!1,!0,a);const l=[],o=t.length>1?(0,p.Ug0)(e,t):t[0];if(o){const r=(0,p.nt9)(e,o),s=t.length>1?i().text("Attributes"):(0,p.jFi)(e,{type:r.uri}),c=E(a,r).filter(n).concat(R(e,r,!1).map((t=>A(e,t,r.uri,"",N))));c.length&&l.push((0,m.nT)(r.uri,s,c))}return l})),P=e=>{const t=e=>(0,r.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let n=null;return t(e).map(((e,t)=>(e&&e.items&&(n=t),{item:e,index:t,titleItemIndex:n})))}},25952:(e,t,n)=>{n.d(t,{$t:()=>p,Xk:()=>h,u7:()=>y,tI:()=>E,zy:()=>v,Uv:()=>C,eC:()=>S,DV:()=>A,OP:()=>N,_H:()=>R,bB:()=>w,S9:()=>I,tm:()=>P,DT:()=>F});var r=n(17440),a=n(87918),l=n.n(a),i=n(24097),o=n(81403),s=n(26507),c=n(55639);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){d(e,t,n[t])}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=e=>(0,s.YU)(o.lD1.type,{hiddenTitle:l().text("Entity types"),disableIncludeFilter:!0,pageSize:101,showIcon:!0,barColor:"#61D55D",transparentBackground:!0,showDeleteButton:!1}),m=(0,s.YU)(o.lD1.matches,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),f=[(0,s.YU)(o.lD1.createdBy,{pageSize:i.cu}),(0,s.YU)(o.lD1.updatedBy,{pageSize:i.cu}),(0,s.YU)(o.lD1.createdTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),(0,s.YU)(o.lD1.updatedTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),(0,s.YU)(o.lD1.sourceSystems,{title:l().text("Sources"),pageSize:i.cu,orderType:"reversedCount"}),(0,s.YU)(o.lD1.tags,{pageSize:i.cu,orderType:"reversedCount"}),(0,s.YU)(o.lD1.roles,{pageSize:i.cu,orderType:"reversedCount"}),m,(0,s.YU)(o.lD1.matchScore,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),(0,s.YU)(o.lD1.startDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),(0,s.YU)(o.lD1.endDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0})],h=e=>{const t=(e||[]).map((e=>u({},m,(0,s.sW)({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:m.title}))));return f.concat(t)},y=(e,t,n,r,a)=>u({},(0,s.Y2)(e,t,n,r,a),{uri:t.uri,type:(0,o.CY1)(t)}),g=(0,r.memoizeWith)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,c.Lt)(t.toString()+(n||[]).map((0,r.prop)("id")).toString())}),(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,s.Km)(e,t,b,y,!0,!0,n)})),b=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return n&&n.length?{id:e,title:t,needGroupIcon:r,facets:n}:null},E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3?arguments[3]:void 0;const i=1===t.length,o=h(a),s=b("special",l().text("Basic"),o,!1),c=g(e,t,a),u=(0,r.chain)((0,r.prop)("facets"),c),d=(0,r.pipe)((0,r.map)(v([...o,...u])),(0,r.reject)(r.isNil))(n);return[b("recommended",l().text("Recommended"),d,!1)].concat(i?c:s).concat(i?s:c).filter(r.identity)},v=(0,r.curry)(((e,t)=>{const n=e.find((0,r.propEq)("fieldName",t));if(n)return n;{const n=(0,r.chain)((0,r.propOr)([],"children"),e);return n.length?v(n,t):void 0}})),T=e=>u({},e,{facets:e.facets.reduce(((e,t)=>(e.push(t),t.children&&e.push(...(0,s.jj)(t)),e)),[])}),C=(e,t,n)=>E(e,t,[],n).map(T),O=e=>e.children?[e].concat(e.children.flatMap(O)):[e],S=(e,t,n,r)=>E(e,t,n,r).flatMap((e=>e.facets)).flatMap(O),A=function(e){let{values:t=[],showAllItems:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.reject)(r.isNil,{fieldName:e,data:[],values:t&&t.map((0,r.when)((0,r.is)(Boolean),r.toString)),showAllItems:n})},N=e=>e.type===o.$26.COMPLEX_FACET,R=e=>e.attrType&&(0,o.CwH)(e.attrType),w=e=>"matches"===e.fieldName||"potentialMatches.matchScore"===e.fieldName||e.fieldName.startsWith((0,o.CSV)("dtPotentialMatches.matches","")),I=e=>(0,r.intersection)(["matchRules","dtPotentialMatches.matchRules"],[e.fieldNameForRequest,e.fieldName]).length>0,P=e=>"MLRecommendedMatch"===e.fieldName,F=e=>!!e.dataTenant},78844:(e,t,n)=>{n.d(t,{h:()=>f});var r=n(17440),a=n(58697),l=n.n(a),i=n(36631),o=n(578),s=n(81403),c=n(24097);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.filter)((0,r.pipe)((0,r.prop)("values"),r.isEmpty,r.not)),p=(0,i.Z)((e=>(0,o.Yg)({dataTenants:e}))),m=(e,t,n)=>(0,s.jFi)(e,{type:n.entityTypeUri})||(p(t).find((e=>e.attributes.find((e=>e.fieldName===n.fieldName))))||{}).title,f=(e,t,n)=>{const a=d(n),[[i={}],o]=(0,r.partition)(s.M5u,a);return o.reduce(((n,a)=>{const i=(0,s.d3Y)(a.attrType,a.fieldName),o=(0,s.P$2)(a),c=(0,r.pick)(["title","pathToTitle","fieldName","fieldNameForRequest","dataTenant","dataTenantFieldName","attrType","groupName","entityTypeUri","pageSize","orderType","isComplex","disableIncludeFilter","uri"])(a),d=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}({},c,{groupName:m(e,t,c),filterOptions:i}),p=(0,s.WxZ)(a);return n[0].push({data:d,operator:"and",filter:o,id:l()(),values:p}),n}),[[]]).filter((e=>e.length||(0,r.path)(["values","length"],i))).map((e=>({attributes:e,operator:c.qx.value,id:l()(),entityTypes:i.values||[]})))}},91785:(e,t,n)=>{n.d(t,{sc:()=>i,eQ:()=>s,ZK:()=>c});var r=n(17440),a=n(81403);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=(0,r.pipe)((0,r.propOr)([],"entityTypes"),(0,r.any)((0,r.complement)(a.oDv))),o=(0,r.pipe)((0,r.propOr)([],"entityTypes"),(0,r.filter)(a.oDv),(0,r.map)((0,r.prop)("uri"))),s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0===t.length&&i(e)?o(e):t},c=(e,t)=>t&&Array.isArray(t.availableEntityTypes)?e.map((e=>t.availableEntityTypes.includes(e.value)?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}({},e,{number:void 0}))):e},7066:(e,t,n)=>{n.d(t,{HC:()=>E,Kn:()=>v,wW:()=>w,dG:()=>D,q7:()=>x,iL:()=>j,AX:()=>H,t8:()=>L,i7:()=>M,Kl:()=>U,EG:()=>z,XK:()=>G,$L:()=>q,MI:()=>B,Kk:()=>Z,U4:()=>V});var r=n(17440),a=n(52180),l=n(81403),i=n(61934),o=n(55639),s=n(25952),c=n(95038),u=n.n(c),d=n(24097),p=n(14476),m=n(91785),f=n(19492),h=n(87861);function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){g(e,t,n[t])}))}return e}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=(e,t)=>t.find((t=>[t.fieldName,`${t.fieldName}.ov`].includes(e)))||(console.warn(`Can't find facet config for ${e} fieldName`),null),E=(e,t,n,r,a)=>Object.keys(t).reduce(((l,i)=>{const o=b(i,n);if(o){const n=o.fieldName;l[n]=k(e,n,t[i],o,r,a)}return l}),{}),v=(e,t)=>Object.keys(e).reduce(((n,r)=>{const a=b(r,t);return a&&(n[a.fieldName]=_(e[r],a.attrType&&a.attrType.type)),n}),{}),T=(e,t)=>t.number-e.number,C=e=>{let{number:t}=e;return t>0},O=e=>(0,r.either)(C,(e=>{let{values:t=[]}=e;return e=>{let{value:n}=e;return t.includes(n)}})(e)),S=e=>Object.keys(e).map((t=>({value:t,number:e[t],label:t}))).sort(T),A=(e,t)=>Object.keys(e).map((n=>({value:"Long"===t?new a.Decimal(n):+n,number:e[n],label:n}))),N=(e,t)=>S(e).map((e=>y({},e,{label:(0,l.sG0)(e.value,(0,r.path)([e.value,"displayName"],t))}))),R=(e,t)=>t.map((t=>({value:t,label:t,number:e[t]||0}))).sort(T),w=(e,t,n)=>{const{entityTypes:a}=e;return a.filter(n?e=>{let{uri:t}=e;return n.includes(t)}:r.identity).sort(n?(0,l.A9Y)(n,"uri"):e=>0).map((n=>{const r=(0,l.nIW)(n.uri);return(0,l.oDv)(n)?{value:n.uri,number:t[r]||0,label:(0,l.jFi)(e,{type:n.uri})||r,icon:(0,i.H)(e,n.uri)}:null})).filter(r.identity)},I=(e,t,n)=>{const{roles:r}=e;return r.map((e=>{const n=(0,l.nIW)(e.uri);return{value:e.uri,label:e.label,number:t[n]||0}})).filter(O(n)).sort(T)},P=(e,t,n)=>{const{sources:r}=e;return r.map((e=>{const n=(0,l.nIW)(e.uri);return{value:n,number:t[n]||0,label:e.label||n}})).filter(O(n)).sort(T)},F=(e,t,n)=>{const a=(0,l.nt9)(e,n.entityTypeUri),i=a&&a.matchGroups||[];return(0,r.uniqBy)((0,r.prop)("value"),[...i.map((e=>{let{uri:n,label:r}=e;return{isRaw:!1,value:n,number:t[n]||0,label:r||n}})),...Object.entries(t).map((e=>{let[t,n]=e;const a=(0,r.find)((0,r.propEq)("uri",t))(i),l=!a;return{value:t,number:n,label:l?t:a.label,isRaw:l}}))]).filter(O(n)).sort(T)},_=(e,t)=>{const{min:n,max:r,count:l}=e;return{min:"Long"===t?new a.Decimal(n):+n,max:"Long"===t?new a.Decimal(r):+r,count:l}},k=function(e,t,n,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};switch(t){case"type":{const{allowedEntityTypes:t}=o;return w(e,n,t)}case"roles":return I(e,n,a);case"sourceSystems":return P(e,n,a)}if((0,s.S9)(a))return F(e,n,a);if((0,s._H)(a))return N(n,i[(0,l.To9)(a.attrType)]);if((0,l.eEv)(a.attrType))return R(n,(0,r.path)(["attrType","values"],a));switch(a.type){case l.$26.NUMERIC_RANGE_FACET:case l.$26.DATE_RANGE_FACET:return A(n,a.attrType&&a.attrType.type);default:return S(n)}},D=e=>{switch(e){case l.$26.DATE_RANGE_FACET:return[d.q7,d.FR];case l.$26.NUMERIC_RANGE_FACET:default:return[d.GB,d.nq]}},x=((0,r.curry)(((e,t)=>(Object.values(t).map((t=>t.filter((e=>isNaN(e.value))).forEach((t=>t.value=e)))),t))),(e,t)=>isNaN(t)?e:t),j=(e,t)=>t.find((t=>t.fieldName===e||t.fieldNameForRequest===e)),H=(e,t)=>Object.keys(e).filter((e=>t.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{}),L=(e,t)=>{const n=t.reduce(((e,t)=>(e[t.fieldName]=t,e)),{});return Object.keys(e).reduce(((t,r)=>{const a=n[r];return t[r]=y({},e[r],a),t}),{})},M=e=>Object.keys(e).reduce(((t,n)=>(t[n]=y({},e[n],{filter:W(e[n].type)}),t)),{}),U=e=>(0,r.map)((0,r.ifElse)(l.M5u,(t=>y({},t,{values:(0,m.eQ)(e,t.values)})),r.identity)),z=e=>(0,r.map)((0,r.when)(l.M5u,(t=>y({},t,{values:e&&e.length>0?t.values.filter((t=>e.includes(t))).sort((0,l.A9Y)(e)):t.values})))),G=(0,r.path)(["facets","facetsData","type"]),W=e=>({entityTypeFacet:"equals",facetWithDropdownCheckboxes:"equals",numericRangeFacet:"range",dateRangeFacet:"range"}[e]),q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="type"===(0,r.path)(["payload","facetFieldName"],e);return e.type===f.Z.CHANGE_VALUES&&t||e.type===f.Z.CLEAR_ALL_VALUES||e.type===h.Z.CLEAR_ALL},B=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map((r=>{let a;switch(n){case l.$26.NUMERIC_RANGE_FACET:return`${(0,o.k7)(+r[0],1e4)} — ${(0,o.k7)(+r[1],1e4)}`;case l.$26.DATE_RANGE_FACET:return a=(0,p.C)().getRange(t,e),`${(0,o.XY)(u()(a[0]))} — ${(0,o.XY)(u()(a[1]))}`;case l.$26.ENTITY_TYPE_FACET:case l.$26.WITH_DROPDOWN_CHECKBOXES_FACET:default:return l.wSh.fromNull(e.find((e=>e.value===r))).orSome({label:r||""}).label}}))},Z=(0,r.pipe)((0,r.propOr)([],"values"),r.length,(0,r.gt)(r.__,d.wP)),Y=(0,r.pipe)((0,r.pipe)((0,r.filter)(s._H),(0,r.map)((e=>({type:(0,l.To9)((0,r.path)(["attrType"],e)),codeValues:(0,r.flatten)((0,r.propOr)([],"values",e))}))),(0,r.filter)((e=>{let{codeValues:t}=e;return t.length>0}))),l.qWg),V=(e,t)=>(0,r.pipe)(Y,(0,l.DVz)(t))(e)},36657:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(25952),a=n(17440);const l=e=>t=>{const n=t.entityType||t.entityTypeUri||"special",r=e.find((0,a.propEq)("id",n));return(0,a.propOr)([],"facets",r).find((0,a.propEq)("fieldName",t.fieldName))};var i=n(81403);const o=e=>t=>e.find((e=>e.fieldName===t.fieldName));function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,a.pipe)((e=>e.reduce(((e,t)=>(e[t.fieldName]=s({},t,{values:[...(0,a.propOr)([],"values",t),...(0,a.pathOr)([],[t.fieldName,"values"],e)]}),e)),{})),a.values),d=e=>(t,n)=>{if(n.entityType){const r=(0,i.h2W)(n.fieldName,n.entityType),a=(0,i.zeJ)(e,r);a&&(0===t.entityTypes.length&&t.entityTypes.push(n.entityType),t.entityTypes.includes(n.entityType)&&t.searchParams.push({fieldName:n.fieldName,filter:n.filter||"equals",uri:a.uri,values:n.values||[]}))}return t},p=e=>(t,n)=>{const r=e.find((e=>e.fieldName===n.fieldName));if(r){const e=(0,i.g5f)(r)?(0,i.fed)(n.values):n.values,l=(0,i.M5u)(r)&&n.showAllEntityTypes?n.showAllEntityTypes:null;return s({},t,{[n.fieldName]:(0,a.reject)(a.isNil,{fieldName:n.fieldName,values:e,showAllItems:l})})}return t};var m=n(58697),f=n.n(m),h=n(26507),y=n(578);function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=(0,a.curry)(((e,t,n,r)=>{const{uri:l}=r;return l&&!l.startsWith("special/")?((e,t)=>{let{uri:n,entityTypeUri:r,fieldName:l}=t;const o=(0,i.zeJ)(e,n);if(o){const t=((0,i.X3M)(e,(0,i.h2W)(l,r),r)||[]).map((0,a.pick)(["label","name"])).slice(0,-1);return g({uri:n,groupName:(0,i.jFi)(e,{type:r}),filterOptions:(0,i.d3Y)(o,l)},(0,h.Y2)(e,o,r,l,t))}return null})(e,r):((e,t,n,r)=>{let{fieldName:l}=r;const o=(0,y.Yg)({dataTenants:t,canUserReadWorkflowDataTask:n}).find((e=>e.attributes.find((e=>e.fieldName===l)))),s=o&&o.attributes.find((e=>e.fieldName===l));return s?g({groupName:o.title,filterOptions:(0,i.d3Y)(s.attrType,l)},(0,a.pick)(["title","fieldName","attrType","pageSize","orderType","dataTenant","fieldNameForRequest","dataTenantFieldName"],s)):null})(0,t,n,r)||((e,t,n)=>{let{fieldName:r,entityTypeUri:l}=n;const o=(0,a.pipe)((0,i.nt9)(e),(0,h.Q9)(t),(0,a.find)((0,a.propEq)("fieldName",r)))(l);return o?g({groupName:(0,i.jFi)(e,{type:l}),filterOptions:(0,i.d3Y)(o.attrType,r)},o):null})(e,t,r)}));var v=n(24097);const T=(0,a.curry)(((e,t,n,r,l)=>(0,a.pipe)((0,i.w3l)(e,r),(0,a.evolve)({data:E(e,t,n)}))(l)));var C=n(67679);const O="Preview",S={NoPreview:v.ll.LIST,[O]:v.cp,MapPreview:v.cp,TableView:v.ll.TABLE},A={[O]:v.om.PROFILE},N=e=>e.find((e=>e.selected))||{},R=(e,t,n)=>{const r=(0,C.wM)(e,t),l=n.reduce(((t,n)=>(t[n.entityTypeUri]=n.selectedAttributes.map((t=>{const n=(0,i.zeJ)(e,t);return{id:(0,i.Tde)(n.uri),label:n.label,attrType:n}})).filter((e=>!(0,i.YkM)(e.attrType))),t)),{});return(0,a.mergeDeepWith)(a.concat,r,l)};var w=n(78844),I=n(7066);const P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.options||[],n=t.find((0,a.propEq)("fieldName","searchByOv"));if(n){const e=(0,a.path)(["values",0],n);if("boolean"==typeof e)return{searchByOv:e,ovOnly:e}}return null};function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_(e,t,n[t])}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const k=(e,t,n,s)=>{let{keyword:c=null,facets:u={},advanced:d=[],map:p,view:m,searchOptions:f,currentSavedSearchUri:h,currentTenant:y}=t;const g={map:p,keyword:c,searchOptions:f};if(d.some((e=>{let{attributes:t,entityTypes:n=[]}=e;return t.length||n.length}))?g.advanced=(0,i.Y5F)(E,e,d,n,s):g.facets=((e,t,n)=>{const s=(0,r.$t)(e);if(!t||0===t.length)return{facetsData:{},facetsConfigs:[s]};const c=t.type?t.type.values.filter((0,i.kuw)(e)):[],u=(0,r.Uv)(e,c,n),d=(0,a.pipe)((0,a.dissoc)("type"),a.values,(0,a.reduce)((e=>{const t=l(e);return(e,n)=>{const r=t(n);return r&&!e.find((0,a.propEq)("fieldName",n.fieldName))?[...e,r]:e}})(u),[s]))(t);return{facetsConfigs:d,facetsData:(0,a.pipe)((0,a.evolve)({type:(0,a.assoc)("values",c)}),(0,a.filter)(o(d)),(0,a.map)((0,a.omit)(["entityTypeUri"])))(t)}})(e,u,n),m){const t=m.tabs||{};Object.keys(t).forEach((n=>{t[n]=(t[n]||[]).map((t=>F({},t,{attrType:t.attrType?(0,i.zeJ)(e,t.attrType.uri)||t.attrType:void 0})))})),g.view={searchResultsMode:m.searchResultsMode||v.cp,entityTypeTab:m.entityTypeTab,sortField:m.sortField,sortOrder:m.sortOrder,searchResultsColumns:t,previewPanelMode:m.previewPanelMode||null}}return h&&(g.currentSavedSearchUri=h),y&&(g.currentTenant=y),g},D=(e,t,n,o,s)=>{const{facets:c={},advanced:m,view:h,curSavedSearchUri:y,useSeparateGroups:g}=t,b={keyword:(0,i.ERZ)(t),searchOptions:P(m)},E=((e,t,n)=>{const o=(0,r.$t)(e);if(!n||(0,a.isEmpty)(n))return{facetsData:{},facetsConfigs:[o]};const[s,c]=(0,a.partition)((e=>"tenants"===e.fieldName),n),m=(0,a.path)([0,"currentTenant"],s),[f,h]=(0,a.partition)((e=>"type"===e.fieldName),c),y=(0,a.chain)((0,a.propOr)([],"values"),f),g=(0,a.compose)(l,r.Uv)(e,y,t),b=(0,i.Jso)(h),E=(0,a.either)((0,a.pipe)((0,a.prop)("filter"),a.isNil),(0,a.propEq)("filter","equals")),v=b.some((e=>!g(e)||!E(e)));if(v)return{currentTenant:m,advanced:b.reduce(d(e),{entityTypes:y,searchParams:[]}),facetsConfigs:[],facetsData:{}};{const e=u(b),t=[o,...e.map(g)];return{currentTenant:m,facetsConfigs:t,facetsData:[...f,...e].reduce(p(t),{})}}})(e,o,c),{currentTenant:C,advanced:O}=E,_=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(E,["currentTenant","advanced"]),k=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{searchParams:o=[],fastSearchParams:s=[],entityTypes:c=[]}=r,u=[...o,...s].map(T(e,t,n,(0,i.Ug0)(e,c))).filter((e=>e&&e.data)),d=(0,a.curry)(((e,t)=>({id:f()(),operator:e,attributes:t,entityTypes:c}))),p=l?u.map((0,a.pipe)(i.FTe,d(v.YL.value))):(0,i.FTe)(d(v.qx.value,u));return(0,a.pipe)((0,i.CMB)(e),i.yRD,(0,a.reject)(i.qIF))(p)}(e,o,s,m||O,g);if(k.some((e=>{let{attributes:t}=e;return t.length}))){const{facetsData:t,facetsConfigs:n}=_,l=n.reduce(((e,n)=>F({},e,{[n.fieldName]:(0,r.DV)(n.fieldName,t[n.fieldName])})),{}),i=(0,w.h)(e,o,Object.values((0,I.t8)(l,n)));b.advanced=i.length>0?(D=k,x=i,(0,a.prop)("attributes",x.find((e=>e.attributes))).map((e=>D[0].attributes.push(e))),D):k}else b.facets=_;var D,x;return h&&(b.view=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{mode:r,tabs:l=[]}=t,{allowedEntityTypes:i}=n;return{searchResultsMode:S[r]||v.cp,previewPanelMode:A[r]||null,entityTypeTab:(0,a.propOr)(null,"entityTypeUri",N(l)),sortField:"label",sortOrder:"asc",searchResultsColumns:R(e,i,l)}}(e,h,n)),y&&(b.currentSavedSearchUri=y),C&&(b.currentTenant=C),b},x=(e,t,n,r,a)=>{try{const{version:l}=t;return"2.0"===l?k(e,t,r,a):D(e,t,n,r,a)}catch(e){return console.warn("Can't parse search state",e),{errors:Array.isArray(e)?e:[e]}}}},14476:(e,t,n)=>{n.d(t,{C:()=>o});var r=n(17440),a=n(52180),l=n(81403),i=n(55639);const o=e=>{const t=(0,i.Oz)(e),n=(e,n)=>t.toFixed(t.div(t.minus(e,n.offset),n.ratio),0);return{NumMath:t,getRange:(e,n)=>{const a=(0,r.pathOr)((0,r.pathOr)(null,["value",0],(0,r.head)(n)),[0,0],e),l=(0,r.pathOr)((0,r.pathOr)(null,["value",1],(0,r.last)(n)),[0,1],e);return null===a||null===l?[]:t.lessThanOrEqualTo(a,l)?[a,l]:[l,a]},formatNumberForRangeFacet:e=>t.greaterThan(e,1e4)?(0,i.k7)(e,1e4):e.toString(),getBarDomain:e=>e.length>0?[(0,r.head)(e).value[0],(0,r.last)(e).value[1]]:[],calcScale:(t,n)=>{if("Long"===e){const e=n.minus(t),r=e.div(2).gt(Number.MAX_SAFE_INTEGER)?new a.Decimal(Number.MAX_SAFE_INTEGER).mul(2).div(e):1,l=t.mul(r),i=n.mul(r);return{ratio:r,offset:l.lt(Number.MIN_SAFE_INTEGER)?new a.Decimal(Number.MIN_SAFE_INTEGER).minus(l):i.gt(Number.MAX_SAFE_INTEGER)?new a.Decimal(Number.MAX_SAFE_INTEGER).minus(i):0}}return{ratio:1,offset:0}},revertScale:n,applyScale:(e,n)=>Number(t.plus(t.mul(e,n.ratio),n.offset)),bigNumbersTickFormatterX:(e,t)=>r=>e(n(r,t)),adjustRange:(e,n,a)=>{const l=e[0],i=e[1];return[(0,r.isNil)(n)?l:t.max(l,n),(0,r.isNil)(a)?i:t.min(i,a)]},equals:function(){return t.equals(...arguments)},addRanges:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0;if(0===e.length)return[];const i=e[0].value,o=e[e.length-1].value,s=t.greaterThan(i,n)?(0,r.unfold)((e=>!!t.lessThan(e,i)&&[{value:e,number:0},t.plus(e,l)]),n):[],c=t.lessThan(o,t.minus(a,l))?(0,r.unfold)((e=>!!t.lessThanOrEqualTo(e,a)&&[{value:e,number:0},t.plus(e,l)]),t.plus(o,l)):[];return[...s,...e,...c]},getInterval:function(n,r){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return n===r?1:(0,l.Wos)(e)?(r-n)/a:t.ceil(t.div(t.minus(r,n),a))}}}},68973:(e,t,n)=>{n.d(t,{aG:()=>E,kH:()=>g,aw:()=>N,ti:()=>P,_9:()=>w,dW:()=>R,_k:()=>_,XP:()=>h,Jk:()=>V,_e:()=>y,rN:()=>F,P9:()=>x,eQ:()=>j,s4:()=>k,Bo:()=>T,Es:()=>D,kx:()=>O,cI:()=>C,hW:()=>A,qD:()=>p,$9:()=>S});var r=n(17440),a=n(81403),l=n(55639),i=n(34126);const o=(0,r.pipe)((e=>i.stringify(e,{strict:!1})),(e=>e?`?${e}`:""));var s=n(24097);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const p=e=>e.values&&e.values.length||e.rawFilter,m=e=>e.dataTenant?[{filter:"equals",fieldName:e.dataTenantFieldName,values:[e.dataTenant]}]:[],f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[(0,r.prop)("fieldNameForRequest"),t=>{let{fieldNameForRequest:n}=t,l=d(t,["fieldNameForRequest"]);const i=(0,r.cond)([...e,...a.LMI])(c({},l,{fieldName:n}));return(0,r.pipe)((0,a.Uqd)(),a.$bd)([{rawFilter:i},...m(l)])}]},h=(0,a.Uqd)([f()]),y=(0,r.pipe)((0,r.filter)(p),a.h27),g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sortOrder:n,sortField:l,select:i,forceOvOnly:c,searchOptions:u,activityFilter:d,globalFilter:p}=t,m=(0,r.pipe)(h,(0,a.vyX)(p))(e),f=t.page||0,y=t.rowsPerPage||s.Tu[0],g={filter:m||void 0,select:v(e,d,i),max:y,offset:f*y,sort:l||void 0,order:n||void 0,scoreEnabled:!1,options:(c?b(u,"ovOnly"):u)||void 0,activeness:d||void 0};return`entities${o(g)}`},b=(e,t)=>{const n=(e=e||"").split(",").filter(r.identity);return n.includes(t)?e:n.concat(t).join(",")},E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{select:r,searchOptions:a,activityFilter:l}=n,i={select:v(t,l,r),uris:e,options:b(a,"ovOnly")};return{url:"entities/_byUris",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}},v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=s.Tv.concat(n);return t&&t!==a.YJ7.ACTIVE_ONLY&&l.push("startDate","endDate"),(0,r.uniq)(l).join(",")},T=(0,r.propOr)([],"businessCardAttributeURIs"),C=(0,r.compose)(r.flatten,(0,r.map)((e=>[e.latitude,e.longitude])),(0,r.propOr)([],"geoLocationAttributes")),O=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=a.wSh.fromNull(t.find((e=>"type"===e.fieldName&&e.values.length))).map((0,r.prop)("values")).orSome((0,r.pluck)("uri",e.entityTypes)),i=l.map((t=>{const r=(0,a.nt9)(e,t);return n.reduce(((e,t)=>e.concat(t(r))),[]).map(S)}));return(0,r.uniq)((0,r.flatten)(i).map(A))},S=a.Tde,A=(0,r.pipe)((0,r.split)("."),(0,r.slice)(0,2),(0,r.join)(".")),N=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{searchOptions:s,activityFilter:u,globalFilter:d}=l,p=1===e.length?m(e[0]):[],f=(0,r.pipe)((0,r.filter)((e=>e.forceInclude||!n.includes(e.fieldName))),(0,r.concat)(r.__,p),h,(0,a.vyX)(d))(t),y=e.map((e=>{const t={fieldName:e.fieldNameForRequest||e.fieldName,pageSize:e.pageSize,pageNo:1,orderType:e.orderType};return e.disableIncludeFilter||(t.includeFilter=e.includeFilter||e.values),t})),g=c({filter:f||void 0,options:s||void 0,activeness:u||void 0},i);return{url:`entities/_facets${o(g)}`,options:{method:"POST",body:JSON.stringify(y),headers:{"Content-Type":"application/json"}}}},R=function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const s=(0,l.zj)(),c=(0,l.dy)(),u=I(e,t,n,r,a,i);return`api/${s}/${c}/entities/potentialMatches${o(u)}`},w=function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const s=(0,l.zj)(),c=(0,l.dy)(),u=I(e,t,n,r,a,i);return`api/${s}/${c}/entities/matchScores${o(u)}`},I=(e,t,n,r,a,l)=>{const{searchOptions:i,activityFilter:o,globalFilter:s,dataTenant:c}=l;return{filter:_(r,a,s)||void 0,options:i||void 0,from:e,to:t,bars:n,activeness:o||void 0,dataTenant:c}},P=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:l,globalFilter:i}=r,s=d(r,["searchOptions","activityFilter","globalFilter"]),u=_(t.concat(m(e)),n,i),p={filter:u||void 0,options:a||void 0,activeness:l||void 0},f=[c({fieldName:e.fieldNameForRequest||e.fieldName,facetType:"histogram"},s)];return{url:`entities/_facets${o(p)}`,options:{method:"POST",body:JSON.stringify(f),headers:{"Content-Type":"application/json"}}}},F=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:l,globalFilter:i}=r,s=_(t.concat(m(e)),n,i),c={filter:s||void 0,options:a||void 0,activeness:l||void 0},u=[{fieldName:e.fieldNameForRequest||e.fieldName,facetType:"stats"}];return{url:`entities/_facets${o(c)}`,options:{method:"POST",body:JSON.stringify(u),headers:{"Content-Type":"application/json"}}}},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,r.pipe)((0,r.filter)((e=>e.forceInclude||!t.includes(e.fieldName))),h,(0,a.vyX)(n))(e)},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{searchOptions:r,activityFilter:a,globalFilter:l}=n,i=_(e,t,l),s={filter:i||void 0,options:r||void 0,activeness:a||void 0};return o(s).slice(1)};function D(e){let{searchRequest:t,url:n,options:r,dataTenant:i,customerTenant:o,dtssPath:s}=e;return i?(0,a.yaA)({requestProvider:t,url:n,options:r,dataTenant:i,customerTenant:o,dtssPath:s}):t(`api/${(0,l.zj)()}/${o}/${n}`,r)}const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=k(e,t,n);return"entities/_total"+(r?`?${r}`:"")},j=e=>`api/${(0,l.zj)()}/${(0,l.dy)()}/entities/_total?${e}`,H=(0,r.path)(["data","attrType","type"]),L=(e,t)=>{let{orGroupIndex:n=0}=e;const{filters:l}=e,{values:i,filter:o,operator:s}=t;(0,a.jgw)(s)&&(n=(0,r.inc)(n));const c=(0,r.pathOr)({},["filters",n],e),u={filter:o,fieldName:(0,r.path)(["data","fieldName"],t),fieldNameForRequest:(0,r.path)(["data","fieldNameForRequest"],t),dataTenant:(0,r.path)(["data","dataTenant"],t),dataTenantFieldName:(0,r.path)(["data","dataTenantFieldName"],t),values:B(i),type:H(t),operator:s},d=(0,a.i29)(u);return c[d]=(0,r.concat)((0,r.propOr)([],d,c),[u]),{orGroupIndex:n,filters:(0,r.assoc)(n,c,l)}},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>e||(0,a.RsS)(t.children)||M(t.children)),!1)},U=e=>(t,n)=>{const l=(0,r.values)(n).map((t=>{const n=(0,r.path)([0,"operator"],t),l=(0,r.pipe)(a.M7o,a.h27)(t);return!e&&M(l)?{filter:t,operator:(0,r.cond)([[a.mfm,(0,r.always)("and")],[a.jgw,r.identity],[r.T,(0,r.always)(null)]])(n)}:{filter:t,operator:n}}));return(0,r.append)(l,t)},z=(e,t)=>({operand:e,operator:t}),G=(0,r.both)((0,r.propSatisfies)((0,r.lt)(1),"length"),(0,r.propSatisfies)(Array.isArray,0)),W=[[(0,r.propEq)("fieldName","rdmLookups.resolved"),e=>{let{fieldName:t,values:n}=e;return(0,a.sPt)({filter:a.j5E.EQUALS,fieldName:t,values:[!n[0]]})}],[(0,r.allPass)([(0,r.propEq)("filter",a.j5E.EQUALS),(0,r.propSatisfies)(G,"values"),(0,r.complement)((0,r.propEq)("fieldName","type")),(0,r.propSatisfies)((0,r.complement)(a.Lt4),"type")]),e=>{let{fieldName:t,values:n}=e;return(0,r.pipe)((0,r.map)((e=>e.length>1?(0,a.sH1)({fieldName:t,values:e,filter:"listEquals"}):(0,a.sPt)({fieldName:t,values:e,filter:"equals"}))),(0,a.v0l)(" and "))(n)}]],q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{const r=[...W,...e];return n.map((e=>z((0,a.Uqd)([f(r),...r],t)(e.filter),e.operator)))}},B=(0,r.pipe)((0,r.defaultTo)([]),(0,r.map)((0,r.when)((0,r.has)("value"),(0,r.prop)("value")))),Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[{filter:"equals",fieldName:"type",values:t}],r=(0,a.Uqd)()(n);return r+(r&&e?` and ${(0,a.$bd)(e)}`:e)},Y=e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])),V=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=e.map((0,r.evolve)({attributes:a.rxg})).filter(a.gk1).map((e=>{const l=(0,r.pipe)((0,r.prop)("attributes"),(0,r.filter)(a.Bgb),(0,r.reduce)(L,{filters:[]}),(0,r.prop)("filters"),Y,(0,r.reduce)(U(n),[]),(0,r.map)(q(t,n)),r.flatten,(0,r.filter)((e=>e.operand)),(0,r.map)((0,r.evolve)({operand:e=>(0,a.$bd)(e,!1)})),a.bji,a.fgW)(e);return z(Z(l,e.entityTypes),e.operator)})).filter((e=>e.operand));return(0,r.pipe)((0,r.ifElse)((0,r.pipe)(r.length,(0,r.lt)(1)),(0,r.map)((e=>z((0,a.$bd)(e.operand),e.operator))),r.identity),a.fgW)(l)}},67679:(e,t,n)=>{n.d(t,{gj:()=>p,kF:()=>f,oq:()=>h,oX:()=>y,m5:()=>b,wM:()=>O,nx:()=>A,vw:()=>N,tU:()=>R});var r=n(17440),a=n(87918),l=n.n(a),i=n(81403),o=n(24097),s=n(55639),c=n(68973),u=n(7066);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=e=>e===o.ll.TABLE,m=(0,r.curry)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=i.wSh.fromNull((0,i.nt9)(e,t)).orSome({});return y(n).concat(g((r.attributes||[]).concat(r.analyticsAttributes||[])))})),f=(0,r.memoizeWith)(((e,t)=>(0,s.Lt)(t)),m(r.__,r.__,["label"])),h=(e,t,n)=>n&&T(f(e,t),(e=>!n.some((t=>e.id===t.id)))),y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[{id:"label",label:l().text("Profile")},{id:"entityId",label:l().text("Entity ID")}].filter((t=>!e.includes(t.id)))},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(i.Uty).map((e=>{const t={id:(0,c.$9)(e.uri),label:e.label||(0,i.nIW)(e.uri),attrType:e},n=e.attributes||e.analyticsAttributes;return"Nested"===e.type&&n&&(t.children=g(n)),t}))},b=(e,t)=>{const n=E(e,t);return v(n)},E=(e,t)=>{let n=null;const r=e=>{e.some((e=>e.id===t?(n=e,!0):e.children?r(e.children,t):void 0))};return r(e),n},v=e=>(0,r.flatten)((e.children||[]).map((e=>e.children?v(e):[e]))),T=(e,t)=>e.filter(t).map((e=>e.children?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){d(e,t,n[t])}))}return e}({},e,{children:T(e.children,t)}):e)),C=(e,t,n)=>{const a=m(e,t);return(0,r.uniq)((0,r.pipe)((0,r.concat)(["label"]),(0,r.map)((e=>E(a,e))),(0,r.reject)(r.isNil),(0,r.filter)((0,r.pipe)((0,r.prop)("attrType"),(0,r.complement)(i.QZu))))(n))},O=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,u.wW)(e,{},t),l=(0,r.prop)("*",n);return a.reduce(((t,a)=>{const i=n[a.value]||l;return t[a.value]=(0,r.isNil)(i)?y():C(e,a.value,i),t}),{})},S=e=>(t,n)=>e.indexOf(t.value)-e.indexOf(n.value),A=function(e){let{entityTypes:t}=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=(0,r.pluck)("uri",t),i=S(l),o=S(a),s=n.filter((e=>{let{value:t}=e;return 0===a.length||a.includes(t)}));return(0,r.sort)(0===a.length?i:o,s)},N=e=>{const t=y();return(0,r.uniq)(e.filter((e=>!t.find((t=>t.id===e.id)))).map((0,r.pipe)((0,r.prop)("id"),c.hW)))},R=(e,t)=>{const n=N(e),a=N(t);return!(0,r.equals)((0,r.intersection)(n,a),n)}},28527:(e,t,n)=>{n.d(t,{v6:()=>a,cN:()=>i,al:()=>o,E7:()=>s});let r={};const a=e=>r=e,l=e=>r[e],i=()=>l("apiPath"),o=()=>l("imagePath"),s=()=>l("maxRecommended")||5},86564:(e,t,n)=>{n.d(t,{rp:()=>o,tj:()=>s,mH:()=>c,eX:()=>u,T4:()=>d});var r=n(585),a=n(81403),l=n(87918),i=n.n(l);const o=e=>{console.error(e),r.Z.addError({title:i().text("Server Error"),message:i().text("Something went wrong...")})},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];console.error(e),r.Z.addError({title:i().text("Error"),message:i().text("Can't apply search state")})},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];console.error(e),r.Z.addError({title:i().text("Error"),message:i().text("Saved Search can't be applied")})},u=e=>{console.error(e),r.Z.addError({title:i().text("Import Error"),message:i().text("Record can't be imported")})},d=e=>{console.error(e),r.Z.addError({title:i().text("Error"),message:(0,a.xU7)(e,i().text("Can't load entity"))})}},55639:(e,t,n)=>{n.d(t,{Lt:()=>$,XY:()=>X,k7:()=>V,zj:()=>Y,Oz:()=>J,dy:()=>Z,l0:()=>K,ZT:()=>Q,Uw:()=>B,sR:()=>W});var r={};n.r(r),n.d(r,{ceil:()=>T,clamp:()=>A,div:()=>f,equals:()=>S,floor:()=>v,greaterThan:()=>y,greaterThanOrEqualTo:()=>g,lessThan:()=>b,lessThanOrEqualTo:()=>E,max:()=>O,min:()=>C,minus:()=>m,mul:()=>h,plus:()=>p,toFixed:()=>N});var a={};n.r(a),n.d(a,{ceil:()=>j,clamp:()=>U,div:()=>I,equals:()=>M,floor:()=>x,greaterThan:()=>F,greaterThanOrEqualTo:()=>_,lessThan:()=>k,lessThanOrEqualTo:()=>D,max:()=>L,min:()=>H,minus:()=>w,mul:()=>P,plus:()=>R,toFixed:()=>z}),n(34126);var l=n(17440),i=n(28140),o=n(87918),s=n.n(o),c=n(95038),u=n.n(c),d=n(52180);const p=(e,t)=>new d.Decimal(e).add(t),m=(e,t)=>new d.Decimal(e).sub(t),f=(e,t)=>new d.Decimal(e).div(t),h=(e,t)=>new d.Decimal(e).mul(t),y=(e,t)=>(0,d.Decimal)(e).greaterThan(t),g=(e,t)=>new d.Decimal(e).greaterThanOrEqualTo(t),b=(e,t)=>new d.Decimal(e).lessThan(t),E=(e,t)=>new d.Decimal(e).lessThanOrEqualTo(t),v=e=>new d.Decimal(e).floor(),T=e=>new d.Decimal(e).ceil(),C=(e,t)=>d.Decimal.min(e,t),O=(e,t)=>d.Decimal.max(e,t),S=(e,t)=>new d.Decimal(e).equals(t),A=(e,t,n)=>{if(new d.Decimal(e).gt(t))throw new Error("min must not be greater than max in clamp(min, max, value)");const r=new d.Decimal(n);return r.lt(e)?e:r.gt(t)?t:n},N=(e,t)=>new d.Decimal(e).toFixed(t),R=(e,t)=>Number(e)+Number(t),w=(e,t)=>e-t,I=(e,t)=>e/t,P=(e,t)=>e*t,F=(e,t)=>Number(e)>Number(t),_=(e,t)=>Number(e)>=Number(t),k=(e,t)=>Number(e)<Number(t),D=(e,t)=>Number(e)<=Number(t),x=e=>Math.floor(e),j=e=>Math.ceil(e),H=(e,t)=>Math.min(e,t),L=(e,t)=>Math.max(e,t),M=(e,t)=>e===t,U=(e,t,n)=>(0,l.clamp)(Number(e),Number(t),Number(n)),z=(e,t)=>Number(e).toFixed(t);let G;const W=e=>{G=e};let q;const B=e=>{q=e},Z=()=>G,Y=()=>q?q.toString():"",V=((0,l.compose)(JSON.parse,JSON.stringify),(e,t)=>{if(!(0,i.hj)(e))return"";const n=J(d.Decimal.isDecimal(e)&&"Long");return n.lessThanOrEqualTo(e,Number.MAX_SAFE_INTEGER)&&n.greaterThanOrEqualTo(e,Number.MIN_SAFE_INTEGER)?n.greaterThan(e,t||1e3)?s().number(e,"0,0.0a").toUpperCase():s().number(e,"0,0[.]0"):n.greaterThan(e,t||1e3)?s().number(n.div(e,1e12),"0,0.0")+"T":e.toString()}),$=e=>`${Z()}_${Y()}_${e}`,X=e=>e.format(u().localeData().longDateFormat("L")),J=e=>"Long"===e?r:a,Q=()=>{},K=(0,l.memoizeWith)(l.identity,(e=>[e]))},19672:(e,t,n)=>{n.d(t,{Ic:()=>a,ET:()=>i});const r=(e,t)=>({get:e,set:t,compose:n=>r((t=>n.get(e(t))),((r,a)=>t(r,n.set(e(r),a))))}),a=e=>r((t=>t[e]),((t,n)=>Object.assign({},t,{[e]:n}))),l=e=>{return"string"==typeof e?a(e):(t=e,r((e=>e[t]),((e,n)=>((e=[...e])[t]=n,e))));var t},i=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.length?l(e).compose(i(...n)):l(e)}},28140:(e,t,n)=>{n.d(t,{Kn:()=>r,hj:()=>a});const r=e=>"object"==typeof e&&null!==e,a=e=>!isNaN(parseFloat(e))&&isFinite(e)},7043:(e,t,n)=>{n.d(t,{Z:()=>r});const r={container:"Headers-styles-container--xVHUC",title:"Headers-styles-title--2f-Hk",actionsBar:"Headers-styles-actionsBar--3znSF",splitter:"Headers-styles-splitter--2cuCI",headerIcon:"Headers-styles-headerIcon--24r6n",previewSwitcher:"Headers-styles-previewSwitcher--IJ7aJ",tabsContainer:"Headers-styles-tabsContainer--33mAP",number:"Headers-styles-number--1bDWm"}}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[350],{97991:(e,t,n)=>{n.d(t,{Z:()=>u});var r,a=n(94079),l=n(71153),i=n.n(l),o=n(24328),s=n.n(o);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}!function(e){e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE"}(r||(r={}));const u=e=>{let{className:t,icon:n,avatarText:l,rootClasses:u}=e,d=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["className","icon","avatarText","rootClasses"]);const[p,m]=(0,o.useState)(null);(0,o.useEffect)((()=>{m(n?r.ICON_MODE:r.TEXT_MODE)}),[n,l]);const f=()=>{m(r.ERROR_MODE)};switch(p){case r.ICON_MODE:return s().createElement(a.Avatar,c({className:i()(t,null==u?void 0:u.iconRoot),src:n,onError:f},d));case r.TEXT_MODE:case r.ERROR_MODE:return s().createElement(a.Avatar,c({className:i()(t,null==u?void 0:u.textRoot)},d),l);default:return null}}},81727:(e,t,n)=>{n.d(t,{E:()=>m,Z:()=>f});var r=n(24328),a=n.n(r),l=n(94079),i=n(8818),o=n(61932),s=n(27291),c=n(31276),u=n(71153),d=n.n(u);const p=(0,n(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 f=e=>{let{classes:t={},tooltip:n="",onClick:r=c.ZT,mode:u=m.INIT}=e;const f=p();return a().createElement("div",{className:d()(f.root,t.root)},(()=>{switch(u){case m.INIT:return a().createElement(i.k,{className:t.button,size:"M",tooltipTitle:n,icon:o.Z,onClick:r});case m.PROGRESS:return a().createElement(l.CircularProgress,{className:t.spinner,size:24});case m.SUCCESS:return a().createElement(s.Z,{className:d()(f.check,t.check)});default:return null}})())}},82842:(e,t,n)=>{n.d(t,{Z:()=>C});var r=n(52730),a=n(59431),l=n(24328),i=n.n(l),o=n(71153),s=n.n(o),c=n(17440),u=n(81403),d=n(68439),p=n(31039),m=n(53180),f=n(81727);const h=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),y=e=>{e&&clearTimeout(e)},g=(e,t)=>{if(e&&t){const n=e.offsetTop,r=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:l}=t;return n>=0&&r>l&&r<l+a}};var b=n(20562),E=n(79692),v=n(41128);const T=(0,E.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,v.U1)(e.palette.primary.main,.12),"&:hover":{background:(0,v.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"}}))),C=(0,r.connect)((e=>({metadata:a.ZP.selectors.getMetadata(e)})))((e=>{let{entities:t,metadata:n,entityToHighlight:r,selectedEntityUri:a,onEntityClick:o,onEntityHover:E,entitiesImportStatus:v,entityButtonsRenderer:C}=e;const O=T(),S=(0,l.useRef)(null),A=(0,l.useRef)(null);return(0,b.D)((()=>{if(r){var e;const n=null===(e=S.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(y(A.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=S.current)||void 0===t?void 0:t.parentElement;g(n[0],e)||(h(n[0]),A.current=setTimeout((()=>{g(n[0],e)||h(n[0])}),1e3))}}return()=>{y(A.current)}}),[r]),i().createElement("div",{ref:S},(t||[]).map((e=>{const t=(0,u.idV)(e.label),l=e.secondaryLabel,h=(0,u.ptG)(n,e),y=(0,u.Fn9)(e),g=e.uri,b=(0,u.wwR)(e),T=(0,c.prop)(g,v);return i().createElement("div",{key:g,className:s()(O.item,{[O.clickable]:!!o,[O.selected]:g===a,[O.highlighted]:g===r,[O.inactive]:!y,[O.justImported]:T===f.E.SUCCESS}),onClick:o?()=>o(g):void 0,onMouseEnter:E?()=>E(g):void 0,onMouseLeave:E?()=>E(null):void 0,"data-entity-uri":g},i().createElement(m.Z,{entity:e,avatarClassName:O.avatar,imageClassName:O.image}),i().createElement("div",{className:O.info},i().createElement("div",null,i().createElement(p.Z,{value:b,className:O.label},t),l&&i().createElement("span",{className:O.secondaryLabel},l," "),h&&i().createElement("span",{className:O.businessCard},h)),i().createElement("div",{className:O.secondRow},i().createElement(d.Z,{entity:e}),i().createElement("div",null,(0,u.BTI)(e)))),C&&C(e))})))}))},20435:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(24328),a=n.n(r),l=n(13980),i=n.n(l),o=n(52730),s=n(31276),c=n(89119),u=n(8818),d=n(87918),p=n.n(d),m=n(67679);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}const h=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",f({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},a().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-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 0017 13zm0 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"})))};var y=n(7043),g=n(59431);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}const E=e=>{let{entityTypeUri:t,headColumns:n=[],onSelectColumns:l=s.ZT}=e,i=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[d,f]=(0,r.useState)(null),[E,v]=(0,r.useState)(""),T=(0,o.useSelector)(g.ZP.selectors.getMetadata),C=()=>{f(null),v("")},O=(0,r.useCallback)(((e,r)=>{const a=(0,m.kF)(T,t),i=(0,m.m5)(a,e.id);let o;o=i.length?r?n.concat(i):n.filter((e=>!i.find((t=>t.id===e.id)))):r?n.concat(e):n.filter((t=>t.id!==e.id)),l(o)}),[T,t,n,l]);return a().createElement(a().Fragment,null,a().createElement(u.k,b({tooltipTitle:p().text("Show/hide columns"),size:"M",icon:h,onClick:e=>f(e.currentTarget),className:y.Z.headerIcon},i)),(()=>{const e=(0,m.kF)(T,t);return a().createElement(c.Z,{open:!!d,anchorEl:d,data:e,onListItemClick:O,selected:n,filterText:E,onClose:C,onSearch:v})})())};E.propTypes={entityTypeUri:i().string,headColumns:i().array,onSelectColumns:i().func};const v=E},17087:(e,t,n)=>{n.d(t,{Z:()=>Ae});var r=n(24328),a=n.n(r),l=n(52730),i=n(13980),o=n.n(i),s=n(17440),c=n(45053),u=n(85709),d=n(71153),p=n.n(d),m=n(94079),f=n(43054),h=n(22385),y=n(32528);const g=e=>{let{headCellData:t,headIndex:n,sortOrder:r,sortField:l,sortHandler:i,canCheck:o,onCheck:c,headerCheckboxState:u,openConfigColumnPopup:d}=e;return a().createElement("div",{className:p()("HeadCellRenderer-styles-headCellContentWrapper--204Aj",(0,s.path)(["wrapperClassName"],t))},t&&o&&a().createElement(m.Checkbox,{className:"HeadCellRenderer-styles-checkbox--3kWo3",checked:u||!1,indeterminate:null===u,onChange:()=>c()}),a().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--3v65T"},t&&(t.sortable?a().createElement(m.TableSortLabel,{active:Boolean(r&&l===t.id),direction:r,onClick:i,classes:{root:"HeadCellRenderer-styles-sortLabel--3pCJO"},component:"div"},t.label):t.label)),d&&a().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--2WKUw"},a().createElement(h.Z,{icon:f.Z,onClick:d,size:"S","data-column-index":n})))};g.propTypes={headCellData:o().shape({id:o().string,label:o().oneOfType([o().string,o().node]),sortable:o().bool}),headIndex:o().number,sortOrder:o().string,sortField:o().string,sortHandler:o().func,canCheck:o().bool,onCheck:o().func,headerCheckboxState:o().oneOf([!0,!1,null]),openConfigColumnPopup:o().func};const b=(0,y.Z)((0,s.pick)(["openConfigColumnPopup"]))(g),E=(0,y.Z)((0,s.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(g);var v=n(81403),T=n(53180),C=n(31039);const O={popupBackdrop:"EntitiesTable-styles-popupBackdrop--1kv_-",popupContent:"EntitiesTable-styles-popupContent--2_Yic",complexPopupContent:"EntitiesTable-styles-complexPopupContent--3eaMg",highlighted:"EntitiesTable-styles-highlighted--2KGk8",highlightAnimate:"EntitiesTable-styles-highlightAnimate--31hFj",inactiveBackground:"EntitiesTable-styles-inactiveBackground--3GLxS",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--2IA7I",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--fXrDv",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--2xMPL",textOverflow:"EntitiesTable-styles-textOverflow--2r-Op",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--c704F",link:"EntitiesTable-styles-link--3M_i8",defaultWrapper:"EntitiesTable-styles-defaultWrapper--17m-1",table:"EntitiesTable-styles-table--2cYK8",imageWrapper:"EntitiesTable-styles-imageWrapper--1Mh4_",blobWrapper:"EntitiesTable-styles-blobWrapper--1lpTF",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--3K07i",referenceWrapper:"EntitiesTable-styles-referenceWrapper--2em-P",referenceContent:"EntitiesTable-styles-referenceContent--Y_vP-",referenceIcon:"EntitiesTable-styles-referenceIcon--3TGdy",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--24W5V",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--2fLKb",profileWrapper:"EntitiesTable-styles-profileWrapper--31FtH",entityAvatar:"EntitiesTable-styles-entityAvatar--1LVQ0",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--1ePjP",entityLabel:"EntitiesTable-styles-entityLabel--2Wawq",scores:"EntitiesTable-styles-scores--RoYyd",dragColumnHead:"EntitiesTable-styles-dragColumnHead--tOZC8",dragColumnBody:"EntitiesTable-styles-dragColumnBody--1F9zz",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--3LNDx",cellWrapper:"EntitiesTable-styles-cellWrapper--1-flA",entityButtons:"EntitiesTable-styles-entityButtons--uhQM9",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--1s9-b",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--3bEFw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--3KFhD"},S=e=>{let{value:t={}}=e;const n=(0,v.idV)(t.label);return a().createElement("div",{className:p()(O.defaultWrapper,O.profileWrapper)},a().createElement(T.Z,{avatarClassName:O.entityAvatar,imageClassName:O.entityAvatarImage,entity:t}),a().createElement(C.Z,{value:(0,v.wwR)(t),className:O.entityLabel},n))};S.propTypes={value:o().object};const A=S;var N=n(72768);const R=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;return a().createElement("div",{className:O.defaultWrapper},n?a().createElement(N.Z,{value:t,dataTypeDefinition:n}):t)};R.propTypes={value:o().any,columnData:o().object};const w=R;var I=n(61934),P=n(97991),F=n(59431);const _=e=>{let{value:t}=e;const n=(0,l.useSelector)(F.ZP.selectors.getMetadata);return t&&a().createElement("div",{className:p()(O.defaultWrapper,O.referenceWrapper)},a().createElement(P.Z,{className:O.referenceIcon,icon:(0,I.H)(n,t.refEntity.type)}),a().createElement(C.Z,{value:t.refEntity.objectURI,className:O.referenceContent},(0,v.idV)(t.label)))};_.propTypes={value:o().object};const k=_,D=e=>{e.stopPropagation()},x=e=>{const{value:t}=e;return a().createElement("div",{className:O.blobWrapper,onScroll:D},t)};x.propTypes={value:o().any};const j=x,H=e=>{let{value:t}=e;const n=(0,v.efz)({value:t});return n&&a().createElement("div",{className:O.imageWrapper},a().createElement("img",{src:n}))};H.propTypes={value:o().object};const L=H,M=e=>{if("label"===e.id)return A;switch((0,s.path)(["attrType","type"],e)){case"Reference":return k;case"Blob":return j;case"Image":return L}return w};function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){z(e,t,n[t])}))}return e}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const W=(0,s.split)("."),q=["entityId"],B=e=>!q.includes(e.id),Y=e=>{if((0,v.vZp)(e)){const[,...t]=W(e);return t.length>1?t.slice(0,-1):null}return null};var Z=n(81727),V=n(50646);const $=e=>{let{entity:t,isSelectedEntity:n,isHighlightedEntity:r,entityImportStatus:l,onEntityImportStatusChange:i}=e;return a().createElement("div",{className:p()(O.entityButtons,{[O.selectedEntityButtons]:n,[O.justImportedEntityButtons]:l===Z.E.SUCCESS,[O.highlightedEntityButtons]:r})},a().createElement(V.Z,{entity:t,entityImportStatus:l,onEntityImportStatusChange:i}))};$.propTypes={entity:o().object,isSelectedEntity:o().bool,isHighlightedEntity:o().bool,entityImportStatus:o().oneOf(Object.values(Z.E)),onEntityImportStatusChange:o().func};const X=(0,y.Z)(((e,t)=>{let{entitiesImportStatus:n,onEntityImportStatusChange:r,selectedEntityUri:a,highlightedEntityIndex:l}=e,{entity:i,rowIndex:o}=t;return{entityImportStatus:i&&n[i.uri],onEntityImportStatusChange:r,isSelectedEntity:a===i.uri,isHighlightedEntity:l===o}}))($);var J=n(14838),Q=n(79692),K=n(41128);function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){te(e,t,n[t])}))}return e}function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ne={height:"100%",display:"flex",flexDirection:"column"},re=(0,Q.Z)((e=>({inactiveCell:ee({background:e.inactiveBackground},ne,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:ee({background:(0,K.$n)(e.palette.primary.main,.88)},ne),clickable:ee({cursor:"pointer"},ne),justImported:ee({backgroundColor:"#FFFBEB !important"},ne)}))),ae={entity:o().object,isSelected:o().bool,onEntityClick:o().func,isJustImported:o().bool},le=(0,Q.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const ie={onCheck:o().func,isChecked:o().bool,hasCheckbox:o().bool},oe=(0,Q.Z)({collapser:{marginLeft:"-2px"}});var se=n(74566);const ce={hasCollapseButton:o().bool},ue=(0,s.pipe)((e=>{const t=t=>{const n=oe(),{hasCollapseButton:r}=t,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=l;return r?a().createElement("div",{className:"cellWithCollapser"},a().createElement(se.Z,{className:n.collapser,rowIndex:o,rowValue:i}),a().createElement(e,l)):a().createElement(e,l)};return t.propTypes=ce,t}),(e=>{const t=t=>{const n=le(),{onCheck:r,isChecked:l,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:s}}=o;return i?a().createElement("div",{className:p()(n.checkboxWrapper,"cellWithCheckbox")},a().createElement(m.Checkbox,{className:n.checkbox,checked:l,onClick:e=>e.stopPropagation(),onChange:e=>r(s.uri,e.target.checked)}),a().createElement(e,o)):a().createElement(e,o)};return t.propTypes=ie,t}),(e=>{const t=t=>{const n=re(),{rowValue:{rawValue:r},isSelected:l,onEntityClick:i,isJustImported:o}=t,s=i?()=>i(r.uri):void 0,c=r&&!(0,v.Fn9)(r);return s||c||l||o?a().createElement("div",{className:p()({[n.inactiveCell]:c},{inactiveCell:c},{[n.selectedRowCell]:l},{selectedRowCell:l},{[n.clickable]:!!s},{[n.justImported]:o},{justImported:o}),onClick:s},a().createElement(e,t)):a().createElement(e,t)};return t.propTypes=ae,t}),(0,y.Z)(((e,t)=>{let{onEntityClick:n,selectedEntityUri:r,entitiesImportStatus:a,canCheck:l,onCheck:i,checkedEntitiesUris:o}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,d=0===c;return{onCheck:i,isChecked:o&&o.includes(u.uri),hasCheckbox:l&&d,hasCollapseButton:d,isSelected:r===u.uri,isJustImported:a[u.uri]===Z.E.SUCCESS,onEntityClick:n}})))(J.Z),de=e=>{let{columnData:t,cell:n}=e;const r=n.values.length,a=28*Math.max(r,1)+20;if(!r)return a;switch((0,s.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return a}},pe=(0,r.forwardRef)(((e,t)=>{let{headColumns:n,entities:i,entityToHighlight:o,selectedEntityUri:d,onReorderingColumn:p,dndColumnReorderingEnabled:m,columnsSize:f,onChangeColumnsSize:h,onScroll:y,onSort:g,sortField:T,sortOrder:C,onEntityHover:S,onEntityClick:A,entitiesImportStatus:N,onEntityImportStatusChange:R,logger:w,canCheck:I,checkedEntitiesUris:P,headerCheckboxState:_,onCheck:k,openConfigColumnPopup:D}=e;const x=(0,r.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:O.dragColumnHead,dragColumnBody:O.dragColumnBody,draggableHeadCell:O.draggableHeadCell,cellWrapper:O.cellWrapper})),[]),j=(0,l.useSelector)(F.ZP.selectors.getMetadata),[H,L]=(0,r.useState)(null),z=(0,r.useCallback)((e=>{L(e),S&&S((0,s.path)([e,"uri"],i))}),[S,i]),q=(0,r.useRef)();(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{q.current&&q.current.resetScrollbarPosition({resetLeft:!1})}})));const Z=(0,r.useCallback)((e=>{C&&e===T?C===c.SORT_DIRECTION_ASC?g({field:e,order:c.SORT_DIRECTION_DESC}):g({field:e}):g({field:e,order:c.SORT_DIRECTION_ASC})}),[g,T,C]),V=(0,r.useCallback)((e=>{const t=(0,s.prop)(e,i);return t?a().createElement(X,{entity:t,rowIndex:e}):null}),[i]),$=(0,r.useCallback)((e=>a().createElement(ue,e)),[]),J=!!S,Q=!!g,K=(0,r.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,n)=>{let{attrType:r}=e,a=G(e,["attrType"]);const l=0===n;return U({},a,{dataTypeDefinition:r&&(0,v.PFL)(r),resizable:!0,autoResize:!l,draggable:!l,sortable:t&&B(a),nestedPath:Y(a.id),headCellRenderer:l?E:b,rowCellValueRenderer:M(U({},a,{attrType:r}))})}))}(n,Q)),[n,Q]),ee=(0,r.useMemo)((()=>((e,t,n)=>n.map((e=>(0,s.pipe)((0,s.reduce)(((t,n)=>(0,s.assoc)(n.id,((e,t,n)=>{switch(t.id){case"label":return n;case"entityId":return(0,v.BTI)(n);default:{const[e,...r]=W(t.id);return(0,s.pipe)((0,s.prop)(e),(0,v.tT_)(r))(n)}}})(0,n,e),t)),{}),(0,s.assoc)("rawValue",e))(t))))(0,n,i)),[j,n,i]),te=o?i.findIndex((0,s.propEq)("uri",o)):-1,ne=(0,r.useMemo)((()=>({onEntityClick:A,selectedEntityUri:d,highlightedEntityIndex:te,entitiesImportStatus:N,onEntityImportStatusChange:R,canCheck:I,checkedEntitiesUris:P,headerCheckboxState:_,onCheck:k,openConfigColumnPopup:D})),[P,N,_,te,I,k,A,R,d,D]);return a().createElement(u.Z,{fixFirstColumn:!0,onScroll:y,rowsData:ee,columnsData:K,onSort:Z,highlightRow:-1!==te?te:null,ref:q,sortFieldClassName:O.sortableCell,containerClassName:O.table,classes:x,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:T,order:C},dndColumnReorderingHandler:p,dndColumnReorderingEnabled:m,onChangeColumnsSize:h,columnsSize:f,resizeDebounceDelay:150,onRowHover:J?z:void 0,hoverStateEnabled:J,hoverRowIndex:H,renderRowOverlay:V,logger:w,context:ne,maxRowValuesCount:2,renderRowCell:$,getRowCellHeight:de})}));pe.propTypes={entities:o().array,entityToHighlight:o().string,selectedEntityUri:o().string,headColumns:o().array,columnsSize:o().array,onScroll:o().func,onSort:o().func,onReorderingColumn:o().func,onChangeColumnsSize:o().func,dndColumnReorderingEnabled:o().bool,onEntityClick:o().func,onEntityHover:o().func,sortField:o().string,sortOrder:o().oneOf([c.SORT_DIRECTION_ASC,c.SORT_DIRECTION_DESC]),entitiesImportStatus:o().object,onEntityImportStatusChange:o().func,logger:o().func,canCheck:o().bool,checkedEntitiesUris:o().arrayOf(o().string),headerCheckboxState:o().oneOf([!0,!1,null]),onCheck:o().func,openConfigColumnPopup:o().func},pe.defaultProps={entities:[],headColumns:[]},pe.displayName="EntitiesTable";const me=(0,r.memo)(pe);var fe=n(89119),he=n(87918),ye=n.n(he);const ge="left",be="right",Ee="hide",ve={[ge]:ye().text("Insert 1 left"),[be]:ye().text("Insert 1 right"),[Ee]:ye().text("Hide column")},Te=e=>{let{open:t,anchorEl:n,onClick:r,onClose:l,actions:i}=e;return a().createElement(m.Popover,{open:t,anchorEl:n,onClose:l},a().createElement(m.List,{component:"div"},i.map(((e,t)=>((e,t,n)=>a().createElement(m.ListItem,{button:!0,component:"div",key:n,onClick:t},a().createElement(m.ListItemText,{primary:ve[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))))};Te.propTypes={open:o().bool,anchorEl:o().any,onClick:o().func,onClose:o().func,actions:o().array};const Ce=Te;var Oe=n(55639);class Se extends a().PureComponent{constructor(){super(...arguments),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:n,headColumns:r}=this.props,a=r.slice();a.splice(t,0,e),n({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case ge:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case be:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case Ee:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:n}=this.props,r=n.slice();r.splice(e,1),t({columns:r}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,s.memoizeWith)(Se.getMemoIdForColumnSize,Se.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t,n){return`${n}${t}${(0,s.toString)(e.map((e=>(0,s.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:n,onScroll:r,headColumns:l,sortField:i,sortOrder:o,dndColumnReorderingEnabled:s,onEntityClick:c,onEntityHover:u,entitiesTableRef:d,additionalColumns:p,onChangeColumnsList:m,onReorderingColumn:f,onSort:h,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:b={},onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:C,headerCheckboxState:O,onCheck:S}=this.props,{addColumnPopupOpen:A,configColumnPopupOpen:N,popupAnchor:R,filterText:w,configurableColumnIndex:I}=this.state,P=this.memoizedGetColumnSize(l,g,(0,Oe.Lt)());return a().createElement(a().Fragment,null,a().createElement(me,{entities:e,entityToHighlight:t,selectedEntityUri:n,onScroll:r,onSort:h,onEntityClick:c,onEntityHover:u,headColumns:l,sortField:i,sortOrder:o,onReorderingColumn:f,ref:d,onChangeColumnsList:m,dndColumnReorderingEnabled:s,onChangeColumnsSize:y,columnsSize:P,entitiesImportStatus:b,onEntityImportStatusChange:E,logger:v,canCheck:T,checkedEntitiesUris:C,headerCheckboxState:O,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup}),a().createElement(fe.Z,{open:A,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:w,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:he.text("Add column")}),a().createElement(Ce,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:N,actions:I>0?[ge,be,Ee]:[be]}))}}Se.propTypes={entities:o().array,entityToHighlight:o().string,selectedEntityUri:o().string,entityTypeUri:o().string,headColumns:o().array,dndColumnReorderingEnabled:o().bool,onScroll:o().func,onSort:o().func,onReorderingColumn:o().func,onChangeColumnsSize:o().func,onChangeColumnsList:o().func,onEntityClick:o().func,onEntityHover:o().func,sortField:o().string,sortOrder:o().oneOf([c.SORT_DIRECTION_ASC,c.SORT_DIRECTION_DESC]),entitiesTableRef:o().shape({current:o().shape({resetScrollbarPosition:o().func})}),additionalColumns:o().arrayOf(o().shape({id:o().string,label:o().string})),entitiesImportStatus:o().object,onEntityImportStatusChange:o().func,logger:o().func,canCheck:o().bool,checkedEntitiesUris:o().arrayOf(o().string),headerCheckboxState:o().oneOf([!0,!1,null]),onCheck:o().func};const Ae=Se},50646:(e,t,n)=>{n.d(t,{Z:()=>E});var r=n(24328),a=n.n(r),l=n(52730),i=n(13980),o=n.n(i),s=n(59431),c=n(81403),u=n(86564),d=n(81727),p=n(87918),m=n.n(p),f=n(17440);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}const y=e=>{let{entity:t,importStatus:n,onImportStatusChange:r,hideDelay:i=3e3}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const p=(0,l.useSelector)(s.ZP.selectors.getDtssPath),f=(0,l.useSelector)(s.ZP.selectors.getTenant);return a().createElement(d.Z,h({},o,{mode:n,tooltip:m().text("Import this record"),onClick:e=>{e.stopPropagation(),r(d.E.PROGRESS),(0,c.WF)({dtssPath:p,customerTenant:f,entity:t}).then((e=>{let{success:n,uris:a}=e;if(!n)throw new Error("Failed to import entity");t.ctSubscribedUris=a,r(d.E.SUCCESS),setTimeout((()=>r(d.E.DONE)),i)})).catch((()=>{r(d.E.INIT),(0,u.eX)()}))}}))};y.propTypes={entity:c.pyR,importStatus:o().oneOf((0,f.values)(d.E)),onImportStatusChange:o().func,hideDelay:o().number};const g=y,b=(0,n(79692).Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),E=e=>{let{entity:t,entityImportStatus:n,onEntityImportStatusChange:r}=e;const i=b(),o=(0,l.useSelector)(s.ZP.selectors.getMetadata),u=(0,l.useSelector)(s.ZP.selectors.getCanUserImportEntitiesFromDT),p=(0,c.biM)(t)&&u,m=(0,c.nt9)(o,t.type),f=(0,c.Nxd)(m)&&!(0,c.aBi)(t),h=n&&n!==d.E.DONE||f;return a().createElement(a().Fragment,null,p&&a().createElement("div",{className:i.importButtonPlaceholder},h&&a().createElement(g,{entity:t,importStatus:n,onImportStatusChange:e=>r(t.uri,e)})))}},31651:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(24328),a=n.n(r),l=n(13980),i=n.n(l),o=n(71153),s=n.n(o),c=n(79692),u=n(81403);const d=(0,c.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[u.Tl4.entityTypeLabel]:{color:"#03904A"},[u.Tl4.attributeLabel]:{color:"#059BEA"},[u.Tl4.specialAttributeLabel]:{color:"#EA05CF"},[u.Tl4.attributeFilter]:{color:"#7F00FF"},[u.Tl4.attributeValue]:{color:"#000000"}})));function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}const m=(0,r.forwardRef)(((e,t)=>{let{readableQuery:n=[],className:r}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["readableQuery","className"]);const i=d();return a().createElement("span",p({ref:t,className:s()(i.query,r)},l),n.map(((e,t)=>{let{type:n,text:r}=e;return a().createElement("span",{key:t,className:i[n]},r)})))}));m.displayName="ReadableSearchQuery",m.propTypes={readableQuery:i().array,className:i().string};const f=m},19492:(e,t,n)=>{n.d(t,{Z:()=>r});const r={CREATE_FACETS:"FACETS_CREATE_FACETS",DESTROY_FACETS:"FACETS_DESTROY_FACETS",CHANGE_VALUES:"FACETS_CHANGE_VALUES",CLEAR_ALL_VALUES:"FACETS_CLEAR_ALL_VALUES",UPDATE_DATA:"FACETS_UPDATE_DATA",UPDATE_FILTERED_DATA:"FACETS_UPDATE_FILTERED_DATA",DESTROY_FILTERED_DATA:"FACETS_DESTROY_FILTERED_DATA",FILTER_FACET_DATA:"FACETS_FILTER_FACET_DATA",HANDLE_CONFIGS_CHANGES:"FACETS_HANDLE_CONFIGS_CHANGES",REQUEST_GIVEN_FACETS_DATA:"FACETS_REQUEST_GIVEN_FACETS_DATA",SET_RECOMMENDED_FACETS_LIST:"FACETS_SET_RECOMMENDED_FACETS_LIST",CONVERT_FROM_ADVANCED_SEARCH:"FACETS_CONVERT_FROM_ADVANCED_SEARCH",SHOW_MORE_ENTITY_TYPES:"FACETS_SHOW_MORE_ENTITY_TYPES",HIGHLIGHT_ADDED_FACETS:"FACETS_HIGHLIGHT_ADDED_FACETS",CLEAR_HIGHLIGHT_ADDED_FACETS:"FACETS_CLEAR_HIGHLIGHT_ADDED_FACETS"}},87861:(e,t,n)=>{n.d(t,{Z:()=>r});const r={UPDATE_ENTITIES:"SEARCH_UPDATE_ENTITIES",UPDATE_URL:"SEARCH_UPDATE_URL",CLEAR_RESULTS:"SEARCH_CLEAR_RESULTS",REFRESH_DISPLAYED_ENTITIES:"SEARCH_REFRESH_DISPLAYED_ENTITIES",REFRESH:"SEARCH_REFRESH",CLEAR_ALL:"SEARCH_CLEAR_ALL",SHOW_MORE_RESULTS_FOR_ENTITY_TYPE:"SEARCH_SHOW_MORE_RESULTS_FOR_ENTITY_TYPE",UPDATE_TOTAL:"SEARCH_UPDATE_TOTAL",CHANGE_PAGE:"SEARCH_CHANGE_PAGE",RESET_PAGE:"SEARCH_RESET_PAGE",CHANGE_ROWS_PER_PAGE:"SEARCH_CHANGE_ROWS_PER_PAGE",CHANGE_SORT:"SEARCH_CHANGE_SORT",CHANGE_LOADING:"SEARCH_CHANGE_LOADING",MAP_CHANGE_VALUE:"SEARCH_MAP_CHANGE_VALUE",STATE_UPDATED:"SEARCH_STATE_UPDATED",EXPORT_RESULTS:"SEARCH_EXPORT_RESULTS",OPEN_DATA_LOADER:"SEARCH_OPEN_DATA_LOADER",CHANGE_CURRENT_TENANT:"SEARCH_CHANGE_CURRENT_TENANT"}},24097:(e,t,n)=>{n.d(t,{Jf:()=>i,Tu:()=>o,GB:()=>s,nq:()=>c,q7:()=>u,FR:()=>d,ll:()=>p,cp:()=>m,om:()=>f,cu:()=>h,Gn:()=>y,YL:()=>g,qx:()=>b,uJ:()=>E,ib:()=>v,KY:()=>T,PW:()=>C,rX:()=>O,m2:()=>S,GT:()=>A,mL:()=>N,wP:()=>R,XU:()=>w,v6:()=>I,dV:()=>P,Vh:()=>F,WN:()=>_,KJ:()=>k,pG:()=>D,DY:()=>x,hS:()=>j,Vp:()=>H,E_:()=>L,Tv:()=>M});var r=n(87918),a=n.n(r),l=n(17440);const i="explorer",o=[25,50,100],s=0,c=1e4,u=(()=>{const e=new Date;return e.setHours(0,0,0,0),e.setFullYear(e.getFullYear()-1)})(),d=(new Date).setHours(0,0,0,0),p={TABLE:"table",LIST:"list",MAP:"map"},m=p.TABLE,f={PROFILE:"profile",MAP:"map"},h=20,y=[{label:"And",value:"and"},{label:"Or",value:"or"},{label:"And not",value:"and not"},{label:"Or not",value:"or not"}],g=y[0],b=y[1],E={saved:"saved",recent:"recent"},v={public:"public",private:"private"},T={name:"name",updateDate:"updateDate"},C={[T.name]:"NAME",[T.updateDate]:"UPDATE_DATE"},O={ASC:"asc",DESC:"desc"},S=[{label:a().text("Only me"),value:v.private},{label:a().text("All users"),value:v.public}],A={info:"info",error:"error"},N={pmRulesScope:"ML_RULES_ONLY"},R=7,w=300,I={include:"include",exclude:"exclude"},P={UpdateProfiles:"UpdateProfiles",DeleteProfiles:"DeleteProfiles"},F={AddNew:"AddNew",Clear:"Clear",ReplaceAllWith:"ReplaceAllWith",FindAndReplace:"FindAndReplace",FindAndRemove:"FindAndRemove",RepointReference:"RepointReference"},_={[F.AddNew]:a().text("Add new"),[F.Clear]:a().text("Clear attribute"),[F.ReplaceAllWith]:a().text("Replace all with"),[F.FindAndReplace]:a().text("Find and replace"),[F.FindAndRemove]:a().text("Find and remove"),[F.RepointReference]:a().text("Repoint reference")},k={[F.AddNew]:["attributeValue"],[F.Clear]:[],[F.ReplaceAllWith]:["attributeValue"],[F.FindAndReplace]:["attributeValue","attributeValueToFind"],[F.FindAndRemove]:["attributeValueToFind"],[F.RepointReference]:["attributeValue"]},D=(0,l.pipe)(l.values,(0,l.without)(F.RepointReference))(F),x=[F.AddNew,F.Clear,F.ReplaceAllWith],j=[F.AddNew,F.Clear,F.RepointReference],H={AddAttribute:"AddAttribute",UpdateAttribute:"UpdateAttribute",DeleteAttribute:"DeleteAttribute",RepointReferencedEntity:"RepointReferencedEntity",AddTags:"AddTags",ReplaceTag:"ReplaceTag",DeleteTags:"DeleteTags",ClearTags:"ClearTags"},L="referenced_entity_id",M=["uri","label","type","secondaryLabel","defaultProfilePic","defaultProfilePicValue","attributes.Address","attributes.GeoLocation","attributes.ImageGallery"]},78088:(e,t,n)=>{n.r(t),n.d(t,{PROP_NAME_OPERATOR:()=>d,PROP_NAME_VALUES:()=>p,PROP_NAME_FILTER:()=>m,getEmptyAttributeObject:()=>f,getAttributeObject:()=>h,getAttributeData:()=>y,defaultFindGroupPath:()=>g,createGetGroupLens:()=>b,createGetAttributesLens:()=>E,createGetAttributeIndex:()=>v,createGetAttributeLens:()=>T,createSetAttributeProp:()=>C,createGetAttributeProp:()=>O,addAttributeAfter:()=>S,changeAttributeData:()=>A,setAttributeOperator:()=>N,deleteAttribute:()=>R,duplicateAttribute:()=>w,setFilter:()=>I,setValues:()=>P});var r=n(17440),a=n(58697),l=n.n(a),i=n(81403),o=n(24097),s=n(19672);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d="operator",p="values",m="filter",f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l()();return{[d]:o.YL.value,id:e}},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l()();const n=y(e);return{data:n,[d]:o.YL.value,[m]:(0,r.pathOr)("",["filterOptions",0],n),id:t}},y=e=>c({},e,{filterOptions:e.enforcedFilterOptions||(0,i.d3Y)(e.attrType,e.fieldName)}),g=(0,r.curry)(((e,t)=>{const n=t.findIndex((t=>t.id===e));return n>-1?[n]:null})),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;return(n,r)=>{const a=(0,s.ET)(...e).get(n),l=t(r,a);return!!l&&(0,s.ET)(...e,...l)}},E=(e,t)=>(n,r)=>{const a=e(n,r);return a&&a.compose((0,s.Ic)(t))},v=e=>(t,n,r)=>{const a=e(t,n);return a?a.get(t).findIndex((e=>e.id===r)):-1},T=e=>(t,n,r)=>{const a=e(t,n),l=v(e)(t,n,r);return-1!==l?a.compose((0,s.ET)(l)):null},C=e=>(t,n,r,a,l)=>{const i=e(t,n,r);if(i){const e=c({},i.get(t));return e[a]=l,i.set(t,e)}return t},O=e=>(t,n,r,a)=>{const l=e(t,n,r);if(l)return l.get(t)[a]},S=e=>{let{state:t,groupId:n,attributeId:r,attribute:a,getAttributesLens:l,getAttributeIndex:i}=e;const s=l(t,n);if(s){let e=[...s.get(t)];const l=i(t,n,r),u=!e[l+1];return-1!==l&&u?e.splice(l+1,0,a):-1!==l?(e.splice(l+1,0,c({},a,{operator:e[l].operator})),e[l]=c({},e[l],{operator:o.YL.value})):e.push(a),s.set(t,e)}return t},A=e=>{let{state:t,groupId:n,attributeId:r,attributeData:a,setAttributeProp:l,getAttributeLens:i}=e,o=t;if(a)return((e,t,n,r,a)=>{const l=a(e,t,n);let i;return l&&(i=l.get(e).filter),r.filterOptions.length&&(!i||!r.filterOptions.includes(i))})(t,n,r,a,i)&&(o=l(t,n,r,m,a.filterOptions[0])),o=l(o,n,r,p,[]),l(o,n,r,"data",a);{const e=i(t,n,r);return e&&(o=e.set(o,f(r))),o}},N=e=>{let{state:t,groupId:n,attributeId:r,operator:a,setAttributeProp:l}=e;return l(t,n,r,d,a)},R=e=>{let{state:t,groupId:n,attributeId:a,getAttributesLens:l}=e;const i=l(t,n);if(i){const e=[...i.get(t)],n=e.findIndex((e=>e.id===a));if(n>-1){const a=(0,r.remove)(n,1,e),l=a[n-1],o=e[n];return l&&(a[n-1]=c({},l,{operator:o.operator})),i.set(t,a)}}return t},w=e=>{let{state:t,groupId:n,attributeId:r,id:a,getAttributesLens:l}=e;const i=l(t,n);if(i){const e=[...i.get(t)],n=e.findIndex((e=>e.id===r));if(n>-1)return e.push(c({},e[n],{id:a})),i.set(t,e)}return t},I=e=>{let{state:t,groupId:n,attributeId:r,filter:a,getAttributeProp:l,setAttributeProp:o}=e;const s=l(t,n,r,m),c=(0,i._26)(s,a)?t:o(t,n,r,p,[]);return o(c,n,r,m,a)},P=e=>{let{state:t,groupId:n,attributeId:r,values:a,setAttributeProp:l}=e;return l(t,n,r,p,a)}},81802:(e,t,n)=>{n.r(t),n.d(t,{toggleQueryBuilderAttributeSelect:()=>i});var r=n(90371),a=n(17440),l=n(78088);function*i(e){let{groups:t,findGroupPath:n=l.defaultFindGroupPath,attributesPropName:i,groupId:o,attributeId:s,selectInfo:c,actions:u}=e;const{checked:d,attribute:p,index:m,selectedAttributes:f}=c,{addAttributeAfter:h,changeAttribute:y,clearAttribute:g,deleteAttribute:b}=u,E=(0,a.pipe)(n(o),(0,a.path)(a.__,t),(0,a.propOr)([],i))(t),v=e=>(0,a.path)([e,"id"],E),T=E.findIndex((0,a.propEq)("id",s));if(s&&0===m)if(d)yield(0,r.gz)(y(o,s,p));else{let e=f[m+1];e?(yield(0,r.gz)(y(o,s,e)),yield(0,r.gz)(b(o,v(T+1)))):yield(0,r.gz)(g(o,s))}else{const e=f.length-m,t=s?T+m:E.length-e;d?yield(0,r.gz)(h(o,v(t-1),p)):yield(0,r.gz)(b(o,v(t)))}}},61934:(e,t,n)=>{n.d(t,{H:()=>l});var r=n(81403),a=n(28527);const l=(e,t)=>{return n=(0,r.XH8)(e,{type:t}),(0,r.vPL)((0,a.al)()||(0,a.cN)(),n);var n}},578:(e,t,n)=>{n.d(t,{o:()=>A,nT:()=>N,Yg:()=>R,zH:()=>w});var r=n(87918),a=n.n(r),l=n(81403),i=n(26507),o=n(17440);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.pipe)(o.values,(0,o.map)((e=>({title:e.label,fieldName:e.name,type:e.type,faceted:e.faceted,hideForDataTenant:e.hideForDataTenant})))),d={id:"entity",title:a().text("Entity"),attributes:u(l.xPW)},p={id:"workflow",title:a().text("Workflow"),attributes:u(l.iP_)},m={id:"collaborationItems",title:a().text("Collaboration Items"),attributes:u(l.eWf)},f={id:"RDMItems",title:a().text("Reference Data Management"),attributes:u(l.lwr)},h={id:"auditItems",title:a().text("Audit Items"),attributes:u(l.PEf)},y={id:"potentialMatches",title:a().text("Potential Matches"),attributes:u(l.C68)},g={id:"crosswalksItems",title:a().text("Crosswalks Items"),attributes:u((0,o.omit)(["sourceTable"],l.G39))},b=()=>d,E=()=>p,v=()=>m,T=()=>f,C=()=>h,O=e=>e?(0,o.evolve)({attributes:(0,o.concat)(o.__,e.map((e=>s({},y.attributes.find((0,o.propEq)("fieldName",l.C68.matches.name)),{dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant"}))))},y):y,S=()=>g,A=e=>{let{title:t,fieldName:n,dataTenant:r,fieldNameForRequest:a,dataTenantFieldName:l}=e,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["title","fieldName","dataTenant","fieldNameForRequest","dataTenantFieldName"]);return s({title:t,fieldName:n,attrType:o},o.faceted?{pageSize:(0,i.OY)(o),orderType:(0,i.nd)(o)}:{},r?(0,i.sW)({dataTenant:r,fieldNameForRequest:a,dataTenantFieldName:l,originalTitle:t}):{})},N=(e,t,n)=>n&&n.length?{id:e,title:t,attributes:n}:null,R=function(){let{attributesFilter:e=o.T,dataTenants:t,canUserReadWorkflowDataTask:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=t=>{let{id:n,title:r,attributes:a}=t;return N(n,r,a.map(A).filter(e))},a=[b(),...n?[E()]:[],v(),T(),C(),O(t),S()];return a.map(r).filter(o.identity)},w=(e,t,n)=>{const r=R({dataTenants:t,canUserReadWorkflowDataTask:n}).find((t=>t.attributes.find((t=>t.fieldName===e))));return r&&r.attributes.find((t=>t.fieldName===e))}},26507:(e,t,n)=>{n.d(t,{TG:()=>I,Km:()=>w,Y2:()=>N,NG:()=>A,sW:()=>g,YU:()=>y,LG:()=>P,Q9:()=>E,vf:()=>R,jj:()=>S,nd:()=>T,OY:()=>v});var r=n(17440),a=n(36631),l=n(87918),i=n.n(l),o=n(24328),s=n.n(o);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}var u=n(68973),d=n(24097),p=n(81403),m=n(578);function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y=(e,t)=>f({title:e.label,fieldName:e.name,type:(0,p.CY1)(e),attrType:{type:e.type,singleValue:e.singleValue,hideForDataTenant:e.hideForDataTenant,faceted:!0}},t),g=e=>{let{dataTenant:t,fieldNameForRequest:n,dataTenantFieldName:r,originalTitle:a}=e;return{fieldName:(0,p.CSV)(n,t.id),fieldNameForRequest:n,dataTenant:t.id,dataTenantFieldName:r,title:`${t.label} ${a}`}},b=[{attribute:y(p.lD1.matchRules,{pageSize:d.cu,orderType:"reversedCount"}),check:p.Ir},{attribute:y(p.lD1.MLRecommendedMatch,{fieldNameForRequest:"matchRules",pageSize:d.cu,orderType:"reversedCount",LogoIcon:e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return s().createElement("svg",c({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),s().createElement("defs",null,s().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"svg1842926308b"},s().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),s().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),s().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"svg1842926308d"},s().createElement("stop",{stopColor:"#FFF",offset:"0%"}),s().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),s().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"svg1842926308g"},s().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:"0",offset:"0%"}),s().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),s().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"svg1842926308i"},s().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),s().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),s().createElement("path",{d:"M.228 8.25l4.055-7.007C4.579.727 5.709.074 6.425.009L14.48.001c.633-.03 1.853.635 2.236 1.3l3.934 6.812c.398.69.345 2.074-.017 2.765l-3.868 6.685c-.472.64-1.77 1.39-2.446 1.416l-7.767.008c-.689-.033-1.992-.72-2.345-1.332L.232 10.769c-.338-.585-.278-1.938-.004-2.519z",id:"svg1842926308a"}),s().createElement("path",{d:"M1.389 8.38l3.589-6.202c.262-.457 1.263-1.033 1.898-1.09h7.143c.56-.026 1.643.565 1.984 1.153l3.494 6.037c.353.611.308 1.837-.012 2.449l-3.424 5.916c-.418.567-1.569 1.23-2.168 1.252H7.006c-.61-.03-1.766-.64-2.08-1.182L1.395 10.61c-.3-.518-.249-1.717-.006-2.23z",id:"svg1842926308c"}),s().createElement("path",{d:"M.124 0l-.161-.002c3.374 0 6.11 2.727 6.11 6.092 0 3.279-2.974 4.316-2.974 7.123a.84.84 0 01-.84.838H.123V8.623a1.75 1.75 0 000-3.437V0z",id:"svg1842926308e"}),s().createElement("path",{d:"M5.92 0l-.012 5.154-.132.006A1.75 1.75 0 005.9 8.654l-.012 5.409H3.486c-.237-.07-.4-.155-.489-.254-.089-.098-.17-.284-.242-.557l-.291-1.341a2.084 2.084 0 00-.12-.344 1.507 1.507 0 00-.187-.267L.25 8.796a1.032 1.032 0 01-.201-.293 1.277 1.277 0 01-.048-.38V3.917a.522.522 0 01.027-.22.562.562 0 01.147-.172L3.546.111a.456.456 0 01.11-.088A.345.345 0 013.784 0h2.136z",id:"svg1842926308h"})),s().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},s().createElement("g",null,s().createElement("g",{transform:"translate(1.5 .75)"},s().createElement("use",{fill:"url(#svg1842926308b)",xlinkHref:"#svg1842926308a"}),s().createElement("use",{fill:"url(#svg1842926308d)",opacity:".5",xlinkHref:"#svg1842926308c"})),s().createElement("g",{transform:"translate(8.707 3.846)"},s().createElement("rect",{fill:"#363636",x:"1.932",y:"16.593",width:"2.644",height:"2.895",rx:"1.322"}),s().createElement("path",{d:"M6.018 14.845v2.367c0 .9-.743 1.629-1.66 1.629H2.27c-.917 0-1.66-.73-1.66-1.63v-2.366l.004-.095h5.401c.002.031.003.063.003.095z",fill:"#717171"}),s().createElement("path",{d:"M5.168 17.15c0 .9-.618 1.63-1.38 1.63H2.049c-.762 0-1.38-.73-1.38-1.63v-2.37h4.5v2.37z",fill:"#828282"}),s().createElement("path",{d:"M5.939 17.28a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.376a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.375a.5.5 0 010 1H.569a.5.5 0 110-1h5.37z",fill:"#B1B1B1"}),s().createElement("path",{d:"M3.125 17.28v1h-2v-1h2zm0-1.376v1h-2v-1h2zm0-1.375v1h-2v-1h2z",fill:"#C5C5C5"}),s().createElement("g",{transform:"translate(3.375)"},s().createElement("mask",{id:"svg1842926308f",fill:"#fff"},s().createElement("use",{xlinkHref:"#svg1842926308e"})),s().createElement("use",{fill:"#FFD44B",xlinkHref:"#svg1842926308e"}),s().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFD347",mask:"url(#svg1842926308f)"}),s().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFDE72",mask:"url(#svg1842926308f)"}),s().createElement("path",{d:"M1.496 6.08c.02-.896.936-1.336 1.732-.85.906.553.507 2.04-.592 2.069H2.199l-.576 7.012-.75-.032.552-6.406.023-.574H.124v-.75h1.354l.017-.448v-.02zm1.342-.21c-.318-.193-.58-.072-.592.221l-.001.036-.016.422h.373c.357 0 .5-.493.252-.668l-.016-.01z",fill:"#F3BE13",mask:"url(#svg1842926308f)"}),s().createElement("ellipse",{fill:"url(#svg1842926308g)",mask:"url(#svg1842926308f)",cx:"-.236",cy:"6.031",rx:"4.567",ry:"4.583"})))),s().createElement("g",null,s().createElement("g",{transform:"translate(5.706 3.846)"},s().createElement("mask",{id:"svg1842926308j",fill:"#fff"},s().createElement("use",{xlinkHref:"#svg1842926308h"})),s().createElement("use",{fill:"url(#svg1842926308i)",xlinkHref:"#svg1842926308h"}),s().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:".5",mask:"url(#svg1842926308j)",d:"M4.78 1.404v.75h-.444L1.56 4.93H-.706v-.75H1.25l2.775-2.776zM3.21 5.097l1.725 1.725H6.25v.75H4.625L2.68 5.628zM6.664 3.53v.75H4.958l-.492.53-.55-.51.714-.77zM1.781 6.53l2.565 2.564h.462v.75h-.773L1.47 7.28H-.08v-.75zM2.67 10.53h1.118L5.05 11.79h2.094v.75H4.74L3.477 11.28z"}))),s().createElement("circle",{fill:"#008FD8",cx:"11.75",cy:"10.75",r:"1.125"})))}}),check:p.XQO}],E=(0,r.curry)(((e,t)=>{const n=b.reduce(((e,n)=>{let{attribute:r,check:a}=n;return a(t)&&e.push(f({},r,{entityTypeUri:t.uri})),e}),[]),a=(e||[]).flatMap((e=>n.filter((0,r.propEq)("fieldName",p.lD1.matchRules.name)).map((t=>f({},t,g({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matchRules",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:t.title}))))));return n.concat(a)})),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return 1;default:return d.cu}},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return"reversedTerm";default:return"reversedCount"}},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return!0;default:return!1}},O=(0,r.curry)(((e,t)=>(0,p.YkM)(t)?(0,p.EUG)(e,t).some(O(e)):!!t.faceted)),S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(e.children?e.children.concat(e.children.map(S)).flat(1/0):[]).filter((0,r.complement)(r.isEmpty))},A=function(e,t,n,r,a){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];const i=f({},a(e,t,n,r,l),{uri:t.uri}),o=t.children?t.children.map((r=>A(e,r,n,"",a,l.concat({name:t.name,label:t.label})))):[];return o.length&&(i.children=o),i},N=(e,t,n,a,l)=>{const i=(0,p.jFi)(e,{type:n}),o=t.label||t.name;return{title:o,pathToTitle:Array.isArray(l)?[i,...(0,r.chain)((0,r.prop)("label"),l),o]:[i,o],fieldName:a||(0,u.$9)(t.uri,l),entityTypeUri:n,attrType:t,pageSize:v(t),orderType:T(t),isComplex:(0,p.YkM)(t),disableIncludeFilter:C(t)}},R=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,p.k66)(e,t,(0,r.either)((0,r.always)(!n),O(e)))},w=(0,a.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,l=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0;const s=e=>t.includes(e),c=()=>i,u=()=>(0,r.propEq)("length",1,t),{entityTypes:d}=e;return d.filter(p.oDv).filter((0,r.anyPass)([(0,r.always)(!t.length),(0,r.allPass)([c,u,(0,r.propEq)("uri",t[0])]),(0,r.allPass)([(0,r.complement)(c),(0,r.pipe)((0,r.prop)("uri"),s)])])).map((t=>{const r=(0,p.jFi)(e,{type:t.uri}),i=E(o,t).concat(R(e,t,l).map((n=>A(e,n,t.uri,"",a))));return i.length?n(t.uri,r,i):null})).filter(r.identity)})),I=(0,a.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.T,a=arguments.length>3?arguments[3]:void 0;if(0===t.length)return w(e,void 0,m.nT,N,!1,!0,a);const l=[],o=t.length>1?(0,p.Ug0)(e,t):t[0];if(o){const r=(0,p.nt9)(e,o),s=t.length>1?i().text("Attributes"):(0,p.jFi)(e,{type:r.uri}),c=E(a,r).filter(n).concat(R(e,r,!1).map((t=>A(e,t,r.uri,"",N))));c.length&&l.push((0,m.nT)(r.uri,s,c))}return l})),P=e=>{const t=e=>(0,r.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let n=null;return t(e).map(((e,t)=>(e&&e.items&&(n=t),{item:e,index:t,titleItemIndex:n})))}},25952:(e,t,n)=>{n.d(t,{$t:()=>p,Xk:()=>h,u7:()=>y,tI:()=>E,zy:()=>v,Uv:()=>C,eC:()=>S,DV:()=>A,OP:()=>N,_H:()=>R,bB:()=>w,S9:()=>I,tm:()=>P,DT:()=>F});var r=n(17440),a=n(87918),l=n.n(a),i=n(24097),o=n(81403),s=n(26507),c=n(55639);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){d(e,t,n[t])}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=e=>(0,s.YU)(o.lD1.type,{hiddenTitle:l().text("Entity types"),disableIncludeFilter:!0,pageSize:101,showIcon:!0,barColor:"#61D55D",transparentBackground:!0,showDeleteButton:!1}),m=(0,s.YU)(o.lD1.matches,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),f=[(0,s.YU)(o.lD1.createdBy,{pageSize:i.cu}),(0,s.YU)(o.lD1.updatedBy,{pageSize:i.cu}),(0,s.YU)(o.lD1.createdTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),(0,s.YU)(o.lD1.updatedTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),(0,s.YU)(o.lD1.sourceSystems,{title:l().text("Sources"),pageSize:i.cu,orderType:"reversedCount"}),(0,s.YU)(o.lD1.tags,{pageSize:i.cu,orderType:"reversedCount"}),(0,s.YU)(o.lD1.roles,{pageSize:i.cu,orderType:"reversedCount"}),m,(0,s.YU)(o.lD1.matchScore,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),(0,s.YU)(o.lD1.startDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),(0,s.YU)(o.lD1.endDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0})],h=e=>{const t=(e||[]).map((e=>u({},m,(0,s.sW)({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:m.title}))));return f.concat(t)},y=(e,t,n,r,a)=>u({},(0,s.Y2)(e,t,n,r,a),{uri:t.uri,type:(0,o.CY1)(t)}),g=(0,r.memoizeWith)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,c.Lt)(t.toString()+(n||[]).map((0,r.prop)("id")).toString())}),(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,s.Km)(e,t,b,y,!0,!0,n)})),b=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return n&&n.length?{id:e,title:t,needGroupIcon:r,facets:n}:null},E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3?arguments[3]:void 0;const i=1===t.length,o=h(a),s=b("special",l().text("Basic"),o,!1),c=g(e,t,a),u=(0,r.chain)((0,r.prop)("facets"),c),d=(0,r.pipe)((0,r.map)(v([...o,...u])),(0,r.reject)(r.isNil))(n);return[b("recommended",l().text("Recommended"),d,!1)].concat(i?c:s).concat(i?s:c).filter(r.identity)},v=(0,r.curry)(((e,t)=>{const n=e.find((0,r.propEq)("fieldName",t));if(n)return n;{const n=(0,r.chain)((0,r.propOr)([],"children"),e);return n.length?v(n,t):void 0}})),T=e=>u({},e,{facets:e.facets.reduce(((e,t)=>(e.push(t),t.children&&e.push(...(0,s.jj)(t)),e)),[])}),C=(e,t,n)=>E(e,t,[],n).map(T),O=e=>e.children?[e].concat(e.children.flatMap(O)):[e],S=(e,t,n,r)=>E(e,t,n,r).flatMap((e=>e.facets)).flatMap(O),A=function(e){let{values:t=[],showAllItems:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.reject)(r.isNil,{fieldName:e,data:[],values:t&&t.map((0,r.when)((0,r.is)(Boolean),r.toString)),showAllItems:n})},N=e=>e.type===o.$26.COMPLEX_FACET,R=e=>e.attrType&&(0,o.CwH)(e.attrType),w=e=>"matches"===e.fieldName||"potentialMatches.matchScore"===e.fieldName||e.fieldName.startsWith((0,o.CSV)("dtPotentialMatches.matches","")),I=e=>(0,r.intersection)(["matchRules","dtPotentialMatches.matchRules"],[e.fieldNameForRequest,e.fieldName]).length>0,P=e=>"MLRecommendedMatch"===e.fieldName,F=e=>!!e.dataTenant},78844:(e,t,n)=>{n.d(t,{h:()=>f});var r=n(17440),a=n(58697),l=n.n(a),i=n(36631),o=n(578),s=n(81403),c=n(24097);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.filter)((0,r.pipe)((0,r.prop)("values"),r.isEmpty,r.not)),p=(0,i.Z)((e=>(0,o.Yg)({dataTenants:e}))),m=(e,t,n)=>(0,s.jFi)(e,{type:n.entityTypeUri})||(p(t).find((e=>e.attributes.find((e=>e.fieldName===n.fieldName))))||{}).title,f=(e,t,n)=>{const a=d(n),[[i={}],o]=(0,r.partition)(s.M5u,a);return o.reduce(((n,a)=>{const i=(0,s.d3Y)(a.attrType,a.fieldName),o=(0,s.P$2)(a),c=(0,r.pick)(["title","pathToTitle","fieldName","fieldNameForRequest","dataTenant","dataTenantFieldName","attrType","groupName","entityTypeUri","pageSize","orderType","isComplex","disableIncludeFilter","uri"])(a),d=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}({},c,{groupName:m(e,t,c),filterOptions:i}),p=(0,s.WxZ)(a);return n[0].push({data:d,operator:"and",filter:o,id:l()(),values:p}),n}),[[]]).filter((e=>e.length||(0,r.path)(["values","length"],i))).map((e=>({attributes:e,operator:c.qx.value,id:l()(),entityTypes:i.values||[]})))}},91785:(e,t,n)=>{n.d(t,{sc:()=>i,eQ:()=>s,ZK:()=>c});var r=n(17440),a=n(81403);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=(0,r.pipe)((0,r.propOr)([],"entityTypes"),(0,r.any)((0,r.complement)(a.oDv))),o=(0,r.pipe)((0,r.propOr)([],"entityTypes"),(0,r.filter)(a.oDv),(0,r.map)((0,r.prop)("uri"))),s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0===t.length&&i(e)?o(e):t},c=(e,t)=>t&&Array.isArray(t.availableEntityTypes)?e.map((e=>t.availableEntityTypes.includes(e.value)?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}({},e,{number:void 0}))):e},7066:(e,t,n)=>{n.d(t,{HC:()=>E,Kn:()=>v,wW:()=>I,dG:()=>x,q7:()=>j,iL:()=>H,AX:()=>L,t8:()=>M,i7:()=>U,Kl:()=>z,EG:()=>G,XK:()=>W,$L:()=>B,MI:()=>Y,Kk:()=>Z,U4:()=>$});var r=n(17440),a=n(52180),l=n(81403),i=n(61934),o=n(55639),s=n(25952),c=n(95038),u=n.n(c),d=n(24097),p=n(14476),m=n(91785),f=n(19492),h=n(87861);function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){g(e,t,n[t])}))}return e}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=(e,t)=>t.find((t=>[t.fieldName,`${t.fieldName}.ov`].includes(e)))||(console.warn(`Can't find facet config for ${e} fieldName`),null),E=(e,t,n,r,a)=>Object.keys(t).reduce(((l,i)=>{const o=b(i,n);if(o){const n=o.fieldName;l[n]=D(e,n,t[i],o,r,a)}return l}),{}),v=(e,t)=>Object.keys(e).reduce(((n,r)=>{const a=b(r,t);return a&&(n[a.fieldName]=k(e[r],a.attrType&&a.attrType.type)),n}),{}),T=(e,t)=>t.number-e.number,C=e=>{let{number:t}=e;return t>0},O=e=>(0,r.either)(C,(e=>{let{values:t=[]}=e;return e=>{let{value:n}=e;return t.includes(n)}})(e)),S=e=>Object.keys(e).map((t=>({value:t,number:e[t],label:t}))).sort(T),A=(e,t)=>Object.keys(e).map((n=>({value:"Long"===t?new a.Decimal(n):+n,number:e[n],label:n}))),N=(e,t)=>S(e).map((e=>y({},e,{label:(0,l.sG0)(e.value,(0,r.path)([e.value,"displayName"],t))}))),R=(e,t)=>t.map((t=>({value:t,label:t,number:e[t]||0}))).sort(T),w=(e,t)=>Object.keys(e).map((n=>({value:n,number:e[n],label:(0,l.mB6)({dataTypeDefinition:t},n)}))).sort(T),I=(e,t,n)=>{const{entityTypes:a}=e;return a.filter(n?e=>{let{uri:t}=e;return n.includes(t)}:r.identity).sort(n?(0,l.A9Y)(n,"uri"):e=>0).map((n=>{const r=(0,l.nIW)(n.uri);return(0,l.oDv)(n)?{value:n.uri,number:t[r]||0,label:(0,l.jFi)(e,{type:n.uri})||r,icon:(0,i.H)(e,n.uri)}:null})).filter(r.identity)},P=(e,t,n)=>{const{roles:r}=e;return r.map((e=>{const n=(0,l.nIW)(e.uri);return{value:e.uri,label:e.label,number:t[n]||0}})).filter(O(n)).sort(T)},F=(e,t,n)=>{const{sources:r}=e;return r.map((e=>{const n=(0,l.nIW)(e.uri);return{value:n,number:t[n]||0,label:e.label||n}})).filter(O(n)).sort(T)},_=(e,t,n)=>{const a=(0,l.nt9)(e,n.entityTypeUri),i=a&&a.matchGroups||[];return(0,r.uniqBy)((0,r.prop)("value"),[...i.map((e=>{let{uri:n,label:r}=e;return{isRaw:!1,value:n,number:t[n]||0,label:r||n}})),...Object.entries(t).map((e=>{let[t,n]=e;const a=(0,r.find)((0,r.propEq)("uri",t))(i),l=!a;return{value:t,number:n,label:l?t:a.label,isRaw:l}}))]).filter(O(n)).sort(T)},k=(e,t)=>{const{min:n,max:r,count:l}=e;return{min:"Long"===t?new a.Decimal(n):+n,max:"Long"===t?new a.Decimal(r):+r,count:l}},D=function(e,t,n,a){var i;let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};switch(t){case"type":{const{allowedEntityTypes:t}=c;return I(e,n,t)}case"roles":return P(e,n,a);case"sourceSystems":return F(e,n,a)}if((0,s.S9)(a))return _(e,n,a);if((0,s._H)(a))return N(n,o[(0,l.To9)(a.attrType)]);if((0,l.eEv)(a.attrType))return R(n,(0,r.path)(["attrType","values"],a));if((0,l.T6Y)(null===(i=a.attrType)||void 0===i?void 0:i.type))return w(n,(0,l.PFL)(a.attrType));switch(a.type){case l.$26.NUMERIC_RANGE_FACET:case l.$26.DATE_RANGE_FACET:return A(n,a.attrType&&a.attrType.type);default:return S(n)}},x=e=>{switch(e){case l.$26.DATE_RANGE_FACET:return[d.q7,d.FR];case l.$26.NUMERIC_RANGE_FACET:default:return[d.GB,d.nq]}},j=((0,r.curry)(((e,t)=>(Object.values(t).map((t=>t.filter((e=>isNaN(e.value))).forEach((t=>t.value=e)))),t))),(e,t)=>isNaN(t)?e:t),H=(e,t)=>t.find((t=>t.fieldName===e||t.fieldNameForRequest===e)),L=(e,t)=>Object.keys(e).filter((e=>t.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{}),M=(e,t)=>{const n=t.reduce(((e,t)=>(e[t.fieldName]=t,e)),{});return Object.keys(e).reduce(((t,r)=>{const a=n[r];return t[r]=y({},e[r],a),t}),{})},U=e=>Object.keys(e).reduce(((t,n)=>(t[n]=y({},e[n],{filter:q(e[n].type)}),t)),{}),z=e=>(0,r.map)((0,r.ifElse)(l.M5u,(t=>y({},t,{values:(0,m.eQ)(e,t.values)})),r.identity)),G=e=>(0,r.map)((0,r.when)(l.M5u,(t=>y({},t,{values:e&&e.length>0?t.values.filter((t=>e.includes(t))).sort((0,l.A9Y)(e)):t.values})))),W=(0,r.path)(["facets","facetsData","type"]),q=e=>({entityTypeFacet:"equals",facetWithDropdownCheckboxes:"equals",numericRangeFacet:"range",dateRangeFacet:"range"}[e]),B=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="type"===(0,r.path)(["payload","facetFieldName"],e);return e.type===f.Z.CHANGE_VALUES&&t||e.type===f.Z.CLEAR_ALL_VALUES||e.type===h.Z.CLEAR_ALL},Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map((r=>{let a;switch(n){case l.$26.NUMERIC_RANGE_FACET:return`${(0,o.k7)(+r[0],1e4)} — ${(0,o.k7)(+r[1],1e4)}`;case l.$26.DATE_RANGE_FACET:return a=(0,p.C)().getRange(t,e),`${(0,o.XY)(u()(a[0]))} — ${(0,o.XY)(u()(a[1]))}`;case l.$26.ENTITY_TYPE_FACET:case l.$26.WITH_DROPDOWN_CHECKBOXES_FACET:default:return l.wSh.fromNull(e.find((e=>e.value===r))).orSome({label:r||""}).label}}))},Z=(0,r.pipe)((0,r.propOr)([],"values"),r.length,(0,r.gt)(r.__,d.wP)),V=(0,r.pipe)((0,r.pipe)((0,r.filter)(s._H),(0,r.map)((e=>({type:(0,l.To9)((0,r.path)(["attrType"],e)),codeValues:(0,r.flatten)((0,r.propOr)([],"values",e))}))),(0,r.filter)((e=>{let{codeValues:t}=e;return t.length>0}))),l.qWg),$=(e,t)=>(0,r.pipe)(V,(0,l.DVz)(t))(e)},36657:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(25952),a=n(17440);const l=e=>t=>{const n=t.entityType||t.entityTypeUri||"special",r=e.find((0,a.propEq)("id",n));return(0,a.propOr)([],"facets",r).find((0,a.propEq)("fieldName",t.fieldName))};var i=n(81403);const o=e=>t=>e.find((e=>e.fieldName===t.fieldName));function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,a.pipe)((e=>e.reduce(((e,t)=>(e[t.fieldName]=s({},t,{values:[...(0,a.propOr)([],"values",t),...(0,a.pathOr)([],[t.fieldName,"values"],e)]}),e)),{})),a.values),d=e=>(t,n)=>{if(n.entityType){const r=(0,i.h2W)(n.fieldName,n.entityType),a=(0,i.zeJ)(e,r);a&&(0===t.entityTypes.length&&t.entityTypes.push(n.entityType),t.entityTypes.includes(n.entityType)&&t.searchParams.push({fieldName:n.fieldName,filter:n.filter||"equals",uri:a.uri,values:n.values||[]}))}return t},p=e=>(t,n)=>{const r=e.find((e=>e.fieldName===n.fieldName));if(r){const e=(0,i.g5f)(r)?(0,i.fed)(n.values):n.values,l=(0,i.M5u)(r)&&n.showAllEntityTypes?n.showAllEntityTypes:null;return s({},t,{[n.fieldName]:(0,a.reject)(a.isNil,{fieldName:n.fieldName,values:e,showAllItems:l})})}return t};var m=n(58697),f=n.n(m),h=n(26507),y=n(578);function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=(0,a.curry)(((e,t,n,r)=>{const{uri:l}=r;return l&&!l.startsWith("special/")?((e,t)=>{let{uri:n,entityTypeUri:r,fieldName:l}=t;const o=(0,i.zeJ)(e,n);if(o){const t=((0,i.X3M)(e,(0,i.h2W)(l,r),r)||[]).map((0,a.pick)(["label","name"])).slice(0,-1);return g({uri:n,groupName:(0,i.jFi)(e,{type:r}),filterOptions:(0,i.d3Y)(o,l)},(0,h.Y2)(e,o,r,l,t))}return null})(e,r):((e,t,n,r)=>{let{fieldName:l}=r;const o=(0,y.Yg)({dataTenants:t,canUserReadWorkflowDataTask:n}).find((e=>e.attributes.find((e=>e.fieldName===l)))),s=o&&o.attributes.find((e=>e.fieldName===l));return s?g({groupName:o.title,filterOptions:(0,i.d3Y)(s.attrType,l)},(0,a.pick)(["title","fieldName","attrType","pageSize","orderType","dataTenant","fieldNameForRequest","dataTenantFieldName"],s)):null})(0,t,n,r)||((e,t,n)=>{let{fieldName:r,entityTypeUri:l}=n;const o=(0,a.pipe)((0,i.nt9)(e),(0,h.Q9)(t),(0,a.find)((0,a.propEq)("fieldName",r)))(l);return o?g({groupName:(0,i.jFi)(e,{type:l}),filterOptions:(0,i.d3Y)(o.attrType,r)},o):null})(e,t,r)}));var v=n(24097);const T=(0,a.curry)(((e,t,n,r,l)=>(0,a.pipe)((0,i.w3l)(e,r),(0,a.evolve)({data:E(e,t,n)}))(l)));var C=n(67679);const O="Preview",S={NoPreview:v.ll.LIST,[O]:v.cp,MapPreview:v.cp,TableView:v.ll.TABLE},A={[O]:v.om.PROFILE},N=e=>e.find((e=>e.selected))||{},R=(e,t,n)=>{const r=(0,C.wM)(e,t),l=n.reduce(((t,n)=>(t[n.entityTypeUri]=n.selectedAttributes.map((t=>{const n=(0,i.zeJ)(e,t);return{id:(0,i.Tde)(n.uri),label:n.label,attrType:n}})).filter((e=>!(0,i.YkM)(e.attrType))),t)),{});return(0,a.mergeDeepWith)(a.concat,r,l)};var w=n(78844),I=n(7066);const P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.options||[],n=t.find((0,a.propEq)("fieldName","searchByOv"));if(n){const e=(0,a.path)(["values",0],n);if("boolean"==typeof e)return{searchByOv:e,ovOnly:e}}return null};function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){_(e,t,n[t])}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const k=(e,t,n,s)=>{let{keyword:c=null,facets:u={},advanced:d=[],map:p,view:m,searchOptions:f,currentSavedSearchUri:h,currentTenant:y}=t;const g={map:p,keyword:c,searchOptions:f};if(d.some((e=>{let{attributes:t,entityTypes:n=[]}=e;return t.length||n.length}))?g.advanced=(0,i.Y5F)(E,e,d,n,s):g.facets=((e,t,n)=>{const s=(0,r.$t)(e);if(!t||0===t.length)return{facetsData:{},facetsConfigs:[s]};const c=t.type?t.type.values.filter((0,i.kuw)(e)):[],u=(0,r.Uv)(e,c,n),d=(0,a.pipe)((0,a.dissoc)("type"),a.values,(0,a.reduce)((e=>{const t=l(e);return(e,n)=>{const r=t(n);return r&&!e.find((0,a.propEq)("fieldName",n.fieldName))?[...e,r]:e}})(u),[s]))(t);return{facetsConfigs:d,facetsData:(0,a.pipe)((0,a.evolve)({type:(0,a.assoc)("values",c)}),(0,a.filter)(o(d)),(0,a.map)((0,a.omit)(["entityTypeUri"])))(t)}})(e,u,n),m){const t=m.tabs||{};Object.keys(t).forEach((n=>{t[n]=(t[n]||[]).map((t=>F({},t,{attrType:t.attrType?(0,i.zeJ)(e,t.attrType.uri)||t.attrType:void 0})))})),g.view={searchResultsMode:m.searchResultsMode||v.cp,entityTypeTab:m.entityTypeTab,sortField:m.sortField,sortOrder:m.sortOrder,searchResultsColumns:t,previewPanelMode:m.previewPanelMode||null}}return h&&(g.currentSavedSearchUri=h),y&&(g.currentTenant=y),g},D=(e,t,n,o,s)=>{const{facets:c={},advanced:m,view:h,curSavedSearchUri:y,useSeparateGroups:g}=t,b={keyword:(0,i.ERZ)(t),searchOptions:P(m)},E=((e,t,n)=>{const o=(0,r.$t)(e);if(!n||(0,a.isEmpty)(n))return{facetsData:{},facetsConfigs:[o]};const[s,c]=(0,a.partition)((e=>"tenants"===e.fieldName),n),m=(0,a.path)([0,"currentTenant"],s),[f,h]=(0,a.partition)((e=>"type"===e.fieldName),c),y=(0,a.chain)((0,a.propOr)([],"values"),f),g=(0,a.compose)(l,r.Uv)(e,y,t),b=(0,i.Jso)(h),E=(0,a.either)((0,a.pipe)((0,a.prop)("filter"),a.isNil),(0,a.propEq)("filter","equals")),v=b.some((e=>!g(e)||!E(e)));if(v)return{currentTenant:m,advanced:b.reduce(d(e),{entityTypes:y,searchParams:[]}),facetsConfigs:[],facetsData:{}};{const e=u(b),t=[o,...e.map(g)];return{currentTenant:m,facetsConfigs:t,facetsData:[...f,...e].reduce(p(t),{})}}})(e,o,c),{currentTenant:C,advanced:O}=E,_=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(E,["currentTenant","advanced"]),k=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{searchParams:o=[],fastSearchParams:s=[],entityTypes:c=[]}=r,u=[...o,...s].map(T(e,t,n,(0,i.Ug0)(e,c))).filter((e=>e&&e.data)),d=(0,a.curry)(((e,t)=>({id:f()(),operator:e,attributes:t,entityTypes:c}))),p=l?u.map((0,a.pipe)(i.FTe,d(v.YL.value))):(0,i.FTe)(d(v.qx.value,u));return(0,a.pipe)((0,i.CMB)(e),i.yRD,(0,a.reject)(i.qIF))(p)}(e,o,s,m||O,g);if(k.some((e=>{let{attributes:t}=e;return t.length}))){const{facetsData:t,facetsConfigs:n}=_,l=n.reduce(((e,n)=>F({},e,{[n.fieldName]:(0,r.DV)(n.fieldName,t[n.fieldName])})),{}),i=(0,w.h)(e,o,Object.values((0,I.t8)(l,n)));b.advanced=i.length>0?(D=k,x=i,(0,a.prop)("attributes",x.find((e=>e.attributes))).map((e=>D[0].attributes.push(e))),D):k}else b.facets=_;var D,x;return h&&(b.view=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{mode:r,tabs:l=[]}=t,{allowedEntityTypes:i}=n;return{searchResultsMode:S[r]||v.cp,previewPanelMode:A[r]||null,entityTypeTab:(0,a.propOr)(null,"entityTypeUri",N(l)),sortField:"label",sortOrder:"asc",searchResultsColumns:R(e,i,l)}}(e,h,n)),y&&(b.currentSavedSearchUri=y),C&&(b.currentTenant=C),b},x=(e,t,n,r,a)=>{try{const{version:l}=t;return"2.0"===l?k(e,t,r,a):D(e,t,n,r,a)}catch(e){return console.warn("Can't parse search state",e),{errors:Array.isArray(e)?e:[e]}}}},14476:(e,t,n)=>{n.d(t,{C:()=>o});var r=n(17440),a=n(52180),l=n(81403),i=n(55639);const o=e=>{const t=(0,i.Oz)(e),n=(e,n)=>t.toFixed(t.div(t.minus(e,n.offset),n.ratio),0);return{NumMath:t,getRange:(e,n)=>{const a=(0,r.pathOr)((0,r.pathOr)(null,["value",0],(0,r.head)(n)),[0,0],e),l=(0,r.pathOr)((0,r.pathOr)(null,["value",1],(0,r.last)(n)),[0,1],e);return null===a||null===l?[]:t.lessThanOrEqualTo(a,l)?[a,l]:[l,a]},formatNumberForRangeFacet:e=>t.greaterThan(e,1e4)?(0,i.k7)(e,1e4):e.toString(),getBarDomain:e=>e.length>0?[(0,r.head)(e).value[0],(0,r.last)(e).value[1]]:[],calcScale:(t,n)=>{if("Long"===e){const e=n.minus(t),r=e.div(2).gt(Number.MAX_SAFE_INTEGER)?new a.Decimal(Number.MAX_SAFE_INTEGER).mul(2).div(e):1,l=t.mul(r),i=n.mul(r);return{ratio:r,offset:l.lt(Number.MIN_SAFE_INTEGER)?new a.Decimal(Number.MIN_SAFE_INTEGER).minus(l):i.gt(Number.MAX_SAFE_INTEGER)?new a.Decimal(Number.MAX_SAFE_INTEGER).minus(i):0}}return{ratio:1,offset:0}},revertScale:n,applyScale:(e,n)=>Number(t.plus(t.mul(e,n.ratio),n.offset)),bigNumbersTickFormatterX:(e,t)=>r=>e(n(r,t)),adjustRange:(e,n,a)=>{const l=e[0],i=e[1];return[(0,r.isNil)(n)?l:t.max(l,n),(0,r.isNil)(a)?i:t.min(i,a)]},equals:function(){return t.equals(...arguments)},addRanges:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0;if(0===e.length)return[];const i=e[0].value,o=e[e.length-1].value,s=t.greaterThan(i,n)?(0,r.unfold)((e=>!!t.lessThan(e,i)&&[{value:e,number:0},t.plus(e,l)]),n):[],c=t.lessThan(o,t.minus(a,l))?(0,r.unfold)((e=>!!t.lessThanOrEqualTo(e,a)&&[{value:e,number:0},t.plus(e,l)]),t.plus(o,l)):[];return[...s,...e,...c]},getInterval:function(n,r){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return n===r?1:(0,l.Wos)(e)?(r-n)/a:t.ceil(t.div(t.minus(r,n),a))}}}},68973:(e,t,n)=>{n.d(t,{aG:()=>E,kH:()=>g,aw:()=>N,ti:()=>P,_9:()=>w,dW:()=>R,_k:()=>_,XP:()=>h,Jk:()=>V,_e:()=>y,rN:()=>F,P9:()=>x,eQ:()=>j,s4:()=>k,Bo:()=>T,Es:()=>D,kx:()=>O,cI:()=>C,hW:()=>A,qD:()=>p,$9:()=>S});var r=n(17440),a=n(81403),l=n(55639),i=n(34126);const o=(0,r.pipe)((e=>i.stringify(e,{strict:!1})),(e=>e?`?${e}`:""));var s=n(24097);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const p=e=>e.values&&e.values.length||e.rawFilter,m=e=>e.dataTenant?[{filter:"equals",fieldName:e.dataTenantFieldName,values:[e.dataTenant]}]:[],f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[(0,r.prop)("fieldNameForRequest"),t=>{let{fieldNameForRequest:n}=t,l=d(t,["fieldNameForRequest"]);const i=(0,r.cond)([...e,...a.LMI])(c({},l,{fieldName:n}));return(0,r.pipe)((0,a.Uqd)(),a.$bd)([{rawFilter:i},...m(l)])}]},h=(0,a.Uqd)([f()]),y=(0,r.pipe)((0,r.filter)(p),a.h27),g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sortOrder:n,sortField:l,select:i,forceOvOnly:c,searchOptions:u,activityFilter:d,globalFilter:p}=t,m=(0,r.pipe)(h,(0,a.vyX)(p))(e),f=t.page||0,y=t.rowsPerPage||s.Tu[0],g={filter:m||void 0,select:v(e,d,i),max:y,offset:f*y,sort:l||void 0,order:n||void 0,scoreEnabled:!1,options:(c?b(u,"ovOnly"):u)||void 0,activeness:d||void 0};return`entities${o(g)}`},b=(e,t)=>{const n=(e=e||"").split(",").filter(r.identity);return n.includes(t)?e:n.concat(t).join(",")},E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{select:r,searchOptions:a,activityFilter:l}=n,i={select:v(t,l,r),uris:e,options:b(a,"ovOnly")};return{url:"entities/_byUris",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}},v=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=s.Tv.concat(n);return t&&t!==a.YJ7.ACTIVE_ONLY&&l.push("startDate","endDate"),(0,r.uniq)(l).join(",")},T=(0,r.propOr)([],"businessCardAttributeURIs"),C=(0,r.compose)(r.flatten,(0,r.map)((e=>[e.latitude,e.longitude])),(0,r.propOr)([],"geoLocationAttributes")),O=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=a.wSh.fromNull(t.find((e=>"type"===e.fieldName&&e.values.length))).map((0,r.prop)("values")).orSome((0,r.pluck)("uri",e.entityTypes)),i=l.map((t=>{const r=(0,a.nt9)(e,t);return n.reduce(((e,t)=>e.concat(t(r))),[]).map(S)}));return(0,r.uniq)((0,r.flatten)(i).map(A))},S=a.Tde,A=(0,r.pipe)((0,r.split)("."),(0,r.slice)(0,2),(0,r.join)(".")),N=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{searchOptions:s,activityFilter:u,globalFilter:d}=l,p=1===e.length?m(e[0]):[],f=(0,r.pipe)((0,r.filter)((e=>e.forceInclude||!n.includes(e.fieldName))),(0,r.concat)(r.__,p),h,(0,a.vyX)(d))(t),y=e.map((e=>{const t={fieldName:e.fieldNameForRequest||e.fieldName,pageSize:e.pageSize,pageNo:1,orderType:e.orderType};return e.disableIncludeFilter||(t.includeFilter=e.includeFilter||e.values),t})),g=c({filter:f||void 0,options:s||void 0,activeness:u||void 0},i);return{url:`entities/_facets${o(g)}`,options:{method:"POST",body:JSON.stringify(y),headers:{"Content-Type":"application/json"}}}},R=function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const s=(0,l.zj)(),c=(0,l.dy)(),u=I(e,t,n,r,a,i);return`api/${s}/${c}/entities/potentialMatches${o(u)}`},w=function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const s=(0,l.zj)(),c=(0,l.dy)(),u=I(e,t,n,r,a,i);return`api/${s}/${c}/entities/matchScores${o(u)}`},I=(e,t,n,r,a,l)=>{const{searchOptions:i,activityFilter:o,globalFilter:s,dataTenant:c}=l;return{filter:_(r,a,s)||void 0,options:i||void 0,from:e,to:t,bars:n,activeness:o||void 0,dataTenant:c}},P=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:l,globalFilter:i}=r,s=d(r,["searchOptions","activityFilter","globalFilter"]),u=_(t.concat(m(e)),n,i),p={filter:u||void 0,options:a||void 0,activeness:l||void 0},f=[c({fieldName:e.fieldNameForRequest||e.fieldName,facetType:"histogram"},s)];return{url:`entities/_facets${o(p)}`,options:{method:"POST",body:JSON.stringify(f),headers:{"Content-Type":"application/json"}}}},F=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:l,globalFilter:i}=r,s=_(t.concat(m(e)),n,i),c={filter:s||void 0,options:a||void 0,activeness:l||void 0},u=[{fieldName:e.fieldNameForRequest||e.fieldName,facetType:"stats"}];return{url:`entities/_facets${o(c)}`,options:{method:"POST",body:JSON.stringify(u),headers:{"Content-Type":"application/json"}}}},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return(0,r.pipe)((0,r.filter)((e=>e.forceInclude||!t.includes(e.fieldName))),h,(0,a.vyX)(n))(e)},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{searchOptions:r,activityFilter:a,globalFilter:l}=n,i=_(e,t,l),s={filter:i||void 0,options:r||void 0,activeness:a||void 0};return o(s).slice(1)};function D(e){let{searchRequest:t,url:n,options:r,dataTenant:i,customerTenant:o,dtssPath:s}=e;return i?(0,a.yaA)({requestProvider:t,url:n,options:r,dataTenant:i,customerTenant:o,dtssPath:s}):t(`api/${(0,l.zj)()}/${o}/${n}`,r)}const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=k(e,t,n);return"entities/_total"+(r?`?${r}`:"")},j=e=>`api/${(0,l.zj)()}/${(0,l.dy)()}/entities/_total?${e}`,H=(0,r.path)(["data","attrType","type"]),L=(e,t)=>{let{orGroupIndex:n=0}=e;const{filters:l}=e,{values:i,filter:o,operator:s}=t;(0,a.jgw)(s)&&(n=(0,r.inc)(n));const c=(0,r.pathOr)({},["filters",n],e),u={filter:o,fieldName:(0,r.path)(["data","fieldName"],t),fieldNameForRequest:(0,r.path)(["data","fieldNameForRequest"],t),dataTenant:(0,r.path)(["data","dataTenant"],t),dataTenantFieldName:(0,r.path)(["data","dataTenantFieldName"],t),values:B(i),type:H(t),operator:s},d=(0,a.i29)(u);return c[d]=(0,r.concat)((0,r.propOr)([],d,c),[u]),{orGroupIndex:n,filters:(0,r.assoc)(n,c,l)}},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>e||(0,a.RsS)(t.children)||M(t.children)),!1)},U=e=>(t,n)=>{const l=(0,r.values)(n).map((t=>{const n=(0,r.path)([0,"operator"],t),l=(0,r.pipe)(a.M7o,a.h27)(t);return!e&&M(l)?{filter:t,operator:(0,r.cond)([[a.mfm,(0,r.always)("and")],[a.jgw,r.identity],[r.T,(0,r.always)(null)]])(n)}:{filter:t,operator:n}}));return(0,r.append)(l,t)},z=(e,t)=>({operand:e,operator:t}),G=(0,r.both)((0,r.propSatisfies)((0,r.lt)(1),"length"),(0,r.propSatisfies)(Array.isArray,0)),W=[[(0,r.propEq)("fieldName","rdmLookups.resolved"),e=>{let{fieldName:t,values:n}=e;return(0,a.sPt)({filter:a.j5E.EQUALS,fieldName:t,values:[!n[0]]})}],[(0,r.allPass)([(0,r.propEq)("filter",a.j5E.EQUALS),(0,r.propSatisfies)(G,"values"),(0,r.complement)((0,r.propEq)("fieldName","type")),(0,r.propSatisfies)((0,r.complement)(a.Lt4),"type")]),e=>{let{fieldName:t,values:n}=e;return(0,r.pipe)((0,r.map)((e=>e.length>1?(0,a.sH1)({fieldName:t,values:e,filter:"listEquals"}):(0,a.sPt)({fieldName:t,values:e,filter:"equals"}))),(0,a.v0l)(" and "))(n)}]],q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{const r=[...W,...e];return n.map((e=>z((0,a.Uqd)([f(r),...r],t)(e.filter),e.operator)))}},B=(0,r.pipe)((0,r.defaultTo)([]),(0,r.map)((0,r.when)((0,r.has)("value"),(0,r.prop)("value")))),Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[{filter:"equals",fieldName:"type",values:t}],r=(0,a.Uqd)()(n);return r+(r&&e?` and ${(0,a.$bd)(e)}`:e)},Z=e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])),V=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=e.map((0,r.evolve)({attributes:a.rxg})).filter(a.gk1).map((e=>{const l=(0,r.pipe)((0,r.prop)("attributes"),(0,r.filter)(a.Bgb),(0,r.reduce)(L,{filters:[]}),(0,r.prop)("filters"),Z,(0,r.reduce)(U(n),[]),(0,r.map)(q(t,n)),r.flatten,(0,r.filter)((e=>e.operand)),(0,r.map)((0,r.evolve)({operand:e=>(0,a.$bd)(e,!1)})),a.bji,a.fgW)(e);return z(Y(l,e.entityTypes),e.operator)})).filter((e=>e.operand));return(0,r.pipe)((0,r.ifElse)((0,r.pipe)(r.length,(0,r.lt)(1)),(0,r.map)((e=>z((0,a.$bd)(e.operand),e.operator))),r.identity),a.fgW)(l)}},67679:(e,t,n)=>{n.d(t,{gj:()=>p,kF:()=>f,oq:()=>h,oX:()=>y,m5:()=>b,wM:()=>O,nx:()=>A,vw:()=>N,tU:()=>R});var r=n(17440),a=n(87918),l=n.n(a),i=n(81403),o=n(24097),s=n(55639),c=n(68973),u=n(7066);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=e=>e===o.ll.TABLE,m=(0,r.curry)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=i.wSh.fromNull((0,i.nt9)(e,t)).orSome({});return y(n).concat(g((r.attributes||[]).concat(r.analyticsAttributes||[])))})),f=(0,r.memoizeWith)(((e,t)=>(0,s.Lt)(t)),m(r.__,r.__,["label"])),h=(e,t,n)=>n&&T(f(e,t),(e=>!n.some((t=>e.id===t.id)))),y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[{id:"label",label:l().text("Profile")},{id:"entityId",label:l().text("Entity ID")}].filter((t=>!e.includes(t.id)))},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(i.Uty).map((e=>{const t={id:(0,c.$9)(e.uri),label:e.label||(0,i.nIW)(e.uri),attrType:e},n=e.attributes||e.analyticsAttributes;return"Nested"===e.type&&n&&(t.children=g(n)),t}))},b=(e,t)=>{const n=E(e,t);return v(n)},E=(e,t)=>{let n=null;const r=e=>{e.some((e=>e.id===t?(n=e,!0):e.children?r(e.children,t):void 0))};return r(e),n},v=e=>(0,r.flatten)((e.children||[]).map((e=>e.children?v(e):[e]))),T=(e,t)=>e.filter(t).map((e=>e.children?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){d(e,t,n[t])}))}return e}({},e,{children:T(e.children,t)}):e)),C=(e,t,n)=>{const a=m(e,t);return(0,r.uniq)((0,r.pipe)((0,r.concat)(["label"]),(0,r.map)((e=>E(a,e))),(0,r.reject)(r.isNil),(0,r.filter)((0,r.pipe)((0,r.prop)("attrType"),(0,r.complement)(i.QZu))))(n))},O=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,u.wW)(e,{},t),l=(0,r.prop)("*",n);return a.reduce(((t,a)=>{const i=n[a.value]||l;return t[a.value]=(0,r.isNil)(i)?y():C(e,a.value,i),t}),{})},S=e=>(t,n)=>e.indexOf(t.value)-e.indexOf(n.value),A=function(e){let{entityTypes:t}=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const l=(0,r.pluck)("uri",t),i=S(l),o=S(a),s=n.filter((e=>{let{value:t}=e;return 0===a.length||a.includes(t)}));return(0,r.sort)(0===a.length?i:o,s)},N=e=>{const t=y();return(0,r.uniq)(e.filter((e=>!t.find((t=>t.id===e.id)))).map((0,r.pipe)((0,r.prop)("id"),c.hW)))},R=(e,t)=>{const n=N(e),a=N(t);return!(0,r.equals)((0,r.intersection)(n,a),n)}},28527:(e,t,n)=>{n.d(t,{v6:()=>a,cN:()=>i,al:()=>o,E7:()=>s});let r={};const a=e=>r=e,l=e=>r[e],i=()=>l("apiPath"),o=()=>l("imagePath"),s=()=>l("maxRecommended")||5},86564:(e,t,n)=>{n.d(t,{rp:()=>o,tj:()=>s,mH:()=>c,eX:()=>u,T4:()=>d});var r=n(585),a=n(81403),l=n(87918),i=n.n(l);const o=e=>{console.error(e),r.Z.addError({title:i().text("Server Error"),message:i().text("Something went wrong...")})},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];console.error(e),r.Z.addError({title:i().text("Error"),message:i().text("Can't apply search state")})},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];console.error(e),r.Z.addError({title:i().text("Error"),message:i().text("Saved Search can't be applied")})},u=e=>{console.error(e),r.Z.addError({title:i().text("Import Error"),message:i().text("Record can't be imported")})},d=e=>{console.error(e),r.Z.addError({title:i().text("Error"),message:(0,a.xU7)(e,i().text("Can't load entity"))})}},55639:(e,t,n)=>{n.d(t,{Lt:()=>$,XY:()=>X,k7:()=>V,zj:()=>Z,Oz:()=>J,dy:()=>Y,l0:()=>K,ZT:()=>Q,Uw:()=>B,sR:()=>W});var r={};n.r(r),n.d(r,{ceil:()=>T,clamp:()=>A,div:()=>f,equals:()=>S,floor:()=>v,greaterThan:()=>y,greaterThanOrEqualTo:()=>g,lessThan:()=>b,lessThanOrEqualTo:()=>E,max:()=>O,min:()=>C,minus:()=>m,mul:()=>h,plus:()=>p,toFixed:()=>N});var a={};n.r(a),n.d(a,{ceil:()=>j,clamp:()=>U,div:()=>I,equals:()=>M,floor:()=>x,greaterThan:()=>F,greaterThanOrEqualTo:()=>_,lessThan:()=>k,lessThanOrEqualTo:()=>D,max:()=>L,min:()=>H,minus:()=>w,mul:()=>P,plus:()=>R,toFixed:()=>z}),n(34126);var l=n(17440),i=n(28140),o=n(87918),s=n.n(o),c=n(95038),u=n.n(c),d=n(52180);const p=(e,t)=>new d.Decimal(e).add(t),m=(e,t)=>new d.Decimal(e).sub(t),f=(e,t)=>new d.Decimal(e).div(t),h=(e,t)=>new d.Decimal(e).mul(t),y=(e,t)=>(0,d.Decimal)(e).greaterThan(t),g=(e,t)=>new d.Decimal(e).greaterThanOrEqualTo(t),b=(e,t)=>new d.Decimal(e).lessThan(t),E=(e,t)=>new d.Decimal(e).lessThanOrEqualTo(t),v=e=>new d.Decimal(e).floor(),T=e=>new d.Decimal(e).ceil(),C=(e,t)=>d.Decimal.min(e,t),O=(e,t)=>d.Decimal.max(e,t),S=(e,t)=>new d.Decimal(e).equals(t),A=(e,t,n)=>{if(new d.Decimal(e).gt(t))throw new Error("min must not be greater than max in clamp(min, max, value)");const r=new d.Decimal(n);return r.lt(e)?e:r.gt(t)?t:n},N=(e,t)=>new d.Decimal(e).toFixed(t),R=(e,t)=>Number(e)+Number(t),w=(e,t)=>e-t,I=(e,t)=>e/t,P=(e,t)=>e*t,F=(e,t)=>Number(e)>Number(t),_=(e,t)=>Number(e)>=Number(t),k=(e,t)=>Number(e)<Number(t),D=(e,t)=>Number(e)<=Number(t),x=e=>Math.floor(e),j=e=>Math.ceil(e),H=(e,t)=>Math.min(e,t),L=(e,t)=>Math.max(e,t),M=(e,t)=>e===t,U=(e,t,n)=>(0,l.clamp)(Number(e),Number(t),Number(n)),z=(e,t)=>Number(e).toFixed(t);let G;const W=e=>{G=e};let q;const B=e=>{q=e},Y=()=>G,Z=()=>q?q.toString():"",V=((0,l.compose)(JSON.parse,JSON.stringify),(e,t)=>{if(!(0,i.hj)(e))return"";const n=J(d.Decimal.isDecimal(e)&&"Long");return n.lessThanOrEqualTo(e,Number.MAX_SAFE_INTEGER)&&n.greaterThanOrEqualTo(e,Number.MIN_SAFE_INTEGER)?n.greaterThan(e,t||1e3)?s().number(e,"0,0.0a").toUpperCase():s().number(e,"0,0[.]0"):n.greaterThan(e,t||1e3)?s().number(n.div(e,1e12),"0,0.0")+"T":e.toString()}),$=e=>`${Y()}_${Z()}_${e}`,X=e=>e.format(u().localeData().longDateFormat("L")),J=e=>"Long"===e?r:a,Q=()=>{},K=(0,l.memoizeWith)(l.identity,(e=>[e]))},19672:(e,t,n)=>{n.d(t,{Ic:()=>a,ET:()=>i});const r=(e,t)=>({get:e,set:t,compose:n=>r((t=>n.get(e(t))),((r,a)=>t(r,n.set(e(r),a))))}),a=e=>r((t=>t[e]),((t,n)=>Object.assign({},t,{[e]:n}))),l=e=>{return"string"==typeof e?a(e):(t=e,r((e=>e[t]),((e,n)=>((e=[...e])[t]=n,e))));var t},i=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.length?l(e).compose(i(...n)):l(e)}},28140:(e,t,n)=>{n.d(t,{Kn:()=>r,hj:()=>a});const r=e=>"object"==typeof e&&null!==e,a=e=>!isNaN(parseFloat(e))&&isFinite(e)},7043:(e,t,n)=>{n.d(t,{Z:()=>r});const r={container:"Headers-styles-container--xVHUC",title:"Headers-styles-title--2f-Hk",actionsBar:"Headers-styles-actionsBar--3znSF",splitter:"Headers-styles-splitter--2cuCI",headerIcon:"Headers-styles-headerIcon--24r6n",previewSwitcher:"Headers-styles-previewSwitcher--IJ7aJ",tabsContainer:"Headers-styles-tabsContainer--33mAP",number:"Headers-styles-number--1bDWm"}}}]);
package/9838.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9838],{98808:(e,t,n)=>{n.d(t,{K:()=>m,N:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg 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}})));var c=n(31276),u=n(88611),d=n(8818);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}let h;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(h||(h={}));const m=(0,r.forwardRef)(((e,t)=>{let{className:n,mode:r=h.iconButton,label:i,disabled:m,icon:g,onClick:f=c.ZT,onMenuClose:b=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const v=s();return(()=>{switch(r){case"iconButton":return o().createElement(d.k,p({disabled:m,className:a()(v.iconButton,n),size:"S",tooltipTitle:i,onClick:f,icon:g},y));case"button":return o().createElement(l.Button,p({className:a()(v.button,n),disabled:m,startIcon:o().createElement(g,null),onClick:f,color:"primary",classes:{startIcon:v.startIcon,label:v.label}},y),o().createElement(u.C,{value:i},o().createElement("div",{className:v.overflowStyle},i)));case"menuItem":{const e=()=>{b(),f()};return o().createElement(l.MenuItem,p({classes:{root:v.menuItem},onClick:e,disabled:m,ref:t},y),o().createElement(o().Fragment,null,o().createElement(g,{className:v.menuIcon}),o().createElement(l.Typography,{classes:{root:v.menuText}},i)))}}})()}));m.displayName="ActionButton"},30739:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(81403);const s=(0,n(79692).Z)({item:{overflow:"hidden"}});function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:u,data:d,children:p,itemKey:h,showNotMeasuredItems:m,listRef:g}=e;const f=s(),b=(0,r.useRef)({}),[y,v]=(0,r.useState)({}),x=(0,r.useCallback)((0,l.DsO)((()=>{v(c({},b.current))})),[]),E=(0,r.useCallback)(((e,t)=>h?h(t,e):t),[h]),w=(0,r.useRef)(),C=g||w;C.current&&C.current.resetAfterIndex(0,!1);const T=(0,r.useMemo)((()=>e=>{let{data:t,index:n,style:r}=e;const i=E(t,n);return o().createElement("div",{style:r,className:f.item},o().createElement("div",{style:m?void 0:{visibility:i in y?void 0:"hidden"}},o().createElement(a.Z,{handleHeight:!0,onResize:(e,t)=>{b.current[i]!==t&&(((e,t)=>{b.current=c({},b.current,{[e]:t})})(i,t),x())}}),p({data:t,index:n})))}),[p,m,E,x,!m&&y]);return o().createElement(i.VariableSizeList,{ref:C,width:t,height:n,itemCount:d.length,itemData:d,itemSize:e=>y[(e=>E(d,e))(e)]||u,itemKey:h},T)}))},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),o=n.n(r),i=n(24328),a=n.n(i),l=n(71153),s=n.n(l),c=n(94079),u=n(87918),d=n.n(u),p=n(31276),h=n(17440);const m=(0,n(79692).Z)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none"},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px"},selectRoot:{marginLeft:"5px",marginRight:"36px"},select:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right"},actions:{marginLeft:"32px"}});function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:o,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=m(),x=(0,i.useCallback)((()=>{(0,h.pathOr)(h.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,i.useCallback)((e=>{l(e),x()}),[l,x]),w=(0,i.useCallback)((e=>{l(0),f(e),x()}),[l,f,x]);return a().createElement(c.TablePagination,{classes:g({},t,{root:s()(v.pagination,t.root),select:s()(v.select,t.select),caption:v.caption,selectRoot:v.selectRoot,actions:v.actions}),component:"div",labelRowsPerPage:y||d().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return d().text("${fromRow}-${toRow} of ${countRows}",{fromRow:d().number(t,"0,0"),toRow:d().number(n,"0,0"),countRows:d().number(r,"0,0")})},count:n,rowsPerPageOptions:r,page:o,onChangePage:(0,h.pipe)((0,h.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,h.pipe)(p.NA,w)})};b.propTypes={classes:o().object,rowsPerPageOptions:o().arrayOf(o().number),count:o().number,page:o().number,onChangePage:o().func,rowsPerPage:o().number,onChangeRowsPerPage:o().func,basicTableRef:o().shape({current:o().object}),labelRowsPerPage:o().string};const y=a().memo(b)},10237:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(27556),o=n(13980),i=n.n(o),a=n(24328),l=n.n(a);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=(0,a.forwardRef)(((e,t)=>{let{children:n,className:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const a=u();return l().createElement(r.Z,d({ref:t,className:o,classes:{root:a["basic-view__paper"]}},i),n)}));p.displayName="BasicView",p.propTypes={children:i().node,className:i().string};const h=p},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079);const s=(0,n(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"}}),c=e=>{let{open:t,title:n,content:r,onCancel:i,cancelCaption:c=a().text("Cancel"),onDiscard:u,discardCaption:d="",onSave:p,saveCaption:h=a().text("Save"),disabledSave:m=!1}=e;const g=s();return o().createElement(l.Dialog,{open:t,onClose:i,classes:{paperScrollPaper:g.paper}},o().createElement(l.DialogTitle,{classes:{root:g.title}},n),o().createElement(l.DialogContent,{classes:{root:g.content}},o().createElement(l.DialogContentText,{classes:{root:g.contentText}},r)),o().createElement(l.DialogActions,{className:g.actionButtons,disableSpacing:!0},i&&o().createElement(l.Button,{onClick:i},c),o().createElement("div",null,u&&o().createElement(l.Button,{onClick:u,classes:{root:g.discardButton}},d),o().createElement(l.Button,{onClick:p,color:"primary",disabled:m,autoFocus:!0},h))))}},14363:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(79692).Z)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(20562),i=n(24328),a=n.n(i),l=n(52730),s=n(59431),c=n(81403),u=n(91262),d=n(71153),p=n.n(d),h=n(17440),m=n(7154),g=n(26579),f=n(81077);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y=e=>{let{connection:t,relatedEntity:n,inRelationTypes:d=[],outRelationTypes:y=[],showEmptyEditors:v,entityErrorMessage:x,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:T,onChangeEntity:O}=e;const R=r(),{relation:S,entity:P}=t,{attributes:N,uri:L,type:j="",direction:k}=S||{},_=Boolean(j),I=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>S&&function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}({attributes:N},(0,c.p2l)(S))),[S,N]),D=(0,i.useMemo)((()=>(0,c.xF8)(I,j)),[j,I]),Z=(0,i.useMemo)((()=>_?(0,c.jWj)(k===c.Nsj.OUT,I,[(0,c.V3K)(I,j)]):(0,h.uniq)((0,c.jWj)(!0,I,y).concat((0,c.jWj)(!1,I,d)))),[_,j,I,d,y]),U=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),z=(0,i.useMemo)((()=>S&&{relationType:S.type,direction:S.direction}),[S]),B=(0,i.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,c.idV)(P.label)}),[P]),M=(0,i.useMemo)((()=>P&&P.uri?d.filter((0,c.eHk)(!1,P,n,I)):d),[P,d,n,I]),F=(0,i.useMemo)((()=>P&&P.uri?y.filter((0,c.eHk)(!0,P,n,I)):y),[P,y,n,I]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(d,y)||{};!j&&e&&T&&T({type:e.uri,direction:t})}),[j,d,y,T]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(M,F)||{};!j&&e&&T({type:e.uri,direction:t})}),[j,P,M,F,O]);const q=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;T({type:t.uri,direction:n})}),[T]);return a().createElement(a().Fragment,null,T&&a().createElement(m.Z,{className:R.item,relation:z,metadata:I,inRelationTypes:d,outRelationTypes:y,onChange:q}),O&&a().createElement(g.Z,{errorMessage:x,className:R.item},a().createElement(f.Z,{key:j,className:p()({[R.dense]:x}),entity:B||{},entityTypesUris:Z,max:20,globalSearchRequestOptions:U,mode:c.fO_.EDITING,onChange:O,onCreate:void 0,metadata:I,attributeTypesSelectionStrategy:void 0})),j&&a().createElement(u.Z,{attrTypes:D,entity:A,showEmptyEditors:v,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},7154:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(81403),s=n(17440),c=n(89846),u=n(27185);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:i=[],onChange:a=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:p=!1}=e,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:m,fromEditorValue:g,toEditorValue:f}=(0,c.n)({reversedContextLabels:p}),b=(0,r.useMemo)((()=>m(n,i)),[m,n,i]),y=(0,r.useCallback)((0,s.pipe)(g(n,i),a),[g,n,i,a]),v=!!t.relationType;return(0,r.useEffect)((()=>{l&&b.length&&!v&&y(b[0])}),[b,l,y,v]),o().createElement(u.Z,d({value:f(t,b),options:b,onChange:y},h))};p.propTypes={className:a().string,relation:l.bNA,inRelationTypes:a().arrayOf(l.IYE),outRelationTypes:a().arrayOf(l.IYE),applyFirstByDefault:a().bool,reversedContextLabels:a().bool,onChange:a().func};const h=p},68439:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(94079),c=n(81403),u=n(59431);const d=(0,n(79692).Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),p=e=>{let{entity:t,className:n,size:r="small"}=e;const a=d(),p=(0,i.useSelector)(u.ZP.selectors.getMetadata),h=t.type,m=(0,c.nt9)(p,h)||{},g=(0,c.VD3)(p,m,"typeColor")||c.rSc.palette.primary.main;return o().createElement(s.Typography,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},59725:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(81403),s=n(42520);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:h={},disabled:m=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.oDv)),[t]);return o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:h,disabled:m,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},93416:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(92778);const s=(0,n(79692).Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),c=e=>{let{className:t,title:n,children:r}=e;const i=s();return o().createElement(l.Z,{title:n,classes:{root:a()(i.container,t),title:i.title}},r)}},42520:(e,t,n)=>{n.d(t,{S:()=>L});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17440),s=n(81403),c=n(94079),u=n(83543),d=n(79692);const p=(0,d.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),h=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:o}=t;if(n.length>0){const[t]=Array.from(n),i=document.createRange();i.setStart(t,0);for(let n=0;n<e.length;n++){i.setEnd(t,i.endOffset+e[n].length);const{width:a}=i.getBoundingClientRect();if(r+a>o)return n;n!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1},m=e=>e.join(", "),g=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,f=e=>{let{list:t,maxWidth:n}=e;const i=p(),a=(0,r.useRef)(),[l,s]=(0,r.useState)(0);(0,r.useEffect)((()=>{s(((e,t)=>{const n=e.length,r=((e,t)=>{if(t){const n=h(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,a.current))}),[t]);const u=m(t),d=l>0,f=d?m(t.slice(0,-l)):u;return o().createElement(c.Tooltip,{title:d?u:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:g(n)},className:i.listLabel,ref:a},u),o().createElement("div",{className:i.visibleItemsLabel},f),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var b=n(22385),y=n(97820),v=n(54763),x=n(7785),E=n(27239),w=n(44890);function C(){return C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}const T=(0,l.always)(32),O=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:i,height:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return o().createElement(w.Z,C({getItemSize:T,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(x.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(E.Z,{text:l.label,highlight:l.filterText}),labelInText:l.label,style:e,isFocused:c,hideIcon:!0,LogoIcon:l.LogoIcon})},focusIndex:r,fixedTitle:!1,disableHorizontalScrollbar:!0,width:i,height:a},l))}));O.displayName="SelectMetadataTypesList";const R=(0,d.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:d,onChange:p,ListLabelProps:h={},disabled:m,enableEmptyValueUnderline:g,single:x,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const T=R(),[N,L]=(0,r.useState)(!1),j=(0,r.useCallback)((()=>L(!0)),[]),k=(0,r.useCallback)((()=>L(!1)),[]),[_,I]=(0,r.useState)(""),A=(0,r.useCallback)((()=>I("")),[]),D=(0,r.useCallback)((0,l.pipe)(A,k),[k,A]),Z=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,_)})).map(((e,t)=>({item:{item:P({},e,{filterText:_})},index:t}))),U=(0,r.useMemo)((()=>d.map((e=>i.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[d,i]),z=(0,r.useCallback)(((e,t)=>{x?(p(t?[e.uri]:[]),D()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,x,D]),B=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);z(t,n)}),[d,z]),{focusIndex:M,handleKeyDown:F}=(0,v.t)({items:Z,open:N,onSelectFocusedItem:B,selectedItems:d,onClose:D}),q=(0,r.useRef)(),G=q.current?q.current.getBoundingClientRect().width:0,H=Math.max(G,255),V=0===d.length;return o().createElement(o().Fragment,null,o().createElement(c.TextField,{label:E,ref:q,InputProps:{startAdornment:V&&!t?null:o().createElement("div",{className:a()(T.inputText,n.inputText)},V?o().createElement("div",null,t):o().createElement(f,S({},h,{list:U}))),classes:{root:T.inputRoot,input:a()(T.input,n.input,{[T.emptyInput]:V&&!t}),disabled:a()(T.disabledInput,{[T.disabledPointer]:m}),underline:T.disabledUnderline},endAdornment:o().createElement(b.Z,{size:"L",icon:u.Z,iconClassName:a()(T.icon,{[T["popup-opened-icon"]]:N}),disabled:m}),readOnly:!0,disabled:!0,disableUnderline:V&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(T.inputLabel,n.label)}},value:"",onClick:m?void 0:j,classes:{root:a()(T.root,n.root)},margin:"dense",variant:"filled",disabled:m,"data-reltio-id":w}),o().createElement(y.Z,{open:N,anchorEl:q.current,onClose:D,onSearch:I,title:C,containerWidth:H,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(O,{items:Z,onItemClick:z,selectedItems:d,width:H,height:245,focusIndex:M})))}));L.displayName="MetadataTypesSelector"},57304:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(94079),p=n(87918),h=n.n(p),m=n(81403),g=n(59431),f=n(53180),b=n(68439);const y=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),v=e=>{let{className:t,entity:n,children:i,classes:a}=e;const l=y({classes:a}),p=(0,c.useSelector)(g.ZP.selectors.getMetadata),v=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,m.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const x=(0,m.idV)(n.label),E=n.secondaryLabel,w=(0,m.ptG)(p,n),C=(0,m.Fn9)(n),T=n.uri,O=(0,m.BTI)(n);return o().createElement("div",{className:s()(l.profileBandWrapper,t)},o().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!C}),"data-entity-uri":T},o().createElement(f.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),o().createElement("div",{className:l.profileInfo},o().createElement("div",null,o().createElement(d.Typography,{variant:"h6",className:l.label},x),E&&o().createElement(d.Typography,{variant:"subtitle2",className:l.secondaryLabel},E),w&&o().createElement(d.Typography,{variant:"subtitle1",className:l.businessCard},w)),o().createElement("div",{className:l.specialInfo},o().createElement("div",{className:l.entityType},o().createElement(b.Z,{entity:n,size:"medium",className:l.badge}),!(0,m.ZiX)(T)&&o().createElement(d.Tooltip,{title:h().text("Copy to clipboard")},o().createElement(d.Typography,{display:"inline",variant:"body2",className:l.entityId,onClick:v},h().text("Entity ID"),": ",O))))),i&&o().createElement("div",null,i)))};v.propTypes={className:a().string,entity:a().object,children:a().node,classes:a().object};const x=v},93873:(e,t,n)=>{n.d(t,{a:()=>P});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079),s=n(83348),c=n(8818),u=n(67766),d=n(42767),p=n(81403);const h=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),m=(0,s.Z)(l.Link),g=e=>{let{total:t=0,onPrev:n,onNext:r,onSearchResultsClick:i,isPrevDisabled:l,isNextDisabled:s}=e;const g=h();return o().createElement("div",{className:g.container},o().createElement(m,{className:g.link,component:"button",variant:"caption",onClick:i,underline:"none",tooltipTitle:a().text("Go to search results")},(0,p.k7L)(t,1e6)," ",1===t?a().text("Search result"):a().text("Search results")),o().createElement(c.k,{size:"L",icon:u.Z,tooltipTitle:a().text("Go to previous profile"),onClick:n,disabled:l,showForDisabled:!0}),o().createElement(c.k,{size:"L",icon:d.Z,tooltipTitle:a().text("Go to next profile"),onClick:r,disabled:s,showForDisabled:!0}))};var f=n(52730),b=n(59431),y=n(17440),v=n(39450),x=n(67218);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){w(e,t,n[t])}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class C{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:o},tenant:i,searchTenant:a,apiPath:l,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]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[t.getQueryFilter(),...e],o=E({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,p.uqV)({filters:r,options:o,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,p.ZOr)(r,o)},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,p.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,p.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=r,this.sortOrder=o,this.tenant=i,this.searchTenant=a,this.apiPath=l,this.dtssPath=s,this.globalSearchRequestOptions=c}}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class R{constructor(e){var t=this;let{data:n,tenant:r,apiPath:o}=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]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[{rawFilter:t.searchBody.filter},...e];return(0,p.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:T({},t.searchBody,{filter:e.length?(0,p.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,p.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,p.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=o}}const S=(e,t)=>(0,y.pipe)((0,y.map)((0,y.prop)("uri")),(0,y.reject)((e=>t.includes(e))))(e),P=()=>{const{total:e,onPrev:t,onNext:n,onSearchResultsClick:i,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,x._)(),t=(0,x._)(),n=(0,x._)(),{uri:o,index:i,total:a,tenant:l,cache:s}=(0,f.useSelector)(b.ZP.selectors.getSearchNavigationData)||{},{type:c,data:u}=(0,f.useSelector)(b.ZP.selectors.getSearchProviderData)||{},d=(0,f.useSelector)(b.ZP.selectors.getTenant),h=(0,f.useSelector)(b.ZP.selectors.getApiPath),m=(0,f.useSelector)(b.ZP.selectors.getDtssPath),g=(0,f.useSelector)((e=>b.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),y=(0,r.useContext)(v.m),E=(0,f.useDispatch)(),[w,T]=(0,r.useState)(!1),O=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new C(t);case"graphsearch":return new R(t)}})(c,{data:u,tenant:d,searchTenant:l,apiPath:h,dtssPath:m,globalSearchRequestOptions:g})),[c,u,d,l,h,m,g]),P=(0,r.useCallback)((e=>{E(b.yC.actions.updateSearchNavigationDataFields(e))}),[E]),N=(0,r.useCallback)((e=>{const t=d!==l?(0,p.wwR)({uri:e,dataTenant:l}):e;E(b.ui.actions.openEntity({uri:t,viewId:y,source:"navigation"}))}),[E,y,d,l]),L=(0,r.useCallback)((()=>{E(b.ui.actions.openPerspective({perspectiveId:c,viewId:y}))}),[E,c,y]);(0,r.useEffect)((()=>{i>=a?P({index:a-1}):i<0&&P({index:0})}),[a,i,P]);const j=(0,r.useCallback)(((e,r,o)=>{T(!0),t(O.requestTotal()).then((e=>P({total:e})));const i=o+1;return n(O.requestEntities(15,i)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return P({cache:e.concat(n),uri:n[0],index:i+t.length-n.length}),void N(n[0]);if(o+t.length<r-1)return j(e,r-t.length,o+t.length)}P({index:i})}})).finally((()=>{T(!1)}))}),[O,P,N]),k=(0,r.useCallback)(((e,r)=>{T(!0),t(O.requestTotal()).then((e=>P({total:e})));const o=r-1,i=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(O.requestEntities(a,i)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return P({cache:n.concat(e),uri:n[n.length-1],index:o-(t.length-n.length)}),void N(n[n.length-1]);if(r-t.length>0)return k(e,r-t.length)}P({index:0})}})).finally((()=>{T(!1)}))}),[O,P,N]),_=(0,r.useCallback)(((t,n,r,o)=>{if(n<t.length){const i=t[n];return T(!0),e(O.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),_(e,n,r-1,o)}P({index:o+1,uri:i,cache:t,total:r}),N(i)})).finally((()=>{T(!1)}))}if(!(o>=r-1))return j(t,r,o);P({cache:t,total:r,index:r-1})}),[O,P,N,j]),I=(0,r.useCallback)(((t,n,r,o)=>{if(n>-1){const i=t[n];return T(!0),e(O.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),I(e,n-1,r-1,o-1)}P({index:o-1,uri:i,cache:t,total:r}),N(i)})).finally((()=>{T(!1)}))}if(!(o<=0))return k(t,o);P({index:0,cache:t,total:r})}),[O,P,N,k]),A=(0,r.useCallback)((()=>{if(s&&o){const e=s.indexOf(o)-1;I(s,e,a,i)}}),[I,s,o,a,i]),D=(0,r.useCallback)((()=>{if(s&&o){const e=s.indexOf(o)+1;_(s,e,a,i)}}),[_,s,o,a,i]);return{total:a,onPrev:A,onNext:D,onSearchResultsClick:L,isPrevDisabled:w||i<=0,isNextDisabled:w||i>=a-1}})();return(()=>{const{cache:e}=(0,f.useSelector)(b.ZP.selectors.getSearchNavigationData)||{},t=(0,f.useSelector)(b.ZP.selectors.getMode),n=(0,f.useSelector)(b.ZP.selectors.getEntity);return(0,p.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?o().createElement(g,{total:e,onPrev:t,onNext:n,onSearchResultsClick:i,isPrevDisabled:a,isNextDisabled:l}):null}},32371:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(81403),s=n(42520);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:h={},disabled:m=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.Tt2)),[t]);return o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:h,disabled:m,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},39827:(e,t,n)=>{n.d(t,{G:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(8818),s=n(79692),c=n(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 d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const h=e=>{let{buttonsProps:t,activeIndexId:n,className:r,onButtonClick:i,classes:s={}}=e;const c=u(),{active:h,buttonWrapper:m}=s,g=p(s,["active","buttonWrapper"]);return o().createElement("div",{className:a()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return o().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:a()({[a()(c.active,h)]:n===t},c.buttonWrapper,m),onClick:()=>i(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>a});var r=n(24328),o=n.n(r);const i=(0,n(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})}}))),a=e=>{let{width:t,open:n,children:r}=e;const a=i();return o().createElement("div",{className:a.contentWrapper,style:{width:`${n?t:0}px`}},n&&o().createElement(o().Fragment,null,r))}},8962:(e,t,n)=>{n.d(t,{Z:()=>j});var r=n(52730),o=n(59431),i=n(24328),a=n.n(i),l=n(81403),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(94079),h=n(60995),m=n(10237),g=n(93416),f=n(80931),b=n(8261),y=n(79692);const v=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),x=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:y=[],includeUris:x=[],attributesCount:E=16}=e;const w=v(),C=(0,r.useSelector)(o.ZP.selectors.getPivotingAttributes),T=(0,i.useMemo)((()=>(0,b.U)(s,n.type,x,y)),[y,x,s,n.type]),O=(0,l.fyF)(T,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return O||!(0,l.O27)(u)?a().createElement(h.J.Provider,{value:C},a().createElement(m.Z,{className:t},u&&a().createElement(g.Z,{className:w.header,title:u}),a().createElement(p.Box,{className:c()(w.attributesContainer,{[w.noCaption]:!u})},O?a().createElement(f.Z,{entity:n,attrTypes:T,parentUri:n.uri,drawLines:!1,max:E}):a().createElement(p.Typography,{className:w.noData},d().text("No data found"))))):null}));var E=n(17440),w=n(91262),C=n(39450),T=n(66784);const O=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:h=[],includeUris:f=[],pinnedAttributes:y}=e;const v=O(),x=(0,r.useDispatch)(),S=(0,i.useContext)(C.m),P=(0,r.useSelector)(o.ZP.selectors.getUserRoles),N=(0,i.useMemo)((()=>(0,l.mC3)(y,P)),[y,P]),L=(0,r.useSelector)((e=>o.ZP.selectors.getModifiedEntity(e,n.uri)||{})),j=(0,i.useMemo)((()=>(0,b.U)(u,L.type,f,h)),[h,f,u,L.type]),k=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.addAttributes,x)(e.map((e=>R({},e,{viewId:S}))))),[S,x]),_=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.modifyAttribute,x)(R({},e,{viewId:S}))),[S,x]),I=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.removeAttribute,x)(R({},e,{viewId:S}))),[S,x]);return a().createElement(m.Z,{className:t},d&&a().createElement(g.Z,{className:v.header,title:d}),a().createElement(p.Box,{className:c()(v.attributesContainer,{[v.noCaption]:!d})},a().createElement(T.c.Provider,{value:N},a().createElement(w.Z,{entity:L,attrTypes:j,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:k,onChangeAttribute:_,onDeleteAttribute:I}))))}));var N=n(3185);function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}const j=(0,r.connect)(((e,t)=>({entity:t.entity||o.ZP.selectors.getEntityWithDiff(e),mode:t.mode||o.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["mode","attributesCount","pinnedAttributes","entity"]);return a().createElement(N.u.Provider,{value:o},(0,l.uzs)(t)?a().createElement(x,L({attributesCount:n,entity:o},i)):a().createElement(P,L({mode:t,pinnedAttributes:r,entity:o},i)))}))},27185:(e,t,n)=>{n.d(t,{Z:()=>T});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(87918),s=n.n(l),c=n(17440),u=n(71153),d=n.n(u),p=n(94079);const h=(0,n(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 m=n(31254),g=n(88611);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}const b=e=>{let{innerRef:t,innerProps:n,selectOption:r,data:i}=e;const a=h(),{value:l,label:s,startObject:c,endObject:u}=i,b=c.objectType.label+" ↔ "+u.objectType.label;return o().createElement(p.MenuItem,f({className:a.container,ref:t,key:l,onClick:()=>r({label:s,value:l,startObject:c,endObject:u})},n),o().createElement("div",{className:a.icons},o().createElement(m.Z,{className:a.iconTop,entityType:c.objectType}),o().createElement(m.Z,{className:a.iconBottom,entityType:u.objectType})),o().createElement("div",{className:a.text},o().createElement(g.C,{value:s},o().createElement(p.Typography,{className:d()(a.textItem,a.primaryTextItem)},s)),o().createElement(g.C,{value:b},o().createElement(p.Typography,{color:"textSecondary",className:d()(a.textItem,a.secondaryTextItem)},b))))};b.propTypes={innerRef:a().oneOfType([a().oneOf([null]),a().func,a().shape({current:a().any.isRequired})]),innerProps:a().object.isRequired,selectOption:a().func.isRequired,data:a().shape({value:a().string.isRequired,label:a().string.isRequired,startObject:a().object,endObject:a().object})};const y=b;var v=n(24737);function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:i=c.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","options","onChange","TextFieldProps"]);const u=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return o().createElement(v.Z,x({value:t,options:n,onChange:i,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:u},l))},C=a().shape({label:a().string.isRequired,value:a().string.isRequired,startObject:a().object,endObject:a().object});w.propTypes={value:C,options:a().arrayOf(C),onChange:a().func};const T=w},78620:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(24328),o=n(81403),i=n(17440),a=n(52730),l=n(59431);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const u=(0,a.useSelector)(l.ZP.selectors.getMetadata),d=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),d),[t.relation,d]),h=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),d),[t.relation,d]),m=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),d),[t.relation,d]),g=(0,r.useCallback)((e=>{let{type:r,direction:i}=e;const a={entity:t.entity&&(0,o.eHk)(i===o.Nsj.OUT,t.entity,c,u,(0,o.V3K)(u,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,u]);return{onAddAttributes:p,onChangeAttribute:h,onRemoveAttribute:m,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},89846:(e,t,n)=>{n.d(t,{n:()=>a});var r=n(24328),o=n(81403),i=n(17440);const a=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,r.useCallback)(((e,n)=>{const r={},a=(0,i.pipe)(o.PjQ,(0,i.tap)((e=>r[e]=(0,i.propOr)(0,e,r)+1))),l=(0,i.ascend)((0,i.prop)("label")),s=(0,i.curry)(((e,n)=>{let{uri:r,label:i,startObject:l,endObject:s}=n;const c=e===(t?o.Nsj.OUT:o.Nsj.IN)?l:s;return{label:{directionalLabel:a(c),typeLabel:i},value:`${r},${e}`,startObject:l,endObject:s}}));return e.map(s(o.Nsj.IN)).concat(n.map(s(o.Nsj.OUT))).map((0,i.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(l)}),[t]),fromEditorValue:(0,r.useCallback)(((e,t)=>n=>{const[r,a]=n.value.split(",");return{type:(a===o.Nsj.IN?e:t).find((0,i.propEq)("uri",r)),direction:a}}),[]),toEditorValue:(0,r.useCallback)(((e,t)=>t.find((0,i.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},59838:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Dn});var r=n(24328),o=n.n(r),i=n(52730),a=n(36138),l=n(585),s=n(22664),c=n(52844),u=n(59431),d=n(99136),p=n(98996),h=n(17440),m=n(81403),g=n(87918),f=n.n(g),b=n(60715),y=n(35174);function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){x(e,t,n[t])}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.relations.filter((e=>!n.includes(e))).filter((0,h.either)((0,h.pipe)(m.nqN,(0,h.equals)(e)),(0,h.pipe)(m.j5q,(0,h.equals)(e))));n.push(...r);const o=(0,h.pipe)(w,(0,h.without)([e]))(r);return o.forEach((e=>E(e,t,n))),n},w=e=>(0,h.pipe)((0,h.chain)((e=>[(0,m.nqN)(e),(0,m.j5q)(e)])),h.uniq)(e),C=(e,t)=>{const n=(e=>{var t;const n=new Set,r=new Set;e.entities.forEach((e=>n.add(e.uri))),((null===(t=e.relations)||void 0===t?void 0:t.filter((e=>n.has(e.startObject.objectURI)&&n.has(e.endObject.objectURI))))||[]).forEach((e=>{r.add(`${e.startObject.objectURI}--${e.endObject.objectURI}--${e.uri}--${e.type}--${e.direction}`)}));const o=e.entities.map((e=>({id:e.uri,name:e.label,entityTypeUri:e.type,traversedRelationsCount:e.traversedRelations,untraversedRelationsCount:e.untraversedRelations}))),i=[];return r.forEach((e=>{const[t,n,r,o,a]=e.split("--");i.push({from:t,to:n,key:r,relationTypeUri:o,direction:a})})),{nodes:o,edges:i}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,m.idV)(t.name),entityTypeUri:t.entityTypeUri,traversedRelationsCount:t.traversedRelationsCount,untraversedRelationsCount:t.untraversedRelationsCount,x:1,y:1})})),n.edges.forEach((t=>{const n=t.from===t.to;e.hasEdge(t.key)||e.addEdgeWithKey(t.key,t.from,t.to,{size:1,color:"rgba(0, 0, 0, 0.2)",forceLabel:n,loop:n,relationTypeUri:t.relationTypeUri,direction:t.direction})}))},T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.neighbors(e).filter((e=>!n.includes(e)));return n.push(...r),r.forEach((e=>T(e,t,n))),n};var O=n(67218);const R=e=>{const[t,n]=(0,r.useState)(null),[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,g]=(0,r.useState)(!1),x=null==e?void 0:e.uri,R=(0,m.biM)(e),S=(0,i.useSelector)(u.ZP.selectors.getMetadata),P=(0,O._)(),N=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return P((0,m.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}))}),[t,P]);(0,r.useEffect)((()=>(!x||(0,m.ZiX)(x)||R||(g(!0),(0,m.ZYI)({uri:x,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;C(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)}))),()=>{a(null),c(null),g(!1)})),[x,R,l,t]);const L=(0,r.useCallback)((e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;return g(!0),(0,m.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}).then((e=>{var t;if(null==e||null===(t=e[0])||void 0===t||!t.successful)throw null==e?void 0:e[0];const n=e[0].object,r=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,h.prop)("uri")),l=(0,m.V3K)(n,t.type),s=i.find((e=>!(0,h.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),u=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},d=v({},(0,h.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,h.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,h.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(u?e.entities.concat([u]):e.entities).map((e=>e.uri===r||e.uri===o?v({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:e.relations.concat([d])}})(s,n,S);C(o,r);const i=[n.startObject.objectURI,n.endObject.objectURI],a=s.entities.map((0,h.prop)("uri"));i.map((e=>{if(a.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(r)})).catch((e=>{throw l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong")))),e})).finally((()=>{g(!1)}))}),[l,s,o,S]),j=(0,r.useCallback)((e=>{g(!0),(0,m.VGk)(e).then((()=>{o.extremities(e).map((e=>{const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t-1)})),o.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const o=r.relations.find((0,h.propEq)("uri",t)),i=(0,m.nqN)(o),a=(0,m.j5q)(o),l=(0,y.toUndirected)(n),s=(0,h.cond)([[()=>!(0,b.Ar)(l,e,i),(0,h.always)(i)],[()=>!(0,b.Ar)(l,e,a),(0,h.always)(a)],[h.T,(0,h.always)(null)]])(),c=(0,h.evolve)({entities:(0,h.map)((e=>e.uri===i||e.uri===a?v({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,h.reject)((0,h.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=E(e,t),r=(0,h.pipe)(w,(0,h.append)(e),h.uniq)(n);return{updatedData:(0,h.evolve)({relations:(0,h.reject)((e=>n.includes(e))),entities:(0,h.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(x,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)}))}),[l,o,x,s]),k=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,h.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,y.toUndirected)(r),i=(e,t)=>{o.filterEdges(e,t,(e=>!!e)).forEach((e=>o.dropEdge(e)))};n.forEach((e=>{i(t,e),o.forEachNeighbor(e,(t=>{i(e,t)}))}));const a=[];return o.nodes().forEach((t=>{((e,t,n)=>(0,b.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,h.uniq)(a.reduce(((e,t)=>T(t,o,e)),[...a]))})(x,e,r,o).forEach((t=>{t!==x&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[x,o]),_=(0,r.useCallback)((e=>{if(e&&!(0,m.ZiX)(e)&&!R){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(g(!0),N(e).then((t=>{const n=((e,t,n)=>{const{entities:r=[],relations:o=[]}=t;return{entities:r.reduce(((e,t)=>{if(e.some((e=>{let{uri:n}=e;return n===t.uri}))){if(t.uri===n){const r=e.findIndex((e=>{let{uri:t}=e;return t===n}));e[r]=v({},e[r],{traversedRelations:t.traversedRelations,untraversedRelations:t.untraversedRelations})}}else e.push(t);return e}),[...e.entities||[]]),relations:o.reduce(((e,t)=>(e.some((e=>{let{uri:n}=e;return n===t.uri}))||e.push(t),e)),[...e.relations||[]])}})(s,t,e);C(o,t);const r=t.entities.find((t=>t.uri===e));o.setNodeAttribute(e,"untraversedRelationsCount",r.untraversedRelations),o.setNodeAttribute(e,"traversedRelationsCount",r.traversedRelations),c(n)})).catch((e=>{console.error(e),l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)})))}}),[s,l,o,R,N]);return{graphLoading:d,data:s,graphologyGraph:o,graphTypeUri:t,setGraphTypeUri:n,onAddRelation:L,onDeleteRelation:j,onCollapseEntity:k,onExpandEntity:_}};function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=(e,t)=>{const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}({},e,{[null==t?void 0:t.uri]:t}),r=Object.keys(n);return r.length>50&&delete n[r[0]],n},N=[25,50,100];function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const j=(e,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,m.nqN)(t)===n?r:o;return a||(0,m.Lmx)(e,i)},k=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:o,graphTypeUri:a}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,d]=(0,r.useState)(0),[p,g]=(0,r.useState)(N[0]),[b,y]=(0,r.useState)([]),[v,x]=(0,r.useState)(!1),E=(0,i.useDispatch)(),w=(0,i.useSelector)(u.ZP.selectors.getMetadata),C=(0,r.useMemo)((()=>{const e=(null==t?void 0:t.entities)||[];return(0,h.zipObj)(e.map((0,h.prop)("uri")),e)}),[null==t?void 0:t.entities]),T=(0,r.useMemo)((()=>(0,h.pipe)((0,h.filter)((0,h.either)((0,h.pipe)(m.nqN,(0,h.equals)(n)),(0,h.pipe)(m.j5q,(0,h.equals)(n)))),(0,h.uniqBy)((0,h.prop)("uri")),(0,h.map)((e=>{const t=C[((e,t)=>{const n=(0,m.nqN)(t),r=(0,m.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,m.idV)(t.label),entityTypeLabel:(0,m.jFi)(w,t),relationTypeLabel:j(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:O,onChangeSearchText:R,filters:S,onFilter:P,relationTypesOptions:k,entityTypesOptions:_}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,h.pipe)((0,h.map)((e=>{let{entity:t}=e;return t.type})),(0,h.concat)(h.__,o.entityTypesUris),h.uniq,(0,h.map)((0,m.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,h.pipe)((0,h.map)((e=>{let{relation:t}=e;return t.type})),(0,h.concat)(h.__,o.relationTypesUris),h.uniq,(0,h.map)((0,m.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(T),I=(0,r.useMemo)((()=>(0,h.pipe)((0,h.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=S;return m.P6Y.strings.search(t,O)&&(0,h.ifElse)((0,h.prop)("length"),(0,h.includes)(r.type),h.T)(i)&&(0,h.ifElse)((0,h.prop)("length"),(0,h.includes)(n.type),h.T)(o)})),l.field?(0,h.sort)(((e,t)=>m.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):h.identity)(T)),[T,l,O,S]),A=(0,r.useMemo)((()=>I.slice(c*p,c*p+p)),[I,c,p]),D=(0,r.useCallback)((e=>{x(!0),(0,m._vs)(e).then((e=>{y((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Can't load relationship's attributes"))))})).finally((()=>x(!1)))}),[E]),Z=(0,r.useCallback)((e=>{y((t=>t.map((t=>t.relation.uri===e.uri?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){L(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),R("")}),[n,a,R,P]),(0,r.useEffect)((()=>{P({entityTypesUris:[],relationTypesUris:[]})}),[a,o,P]),(0,r.useEffect)((()=>{d(0)}),[l,O,S]);const U=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),z=(0,r.useCallback)(((e,t)=>{x(!0),(0,m.HH7)({oldRelation:e,newRelation:t}).then((()=>{U(t.uri)})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Can't edit relationship"))))})).finally((()=>x(!1)))}),[U,E]);return{rowsData:A,onSort:s,sorting:l,searchText:O,onChangeSearchText:R,filters:S,onFilter:P,entityTypesOptions:_,relationTypesOptions:k,editingRelations:b,onStartRelationEditing:D,onCancelRelationEditing:U,onUpdateEditingRelation:Z,total:I.length,page:c,rowsPerPage:p,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:z,loading:v}},_=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{}});_.displayName="GraphStateContext";var I=n(71153),A=n.n(I),D=n(57304),Z=n(19603),U=n(93873),z=n(94646),B=n(94079),M=n(79692);const F=(0,M.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),q=(0,r.memo)((e=>{let{className:t}=e;const n=F(),r=(0,i.useSelector)(u.ZP.selectors.getEntity),a=(0,i.useSelector)(u.ZP.selectors.getEntityUriWithDataTenant);return o().createElement(D.Z,{className:A()(t,Z.U),entity:r},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},o().createElement(U.a,null))),o().createElement(B.Box,{className:n.comments},o().createElement(z.Z,{uri:a,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:a}),objectType:m.q7e.ENTITY})))}));q.displayName="GraphProfileBand";const G=q;var H=n(52043),V=n(39827),W=n(82726);const Y=(0,M.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function $(){return $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}const X=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",$({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7v2h2V7H6zm0 4v2h2v-2H6zm0 4v2h2v-2H6zm4-8v2h8V7h-8zm10-2v5.02a6.52 6.52 0 012 2.01V3H2v18h11.028a6.52 6.52 0 01-2.009-2H4V5h16zm-9.503 8a6.497 6.497 0 011.31-2H10v2h.497zM10 15.5c0-.168.006-.335.019-.5H10v.5zm0 0c0 .516.06 1.018.173 1.5H10v-1.5zm10.3 2.39L23.42 21 22 22.42l-3.12-3.12c-.69.44-1.51.7-2.39.7-2.48 0-4.49-2.01-4.49-4.5s2.01-4.5 4.5-4.5 4.5 2.01 4.5 4.5c0 .88-.26 1.69-.7 2.39zm-3.8.11a2.5 2.5 0 000-5 2.5 2.5 0 000 5z",fill:"currentColor"}))};var K=n(48852);const Q=(0,K.l)(_,(0,h.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return o().createElement(D.Z,{entity:t})}));var J=n(8962);const ee=(0,M.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),te=(0,K.l)(_,(0,h.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=ee();return o().createElement("div",{className:r.wrapper},n&&o().createElement(d.Z,null),o().createElement(J.Z,{entity:t,caption:f().text("Entity details"),className:r.noShadowBlock}))}));var ne=n(58662),re=n(44443),oe=n(30739),ie=n(31276);const ae="1px solid rgba(0, 0, 0, 0.05)",le=(0,M.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ae},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px",paddingBottom:"8px"},headRow:{borderBottom:ae}});function se(){return se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}const ce=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=le();return o().createElement("div",{className:A()(i.tableRow,i.headRow)},t.map((e=>{const{id:t,sortable:i,headCellRenderer:a,columnClassName:l}=e,s=a,c=i?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,ie.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,se({headCellData:e},c)))})))})),ue=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=le(),[h,m]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const a=t[r];return o().createElement("div",{className:A()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:A()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:a.expanded})},i.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const i=n;return o().createElement("div",{key:t,className:r},o().createElement(i,{value:a[t],rowValue:a}))}))),a.expanded&&u&&o().createElement(u,{open:a.expanded,rowValue:a}))}),[i,u]),f=(0,r.useCallback)(((e,t)=>{m({width:e,height:t})}),[]),b=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=b.current)||void 0===e||e.scrollTo(0)}}))),o().createElement("div",{className:p.table},o().createElement(ce,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(re.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),o().createElement("div",{className:p.tableBody},o().createElement(oe.Z,{listRef:b,width:h.width,height:h.height,data:a,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),de=(0,r.memo)(ue);var pe=n(92332),he=n(88611);const me="rgba(238, 238, 238, 1)",ge=(0,M.Z)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{width:"200px"},relationshipTypeColumn:{width:"130px"},entityTypeColumn:{width:"140px"},row:{position:"relative","&:hover":{background:me}}});function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const be={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},ye=".collapsibleTableRow:hover &",ve=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}({},be,{[ye]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${me} 100%)`}}),xe=(0,M.Z)((e=>({headCell:{position:"relative",display:"flex",alignItems:"center",height:"33px",padding:"6px 0 6px 16px","&>div":{flexDirection:"row"},"&>div>span[role=button]":{width:"calc(100% + 49px)"}},headLabel:{color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden","&:after":be},defaultCell:{position:"relative",color:e.palette.text.primary,fontSize:"13px",fontWeight:"normal",lineHeight:"15px",whiteSpace:"nowrap",overflow:"hidden",display:"flex",alignItems:"center",height:"100%",padding:"6px 16px","&:after":ve},clickable:{cursor:"pointer"},profileCell:{paddingTop:"3px",paddingBottom:"4px"},controlsCell:{position:"absolute",display:"flex",alignItems:"center",height:"100%",flexShrink:0,top:0,right:"9px",visibility:"hidden",[ye]:{visibility:"visible",background:me}},editingMode:{visibility:"visible"},hidden:{visibility:"hidden"},editButton:{marginRight:"7px"},entityAvatar:{width:"20px",height:"20px",marginRight:"8px"},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)"}},expandedRow:{padding:"0 16px 6px",fontSize:"13px"}})));function Ee(){return Ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ee.apply(this,arguments)}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Te=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","headCellData"]);const i=xe();return o().createElement("div",{className:A()(i.headCell,t)},o().createElement(pe.default,Ee({},r,{headCellData:we({},n,{label:o().createElement(he.C,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},Oe=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=xe();return n=n||t,o().createElement(he.C,{value:n},o().createElement("div",{className:A()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var Re=n(53180);const Se=(0,K.l)(_,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=xe(),l=o().createElement(o().Fragment,null,o().createElement(Re.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(Oe,{value:l,tooltip:t,className:A()(a.profileCell,r),onClick:()=>i(n.uri)})}));var Pe=n(78620),Ne=n(14363);const Le=(0,K.l)(_,((e,t)=>{let{relationshipTable:n}=e;return{editingRelationObject:n.editingRelations.find((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)})),onUpdateEditingRelation:n.onUpdateEditingRelation,onCancelRelationEditing:n.onCancelRelationEditing,onSaveEditingRelation:n.onSaveEditingRelation}}),(e=>{let{open:t,editingRelationObject:n,onUpdateEditingRelation:a,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,i.useDispatch)(),d=(0,i.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:g}=n,b=(0,r.useMemo)((()=>!(0,h.equals)(g,p)),[p,g]),y=xe(),v=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),x=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}=(0,Pe.R)({connection:E,onConnectionChange:v});return t?o().createElement("div",{className:y.expandedRow},o().createElement(Ne.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}),o().createElement("div",{className:y.actionButtons},o().createElement(B.Button,{onClick:x},f().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!b,onClick:()=>{(e=>{const t=(0,m.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(g,p)}},f().text("Save")))):null}));var je=n(8818),ke=n(27604),_e=n(22983),Ie=n(81137);const Ae=(0,K.l)(_,(0,h.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Ie.Z,{open:n,title:f().text("Do you want to make a clean break?"),content:f().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:f().text("Delete relationship"),discardCaption:f().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),De=(0,r.memo)((e=>{let{uri:t}=e;const[n,i]=(0,r.useState)(!1),a=(0,r.useCallback)((()=>i(!0)),[]),l=(0,r.useCallback)((()=>i(!1)),[]);return o().createElement(o().Fragment,null,o().createElement(je.k,{icon:_e.Z,size:"XXS",tooltipTitle:f().text("Delete"),onClick:a}),o().createElement(Ae,{open:n,onClose:l,uri:t}))}));De.displayName="DeleteRelationButton";const Ze=De,Ue=(0,K.l)(_,((e,t)=>{let{relationshipTable:{onStartRelationEditing:n,editingRelations:r}}=e;return{onEdit:n,isEditing:r.some((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)}))}}),(e=>{let{rowValue:{relation:{uri:t,type:n}},className:r,onEdit:a,isEditing:l}=e;const s=xe(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),d=(0,m.V3K)(c,n),p=(0,m.Z5t)(m.ARY.Editing,d),h=(0,m.Edd)(m.ARY.Editing,d);return o().createElement("div",{className:A()(s.controlsCell,r,{[s.editingMode]:l})},p&&o().createElement(je.k,{className:A()(s.editButton,{[s.hidden]:l}),icon:ke.Z,size:"XXS",tooltipTitle:f().text("Edit"),onClick:()=>a(t)}),h&&o().createElement(Ze,{uri:t}))}));function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Be(e,t,n[t])}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(e,t)=>t[e].relation.uri||`${e}`,Fe=(0,K.l)(_,(e=>{let{relationshipTable:t}=e;return ze({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:h}=e;const m=ge(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:f().text("Profile"),headCellRenderer:Te,rowCellValueRenderer:Se,sortable:!0,columnClassName:m.profileColumn},{id:"relationTypeLabel",label:f().text("Relationship type"),headCellRenderer:Te,rowCellValueRenderer:Oe,sortable:!0,columnClassName:m.relationshipTypeColumn},{id:"entityTypeLabel",label:f().text("Entity Type"),headCellRenderer:Te,rowCellValueRenderer:Oe,sortable:!0,columnClassName:m.entityTypeColumn},{id:"controls",label:"",headCellRenderer:Te,rowCellValueRenderer:Ue}]),[m]),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=b.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const y=(0,r.useMemo)((()=>t.map((e=>null!=p&&p.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?ze({},e,{expanded:!0}):e))),[t,p]),v=(0,r.useMemo)((()=>({tableRow:A()(m.row,"collapsibleTableRow")})),[m]);return o().createElement("div",{className:m.tableWithPagination},o().createElement("div",{className:m.tableContainer},o().createElement(de,{ref:b,columnsData:g,rowsData:y,sorting:n,onSort:i,getRowKey:Me,ExpandedRowRenderer:Le,defaultRowHeight:28,classes:v})),a>N[0]&&o().createElement(ne.Z,{count:a,rowsPerPageOptions:N,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:b}),h&&o().createElement(d.Z,null))}));var qe=n(36444),Ge=n(94574);const He=(0,M.Z)((e=>({inactiveSearchIcon:{color:e.palette.text.secondary},activeSearchIcon:{color:e.palette.text.primary},input:{fontSize:"14px","&::placeholder":{color:`${e.palette.text.secondary} !important`,opacity:1}}}))),Ve=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=He();return o().createElement(Ge.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:f().text("Search profiles"),classes:{input:r.input}})}));var We=n(59725),Ye=n(32371);const $e=(0,M.Z)((e=>({dialogPaper:{display:"flex",flexDirection:"column",padding:"12px 16px 8px"},title:{marginBottom:"21px",fontWeight:500,fontSize:"20px",lineHeight:"23px",letterSpacing:"0.25px",color:e.palette.text.primary},entityTypesSelector:{width:"468px",marginBottom:"20px"},relationTypesSelector:{width:"468px",marginBottom:"32px"},footer:{display:"flex"},clearAllButton:{marginRight:"auto"},cancelButton:{marginRight:"8px"}}))),Xe=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=$e(),[u,d]=(0,r.useState)([]),[p,h]=(0,r.useState)([]),m=()=>{d(i.entityTypesUris),h(i.relationTypesUris),n()};return(0,r.useEffect)((()=>{d(i.entityTypesUris),h(i.relationTypesUris)}),[i.entityTypesUris,i.relationTypesUris]),o().createElement(B.Dialog,{classes:{paper:c.dialogPaper},onClose:m,open:t},o().createElement(B.Typography,{className:c.title},f().text("Filter")),o().createElement(We.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),o().createElement(Ye.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:h}),o().createElement("div",{className:c.footer},o().createElement(B.Button,{className:c.clearAllButton,onClick:()=>{d([]),h([])}},f().text("Clear All")),o().createElement(B.Button,{className:c.cancelButton,onClick:m},f().text("Cancel")),o().createElement(B.Button,{onClick:()=>{a({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},f().text("Apply"))))})),Ke=(0,M.Z)((e=>({wrapper:{display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"2px"},iconButton:{marginLeft:"4px"},activeFiltersIcon:{color:e.palette.primary.main},inactiveFiltersIcon:{color:e.palette.text.secondary}}))),Qe=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Ke(),[i,a]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return o().createElement("div",{className:n.wrapper},o().createElement(Ve,null),o().createElement(B.IconButton,{className:n.iconButton,onClick:()=>a(!0)},o().createElement(qe.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement(Xe,{open:i,onClose:()=>a(!1)}))}));var Je=n(65549),et=n(98808);const tt=e=>{const t=(0,i.useSelector)(u.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,m.UWq)(t,e,(0,m.d89)(m.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},nt=(0,M.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"12px 16px"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px",fontWeight:"bold"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),rt=(0,K.l)(_,(e=>{let{selectedEntity:t,onAddRelation:n}=e;return{selectedEntity:t,onAddRelation:n}}),(e=>{let{selectedEntity:t,open:n,onClose:a,onAddRelation:l}=e;const s=nt(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),[d,p]=(0,r.useState)({}),{relation:h,entity:g}=d,{type:b,direction:y}=h||{},[v,x]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&p({relation:{uri:(0,m.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=tt(t.type),T=(0,r.useCallback)((()=>{const e=(0,m.xkB)(c,{relation:{object:h}});return E(u.N5.errors.actions.errorsSet(e)),0===e.length}),[h,c,E]),{onAddAttributes:O,onChangeAttribute:R,onRemoveAttribute:S,onChangeEntity:P,onChangeRelationType:N}=(0,Pe.R)({connection:d,onConnectionChange:p,relatedEntity:t});return o().createElement(B.Dialog,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement(B.DialogTitle,{disableTypography:!0,classes:{root:s.dialogTitle}},o().createElement(B.Typography,{variant:"subtitle1",classes:{root:s.titleText}},f().text("Add relationship"))),o().createElement(B.DialogContent,{classes:{root:s.content}},o().createElement(Ne.n,{connection:d,onAddAttributes:O,onChangeAttribute:R,onRemoveAttribute:S,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:N,onChangeEntity:P})),o().createElement(B.DialogActions,null,o().createElement(B.Button,{onClick:a},f().text("Cancel")),o().createElement(B.Button,{disabled:!(null!=d&&d.entity)||!b||v,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=h,i=y===m.Nsj.OUT?t.uri:g.uri,s=y===m.Nsj.OUT?g.uri:t.uri;T()&&(x(!0),l({startEntityUri:i,endEntityUri:s,relationType:e,attributes:n,startDate:r,endDate:o}).then((()=>{a()})).catch((e=>{console.error(e)})).finally((()=>{x(!1)})))}},f().text("Add"))))})),ot=(0,K.l)(_,(0,h.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=tt(t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(et.K,{mode:et.N.button,label:f().text("Add relationship"),icon:Je.Z,onClick:()=>{s(!0)}}),o().createElement(rt,{open:l,onClose:()=>{s(!1)}}))})),it=(0,M.Z)({caption:{marginLeft:"16px",marginTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),at=()=>{const e=it();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(B.Typography,{variant:"subtitle1"},f().text("Relationships")),o().createElement(ot,null)),o().createElement(Qe,null),o().createElement(Fe,null))};let lt;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(lt||(lt={}));const st=(0,r.memo)((()=>{var e;const t=Y(),[n,i]=(0,r.useState)(null),a=(0,r.useCallback)((e=>{i((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:lt.Relationship,icon:X,tooltipTitle:f().text("Relationship")},content:o().createElement(at,null)},{buttonProps:{id:lt.EntityDetails,icon:W.Z,tooltipTitle:f().text("Entity Details")},content:o().createElement(te,null)}]),[]);return o().createElement("div",{className:t.wrapper},o().createElement(H.h,{open:l,width:480},o().createElement(Q,null),null===(e=s[n])||void 0===e?void 0:e.content),o().createElement(V.G,{buttonsProps:(0,h.pluck)("buttonProps",s),onButtonClick:a,activeIndexId:n}))}));st.displayName="GraphRightSidePanel";const ct=st;var ut=n(46339),dt=n(23304),pt=n(64488),ht=n(46680),mt=n.n(ht);const gt=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=3,e.shadowColor="rgba(0,0,0,0.2)","string"==typeof t.label){const o=n.labelSize+2,i=2,a=e.measureText(t.label).width,l=Math.round(a+16),s=Math.round(o+4),c=Math.max(t.size,o/2)+2,u=t.y-s/2,d=t.y+s/2,p=t.x+(r?0:c),h=p+l+(r?c:0);e.beginPath(),e.moveTo(p,d-i),e.quadraticCurveTo(p,d,p+i,d),e.lineTo(h-i,d),e.quadraticCurveTo(h,d,h,d-i),e.lineTo(h,u+i),e.quadraticCurveTo(h,u,h-i,u),e.lineTo(p+i,u),e.quadraticCurveTo(p,u,p,u+i),e.closePath(),e.fill(),r&&(e.shadowOffsetX=-2,e.shadowOffsetY=0,e.beginPath(),e.arc(t.x,t.y,c,0,2*Math.PI),e.closePath(),e.fill())}else r&&(e.beginPath(),e.arc(t.x,t.y,t.size+2,0,2*Math.PI),e.closePath(),e.fill())},ft=function(e,t,n){var r;let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t.label)return;const i=n.labelSize,a=n.labelFont,l=n.labelWeight;o&&gt(e,t,n,!1),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,e.fillStyle=null!==(r=n.labelColor)&&void 0!==r&&r.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color,e.font=`${l} ${i}px ${a}`,e.fillText(t.label,t.x+t.size+11,t.y+i/3)},bt=(e,t,n)=>{gt(e,t,n,!0),ft(e,t,n,!1)};var yt=n(88586);class vt extends dt.AbstractNodeProgram{constructor(e){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n \n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}","\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\nvoid main(void) {\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(v_color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = v_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n",1,5),this.borderSize=void 0,this.borderSize=e.getAttribLocation(this.program,"a_borderSize"),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.borderSize),e.vertexAttribPointer(this.borderSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)}process(e,t,n){const r=this.array;let o=1*n*5;if(t||!e.inPath)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o]=e.highlighted?4:2}render(e){const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/5)}}class xt{constructor(){this.rebindTextureFns=[],this.images={},this.textureImage=void 0,this.hasReceivedImages=!1,this.pendingImagesFrameID=void 0,this.loadImage=(e,t)=>{if(this.images[e])return;const n=new Image;var r;n.addEventListener("load",(()=>{this.images[e]={status:"pending",image:n},"number"!=typeof this.pendingImagesFrameID&&(this.pendingImagesFrameID=requestAnimationFrame((()=>this.finalizePendingImages())))})),n.addEventListener("error",(()=>{this.images[e]={status:"error"}})),this.images[e]={status:"loading"},r=n,new URL(t,window.location.href).origin!==window.location.origin&&(r.crossOrigin=""),n.src=t},this.finalizePendingImages=()=>{this.pendingImagesFrameID=void 0;const e=[];for(const t in this.images){const n=this.images[t];"pending"===n.status&&e.push({id:t,image:n.image,size:Math.min(n.image.width,n.image.height)||1})}const t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.reduce(((e,t)=>{let{size:n}=t;return e+n}),this.hasReceivedImages?this.textureImage.width:0),t.height=Math.max(this.hasReceivedImages?this.textureImage.height:0,...e.map((e=>{let{size:t}=e;return t})));let r=0;this.hasReceivedImages&&(n.putImageData(this.textureImage,0,0),r=this.textureImage.width),e.forEach((e=>{let{id:t,image:o,size:i}=e;const a=Math.min(128,i);let l=0,s=0;(o.width||0)>(o.height||0)?l=(o.width-o.height)/2:s=(o.height-o.width)/2,n.drawImage(o,l,s,i,i,r,0,a,a),this.images[t]={status:"ready",x:r,y:0,width:a,height:a},r+=a})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const Et={id:"defaultImage",path:(0,m.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};class wt extends dt.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n// convert color to gray\nvec4 toGrayscale(in vec4 color)\n{\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toGrayscale(color);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}",1,9),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.inactive=void 0,this.imageLoader=new xt,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.inactive=e.getAttribLocation(this.program,"a_inactive");const n=e.getUniformLocation(this.program,"u_atlas");if(null===n)throw new Error("NodeProgramImage: error while getting atlasLocation");this.atlasLocation=n,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),this.imageLoader.loadImage(Et.id,Et.path),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.textureLocation),e.enableVertexAttribArray(this.inactive),e.vertexAttribPointer(this.inactive,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20)}process(e,t,n){const r=this.array;let o=1*n*9;const i=e.image;let a=i&&this.imageLoader.images[i];if("string"!=typeof i||a||this.imageLoader.loadImage(i,i),t)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[Et.id]),a&&"ready"===a.status){const{width:e,height:t}=this.imageLoader.textureImage;r[o++]=a.x/e,r[o++]=a.y/t,r[o++]=a.width/e,r[o++]=a.height/t}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1i(this.atlasLocation,0),t.drawArrays(t.POINTS,0,this.array.length/9)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const Ct=[{id:"expandIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.80013 7.20003V4H7.20013L7.20013 7.20003H4V8.80003H7.20013L7.20013 12H8.80013V8.80003H12V7.20003H8.80013Z" fill="black" fill-opacity="0.541176"/>\n</svg>')},{id:"collapseIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path d="M4 7.20004H12V8.80004H4V7.20004Z" fill="black" fill-opacity="0.541176"/>\n</svg>\n')}];class Tt extends dt.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_buttonSize;\nattribute vec2 a_normals;\nattribute vec4 a_texture;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying float v_border;\nvarying vec4 v_texture;\nvarying vec4 v_color;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normals);\n vec2 unitNormal = (a_normals) / normalLength;\n\n float pixelsThickness = max(normalLength, 1.0 * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Move the point\n float adaptedWebGLNodeRadius = a_size * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n vec2 compensationVector = vec2(-unitNormal.y, unitNormal.x) * (adaptedWebGLNodeRadius);\n\n // Set position\n gl_Position = vec4((u_matrix * vec3(a_position + compensationVector, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_buttonSize * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color;\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(black, texel, texel.a).rgb, max(texel.a, bias));\n } else {\n color = black;\n }\n\n if (distToCenter < radius - v_border) // points inside button\n gl_FragColor = color;\n else if (distToCenter < radius) // border of button\n gl_FragColor = mix(transparent, color, (0.5 - distToCenter) / v_border);\n else // points outside button\n gl_FragColor = transparent;\n}",2,11),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.buttonSize=void 0,this.normals=void 0,this.correctionRatioLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.imageLoader=new xt,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.buttonSize=e.getAttribLocation(this.program,"a_buttonSize"),this.normals=e.getAttribLocation(this.program,"a_normals");const n=e.getUniformLocation(this.program,"u_correctionRatio");if(null===n)throw new Error("NodeButtonsProgram: error while getting correctionRatioLocation");this.correctionRatioLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("NodeButtonsProgram: error while getting sqrtZoomRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_atlas");if(null===o)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=o,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),Ct.map((e=>this.imageLoader.loadImage(e.id,e.path))),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.buttonSize),e.enableVertexAttribArray(this.normals),e.enableVertexAttribArray(this.textureLocation),e.vertexAttribPointer(this.buttonSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.normals,2,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,28)}process(e,t,n){const r=this.array;let o=2*n*11;const i=t||e.inactive&&!e.highlighted,[a,l]=e.buttonOffset||[0,0];let s=a*a+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=a*s),i||!e.showExpand)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}if(i||!e.showCollapse)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.uniform1i(this.atlasLocation,1),t.drawArrays(t.POINTS,0,this.array.length/11)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}var Ot=n(23193),Rt=n.n(Ot);class St extends(Rt()){process(e,t,n,r,o){if(r){for(let e=27*o,t=e+27;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size*i||1,l=t.size||1,s=e.x,c=e.y,u=t.x,d=t.y,p=(0,yt.floatColor)(n.color),h=u-s,m=d-c;let g=h*h+m*m,f=0,b=0;g&&(g=1/Math.sqrt(g),f=-m*g*a,b=h*g*a);let y=27*o;const v=this.array;v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=1,v[y++]=0,v[y++]=0,v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=1,v[y++]=0,v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=0,v[y]=1}}class Pt extends St{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var Nt=n(73343),Lt=n.n(Nt);class jt extends pt.AbstractEdgeProgram{constructor(e){super(e,"\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}",Lt(),4,7),this.IndicesArray=void 0,this.indicesArray=void 0,this.indicesBuffer=void 0,this.indicesType=void 0,this.positionLocation=void 0,this.colorLocation=void 0,this.normalLocation=void 0,this.radiusLocation=void 0,this.arrowSizeRatioLocation=void 0,this.matrixLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.correctionRatioLocation=void 0,this.canUse32BitsIndices=void 0;const t=e.createBuffer();if(null===t)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");this.indicesBuffer=t,this.positionLocation=e.getAttribLocation(this.program,"a_position"),this.colorLocation=e.getAttribLocation(this.program,"a_color"),this.normalLocation=e.getAttribLocation(this.program,"a_normal"),this.radiusLocation=e.getAttribLocation(this.program,"a_radius"),this.arrowSizeRatioLocation=e.getAttribLocation(this.program,"a_arrowSizeRatio");const n=e.getUniformLocation(this.program,"u_matrix");if(null===n)throw new Error("EdgeClampedProgram: error while getting matrixLocation");this.matrixLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_correctionRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");this.correctionRatioLocation=o,this.canUse32BitsIndices=(0,yt.canUse32BitsIndices)(e),this.IndicesArray=this.canUse32BitsIndices?Uint32Array:Uint16Array,this.indicesArray=new this.IndicesArray,this.indicesType=this.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,this.bind()}bind(){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.colorLocation),e.enableVertexAttribArray(this.radiusLocation),e.enableVertexAttribArray(this.arrowSizeRatioLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.colorLocation,4,e.UNSIGNED_BYTE,!0,7*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.radiusLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.arrowSizeRatioLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,24)}process(e,t,n,r,o){if(r){for(let e=28*o,t=e+28;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size||1,l=e.x,s=e.y,c=t.x,u=t.y,d="doubleArrow"===n.type?e.size||1:0,p=t.size||1,h=(0,yt.floatColor)(n.color),m=c-l,g=u-s;let f=m*m+g*g,b=0,y=0;f&&(f=1/Math.sqrt(f),b=-g*f*a,y=m*f*a);let v=28*o;const x=this.array;x[v++]=l,x[v++]=s,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=-d,x[v++]=i,x[v++]=l,x[v++]=s,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=d,x[v++]=i,x[v++]=c,x[v++]=u,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=p,x[v++]=i,x[v++]=c,x[v++]=u,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=-p,x[v]=i}computeIndices(){const e=this.array.length/7,t=e+e/2,n=new this.IndicesArray(t);for(let t=0,r=0;t<e;t+=4)n[r++]=t,n[r++]=t+1,n[r++]=t+2,n[r++]=t+2,n[r++]=t+1,n[r++]=t+3;this.indicesArray=n}bufferData(){super.bufferData();const e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}render(e){if(this.hasNothingToRender())return;const t=this.gl,n=this.program;t.useProgram(n),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}const kt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:bt,labelRenderer:ft,nodeProgramClasses:{image:(0,dt.createNodeCompoundProgram)([wt,vt,Tt])},edgeProgramClasses:{line:mt(),arrow:(0,pt.createEdgeCompoundProgram)([jt,St]),doubleArrow:(0,pt.createEdgeCompoundProgram)([jt,St,Pt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(ut.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var _t=n(28833),It=n.n(_t),At=n(3660),Dt=n.n(At),Zt=n(28301),Ut=n.n(Zt),zt=n(30634),Bt=n(20562),Mt=n(31181),Ft=n(30284);const qt=(e,t,n,r,o,i,a)=>({aX:e+(r-e)*(n-a-i)/n,aY:t+(o-t)*(n-a-i)/n,vX:(r-e)*a/n,vY:(o-t)*a/n}),Gt=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*Ht,n-r*Ht),e.lineTo(t-o*Ht,n+r*Ht),e.lineTo(t+r,n+o),e.closePath(),e.fill()},Ht=.4,Vt=(e,t,n,r,o)=>{if(t.loop){const{size:r,color:o,arrowSizeRatio:i=1}=t,a=n.x,l=n.y,s=n.size,c=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x1:e-7*(n+r),y1:t,x2:e,y2:t+7*(n+r)}}(a,l,.6*s);if(e.strokeStyle=o,e.lineWidth=r,"arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const{aX:t,aY:n,vX:o,vY:u}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return qt(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);Gt(e,t,n,o,u),e.beginPath(),e.moveTo(t,n)}else e.beginPath(),e.moveTo(a,l);const{aX:n,aY:u,vX:d,vY:p}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return qt(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);e.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n,u),e.stroke(),Gt(e,n,u,d,p)}else e.beginPath(),e.moveTo(a,l),e.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke()}(0,Ft.default)(e,t,n,r,o)};function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Yt(e,t,n[t])}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $t=(e,t,n,r,o)=>e>n-o&&e<n+o&&t>r-o&&t<r+o&&Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))<o,Xt=(0,h.memoizeWith)(((e,t,n)=>n.type),m.uie),Kt={size:24,buttonSize:8,buttonOffset:[19,19]},Qt={size:12,buttonSize:6,buttonOffset:[8,13]},Jt=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:p,onNodeExpand:h,filters:g}=e;const f=(0,ut.Ys)(),v=(0,ut.sG)(),x=(0,ut.$j)(),E=(0,ut.eP)(),w=(0,i.useSelector)(u.ZP.selectors.getEntity),C=(0,i.useSelector)(u.ZP.selectors.getMetadata),T=(0,i.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[O,R]=(0,r.useState)(void 0),[S,P]=(0,r.useState)(null),[N,L]=(0,r.useState)({});(0,r.useEffect)((()=>{f.getCamera().setState({ratio:1.2})}),[n,f]),(0,r.useEffect)((()=>{if(P((0,y.toUndirected)(n)),v(n),o){const e=o(f.getGraph(),l);(0,Mt.animateNodes)(f.getGraph(),e,{duration:1e3})}if(a){const e=new a(f.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,o,a,f,l,v,c]);const j=(0,r.useCallback)((e=>{const t=f.getGraph(),n=null==w?void 0:w.uri;if(t&&S&&n&&e&&n!==e){const r=(0,b.Ar)(S,n,e),o=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.reduce(((t,o)=>(n.push(e[r](t,o,(e=>!!e))),o))),n}(t,r);return r?{edges:o,nodes:r}:{}}return{}}),[f,null==w?void 0:w.uri,S]);(0,r.useEffect)((()=>{L(j(s))}),[s,j]),(0,r.useEffect)((()=>{x({enterNode:e=>{let{node:t}=e;R(t)},leaveNode:()=>{R(void 0)},clickNode:e=>{let{node:t}=e;d(t)},click:e=>{const t=(e=>{let{x:t,y:n}=e;const r=f.viewportToGraph({x:t,y:n}),o=f.getGraph(),i=o.nodes().map((e=>{const t=o.getNodeAttributes(e);return{nodeId:e,distance:Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2),hidden:t.hidden}})).sort(((e,t)=>e.distance-t.distance)).filter((e=>{let{hidden:t}=e;return!t}));return i.length>0?i[0].nodeId:null})(e);if(t){const n=f.getNodeDisplayData(t),r=f.framedGraphToViewport({x:n.x,y:n.y}),o=f.scaleSize(n.buttonOffset[0]),i=f.scaleSize(n.buttonOffset[1]),a=f.scaleSize(n.buttonSize),l=$t(e.x,e.y,r.x+o,r.y-i,a),s=$t(e.x,e.y,r.x+o,r.y+i,a);n.showExpand&&l&&(h(t),d(t)),n.showCollapse&&s&&(p(t,j(t)),d(t))}}})}),[f,x,d,p,h,j]),(0,r.useEffect)((()=>{const e=f.getGraph(),t=e.neighbors(s);E({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=Xt(C,T,{type:r.entityTypeUri}),a=n===s?Kt:Qt,l=e.neighbors(n),c=l.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,u=Wt({},r,a,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||c>0,showCollapse:r.traversedRelationsCount>1&&l.length-c>1}),d=(N.nodes||[]).includes(n),p=O===n;return d||n===s||n===(null==w?void 0:w.uri)?(u.inPath=!0,n===(null==w?void 0:w.uri)&&(u.color="#00FFFF")):!t||t.includes(n)||s===n||s===(null==w?void 0:w.uri)||d||(p||(u.label=""),u.inactive=!0),p&&(u.highlighted=!0),![s,null==w?void 0:w.uri].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri)&&(u.hidden=!0),u},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=Wt({},n,{hidden:!1}),i=(N.edges||[]).includes(t);var a;return(s&&s!==(null==w?void 0:w.uri)&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri))&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,c&&(o.arrowSizeRatio=1.4)),o.type=(a=c?n.direction:m.MCv.undirected,{[m.MCv.bidirectional]:"doubleArrow",[m.MCv.directed]:"arrow",[m.MCv.undirected]:"line"}[a]||"line"),o},renderEdgeLabels:!0,edgeLabelRenderer:Vt})}),[f,E,O,s,N,null==w?void 0:w.uri,C,T,c,g])};let en;function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nn(e,t,n[t])}))}return e}function nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network"}(en||(en={}));const rn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,zt.D)(t);(0,Bt.D)((()=>{if(u){const e=(0,h.difference)(t.entities.map((0,h.prop)("uri")),u.entities.map((0,h.prop)("uri")));if(e.length){const t=n.copy();It().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const d=(0,r.useMemo)((()=>(It().assign(n),{settings:tn({},Dt().inferSettings(n),{gravity:1})})),[n]);return Jt({workerLayout:Ut(),layoutSettings:d,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===en.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var on=n(36039);const an=(e,t,n,r)=>{const o=new Set;return t.length||t.push(Array.from(e)),e.forEach((t=>{n.add(t),r.forEach((r=>{r.from!==t||e.has(r.to)||n.has(r.to)||o.add(r.to)}))})),o.size&&t.push(Array.from(o)),((e,t,n)=>{const r=new Set;return e.forEach((e=>{t.forEach((t=>{t.from!==e||n.has(t.to)||r.add(t.to)}))})),!!r.size})(o,r,n)?an(o,t,n,r):t},ln=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const o=e.slice(10),i=e.slice(0,10);t[r]=i,t[r+1]=n[r+1]?[...n[r+1],...o]:o}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return ln(e,t,n,r)}return t};function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case en.VERTICAL_TB:return 180;case en.HORIZONTAL_LR:return 270}})(i),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),o=((e,t,n)=>{const r=new Set;return t.forEach((t=>{e.some((e=>e.to===t.id))||r.add(t.id)})),r.size||r.add(n),r})(r,n,t),i=an(o,[],new Set,r);return ln(i[0],[],i,0)})((e=>{const t=e.nodes().map((e=>({id:e,name:""}))),n=e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:t.relationTypeUri,direction:t.direction})));return{nodes:t,edges:n}})(t),o),a=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(r);for(let e=0;e<r.length;++e)for(let n=0;n<r[e].length;++n)t.setNodeAttribute(r[e][n],"x",(s=n,(l=r[e].length)===(c=a)?5*s:1===l?5*(c-1)/2:5*(c-1)/(l+1)*(s+1))),t.setNodeAttribute(r[e][n],"y",10*e);var l,s,c;return on.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:o}=n;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return Jt({syncLayout:u,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var un=n(24737);const dn=(0,M.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),pn=(0,K.l)(_,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=dn(),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,i.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:f().text("All"),value:null},...(0,m.mmY)(l,s.type).map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))]),[s,l]),d=(0,r.useMemo)((()=>c.find((e=>e.value===t))),[c,t]);return o().createElement(un.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:f().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),hn=(0,M.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),mn=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=hn(),i=[{label:f().text("Simple network"),value:en.SIMPLE_NETWORK},{label:f().text("Vertical hierarchy"),value:en.VERTICAL_TB},{label:f().text("Horizontal hierarchy"),value:en.HORIZONTAL_LR},{label:f().text("Directed network"),value:en.DIRECTED_NETWORK}];return o().createElement(un.Z,{className:r.graphLayoutSelector,label:f().text("Graph layout"),value:i.find((0,h.propEq)("value",t)),options:i,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),gn=()=>{const e=(0,ut.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(re.Z,{handleWidth:!0,onResize:t})};var fn=n(17373);function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yn(e,t,n[t])}))}return e}function yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vn="0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",xn={background:"#FFFFFF",boxShadow:vn,width:"28px",height:"28px"},En=(0,M.Z)({container:{display:"flex",alignItems:"center"},maxButton:bn({},xn,{borderRadius:"2px 4px 4px 2px"}),minButton:bn({},xn,{borderRadius:"4px 2px 2px 4px"}),thumb:{position:"absolute",boxShadow:vn,borderRadius:"2px",width:"8px",height:"28px",marginTop:"-13px",marginLeft:"1px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF",boxSizing:"border-box",outline:0,display:"flex",alignItems:"center",justifyContent:"center"},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px"},sliderRoot:{color:"#EDEDED",marginRight:"10px"}});function wn(){return wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wn.apply(this,arguments)}const Cn=e=>Math.pow(100/e,2),Tn=e=>100/Math.sqrt(e),On=e=>{const t=En(),n=(0,h.omit)(["className"],e);return o().createElement("div",wn({className:t.thumb},n),o().createElement(fn.Z,{className:A()(t.icon,t.thumbIcon)}))},Rn=e=>{let{className:t,max:n,min:i}=e;const a=En(),l=(0,ut.eP)(),s=(0,ut.$j)(),c=(0,ut.Ys)().getCamera(),{zoomIn:u,zoomOut:d}=(0,ut.AH)({factor:1.2}),[p,m]=(0,r.useState)((0,h.clamp)(i,n,Tn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?Cn(i):null),[i]),f=(0,r.useMemo)((()=>n>0?Cn(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:f}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,f,g]),(0,r.useEffect)((()=>{s({cameraUpdated:e=>m(Tn(e.ratio))})}),[s]),o().createElement("div",{className:A()(a.container,t)},o().createElement(B.IconButton,{className:a.minButton,onClick:()=>d()},o().createElement(fn.Z,{className:a.icon})),o().createElement(B.Slider,{ThumbComponent:On,classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:p,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(Cn(t))})}),o().createElement(B.IconButton,{className:a.maxButton,onClick:()=>u()},o().createElement(Je.Z,{className:a.icon})))};var Sn=n(25156);const Pn=(0,M.Z)({button:{background:"#FFFFFF",boxShadow:"0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",width:"28px",height:"28px",borderRadius:"4px"},icon:{width:"18px",height:"18px"}}),Nn=e=>{let{node:t}=e;const n=Pn(),{gotoNode:r}=(0,ut.AH)();return o().createElement(B.IconButton,{className:n.button,onClick:()=>r(t)},o().createElement(Sn.Z,{className:n.icon}))},Ln=(0,M.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"},rightBottomControls:{position:"absolute",zIndex:100,right:"18px",bottom:"16px",display:"flex",width:"200px"},zoomSlider:{flexGrow:1,marginRight:"8px"}}),jn=(0,K.l)(_,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l}}),(e=>{let{data:t,graph:n,selectedNode:i,onNodeSelect:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=Ln(),[d,p]=(0,r.useState)(en.SIMPLE_NETWORK),h={data:t,graph:n,selectedNode:i,layout:d,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c};return o().createElement("div",{className:u.wrapper},o().createElement("div",{className:u.selectors},o().createElement(pn,null),o().createElement(mn,{value:d,onChangeHandler:p})),o().createElement("div",{className:u.graph},n&&o().createElement(kt,null,o().createElement(o().Fragment,null,o().createElement(gn,null),d===en.SIMPLE_NETWORK||d===en.DIRECTED_NETWORK?o().createElement(rn,h):o().createElement(cn,h),o().createElement("div",{className:u.rightBottomControls},o().createElement(Rn,{className:u.zoomSlider,min:30,max:300}),o().createElement(Nn,{node:i}))))))})),kn=(0,M.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},graphWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},graphContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),_n=(0,r.memo)((()=>{const e=kn(),t=(0,i.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:o,graphTypeUri:a,setGraphTypeUri:l,onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p}=R(e),{selectedEntity:g,onEntitySelect:b,selectedEntityLoading:y}=((e,t)=>{const n=(0,O._)(),o=(0,i.useDispatch)(),[a,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),p=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,m.HvW)(e).then((e=>(s.current=P(s.current,e),e)))}),[]),g=(0,r.useCallback)((e=>{var r;const i=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,h.propEq)("uri",e));i&&l(i),d(!0),n(p(e)).then(l).catch((e=>{o(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=P({},e),g(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==a?void 0:a.uri)===e.uri));n||(null!=e&&e.uri?(s.current=P({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,n);return{graphLoading:t,data:n,graphologyGraph:o,selectedEntity:g,selectedEntityLoading:y,graphTypeUri:a,relationshipTable:k({data:n,selectedEntityUri:null==g?void 0:g.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:a}),onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p,onEntitySelect:b,setGraphTypeUri:l}})(t),{graphLoading:a}=n;return o().createElement(_.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},a&&o().createElement(d.Z,null),(null==t?void 0:t.uri)&&o().createElement("div",{className:e.graphContainer},o().createElement("div",{className:e.graphWrapper},o().createElement(G,null),o().createElement(jn,null)),o().createElement(ct,null))))}));_n.displayName="GraphPerspectiveView";const In=_n,An=(0,a.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),Dn=e=>{let{store:t}=e;return o().createElement(i.Provider,{store:t},o().createElement(a.StylesProvider,{generateClassName:An},o().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},o().createElement(In,null),o().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9838],{98808:(e,t,n)=>{n.d(t,{K:()=>m,N:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(94079);const s=(0,n(79692).Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path, & svg path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path, & svg 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}})));var c=n(31276),u=n(88611),d=n(8818);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}let h;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(h||(h={}));const m=(0,r.forwardRef)(((e,t)=>{let{className:n,mode:r=h.iconButton,label:i,disabled:m,icon:g,onClick:f=c.ZT,onMenuClose:b=c.ZT}=e,y=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const v=s();return(()=>{switch(r){case"iconButton":return o().createElement(d.k,p({disabled:m,className:a()(v.iconButton,n),size:"S",tooltipTitle:i,onClick:f,icon:g},y));case"button":return o().createElement(l.Button,p({className:a()(v.button,n),disabled:m,startIcon:o().createElement(g,null),onClick:f,color:"primary",classes:{startIcon:v.startIcon,label:v.label}},y),o().createElement(u.C,{value:i},o().createElement("div",{className:v.overflowStyle},i)));case"menuItem":{const e=()=>{b(),f()};return o().createElement(l.MenuItem,p({classes:{root:v.menuItem},onClick:e,disabled:m,ref:t},y),o().createElement(o().Fragment,null,o().createElement(g,{className:v.menuIcon}),o().createElement(l.Typography,{classes:{root:v.menuText}},i)))}}})()}));m.displayName="ActionButton"},30739:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(81403);const s=(0,n(79692).Z)({item:{overflow:"hidden"}});function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:u,data:d,children:p,itemKey:h,showNotMeasuredItems:m,listRef:g}=e;const f=s(),b=(0,r.useRef)({}),[y,v]=(0,r.useState)({}),x=(0,r.useCallback)((0,l.DsO)((()=>{v(c({},b.current))})),[]),E=(0,r.useCallback)(((e,t)=>h?h(t,e):t),[h]),w=(0,r.useRef)(),C=g||w;C.current&&C.current.resetAfterIndex(0,!1);const T=(0,r.useMemo)((()=>e=>{let{data:t,index:n,style:r}=e;const i=E(t,n);return o().createElement("div",{style:r,className:f.item},o().createElement("div",{style:m?void 0:{visibility:i in y?void 0:"hidden"}},o().createElement(a.Z,{handleHeight:!0,onResize:(e,t)=>{b.current[i]!==t&&(((e,t)=>{b.current=c({},b.current,{[e]:t})})(i,t),x())}}),p({data:t,index:n})))}),[p,m,E,x,!m&&y]);return o().createElement(i.VariableSizeList,{ref:C,width:t,height:n,itemCount:d.length,itemData:d,itemSize:e=>y[(e=>E(d,e))(e)]||u,itemKey:h},T)}))},58662:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(13980),o=n.n(r),i=n(24328),a=n.n(i),l=n(71153),s=n.n(l),c=n(94079),u=n(87918),d=n.n(u),p=n(31276),h=n(17440);const m=(0,n(79692).Z)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none"},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px"},selectRoot:{marginLeft:"5px",marginRight:"36px"},select:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right"},actions:{marginLeft:"32px"}});function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=e=>{let{classes:t={},count:n,rowsPerPageOptions:r,page:o,onChangePage:l,rowsPerPage:u,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=m(),x=(0,i.useCallback)((()=>{(0,h.pathOr)(h.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,i.useCallback)((e=>{l(e),x()}),[l,x]),w=(0,i.useCallback)((e=>{l(0),f(e),x()}),[l,f,x]);return a().createElement(c.TablePagination,{classes:g({},t,{root:s()(v.pagination,t.root),select:s()(v.select,t.select),caption:v.caption,selectRoot:v.selectRoot,actions:v.actions}),component:"div",labelRowsPerPage:y||d().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return d().text("${fromRow}-${toRow} of ${countRows}",{fromRow:d().number(t,"0,0"),toRow:d().number(n,"0,0"),countRows:d().number(r,"0,0")})},count:n,rowsPerPageOptions:r,page:o,onChangePage:(0,h.pipe)((0,h.nthArg)(1),E),rowsPerPage:u,onChangeRowsPerPage:(0,h.pipe)(p.NA,w)})};b.propTypes={classes:o().object,rowsPerPageOptions:o().arrayOf(o().number),count:o().number,page:o().number,onChangePage:o().func,rowsPerPage:o().number,onChangeRowsPerPage:o().func,basicTableRef:o().shape({current:o().object}),labelRowsPerPage:o().string};const y=a().memo(b)},10237:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(27556),o=n(13980),i=n.n(o),a=n(24328),l=n.n(a);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=(0,a.forwardRef)(((e,t)=>{let{children:n,className:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const a=u();return l().createElement(r.Z,d({ref:t,className:o,classes:{root:a["basic-view__paper"]}},i),n)}));p.displayName="BasicView",p.propTypes={children:i().node,className:i().string};const h=p},81137:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079);const s=(0,n(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"}}),c=e=>{let{open:t,title:n,content:r,onCancel:i,cancelCaption:c=a().text("Cancel"),onDiscard:u,discardCaption:d="",onSave:p,saveCaption:h=a().text("Save"),disabledSave:m=!1}=e;const g=s();return o().createElement(l.Dialog,{open:t,onClose:i,classes:{paperScrollPaper:g.paper}},o().createElement(l.DialogTitle,{classes:{root:g.title}},n),o().createElement(l.DialogContent,{classes:{root:g.content}},o().createElement(l.DialogContentText,{classes:{root:g.contentText}},r)),o().createElement(l.DialogActions,{className:g.actionButtons,disableSpacing:!0},i&&o().createElement(l.Button,{onClick:i},c),o().createElement("div",null,u&&o().createElement(l.Button,{onClick:u,classes:{root:g.discardButton}},d),o().createElement(l.Button,{onClick:p,color:"primary",disabled:m,autoFocus:!0},h))))}},14363:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(79692).Z)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(20562),i=n(24328),a=n.n(i),l=n(52730),s=n(59431),c=n(81403),u=n(91262),d=n(71153),p=n.n(d),h=n(17440),m=n(7154),g=n(26579),f=n(81077);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y=e=>{let{connection:t,relatedEntity:n,inRelationTypes:d=[],outRelationTypes:y=[],showEmptyEditors:v,entityErrorMessage:x,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:T,onChangeEntity:O}=e;const R=r(),{relation:S,entity:P}=t,{attributes:N,uri:L,type:j="",direction:k}=S||{},_=Boolean(j),I=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>S&&function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}({attributes:N},(0,c.p2l)(S))),[S,N]),D=(0,i.useMemo)((()=>(0,c.xF8)(I,j)),[j,I]),Z=(0,i.useMemo)((()=>_?(0,c.jWj)(k===c.Nsj.OUT,I,[(0,c.V3K)(I,j)]):(0,h.uniq)((0,c.jWj)(!0,I,y).concat((0,c.jWj)(!1,I,d)))),[_,j,I,d,y]),U=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),z=(0,i.useMemo)((()=>S&&{relationType:S.type,direction:S.direction}),[S]),B=(0,i.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,c.idV)(P.label)}),[P]),M=(0,i.useMemo)((()=>P&&P.uri?d.filter((0,c.eHk)(!1,P,n,I)):d),[P,d,n,I]),F=(0,i.useMemo)((()=>P&&P.uri?y.filter((0,c.eHk)(!0,P,n,I)):y),[P,y,n,I]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(d,y)||{};!j&&e&&T&&T({type:e.uri,direction:t})}),[j,d,y,T]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(M,F)||{};!j&&e&&T({type:e.uri,direction:t})}),[j,P,M,F,O]);const q=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;T({type:t.uri,direction:n})}),[T]);return a().createElement(a().Fragment,null,T&&a().createElement(m.Z,{className:R.item,relation:z,metadata:I,inRelationTypes:d,outRelationTypes:y,onChange:q}),O&&a().createElement(g.Z,{errorMessage:x,className:R.item},a().createElement(f.Z,{key:j,className:p()({[R.dense]:x}),entity:B||{},entityTypesUris:Z,max:20,globalSearchRequestOptions:U,mode:c.fO_.EDITING,onChange:O,onCreate:void 0,metadata:I,attributeTypesSelectionStrategy:void 0})),j&&a().createElement(u.Z,{attrTypes:D,entity:A,showEmptyEditors:v,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},7154:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(81403),s=n(17440),c=n(89846),u=n(27185);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=e=>{let{relation:t={},inRelationTypes:n=[],outRelationTypes:i=[],onChange:a=s.identity,applyFirstByDefault:l=!1,reversedContextLabels:p=!1}=e,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:m,fromEditorValue:g,toEditorValue:f}=(0,c.n)({reversedContextLabels:p}),b=(0,r.useMemo)((()=>m(n,i)),[m,n,i]),y=(0,r.useCallback)((0,s.pipe)(g(n,i),a),[g,n,i,a]),v=!!t.relationType;return(0,r.useEffect)((()=>{l&&b.length&&!v&&y(b[0])}),[b,l,y,v]),o().createElement(u.Z,d({value:f(t,b),options:b,onChange:y},h))};p.propTypes={className:a().string,relation:l.bNA,inRelationTypes:a().arrayOf(l.IYE),outRelationTypes:a().arrayOf(l.IYE),applyFirstByDefault:a().bool,reversedContextLabels:a().bool,onChange:a().func};const h=p},68439:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(94079),c=n(81403),u=n(59431);const d=(0,n(79692).Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),p=e=>{let{entity:t,className:n,size:r="small"}=e;const a=d(),p=(0,i.useSelector)(u.ZP.selectors.getMetadata),h=t.type,m=(0,c.nt9)(p,h)||{},g=(0,c.VD3)(p,m,"typeColor")||c.rSc.palette.primary.main;return o().createElement(s.Typography,{style:{backgroundColor:g,color:c.P6Y.Colors.getColor(g)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],n),component:"div"},(0,c.jFi)(p,t))}},59725:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(81403),s=n(42520);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:h={},disabled:m=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.oDv)),[t]);return o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:h,disabled:m,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},93416:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(92778);const s=(0,n(79692).Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),c=e=>{let{className:t,title:n,children:r}=e;const i=s();return o().createElement(l.Z,{title:n,classes:{root:a()(i.container,t),title:i.title}},r)}},42520:(e,t,n)=>{n.d(t,{S:()=>L});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17440),s=n(81403),c=n(94079),u=n(83543),d=n(79692);const p=(0,d.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),h=(e,t)=>{const{childNodes:n,clientLeft:r,clientWidth:o}=t;if(n.length>0){const[t]=Array.from(n),i=document.createRange();i.setStart(t,0);for(let n=0;n<e.length;n++){i.setEnd(t,i.endOffset+e[n].length);const{width:a}=i.getBoundingClientRect();if(r+a>o)return n;n!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1},m=e=>e.join(", "),g=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,f=e=>{let{list:t,maxWidth:n}=e;const i=p(),a=(0,r.useRef)(),[l,s]=(0,r.useState)(0);(0,r.useEffect)((()=>{s(((e,t)=>{const n=e.length,r=((e,t)=>{if(t){const n=h(e,t);return-1===n?0:e.length-n}return 0})(e,t);return n-Math.max(1,n-r)})(t,a.current))}),[t]);const u=m(t),d=l>0,f=d?m(t.slice(0,-l)):u;return o().createElement(c.Tooltip,{title:d?u:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:g(n)},className:i.listLabel,ref:a},u),o().createElement("div",{className:i.visibleItemsLabel},f),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var b=n(22385),y=n(97820),v=n(54763),x=n(7785),E=n(27239),w=n(44890);function C(){return C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(this,arguments)}const T=(0,l.always)(32),O=(0,r.memo)((e=>{let{selectedItems:t,onItemClick:n,focusIndex:r,width:i,height:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return o().createElement(w.Z,C({getItemSize:T,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(x.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(E.Z,{text:l.label,highlight:l.filterText}),labelInText:l.label,style:e,isFocused:c,hideIcon:!0,LogoIcon:l.LogoIcon})},focusIndex:r,fixedTitle:!1,disableHorizontalScrollbar:!0,width:i,height:a},l))}));O.displayName="SelectMetadataTypesList";const R=(0,d.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){N(e,t,n[t])}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const L=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:d,onChange:p,ListLabelProps:h={},disabled:m,enableEmptyValueUnderline:g,single:x,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const T=R(),[N,L]=(0,r.useState)(!1),j=(0,r.useCallback)((()=>L(!0)),[]),k=(0,r.useCallback)((()=>L(!1)),[]),[_,I]=(0,r.useState)(""),A=(0,r.useCallback)((()=>I("")),[]),D=(0,r.useCallback)((0,l.pipe)(A,k),[k,A]),Z=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,_)})).map(((e,t)=>({item:{item:P({},e,{filterText:_})},index:t}))),U=(0,r.useMemo)((()=>d.map((e=>i.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[d,i]),z=(0,r.useCallback)(((e,t)=>{x?(p(t?[e.uri]:[]),D()):p(t?d.concat(e.uri):d.filter((t=>t!==e.uri)))}),[d,p,x,D]),B=(0,r.useCallback)((e=>{let{item:t}=e;const n=!d.includes(t.uri);z(t,n)}),[d,z]),{focusIndex:M,handleKeyDown:F}=(0,v.t)({items:Z,open:N,onSelectFocusedItem:B,selectedItems:d,onClose:D}),q=(0,r.useRef)(),G=q.current?q.current.getBoundingClientRect().width:0,H=Math.max(G,255),V=0===d.length;return o().createElement(o().Fragment,null,o().createElement(c.TextField,{label:E,ref:q,InputProps:{startAdornment:V&&!t?null:o().createElement("div",{className:a()(T.inputText,n.inputText)},V?o().createElement("div",null,t):o().createElement(f,S({},h,{list:U}))),classes:{root:T.inputRoot,input:a()(T.input,n.input,{[T.emptyInput]:V&&!t}),disabled:a()(T.disabledInput,{[T.disabledPointer]:m}),underline:T.disabledUnderline},endAdornment:o().createElement(b.Z,{size:"L",icon:u.Z,iconClassName:a()(T.icon,{[T["popup-opened-icon"]]:N}),disabled:m}),readOnly:!0,disabled:!0,disableUnderline:V&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(T.inputLabel,n.label)}},value:"",onClick:m?void 0:j,classes:{root:a()(T.root,n.root)},margin:"dense",variant:"filled",disabled:m,"data-reltio-id":w}),o().createElement(y.Z,{open:N,anchorEl:q.current,onClose:D,onSearch:I,title:C,containerWidth:H,containerHeight:355,searchInputOnKeyDown:F,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(O,{items:Z,onItemClick:z,selectedItems:d,width:H,height:245,focusIndex:M})))}));L.displayName="MetadataTypesSelector"},57304:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(71153),s=n.n(l),c=n(52730),u=n(17440),d=n(94079),p=n(87918),h=n.n(p),m=n(81403),g=n(59431),f=n(53180),b=n(68439);const y=(0,n(79692).Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),v=e=>{let{className:t,entity:n,children:i,classes:a}=e;const l=y({classes:a}),p=(0,c.useSelector)(g.ZP.selectors.getMetadata),v=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,m.BTI)(n))}),[n]);if((0,u.isNil)(n))return null;const x=(0,m.idV)(n.label),E=n.secondaryLabel,w=(0,m.ptG)(p,n),C=(0,m.Fn9)(n),T=n.uri,O=(0,m.BTI)(n);return o().createElement("div",{className:s()(l.profileBandWrapper,t)},o().createElement("div",{className:s()(l.profileBand,{[l.inactive]:!C}),"data-entity-uri":T},o().createElement(f.Z,{key:n.uri,entity:n,avatarClassName:l.profileIcon,imageClassName:l.imageProfileIcon}),o().createElement("div",{className:l.profileInfo},o().createElement("div",null,o().createElement(d.Typography,{variant:"h6",className:l.label},x),E&&o().createElement(d.Typography,{variant:"subtitle2",className:l.secondaryLabel},E),w&&o().createElement(d.Typography,{variant:"subtitle1",className:l.businessCard},w)),o().createElement("div",{className:l.specialInfo},o().createElement("div",{className:l.entityType},o().createElement(b.Z,{entity:n,size:"medium",className:l.badge}),!(0,m.ZiX)(T)&&o().createElement(d.Tooltip,{title:h().text("Copy to clipboard")},o().createElement(d.Typography,{display:"inline",variant:"body2",className:l.entityId,onClick:v},h().text("Entity ID"),": ",O))))),i&&o().createElement("div",null,i)))};v.propTypes={className:a().string,entity:a().object,children:a().node,classes:a().object};const x=v},93873:(e,t,n)=>{n.d(t,{a:()=>P});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(94079),s=n(83348),c=n(8818),u=n(67766),d=n(42767),p=n(81403);const h=(0,n(79692).Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),m=(0,s.Z)(l.Link),g=e=>{let{total:t=0,onPrev:n,onNext:r,onSearchResultsClick:i,isPrevDisabled:l,isNextDisabled:s}=e;const g=h();return o().createElement("div",{className:g.container},o().createElement(m,{className:g.link,component:"button",variant:"caption",onClick:i,underline:"none",tooltipTitle:a().text("Go to search results")},(0,p.k7L)(t,1e6)," ",1===t?a().text("Search result"):a().text("Search results")),o().createElement(c.k,{size:"L",icon:u.Z,tooltipTitle:a().text("Go to previous profile"),onClick:n,disabled:l,showForDisabled:!0}),o().createElement(c.k,{size:"L",icon:d.Z,tooltipTitle:a().text("Go to next profile"),onClick:r,disabled:s,showForDisabled:!0}))};var f=n(52730),b=n(59431),y=n(17440),v=n(39450),x=n(67218);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){w(e,t,n[t])}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class C{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:o},tenant:i,searchTenant:a,apiPath:l,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]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[t.getQueryFilter(),...e],o=E({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,p.uqV)({filters:r,options:o,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,p.ZOr)(r,o)},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,p.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,p.j_Q)(e,t)).then((e=>e.total))},this.query=n,this.sortField=r,this.sortOrder=o,this.tenant=i,this.searchTenant=a,this.apiPath=l,this.dtssPath=s,this.globalSearchRequestOptions=c}}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class R{constructor(e){var t=this;let{data:n,tenant:r,apiPath:o}=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]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[{rawFilter:t.searchBody.filter},...e];return(0,p.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:T({},t.searchBody,{filter:e.length?(0,p.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,p.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,p.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=o}}const S=(e,t)=>(0,y.pipe)((0,y.map)((0,y.prop)("uri")),(0,y.reject)((e=>t.includes(e))))(e),P=()=>{const{total:e,onPrev:t,onNext:n,onSearchResultsClick:i,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,x._)(),t=(0,x._)(),n=(0,x._)(),{uri:o,index:i,total:a,tenant:l,cache:s}=(0,f.useSelector)(b.ZP.selectors.getSearchNavigationData)||{},{type:c,data:u}=(0,f.useSelector)(b.ZP.selectors.getSearchProviderData)||{},d=(0,f.useSelector)(b.ZP.selectors.getTenant),h=(0,f.useSelector)(b.ZP.selectors.getApiPath),m=(0,f.useSelector)(b.ZP.selectors.getDtssPath),g=(0,f.useSelector)((e=>b.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),y=(0,r.useContext)(v.m),E=(0,f.useDispatch)(),[w,T]=(0,r.useState)(!1),O=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new C(t);case"graphsearch":return new R(t)}})(c,{data:u,tenant:d,searchTenant:l,apiPath:h,dtssPath:m,globalSearchRequestOptions:g})),[c,u,d,l,h,m,g]),P=(0,r.useCallback)((e=>{E(b.yC.actions.updateSearchNavigationDataFields(e))}),[E]),N=(0,r.useCallback)((e=>{const t=d!==l?(0,p.wwR)({uri:e,dataTenant:l}):e;E(b.ui.actions.openEntity({uri:t,viewId:y,source:"navigation"}))}),[E,y,d,l]),L=(0,r.useCallback)((()=>{E(b.ui.actions.openPerspective({perspectiveId:c,viewId:y}))}),[E,c,y]);(0,r.useEffect)((()=>{i>=a?P({index:a-1}):i<0&&P({index:0})}),[a,i,P]);const j=(0,r.useCallback)(((e,r,o)=>{T(!0),t(O.requestTotal()).then((e=>P({total:e})));const i=o+1;return n(O.requestEntities(15,i)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return P({cache:e.concat(n),uri:n[0],index:i+t.length-n.length}),void N(n[0]);if(o+t.length<r-1)return j(e,r-t.length,o+t.length)}P({index:i})}})).finally((()=>{T(!1)}))}),[O,P,N]),k=(0,r.useCallback)(((e,r)=>{T(!0),t(O.requestTotal()).then((e=>P({total:e})));const o=r-1,i=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(O.requestEntities(a,i)).then((t=>{if(t){if(t.length){const n=S(t,e);if(n.length>0)return P({cache:n.concat(e),uri:n[n.length-1],index:o-(t.length-n.length)}),void N(n[n.length-1]);if(r-t.length>0)return k(e,r-t.length)}P({index:0})}})).finally((()=>{T(!1)}))}),[O,P,N]),_=(0,r.useCallback)(((t,n,r,o)=>{if(n<t.length){const i=t[n];return T(!0),e(O.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),_(e,n,r-1,o)}P({index:o+1,uri:i,cache:t,total:r}),N(i)})).finally((()=>{T(!1)}))}if(!(o>=r-1))return j(t,r,o);P({cache:t,total:r,index:r-1})}),[O,P,N,j]),I=(0,r.useCallback)(((t,n,r,o)=>{if(n>-1){const i=t[n];return T(!0),e(O.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),I(e,n-1,r-1,o-1)}P({index:o-1,uri:i,cache:t,total:r}),N(i)})).finally((()=>{T(!1)}))}if(!(o<=0))return k(t,o);P({index:0,cache:t,total:r})}),[O,P,N,k]),A=(0,r.useCallback)((()=>{if(s&&o){const e=s.indexOf(o)-1;I(s,e,a,i)}}),[I,s,o,a,i]),D=(0,r.useCallback)((()=>{if(s&&o){const e=s.indexOf(o)+1;_(s,e,a,i)}}),[_,s,o,a,i]);return{total:a,onPrev:A,onNext:D,onSearchResultsClick:L,isPrevDisabled:w||i<=0,isNextDisabled:w||i>=a-1}})();return(()=>{const{cache:e}=(0,f.useSelector)(b.ZP.selectors.getSearchNavigationData)||{},t=(0,f.useSelector)(b.ZP.selectors.getMode),n=(0,f.useSelector)(b.ZP.selectors.getEntity);return(0,p.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?o().createElement(g,{total:e,onPrev:t,onNext:n,onSearchResultsClick:i,isPrevDisabled:a,isNextDisabled:l}):null}},32371:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(87918),a=n.n(i),l=n(81403),s=n(42520);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p={},ListLabelProps:h={},disabled:m=!1}=e;const g=(0,r.useMemo)((()=>t.filter(l.Tt2)),[t]);return o().createElement(s.S,{items:g,selectedItemsUris:n,single:i,placeholder:c,enableEmptyValueUnderline:u,onChange:d,classes:p,ListLabelProps:h,disabled:m,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},39827:(e,t,n)=>{n.d(t,{G:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(8818),s=n(79692),c=n(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 d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const h=e=>{let{buttonsProps:t,activeIndexId:n,className:r,onButtonClick:i,classes:s={}}=e;const c=u(),{active:h,buttonWrapper:m}=s,g=p(s,["active","buttonWrapper"]);return o().createElement("div",{className:a()(c.container,r)},t.map((e=>{let{id:t}=e,r=p(e,["id"]);return o().createElement(l.k,d({},r,{classes:g,size:"S",key:t,className:a()({[a()(c.active,h)]:n===t},c.buttonWrapper,m),onClick:()=>i(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))}},52043:(e,t,n)=>{n.d(t,{h:()=>a});var r=n(24328),o=n.n(r);const i=(0,n(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})}}))),a=e=>{let{width:t,open:n,children:r}=e;const a=i();return o().createElement("div",{className:a.contentWrapper,style:{width:`${n?t:0}px`}},n&&o().createElement(o().Fragment,null,r))}},8962:(e,t,n)=>{n.d(t,{Z:()=>j});var r=n(52730),o=n(59431),i=n(24328),a=n.n(i),l=n(81403),s=n(71153),c=n.n(s),u=n(87918),d=n.n(u),p=n(94079),h=n(60995),m=n(10237),g=n(93416),f=n(80931),b=n(8261),y=n(79692);const v=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),x=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},metadata:s,caption:u="",excludeUris:y=[],includeUris:x=[],attributesCount:E=16}=e;const w=v(),C=(0,r.useSelector)(o.ZP.selectors.getPivotingAttributes),T=(0,i.useMemo)((()=>(0,b.U)(s,n.type,x,y)),[y,x,s,n.type]),O=(0,l.fyF)(T,n).filter((e=>{let{values:t}=e;return!(0,l.O27)(t)})).length>0;return O||!(0,l.O27)(u)?a().createElement(h.J.Provider,{value:C},a().createElement(m.Z,{className:t},u&&a().createElement(g.Z,{className:w.header,title:u}),a().createElement(p.Box,{className:c()(w.attributesContainer,{[w.noCaption]:!u})},O?a().createElement(f.Z,{entity:n,attrTypes:T,parentUri:n.uri,drawLines:!1,max:E}):a().createElement(p.Typography,{className:w.noData},d().text("No data found"))))):null}));var E=n(17440),w=n(91262),C=n(39450),T=n(66784);const O=(0,y.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=(0,r.connect)((e=>({metadata:o.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:n={},mode:s,metadata:u,caption:d="",excludeUris:h=[],includeUris:f=[],pinnedAttributes:y}=e;const v=O(),x=(0,r.useDispatch)(),S=(0,i.useContext)(C.m),P=(0,r.useSelector)(o.ZP.selectors.getUserRoles),N=(0,i.useMemo)((()=>(0,l.mC3)(y,P)),[y,P]),L=(0,r.useSelector)((e=>o.ZP.selectors.getModifiedEntity(e,n.uri)||{})),j=(0,i.useMemo)((()=>(0,b.U)(u,L.type,f,h)),[h,f,u,L.type]),k=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.addAttributes,x)(e.map((e=>R({},e,{viewId:S}))))),[S,x]),_=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.modifyAttribute,x)(R({},e,{viewId:S}))),[S,x]),I=(0,i.useCallback)((e=>(0,E.pipe)(o.N5.actions.removeAttribute,x)(R({},e,{viewId:S}))),[S,x]);return a().createElement(m.Z,{className:t},d&&a().createElement(g.Z,{className:v.header,title:d}),a().createElement(p.Box,{className:c()(v.attributesContainer,{[v.noCaption]:!d})},a().createElement(T.c.Provider,{value:N},a().createElement(w.Z,{entity:L,attrTypes:j,parentUri:L.uri,drawLines:!1,mode:s,showEmptyEditors:(0,l.ZiX)(L.uri),crosswalks:L.crosswalks,onAddAttributes:k,onChangeAttribute:_,onDeleteAttribute:I}))))}));var N=n(3185);function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}const j=(0,r.connect)(((e,t)=>({entity:t.entity||o.ZP.selectors.getEntityWithDiff(e),mode:t.mode||o.ZP.selectors.getMode(e)})))((e=>{let{mode:t=l.ARY.Viewing,attributesCount:n,pinnedAttributes:r,entity:o}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["mode","attributesCount","pinnedAttributes","entity"]);return a().createElement(N.u.Provider,{value:o},(0,l.uzs)(t)?a().createElement(x,L({attributesCount:n,entity:o},i)):a().createElement(P,L({mode:t,pinnedAttributes:r,entity:o},i)))}))},27185:(e,t,n)=>{n.d(t,{Z:()=>T});var r=n(24328),o=n.n(r),i=n(13980),a=n.n(i),l=n(87918),s=n.n(l),c=n(17440),u=n(71153),d=n.n(u),p=n(94079);const h=(0,n(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 m=n(31254),g=n(88611);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}const b=e=>{let{innerRef:t,innerProps:n,selectOption:r,data:i}=e;const a=h(),{value:l,label:s,startObject:c,endObject:u}=i,b=c.objectType.label+" ↔ "+u.objectType.label;return o().createElement(p.MenuItem,f({className:a.container,ref:t,key:l,onClick:()=>r({label:s,value:l,startObject:c,endObject:u})},n),o().createElement("div",{className:a.icons},o().createElement(m.Z,{className:a.iconTop,entityType:c.objectType}),o().createElement(m.Z,{className:a.iconBottom,entityType:u.objectType})),o().createElement("div",{className:a.text},o().createElement(g.C,{value:s},o().createElement(p.Typography,{className:d()(a.textItem,a.primaryTextItem)},s)),o().createElement(g.C,{value:b},o().createElement(p.Typography,{color:"textSecondary",className:d()(a.textItem,a.secondaryTextItem)},b))))};b.propTypes={innerRef:a().oneOfType([a().oneOf([null]),a().func,a().shape({current:a().any.isRequired})]),innerProps:a().object.isRequired,selectOption:a().func.isRequired,data:a().shape({value:a().string.isRequired,label:a().string.isRequired,startObject:a().object,endObject:a().object})};const y=b;var v=n(24737);function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=e=>{let{value:t={},options:n=[],onChange:i=c.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","options","onChange","TextFieldProps"]);const u=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}({},(0,c.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return o().createElement(v.Z,x({value:t,options:n,onChange:i,label:s().text("Select relationship type "),components:{Option:y},TextFieldProps:u},l))},C=a().shape({label:a().string.isRequired,value:a().string.isRequired,startObject:a().object,endObject:a().object});w.propTypes={value:C,options:a().arrayOf(C),onChange:a().func};const T=w},78620:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(24328),o=n(81403),i=n(17440),a=n(52730),l=n(59431);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const u=(0,a.useSelector)(l.ZP.selectors.getMetadata),d=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),d),[t.relation,d]),h=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),d),[t.relation,d]),m=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),d),[t.relation,d]),g=(0,r.useCallback)((e=>{let{type:r,direction:i}=e;const a={entity:t.entity&&(0,o.eHk)(i===o.Nsj.OUT,t.entity,c,u,(0,o.V3K)(u,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,u]);return{onAddAttributes:p,onChangeAttribute:h,onRemoveAttribute:m,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},89846:(e,t,n)=>{n.d(t,{n:()=>a});var r=n(24328),o=n(81403),i=n(17440);const a=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,r.useCallback)(((e,n)=>{const r={},a=(0,i.pipe)(o.PjQ,(0,i.tap)((e=>r[e]=(0,i.propOr)(0,e,r)+1))),l=(0,i.ascend)((0,i.prop)("label")),s=(0,i.curry)(((e,n)=>{let{uri:r,label:i,startObject:l,endObject:s}=n;const c=e===(t?o.Nsj.OUT:o.Nsj.IN)?l:s;return{label:{directionalLabel:a(c),typeLabel:i},value:`${r},${e}`,startObject:l,endObject:s}}));return e.map(s(o.Nsj.IN)).concat(n.map(s(o.Nsj.OUT))).map((0,i.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(l)}),[t]),fromEditorValue:(0,r.useCallback)(((e,t)=>n=>{const[r,a]=n.value.split(",");return{type:(a===o.Nsj.IN?e:t).find((0,i.propEq)("uri",r)),direction:a}}),[]),toEditorValue:(0,r.useCallback)(((e,t)=>t.find((0,i.propEq)("value",`${e.relationType},${e.direction}`))),[])}}},59838:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Dn});var r=n(24328),o=n.n(r),i=n(52730),a=n(36138),l=n(585),s=n(22664),c=n(52844),u=n(59431),d=n(99136),p=n(98996),h=n(17440),m=n(81403),g=n(87918),f=n.n(g),b=n(60715),y=n(35174);function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){x(e,t,n[t])}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.relations.filter((e=>!n.includes(e))).filter((0,h.either)((0,h.pipe)(m.nqN,(0,h.equals)(e)),(0,h.pipe)(m.j5q,(0,h.equals)(e))));n.push(...r);const o=(0,h.pipe)(w,(0,h.without)([e]))(r);return o.forEach((e=>E(e,t,n))),n},w=e=>(0,h.pipe)((0,h.chain)((e=>[(0,m.nqN)(e),(0,m.j5q)(e)])),h.uniq)(e),C=(e,t)=>{const n=(e=>{var t;const n=new Set,r=new Set;e.entities.forEach((e=>n.add(e.uri))),((null===(t=e.relations)||void 0===t?void 0:t.filter((e=>n.has(e.startObject.objectURI)&&n.has(e.endObject.objectURI))))||[]).forEach((e=>{r.add(`${e.startObject.objectURI}--${e.endObject.objectURI}--${e.uri}--${e.type}--${e.direction}`)}));const o=e.entities.map((e=>({id:e.uri,name:e.label,entityTypeUri:e.type,traversedRelationsCount:e.traversedRelations,untraversedRelationsCount:e.untraversedRelations}))),i=[];return r.forEach((e=>{const[t,n,r,o,a]=e.split("--");i.push({from:t,to:n,key:r,relationTypeUri:o,direction:a})})),{nodes:o,edges:i}})(t);n.nodes.forEach((t=>{e.hasNode(t.id)||e.addNode(t.id,{label:(0,m.idV)(t.name),entityTypeUri:t.entityTypeUri,traversedRelationsCount:t.traversedRelationsCount,untraversedRelationsCount:t.untraversedRelationsCount,x:1,y:1})})),n.edges.forEach((t=>{const n=t.from===t.to;e.hasEdge(t.key)||e.addEdgeWithKey(t.key,t.from,t.to,{size:1,color:"rgba(0, 0, 0, 0.2)",forceLabel:n,loop:n,relationTypeUri:t.relationTypeUri,direction:t.direction})}))},T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=t.neighbors(e).filter((e=>!n.includes(e)));return n.push(...r),r.forEach((e=>T(e,t,n))),n};var O=n(67218);const R=e=>{const[t,n]=(0,r.useState)(null),[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,g]=(0,r.useState)(!1),x=null==e?void 0:e.uri,R=(0,m.biM)(e),S=(0,i.useSelector)(u.ZP.selectors.getMetadata),P=(0,O._)(),N=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return P((0,m.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}))}),[t,P]);(0,r.useEffect)((()=>(!x||(0,m.ZiX)(x)||R||(g(!0),(0,m.ZYI)({uri:x,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,m.nIW)(t)]:null,activenessDate:null,max:t?200:3e3}).then((e=>{const t=new p.MultiGraph;C(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)}))),()=>{a(null),c(null),g(!1)})),[x,R,l,t]);const L=(0,r.useCallback)((e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;return g(!0),(0,m.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}).then((e=>{var t;if(null==e||null===(t=e[0])||void 0===t||!t.successful)throw null==e?void 0:e[0];const n=e[0].object,r=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,h.prop)("uri")),l=(0,m.V3K)(n,t.type),s=i.find((e=>!(0,h.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),u=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},d=v({},(0,h.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,h.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,h.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(u?e.entities.concat([u]):e.entities).map((e=>e.uri===r||e.uri===o?v({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:e.relations.concat([d])}})(s,n,S);C(o,r);const i=[n.startObject.objectURI,n.endObject.objectURI],a=s.entities.map((0,h.prop)("uri"));i.map((e=>{if(a.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(r)})).catch((e=>{throw l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong")))),e})).finally((()=>{g(!1)}))}),[l,s,o,S]),j=(0,r.useCallback)((e=>{g(!0),(0,m.VGk)(e).then((()=>{o.extremities(e).map((e=>{const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t-1)})),o.dropEdge(e);const{updatedData:t,removedEntitiesUris:n}=((e,t,n,r)=>{const o=r.relations.find((0,h.propEq)("uri",t)),i=(0,m.nqN)(o),a=(0,m.j5q)(o),l=(0,y.toUndirected)(n),s=(0,h.cond)([[()=>!(0,b.Ar)(l,e,i),(0,h.always)(i)],[()=>!(0,b.Ar)(l,e,a),(0,h.always)(a)],[h.T,(0,h.always)(null)]])(),c=(0,h.evolve)({entities:(0,h.map)((e=>e.uri===i||e.uri===a?v({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,h.reject)((0,h.propEq)("uri",t))})(r),{updatedData:u,removedEntitiesUris:d}=s?((e,t)=>{const n=E(e,t),r=(0,h.pipe)(w,(0,h.append)(e),h.uniq)(n);return{updatedData:(0,h.evolve)({relations:(0,h.reject)((e=>n.includes(e))),entities:(0,h.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:u,removedEntitiesUris:d}})(x,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)}))}),[l,o,x,s]),k=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,h.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,y.toUndirected)(r),i=(e,t)=>{o.filterEdges(e,t,(e=>!!e)).forEach((e=>o.dropEdge(e)))};n.forEach((e=>{i(t,e),o.forEachNeighbor(e,(t=>{i(e,t)}))}));const a=[];return o.nodes().forEach((t=>{((e,t,n)=>(0,b.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,h.uniq)(a.reduce(((e,t)=>T(t,o,e)),[...a]))})(x,e,r,o).forEach((t=>{t!==x&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[x,o]),_=(0,r.useCallback)((e=>{if(e&&!(0,m.ZiX)(e)&&!R){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(g(!0),N(e).then((t=>{const n=((e,t,n)=>{const{entities:r=[],relations:o=[]}=t;return{entities:r.reduce(((e,t)=>{if(e.some((e=>{let{uri:n}=e;return n===t.uri}))){if(t.uri===n){const r=e.findIndex((e=>{let{uri:t}=e;return t===n}));e[r]=v({},e[r],{traversedRelations:t.traversedRelations,untraversedRelations:t.untraversedRelations})}}else e.push(t);return e}),[...e.entities||[]]),relations:o.reduce(((e,t)=>(e.some((e=>{let{uri:n}=e;return n===t.uri}))||e.push(t),e)),[...e.relations||[]])}})(s,t,e);C(o,t);const r=t.entities.find((t=>t.uri===e));o.setNodeAttribute(e,"untraversedRelationsCount",r.untraversedRelations),o.setNodeAttribute(e,"traversedRelationsCount",r.traversedRelations),c(n)})).catch((e=>{console.error(e),l(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{g(!1)})))}}),[s,l,o,R,N]);return{graphLoading:d,data:s,graphologyGraph:o,graphTypeUri:t,setGraphTypeUri:n,onAddRelation:L,onDeleteRelation:j,onCollapseEntity:k,onExpandEntity:_}};function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const P=(e,t)=>{const n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){S(e,t,n[t])}))}return e}({},e,{[null==t?void 0:t.uri]:t}),r=Object.keys(n);return r.length>50&&delete n[r[0]],n},N=[25,50,100];function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const j=(e,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,m.nqN)(t)===n?r:o;return a||(0,m.Lmx)(e,i)},k=e=>{let{data:t,selectedEntityUri:n,mainEntityUri:o,graphTypeUri:a}=e;const[l,s]=(0,r.useState)({field:"",order:"asc"}),[c,d]=(0,r.useState)(0),[p,g]=(0,r.useState)(N[0]),[b,y]=(0,r.useState)([]),[v,x]=(0,r.useState)(!1),E=(0,i.useDispatch)(),w=(0,i.useSelector)(u.ZP.selectors.getMetadata),C=(0,r.useMemo)((()=>{const e=(null==t?void 0:t.entities)||[];return(0,h.zipObj)(e.map((0,h.prop)("uri")),e)}),[null==t?void 0:t.entities]),T=(0,r.useMemo)((()=>(0,h.pipe)((0,h.filter)((0,h.either)((0,h.pipe)(m.nqN,(0,h.equals)(n)),(0,h.pipe)(m.j5q,(0,h.equals)(n)))),(0,h.uniqBy)((0,h.prop)("uri")),(0,h.map)((e=>{const t=C[((e,t)=>{const n=(0,m.nqN)(t),r=(0,m.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,m.idV)(t.label),entityTypeLabel:(0,m.jFi)(w,t),relationTypeLabel:j(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:O,onChangeSearchText:R,filters:S,onFilter:P,relationTypesOptions:k,entityTypesOptions:_}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,h.pipe)((0,h.map)((e=>{let{entity:t}=e;return t.type})),(0,h.concat)(h.__,o.entityTypesUris),h.uniq,(0,h.map)((0,m.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,h.pipe)((0,h.map)((e=>{let{relation:t}=e;return t.type})),(0,h.concat)(h.__,o.relationTypesUris),h.uniq,(0,h.map)((0,m.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(T),I=(0,r.useMemo)((()=>(0,h.pipe)((0,h.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=S;return m.P6Y.strings.search(t,O)&&(0,h.ifElse)((0,h.prop)("length"),(0,h.includes)(r.type),h.T)(i)&&(0,h.ifElse)((0,h.prop)("length"),(0,h.includes)(n.type),h.T)(o)})),l.field?(0,h.sort)(((e,t)=>m.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):h.identity)(T)),[T,l,O,S]),A=(0,r.useMemo)((()=>I.slice(c*p,c*p+p)),[I,c,p]),D=(0,r.useCallback)((e=>{x(!0),(0,m._vs)(e).then((e=>{y((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Can't load relationship's attributes"))))})).finally((()=>x(!1)))}),[E]),Z=(0,r.useCallback)((e=>{y((t=>t.map((t=>t.relation.uri===e.uri?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){L(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),R("")}),[n,a,R,P]),(0,r.useEffect)((()=>{P({entityTypesUris:[],relationTypesUris:[]})}),[a,o,P]),(0,r.useEffect)((()=>{d(0)}),[l,O,S]);const U=(0,r.useCallback)((e=>{y((t=>t.filter((t=>t.relation.uri!==e))))}),[]),z=(0,r.useCallback)(((e,t)=>{x(!0),(0,m.HH7)({oldRelation:e,newRelation:t}).then((()=>{U(t.uri)})).catch((e=>{E(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Can't edit relationship"))))})).finally((()=>x(!1)))}),[U,E]);return{rowsData:A,onSort:s,sorting:l,searchText:O,onChangeSearchText:R,filters:S,onFilter:P,entityTypesOptions:_,relationTypesOptions:k,editingRelations:b,onStartRelationEditing:D,onCancelRelationEditing:U,onUpdateEditingRelation:Z,total:I.length,page:c,rowsPerPage:p,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:z,loading:v}},_=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{}});_.displayName="GraphStateContext";var I=n(71153),A=n.n(I),D=n(57304),Z=n(19603),U=n(93873),z=n(94646),B=n(94079),M=n(79692);const F=(0,M.Z)({comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),q=(0,r.memo)((e=>{let{className:t}=e;const n=F(),r=(0,i.useSelector)(u.ZP.selectors.getEntity),a=(0,i.useSelector)(u.ZP.selectors.getEntityUriWithDataTenant);return o().createElement(D.Z,{className:A()(t,Z.U),entity:r},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},o().createElement(U.a,null))),o().createElement(B.Box,{className:n.comments},o().createElement(z.Z,{uri:a,relatedObjectUris:(0,m.wp9)(m.q7e.ENTITY,{entityUri:a}),objectType:m.q7e.ENTITY})))}));q.displayName="GraphProfileBand";const G=q;var H=n(52043),V=n(39827),W=n(82726);const Y=(0,M.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0}});function $(){return $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}const X=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",$({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7v2h2V7H6zm0 4v2h2v-2H6zm0 4v2h2v-2H6zm4-8v2h8V7h-8zm10-2v5.02a6.52 6.52 0 012 2.01V3H2v18h11.028a6.52 6.52 0 01-2.009-2H4V5h16zm-9.503 8a6.497 6.497 0 011.31-2H10v2h.497zM10 15.5c0-.168.006-.335.019-.5H10v.5zm0 0c0 .516.06 1.018.173 1.5H10v-1.5zm10.3 2.39L23.42 21 22 22.42l-3.12-3.12c-.69.44-1.51.7-2.39.7-2.48 0-4.49-2.01-4.49-4.5s2.01-4.5 4.5-4.5 4.5 2.01 4.5 4.5c0 .88-.26 1.69-.7 2.39zm-3.8.11a2.5 2.5 0 000-5 2.5 2.5 0 000 5z",fill:"currentColor"}))};var K=n(48852);const Q=(0,K.l)(_,(0,h.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;return o().createElement(D.Z,{entity:t})}));var J=n(8962);const ee=(0,M.Z)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),te=(0,K.l)(_,(0,h.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=ee();return o().createElement("div",{className:r.wrapper},n&&o().createElement(d.Z,null),o().createElement(J.Z,{entity:t,caption:f().text("Entity details"),className:r.noShadowBlock}))}));var ne=n(58662),re=n(44443),oe=n(30739),ie=n(31276);const ae="1px solid rgba(0, 0, 0, 0.05)",le=(0,M.Z)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:ae},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px",paddingBottom:"8px"},headRow:{borderBottom:ae}});function se(){return se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}const ce=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=le();return o().createElement("div",{className:A()(i.tableRow,i.headRow)},t.map((e=>{const{id:t,sortable:i,headCellRenderer:a,columnClassName:l}=e,s=a,c=i?{sortField:n.field,sortOrder:n.order,sortHandler:()=>{r({field:t,order:n.field===t?(0,ie.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,se({headCellData:e},c)))})))})),ue=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:u,defaultRowHeight:d}=e;const p=le(),[h,m]=(0,r.useState)({width:0,height:0}),g=(0,r.useCallback)((e=>{let{data:t,index:r}=e;const a=t[r];return o().createElement("div",{className:A()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:A()(p.tableRow,null==n?void 0:n.tableRow,{[p.editingRow]:a.expanded})},i.map((e=>{let{id:t,rowCellValueRenderer:n,columnClassName:r}=e;const i=n;return o().createElement("div",{key:t,className:r},o().createElement(i,{value:a[t],rowValue:a}))}))),a.expanded&&u&&o().createElement(u,{open:a.expanded,rowValue:a}))}),[i,u]),f=(0,r.useCallback)(((e,t)=>{m({width:e,height:t})}),[]),b=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{var e;null===(e=b.current)||void 0===e||e.scrollTo(0)}}))),o().createElement("div",{className:p.table},o().createElement(ce,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(re.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),o().createElement("div",{className:p.tableBody},o().createElement(oe.Z,{listRef:b,width:h.width,height:h.height,data:a,defaultItemSize:d,itemKey:c,showNotMeasuredItems:!0},g))))})),de=(0,r.memo)(ue);var pe=n(92332),he=n(88611);const me="rgba(238, 238, 238, 1)",ge=(0,M.Z)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{width:"200px"},relationshipTypeColumn:{width:"130px"},entityTypeColumn:{width:"140px"},row:{position:"relative","&:hover":{background:me}}});function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const be={content:'""',position:"absolute",right:0,top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none"},ye=".collapsibleTableRow:hover &",ve=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}({},be,{[ye]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${me} 100%)`}}),xe=(0,M.Z)((e=>({headCell:{position:"relative",display:"flex",alignItems:"center",height:"33px",padding:"6px 0 6px 16px","&>div":{flexDirection:"row"},"&>div>span[role=button]":{width:"calc(100% + 49px)"}},headLabel:{color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden","&:after":be},defaultCell:{position:"relative",color:e.palette.text.primary,fontSize:"13px",fontWeight:"normal",lineHeight:"15px",whiteSpace:"nowrap",overflow:"hidden",display:"flex",alignItems:"center",height:"100%",padding:"6px 16px","&:after":ve},clickable:{cursor:"pointer"},profileCell:{paddingTop:"3px",paddingBottom:"4px"},controlsCell:{position:"absolute",display:"flex",alignItems:"center",height:"100%",flexShrink:0,top:0,right:"9px",visibility:"hidden",[ye]:{visibility:"visible",background:me}},editingMode:{visibility:"visible"},hidden:{visibility:"hidden"},editButton:{marginRight:"7px"},entityAvatar:{width:"20px",height:"20px",marginRight:"8px"},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)"}},expandedRow:{padding:"0 16px 6px",fontSize:"13px"}})));function Ee(){return Ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ee.apply(this,arguments)}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Te=e=>{let{className:t,headCellData:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["className","headCellData"]);const i=xe();return o().createElement("div",{className:A()(i.headCell,t)},o().createElement(pe.default,Ee({},r,{headCellData:we({},n,{label:o().createElement(he.C,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},Oe=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=xe();return n=n||t,o().createElement(he.C,{value:n},o().createElement("div",{className:A()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var Re=n(53180);const Se=(0,K.l)(_,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=xe(),l=o().createElement(o().Fragment,null,o().createElement(Re.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(Oe,{value:l,tooltip:t,className:A()(a.profileCell,r),onClick:()=>i(n.uri)})}));var Pe=n(78620),Ne=n(14363);const Le=(0,K.l)(_,((e,t)=>{let{relationshipTable:n}=e;return{editingRelationObject:n.editingRelations.find((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)})),onUpdateEditingRelation:n.onUpdateEditingRelation,onCancelRelationEditing:n.onCancelRelationEditing,onSaveEditingRelation:n.onSaveEditingRelation}}),(e=>{let{open:t,editingRelationObject:n,onUpdateEditingRelation:a,onCancelRelationEditing:l,onSaveEditingRelation:s}=e;const c=(0,i.useDispatch)(),d=(0,i.useSelector)(u.ZP.selectors.getMetadata),{relation:p,initialRelation:g}=n,b=(0,r.useMemo)((()=>!(0,h.equals)(g,p)),[p,g]),y=xe(),v=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),x=(0,r.useCallback)((()=>l(p.uri)),[l,p.uri]),E=(0,r.useMemo)((()=>({relation:p})),[p]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}=(0,Pe.R)({connection:E,onConnectionChange:v});return t?o().createElement("div",{className:y.expandedRow},o().createElement(Ne.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:T}),o().createElement("div",{className:y.actionButtons},o().createElement(B.Button,{onClick:x},f().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!b,onClick:()=>{(e=>{const t=(0,m.xkB)(d,{relation:{object:e}});return c(u.N5.errors.actions.errorsSet(t)),0===t.length})(p)&&s(g,p)}},f().text("Save")))):null}));var je=n(8818),ke=n(27604),_e=n(22983),Ie=n(81137);const Ae=(0,K.l)(_,(0,h.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Ie.Z,{open:n,title:f().text("Do you want to make a clean break?"),content:f().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:f().text("Delete relationship"),discardCaption:f().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),De=(0,r.memo)((e=>{let{uri:t}=e;const[n,i]=(0,r.useState)(!1),a=(0,r.useCallback)((()=>i(!0)),[]),l=(0,r.useCallback)((()=>i(!1)),[]);return o().createElement(o().Fragment,null,o().createElement(je.k,{icon:_e.Z,size:"XXS",tooltipTitle:f().text("Delete"),onClick:a}),o().createElement(Ae,{open:n,onClose:l,uri:t}))}));De.displayName="DeleteRelationButton";const Ze=De,Ue=(0,K.l)(_,((e,t)=>{let{relationshipTable:{onStartRelationEditing:n,editingRelations:r}}=e;return{onEdit:n,isEditing:r.some((e=>{var n;return e.initialRelation.uri===(null==t||null===(n=t.rowValue.relation)||void 0===n?void 0:n.uri)}))}}),(e=>{let{rowValue:{relation:{uri:t,type:n}},className:r,onEdit:a,isEditing:l}=e;const s=xe(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),d=(0,m.V3K)(c,n),p=(0,m.Z5t)(m.ARY.Editing,d),h=(0,m.Edd)(m.ARY.Editing,d);return o().createElement("div",{className:A()(s.controlsCell,r,{[s.editingMode]:l})},p&&o().createElement(je.k,{className:A()(s.editButton,{[s.hidden]:l}),icon:ke.Z,size:"XXS",tooltipTitle:f().text("Edit"),onClick:()=>a(t)}),h&&o().createElement(Ze,{uri:t}))}));function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Be(e,t,n[t])}))}return e}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(e,t)=>t[e].relation.uri||`${e}`,Fe=(0,K.l)(_,(e=>{let{relationshipTable:t}=e;return ze({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:u,editingRelations:p,loading:h}=e;const m=ge(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:f().text("Profile"),headCellRenderer:Te,rowCellValueRenderer:Se,sortable:!0,columnClassName:m.profileColumn},{id:"relationTypeLabel",label:f().text("Relationship type"),headCellRenderer:Te,rowCellValueRenderer:Oe,sortable:!0,columnClassName:m.relationshipTypeColumn},{id:"entityTypeLabel",label:f().text("Entity Type"),headCellRenderer:Te,rowCellValueRenderer:Oe,sortable:!0,columnClassName:m.entityTypeColumn},{id:"controls",label:"",headCellRenderer:Te,rowCellValueRenderer:Ue}]),[m]),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=b.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const y=(0,r.useMemo)((()=>t.map((e=>null!=p&&p.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?ze({},e,{expanded:!0}):e))),[t,p]),v=(0,r.useMemo)((()=>({tableRow:A()(m.row,"collapsibleTableRow")})),[m]);return o().createElement("div",{className:m.tableWithPagination},o().createElement("div",{className:m.tableContainer},o().createElement(de,{ref:b,columnsData:g,rowsData:y,sorting:n,onSort:i,getRowKey:Me,ExpandedRowRenderer:Le,defaultRowHeight:28,classes:v})),a>N[0]&&o().createElement(ne.Z,{count:a,rowsPerPageOptions:N,rowsPerPage:s,onChangeRowsPerPage:u,page:l,onChangePage:c,basicTableRef:b}),h&&o().createElement(d.Z,null))}));var qe=n(36444),Ge=n(94574);const He=(0,M.Z)((e=>({inactiveSearchIcon:{color:e.palette.text.secondary},activeSearchIcon:{color:e.palette.text.primary},input:{fontSize:"14px","&::placeholder":{color:`${e.palette.text.secondary} !important`,opacity:1}}}))),Ve=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=He();return o().createElement(Ge.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:f().text("Search profiles"),classes:{input:r.input}})}));var We=n(59725),Ye=n(32371);const $e=(0,M.Z)((e=>({dialogPaper:{display:"flex",flexDirection:"column",padding:"12px 16px 8px"},title:{marginBottom:"21px",fontWeight:500,fontSize:"20px",lineHeight:"23px",letterSpacing:"0.25px",color:e.palette.text.primary},entityTypesSelector:{width:"468px",marginBottom:"20px"},relationTypesSelector:{width:"468px",marginBottom:"32px"},footer:{display:"flex"},clearAllButton:{marginRight:"auto"},cancelButton:{marginRight:"8px"}}))),Xe=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=$e(),[u,d]=(0,r.useState)([]),[p,h]=(0,r.useState)([]),m=()=>{d(i.entityTypesUris),h(i.relationTypesUris),n()};return(0,r.useEffect)((()=>{d(i.entityTypesUris),h(i.relationTypesUris)}),[i.entityTypesUris,i.relationTypesUris]),o().createElement(B.Dialog,{classes:{paper:c.dialogPaper},onClose:m,open:t},o().createElement(B.Typography,{className:c.title},f().text("Filter")),o().createElement(We.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:u,enableEmptyValueUnderline:!0,onChange:d}),o().createElement(Ye.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:h}),o().createElement("div",{className:c.footer},o().createElement(B.Button,{className:c.clearAllButton,onClick:()=>{d([]),h([])}},f().text("Clear All")),o().createElement(B.Button,{className:c.cancelButton,onClick:m},f().text("Cancel")),o().createElement(B.Button,{onClick:()=>{a({entityTypesUris:u,relationTypesUris:p}),n()},color:"primary"},f().text("Apply"))))})),Ke=(0,M.Z)((e=>({wrapper:{display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"2px"},iconButton:{marginLeft:"4px"},activeFiltersIcon:{color:e.palette.primary.main},inactiveFiltersIcon:{color:e.palette.text.secondary}}))),Qe=(0,K.l)(_,(0,h.pipe)((0,h.prop)("relationshipTable"),(0,h.pick)(["filters"])),(e=>{let{filters:t}=e;const n=Ke(),[i,a]=(0,r.useState)(!1),{entityTypesUris:l,relationTypesUris:s}=t,c=l.length||s.length;return o().createElement("div",{className:n.wrapper},o().createElement(Ve,null),o().createElement(B.IconButton,{className:n.iconButton,onClick:()=>a(!0)},o().createElement(qe.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement(Xe,{open:i,onClose:()=>a(!1)}))}));var Je=n(65549),et=n(98808);const tt=e=>{const t=(0,i.useSelector)(u.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,m.UWq)(t,e,(0,m.d89)(m.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},nt=(0,M.Z)((e=>({dialogPaper:{height:"600px",maxWidth:"600px"},dialogTitle:{padding:"12px 16px"},titleText:{color:e.palette.text.primary,fontSize:"18px",letterSpacing:0,lineHeight:"21px",fontWeight:"bold"},content:{padding:"8px 16px 0px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),rt=(0,K.l)(_,(e=>{let{selectedEntity:t,onAddRelation:n}=e;return{selectedEntity:t,onAddRelation:n}}),(e=>{let{selectedEntity:t,open:n,onClose:a,onAddRelation:l}=e;const s=nt(),c=(0,i.useSelector)(u.ZP.selectors.getMetadata),[d,p]=(0,r.useState)({}),{relation:h,entity:g}=d,{type:b,direction:y}=h||{},[v,x]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&p({relation:{uri:(0,m.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=tt(t.type),T=(0,r.useCallback)((()=>{const e=(0,m.xkB)(c,{relation:{object:h}});return E(u.N5.errors.actions.errorsSet(e)),0===e.length}),[h,c,E]),{onAddAttributes:O,onChangeAttribute:R,onRemoveAttribute:S,onChangeEntity:P,onChangeRelationType:N}=(0,Pe.R)({connection:d,onConnectionChange:p,relatedEntity:t});return o().createElement(B.Dialog,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement(B.DialogTitle,{disableTypography:!0,classes:{root:s.dialogTitle}},o().createElement(B.Typography,{variant:"subtitle1",classes:{root:s.titleText}},f().text("Add relationship"))),o().createElement(B.DialogContent,{classes:{root:s.content}},o().createElement(Ne.n,{connection:d,onAddAttributes:O,onChangeAttribute:R,onRemoveAttribute:S,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:N,onChangeEntity:P})),o().createElement(B.DialogActions,null,o().createElement(B.Button,{onClick:a},f().text("Cancel")),o().createElement(B.Button,{disabled:!(null!=d&&d.entity)||!b||v,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=h,i=y===m.Nsj.OUT?t.uri:g.uri,s=y===m.Nsj.OUT?g.uri:t.uri;T()&&(x(!0),l({startEntityUri:i,endEntityUri:s,relationType:e,attributes:n,startDate:r,endDate:o}).then((()=>{a()})).catch((e=>{console.error(e)})).finally((()=>{x(!1)})))}},f().text("Add"))))})),ot=(0,K.l)(_,(0,h.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=tt(t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(et.K,{mode:et.N.button,label:f().text("Add relationship"),icon:Je.Z,onClick:()=>{s(!0)}}),o().createElement(rt,{open:l,onClose:()=>{s(!1)}}))})),it=(0,M.Z)({caption:{marginLeft:"16px",marginTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px",fontSize:"16px",lineHeight:"24px"},wrapper:{flex:1,display:"flex",flexDirection:"column",height:0}}),at=()=>{const e=it();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(B.Typography,{variant:"subtitle1"},f().text("Relationships")),o().createElement(ot,null)),o().createElement(Qe,null),o().createElement(Fe,null))};let lt;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(lt||(lt={}));const st=(0,r.memo)((()=>{var e;const t=Y(),[n,i]=(0,r.useState)(null),a=(0,r.useCallback)((e=>{i((t=>t===e?null:e))}),[]),l=null!==n,s=(0,r.useMemo)((()=>[{buttonProps:{id:lt.Relationship,icon:X,tooltipTitle:f().text("Relationship")},content:o().createElement(at,null)},{buttonProps:{id:lt.EntityDetails,icon:W.Z,tooltipTitle:f().text("Entity Details")},content:o().createElement(te,null)}]),[]);return o().createElement("div",{className:t.wrapper},o().createElement(H.h,{open:l,width:480},o().createElement(Q,null),null===(e=s[n])||void 0===e?void 0:e.content),o().createElement(V.G,{buttonsProps:(0,h.pluck)("buttonProps",s),onButtonClick:a,activeIndexId:n}))}));st.displayName="GraphRightSidePanel";const ct=st;var ut=n(46339),dt=n(23304),pt=n(64488),ht=n(46680),mt=n.n(ht);const gt=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=3,e.shadowColor="rgba(0,0,0,0.2)","string"==typeof t.label){const o=n.labelSize+2,i=2,a=e.measureText(t.label).width,l=Math.round(a+16),s=Math.round(o+4),c=Math.max(t.size,o/2)+2,u=t.y-s/2,d=t.y+s/2,p=t.x+(r?0:c),h=p+l+(r?c:0);e.beginPath(),e.moveTo(p,d-i),e.quadraticCurveTo(p,d,p+i,d),e.lineTo(h-i,d),e.quadraticCurveTo(h,d,h,d-i),e.lineTo(h,u+i),e.quadraticCurveTo(h,u,h-i,u),e.lineTo(p+i,u),e.quadraticCurveTo(p,u,p,u+i),e.closePath(),e.fill(),r&&(e.shadowOffsetX=-2,e.shadowOffsetY=0,e.beginPath(),e.arc(t.x,t.y,c,0,2*Math.PI),e.closePath(),e.fill())}else r&&(e.beginPath(),e.arc(t.x,t.y,t.size+2,0,2*Math.PI),e.closePath(),e.fill())},ft=function(e,t,n){var r;let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t.label)return;const i=n.labelSize,a=n.labelFont,l=n.labelWeight;o&&gt(e,t,n,!1),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,e.fillStyle=null!==(r=n.labelColor)&&void 0!==r&&r.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color,e.font=`${l} ${i}px ${a}`,e.fillText(t.label,t.x+t.size+11,t.y+i/3)},bt=(e,t,n)=>{gt(e,t,n,!0),ft(e,t,n,!1)};var yt=n(88586);class vt extends dt.AbstractNodeProgram{constructor(e){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n \n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}","\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\nvoid main(void) {\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(v_color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = v_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n",1,5),this.borderSize=void 0,this.borderSize=e.getAttribLocation(this.program,"a_borderSize"),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.borderSize),e.vertexAttribPointer(this.borderSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)}process(e,t,n){const r=this.array;let o=1*n*5;if(t||!e.inPath)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o]=e.highlighted?4:2}render(e){const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/5)}}class xt{constructor(){this.rebindTextureFns=[],this.images={},this.textureImage=void 0,this.hasReceivedImages=!1,this.pendingImagesFrameID=void 0,this.loadImage=(e,t)=>{if(this.images[e])return;const n=new Image;var r;n.addEventListener("load",(()=>{this.images[e]={status:"pending",image:n},"number"!=typeof this.pendingImagesFrameID&&(this.pendingImagesFrameID=requestAnimationFrame((()=>this.finalizePendingImages())))})),n.addEventListener("error",(()=>{this.images[e]={status:"error"}})),this.images[e]={status:"loading"},r=n,new URL(t,window.location.href).origin!==window.location.origin&&(r.crossOrigin=""),n.src=t},this.finalizePendingImages=()=>{this.pendingImagesFrameID=void 0;const e=[];for(const t in this.images){const n=this.images[t];"pending"===n.status&&e.push({id:t,image:n.image,size:Math.min(n.image.width,n.image.height)||1})}const t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.reduce(((e,t)=>{let{size:n}=t;return e+n}),this.hasReceivedImages?this.textureImage.width:0),t.height=Math.max(this.hasReceivedImages?this.textureImage.height:0,...e.map((e=>{let{size:t}=e;return t})));let r=0;this.hasReceivedImages&&(n.putImageData(this.textureImage,0,0),r=this.textureImage.width),e.forEach((e=>{let{id:t,image:o,size:i}=e;const a=Math.min(128,i);let l=0,s=0;(o.width||0)>(o.height||0)?l=(o.width-o.height)/2:s=(o.height-o.width)/2,n.drawImage(o,l,s,i,i,r,0,a,a),this.images[t]={status:"ready",x:r,y:0,width:a,height:a},r+=a})),this.textureImage=n.getImageData(0,0,t.width,t.height),this.hasReceivedImages=!0,this.rebindTextureFns.forEach((e=>e()))}}}const Et={id:"defaultImage",path:(0,m.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};class wt extends dt.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n// convert color to gray\nvec4 toGrayscale(in vec4 color)\n{\n float average = (color.r + color.g + color.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toGrayscale(color);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}",1,9),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.inactive=void 0,this.imageLoader=new xt,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.inactive=e.getAttribLocation(this.program,"a_inactive");const n=e.getUniformLocation(this.program,"u_atlas");if(null===n)throw new Error("NodeProgramImage: error while getting atlasLocation");this.atlasLocation=n,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),this.imageLoader.loadImage(Et.id,Et.path),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.textureLocation),e.enableVertexAttribArray(this.inactive),e.vertexAttribPointer(this.inactive,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20)}process(e,t,n){const r=this.array;let o=1*n*9;const i=e.image;let a=i&&this.imageLoader.images[i];if("string"!=typeof i||a||this.imageLoader.loadImage(i,i),t)return r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,void(r[o++]=0);if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[Et.id]),a&&"ready"===a.status){const{width:e,height:t}=this.imageLoader.textureImage;r[o++]=a.x/e,r[o++]=a.y/t,r[o++]=a.width/e,r[o++]=a.height/t}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1i(this.atlasLocation,0),t.drawArrays(t.POINTS,0,this.array.length/9)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}const Ct=[{id:"expandIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.80013 7.20003V4H7.20013L7.20013 7.20003H4V8.80003H7.20013L7.20013 12H8.80013V8.80003H12V7.20003H8.80013Z" fill="black" fill-opacity="0.541176"/>\n</svg>')},{id:"collapseIcon",path:(0,m.m5F)('<svg width="32" height="32" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="8" cy="8" r="8" fill="white"/>\n<circle cx="8" cy="8" r="7.5" stroke="black" stroke-opacity="0.541176"/>\n<path d="M4 7.20004H12V8.80004H4V7.20004Z" fill="black" fill-opacity="0.541176"/>\n</svg>\n')}];class Tt extends dt.AbstractNodeProgram{constructor(e,t){super(e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_buttonSize;\nattribute vec2 a_normals;\nattribute vec4 a_texture;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying float v_border;\nvarying vec4 v_texture;\nvarying vec4 v_color;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normals);\n vec2 unitNormal = (a_normals) / normalLength;\n\n float pixelsThickness = max(normalLength, 1.0 * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Move the point\n float adaptedWebGLNodeRadius = a_size * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n vec2 compensationVector = vec2(-unitNormal.y, unitNormal.x) * (adaptedWebGLNodeRadius);\n\n // Set position\n gl_Position = vec4((u_matrix * vec3(a_position + compensationVector, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_buttonSize * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n}","\nprecision mediump float;\n\nvarying float v_border;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color;\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(black, texel, texel.a).rgb, max(texel.a, bias));\n } else {\n color = black;\n }\n\n if (distToCenter < radius - v_border) // points inside button\n gl_FragColor = color;\n else if (distToCenter < radius) // border of button\n gl_FragColor = mix(transparent, color, (0.5 - distToCenter) / v_border);\n else // points outside button\n gl_FragColor = transparent;\n}",2,11),this.imageLoader=void 0,this.texture=void 0,this.textureLocation=void 0,this.buttonSize=void 0,this.normals=void 0,this.correctionRatioLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.atlasLocation=void 0,this.latestRenderParams=void 0,this.imageLoader=new xt,this.imageLoader.rebindTextureFns.push((()=>{this&&this.rebindTexture&&this.rebindTexture(),t&&t.refresh&&t.refresh()})),this.imageLoader.textureImage=new ImageData(1,1),this.textureLocation=e.getAttribLocation(this.program,"a_texture"),this.buttonSize=e.getAttribLocation(this.program,"a_buttonSize"),this.normals=e.getAttribLocation(this.program,"a_normals");const n=e.getUniformLocation(this.program,"u_correctionRatio");if(null===n)throw new Error("NodeButtonsProgram: error while getting correctionRatioLocation");this.correctionRatioLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("NodeButtonsProgram: error while getting sqrtZoomRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_atlas");if(null===o)throw new Error("NodeButtonsProgram: error while getting atlasLocation");this.atlasLocation=o,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),Ct.map((e=>this.imageLoader.loadImage(e.id,e.path))),this.bind()}bind(){super.bind();const e=this.gl;e.enableVertexAttribArray(this.buttonSize),e.enableVertexAttribArray(this.normals),e.enableVertexAttribArray(this.textureLocation),e.vertexAttribPointer(this.buttonSize,1,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.normals,2,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.textureLocation,4,e.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,28)}process(e,t,n){const r=this.array;let o=2*n*11;const i=t||e.inactive&&!e.highlighted,[a,l]=e.buttonOffset||[0,0];let s=a*a+l*l,c=0,u=0;if(s&&(s=1/Math.sqrt(s),c=l*s,u=a*s),i||!e.showExpand)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.expandIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}if(i||!e.showCollapse)r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0;else{const t=this.imageLoader.images.collapseIcon;if(r[o++]=e.x,r[o++]=e.y,r[o++]=e.size,r[o++]=(0,yt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-u,t&&"ready"===t.status){const{width:e,height:n}=this.imageLoader.textureImage;r[o++]=t.x/e,r[o++]=t.y/n,r[o++]=t.width/e,r[o++]=t.height/n}else r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0}}render(e){if(this.hasNothingToRender())return;this.latestRenderParams=e;const t=this.gl,n=this.program;t.useProgram(n),t.uniform1f(this.ratioLocation,1/Math.sqrt(e.ratio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.uniform1i(this.atlasLocation,1),t.drawArrays(t.POINTS,0,this.array.length/11)}rebindTexture(){const e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.imageLoader.textureImage),e.generateMipmap(e.TEXTURE_2D),this.latestRenderParams&&(this.bind(),this.bufferData(),this.render(this.latestRenderParams))}}var Ot=n(23193),Rt=n.n(Ot);class St extends(Rt()){process(e,t,n,r,o){if(r){for(let e=27*o,t=e+27;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size*i||1,l=t.size||1,s=e.x,c=e.y,u=t.x,d=t.y,p=(0,yt.floatColor)(n.color),h=u-s,m=d-c;let g=h*h+m*m,f=0,b=0;g&&(g=1/Math.sqrt(g),f=-m*g*a,b=h*g*a);let y=27*o;const v=this.array;v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=1,v[y++]=0,v[y++]=0,v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=1,v[y++]=0,v[y++]=u,v[y++]=d,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=0,v[y]=1}}class Pt extends St{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var Nt=n(73343),Lt=n.n(Nt);class jt extends pt.AbstractEdgeProgram{constructor(e){super(e,"\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}",Lt(),4,7),this.IndicesArray=void 0,this.indicesArray=void 0,this.indicesBuffer=void 0,this.indicesType=void 0,this.positionLocation=void 0,this.colorLocation=void 0,this.normalLocation=void 0,this.radiusLocation=void 0,this.arrowSizeRatioLocation=void 0,this.matrixLocation=void 0,this.sqrtZoomRatioLocation=void 0,this.correctionRatioLocation=void 0,this.canUse32BitsIndices=void 0;const t=e.createBuffer();if(null===t)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");this.indicesBuffer=t,this.positionLocation=e.getAttribLocation(this.program,"a_position"),this.colorLocation=e.getAttribLocation(this.program,"a_color"),this.normalLocation=e.getAttribLocation(this.program,"a_normal"),this.radiusLocation=e.getAttribLocation(this.program,"a_radius"),this.arrowSizeRatioLocation=e.getAttribLocation(this.program,"a_arrowSizeRatio");const n=e.getUniformLocation(this.program,"u_matrix");if(null===n)throw new Error("EdgeClampedProgram: error while getting matrixLocation");this.matrixLocation=n;const r=e.getUniformLocation(this.program,"u_sqrtZoomRatio");if(null===r)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");this.sqrtZoomRatioLocation=r;const o=e.getUniformLocation(this.program,"u_correctionRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");this.correctionRatioLocation=o,this.canUse32BitsIndices=(0,yt.canUse32BitsIndices)(e),this.IndicesArray=this.canUse32BitsIndices?Uint32Array:Uint16Array,this.indicesArray=new this.IndicesArray,this.indicesType=this.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,this.bind()}bind(){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.colorLocation),e.enableVertexAttribArray(this.radiusLocation),e.enableVertexAttribArray(this.arrowSizeRatioLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.colorLocation,4,e.UNSIGNED_BYTE,!0,7*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.radiusLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,20),e.vertexAttribPointer(this.arrowSizeRatioLocation,1,e.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,24)}process(e,t,n,r,o){if(r){for(let e=28*o,t=e+28;e<t;e++)this.array[e]=0;return}const i=n.arrowSizeRatio||1,a=n.size||1,l=e.x,s=e.y,c=t.x,u=t.y,d="doubleArrow"===n.type?e.size||1:0,p=t.size||1,h=(0,yt.floatColor)(n.color),m=c-l,g=u-s;let f=m*m+g*g,b=0,y=0;f&&(f=1/Math.sqrt(f),b=-g*f*a,y=m*f*a);let v=28*o;const x=this.array;x[v++]=l,x[v++]=s,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=-d,x[v++]=i,x[v++]=l,x[v++]=s,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=d,x[v++]=i,x[v++]=c,x[v++]=u,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=p,x[v++]=i,x[v++]=c,x[v++]=u,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=-p,x[v]=i}computeIndices(){const e=this.array.length/7,t=e+e/2,n=new this.IndicesArray(t);for(let t=0,r=0;t<e;t+=4)n[r++]=t,n[r++]=t+1,n[r++]=t+2,n[r++]=t+2,n[r++]=t+1,n[r++]=t+3;this.indicesArray=n}bufferData(){super.bufferData();const e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}render(e){if(this.hasNothingToRender())return;const t=this.gl,n=this.program;t.useProgram(n),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(e.ratio)),t.uniform1f(this.correctionRatioLocation,e.correctionRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}const kt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:bt,labelRenderer:ft,nodeProgramClasses:{image:(0,dt.createNodeCompoundProgram)([wt,vt,Tt])},edgeProgramClasses:{line:mt(),arrow:(0,pt.createEdgeCompoundProgram)([jt,St]),doubleArrow:(0,pt.createEdgeCompoundProgram)([jt,St,Pt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(ut.C6,{graph:p.MultiGraph,style:{background:"transparent"},initialSettings:n},t)};var _t=n(28833),It=n.n(_t),At=n(3660),Dt=n.n(At),Zt=n(28301),Ut=n.n(Zt),zt=n(30634),Bt=n(20562),Mt=n(31181),Ft=n(30284);const qt=(e,t,n,r,o,i,a)=>({aX:e+(r-e)*(n-a-i)/n,aY:t+(o-t)*(n-a-i)/n,vX:(r-e)*a/n,vY:(o-t)*a/n}),Gt=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*Ht,n-r*Ht),e.lineTo(t-o*Ht,n+r*Ht),e.lineTo(t+r,n+o),e.closePath(),e.fill()},Ht=.4,Vt=(e,t,n,r,o)=>{if(t.loop){const{size:r,color:o,arrowSizeRatio:i=1}=t,a=n.x,l=n.y,s=n.size,c=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x1:e-7*(n+r),y1:t,x2:e,y2:t+7*(n+r)}}(a,l,.6*s);if(e.strokeStyle=o,e.lineWidth=r,"arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const{aX:t,aY:n,vX:o,vY:u}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return qt(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);Gt(e,t,n,o,u),e.beginPath(),e.moveTo(t,n)}else e.beginPath(),e.moveTo(a,l);const{aX:n,aY:u,vX:d,vY:p}=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return qt(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);e.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n,u),e.stroke(),Gt(e,n,u,d,p)}else e.beginPath(),e.moveTo(a,l),e.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke()}(0,Ft.default)(e,t,n,r,o)};function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Yt(e,t,n[t])}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $t=(e,t,n,r,o)=>e>n-o&&e<n+o&&t>r-o&&t<r+o&&Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))<o,Xt=(0,h.memoizeWith)(((e,t,n)=>n.type),m.uie),Kt={size:24,buttonSize:8,buttonOffset:[19,19]},Qt={size:12,buttonSize:6,buttonOffset:[8,13]},Jt=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:p,onNodeExpand:h,filters:g}=e;const f=(0,ut.Ys)(),v=(0,ut.sG)(),x=(0,ut.$j)(),E=(0,ut.eP)(),w=(0,i.useSelector)(u.ZP.selectors.getEntity),C=(0,i.useSelector)(u.ZP.selectors.getMetadata),T=(0,i.useSelector)(u.ZP.selectors.getAbsoluteImagePath)||"",[O,R]=(0,r.useState)(void 0),[S,P]=(0,r.useState)(null),[N,L]=(0,r.useState)({});(0,r.useEffect)((()=>{f.getCamera().setState({ratio:1.2})}),[n,f]),(0,r.useEffect)((()=>{if(P((0,y.toUndirected)(n)),v(n),o){const e=o(f.getGraph(),l);(0,Mt.animateNodes)(f.getGraph(),e,{duration:1e3})}if(a){const e=new a(f.getGraph(),l);e.start();const t=setTimeout((()=>{e.stop()}),5e3);return()=>{clearTimeout(t),e.kill()}}}),[t,n,o,a,f,l,v,c]);const j=(0,r.useCallback)((e=>{const t=f.getGraph(),n=null==w?void 0:w.uri;if(t&&S&&n&&e&&n!==e)try{const r=(0,b.Ar)(S,n,e),o=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.reduce(((t,o)=>(n.push(e[r](t,o,(e=>!!e))),o))),n}(t,r);return r?{edges:o,nodes:r}:{}}catch(e){}return{}}),[f,null==w?void 0:w.uri,S]);(0,r.useEffect)((()=>{L(j(s))}),[s,j]),(0,r.useEffect)((()=>{x({enterNode:e=>{let{node:t}=e;R(t)},leaveNode:()=>{R(void 0)},clickNode:e=>{let{node:t}=e;d(t)},click:e=>{const t=(e=>{let{x:t,y:n}=e;const r=f.viewportToGraph({x:t,y:n}),o=f.getGraph(),i=o.nodes().map((e=>{const t=o.getNodeAttributes(e);return{nodeId:e,distance:Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2),hidden:t.hidden}})).sort(((e,t)=>e.distance-t.distance)).filter((e=>{let{hidden:t}=e;return!t}));return i.length>0?i[0].nodeId:null})(e);if(t){const n=f.getNodeDisplayData(t),r=f.framedGraphToViewport({x:n.x,y:n.y}),o=f.scaleSize(n.buttonOffset[0]),i=f.scaleSize(n.buttonOffset[1]),a=f.scaleSize(n.buttonSize),l=$t(e.x,e.y,r.x+o,r.y-i,a),s=$t(e.x,e.y,r.x+o,r.y+i,a);n.showExpand&&l&&(h(t),d(t)),n.showCollapse&&s&&(p(t,j(t)),d(t))}}})}),[f,x,d,p,h,j]),(0,r.useEffect)((()=>{const e=f.getGraph();let t;try{t=e.neighbors(s)}catch(e){}E({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=Xt(C,T,{type:r.entityTypeUri}),a=n===s?Kt:Qt,l=e.neighbors(n),c=l.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,u=Wt({},r,a,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||c>0,showCollapse:r.traversedRelationsCount>1&&l.length-c>1}),d=(N.nodes||[]).includes(n),p=O===n;return d||n===s||n===(null==w?void 0:w.uri)?(u.inPath=!0,n===(null==w?void 0:w.uri)&&(u.color="#00FFFF")):!t||t.includes(n)||s===n||s===(null==w?void 0:w.uri)||d||(p||(u.label=""),u.inactive=!0),p&&(u.highlighted=!0),![s,null==w?void 0:w.uri].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri)&&(u.hidden=!0),u},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=Wt({},n,{hidden:!1}),i=(N.edges||[]).includes(t);var a;return(s&&s!==(null==w?void 0:w.uri)&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri))&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,c&&(o.arrowSizeRatio=1.4)),o.type=(a=c?n.direction:m.MCv.undirected,{[m.MCv.bidirectional]:"doubleArrow",[m.MCv.directed]:"arrow",[m.MCv.undirected]:"line"}[a]||"line"),o},renderEdgeLabels:!0,edgeLabelRenderer:Vt})}),[f,E,O,s,N,null==w?void 0:w.uri,C,T,c,g])};let en;function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nn(e,t,n[t])}))}return e}function nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.SIMPLE_NETWORK="Simple network",e.VERTICAL_TB="Vertical hierarchy",e.HORIZONTAL_LR="Horizontal hierarchy",e.DIRECTED_NETWORK="Directed Network"}(en||(en={}));const rn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,zt.D)(t);(0,Bt.D)((()=>{if(u){const e=(0,h.difference)(t.entities.map((0,h.prop)("uri")),u.entities.map((0,h.prop)("uri")));if(e.length){const t=n.copy();It().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const d=(0,r.useMemo)((()=>(It().assign(n),{settings:tn({},Dt().inferSettings(n),{gravity:1})})),[n]);return Jt({workerLayout:Ut(),layoutSettings:d,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===en.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var on=n(36039);const an=(e,t,n,r)=>{const o=new Set;return t.length||t.push(Array.from(e)),e.forEach((t=>{n.add(t),r.forEach((r=>{r.from!==t||e.has(r.to)||n.has(r.to)||o.add(r.to)}))})),o.size&&t.push(Array.from(o)),((e,t,n)=>{const r=new Set;return e.forEach((e=>{t.forEach((t=>{t.from!==e||n.has(t.to)||r.add(t.to)}))})),!!r.size})(o,r,n)?an(o,t,n,r):t},ln=(e,t,n,r)=>{if(e.length<10&&(t[r]=[...e]),e.length>10){const o=e.slice(10),i=e.slice(0,10);t[r]=i,t[r+1]=n[r+1]?[...n[r+1],...o]:o}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return ln(e,t,n,r)}return t};function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case en.VERTICAL_TB:return 180;case en.HORIZONTAL_LR:return 270}})(i),r=((e,t)=>{const n=e.nodes,r=e.edges.filter((e=>e.from!==e.to)),o=((e,t,n)=>{const r=new Set;return t.forEach((t=>{e.some((e=>e.to===t.id))||r.add(t.id)})),r.size||r.add(n),r})(r,n,t),i=an(o,[],new Set,r);return ln(i[0],[],i,0)})((e=>{const t=e.nodes().map((e=>({id:e,name:""}))),n=e.mapEdges(((e,t,n,r)=>({from:n,to:r,key:e,relationTypeUri:t.relationTypeUri,direction:t.direction})));return{nodes:t,edges:n}})(t),o),a=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(r);for(let e=0;e<r.length;++e)for(let n=0;n<r[e].length;++n)t.setNodeAttribute(r[e][n],"x",(s=n,(l=r[e].length)===(c=a)?5*s:1===l?5*(c-1)/2:5*(c-1)/(l+1)*(s+1))),t.setNodeAttribute(r[e][n],"y",10*e);var l,s,c;return on.rotation.assign(t,n,{degrees:!0}),t.reduceNodes(((e,t,n)=>{let{x:r,y:o}=n;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sn(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return Jt({syncLayout:u,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var un=n(24737);const dn=(0,M.Z)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),pn=(0,K.l)(_,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=dn(),l=(0,i.useSelector)(u.ZP.selectors.getMetadata),s=(0,i.useSelector)(u.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:f().text("All"),value:null},...(0,m.mmY)(l,s.type).map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))]),[s,l]),d=(0,r.useMemo)((()=>c.find((e=>e.value===t))),[c,t]);return o().createElement(un.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:f().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),hn=(0,M.Z)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),mn=(0,r.memo)((e=>{let{value:t,onChangeHandler:n}=e;const r=hn(),i=[{label:f().text("Simple network"),value:en.SIMPLE_NETWORK},{label:f().text("Vertical hierarchy"),value:en.VERTICAL_TB},{label:f().text("Horizontal hierarchy"),value:en.HORIZONTAL_LR},{label:f().text("Directed network"),value:en.DIRECTED_NETWORK}];return o().createElement(un.Z,{className:r.graphLayoutSelector,label:f().text("Graph layout"),value:i.find((0,h.propEq)("value",t)),options:i,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:r.filledInputRoot}}}})})),gn=()=>{const e=(0,ut.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(re.Z,{handleWidth:!0,onResize:t})};var fn=n(17373);function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yn(e,t,n[t])}))}return e}function yn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vn="0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",xn={background:"#FFFFFF",boxShadow:vn,width:"28px",height:"28px"},En=(0,M.Z)({container:{display:"flex",alignItems:"center"},maxButton:bn({},xn,{borderRadius:"2px 4px 4px 2px"}),minButton:bn({},xn,{borderRadius:"4px 2px 2px 4px"}),thumb:{position:"absolute",boxShadow:vn,borderRadius:"2px",width:"8px",height:"28px",marginTop:"-13px",marginLeft:"1px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF",boxSizing:"border-box",outline:0,display:"flex",alignItems:"center",justifyContent:"center"},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px"},sliderRoot:{color:"#EDEDED",marginRight:"10px"}});function wn(){return wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wn.apply(this,arguments)}const Cn=e=>Math.pow(100/e,2),Tn=e=>100/Math.sqrt(e),On=e=>{const t=En(),n=(0,h.omit)(["className"],e);return o().createElement("div",wn({className:t.thumb},n),o().createElement(fn.Z,{className:A()(t.icon,t.thumbIcon)}))},Rn=e=>{let{className:t,max:n,min:i}=e;const a=En(),l=(0,ut.eP)(),s=(0,ut.$j)(),c=(0,ut.Ys)().getCamera(),{zoomIn:u,zoomOut:d}=(0,ut.AH)({factor:1.2}),[p,m]=(0,r.useState)((0,h.clamp)(i,n,Tn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?Cn(i):null),[i]),f=(0,r.useMemo)((()=>n>0?Cn(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:f}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,f,g]),(0,r.useEffect)((()=>{s({cameraUpdated:e=>m(Tn(e.ratio))})}),[s]),o().createElement("div",{className:A()(a.container,t)},o().createElement(B.IconButton,{className:a.minButton,onClick:()=>d()},o().createElement(fn.Z,{className:a.icon})),o().createElement(B.Slider,{ThumbComponent:On,classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:p,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(Cn(t))})}),o().createElement(B.IconButton,{className:a.maxButton,onClick:()=>u()},o().createElement(Je.Z,{className:a.icon})))};var Sn=n(25156);const Pn=(0,M.Z)({button:{background:"#FFFFFF",boxShadow:"0 1px 1px rgba(0,0,0,0.14), 0 2px 1px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.2)",width:"28px",height:"28px",borderRadius:"4px"},icon:{width:"18px",height:"18px"}}),Nn=e=>{let{node:t}=e;const n=Pn(),{gotoNode:r}=(0,ut.AH)();return o().createElement(B.IconButton,{className:n.button,onClick:()=>r(t)},o().createElement(Sn.Z,{className:n.icon}))},Ln=(0,M.Z)({wrapper:{height:"100%",position:"relative"},selectors:{display:"flex",position:"absolute",top:"12px",right:"16px",zIndex:2},graph:{height:"calc(100% - 5px)"},rightBottomControls:{position:"absolute",zIndex:100,right:"18px",bottom:"16px",display:"flex",width:"200px"},zoomSlider:{flexGrow:1,marginRight:"8px"}}),jn=(0,K.l)(_,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l}}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l}}),(e=>{let{data:t,graph:n,selectedNode:i,onNodeSelect:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const u=Ln(),[d,p]=(0,r.useState)(en.SIMPLE_NETWORK),h={data:t,graph:n,selectedNode:i,layout:d,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c};return o().createElement("div",{className:u.wrapper},o().createElement("div",{className:u.selectors},o().createElement(pn,null),o().createElement(mn,{value:d,onChangeHandler:p})),o().createElement("div",{className:u.graph},n&&o().createElement(kt,null,o().createElement(o().Fragment,null,o().createElement(gn,null),d===en.SIMPLE_NETWORK||d===en.DIRECTED_NETWORK?o().createElement(rn,h):o().createElement(cn,h),o().createElement("div",{className:u.rightBottomControls},o().createElement(Rn,{className:u.zoomSlider,min:30,max:300}),o().createElement(Nn,{node:i}))))))})),kn=(0,M.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},graphWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1},graphContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}}))),_n=(0,r.memo)((()=>{const e=kn(),t=(0,i.useSelector)(u.ZP.selectors.getEntity),n=(e=>{const{graphLoading:t,data:n,graphologyGraph:o,graphTypeUri:a,setGraphTypeUri:l,onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p}=R(e),{selectedEntity:g,onEntitySelect:b,selectedEntityLoading:y}=((e,t)=>{const n=(0,O._)(),o=(0,i.useDispatch)(),[a,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),p=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,m.HvW)(e).then((e=>(s.current=P(s.current,e),e)))}),[]),g=(0,r.useCallback)((e=>{var r;const i=null==t||null===(r=t.entities)||void 0===r?void 0:r.find((0,h.propEq)("uri",e));i&&l(i),d(!0),n(p(e)).then(l).catch((e=>{o(u.ui.actions.errorSet((0,m.xU7)(e,f().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,p]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=P({},e),g(e.uri))}),[null==e?void 0:e.uri]),(0,r.useEffect)((()=>{const n=null==t?void 0:t.entities.find((e=>(null==a?void 0:a.uri)===e.uri));n||(null!=e&&e.uri?(s.current=P({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,n);return{graphLoading:t,data:n,graphologyGraph:o,selectedEntity:g,selectedEntityLoading:y,graphTypeUri:a,relationshipTable:k({data:n,selectedEntityUri:null==g?void 0:g.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:a}),onAddRelation:s,onDeleteRelation:c,onCollapseEntity:d,onExpandEntity:p,onEntitySelect:b,setGraphTypeUri:l}})(t),{graphLoading:a}=n;return o().createElement(_.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},a&&o().createElement(d.Z,null),(null==t?void 0:t.uri)&&o().createElement("div",{className:e.graphContainer},o().createElement("div",{className:e.graphWrapper},o().createElement(G,null),o().createElement(jn,null)),o().createElement(ct,null))))}));_n.displayName="GraphPerspectiveView";const In=_n,An=(0,a.createGenerateClassName)({productionPrefix:"graph",disableGlobal:!0}),Dn=e=>{let{store:t}=e;return o().createElement(i.Provider,{store:t},o().createElement(a.StylesProvider,{generateClassName:An},o().createElement(s.MuiPickersUtilsProvider,{utils:c.Z},o().createElement(In,null),o().createElement(l.Z,{showErrorFromStore:!0}))))}}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/remotes",
3
- "version": "1.4.1165",
3
+ "version": "1.4.1167",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "main.js",
6
6
  "publishConfig": {